Version 2 Scripts New

From Pokémon 3D Wiki
Jump to: navigation, search

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 tells 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>.


A General Note to all GameMode Scripters ( Must Read )

  1. This page is currently updated as of v0.53.3 Script Library.
  2. This page contains information that is similar to what you can see when typing @help(command).
  3. 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

Header is used to define the script engine you want to use for the entire action script. For each actionscript file, the header must contain "version=2".

Statement

Statement is used to make comparisons between constructs and parameters or to make conditions for the script to run.

There are a few statement available in the game.

  •  :if:
  •  :else
  •  :endif
  •  :while:
  •  :exitwhile
  •  :endwhile
  •  :select:
  •  :when:
  •  :endwhen
  •  :end
  •  :endscript
  •  :return:

For more infomation about statement and its usage, proceed here.

Command Declaration

Command is used to instruct the game with a set of procedures to run. They do not return any value.

You can define command by: @Class.Subclass

Construct Declaration

Construct is used to instruct the game to return a value. They can be used with commands and statement.

You can define construct by: <Class.Subclass>

Temporary Global Variable

Global Variable are used when you want to use a variable on the other script without having to redefine again.

Assignments:

@Storage.set(str,Name,Message)
@Storage.set(int,Name,Value)
@Storage.set(sng,Name,Value)
@Storage.set(dbl,Name,Value)
@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 ( 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 )
  • 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 underlined and in 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. It comes with @ and usually used with statement.

The table below is split into sections by Command.
You may use the sort feature to make it list according to alphanumeric order.


@Battle

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Battle.starttrainer(Str1) Plays the default reaction of a trainer. Str1 = trainerFile
The relative file path of the Trainer File without extension. (Pokemon\Scripts\trainer\xxx)
@Battle.trainer(Str1,Str2) Start a battle with a trainer. Str1 = trainerFile
The relative file path of the Trainer File without extension. (Pokemon\Scripts\trainer\xxx)
Str2 = additionalTrainerData
The additional trainer data. Accepted values: generate_pokemon_tower
@Battle.wild(PokemonData1,Str1)
@Battle.wild(Int1,Int2,Int3,Str1,Int4)
Starts a wild battle. PokemonData1 = pokemonData
The Pokémon Code.
Str1 = musicloop
The file name of the Music File without extension. (Pokemon\Content\Songs\xxx)

Int1 = pokemonID
The Pokémon national dex number.
Int2 = level
The Pokémon Level.
Int3 = shiny
-1 = Random, 0 = Not shiny, 1 = Always shiny. [Default value: -1]
Str1 = musicloop
The file name of the Music File without extension. (Pokemon\Content\Songs\xxx)
Int4 = introtype
0 = Black Checker Boxes, 1 = Black Horizontal Lines, 2 = Black Vertical Lines, 3 = Black Box Expand out, 4 = Black Box Expand in, 5 = White Checker Boxes, 6 = White Horizontal Lines, 7 = White Vertical Lines, 8 = White Box Expand out, 9 = White Box Expand in, 10-11 = Not useable, 12 = Blur Zoom in effect [Default value: 0-10]
@Battle.setvar(Str1,Str2) Sets a battle variable. Str1 = varName
The variables are canrun, cancatch, canblackout, canreceiveexp, canuseitems, frontiertrainer, divebattle, inversebattle, custombattlemusic and hiddenabilitychance.
Str2 = varValue
The value for the variable. Usually it is a Boolean. custombattlemusic is string, frontiertrainer and hiddenabilitychance is integer.
@Battle.resetvars Reset all battle variable.



@Camera

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Camera.set(Sng1,Sng2,Sng3,Sng4,Sng5) Sets the given properties of the camera. Sng1 = x
x coordinate of the object. ~ for player position.
Sng2 = y
y coordinate of the object. ~ for player position.
Sng3 = z
z coordinate of the object. ~ for player position.
Sng4 = yaw
The direction of the object in terms of left and right.
Sng5 = pitch
The direction of the object in terms of up and down. For pitch in terms of sound, refer this for more detail
@Camera.reset(Bool1) Resets the camera to the default setting. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.setyaw(Sng1) Sets the Yaw property of the camera. Sng1 = yaw
The direction of the object in terms of left and right.
@Camera.setpitch(Sng1) Sets the Pitch property of the camera. Sng1 = pitch
The direction of the object in terms of up and down. For pitch in terms of sound, refer this for more detail
@Camera.setposition(Sng1,Sng2,Sng3) Sets the Position property of the camera. Sng1 = x
x coordinate of the object. ~ for player position.
Sng2 = y
y coordinate of the object. ~ for player position.
Sng3 = z
z coordinate of the object. ~ for player position.
@Camera.setx(Sng1) Sets the X Position property of the camera. Sng1 = x
x coordinate of the object. ~ for player position.
@Camera.sety(Sng1) Sets the Y Position property of the camera. Sng1 = y
y coordinate of the object. ~ for player position.
@Camera.setz(Sng1) Sets the Z Position property of the camera. Sng1 = z
z coordinate of the object. ~ for player position.
@Camera.togglethirdperson(Bool1) Toggles the third person camera. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.activatethirdperson(Bool1) Activates the third person camera. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.deactivethirdperson(Bool1) Deactivates the third person camera. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.deactivatethirdperson(Bool1) Deactivates the third person camera. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.setthirdperson(Bool1,Bool2) Set the camera to third person camera. Bool1 = thirdPerson
This is undocumented in Wiki Script Library.
Bool2 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.fix(Bool1) Fixes the camera to the current position. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.defix(Bool1) Defixes the camera so that it clips behind the player again. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.togglefix(Bool1) Sets the fix state of the camera to the opposite of the current state. Bool1 = doCameraUpdate
Sets if the camera should update or not. [Default value: True]
@Camera.update Update the camera.
@Camera.setfocus
@Camera.setfocustype
@Camera.setfocusid
@Camera.resetfocus
@Camera.settoplayerfacing

@Chat

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Chat.clear Clears the chat.



@Daycare

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Daycare.takeegg(Int1) Removes the egg from the daycare and adds it to the player's party. Int1 = daycareID
ID of the Daycare you are referring to.
@Daycare.takepokemon(Int1,Int2) Takes a Pokémon from the daycare to the player's party. Int1 = daycareID
ID of the Daycare you are referring to.
Int2 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
@Daycare.leavepokemon(Int1,Int2,Int3) Removes a Pokémon from the player's party and fills the given PokemonDaycareIndex with that Pokémon. Int1 = daycareID
ID of the Daycare you are referring to.
Int2 = PokemonDaycareIndex
Daycare slot for Pokémon to be stored in.
Int3 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
@Daycare.removeegg(Int1) Removes the egg from the daycare. Int1 = daycareID
ID of the Daycare you are referring to.
@Daycare.clean(Int1) Cleans all data for the given daycare. This doesn't remove the data, just rearranges it. Int1 = daycareID
ID of the Daycare you are referring to.
@Daycare.call(Int1) Initializes a call with the daycare. This checks if the daycare is registered in the Pokégear. Int1 = daycareID
ID of the Daycare you are referring to.
@Daycare.cleardata(Int1) Clears all the data for one daycare. That includes the Pokémon stored there and a potetial egg. Int1 = daycareID
ID of the Daycare you are referring to.



@Entity

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Entity.showmessagebulb(Int1|Sng1|Sng2|Sng3) Displays a message bulb in the world. Int1 = bulbID
ID of the message Bulb. ( 0 = Waiting, 1= Exclamation, 2 = Shouting, 3 = Question, 4 = Note, 5 = Heart, 6 = Unhappy, 7 = Happy, 8 = Friendly, 9 = Poisoned, 10 = Battle, 11 = Wink, 12 = AFK, 13 = Angry, 14 = CatFace, 15 = Unsure )
Sng1 = x
x coordinate of the object. ~ for player position.
Sng2 = y
y coordinate of the object. ~ for player position.
Sng3 = z
z coordinate of the object. ~ for player position.
@Entity.warp(Int1,Sng1,Sng2,Sng3) Warps the entity to a new location on the map. Int1 = entityID
ID of the Entity you are referring to.
Sng1 = x
x coordinate of the object. ~ for player position.
Sng2 = y
y coordinate of the object. ~ for player position.
Sng3 = z
z coordinate of the object. ~ for player position.
@Entity.setscale(Int1,Sng1,Sng2,Sng3) Changes the Scale property of the selected entity. Int1 = entityID
ID of the Entity you are referring to.
Sng1 = xS
The scale of the object in terms of x coordinate.
Sng2 = yS
The scale of the object in terms of y coordinate.
Sng3 = zS
The scale of the object in terms of z coordinate.
@Entity.remove(Int1) Removes the entity from the map once it updates. Int1 = entityID
ID of the Entity you are referring to.
@Entity.setid(Int1,Int2) Sets the entity ID of the selected entity to a new ID. Int1 = entityID
ID of the Entity you are referring to.
Int2 = newID
Change the Old ID into this new ID.
@Entity.setopacity(Int1,Int2) Sets the Opacity property of the selected entity. "opacity" in %. Int1 = entityID
ID of the Entity you are referring to.
Int2 = opacity
To set the opacity of the object from transparent: 0 to opaque: 100.
@Entity.setvisible(Int1,Bool1) Sets the Visible property of the selected entity. Int1 = entityID
ID of the Entity you are referring to.
Bool1 = visible
The visibility of the object.
@Entity.setadditionalvalue(Int1,Str1) Sets the AdditionalValue property of the selected entity. Int1 = entityID
ID of the Entity you are referring to.
Str1 = additionalValue
The additional value for the object.
@Entity.setcollision(Int1,Bool1) Sets the Collision property of the selected entity. Int1 = entityID
ID of the Entity you are referring to.
Bool1 = collision
Whether the player can walk through the object.
@Entity.settetxure(Int1,Str1,[Str2,Int2,Int3,Int4,Int5]) Sets the texture in the selected entity's texture array. Argument example: 0,0,[nilllzz,0,10,32,32] Int1 = entityID
ID of the Entity you are referring to.
Str1 = textureIndex
The texture index value.
Str2 = textureName
The texture file name.
Int2 = rX
The start coordinate of the texture rectangle.
Int3 = rY
The start coordinate of the texture rectangle.
Int4 = rWidth
The width of the texture rectangle.
Int5 = rHeight
The height of the texture rectangle.
@Entity.addtoposition(Int1,Sng1,Sng2,Sng3) Adds the given coordinates to the position of the given entity. Int1 = entityID
ID of the Entity you are referring to.
Sng1 = x
x coordinate of the object. ~ for player position.
Sng2 = y
y coordinate of the object. ~ for player position.
Sng3 = z
z coordinate of the object. ~ for player position.



@Environment

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Environment.setweather(Int1) Changes the weather of the current map. Int1 = weatherID
The ID of the weather. ( 0 = Current Region Weather, 1 = Clear, 2 = Rain, 3 = Snow, 4 = Underwater, 5 = Sunny, 6 = Fog, 7 = Sandstorm, 8 = Ash, 9 = Blizzard )
@Environment.setregionweather(Int1) Changes the weather of the current region. Int1 = weatherID
The ID of the weather. ( 0 = Current Region Weather, 1 = Clear, 2 = Rain, 3 = Snow, 4 = Underwater, 5 = Sunny, 6 = Fog, 7 = Sandstorm, 8 = Ash, 9 = Blizzard )
@Environment.setcanfly(Bool1) Sets the "CanFly" parameter of the current map. Bool1 = canfly
Whether the player can use fly.
@Environment.setcandig(Bool1) Sets the "CanDig" parameter of the current map. Bool1 = candig
Whether the player can use dig.
@Environment.setcanteleport(Bool1) Sets the "CanTeleport" parameter of the current map. Bool1 = canteleport
Whether the player can use teleport.
@Environment.setwildpokemongrass(Bool1) Sets the "WildPokemonGrass" parameter of the current map. Bool1 = canencounter
Whether you can encounter Pokémon.
@Environment.setwildpokemonwater(Bool1) Sets the "WildPokemonWater" parameter of the current map. Bool1 = canencounter
Whether you can encounter Pokémon.
@Environment.setwildpokemoneverywhere(Bool1) Sets the "WildPokemonEverywhere" parameter of the current map. Bool1 = canencounter
Whether you can encounter Pokémon.
@Environment.setisdark(Bool1) Sets the "IsDark" parameter of the current map. Bool1 = isDark
Whether the place is dark.
@Environment.setrenderdistance(Int1) Sets the render distance. Int1 = distance
The render distance. ( 0-4 tiny, small, normal, far, extreme )
@Environment.toggledarkness Toggles the "IsDark" parameter of the current map.



@Item

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Item.give(Int1,Int2)
@Item.give(Str1,Int2)
Adds the given amount of items to the player's inventory. Int1 = ItemID
The Item ID.
Int2 = Amount
Amount of the item to be given or taken away. [Default value: 1]

Int1 = ItemName
The Item name.
Int2 = Amount
Amount of the item to be given or taken away. [Default value: 1]
@Item.remove(Int1,Int2,Bool1)
@Item.remove(Str1,Int2,Bool1)
Removes the given amount of items from the player's inventory. Displays a message afterwards, if "showMessage" is true. Int1 = ItemID
The Item ID.
Int2 = Amount
Amount of the item to be given or taken away. [Default value: 1]
Bool1 = showMessage
whether to show the message prompt. [Default value: True]

Str1 = ItemName
The Item name.
Int2 = Amount
Amount of the item to be given or taken away. [Default value: 1]
Bool1 = showMessage
whether to show the message prompt. [Default value: True]
@Item.clearitem(Int1)
@Item.clearitem(Str1)
Clears all items with the given ID from the player's inventory. Clears the whole inventory if ItemID is empty. Int1 = ItemID
The Item ID.

Int1 = ItemName
The Item name.
@Item.messagegive(Int1,Int2)
@Item.messagegive(Str1,Int2)
Displays a message for getting the specified amount of items. Int1 = ItemID
The Item ID.
Int2 = Amount
Amount of the item to be given or taken away. [Default value: 1]

Str1 = ItemName
The Item name.
Int2 = Amount
Amount of the item to be given or taken away. [Default value: 1]
@Item.repel(Int1) Adds the steps of the repel to the repel steps of the player. Int1 = RepelItemID
The Repel ID. ( 20 = Repel, 42 = Super Repel, 43 = Max Repel )



@Level

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Level.wait(Int1) Makes the level idle for the duration of the given ticks. Int1 = ticks
The amount of ticks. Usually 10 ticks is about 1 second.
@Level.update Updates the level and all entities once.
@Level.waitforevents Makes the level idle until every NPC movement is done.
@Level.waitforsave Makes the level idle until the current saving of an GameJolt save is done.
@Level.reload Reloads the current map.
@Level.setsafari(Bool1) Sets if the current map is a Safari Zone (influences battle style). Bool1 = safari
Change the battle style to safari.



@Music

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Music.play(Str1) Changes the currently playing music to a new one. Str1 = musicFile
The file name of the Music File without extension. (Pokemon\Content\Songs\xxx)
@Music.setmusicloop(Str1) Sets the map musicloop to a new musicfile. Str1 = musicFile
The file name of the Music File without extension. (Pokemon\Content\Songs\xxx)
@Music.stop Stops the music playback.
@Music.pause Pauses the music playback.
@Music.resume Resumes the music playback.



@NPC

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@NPC.remove
@NPC.position
@NPC.warp
@NPC.addtoposition
@NPC.register
@NPC.unregister
@NPC.wearskin
@NPC.move
@NPC.setMoveY
@NPC.moveasync
@NPC.turn
@NPC.spawn
@NPC.setspeed


@Options

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Options.show
@Options.setcancelindex


@Player

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Player.receivepokedex
@Player.receivepokegear
@Player.renamerivel
@Player.wearskin
@Player.setonlineskin
@Player.move
@Player.moveasync
@Player.turn
@Player.turnasync
@Player.turnto
@Player.turntoasync
@Player.warp
@Player.stopmovement
@Player.addmoney
@Player.money
@Player.setmovement
@Player.resetmovement
@Player.getbadge
@Player.achieveemblem
@Player.addbp
@Player.showrod
@Player.hiderod
@Player.showpokemonfollow
@Player.hidepokemonfollow
@Player.togglepokemonfollow
@Player.save
@Player.setrivalname


@Pokedex

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Pokedex.setautodetect(Bool1) Sets if the Pokédex registers seen Pokémon in wild or trainer battles. Bool1 = autodetect
Sets if the Pokédex registers seen Pokémon in wild or trainer battles.



@Pokemon

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Pokemon.cry(Int1) Plays the cry of the given Pokémon. Int1 = pokemonID
The Pokémon national dex number.
@Pokemon.remove(Int1) Removes the Pokémon at the given party index. Int1 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
@Pokemon.add(Int1,PokemonData1)
@Pokemon.add(Int1,Int2,Str1,Int3,Str2,Bool1,Str3)
Adds the Pokémon to the player's party.
Adds the Pokémon with the given arguments to the player's party.
Int1 = insertIndex
This is undocumented in Wiki Script Library. [Default value: Pokemon Count]
PokemonData1 = pokemonData
The Pokémon Code.

Int1 = pokemonID
The Pokémon national dex number.
Int2 = level
The Pokémon Level.
Str1 = method
This is undocumented in Wiki Script Library. [Default value: random reason]
Int3 = ballID
This is undocumented in Wiki Script Library. [Default value: 5]
Str2 = location
This is undocumented in Wiki Script Library. [Default value: Current location]
Bool1 = isEgg
This is undocumented in Wiki Script Library. [Default value: False]
Str3 = trainerName
This is undocumented in Wiki Script Library. [Default value: Current TrainerName]
@Pokemon.setadditionalvalue(Int1,Str1) Set the additional data for a Pokémon in the player's party. Int1 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
Str1 = data
This is undocumented in Wiki Script Library.
@Pokemon.setadditionaldata(Int1,Str1) Set the additional data for a Pokémon in the player's party. Int1 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
Str1 = data
This is undocumented in Wiki Script Library.
@Pokemon.setnickname(Int1,Str1) Set the nick name for a Pokémon in the player's party. Int1 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
Str1 = nickName
This is undocumented in Wiki Script Library.
@Pokemon.setstat(Int1,Str1,Int2) Set the value of a stat for a Pokémon in the player's party. Int1 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
Str1 = statName
Set the Stats. ( chp, hp, maxhp, atk, attack, def, defense, spatk, spattack, specialattack, spdef, spdefense, specialdefense, speed )
Int2 = statValue
This is undocumented in Wiki Script Library.
@pokemon.clear
@pokemon.removeattack
@pokemon.clearattacks
@pokemon.addattack
@pokemon.setshiny
@pokemon.changelevel
@pokemon.gainexp
@pokemon.setnature
@pokemon.npcTrade genderID: 0-2

@Radio

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Radio.allowchannel
@Radio.blockchannel


@Register

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Register.register
@Register.unregister
@Register.registertime


@Screen

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Screen.storagesystem
@Screen.apricornkurt
@Screen.trade
@Screen.townmap
@Screen.donation
@Screen.blackout
@Screen.fadein
@Screen.fadeout
@Screen.credits
@Screen.halloffame
@Screen.teachmoves
@Screen.mailsystem
@Screen.pvp
@Screen.input
@Screen.mysteryevent
@Screen.showPokemon


@Script

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Script.start
@Script.text
@Script.run


@Sound

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Sound.play
@Sound.playadvanced


@Storage

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Storage.set
@Storage.clear
@Storage.update


@Text

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]
@Text.show
@Text.setfont
@Text.debug
@Text.log


@Title

Command [@Command.Subcommand(Argument Types)] Description Inputs [Argument Types = Argument Name]


@Title.add(Str1,Sng1,Int1,Int2,Int3,Sng2,Bool1,Sng3,Sng4) Adds a new title for the game to display during gameplay. Str1 = text
Define the text to display. [Default value: Sample Text]
Sng1 = delay
The amount of ticks before it fade out. 10 ticks is about 1 second. [Default value: 20.0]
Int1 = R
The red color value. [Default value: 255]
Int2 = G
The green color value. [Default value: 255]
Int3 = B
The blue color value. [Default value: 255]
Sng2 = scale
The size of the text. [Default value: 10.0]
Bool1 = isCentered
Whether the text is at the center. [Default value: true]
Sng3 = x
x coordinate of the object. ~ for player position. [Default value: 0.0]
Sng4 = y
y coordinate of the object. ~ for player position. [Default value: 0.0]
@Title.clear 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

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]


<Battle.defeatmessage(Str1)> Returns the defeat message of the trainer loaded from the given "trainerFile". Str1 = trainerFile
The relative file path of the Trainer File without extension. (Pokemon\Scripts\trainer\xxx)
<Battle.intromessage(Str1)> Returns the intro message of the trainer loaded from the given "trainerFile". Str1 = trainerFile
The relative file path of the Trainer File without extension. (Pokemon\Scripts\trainer\xxx)
<Battle.outromessage(Str1)> Returns the outro message of the trainer loaded from the given "trainerFile". Str1 = trainerFile
The relative file path of the Trainer File without extension. (Pokemon\Scripts\trainer\xxx)
<Battle.won> Returns "true" if the player won the last battle. Returns "false" otherwise.



Camera

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]


<Camera.isfixed> Returns if the camera is fixed to a specific position.
<Camera.x> Returns the current X position of the camera.
<Camera.y> Returns the current Y position of the camera.
<Camera.z> Returns the current Z position of the camera.



Daycare

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]


<Daycare.pokemonID(Int1,Int2)> Returns the Pokémon ID of a Pokémon in the daycare. Int1 = daycareID
ID of the Daycare you are referring to.
Int2 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
<Daycare.pokemonName(Int1,Int2)> Returns the name of a Pokémon in the daycare. Int1 = daycareID
ID of the Daycare you are referring to.
Int2 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
<Daycare.pokemonSprite(Int1,Int2)> Returns the sprite of a Pokémon in the daycare. Int1 = daycareID
ID of the Daycare you are referring to.
Int2 = pokemonIndex
The index of the Pokémon. First Pokémon start from zero.
@Daycare.shinyIndicator
@Daycare.countpokemon
@Daycare.haspokemon
@Daycare.canswim
@Daycare.hasegg
@Daycare.grownlevels
@Daycare.currentlevel
@Daycare.canbreed


Entity

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@Entity.visible
@Entity.opacity
@Entity.position
@Entity.positionx
@Entity.positiony
@Entity.positionz
@Entity.scale
@Entity.additionalvalue
@Entity.collision


Environment

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@environment.daytime
@environment.daytimeID
@environment.season
@environment.seasonID
@environment.day
@environment.dayofyear
@environment.dayinformation
@environment.week
@environment.year
@environment.weather
@environment.mapweather
@environment.currentmapweather
@environment.weatherid
@environment.mapweatherid
@environment.currentmapweatherid
@environment.regionweather
@environment.regionweatherid
@environment.canfly
@environment.candig
@environment.canteleport
@environment.wildpokemongrass
@environment.wildpokemonwater
@environment.wildpokemoneverywhere
@environment.isdark


Inventory

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@inventory.countitem
@inventory.countitems
@inventory.name
@inventory.ID


Level

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@level.mapfile
@level.levelfile
@level.filename
@level.riding
@level.surfing


Math

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@math.int
@math.sng
@math.abs
@math.ceiling
@math.floor
@math.isint
@math.issng


NPC

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@npc.position
@npc.exists
@npc.ismoving
@npc.moved
@npc.skin
@npc.facing
@npc.ID
@npc.name
@npc.action
@npc.additionalvalue
@npc.movement
@npc.hasmoverectangles
@npc.trainertexture


Phone

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@phone.callflag
@phone.got


Player

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@player.position
@player.hasbadge
@player.skin
@player.velocity
@player.ismoving
@player.facing
@player.compass
@player.money
@player.name
@player.gender
@player.bp
@player.badges
@player.thirdperson
@player.rival
@player.rivalname
@player.ot
@player.gamejoltid


Pokedex

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@pokedex.caught
@pokedex.seen
@pokedex.shiny


Pokemon

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@pokemon.id
@pokemon.number
@pokemon.data
@pokemon.level
@pokemon.hasfullhp
@pokemon.hp
@pokemon.atk
@pokemon.def
@pokemon.spatk
@pokemon.spdef
@pokemon.speed
@pokemon.maxhp
@pokemon.isegg
@pokemon.additionaldata
@pokemon.nickname
@pokemon.name
@pokemon.ot
@pokemon.trainer
@pokemon.itemid
@pokemon.friendship
@pokemon.itemname
@pokemon.catchball
@pokemon.catchmethod
@pokemon.catchlocation
@pokemon.hasattack
@pokemon.countattacks
@pokemon.attackname
@pokemon.isShiny
@pokemon.nature
@pokemon.ownpokemon
@pokemon.islegendary
@pokemon.freeplaceinparty
@pokemon.nopokemon
@pokemon.count
@pokemon.countbattle
@pokemon.has
@pokemon.selected
@pokemon.selectedmove
@pokemon.hasegg
@pokemon.maxpartylevel
@pokemon.evhp
@pokemon.evatk
@pokemon.evdef
@pokemon.evspatk
@pokemon.evspdef
@pokemon.evspeed
@pokemon.ivhp
@pokemon.ivatk
@pokemon.ivdef
@pokemon.ivspatk
@pokemon.ivspdef
@pokemon.spawnwild
@pokemon.itemdata
@pokemon.countHallofFame
@pokemon.learnedTutorMove
@pokemon.totalexp
@pokemon.needexp
@pokemon.currentexp
@pokemon.generateFrontier
@pokemon.spawnwild
@pokemon.spawn
@pokemon.OTmatch
@pokemon.randomOT
@pokemon.status
@pokemon.canevolve
@pokemon.type1
@pokemon.type2
@pokemon.istype


Radio

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@radio.currentchannel


Register

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@register.registered
@register.count
@register.type
@register.value


Rival

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@Rival.name


Storage

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@storage.get
@storage.count


System

Construct [<Construct.SubConstruct(Argument Types)>] Description Inputs [Argument Types = Argument Name]
@system.random
@system.unixtimestamp
@system.dayofyear
@system.year
@system.booltoint
@system.calcint
@system.int
@system.calcsng
@system.sng
@system.sort
@system.isinsightscript
@system.lastinput
@system.return
@system.isint
@system.issng
@system.chrw


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
Pokemon Folder Launcher
Content ContentPacks GameModes maps Saves Screenshots Scripts Version History
Pokemon GameMode.dat poke Save Folder V1 V2 trainer map
Data Party.dat Player.dat Options.dat