Difference between revisions of "Version 2 Scripts New"
Jianmingyong (talk | contribs) m (→@Battle) |
JappaWakka (talk | contribs) m (A little bit of polishing and correcting) |
||
| (186 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
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. | == Introduction == | ||
Version 2 scripts were started in version 0.32 and will cease support in alpha version (v1.xx). Any script in Version 2 must have "version=2" as the first line of the script. | |||
Commands are | Commands are procedures that are used to tell the game what to do.<br /> | ||
Constructs are functions that returns a value in the game. | |||
Constructs | Commands are written as @Command.SubCommand.<br /> | ||
Constructs are written as <Construct.SubConstruct>. | |||
Commands and constructs are not case sensitive. | |||
== A General Note to all GameMode Scripters ( Must Read ) == | == A General Note to all GameMode Scripters ( Must Read ) == | ||
# This | # This page is currently updated as of v0.53.3 Script Library. | ||
# This page contains information that is similar to what you can see when typing @help(command). | |||
# This | # The line number shown in the crash logs starts counting at the first non-empty line of a valid command or statement. However, any line after :while: statement are continuously counted until the end loop. If there are two repeating cycle within the while loop, the number of lines doubles. | ||
# | |||
# | == Code Conventions == | ||
=== Header === | |||
The Header is used to define the ActionScript engine you want to use for the entire script. | |||
For each script file, the header must contain "version=2". | |||
=== Statement === | |||
A Statement is used to make comparisons between constructs and parameters or to make conditions for the script to run. | |||
There are a few Statements available in the game. | |||
* :if: | |||
* :else | |||
* :endif | |||
* :while: | |||
* :exitwhile | |||
* :endwhile | |||
* :select: | |||
* :when: | |||
* :endwhen | |||
* :end | |||
* :endscript | |||
* :return: | |||
For more infomation about Statements and their usage, proceed to [[Version_2_Scripts_New#Statement_2|here]]. | |||
=== Command Declaration === | |||
A Command is used to instruct the game with a set of procedures to run. They do not return any value. | |||
You can define a Command with: @Class.Subclass | |||
=== Construct Declaration === | |||
A Construct is used to instruct the game to return a value. They can be used with Commands and Statements. | |||
You can define construct with: <Class.Subclass> | |||
=== Temporary Global Variable === | |||
Global Variables are used when you want to use a variable on another script without having to redefine it again. | |||
Assignments:<br /> | |||
@Storage.set(str,Name,Text) | |||
@Storage.set(int,Name,Number) | |||
@Storage.set(sng,Name,Number) | |||
@Storage.set(dbl,Name,Number) | |||
@Storage.set(bool,Name,Boolean) | |||
Basic math:<br /> | |||
Addition: | |||
@Storage.update(int,Name,add,Value) | |||
@Storage.update(int,Name,+,Value) | |||
Subtraction: | |||
@Storage.update(int,Name,substract,Value) | |||
@Storage.update(int,Name,-,Value) | |||
Multiplication: | |||
@Storage.update(int,Name,multiply,Value) | |||
@Storage.update(int,Name,*,Value) | |||
Division: | |||
@Storage.update(int,Name,divide,Value) | |||
@Storage.update(int,Name,/,Value) | |||
String concatenation:<br /> | |||
@Storage.update(str,Name,add,Message) | |||
@Storage.update(str,Name,+,Message) | |||
Reading:<br /> | |||
@Text.show(<Storage.get(str,Name)>) | |||
@Text.show(<Storage.get(int,Name)>) | |||
== Version 2 Class == | |||
'''Important info / definition of certain things before we get started.''' | |||
By Default, the Argument Types are: | By Default, the Argument Types are: | ||
*Str | *Str ( Strings are defined as letters or symbols ) | ||
*Int | *Int ( Int ''(Integer)'' are defined as [http://en.wikipedia.org/wiki/Integer Integer numbers] ) | ||
*Sng | *Sng ( Sng ''(Single)'' are defined as [http://en.wikipedia.org/wiki/Real_number Real numbers] ) | ||
*ItemCollection | *ItemCollection ( ItemCollection are defined as {itemID|amount|price} ) | ||
*Bool | *Bool ( Bool ''(Boolean)'' are defined either as True & False or 1 & 0 ) | ||
* | *IntArr ( IntArr are defined as an array of [http://en.wikipedia.org/wiki/Integer Integer numbers], usually with commas inbetween ) | ||
*StrArr ( StrArr are defined as an array of letters or symbols, usually with commas inbetween ) | |||
*StrArr | *SngArr ( SngArr are defined as an array of [http://en.wikipedia.org/wiki/Real_number Real numbers] ) | ||
*SngArr | *BoolArr ( BoolArr are defined as an array of words such as True, False ) | ||
*BoolArr | *PokemonData ( PokemonData are defined as [[Pokemon_Code|Pokemon Code]] ) | ||
*PokemonData | *Arr ( Arr are defined as an array of something. ) | ||
*Arr | |||
For any '''Optional Argument''', it will be underlined and have a red color, for example "<span style="text-decoration: underline; color:red;">Str1,Str2,Str3,...</span>"<br /> | |||
For any '''Array Argument''', it will be surrounded by a grouped square bracket, for example "<nowiki>[Str1,Int2,Int3,Int4,Int5],Int6...</nowiki>"<br /> | |||
== Commands == | |||
Commands are scripts that tells the game what to do. A Command comes with a @ and usually with some arguments '''('''between Parantheses like these''')''' | |||
The table below is split into sections by Command.<br /> | |||
You may use the sort feature to make it list contents in alphanumeric order. | |||
<!-- | |||
{{ScriptCommandV2|Command|Subcommand| Type = Command/Construct | |||
| Argument1 = {{ScriptArgumentV2|Name|ArgumentType|Value|Optional|Default Value|}} | |||
| Description1 = | |||
| Input1 = | |||
}} | |||
--> | |||
=== @Battle === | === @Battle === | ||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Battle|starttrainer| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|trainerFile|Str|1|False||}} | |||
| Description1 = Plays the default reaction of a trainer. | |||
| Input1 = {{ScriptArgumentV2|trainerFile|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Battle|trainer| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|trainerFile|Str|1|False||}},{{ScriptArgumentV2|additionalTrainerData|Str|2|True||}} | |||
| Description1 = Start a battle with a trainer. | |||
| Input1 = {{ScriptArgumentV2|trainerFile|Str|1|False||Input}}<br />{{ScriptArgumentV2|additionalTrainerData|Str|2|True||Input}} | |||
}} | |||
{{ScriptCommandV2|Battle|wild| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pokemonData|PokemonData|1|False||}},{{ScriptArgumentV2|musicloop|Str|1|True||}} | |||
| Description1 = Starts a wild battle. | |||
| Input1 = {{ScriptArgumentV2|pokemonData|PokemonData|1|False||Input}}<br />{{ScriptArgumentV2|musicloop|Str|1|True||Input}} | |||
| Argument2 = {{ScriptArgumentV2|pokemonID|Int|1|False||}},{{ScriptArgumentV2|level|Int|2|False||}},{{ScriptArgumentV2|shiny|Int|3|True|-1|}},{{ScriptArgumentV2|musicloop|Str|1|True||}},{{ScriptArgumentV2|introtype|Int|4|True|0-10|}} | |||
| Input2 = {{ScriptArgumentV2|pokemonID|Int|1|False||Input}}<br />{{ScriptArgumentV2|level|Int|2|False||Input}}<br />{{ScriptArgumentV2|shiny|Int|3|True|-1|Input}}<br />{{ScriptArgumentV2|musicloop|Str|1|True||Input}}<br />{{ScriptArgumentV2|introtype|Int|4|True|0-10|Input}} | |||
}} | |||
{{ScriptCommandV2|Battle|setvar| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|varName|Str|1|False||}},{{ScriptArgumentV2|varValue|Str|2|False||}} | |||
| Description1 = Sets a battle variable. | |||
| Input1 = {{ScriptArgumentV2|varName|Str|1|False||Input}}<br />{{ScriptArgumentV2|varValue|Str|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Battle|resetvars| Type = Command | |||
| Description1 = Reset all battle variable. | |||
}} | |||
}} | |||
=== @Camera === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Camera|set| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}},{{ScriptArgumentV2|yaw|Sng|4|False||}},{{ScriptArgumentV2|pitch|Sng|5|False||}} | |||
| Description1 = Sets the given properties of the camera. | |||
| Input1 = {{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}}<br />{{ScriptArgumentV2|yaw|Sng|4|False||Input}}<br />{{ScriptArgumentV2|pitch|Sng|5|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|reset| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Resets the camera to the default setting. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|setyaw| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|yaw|Sng|1|False||}} | |||
| Description1 = Sets the Yaw property of the camera. | |||
| Input1 = {{ScriptArgumentV2|yaw|Sng|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|setpitch| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pitch|Sng|1|False||}} | |||
| Description1 = Sets the Pitch property of the camera. | |||
| Input1 = {{ScriptArgumentV2|pitch|Sng|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|setposition| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}} | |||
| Description1 = Sets the Position property of the camera. | |||
| Input1 = {{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|setx| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|x|Sng|1|False||}} | |||
| Description1 = Sets the X Position property of the camera. | |||
| Input1 = {{ScriptArgumentV2|x|Sng|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|sety| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|y|Sng|1|False||}} | |||
| Description1 = Sets the Y Position property of the camera. | |||
| Input1 = {{ScriptArgumentV2|y|Sng|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|setz| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|z|Sng|1|False||}} | |||
| Description1 = Sets the Z Position property of the camera. | |||
| Input1 = {{ScriptArgumentV2|z|Sng|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|togglethirdperson| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Toggles the third person camera. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|activatethirdperson| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Activates the third person camera. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|deactivethirdperson| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Deactivates the third person camera. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|deactivatethirdperson| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Deactivates the third person camera. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|setthirdperson| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|thirdPerson|Bool|1|False||}},{{ScriptArgumentV2|doCameraUpdate|Bool|2|True|True|}} | |||
| Description1 = Set the camera to third person camera. | |||
| Input1 = {{ScriptArgumentV2|thirdPerson|Bool|1|False||Input}}<br />{{ScriptArgumentV2|doCameraUpdate|Bool|2|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|fix| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Fixes the camera to the current position. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|defix| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Defixes the camera so that it clips behind the player again. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|togglefix| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|}} | |||
| Description1 = Sets the fix state of the camera to the opposite of the current state. | |||
| Input1 = {{ScriptArgumentV2|doCameraUpdate|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Camera|update| Type = Command | |||
| Description1 = Update the camera. | |||
}} | |||
{{ScriptCommandV2|Camera|setfocus| Type = Command | |||
}} | |||
{{ScriptCommandV2|Camera|setfocustype| Type = Command | |||
}} | |||
{{ScriptCommandV2|Camera|setfocusid| Type = Command | |||
}} | |||
{{ScriptCommandV2|Camera|resetfocus| Type = Command | |||
}} | |||
{{ScriptCommandV2|Camera|settoplayerfacing| Type = Command | |||
}} | |||
}} | |||
=== @Chat === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Chat|clear| Type = Command | |||
| Description1 = Clears the chat. | |||
}} | |||
}} | |||
=== @Daycare === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Daycare|takeegg| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}} | |||
| Description1 = Removes the egg from the daycare and adds it to the player's party. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|takepokemon| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}} | |||
| Description1 = Takes a Pokémon from the daycare to the player's party. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|leavepokemon| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|PokemonDaycareIndex|Int|2|False||}},{{ScriptArgumentV2|pokemonIndex|Int|3|False||}} | |||
| Description1 = Removes a Pokémon from the player's party and fills the given PokemonDaycareIndex with that Pokémon. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|PokemonDaycareIndex|Int|2|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|3|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|removeegg| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}} | |||
| Description1 = Removes the egg from the daycare. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|clean| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}} | |||
| Description1 = Cleans all data for the given daycare. This doesn't remove the data, just rearranges it. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|call| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}} | |||
| Description1 = Initializes a call with the daycare. This checks if the daycare is registered in the Pokégear. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|cleardata| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}} | |||
| Description1 = Clears all the data for one daycare. That includes the Pokémon stored there and a potetial egg. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}} | |||
}} | |||
}} | |||
=== @Entity === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Entity|showmessagebulb| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|bulbID|Int|1|False||}}<nowiki>|</nowiki>{{ScriptArgumentV2|x|Sng|1|False||}}<nowiki>|</nowiki>{{ScriptArgumentV2|y|Sng|2|False||}}<nowiki>|</nowiki>{{ScriptArgumentV2|z|Sng|3|False||}} | |||
| Description1 = Displays a message bulb in the world. | |||
| Input1 = {{ScriptArgumentV2|bulbID|Int|1|False||Input}}<br />{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|warp| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}} | |||
| Description1 = Warps the entity to a new location on the map. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|setscale| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|xS|Sng|1|False||}},{{ScriptArgumentV2|yS|Sng|2|False||}},{{ScriptArgumentV2|zS|Sng|3|False||}} | |||
| Description1 = Changes the Scale property of the selected entity. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|xS|Sng|1|False||Input}}<br />{{ScriptArgumentV2|yS|Sng|2|False||Input}}<br />{{ScriptArgumentV2|zS|Sng|3|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|remove| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}} | |||
| Description1 = Removes the entity from the map once it updates. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|setid| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|newID|Int|2|False||}} | |||
| Description1 = Sets the entity ID of the selected entity to a new ID. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|newID|Int|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|setopacity| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|opacity|Int|2|False||}} | |||
| Description1 = Sets the Opacity property of the selected entity. "opacity" in %. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|opacity|Int|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|setvisible| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|visible|Bool|1|False||}} | |||
| Description1 = Sets the Visible property of the selected entity. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|visible|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|setadditionalvalue| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|additionalValue|Str|1|False||}} | |||
| Description1 = Sets the AdditionalValue property of the selected entity. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|additionalValue|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|setcollision| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|collision|Bool|1|False||}} | |||
| Description1 = Sets the Collision property of the selected entity. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|collision|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|settetxure| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|textureIndex|Str|1|False||}},[{{ScriptArgumentV2|textureName|Str|2|False||}},{{ScriptArgumentV2|rX|Int|2|False||}},{{ScriptArgumentV2|rY|Int|3|False||}},{{ScriptArgumentV2|rWidth|Int|4|False||}},{{ScriptArgumentV2|rHeight|Int|5|False||}}] | |||
| Description1 = Sets the texture in the selected entity's texture array. Argument example: 0,0,[nilllzz,0,10,32,32] | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|textureIndex|Str|1|False||Input}}<br />{{ScriptArgumentV2|textureName|Str|2|False||Input}}<br />{{ScriptArgumentV2|rX|Int|2|False||Input}}<br />{{ScriptArgumentV2|rY|Int|3|False||Input}}<br />{{ScriptArgumentV2|rWidth|Int|4|False||Input}}<br />{{ScriptArgumentV2|rHeight|Int|5|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Entity|addtoposition| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|entityID|Int|1|False||}},{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}} | |||
| Description1 = Adds the given coordinates to the position of the given entity. | |||
| Input1 = {{ScriptArgumentV2|entityID|Int|1|False||Input}}<br />{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}} | |||
}} | |||
}} | |||
=== @Environment === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Environment|setweather| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|weatherID|Int|1|False||}} | |||
| Description1 = Changes the weather of the current map. | |||
| Input1 = {{ScriptArgumentV2|weatherID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setregionweather| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|weatherID|Int|1|False||}} | |||
| Description1 = Changes the weather of the current region. | |||
| Input1 = {{ScriptArgumentV2|weatherID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setcanfly| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|canfly|Bool|1|False||}} | |||
| Description1 = Sets the "CanFly" parameter of the current map. | |||
| Input1 = {{ScriptArgumentV2|canfly|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setcandig| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|candig|Bool|1|False||}} | |||
| Description1 = Sets the "CanDig" parameter of the current map. | |||
| Input1 = {{ScriptArgumentV2|candig|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setcanteleport| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|canteleport|Bool|1|False||}} | |||
| Description1 = Sets the "CanTeleport" parameter of the current map. | |||
| Input1 = {{ScriptArgumentV2|canteleport|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setwildpokemongrass| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|canencounter|Bool|1|False||}} | |||
| Description1 = Sets the "WildPokemonGrass" parameter of the current map. | |||
| Input1 = {{ScriptArgumentV2|canencounter|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setwildpokemonwater| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|canencounter|Bool|1|False||}} | |||
| Description1 = Sets the "WildPokemonWater" parameter of the current map. | |||
| Input1 = {{ScriptArgumentV2|canencounter|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setwildpokemoneverywhere| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|canencounter|Bool|1|False||}} | |||
| Description1 = Sets the "WildPokemonEverywhere" parameter of the current map. | |||
| Input1 = {{ScriptArgumentV2|canencounter|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setisdark| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|isDark|Bool|1|False||}} | |||
| Description1 = Sets the "IsDark" parameter of the current map. | |||
| Input1 = {{ScriptArgumentV2|isDark|Bool|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|setrenderdistance| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|distance|Int|1|False||}} | |||
| Description1 = Sets the render distance. | |||
| Input1 = {{ScriptArgumentV2|distance|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Environment|toggledarkness| Type = Command | |||
| Description1 = Toggles the "IsDark" parameter of the current map. | |||
}} | |||
}} | |||
=== @Item === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Item|give| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|ItemID|Int|1|False||}},{{ScriptArgumentV2|Amount|Int|2|True|1|}} | |||
| Description1 = Adds the given amount of items to the player's inventory. | |||
| Input1 = {{ScriptArgumentV2|ItemID|Int|1|False||Input}}<br />{{ScriptArgumentV2|Amount|Int|2|True|1|Input}} | |||
| Argument2 = {{ScriptArgumentV2|ItemName|Str|1|False||}},{{ScriptArgumentV2|Amount|Int|2|True|1|}} | |||
| Input2 = {{ScriptArgumentV2|ItemName|Int|1|False||Input}}<br />{{ScriptArgumentV2|Amount|Int|2|True|1|Input}} | |||
}} | |||
{{ScriptCommandV2|Item|remove| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|ItemID|Int|1|False||}},{{ScriptArgumentV2|Amount|Int|2|True|1|}},{{ScriptArgumentV2|showMessage|Bool|1|True|True|}} | |||
| Description1 = Removes the given amount of items from the player's inventory. Displays a message afterwards, if "showMessage" is true. | |||
| Input1 = {{ScriptArgumentV2|ItemID|Int|1|False||Input}}<br />{{ScriptArgumentV2|Amount|Int|2|True|1|Input}}<br />{{ScriptArgumentV2|showMessage|Bool|1|True|True|Input}} | |||
| Argument2 = {{ScriptArgumentV2|ItemName|Str|1|False||}},{{ScriptArgumentV2|Amount|Int|2|True|1|}},{{ScriptArgumentV2|showMessage|Bool|1|True|True|}} | |||
| Input2 = {{ScriptArgumentV2|ItemName|Str|1|False||Input}}<br />{{ScriptArgumentV2|Amount|Int|2|True|1|Input}}<br />{{ScriptArgumentV2|showMessage|Bool|1|True|True|Input}} | |||
}} | |||
{{ScriptCommandV2|Item|clearitem| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|ItemID|Int|1|True||}} | |||
| Description1 = Clears all items with the given ID from the player's inventory. Clears the whole inventory if ItemID is empty. | |||
| Input1 = {{ScriptArgumentV2|ItemID|Int|1|True||Input}} | |||
| Argument2 = {{ScriptArgumentV2|ItemName|Str|1|True||}} | |||
| Input2 = {{ScriptArgumentV2|ItemName|Int|1|True||Input}} | |||
}} | |||
{{ScriptCommandV2|Item|messagegive| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|ItemID|Int|1|False||}},{{ScriptArgumentV2|Amount|Int|2|True|1|}} | |||
| Description1 = Displays a message for getting the specified amount of items. | |||
| Input1 = {{ScriptArgumentV2|ItemID|Int|1|False||Input}}<br />{{ScriptArgumentV2|Amount|Int|2|True|1|Input}} | |||
| Argument2 = {{ScriptArgumentV2|ItemName|Str|1|False||}},{{ScriptArgumentV2|Amount|Int|2|True|1|}} | |||
| Input2 = {{ScriptArgumentV2|ItemName|Str|1|False||Input}}<br />{{ScriptArgumentV2|Amount|Int|2|True|1|Input}} | |||
}} | |||
{{ScriptCommandV2|Item|repel| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|RepelItemID|Int|1|False||}} | |||
| Description1 = Adds the steps of the repel to the repel steps of the player. | |||
| Input1 = {{ScriptArgumentV2|RepelItemID|Int|1|False||Input}} | |||
}} | |||
}} | |||
=== @Level === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Level|wait| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|ticks|Int|1|False||}} | |||
| Description1 = Makes the level idle for the duration of the given ticks. | |||
| Input1 = {{ScriptArgumentV2|ticks|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Level|update| Type = Command | |||
| Description1 = Updates the level and all entities once. | |||
}} | |||
{{ScriptCommandV2|Level|waitforevents| Type = Command | |||
| Description1 = Makes the level idle until every NPC movement is done. | |||
}} | |||
{{ScriptCommandV2|Level|waitforsave| Type = Command | |||
| Description1 = Makes the level idle until the current saving of an GameJolt save is done. | |||
}} | |||
{{ScriptCommandV2|Level|reload| Type = Command | |||
| Description1 = Reloads the current map. | |||
}} | |||
{{ScriptCommandV2|Level|setsafari| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|safari|Bool|1|False||}} | |||
| Description1 = Sets if the current map is a Safari Zone (influences battle style). | |||
| Input1 = {{ScriptArgumentV2|safari|Bool|1|false||Input}} | |||
}} | |||
}} | |||
=== @Music === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Music|play| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|musicFile|Str|1|False||}} | |||
| Description1 = Changes the currently playing music to a new one. | |||
| Input1 = {{ScriptArgumentV2|musicFile|Str|1|True||Input}} | |||
}} | |||
{{ScriptCommandV2|Music|setmusicloop| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|musicFile|Str|1|False||}} | |||
| Description1 = Sets the map musicloop to a new musicfile. | |||
| Input1 = {{ScriptArgumentV2|musicFile|Str|1|True||Input}} | |||
}} | |||
{{ScriptCommandV2|Music|stop| Type = Command | |||
| Description1 = Stops the music playback. | |||
}} | |||
{{ScriptCommandV2|Music|pause| Type = Command | |||
| Description1 = Pauses the music playback. | |||
}} | |||
{{ScriptCommandV2|Music|resume| Type = Command | |||
| Description1 = Resumes the music playback. | |||
}} | |||
}} | |||
=== @NPC === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|NPC|remove|{{ScriptArgumentV2|npcID|Int|1|False||}}|Removes the selected NPC from the map.|{{ScriptArgumentV2|npcID|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|position|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}}|Moves the selected NPC to a different place on the map. To get relative coordinates, enter a "~".|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|warp|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}}|Moves the selected NPC to a different place on the map. To get relative coordinates, enter a "~".|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|addtoposition|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}}|Adds the given coordinates to the position of the given NPC. To get relative coordinates, enter a "~".|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|register|{{ScriptArgumentV2|registerData|Str|1|False||}}|Registers NPC data.|{{ScriptArgumentV2|registerData|Str|1|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|unregister|{{ScriptArgumentV2|registerData|Str|1|False||}}|Unregisters NPC data.|{{ScriptArgumentV2|registerData|Str|1|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|wearskin|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|skin|Str|1|False||}}|Sets the skin of the selected NPC.|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|skin|Str|1|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|move|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|steps|Int|2|False||}}|Starts NPC movement of the selected NPC.|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|steps|Int|2|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|setMoveY|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|steps|Int|2|False||}}|Sets the steps the selected NPC should walk in the Y direction.|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|steps|Int|2|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|moveasync|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|steps|Int|2|False||}}|Starts async NPC movement of the selected NPC.|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|steps|Int|2|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|turn|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|facing|Int|2|False||}}|Sets the face direction of the selected NPC.|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|facing|Int|2|False||Input}}|False}} | |||
{{ScriptCommandV2|NPC|spawn|{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}},{{ScriptArgumentV2|actionValue|Int|1|True|0|}},{{ScriptArgumentV2|additionalValue|Str|1|True||}},{{ScriptArgumentV2|TextureID|Str|2|True|0|}},{{ScriptArgumentV2|AnimateIdle|Bool|1|True|False|}},{{ScriptArgumentV2|Rotation|Int|2|True|0|}},{{ScriptArgumentV2|Name|Str|3|True||}},{{ScriptArgumentV2|npcID|Int|3|True|0|}},{{ScriptArgumentV2|Movement|Str|4|True|Still|}}|Spawns a new NPC with the given conditions.|{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}}<br />{{ScriptArgumentV2|actionValue|Int|1|True|0|Input}}<br />{{ScriptArgumentV2|additionalValue|Str|1|True||Input}}<br />{{ScriptArgumentV2|TextureID|Str|2|True|0|Input}}<br />{{ScriptArgumentV2|AnimateIdle|Bool|1|True|False|Input}}<br />{{ScriptArgumentV2|Rotation|Int|2|True|0|Input}}<br />{{ScriptArgumentV2|Name|Str|3|True||Input}}<br />{{ScriptArgumentV2|npcID|Int|3|True|0|Input}}<br />{{ScriptArgumentV2|Movement|Str|4|True|Still|Input}}|False}} | |||
{{ScriptCommandV2|NPC|setspeed|{{ScriptArgumentV2|npcID|Int|1|False||}},{{ScriptArgumentV2|speed|Sng|1|False||}}|Sets the speed of an NPC. The default is "1".|{{ScriptArgumentV2|npcID|Int|1|False||Input}}<br />{{ScriptArgumentV2|speed|Sng|1|False||Input}}|False}} | |||
}} | |||
=== @Options === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Options|show|{{ScriptArgumentV2|options|StrArr|1|False||}},{{ScriptArgumentV2|flag|Str|1|True||}}|Displays a choose box with the given options. Valid Arguments for "flag": <nowiki>[TEXT=FALSE]</nowiki>|{{ScriptArgumentV2|options|StrArr|1|False||Input}}<br />{{ScriptArgumentV2|flag|Str|1|True||Input}}|False}} | |||
{{ScriptCommandV2|Options|setcancelindex|{{ScriptArgumentV2|index|Int|1|False||}}|Sets the cancel index of the next choose box. This index gets choosen when the player presses a back key.|{{ScriptArgumentV2|index|Int|1|False||Input}}|False}} | |||
}} | |||
=== @Player === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Player|receivepokedex||Makes the Pokédex accessible for the player.||False}} | |||
{{ScriptCommandV2|Player|receivepokegear||Makes the Pokégear accessible for the player.||False}} | |||
{{ScriptCommandV2|Player|renamerivel||Opens the rival rename screen.||False}} | |||
{{ScriptCommandV2|Player|wearskin|{{ScriptArgumentV2|skin|Str|1|False||}}|Changes the player skin.|{{ScriptArgumentV2|skin|Str|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|setonlineskin|{{ScriptArgumentV2|gamejoltID|Str|1|False||}}|Changes the player skin to a skin downloaded for the GameJoltID.|{{ScriptArgumentV2|gamejoltID|Str|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|move|{{ScriptArgumentV2|steps|Int|1|False||}}|Starts the player movement.|{{ScriptArgumentV2|steps|Sng|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|moveasync|{{ScriptArgumentV2|steps|Int|1|False||}}|Starts the async player movement.|{{ScriptArgumentV2|steps|Sng|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|turn|{{ScriptArgumentV2|turns|Int|1|False||}}|Adds to the direction the player faces and starts the turning.|{{ScriptArgumentV2|turns|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|turnasync|{{ScriptArgumentV2|turns|Int|1|False||}}|Adds to the direction the player faces and starts the async turning.|{{ScriptArgumentV2|turns|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|turnto|{{ScriptArgumentV2|facing|Int|1|False||}}|Changes the direction the player faces and starts the turning.|{{ScriptArgumentV2|facing|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|turntoasync|{{ScriptArgumentV2|facing|Int|1|False||}}|Changes the direction the player faces and starts the async turning.|{{ScriptArgumentV2|facing|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|warp|{{ScriptArgumentV2|mapfile|Str|1|False||}} OR {{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}} OR {{ScriptArgumentV2|mapfile|Str|1|False||}},{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}} OR {{ScriptArgumentV2|mapfile|Str|1|False||}},{{ScriptArgumentV2|x|Sng|1|False||}},{{ScriptArgumentV2|y|Sng|2|False||}},{{ScriptArgumentV2|z|Sng|3|False||}},{{ScriptArgumentV2|facing|Int|1|False||}}|Warps the player to a new location on a new map and changes the facing afterwards. To get relative coordinates, enter a "~".|{{ScriptArgumentV2|mapfile|Str|1|False||Input}}<br />{{ScriptArgumentV2|x|Sng|1|False||Input}}<br />{{ScriptArgumentV2|y|Sng|2|False||Input}}<br />{{ScriptArgumentV2|z|Sng|3|False||Input}}<br />{{ScriptArgumentV2|facing|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|stopmovement||Stops the player movement.||False}} | |||
{{ScriptCommandV2|Player|addmoney|{{ScriptArgumentV2|amount|Int|1|False||}}|Adds the given amount to the player's money.|{{ScriptArgumentV2|amount|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|money|{{ScriptArgumentV2|amount|Int|1|False||}}|Adds the given amount to the player's money.|{{ScriptArgumentV2|amount|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|setmovement|{{ScriptArgumentV2|x|Int|1|False||}},{{ScriptArgumentV2|y|Int|2|False||}},{{ScriptArgumentV2|z|Int|3|False||}}|Sets the direction the player will move next regardless of facing.|{{ScriptArgumentV2|x|Int|1|False||Input}}<br />{{ScriptArgumentV2|y|Int|2|False||Input}}<br />{{ScriptArgumentV2|z|Int|3|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|resetmovement||Resets the player movement to the default movement directions.||False}} | |||
{{ScriptCommandV2|Player|getbadge|{{ScriptArgumentV2|badgeID|Int|1|False||}}|Adds the given badge to the player's badges and displays a message.|{{ScriptArgumentV2|badgeID|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|achieveemblem|{{ScriptArgumentV2|emblemName|Str|1|False||}}|Makes the player achieve an emblem (GameJolt only).|{{ScriptArgumentV2|emblemName|Str|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|addbp|{{ScriptArgumentV2|amount|Int|1|False||}}|Adds the given amount to the player's BattlePoints.|{{ScriptArgumentV2|amount|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|showrod|{{ScriptArgumentV2|rodID|Int|1|False||}}|Displays a rod on the screen.|{{ScriptArgumentV2|rodID|Int|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Player|hiderod||Hides the fishing rod.||False}} | |||
{{ScriptCommandV2|Player|showpokemonfollow||Shows up the following Pokémon.||False}} | |||
{{ScriptCommandV2|Player|hidepokemonfollow||Hides the following Pokémon.||False}} | |||
{{ScriptCommandV2|Player|togglepokemonfollow||Toggles the following Pokémon's visibility.||False}} | |||
{{ScriptCommandV2|Player|save||Saves the game.||False}} | |||
{{ScriptCommandV2|Player|setrivalname|{{ScriptArgumentV2|Name|Str|1|False||}}|Sets the rival's name.|{{ScriptArgumentV2|Name|Str|1|False|Input|Str}}|False}} | |||
}} | |||
=== @Pokedex === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Pokedex|setautodetect| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|autodetect|Bool|1|False||}} | |||
| Description1 = Sets if the Pokédex registers seen Pokémon in wild or trainer battles. | |||
| Input1 = {{ScriptArgumentV2|autodetect|Bool|1|False||Input}} | |||
}} | |||
}} | |||
=== @Pokemon === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Pokemon|cry| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pokemonID|Int|1|False||}} | |||
| Description1 = Plays the cry of the given Pokémon. | |||
| Input1 = {{ScriptArgumentV2|pokemonID|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Pokemon|remove| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||}} | |||
| Description1 = Removes the Pokémon at the given party index. | |||
| Input1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Pokemon|add| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|insertIndex|Int|1|True|Pokemon Count|}},{{ScriptArgumentV2|pokemonData|PokemonData|1|False||}} | |||
| Description1 = Adds the Pokémon to the player's party. | |||
| Input1 = {{ScriptArgumentV2|insertIndex|Int|1|True|Pokemon Count|Input}}<br />{{ScriptArgumentV2|pokemonData|PokemonData|1|True||Input}} | |||
| Argument2 = {{ScriptArgumentV2|pokemonID|Int|1|False||}},{{ScriptArgumentV2|level|Int|2|False||}},{{ScriptArgumentV2|method|Str|1|True|random reason|}},{{ScriptArgumentV2|ballID|Int|3|True|5|}},{{ScriptArgumentV2|location|Str|2|True|Current location|}},{{ScriptArgumentV2|isEgg|Bool|1|True|False|}},{{ScriptArgumentV2|trainerName|Str|3|True|Current TrainerName|}} | |||
| Description2 = Adds the Pokémon with the given arguments to the player's party. | |||
| Input2 = {{ScriptArgumentV2|pokemonID|Int|1|False||Input}}<br />{{ScriptArgumentV2|level|Int|2|False||Input}}<br />{{ScriptArgumentV2|method|Str|1|True|random reason|Input}}<br />{{ScriptArgumentV2|ballID|Int|3|True|5|Input}}<br />{{ScriptArgumentV2|location|Str|2|True|Current location|Input}}<br />{{ScriptArgumentV2|isEgg|Bool|1|True|False|Input}}<br />{{ScriptArgumentV2|trainerName|Str|3|True|Current TrainerName|Input}} | |||
}} | |||
{{ScriptCommandV2|Pokemon|setadditionalvalue| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||}},{{ScriptArgumentV2|data|Str|1|False||}} | |||
| Description1 = Set the additional data for a Pokémon in the player's party. | |||
| Input1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||Input}}<br />{{ScriptArgumentV2|data|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Pokemon|setadditionaldata| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||}},{{ScriptArgumentV2|data|Str|1|False||}} | |||
| Description1 = Set the additional data for a Pokémon in the player's party. | |||
| Input1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||Input}}<br />{{ScriptArgumentV2|data|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Pokemon|setnickname| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||}},{{ScriptArgumentV2|nickName|Str|1|False||}} | |||
| Description1 = Set the nick name for a Pokémon in the player's party. | |||
| Input1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||Input}}<br />{{ScriptArgumentV2|nickName|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Pokemon|setstat| Type = Command | |||
| Argument1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||}},{{ScriptArgumentV2|statName|Str|1|False||}},{{ScriptArgumentV2|statValue|Int|2|False||}} | |||
| Description1 = Set the value of a stat for a Pokémon in the player's party. | |||
| Input1 = {{ScriptArgumentV2|pokemonIndex|Int|1|False||Input}}<br />{{ScriptArgumentV2|statName|Str|1|False||Input}}<br />{{ScriptArgumentV2|statValue|Int|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|pokemon|clear||||False}} | |||
{{ScriptCommandV2|pokemon|removeattack||||False}} | |||
{{ScriptCommandV2|pokemon|clearattacks||||False}} | |||
{{ScriptCommandV2|pokemon|addattack||||False}} | |||
{{ScriptCommandV2|pokemon|setshiny||||False}} | |||
{{ScriptCommandV2|pokemon|changelevel||||False}} | |||
{{ScriptCommandV2|pokemon|gainexp||||False}} | |||
{{ScriptCommandV2|pokemon|setnature||||False}} | |||
{{ScriptCommandV2|pokemon|npcTrade||||False}}genderID: 0-2||", False))" | |||
{{ScriptCommandV2|pokemon|hide||||False}} | |||
{{ScriptCommandV2|pokemon|rename||||False}} | |||
{{ScriptCommandV2|pokemon|read||||False}} | |||
{{ScriptCommandV2|pokemon|heal||||False}} | |||
{{ScriptCommandV2|pokemon|setfriendship||||False}} | |||
{{ScriptCommandV2|pokemon|addfriendship||||False}} | |||
{{ScriptCommandV2|pokemon|select||||False}} | |||
{{ScriptCommandV2|pokemon|selectmove||||False}} | |||
{{ScriptCommandV2|pokemon|calcStats||||False}} | |||
{{ScriptCommandV2|pokemon|learnAttack||||False}} | |||
{{ScriptCommandV2|pokemon|setgender||||False}} | |||
{{ScriptCommandV2|pokemon|setability||||False}} | |||
{{ScriptCommandV2|pokemon|setev||||False}} | |||
{{ScriptCommandV2|pokemon|setiv||||False}} | |||
{{ScriptCommandV2|pokemon|registerhalloffame||||False}} | |||
{{ScriptCommandV2|pokemon|setOT||||False}} | |||
{{ScriptCommandV2|pokemon|setItem||||False}} | |||
{{ScriptCommandV2|pokemon|setItemData||||False}} | |||
{{ScriptCommandV2|pokemon|setcatchtrainer||||False}} | |||
{{ScriptCommandV2|pokemon|setcatchball||||False}} | |||
{{ScriptCommandV2|pokemon|setcatchmethod||||False}} | |||
{{ScriptCommandV2|pokemon|setcatchplace||||False}} | |||
{{ScriptCommandV2|pokemon|setcatchlocation||||False}} | |||
{{ScriptCommandV2|pokemon|newroaming||||False}} | |||
{{ScriptCommandV2|pokemon|evolve||||False}} | |||
{{ScriptCommandV2|pokemon|reload||||False}} | |||
{{ScriptCommandV2|pokemon|clone||||False}} | |||
}} | |||
=== @Radio === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Radio|allowchannel|{{ScriptArgumentV2|channel|Sng|1|False||}}|Allows a channel on the map.|{{ScriptArgumentV2|channel|Sng|1|False||Input}}|False}} | |||
{{ScriptCommandV2|Radio|blockchannel|{{ScriptArgumentV2|channel|Sng|1|False||}}|Blocks a channel on the map.|{{ScriptArgumentV2|channel|Sng|1|False||Input}}|False}} | |||
}} | |||
=== @Register === | |||
{{ScriptCommandTableV2|Command| | |||
{{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.<br />OR<br />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|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.<br />OR<br />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|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}} | |||
}} | |||
=== @Screen === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Screen|storagesystem||Opens the storage system.||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|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|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|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|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|mailsystem||Opens the PC Inbox 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|mysteryevent||Opens the Mystery Event screen.||False}} | |||
{{ScriptCommandV2|Screen|showPokemon||||False}} | |||
}} | |||
=== @Script === | |||
{{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|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}} | |||
}} | |||
=== @Sound === | |||
{{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|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}} | |||
}} | |||
=== @Storage === | |||
{{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|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}} | |||
}} | |||
=== @Text === | |||
{{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|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|log|{{ScriptArgumentV2|text|Str|1|False||}}|Logs the "text" argument into the log.dat file.|{{ScriptArgumentV2|text|Str|1|False||Input}}|False}} | |||
}} | |||
=== @Title === | |||
{{ScriptCommandTableV2|Command| | |||
{{ScriptCommandV2|Title|add| Type = Command | |||
| Argument1 = {{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|}} | |||
| Description1 = Adds a new title for the game to display during gameplay. | |||
| Input1 = {{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}} | |||
}} | |||
{{ScriptCommandV2|Title|clear| Type = Command | |||
| Description1 = Clears all titles that are currently being displayed. | |||
}} | |||
}} | |||
== 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 === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|Battle|defeatmessage| Type = Construct | |||
| Argument1 = {{ScriptArgumentV2|trainerFile|Str|1|False||}} | |||
| Description1 = Returns the defeat message of the trainer loaded from the given "trainerFile". | |||
| Input1 = {{ScriptArgumentV2|trainerFile|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Battle|intromessage| Type = Construct | |||
| Argument1 = {{ScriptArgumentV2|trainerFile|Str|1|False||}} | |||
| Description1 = Returns the intro message of the trainer loaded from the given "trainerFile". | |||
| Input1 = {{ScriptArgumentV2|trainerFile|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Battle|outromessage| Type = Construct | |||
| Argument1 = {{ScriptArgumentV2|trainerFile|Str|1|False||}} | |||
| Description1 = Returns the outro message of the trainer loaded from the given "trainerFile". | |||
| Input1 = {{ScriptArgumentV2|trainerFile|Str|1|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Battle|won| Type = Construct | |||
| Description1 = Returns "true" if the player won the last battle. Returns "false" otherwise. | |||
}} | |||
}} | |||
=== Camera === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|Camera|isfixed| Type = Construct | |||
| Description1 = Returns if the camera is fixed to a specific position. | |||
}} | |||
{{ScriptCommandV2|Camera|x| Type = Construct | |||
| Description1 = Returns the current X position of the camera. | |||
}} | |||
{{ScriptCommandV2|Camera|y| Type = Construct | |||
| Description1 = Returns the current Y position of the camera. | |||
}} | |||
{{ScriptCommandV2|Camera|z| Type = Construct | |||
| Description1 = Returns the current Z position of the camera. | |||
}} | |||
}} | |||
=== Daycare === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|Daycare|pokemonID| Type = Construct | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}} | |||
| Description1 = Returns the Pokémon ID of a Pokémon in the daycare. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|pokemonName| Type = Construct | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}} | |||
| Description1 = Returns the name of a Pokémon in the daycare. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|pokemonSprite| Type = Construct | |||
| Argument1 = {{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}} | |||
| Description1 = Returns the sprite of a Pokémon in the daycare. | |||
| Input1 = {{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}} | |||
}} | |||
{{ScriptCommandV2|Daycare|shinyIndicator|{{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}}|Returns the Shiny Indicator of a Pokémon in the daycare (either "N" or "S").|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}}|True}} | |||
{{ScriptCommandV2|Daycare|countpokemon|{{ScriptArgumentV2|daycareID|Int|1|False||}}|Returns the amount of Pokémon in the daycare.|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Daycare|haspokemon|{{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}}|Returns the Pokémon ID of a Pokémon in the daycare.|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}}|True}} | |||
{{ScriptCommandV2|Daycare|canswim|{{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}}|Returns if the Pokémon in the daycare can swim.|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}}|True}} | |||
{{ScriptCommandV2|Daycare|hasegg|{{ScriptArgumentV2|daycareID|Int|1|False||}}|Returns if the daycare has an egg.|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Daycare|grownlevels|{{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}}|Returns the amount of levels the Pokémon has grown in the daycare.|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}}|True}} | |||
{{ScriptCommandV2|Daycare|currentlevel|{{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}}|Returns the current level of the Pokémon in the daycare.|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}}|True}} | |||
{{ScriptCommandV2|Daycare|canbreed|{{ScriptArgumentV2|daycareID|Int|1|False||}},{{ScriptArgumentV2|pokemonIndex|Int|2|False||}}|Returns the chance the Pokémon in the daycare can breed (in %).|{{ScriptArgumentV2|daycareID|Int|1|False||Input}}<br />{{ScriptArgumentV2|pokemonIndex|Int|2|False||Input}}|True}} | |||
}} | |||
=== Entity === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|Entity|visible|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns if the selected entity is visible.|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|opacity|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the opacity property of the selected entity.|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|position|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the position of the selected entity in the pattern "x,y,z".|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|positionx|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the X position of the selected entity.|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|positiony|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the Y position of the selected entity.|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|positionz|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the Z position of the selected entity.|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|scale|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the scale of the selected entity in the pattern "x,y,z".|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|additionalvalue|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the additional value of the selected entity.|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
{{ScriptCommandV2|Entity|collision|{{ScriptArgumentV2|entityID|Int|1|False||}}|Returns the collision property of the selected entity.|{{ScriptArgumentV2|entityID|Int|1|False||Input}}|True}} | |||
}} | |||
=== Environment === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|environment|daytime||||True}} | |||
{{ScriptCommandV2|environment|daytimeID||||True}} | |||
{{ScriptCommandV2|environment|season||||True}} | |||
{{ScriptCommandV2|environment|seasonID||||True}} | |||
{{ScriptCommandV2|environment|day||||True}} | |||
{{ScriptCommandV2|environment|dayofyear||||True}} | |||
{{ScriptCommandV2|environment|dayinformation||||True}} | |||
{{ScriptCommandV2|environment|week||||True}} | |||
{{ScriptCommandV2|environment|year||||True}} | |||
{{ScriptCommandV2|environment|weather||||True}} | |||
{{ScriptCommandV2|environment|mapweather||||True}} | |||
{{ScriptCommandV2|environment|currentmapweather||||True}} | |||
{{ScriptCommandV2|environment|weatherid||||True}} | |||
{{ScriptCommandV2|environment|mapweatherid||||True}} | |||
{{ScriptCommandV2|environment|currentmapweatherid||||True}} | |||
{{ScriptCommandV2|environment|regionweather||||True}} | |||
{{ScriptCommandV2|environment|regionweatherid||||True}} | |||
{{ScriptCommandV2|environment|canfly||||True}} | |||
{{ScriptCommandV2|environment|candig||||True}} | |||
{{ScriptCommandV2|environment|canteleport||||True}} | |||
{{ScriptCommandV2|environment|wildpokemongrass||||True}} | |||
{{ScriptCommandV2|environment|wildpokemonwater||||True}} | |||
{{ScriptCommandV2|environment|wildpokemoneverywhere||||True}} | |||
{{ScriptCommandV2|environment|isdark||||True}} | |||
}} | |||
=== Inventory === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|inventory|countitem||||True}} | |||
{{ScriptCommandV2|inventory|countitems||||True}} | |||
{{ScriptCommandV2|inventory|name||||True}} | |||
{{ScriptCommandV2|inventory|ID||||True}} | |||
}} | |||
=== Level === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|level|mapfile||||True}} | |||
{{ScriptCommandV2|level|levelfile||||True}} | |||
{{ScriptCommandV2|level|filename||||True}} | |||
{{ScriptCommandV2|level|riding||||True}} | |||
{{ScriptCommandV2|level|surfing||||True}} | |||
}} | |||
=== Math === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|math|int||||True}} | |||
{{ScriptCommandV2|math|sng||||True}} | |||
{{ScriptCommandV2|math|abs||||True}} | |||
{{ScriptCommandV2|math|ceiling||||True}} | |||
{{ScriptCommandV2|math|floor||||True}} | |||
{{ScriptCommandV2|math|isint||||True}} | |||
{{ScriptCommandV2|math|issng||||True}} | |||
}} | |||
=== NPC === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|npc|position||||True}} | |||
{{ScriptCommandV2|npc|exists||||True}} | |||
{{ScriptCommandV2|npc|ismoving||||True}} | |||
{{ScriptCommandV2|npc|moved||||True}} | |||
{{ScriptCommandV2|npc|skin||||True}} | |||
{{ScriptCommandV2|npc|facing||||True}} | |||
{{ScriptCommandV2|npc|ID||||True}} | |||
{{ScriptCommandV2|npc|name||||True}} | |||
{{ScriptCommandV2|npc|action||||True}} | |||
{{ScriptCommandV2|npc|additionalvalue||||True}} | |||
{{ScriptCommandV2|npc|movement||||True}} | |||
{{ScriptCommandV2|npc|hasmoverectangles||||True}} | |||
{{ScriptCommandV2|npc|trainertexture||||True}} | |||
}} | |||
=== Phone === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|phone|callflag||||True}} | |||
{{ScriptCommandV2|phone|got||||True}} | |||
}} | |||
=== Player === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|player|position||||True}} | |||
{{ScriptCommandV2|player|hasbadge||||True}} | |||
{{ScriptCommandV2|player|skin||||True}} | |||
{{ScriptCommandV2|player|velocity||||True}} | |||
{{ScriptCommandV2|player|ismoving||||True}} | |||
{{ScriptCommandV2|player|facing||||True}} | |||
{{ScriptCommandV2|player|compass||||True}} | |||
{{ScriptCommandV2|player|money||||True}} | |||
{{ScriptCommandV2|player|name||||True}} | |||
{{ScriptCommandV2|player|gender||||True}} | |||
{{ScriptCommandV2|player|bp||||True}} | |||
{{ScriptCommandV2|player|badges||||True}} | |||
{{ScriptCommandV2|player|thirdperson||||True}} | |||
{{ScriptCommandV2|player|rival||||True}} | |||
{{ScriptCommandV2|player|rivalname||||True}} | |||
{{ScriptCommandV2|player|ot||||True}} | |||
{{ScriptCommandV2|player|gamejoltid||||True}} | |||
}} | |||
=== Pokedex === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|pokedex|caught||||True}} | |||
{{ScriptCommandV2|pokedex|seen||||True}} | |||
{{ScriptCommandV2|pokedex|shiny||||True}} | |||
}} | |||
=== Pokemon === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|pokemon|id||||True}} | |||
{{ScriptCommandV2|pokemon|number||||True}} | |||
{{ScriptCommandV2|pokemon|data||||True}} | |||
{{ScriptCommandV2|pokemon|level||||True}} | |||
{{ScriptCommandV2|pokemon|hasfullhp||||True}} | |||
{{ScriptCommandV2|pokemon|hp||||True}} | |||
{{ScriptCommandV2|pokemon|atk||||True}} | |||
{{ScriptCommandV2|pokemon|def||||True}} | |||
{{ScriptCommandV2|pokemon|spatk||||True}} | |||
{{ScriptCommandV2|pokemon|spdef||||True}} | |||
{{ScriptCommandV2|pokemon|speed||||True}} | |||
{{ScriptCommandV2|pokemon|maxhp||||True}} | |||
{{ScriptCommandV2|pokemon|isegg||||True}} | |||
{{ScriptCommandV2|pokemon|additionaldata||||True}} | |||
{{ScriptCommandV2|pokemon|nickname||||True}} | |||
{{ScriptCommandV2|pokemon|name||||True}} | |||
{{ScriptCommandV2|pokemon|ot||||True}} | |||
{{ScriptCommandV2|pokemon|trainer||||True}} | |||
{{ScriptCommandV2|pokemon|itemid||||True}} | |||
{{ScriptCommandV2|pokemon|friendship||||True}} | |||
{{ScriptCommandV2|pokemon|itemname||||True}} | |||
{{ScriptCommandV2|pokemon|catchball||||True}} | |||
{{ScriptCommandV2|pokemon|catchmethod||||True}} | |||
{{ScriptCommandV2|pokemon|catchlocation||||True}} | |||
{{ScriptCommandV2|pokemon|hasattack||||True}} | |||
{{ScriptCommandV2|pokemon|countattacks||||True}} | |||
{{ScriptCommandV2|pokemon|attackname||||True}} | |||
{{ScriptCommandV2|pokemon|isShiny||||True}} | |||
{{ScriptCommandV2|pokemon|nature||||True}} | |||
{{ScriptCommandV2|pokemon|ownpokemon||||True}} | |||
{{ScriptCommandV2|pokemon|islegendary||||True}} | |||
{{ScriptCommandV2|pokemon|freeplaceinparty||||True}} | |||
{{ScriptCommandV2|pokemon|nopokemon||||True}} | |||
{{ScriptCommandV2|pokemon|count||||True}} | |||
{{ScriptCommandV2|pokemon|countbattle||||True}} | |||
{{ScriptCommandV2|pokemon|has||||True}} | |||
{{ScriptCommandV2|pokemon|selected||||True}} | |||
{{ScriptCommandV2|pokemon|selectedmove||||True}} | |||
{{ScriptCommandV2|pokemon|hasegg||||True}} | |||
{{ScriptCommandV2|pokemon|maxpartylevel||||True}} | |||
{{ScriptCommandV2|pokemon|evhp||||True}} | |||
{{ScriptCommandV2|pokemon|evatk||||True}} | |||
{{ScriptCommandV2|pokemon|evdef||||True}} | |||
{{ScriptCommandV2|pokemon|evspatk||||True}} | |||
{{ScriptCommandV2|pokemon|evspdef||||True}} | |||
{{ScriptCommandV2|pokemon|evspeed||||True}} | |||
{{ScriptCommandV2|pokemon|ivhp||||True}} | |||
{{ScriptCommandV2|pokemon|ivatk||||True}} | |||
{{ScriptCommandV2|pokemon|ivdef||||True}} | |||
{{ScriptCommandV2|pokemon|ivspatk||||True}} | |||
{{ScriptCommandV2|pokemon|ivspdef||||True}} | |||
{{ScriptCommandV2|pokemon|spawnwild||||True}} | |||
{{ScriptCommandV2|pokemon|itemdata||||True}} | |||
{{ScriptCommandV2|pokemon|countHallofFame||||True}} | |||
{{ScriptCommandV2|pokemon|learnedTutorMove||||True}} | |||
{{ScriptCommandV2|pokemon|totalexp||||True}} | |||
{{ScriptCommandV2|pokemon|needexp||||True}} | |||
{{ScriptCommandV2|pokemon|currentexp||||True}} | |||
{{ScriptCommandV2|pokemon|generateFrontier||||True}} | |||
{{ScriptCommandV2|pokemon|spawnwild||||True}} | |||
{{ScriptCommandV2|pokemon|spawn||||True}} | |||
{{ScriptCommandV2|pokemon|OTmatch||||True}} | |||
{{ScriptCommandV2|pokemon|randomOT||||True}} | |||
{{ScriptCommandV2|pokemon|status||||True}} | |||
{{ScriptCommandV2|pokemon|canevolve||||True}} | |||
{{ScriptCommandV2|pokemon|type1||||True}} | |||
{{ScriptCommandV2|pokemon|type2||||True}} | |||
{{ScriptCommandV2|pokemon|istype||||True}} | |||
}} | |||
=== Radio === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|radio|currentchannel||||True}} | |||
}} | |||
=== Register === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|register|registered||||True}} | |||
{{ScriptCommandV2|register|count||||True}} | |||
{{ScriptCommandV2|register|type||||True}} | |||
{{ScriptCommandV2|register|value||||True}} | |||
}} | |||
=== Rival === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|Rival|name||Returns the rival's name||True}} | |||
}} | |||
=== Storage === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|storage|get||||True}} | |||
{{ScriptCommandV2|storage|count||||True}} | |||
}} | |||
=== System === | |||
{{ScriptCommandTableV2|Construct| | |||
{{ScriptCommandV2|system|random||||True}} | |||
{{ScriptCommandV2|system|unixtimestamp||||True}} | |||
{{ScriptCommandV2|system|dayofyear||||True}} | |||
{{ScriptCommandV2|system|year||||True}} | |||
{{ScriptCommandV2|system|booltoint||||True}} | |||
{{ScriptCommandV2|system|calcint||||True}} | |||
{{ScriptCommandV2|system|int||||True}} | |||
{{ScriptCommandV2|system|calcsng||||True}} | |||
{{ScriptCommandV2|system|sng||||True}} | |||
{{ScriptCommandV2|system|sort||||True}} | |||
{{ScriptCommandV2|system|isinsightscript||||True}} | |||
{{ScriptCommandV2|system|lastinput||||True}} | |||
{{ScriptCommandV2|system|return||||True}} | |||
{{ScriptCommandV2|system|isint||||True}} | |||
{{ScriptCommandV2|system|issng||||True}} | |||
{{ScriptCommandV2|system|chrw||||True}} | |||
}} | |||
== Statement == | |||
Statement 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:[[Version_2_Scripts_New#Conditions|Conditions]] | |||
@Command.Subcommand(Argument Types) | |||
:endif | |||
:if:[[Version_2_Scripts_New#Conditions|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 | |||
<big>'''FAQ:'''</big> | |||
---- | |||
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 )<br /> | |||
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 )<br /> | |||
Ans: Yes. The script will be able to handle this. | |||
3. Why it didn't work? Why it skip the condition defined?<br /> | |||
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:[[Version_2_Scripts_New#Value|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. | |||
<big>'''FAQ:'''</big> | |||
---- | |||
1. Why it didn't work? Why it skip the condition defined?<br /> | |||
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:[[Version_2_Scripts_New#Option|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. | |||
<big>'''FAQ:'''</big> | |||
---- | |||
1. Why it didn't work? Why it skip the condition defined?<br /> | |||
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:[[Version_2_Scripts_New#Conditions|Conditions]] | |||
@Command.Subcommand(Argument Types) | |||
... | |||
@Command.Subcommand(Argument Types) | |||
:endwhile | |||
<big>'''FAQ:'''</big> | |||
---- | |||
1. How to manually stop the loop when you know that the condition will never be met?<br /> | |||
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?<br /> | |||
Ans: This is a bug. Unfortunately, if this happens, please ensure that your script is correct before filling a bug report. | |||
3. Can I stack :while: switches? | |||
Ans: No. Nilllzz officially said it is not possible. | |||
=== :endscript === | |||
---- | |||
If you want to stop all script prematurely, this shall do the job. | |||
Typical Usage: | |||
@Command.Subcommand(Argument Types) | |||
... | |||
... | |||
:endscript | |||
<big>'''FAQ:'''</big> | |||
---- | |||
1. How come it didn't work?<br /> | |||
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: === | |||
---- | |||
More of a script function that return a value. | |||
Typical Usage: | |||
:return:True | |||
:end | |||
Once you use <System.return>, it will return True. | |||
=== 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 | |||
<big>'''FAQ:'''</big> | |||
---- | |||
1. Can it support multiple line without keep using # all the time?<br /> | |||
Ans: Unfortunately, no. | |||
=== :end === | |||
---- | |||
To end the current running script, this will do ithe job | |||
Typical Usage: | |||
@Command.Subcommand(Argument Types) | |||
:end | |||
== Reserved Registers == | |||
Reserved Registers are registers that are reserved in the P3D engine and cannot be replaced by other events. | |||
pokegear_card_radio | |||
# Give Player PokéGear Radio | |||
pokegear_card_GTS | |||
# Give Player GTS Card | |||
phone_contact_### | |||
# Add Phone Contact ID ### | |||
pokegear_card_minimap | |||
# Give PokéNav MiniMap Card | |||
pokegear_card_frontier | |||
# Give PokéNav Frontier Emblem Card | |||
{ | {{FilePaths}} | ||
Latest revision as of 20:30, 22 January 2021
Introduction
Version 2 scripts were started in version 0.32 and will cease support in alpha version (v1.xx). Any script in Version 2 must have "version=2" as the first line of the script.
Commands are procedures that are used to tell the game what to do.
Constructs are functions that returns a value in the game.
Commands are written as @Command.SubCommand.
Constructs are written as <Construct.SubConstruct>.
Commands and constructs are not case sensitive.
A General Note to all GameMode Scripters ( Must Read )
- This page is currently updated as of v0.53.3 Script Library.
- This page contains information that is similar to what you can see when typing @help(command).
- The line number shown in the crash logs starts counting at the first non-empty line of a valid command or statement. However, any line after :while: statement are continuously counted until the end loop. If there are two repeating cycle within the while loop, the number of lines doubles.
Code Conventions
Header
The Header is used to define the ActionScript engine you want to use for the entire script. For each script file, the header must contain "version=2".
Statement
A Statement is used to make comparisons between constructs and parameters or to make conditions for the script to run.
There are a few Statements available in the game.
- :if:
- :else
- :endif
- :while:
- :exitwhile
- :endwhile
- :select:
- :when:
- :endwhen
- :end
- :endscript
- :return:
For more infomation about Statements and their usage, proceed to here.
Command Declaration
A Command is used to instruct the game with a set of procedures to run. They do not return any value.
You can define a Command with: @Class.Subclass
Construct Declaration
A Construct is used to instruct the game to return a value. They can be used with Commands and Statements.
You can define construct with: <Class.Subclass>
Temporary Global Variable
Global Variables are used when you want to use a variable on another script without having to redefine it again.
Assignments:
@Storage.set(str,Name,Text) @Storage.set(int,Name,Number) @Storage.set(sng,Name,Number) @Storage.set(dbl,Name,Number) @Storage.set(bool,Name,Boolean)
Basic math:
Addition: @Storage.update(int,Name,add,Value) @Storage.update(int,Name,+,Value)
Subtraction: @Storage.update(int,Name,substract,Value) @Storage.update(int,Name,-,Value)
Multiplication: @Storage.update(int,Name,multiply,Value) @Storage.update(int,Name,*,Value)
Division: @Storage.update(int,Name,divide,Value) @Storage.update(int,Name,/,Value)
String concatenation:
@Storage.update(str,Name,add,Message) @Storage.update(str,Name,+,Message)
Reading:
@Text.show(<Storage.get(str,Name)>) @Text.show(<Storage.get(int,Name)>)
Version 2 Class
Important info / definition of certain things before we get started.
By Default, the Argument Types are:
- Str ( Strings are defined as letters or symbols )
- Int ( Int (Integer) are defined as Integer numbers )
- Sng ( Sng (Single) are defined as Real numbers )
- ItemCollection ( ItemCollection are defined as {itemID|amount|price} )
- Bool ( Bool (Boolean) are defined either as True & False or 1 & 0 )
- IntArr ( IntArr are defined as an array of Integer numbers, usually with commas inbetween )
- StrArr ( StrArr are defined as an array of letters or symbols, usually with commas inbetween )
- SngArr ( SngArr are defined as an array of Real numbers )
- BoolArr ( BoolArr are defined as an array of words such as True, False )
- PokemonData ( PokemonData are defined as Pokemon Code )
- Arr ( Arr are defined as an array of something. )
For any Optional Argument, it will be underlined and have a red color, for example "Str1,Str2,Str3,..."
For any Array Argument, it will be surrounded by a grouped square bracket, for example "[Str1,Int2,Int3,Int4,Int5],Int6..."
Commands
Commands are scripts that tells the game what to do. A Command comes with a @ and usually with some arguments (between Parantheses like these)
The table below is split into sections by Command.
You may use the sort feature to make it list contents in 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
|
Statement
Statement 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: Yes. The script will be able to handle this.
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.
3. Can I stack :while: switches? Ans: No. Nilllzz officially said it is not possible.
: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:
More of a script function that return a value.
Typical Usage:
:return:True :end
Once you use <System.return>, it will return True.
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 ithe job
Typical Usage:
@Command.Subcommand(Argument Types) :end
Reserved Registers
Reserved Registers are registers that are reserved in the P3D engine and cannot be replaced by other events.
pokegear_card_radio # Give Player PokéGear Radio
pokegear_card_GTS # Give Player GTS Card
phone_contact_### # Add Phone Contact ID ###
pokegear_card_minimap # Give PokéNav MiniMap Card
pokegear_card_frontier # Give PokéNav Frontier Emblem Card
| 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 | |||||||||||||