Difference between revisions of "Version 2 Scripts New"
Jianmingyong (talk | contribs) m |
Jianmingyong (talk | contribs) m |
||
| Line 308: | Line 308: | ||
=== @Register === | === @Register === | ||
{{ScriptCommandTableV2|Command| | {{ScriptCommandTableV2|Command| | ||
{{ScriptCommandV2|register|register||||False}} | {{ScriptCommandV2|Register|register|{{ScriptArgumentV2|name|Str|1|False||}} OR {{ScriptArgumentV2|name|Str|1|False||}},{{ScriptArgumentV2|type|Str|2|False||}},{{ScriptArgumentV2|value|Str|3|False||}}|Registers a new register with the given name, type and value. Valid arguments for "type": str,int,sng,bool|{{ScriptArgumentV2|name|Str|1|False||Input}}<br />{{ScriptArgumentV2|type|Str|2|False||Input}}<br />{{ScriptArgumentV2|value|Str|3|False||Input}}|False}} | ||
{{ | |||
{{ScriptCommandV2| | {{ScriptCommandV2|Register|unregister|{{ScriptArgumentV2|name|Str|1|False||}} OR {{ScriptArgumentV2|name|Str|1|False||}},{{ScriptArgumentV2|type|Str|2|False||}}|Unregisters a register with the given name and type that has a value. Valid arguments for "type": str,int,sng,bool|{{ScriptArgumentV2|name|Str|1|False||Input}}<br />{{ScriptArgumentV2|type|Str|2|False||Input}}|False}} | ||
{{ | |||
{{ScriptCommandV2|register| | {{ScriptCommandV2|Register|registertime|{{ScriptArgumentV2|name|Str|1|False||}},{{ScriptArgumentV2|time|Int|1|False||}},{{ScriptArgumentV2|timeFormat|Str|2|False||}}|Registers a time based register. Valid arguments for "timeFormat": days,hours,minutes,seconds,years,weeks,months,dayofweek|{{ScriptArgumentV2|name|Str|1|False||Input}}<br />{{ScriptArgumentV2|time|Int|1|False||Input}}<br />{{ScriptArgumentV2|timeFormat|Str|2|False||Input}}|False}} | ||
}} | }} | ||
| Line 319: | Line 319: | ||
{{ScriptCommandTableV2|Command| | {{ScriptCommandTableV2|Command| | ||
{{ScriptCommandV2|Screen|storagesystem||Opens the storage system.||False}} | {{ScriptCommandV2|Screen|storagesystem||Opens the storage system.||False}} | ||
{{ScriptCommandV2|Screen|apricornkurt||Opens the Apricorn Screen.||False}} | {{ScriptCommandV2|Screen|apricornkurt||Opens the Apricorn Screen.||False}} | ||
{{ScriptCommandV2|Screen|trade|{{ScriptArgumentV2|tradeItems|ItemCollection|1|False||}},{{ScriptArgumentV2|canBuy|Bool|1|False||}},{{ScriptArgumentV2|canSell|Bool|2|False||}}|Opens a new trade screen with the given items in stock.|{{ScriptArgumentV2|tradeItems|ItemCollection|1|False||Input}}<br />{{ScriptArgumentV2|canBuy|Bool|1|False||Input}}<br />{{ScriptArgumentV2|canSell|Bool|2|False||Input}}|False}} | |||
{{ScriptCommandV2|Screen|trade|{{ScriptArgumentV2|tradeItems|ItemCollection|1|False||}},{{ScriptArgumentV2|canBuy|Bool|1|False||}}, | |||
{{ScriptArgumentV2|canSell|Bool|2|False||}}|Opens a new trade screen with the given items in stock.|{{ScriptArgumentV2|tradeItems|ItemCollection|1|False||Input}}<br />{{ScriptArgumentV2|canBuy|Bool|1|False||Input}}<br />{{ScriptArgumentV2|canSell|Bool|2|False||Input}}|False}} | |||
{{ScriptCommandV2|Screen|townmap|{{ScriptArgumentV2|regionList|StrArr|1|False||}}|Opens the map screen with the given regions.|{{ScriptArgumentV2|regionList|StrArr|1|False||Input}}|False}} | {{ScriptCommandV2|Screen|townmap|{{ScriptArgumentV2|regionList|StrArr|1|False||}}|Opens the map screen with the given regions.|{{ScriptArgumentV2|regionList|StrArr|1|False||Input}}|False}} | ||
{{ScriptCommandV2|Screen|donation||Opens the donation screen.||False}} | {{ScriptCommandV2|Screen|donation||Opens the donation screen.||False}} | ||
{{ScriptCommandV2|Screen|blackout||Opens the blackout screen and warps the player back to the last saveplace.||False}} | {{ScriptCommandV2|Screen|blackout||Opens the blackout screen and warps the player back to the last saveplace.||False}} | ||
{{ScriptCommandV2|Screen|fadein|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|}}|Fades the screen back in.|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|Input}}|False}} | {{ScriptCommandV2|Screen|fadein|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|}}|Fades the screen back in.|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|Input}}|False}} | ||
{{ScriptCommandV2|Screen|fadeout|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|}}|Fades the screen to black.|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|Input}}|False}} | {{ScriptCommandV2|Screen|fadeout|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|}}|Fades the screen to black.|{{ScriptArgumentV2|fadeSpeed|Int|1|True|5|Input}}|False}} | ||
{{ScriptCommandV2|Screen|credits|{{ScriptArgumentV2|ending|Str|1|True|Johto|}}|Displays a credits scene.|{{ScriptArgumentV2|ending|Str|1|True|Johto|Input}}|False}} | {{ScriptCommandV2|Screen|credits|{{ScriptArgumentV2|ending|Str|1|True|Johto|}}|Displays a credits scene.|{{ScriptArgumentV2|ending|Str|1|True|Johto|Input}}|False}} | ||
{{ScriptCommandV2|Screen|halloffame|{{ScriptArgumentV2|displayEntryIndex|Int|1|True||}}|Displays the Hall of Fame. If the argument "displayEntryIndex" is not empty, it displays only that entry.|{{ScriptArgumentV2|displayEntryIndex|Int|1|True||Input}}|False}} | {{ScriptCommandV2|Screen|halloffame|{{ScriptArgumentV2|displayEntryIndex|Int|1|True||}}|Displays the Hall of Fame. If the argument "displayEntryIndex" is not empty, it displays only that entry.|{{ScriptArgumentV2|displayEntryIndex|Int|1|True||Input}}|False}} | ||
{{ScriptCommandV2|Screen|teachmoves|{{ScriptArgumentV2|pokemonIndex|Int|1|False||}},{{ScriptArgumentV2|moveIDs|IntArr|1|True||}}|Displays a move learn screen. If the argument "moveIDs" is left empty, it defaults to the Pokémon's tutor moves.|{{ScriptArgumentV2|pokemonIndex|Int|1|False||Input}}<br />{{ScriptArgumentV2|moveIDs|IntArr|1|True||Input}}|False}} | {{ScriptCommandV2|Screen|teachmoves|{{ScriptArgumentV2|pokemonIndex|Int|1|False||}},{{ScriptArgumentV2|moveIDs|IntArr|1|True||}}|Displays a move learn screen. If the argument "moveIDs" is left empty, it defaults to the Pokémon's tutor moves.|{{ScriptArgumentV2|pokemonIndex|Int|1|False||Input}}<br />{{ScriptArgumentV2|moveIDs|IntArr|1|True||Input}}|False}} | ||
{{ScriptCommandV2|Screen|mailsystem||Opens the PC Inbox screen.||False}} | {{ScriptCommandV2|Screen|mailsystem||Opens the PC Inbox screen.||False}} | ||
{{ScriptCommandV2|Screen|pvp||Opens the PVP lobby screen.||False}} | {{ScriptCommandV2|Screen|pvp||Opens the PVP lobby screen.||False}} | ||
{{ScriptCommandV2|Screen|input|{{ScriptArgumentV2|defaultName|Str|1|True||}},{{ScriptArgumentV2|inputMode|Str|2|True|0|}},{{ScriptArgumentV2|currentText|Str|3|True||}},{{ScriptArgumentV2|maxChars|Int|1|True|14|}}|Displays the Input screen. The input can be retrieved with <system.lastinput>. Valid arguments for "inputMode:" 0-2,name,text,numbers|{{ScriptArgumentV2|defaultName|Str|1|True||Input}}<br />{{ScriptArgumentV2|inputMode|Str|2|True|0|Input}}<br />{{ScriptArgumentV2|currentText|Str|3|True||Input}}<br />{{ScriptArgumentV2|maxChars|Int|1|True|14|Input}}|False}} | {{ScriptCommandV2|Screen|input|{{ScriptArgumentV2|defaultName|Str|1|True||}},{{ScriptArgumentV2|inputMode|Str|2|True|0|}},{{ScriptArgumentV2|currentText|Str|3|True||}},{{ScriptArgumentV2|maxChars|Int|1|True|14|}}|Displays the Input screen. The input can be retrieved with <system.lastinput>. Valid arguments for "inputMode:" 0-2,name,text,numbers|{{ScriptArgumentV2|defaultName|Str|1|True||Input}}<br />{{ScriptArgumentV2|inputMode|Str|2|True|0|Input}}<br />{{ScriptArgumentV2|currentText|Str|3|True||Input}}<br />{{ScriptArgumentV2|maxChars|Int|1|True|14|Input}}|False}} | ||
{{ScriptCommandV2|Screen|mysteryevent||Opens the Mystery Event screen.||False}} | {{ScriptCommandV2|Screen|mysteryevent||Opens the Mystery Event screen.||False}} | ||
{{ScriptCommandV2|Screen|showPokemon||||False}} | {{ScriptCommandV2|Screen|showPokemon||||False}} | ||
}} | }} | ||
| Line 340: | Line 356: | ||
{{ScriptCommandTableV2|Command| | {{ScriptCommandTableV2|Command| | ||
{{ScriptCommandV2|Script|start|{{ScriptArgumentV2|scriptFile|Str|1|False||}}|Starts a script with the given filename (without file extension).|{{ScriptArgumentV2|scriptFile|Str|1|False||Input}}|False}} | {{ScriptCommandV2|Script|start|{{ScriptArgumentV2|scriptFile|Str|1|False||}}|Starts a script with the given filename (without file extension).|{{ScriptArgumentV2|scriptFile|Str|1|False||Input}}|False}} | ||
{{ScriptCommandV2|Script|text|{{ScriptArgumentV2|text|Str|1|False||}}|Starts a script with a simple text to display.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | {{ScriptCommandV2|Script|text|{{ScriptArgumentV2|text|Str|1|False||}}|Starts a script with a simple text to display.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | ||
{{ScriptCommandV2|Script|run|{{ScriptArgumentV2|scriptContent|Str|1|False||}}|Runs script content. New lines are represented with "^".|{{ScriptArgumentV2|scriptContent|Str|1|False||Input}}|False}} | {{ScriptCommandV2|Script|run|{{ScriptArgumentV2|scriptContent|Str|1|False||}}|Runs script content. New lines are represented with "^".|{{ScriptArgumentV2|scriptContent|Str|1|False||Input}}|False}} | ||
}} | }} | ||
| Line 348: | Line 366: | ||
{{ScriptCommandTableV2|Command| | {{ScriptCommandTableV2|Command| | ||
{{ScriptCommandV2|Sound|play|{{ScriptArgumentV2|soundFile|Str|1|False||}},{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|True|false|}}|Plays a sound.|{{ScriptArgumentV2|soundFile|Str|1|False||Input}}<br />{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|True|false|Input}}|False}} | {{ScriptCommandV2|Sound|play|{{ScriptArgumentV2|soundFile|Str|1|False||}},{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|True|false|}}|Plays a sound.|{{ScriptArgumentV2|soundFile|Str|1|False||Input}}<br />{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|True|false|Input}}|False}} | ||
{{ScriptCommandV2|Sound|playadvanced|{{ScriptArgumentV2|soundFile|Str|1|False||}},{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|False||}},{{ScriptArgumentV2|pitch|Sng|1|False||}},{{ScriptArgumentV2|pan|Sng|2|False||}},{{ScriptArgumentV2|volume|Sng|3|False||}}|Plays a sound with advanced parameters.|{{ScriptArgumentV2|soundFile|Str|1|False||Input}}<br />{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|False||Input}}<br />{{ScriptArgumentV2|pitch|Sng|1|False||Input}}<br />{{ScriptArgumentV2|pan|Sng|2|False||Input}}<br />{{ScriptArgumentV2|volume|Sng|3|False||Input}}|False}} | {{ScriptCommandV2|Sound|playadvanced|{{ScriptArgumentV2|soundFile|Str|1|False||}},{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|False||}},{{ScriptArgumentV2|pitch|Sng|1|False||}},{{ScriptArgumentV2|pan|Sng|2|False||}},{{ScriptArgumentV2|volume|Sng|3|False||}}|Plays a sound with advanced parameters.|{{ScriptArgumentV2|soundFile|Str|1|False||Input}}<br />{{ScriptArgumentV2|stopBackgroundMusic|Bool|1|False||Input}}<br />{{ScriptArgumentV2|pitch|Sng|1|False||Input}}<br />{{ScriptArgumentV2|pan|Sng|2|False||Input}}<br />{{ScriptArgumentV2|volume|Sng|3|False||Input}}|False}} | ||
}} | }} | ||
| Line 355: | Line 374: | ||
{{ScriptCommandTableV2|Command| | {{ScriptCommandTableV2|Command| | ||
{{ScriptCommandV2|Storage|set|{{ScriptArgumentV2|type|Str|1|False||}},{{ScriptArgumentV2|name|Str|2|False||}},{{ScriptArgumentV2|value|Str|3|False||}}|Creates or overwrites a storage with the given name and type.|{{ScriptArgumentV2|type|Str|1|False||Input}}<br />{{ScriptArgumentV2|name|Str|2|False||Input}}<br />{{ScriptArgumentV2|value|Str|3|False||Input}}|False}} | {{ScriptCommandV2|Storage|set|{{ScriptArgumentV2|type|Str|1|False||}},{{ScriptArgumentV2|name|Str|2|False||}},{{ScriptArgumentV2|value|Str|3|False||}}|Creates or overwrites a storage with the given name and type.|{{ScriptArgumentV2|type|Str|1|False||Input}}<br />{{ScriptArgumentV2|name|Str|2|False||Input}}<br />{{ScriptArgumentV2|value|Str|3|False||Input}}|False}} | ||
{{ScriptCommandV2|Storage|clear||Clears all storage items.||False}} | {{ScriptCommandV2|Storage|clear||Clears all storage items.||False}} | ||
{{ScriptCommandV2|Storage|update|{{ScriptArgumentV2|type|Str|1|False||}},{{ScriptArgumentV2|name|Str|2|False||}},{{ScriptArgumentV2|operation|Str|3|False||}},{{ScriptArgumentV2|value|Str|4|False||}}|Updates the value in a storage with the given name and type.|{{ScriptArgumentV2|type|Str|1|False||Input}}<br />{{ScriptArgumentV2|name|Str|2|False||Input}}<br />{{ScriptArgumentV2|operation|Str|3|False||Input}}<br />{{ScriptArgumentV2|value|Str|4|False||Input}}|False}} | {{ScriptCommandV2|Storage|update|{{ScriptArgumentV2|type|Str|1|False||}},{{ScriptArgumentV2|name|Str|2|False||}},{{ScriptArgumentV2|operation|Str|3|False||}},{{ScriptArgumentV2|value|Str|4|False||}}|Updates the value in a storage with the given name and type.|{{ScriptArgumentV2|type|Str|1|False||Input}}<br />{{ScriptArgumentV2|name|Str|2|False||Input}}<br />{{ScriptArgumentV2|operation|Str|3|False||Input}}<br />{{ScriptArgumentV2|value|Str|4|False||Input}}|False}} | ||
}} | }} | ||
| Line 363: | Line 384: | ||
{{ScriptCommandTableV2|Command| | {{ScriptCommandTableV2|Command| | ||
{{ScriptCommandV2|Text|show|{{ScriptArgumentV2|text|Str|1|False||}}|Displays a textbox with the given text.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | {{ScriptCommandV2|Text|show|{{ScriptArgumentV2|text|Str|1|False||}}|Displays a textbox with the given text.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | ||
{{ScriptCommandV2|Text|setfont|{{ScriptArgumentV2|font|Str|1|False||}}|Changes the font of the textbox. All fonts from loaded ContentPacks, GameModes and the standard game can be loaded.|{{ScriptArgumentV2|font|Str|1|False||Input}}|False}} | {{ScriptCommandV2|Text|setfont|{{ScriptArgumentV2|font|Str|1|False||}}|Changes the font of the textbox. All fonts from loaded ContentPacks, GameModes and the standard game can be loaded.|{{ScriptArgumentV2|font|Str|1|False||Input}}|False}} | ||
{{ScriptCommandV2|Text|debug|{{ScriptArgumentV2|text|Str|1|False||}}|Prints the "text" argument to the immediate window console.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | {{ScriptCommandV2|Text|debug|{{ScriptArgumentV2|text|Str|1|False||}}|Prints the "text" argument to the immediate window console.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | ||
{{ScriptCommandV2|Text|log|{{ScriptArgumentV2|text|Str|1|False||}}|Logs the "text" argument into the log.dat file.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | {{ScriptCommandV2|Text|log|{{ScriptArgumentV2|text|Str|1|False||}}|Logs the "text" argument into the log.dat file.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | ||
}} | }} | ||
| Line 372: | Line 396: | ||
{{ScriptCommandTableV2|Command| | {{ScriptCommandTableV2|Command| | ||
{{ScriptCommandV2|Title|add|{{ScriptArgumentV2|text|Str|1|True|Sample Text|}},{{ScriptArgumentV2|delay|Sng|1|True|20.0|}},{{ScriptArgumentV2|R|Int|1|True|255|}},{{ScriptArgumentV2|G|Int|2|True|255|}},{{ScriptArgumentV2|B|Int|3|True|255|}},{{ScriptArgumentV2|scale|Sng|2|True|10.0|}},{{ScriptArgumentV2|isCentered|Bool|1|True|true|}},{{ScriptArgumentV2|x|Sng|3|True|0.0|}},{{ScriptArgumentV2|y|Sng|4|True|0.0|}}|Adds a new title for the game to display during gameplay.|{{ScriptArgumentV2|text|Str|1|True|Sample Text|Input}}<br />{{ScriptArgumentV2|delay|Sng|1|True|20.0|Input}}<br />{{ScriptArgumentV2|R|Int|1|True|255|Input}}<br />{{ScriptArgumentV2|G|Int|2|True|255|Input}}<br />{{ScriptArgumentV2|B|Int|3|True|255|Input}}<br />{{ScriptArgumentV2|scale|Sng|2|True|10.0|Input}}<br />{{ScriptArgumentV2|isCentered|Bool|1|True|true|Input}}<br />{{ScriptArgumentV2|x|Sng|3|True|0.0|Input}}<br />{{ScriptArgumentV2|y|Sng|4|True|0.0|Input}}|False}} | {{ScriptCommandV2|Title|add|{{ScriptArgumentV2|text|Str|1|True|Sample Text|}},{{ScriptArgumentV2|delay|Sng|1|True|20.0|}},{{ScriptArgumentV2|R|Int|1|True|255|}},{{ScriptArgumentV2|G|Int|2|True|255|}},{{ScriptArgumentV2|B|Int|3|True|255|}},{{ScriptArgumentV2|scale|Sng|2|True|10.0|}},{{ScriptArgumentV2|isCentered|Bool|1|True|true|}},{{ScriptArgumentV2|x|Sng|3|True|0.0|}},{{ScriptArgumentV2|y|Sng|4|True|0.0|}}|Adds a new title for the game to display during gameplay.|{{ScriptArgumentV2|text|Str|1|True|Sample Text|Input}}<br />{{ScriptArgumentV2|delay|Sng|1|True|20.0|Input}}<br />{{ScriptArgumentV2|R|Int|1|True|255|Input}}<br />{{ScriptArgumentV2|G|Int|2|True|255|Input}}<br />{{ScriptArgumentV2|B|Int|3|True|255|Input}}<br />{{ScriptArgumentV2|scale|Sng|2|True|10.0|Input}}<br />{{ScriptArgumentV2|isCentered|Bool|1|True|true|Input}}<br />{{ScriptArgumentV2|x|Sng|3|True|0.0|Input}}<br />{{ScriptArgumentV2|y|Sng|4|True|0.0|Input}}|False}} | ||
{{ScriptCommandV2|Title|clear||Clears all titles that are currently being displayed.||False}} | {{ScriptCommandV2|Title|clear||Clears all titles that are currently being displayed.||False}} | ||
}} | }} | ||
Revision as of 20:06, 12 July 2014
Version 2 scripts were started in version 0.32. Any script in Version 2 must have "version=2" as the first line of the script.
Commands are written as @command.subcommand and are no longer case sensitive. All commands require a subcommand.
Constructs are written as <construct.subconstruct> and can be used basically everywhere except itself.
A General Note to all GameMode Scripters ( Must Read )
- This list is currently updated as of v0.49.1 Script Library found in game.
- This list is the same as what you can see when typing @help(command).
- Please do not blame darkfire or nilllzz as they are not the one who document this page. ( Nilllzz is the one who creates the scripts )
- If you are a GameMode Scripter or trying to be one, you are recommended to download Notepad++ with our special syntax highlighter for checking typo mistake.
- There might be some missing command from the old page as well as the new page. You might want to refer both :)
- If you find that any command you found here doesn't work the way you want it to be, it might be a bug. Try report it over here.
Make sure that your title include the game version and state clearly what you are trying to do. - The line number shown in the crash logs when scripts have problem starts counting after version=2. Empty lines are not counted as a line as well.
Important info / definition of certain things before we get started.
By Default, the Argument Types are:
- Str ( Str are define as letters or symbols )
- Int ( Int are define as Integer numbers )
- Sng ( Sng are define as Real numbers )
- ItemCollection ( ItemCollection are define as {itemID|amount|price} )
- Bool ( Bool are define as words such as True, False )
- Rec
- IntArr ( IntArr are define as an array of Integer numbers )
- StrArr ( StrArr are define as an array of letters or symbols )
- SngArr ( SngArr are define as an array of Real numbers )
- BoolArr ( BoolArr are define as an array of words such as True, False )
- PokemonData ( PokemonData are define as Pokemon Code )
- Arr ( Arr are define as an array of something. )
For any Optional Argument, it will be engrave by a individual square bracket for example "[Str1],[Str2],[Str3],..."
For any Rec/Arr Argument, it will be engrave by a grouped square bracket for example "[Str1,Int2,Int3,Int4,Int5],Int6..."
For any Multiple Argument ( Either or ), it will be separated by the word "OR" for example "Str1,Int2,Int3,Int4,Int5 OR Str1,Int2,Int3"
Commands
Commands are scripts that tells the game what to do. It comes with @ and usually used with switches.
The table below is split into sections by Command.
You may use the sort feature to make it list according to alphanumeric order.
@Battle
|
@Camera
|
@Chat
|
@Daycare
|
@Entity
|
@Environment
|
@Item
|
@Level
|
@Music
|
@NPC
|
@Options
|
@Player
|
@Pokedex
|
@Pokemon
|
@Radio
|
@Register
|
@Screen
|
@Script
|
@Sound
|
@Storage
|
@Text
|
@Title
|
Constructs
Constructs are script that return a specific values in game. It is used with commands or switches.
They can even be used in trainer files. Constructs always have a subconstruct. All combinations will be listed below.
Constructs that return numbers such as <Pokemon.level(int)> may be used in mathematical functions including:
+: Addition -: Subtraction /: Division *: Multiplication ^: Exponent %: Percent =: Equals >: Greater Than <: Less Than m: Mod (ex. 25m4=1) r: Root(ex. 27r3=3)
The table is split into sections by Construct.
Battle
|
Camera
|
Daycare
|
Entity
|
Environment
|
Inventory
|
Level
|
Math
|
NPC
|
Phone
|
Player
|
Pokedex
|
Pokemon
|
Radio
|
Register
|
Rival
|
Storage
|
System
|
Switches
Switches do a comparison between a given parameter and a construct.
:if:
If you want to make the script run by certain condition, :if: will do the job.
Typical Usage:
:if:Conditions @Command.Subcommand(Argument Types) :endif
:if:Conditions @Command.Subcommand(Argument Types) :else @Command.Subcommand(Argument Types) :endif
Conditions
There are some valid condition that you can use.
The script will run if a value that returns from the constructs match the value given.
<Construct.SubConstruct(Argument Types)>=value <Construct.SubConstruct(Argument Types)>>value <Construct.SubConstruct(Argument Types)><value
The script will run if a value that returns from the constructs does not match the value given.
<not><Construct.SubConstruct(Argument Types)>=value <not><Construct.SubConstruct(Argument Types)>>value <not><Construct.SubConstruct(Argument Types)><value
The script will run if two or more value that returns from the constructs match the value given.
<Construct.SubConstruct(Argument Types)>=value <and> <Construct.SubConstruct(Argument Types)>>value <and> <Construct.SubConstruct(Argument Types)><value
The script will run if at least one value that returns from the constructs match the value given.
<Construct.SubConstruct(Argument Types)>=value <or> <Construct.SubConstruct(Argument Types)>>value <or> <Construct.SubConstruct(Argument Types)><value
FAQ:
1. Can I use <and> and <or> at the same line? (E.g: <Construct.SubConstruct(Argument Types)>=value <or> <Construct.SubConstruct(Argument Types)>=value <and> <Construct.SubConstruct(Argument Types)>=value )
Ans: No. This is because the script does not support it. Also, the script will not understand what condition you are trying to say so I recommend to start a new :if: switches so that it will work the way you want it to be.
2. Can I use <not> with <and> or <or> at the same line? (E.g: <not><Construct.SubConstruct(Argument Types)>=value <or> <Construct.SubConstruct(Argument Types)>=value )
Ans: No. The script will ignore your condition as it could not read the condition properly. If you need to, I recommend to start a new :if: switches so that it will work the way you want it to be.
3. Why it didn't work? Why it skip the condition defined?
Ans: This is probably your own typo mistake. If you are sure that it isn't report the bug.
:select:
If you want to make the script run by selecting certain condition, :select: will do the job.
Typical Usage:
:select:<Construct.SubConstruct(Argument Types)> :when:Value @Command.Subcommand(Argument Types) :endwhen
Value
This field is to define the possible value that the construct given so that the script will run when condition is met.
Define the possible values that the construct will return.
:when:value1 ... :when:value2 ... :when:valuei
If you want to have multiple value as you intended to let them do the same thing, you can use " ; "
:when:value1;value2;value3...;valuei ... :when:value1;value2;value3...;valuei
After you define the values in each condition, use " :endwhen " to properly close the :select: switches.
FAQ:
1. Why it didn't work? Why it skip the condition defined?
Ans: This is probably your own typo mistake. If you are sure that it isn't, report the bug.
@options.show()
If you want to let player choose a certain options to choose from, @Options.show() will do the job.
Typical Usage:
@options.show(option1,option2,optioni) :when:Option1 @Command.Subcommand(Argument Types) :endwhen
Option
This field is to define the possible option that you define in @options.show() so that the script will run when player choose the options.
Define the possible option that you define in @options.show().
:when:option1 ... :when:option2 ... :when:optioni
If you want to have multiple value as you intended to let them do the same thing, you can use " ; "
:when:option1;option2;optioni
After you define all the options in each condition, use " :endwhen " to properly close the @options.show() switches.
FAQ:
1. Why it didn't work? Why it skip the condition defined?
Ans: This is probably your own typo mistake. If you are sure that it isn't, report the bug.
:while:
If you want to loop a certain command until it met the condition, this will do the job.
Typical Usage:
:while:Conditions @Command.Subcommand(Argument Types) ... @Command.Subcommand(Argument Types) :endwhile
FAQ:
1. How to manually stop the loop when you know that the condition will never be met?
Ans: Insert without quotation marks " :exitwhile " before :endwhile to stop the loop prematurely.
2. How come it didn't loop? How come it stop prematurely despite :exitwhile is not used?
Ans: This is a bug. Unfortunately, if this happens, please ensure that your script is correct before filling a bug report.
:endscript
If you want to stop all script prematurely, this shall do the job.
Typical Usage:
@Command.Subcommand(Argument Types) ... ... :endscript
FAQ:
1. How come it didn't work?
Ans: Unfortunately, even I myself do not know what is intended for it to work. You might need to ask Nilllzz by creating a new thread in the community support thread.
:return
Unfortunately, even I myself do not know what is intended for it to work. You might need to ask Nilllzz by creating a new thread in the community support thread.
Comments
To add some comments in your script like what programmer does, you can use " # " a hash at the start of the line.
Typical Usage:
# This is a comment that says nothing @Command.Subcommand(Argument Types) # <= Unfortunately, hash at here do not work. # @Command.Subcommand(Argument Types) <= It will not run this script at all :D
FAQ:
1. Can it support multiple line without keep using # all the time?
Ans: Unfortunately, no.
:end
To end the current running script, this will do the job
Typical Usage:
@Command.Subcommand(Argument Types) :end
| Game Folder | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Content | ContentPacks | GameModes | Saves | Screenshots | Game Executable | ||||||||||||||
| Pokemon | Data | ContentPack Folder | GameMode folder | Savegame folder | Version History | ||||||||||||||
| Data | Maps | Moves | Items | Scripts | Control Files | Content | GameMode.dat | Party.dat | Player.dat | Options.dat | |||||||||
| poke | battle | structures | V1 | V2 | trainer | worldmap | |||||||||||||