• ✨ ARCHIVE MODE ✨
    The forum has now been set to read-only mode, no new posts, resources, replies etc will not be possible.
    We recommend you join our Discord server to get real-time response: Discord Invite Link

Need help with scripting

Zottelchen

Trainer
Hi,
I want to create a custom gamemode. For this gamemode I need a faster daycare. How do I do this?
I figured out this (but it doesn't work):
Code:
version=2
    @text.show(I'm the EggMan.*I create Eggs. ~What do you want to~do today?)
    @options.show(EGG,NOEGG)
    :when:EGG
            @Storage.set(boolean,daycare.hasegg(0),1)
            @text.show(DONE!)
        :endif
    :when:NOEGG
        @text.show(AWW :()
    :endwhen
:end
Any ideas?
 

nilllzz

Original Developer
Administrator
P3D Developer
Code:
version=2
@text.show(I'm the EggMan.*I create Eggs. ~What do you want to~do today?)
@options.show(EGG,NOEGG) 
:when:EGG 
@Storage.set(boolean,daycarehasegg0,<daycare.hasegg(0)>) 
@text.show(DONE!) 
:when:NOEGG 
@text.show(AWW :() 
:endwhen
:end
This should work. I am not sure what you want to achieve with the storage though...
 

Zottelchen

Trainer
I thought that way I can trigger the take_egg script (which I just copied)...

Code:
version=2
    @daycare.clean(0)

    :if:<register.registered(oddegg_got)>=false
    :then
        @script.start(route34\daycare\odd_egg)
    :else
        :if:<daycare.hasegg(0)>=true
        :then
            @script.start(route34\daycare\take_egg)
            :end
        :endif

        @text.show(I'm the Day-Care Man.*We can raise [POKE]MON~for you.~What do you want to~do today?)
[...shortened...]
 

nilllzz

Original Developer
Administrator
P3D Developer
The
Code:
<daycare.hasegg(0)>
tells you if the daycare has an egg ready. You can't set that value though.
 

Zottelchen

Trainer
Can someone explain to me why this doesn`t work?
Code:
        :if:<pokemon.count><6
        :then
            @Text.show(Enter a Pokedex number!)
            @screen.input(<System.random(1,729)>,1,Pokedex-Number,3)
            @Storage.set(integer,pokenum,<System.lastinput>)
            @Text.show(Enter a Level!)
            @screen.input(<System.random(1,100)>,1,Level,3)
            @Storage.set(integer,pokelevel,<System.lastinput>)
            @Text.show(What is your catch method?)
            @options.show(Default,Custom)
            :when:Default
                @Storage.set(string,pokecatchm,random reason)
            :when:Custom
                @screen.input(random reason,0,Catchmethod,16)
                @Storage.set(string,pokecatchm,<System.lastinput>)
            :endwhen
            @Text.show(What is your catch ball?)
            @options.show(Default/Master Ball,Ultra Ball,Great Ball,Poke Ball,Friend Ball,Moon Ball,Love Ball,Premier Ball)
            :when:Default/Master Ball
                @Storage.set(integer,pokecatchb,1)
            :when:Ultra Ball
                @Storage.set(integer,pokecatchb,2)
            :when:Great Ball
                @Storage.set(integer,pokecatchb,4)
            :when:Poke Ball
                @Storage.set(integer,pokecatchb,5)
            :when:Friend Ball
                @Storage.set(integer,pokecatchb,164)
            :when:Moon Ball
                @Storage.set(integer,pokecatchb,165)
            :when:Love Ball
                @Storage.set(integer,pokecatchb,166)
            :when:Premier Ball
                @Storage.set(integer,pokecatchb,3)
            :endwhen
            @Text.show(Enter a Catchlocation!)
            @screen.input(the world that never was,0,Catch Location,16)
            @Storage.set(string,pokecatchl,<System.lastinput>)
            @Text.show(Is it an egg?)
            @options.show(Yes,No)
            :when:Yes
                @Storage.set(boolean,pokeisegg,1)
            :when:No
                @Storage.set(boolean,pokeisegg,0)
            :endwhen
            @Text.show(The pokemon was catched by ...)
            @options.show(Default/myself,Custom)
            :when:default/myself
                @Storage.set(string,pokecatcher,<player.name>)
            :when:Custom
                @screen.input(Lance,0,Playername,16)
                @Storage.set(string,pokecatcher,<System.lastinput>)
            :endwhen
            @Pokemon.add(<Storage.get(integer,pokenum)>,<Storage.get(integer,pokelevel)>,<Storage.get(string,pokecatchm)>,<Storage.get(integer,pokecatchb)>,<Storage.get(string,pokecatchl)>,<Storage.get(boolean,pokeisegg)>,<Storage.get(string,pokecatcher)>)
            @Pokemon.cry(<Storage.get(integer,pokenum)>)
            :endscript
          
        :else
            @text.show(You have no room~right now.*Come back when you've~made room.)
        :endif
        :endscript
The Error
Code:
Kolben Games Crash Log V 1.2
Pokémon 3D has crashed!
---------------------------

System specifications:
Pokémon 3D version: 0.43.3
Operating system: Microsoft Windows 8.1 [6.2.9200.0]
System time: 21.01.2014 21:03:06
System language: German (Germany)(DEU) / Loaded game language: en
Decimal seperator: ,
Content Packs: {BlueUI, HGSS Music Pack}
Active GameMode: Pokemon 3D
GameJolt Account: TRUE (62804)
Playing on Servers: FALSE
Game environment: OverworldScreen
Actionscript: No script running
---------------------------

Here is further information:
Message: Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Auflistung sein.
Parametername: index
InnerException: NOTHING
BaseException: Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Auflistung sein.
Parametername: index
HelpLink: No helplink available.
Data: Items: 0
Source: mscorlib
TargetSite: Name: ThrowArgumentOutOfRangeException [
  Attributes: PrivateScope, Assembly, Static, HideBySig
  CallingConvention: Standard
  ContainsGenericParameters: False
  DeclaringType: System.ThrowHelper
  IsAbstract: False
  IsAssembly: True
  IsConstructor: False
  IsFamily: False
  IsFamilyAndAssembly: False
  IsFamilyOrAssembly: False
  IsFinal: False
  IsGenericMethod: False
  IsGenericMethodDefinition: False
  IsHideBySig: True
  IsPrivate: False
  IsPublic: False
  IsSecurityCritical: False
  IsSecuritySafeCritical: False
  IsSecurityTransparent: True
  IsSpecialName: False
  IsStatic: True
  IsVirtual: False
  MemberType: Method
  MetadataToken: 100663888
  MethodHandle: System.RuntimeMethodHandle
  Module: CommonLanguageRuntimeLibrary
  ReflectedType: System.ThrowHelper
  ]

CallStack:    bei System.ThrowHelper.ThrowArgumentOutOfRangeException()
  bei System.Collections.Generic.List`1.get_Item(Int32 index)
  bei _2._5DHero.ActionScript.Switch(Object Answer)
  bei _2._5DHero.ChooseBox.Update(Boolean RaiseClickEvent)
  bei _2._5DHero.ChooseBox.Update()
  bei _2._5DHero.OverworldScreen.Update()
  bei _2._5DHero.Basic.Update(GameTime gameTime)
  bei _2._5DHero.DGame.Update(GameTime gameTime)
  bei Microsoft.Xna.Framework.Game.Tick()
  bei Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
  bei Microsoft.Xna.Framework.GameHost.OnIdle()
  bei Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
  bei Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
  bei System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
  bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
  bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
  bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
  bei System.Windows.Forms.Application.Run(Form mainForm)
  bei Microsoft.Xna.Framework.WindowsGameHost.Run()
  bei Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
  bei Microsoft.Xna.Framework.Game.Run()
  bei _2._5DHero.Program.Main(String[] args)

You should report this error.

Go to "http://pokemon3d.net/forum/forums/6/create-thread" to report this crash there.
 

Enethil

Community Support & Suggestions/Feedback Moderator
Donator
Trusted Support
Retired Mod
I believe that
":if:<pokemon.count><6" needs that extra ">" in the end to work
 

Zottelchen

Trainer
I copied that part from take_egg (daycare):

Code:
        :if:<pokemon.count><6
        :then
            @text.show(<player.name> received~the Egg from the~Day-Care Man.)
            @daycare.takeegg(0)
            @text.show(Please take good~care of it!)
        :else
            @text.show(You have no room~right now.*Come back when you've~made room.)
        :endif
 

Enethil

Community Support & Suggestions/Feedback Moderator
Donator
Trusted Support
Retired Mod
Well, I am no expert on the script, just started learning it myself, but why would you need a way to change the information about pokemon? If I weren't so trusting, I would beleieve you were trying to make hacking pokemon look legit or something.
 

nilllzz

Original Developer
Administrator
P3D Developer
I broke it down to this:
Code:
version=2
:if:<pokemon.count><6
        :then
            @Text.show(What is your catch method?)
            @options.show(Default,Custom)
            :when:Default
                @Storage.set(string,pokecatchm,random reason)
            :when:Custom
                @screen.input(random reason,0,Catchmethod,16)
                @Storage.set(string,pokecatchm,<System.lastinput>)
            :endwhen
            @Text.show(What is your catch ball?)
            @options.show(Default/Master Ball,Ultra Ball,Great Ball,Poke Ball,Friend Ball,Moon Ball,Love Ball,Premier Ball)
            :when:Default/Master Ball
                @Storage.set(integer,pokecatchb,1)
            :when:Ultra Ball
                @Storage.set(integer,pokecatchb,2)
            :when:Great Ball
                @Storage.set(integer,pokecatchb,4)
            :when:Poke Ball
                @Storage.set(integer,pokecatchb,5)
            :when:Friend Ball
                @Storage.set(integer,pokecatchb,164)
            :when:Moon Ball
                @Storage.set(integer,pokecatchb,165)
            :when:Love Ball
                @Storage.set(integer,pokecatchb,166)
            :when:Premier Ball
                @Storage.set(integer,pokecatchb,3)
            :endwhen
            @Text.show(Enter a Catchlocation!)
            @options.show(Yes,No)
            :when:Yes
                @Storage.set(boolean,pokeisegg,1)
            :when:No
                @Storage.set(boolean,pokeisegg,0)
            :endwhen
            @Text.show(The pokemon was catched by ...)
            @options.show(Default/myself,Custom)
            :when:default/myself
                @Storage.set(string,pokecatcher,<player.name>)
            :when:Custom
                @screen.input(Lance,0,Playername,16)
                @Storage.set(string,pokecatcher,<System.lastinput>)
            :endwhen
        :else
            @text.show(You have no room~right now.*Come back when you've~made room.)
        :endif
:end
Basically all I did though is removing the :endscript and adding an :end at the end of the script.
 

Zottelchen

Trainer
But there are some other things missing:
Code:
@Pokemon.add(<Storage.get(integer,pokenum)>,<Storage.get(integer,pokelevel)>,<Storage.get(string,pokecatchm)>,<Storage.get(integer,pokecatchb)>,<Storage.get(string,pokecatchl)>,<Storage.get(boolean,pokeisegg)>,<Storage.get(string,pokecatcher)>)
            @Pokemon.cry(<Storage.get(integer,pokenum)>)
Code:
    @Text.show(Enter a Pokedex number!)
            @screen.input(<System.random(1,729)>,1,Pokedex-Number,3)
            @Storage.set(integer,pokenum,<System.lastinput>)
            @Text.show(Enter a Level!)
            @screen.input(<System.random(1,100)>,1,Level,3)
            @Storage.set(integer,pokelevel,<System.lastinput>)
I have readded them and now I've got another error.
Code:
Kolben Games Crash Log V 1.2
Pokémon 3D has crashed!
---------------------------

System specifications:
Pokémon 3D version: 0.43.3
Operating system: Microsoft Windows 8.1 [6.2.9200.0]
System time: 21.01.2014 21:09:01
System language: German (Germany)(DEU) / Loaded game language: en
Decimal seperator: ,
Content Packs: {BlueUI, HGSS Music Pack}
Active GameMode: Pokemon 3D
GameJolt Account: TRUE (62804)
Playing on Servers: FALSE
Game environment: OverworldScreen
Actionscript: No script running
---------------------------

Here is further information:
Message: Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Auflistung sein.
Parametername: index
InnerException: NOTHING
BaseException: Der Index lag außerhalb des Bereichs. Er darf nicht negativ und kleiner als die Auflistung sein.
Parametername: index
HelpLink: No helplink available.
Data: Items: 0
Source: mscorlib
TargetSite: Name: ThrowArgumentOutOfRangeException [
  Attributes: PrivateScope, Assembly, Static, HideBySig
  CallingConvention: Standard
  ContainsGenericParameters: False
  DeclaringType: System.ThrowHelper
  IsAbstract: False
  IsAssembly: True
  IsConstructor: False
  IsFamily: False
  IsFamilyAndAssembly: False
  IsFamilyOrAssembly: False
  IsFinal: False
  IsGenericMethod: False
  IsGenericMethodDefinition: False
  IsHideBySig: True
  IsPrivate: False
  IsPublic: False
  IsSecurityCritical: False
  IsSecuritySafeCritical: False
  IsSecurityTransparent: True
  IsSpecialName: False
  IsStatic: True
  IsVirtual: False
  MemberType: Method
  MetadataToken: 100663888
  MethodHandle: System.RuntimeMethodHandle
  Module: CommonLanguageRuntimeLibrary
  ReflectedType: System.ThrowHelper
  ]

CallStack:    bei System.ThrowHelper.ThrowArgumentOutOfRangeException()
  bei System.Collections.Generic.List`1.get_Item(Int32 index)
  bei _2._5DHero.ActionScript.Switch(Object Answer)
  bei _2._5DHero.ScriptV2.Update()
  bei _2._5DHero.Script.Update()
  bei _2._5DHero.ActionScript.Update()
  bei _2._5DHero.OverworldScreen.Update()
  bei _2._5DHero.Basic.Update(GameTime gameTime)
  bei _2._5DHero.DGame.Update(GameTime gameTime)
  bei Microsoft.Xna.Framework.Game.Tick()
  bei Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
  bei Microsoft.Xna.Framework.GameHost.OnIdle()
  bei Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
  bei Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
  bei System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
  bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
  bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
  bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
  bei System.Windows.Forms.Application.Run(Form mainForm)
  bei Microsoft.Xna.Framework.WindowsGameHost.Run()
  bei Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
  bei Microsoft.Xna.Framework.Game.Run()
  bei _2._5DHero.Program.Main(String[] args)

You should report this error.

Go to "http://pokemon3d.net/forum/forums/6/create-thread" to report this crash there.
 

Zottelchen

Trainer
nillz the inputscreens were working all the time^^
but i found the error - I am too dumb to write, the scripts are casesensitive.

@Text.show(The pokemon was catched by ...)
@options.show(Default/myself,Custom)
:when:default/myself
 
Top