Version 2 Scripts
Version 2 scripts were started in version 0.32. Any script in Version 2 must have "version=2" as the first line of the script.
Commands are written as @command.subcommand and are no longer case sensitive. All commands require a subcommand.
Constructs were also expanded to be <construct.subconstruct> and can be used with switches too.
Commands
Commands always have a subcommand and sometimes one or more arguments. All combinations will be listed below.
Arguments in bold (e.g. Argument) are optional.
The table below is split into sections by Command.
When an example is given for a possible value for an argument (e.g. "argument"), don't include the quotation marks in your actual command.
Unless otherwise specified a bool can be either 1 (true/on) or 0 (false/off). Unless otherwise specified X,Y,Z is a three dimensional position. Unless otherwise specified TradeItem means an array defined as follows: {ItemID|Amount|Price}
- ItemID (int) - ID of the item that is being sold. See Items
- Amount (int) - The amount of the item available for sale. When the value is "-1", there's an infinite amount available.
- Price = The price of the item. When the value is "-1", the default price of that item is used.
Subcommand | Job | Inputs |
---|---|---|
@Title | ||
.Add(Text,Delay,R,G,B,Scale,IsCentered,X,Y) | Adds a new title for the game to display during gameplay. | Text (str) - The text to display. Delay (sng) - How long it takes before the text disappears (default value is: 20.0) R,G,B (int) - Red, Green & Blue color values for the text (default values are: 255,255,255). Scale (sng) - How big the text should be rendered (default value is: 10.0) IsCentered (bool) - If the text is centered or not. (default value is: 1) X,Y (sng) - Coordinates at which the text is displayed. (default values are: 0.0, 0.0) |
.Clear | Clears all titles that are currently being displayed. | None |
@Camera | ||
.ActivateThirdPerson | Activates the third person camera. | None |
.DeactivateThirdPerson | Deactivates the third person camera. | None |
.ToggleThirdPerson | Sets the camera mode to the opposite of the current mode (first person or third person). | None |
.Fix | Fixes the camera to the current position. | None |
.Defix | Defixes the camera so that it clips behind the player again. | None |
.ToggleFix | Sets the fix state of the camera to the opposite of the current state. | None |
.Set(X,Y,Z,Yaw,Pitch) | Changes the position and rotation of the camera. | X,Y,Z (sng) - The new position of the camera. Yaw (sng) - The new Yaw (horizontal) rotation of the camera. Pitch (sng) - The new Pitch (vertical) rotation of the camera. |
.SetPitch(Value) | Changes the Pitch (vertical) rotation of the camera. | Value (sng) - The new value for the Pitch rotation. |
.SetYaw(Value) | Changes the Yaw (horizontal) rotation of the camera. | Value (sng) - The new value for the Yaw rotation. |
.SetPosition(X,Y,Z) | Changes the position of the camera. | X,Y,Z (sng) - The new position for the camera. |
.SetX(Value) | Changes the X-coordinate of the camera. | Value (sng) - The new value for the X-coordinate. |
.SetY(Value) | Changes the Y-coordinate of the camera. | Value (sng) - The new value for the Y-coordinate. |
.SetZ(Value) | Changes the Z-coordinate of the camera. | Value (sng) - The new value for the Z-coordinate. |
.SetFocus(FocusType,FocusID) | Focuses the camera on an object. | FocusType (str) - Can be "Player", "NPC", or "Entity". FocusID - The ID of the NPC or Entity to focus on. |
.SetFocusType(FocusType) | Sets the focus type for the camera. | FocusType - Can be "Player", "NPC", or "Entity". |
.SetFocusID(FocusID) | Sets the ID of the focus target for the camera. | FocusID - The ID of the NPC or Entity to focus on |
.SetToPlayerFacing | Sets the Yaw rotation of the camera to the direction in which the player is facing. | None |
.Reset | Resets the camera to its default location and rotation. | None |
.Update | Updates the camera. This is often used when dealing with things like fading the screen in and out during a script or when a property of the camera is changed. | None |
@Options | ||
.Show(Options,Flag) | Displays a choose box with the given options. See section below: @Options.Show Explanation. |
Options (str) - The options to display,divided by comma's (,) Flag (str) - If this is set to "TEXT=FALSE", only the options box will be visible (not the text message box). |
.SetCancelIndex(Index) | Sets the cancel index of the next choose box. This index gets chosen when the player presses a back key (like "E"). | Index - The chosen index. |
@Text | ||
.Show(Text) | Displays a textbox with the given text. | Text (str) - The text to display. |
.SetFont(FontName) | Changes the font of the textbox. All fonts from loaded ContentPacks, GameModes and the standard game can be loaded. | FontName (str) - The name of the font file (without the extension) |
.Notification(Message, Delay,BackgroundIndex,IconIndex,SoundEffect,ScriptFile,Priority) | Displays a notification popup. | Message (str) = Message to be displayed in the notification popup. Delay = Delay in 100th of a second before the notification popup disappears (default = 500). BackgroundIndex (int) = Index of background texture in "Textures\Notifications\Backgrounds.png" (default = 0). IconIndex (int) = Index of icon texture in "Textures\Notifications\Icons.png" (default = 0) SoundEffect (str) = Sound effect to play when the notification popup appears. ScriptFile (str) = Path to the script file to execute when interacting with the notification popup relative to "Data\Scripts\Trainer\". Priority (bool) = If the notifications popup should be given priority when there are multiple popups in a row (default = 0). |
.Log(Text) | Logs the given text in log.dat. | Text (str) - The text to log. |
@Sound | ||
.Play(Sound,StopMusic) | Plays a sound. | Sound (str) - The path to the sound (without the extension) relative to "Sounds\". StopMusic (bool) - If the music should be paused until the sound has finished playing (default = 0). |
.PlayAdvanced(Sound,StopMusic,Pitch,Pan,Volume) | Plays a sound with advanced parameters. | Sound (str) - The path to the sound (without the extension) relative to "Sounds\". StopMusic (bool) - If the music should be paused until the sound has finished playing (default = 0). Pitch (sng) - The pitch adjustment of the sound, ranging from -1.0 (down an octave) to 0.0 (no change) to 1.0 (up an octave). Pan (sng) - Panning, ranging from -1.0 (left speaker) to 0.0 (centered), to 1.0 (right speaker). Volume (sng) - Volume, ranging from 0.0 (silence) to 1.0 (full volume). |
@Music | ||
.Play(Music) | Stops the currently playing music and plays a new one until the song is changed by another command or a new map. | Music (str) - The path to the song (without the extension) relative to "Music\". |
.Pause | Pauses the music playback (and keeps track of when it was paused, so it can be resumed later). | None |
.Resume | Resumes the music playback starting from when it was paused. | None |
.Mute | Silences the music playback (but keeps it playing while silent). | None |
.Unmute | Reverts the volume of the music playback back to what it was before. | None |
.Stop | Stops the music playback. | None |
.SetMusicLoop(Music) | Sets the currently playing song to a new one until the song is changed by another command or a new map. This doesn't reset the playback position to the start like @Music.Play does. | Music (str) - The path to the song (without the extension) relative to "Music\". |
@Battle | ||
.StartTrainer(TrainerFilePath) | Initializes a trainer interaction and checks the register if the player has already beaten that trainer. | TrainerFilePath (str) - The file path of the TrainerFile (.trainer) without the extension, relative to "Data\Scripts\Trainer\". |
.Trainer(TrainerFilePath) | Initializes a trainer battle without displaying an intro message or checking the register. | TrainerFilePath (str) - The file path of the TrainerFile (.trainer) without the extension, relative to "Data\Scripts\Trainer\". |
.Wild(PokémonData,IntroMusic) | Initializes a wild battle against the given Pokémon. | PokémonData - The Pokemon Code. IntroMusic - The path to the music that is played when the battle starts (without the extension) relative to "Songs\". |
.Wild(PokémonID,Level,Shiny,IntroMusic,IntroType) | Initializes a wild battle against the given Pokemon. | PokémonID (int) - The national dex number of a Pokémon. Level - The level of a Pokémon. Shiny (int) - -1 = Random, 0 = Not shiny, 1 = Always shiny. Default value: -1 IntroMusic - The path to the music that is played when the battle starts (without the extension) relative to "Songs\". IntroType (int) - 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-9 |
.SetVars(Variable,Value) | Changes the given battle variable to the given boolean. | Variable - The variable to change. Can be: CanRun, CanCatch, CanBlackout, CanReceiveExp, CanUseItems, FrontierTrainer, DiveBattle, InverseBattle, CustomBattleMusic, HiddenAbilityChance Value - The value to change the variable to. |
.ResetVars | Resets the battle variables to their default value. | None |
@Level | ||
.Reload | Reloads the current map. | None |
.Update | Updates the level and all entities once. | None |
.Wait(Ticks) | Waits for the duration of the given ticks before continuing. | Ticks - The time to wait. |
.WaitForEvents | Waits for all other scripts to finish before continuing(including @NPC.MoveAsync()). | |
.SetSafari(Value) | Sets if the current map is a Safari Zone (influences battle style). | Value (bool) - 1 (the current map is a Safari Zone) or 0 (the current map is not a Safari Zone) |
@Entity | ||
.ShowMessageBulb(BulbID|X|Y|Z) | Displays the given Message Bulb at the given position | :/ ) X|Y|Z (sng) - The position of the Message Bulb. |
.Warp(EntityID,X,Y,Z) | Warps the given entity to the given position on the map. | EntityID (int) - ID of an entity on the map. X,Y,Z (sng) - The new position. |
.AddToPosition(EntityID,X,Y,Z) | Adds the given coordinates to the position of the given entity. | EntityID (int) - ID of an entity on the map. X,Y,Z (sng) - The coordinates to add to the position (can be negative). |
.Remove(EntityID) | Removes the given entity from the map until the map is loaded again. | EntityID (int) - ID of an entity on the map. |
.SetID(OldID,NewID) | Changes the ID of the given entity. | OldID - ID of an entity on the map. NewID - The new ID for the entity. |
.SetScale(EntityID,xScale,yScale,zScale) | Changes the scale (size) property of the selected entity. | EntityID (int) - ID of an entity on the map. xScale,yScale,zScale (sng) - The new scale. |
.SetOpacity(EntityID,Opacity) | Changes the opacity (transparency) of the given entity to the given value. | EntityID (int) - ID of an entity on the map. Opacity (int) - The opacity to set the entity to (in %). |
.SetVisible(EntityID,Visible) | Changes the whether the entity is visible or not. | EntityID (int) - ID of an entity on the map. Visible (bool) - The value to change the visibility property to. |
.SetAdditionalValue(EntityID,Value) | Changes the AdditionalValue of the given entity to the given value. | EntityID (int) - ID of an entity on the map. Value (str) - The value to change the AdditionalValue property to. |
.SetCollision(EntityID,Collision) | Changes whether the player can walk through the given entity or not. | EntityID (int) - ID of an entity on the map. Collision (bool) - The value to change the collision property to. |
.SetTexture(EntityID,TextureIndex,TextureName,X,Y,Width,Height) | Sets the texture in the selected entity's texture array. Example: @Entity.SetTexture(0,0,Routes,112,64,16,32) | EntityID (int) - ID of an entity on the map. TextureIndex (int) - The face of the given entity to change. TextureName (str) - The texture file from which to get the new texture. X (int) - First pixel of the rectangle on the X-axis (horizontal). Y (int) - First pixel of the rectangle on the Y-axis (vertical). Width - How many pixels wide the rectangle is (X-axis). Height - How many pixels tall the rectangle is (Y-axis). |
@Item | ||
.Give(ItemID,Amount) | Adds the given amount of items to the player's inventory. | ItemID (int) - The ID of the item to give. See Items. Amount (int) - The amount of the item to give. (Default value is: 1). |
.MessageGive(ItemID,Amount) | Displays a message for getting the specified amount of items. | ItemID (int) - The ID of the item to give. Amount (int) - The amount of the item to give. (Default value is: 1). |
.ClearItem(ItemID,Amount) | Clears all items with the given ID from the player's inventory. Clears the whole inventory if ItemID is empty. | ItemID (int) - The ID of the item to remove. Amount - The amount of the item to remove. |
.Remove(ItemID,Amount,ShowMessage) | Removes the given amount of items from the player's inventory. Displays a message afterwards, if the "ShowMessage" argument is 1 (true). | ItemID (int) - The ID of the item to remove. Amount (int) - The amount of the item to give. (Default value is: 1). ShowMessage (bool) - Whether a message should be displayed or not (Default value is: 1) |
.Repel(RepelItemID) | Adds the steps of the Repel to the Repel steps of the player. | RepelItemID (int) - The item ID of a repel. Possible values: "20" (100 steps), "42" (200 steps), "43" (250 steps) |
@Chat | ||
.Clear | Clears the chat. | None |
@Screen | ||
.Input(DefaultInput,InputMode,CurrentInput,MaxChars) | Displays the Keyboard Input screen. The input can be retrieved with the construct <System.LastInput>. | DefaultInput (str) - The text that appears when the button "Default" is clicked. InputMode (int) - The input mode; 0 for regular text, 1 for numbers only and 2 for names. CurrentInput (str) - The text that displays in the input box when the screen is first loaded. MaxChars (int) - Number of characters allowed. |
.ShowPokemon(PokemonID,Shiny,Front) | Displays a box and an image of the specified Pokemon. | PokemonID (int) - A Pokemon dex number. Shiny (bool) - Determines if the Pokemon is shiny Front (bool) - Determines if the front(1) or back(0) is shown. |
.ShowImage(Texture,SoundEffect,X,Y,Width,Height) | Displays a box and (part of a) texture image. | Texture (str) - The path to a texture. SoundEffect (str) - The path to a sound effect file to play when the image is displayed (can be left empty). X (int) - First pixel of the texture rectangle on the X-axis (horizontal). Y (int) - First pixel of the texture rectangle on the Y-axis (vertical). Width - How many pixels wide the texture rectangle is (X-axis). Height - How many pixels tall the texture rectangle is (Y-axis). |
.ShowMessageBox(Message|BackgroundColor|FontColor|BorderColor) | Displays a dynamically sized customizable message box in the center of the screen. | Message (str) - The message to display BackgroundColor (intArr) - A list of integers specifying the RGB values of the background color of the textbox e.g. 255,255,255 for pure white. FontColor (intArr) - A list of integers specifying the RGB values of the font color e.g. 0,0,0 for pure black. BorderColor (intArr) - A list of integers specifying the RGB values of the border color of the textbox e.g. 0,0,0 for pure black. |
.FadeOutColor(Color) | Sets the color of the screen fade. | Color (intArr) - A list of integers specifying the RGB values of the screen fade color e.g. 255,255,255 for pure white (Default value is: 0,0,0 which is pure black). Values can range from 0 - 255. |
.FadeIn(FadeSpeed) | Fades the screen in from the FadeOutColor (Which is black by default). | FadeSpeed (int) - How fast to fade the screen in (Default value is: 5). |
.FadeOut(FadeSpeed) | Fades the screen out to the FadeOutColor (Which is black by default). | FadeSpeed (int) - How fast to fade the screen out (Default value is: 5). |
.SetFade(Alpha) | Sets the alpha (transparency) value of the screen fade. | Alpha (int) - The transparency of the screen fade. Values can range from 0 - 255. |
.ApricornKurt | Displays the Apricorn selection screen. | None |
.Credits(Region) | Displays the credits scene. | Region (str) - The region to use maps from. Currently this is hardcoded (Default value is: Johto). |
.Donation | Displays the list of donators. | None |
.Blackout | Displays the blackout message screen and warps the player back to the last restplace. | None |
.MysteryEvent | Displays the Mystery Event screen. | None |
.HallOfFame(Record) | Displays the given Hall of Fame record(s). | Record (int) - The Hall of Fame record to display. If not specified, then it will displays all records. |
.MailSystem | Displays the PC Inbox screen. | None |
.SkinSelection | Displays the Player Skin selection screen. The skin selected in this screen can be retrieved using the construct <Screen.SelectedSkin>. | None |
.StorageSystem | Displays the Pokémon storage system screen. | None |
.TownMap(RegionList) | Displays the map screen with the specified regions. | RegionList (str) - Name(s) of region(s) to view separated by comas. |
.Trade(TradeItems,AllowBuy,AllowSell,Currency) | Opens a new trade screen/shop with the specified items in stock. | TradeItems - A list of TradeItems as defined at the top of this page. AllowBuy (bool) - Allows the player to buy items from this store. AllowSell (bool) - Allows the player to sell items to this store. Currency (str) - What currency to use for the trade (Default value is: "P"). Possible values: "P" (for PokéDollars), "BP" (for Battle Points). |
.TeachMoves(PartyIndex,MoveIDs) | Displays a move learn screen. | PartyIndex (int) Index of a Pokémon in the player's party. Values can range from 0 - 5. MoveIDs (intArr) - If this argument is left empty, it defaults to the Pokémon's tutor moves. |
@Script | ||
.Run(ScriptContent) | Executes the given commands. | ScriptContent (str) - Contains the commands to execute. New lines are represented with "^". |
.Start(ScriptFile) | Starts the given script. | ScriptFile (str) - The file path to the script file to start relative to the script folder ("Content\Data\Scripts\" by default). |
.Text(Message) | Displays the given text. | Message (str) - The text to display. |
@Register | ||
.Register(Name) | Adds a new register with the given name to the "register.dat" file of the current save game. | Name (str) - The name of the new register. |
.Register(Name,Type,Value) | Adds a new register with the given Name, Type and Value to the "register.dat" file of the current save game. | Name (str) - The name of the new register. Type (str) - The type of the Value argument. Possible values: "str", "bool", "int" or "sng". Value (str) - The value to be stored in the register. |
.Change(Name,Value) | Changes the specified register's stored value to a new value. | Name (str) - The name of the register to change the stored value of. Value (str) - The value which replaces the old value stored in the register. |
.Unregister(Name) | Removes the specified register from the "register.dat" file of the current save game. | Name (str) - The name of the register to unregister. |
.Unregister(Name,Type) | Removes the value stored in the specified register from the "register.dat" file of the current save game but does not unregister the register itself. | Name (str) - The name of the register to unregister the value of. Type (str) - The type of the value stored in the register to unregister. |
.RegisterTime(Name,Amount,Type) | Adds a new register with the given name for a specified amount of time to the "register.dat" file of the current save game. | Name (str) - The name of the new register. Amount (str) - The amount of time to wait before unregistering the register. What kind of time is used is determined by the Type argument. Type - What kind of time to use for this register. Possible values:
|
@Daycare | ||
.clean(int) | Organizes the save data for the given daycare. | int - The ID of the daycare(Route 34's is 0). |
.leavepokemon(int1,int2,int3) | Leaves the given Pokemon in the given daycare. | int1 - The ID of the daycare(Route 34's is 0). int2 - Daycare slot for pokemon to be stored in(0 or 1). Party ID of pokemon to be deposited(0-5). |
.removeegg(int) | Removes the egg from the given daycare permanently. | int - The ID of the daycare(Route 34's is 0). |
.takeegg(int) | Takes the egg from the given daycare. | int - The ID of the daycare(Route 34's is 0). |
.takepokemon(int1,int2) | Takes the given Pokemon from the given daycare. | int1 - The ID of the daycare(Route 34's is 0). int2 - Daycare slot for pokemon to be stored in(0 or 1). |
@Environment | ||
.setcandig(bool) | Changes the candig option for the map to 'bool'. | bool - A bool for candig. |
.setcanfly(bool) | Changes the canfly option for the map to 'bool'. | bool - A bool for canfly. |
.setcanteleport(bool) | Changes the canteleportoption for the map to 'bool'. | bool - A bool for canteleport. |
.setisdark(bool) | Changes the isdark option for the map to 'bool'. | bool - A bool for isdark. |
.setregionweather(int) | Changes the random weather for all of the maps to the given weather. | int - Clear=0, Rain=1, Snow=2, Underwater=3, Sunny=4, Fog=5, Sandstorm=6 |
.setrenderdistance(int\str) | Sets the render distance to the int or str given. | int - 0-4 str - tiny, small, normal, far, or extreme. |
.setweather(int) | Changes the weather for the map to the given weather. | int - Clear=0, Rain=1, Snow=2, Underwater=3, Sunny=4, Fog=5, Sandstorm=6 |
.setwildPokemoneverywhere(bool) | Turns wild encounters on\off. | bool - A bool for wild encounters. |
.setwildPokemongrass(bool) | Turns wild encounters on\off for grass. | bool - A bool for wild encounters. |
.setwildPokemonwater(bool) | Turns wild encounters on\off for water. | bool - A bool for wild encounters. |
.toggledarkness | Changes the darkness to whatever it isn't. | None |
@NPC | ||
.move(int1,int2) | Moves the given NPC the given amount of steps. | int1 - The ID of an NPC on the map. int2 - The amount of steps for the NPC to move. |
.moveasync(int1,int2) | Moves the given npc the given amount of steps while still executing the scripts after it. | int1 - The ID of an NPC on the map. int2 - The amount of steps for the NPC to move. |
.position(int,X,Y,Z) | Warps the NPC to the given position. | int - The ID of an NPC on the map. X,Y,Z - The new position. |
.register(str) | Creates a register in the NPC register file of the save. | 0|remove|0) |
.remove(int) | Removes the given NPC from the map. | int - The ID of an NPC on the map. |
.spawn(X,Y,Z,int1,str1,str2,bool,int2,str3,int3,str4) | Creates a new NPC. | X,Y,Z - The position of the new NPC. int1 - The action value of the new NPC. str1 - The AdditionalValue of the new NPC. str2 - The skin of the new NPC. bool - The animateidle value of the new NPC. int2 - The rotation of the new NPC. str3 - The Name of the new NPC. int3 - The ID of the new NPC. str4 - The movement type of the new NPC. |
.turn(int1,int2) | Turns the given NPc in the given direction. | int1 - The ID of an NPC on the map. int2 - The direction for the NPC to turn to. |
.unregister(str) | Removes a register in the NPC register file of the save. | 0|remove|0) |
.warp(int,X,Y,Z) | Warps the NPC to the given position. | int - The ID of an NPC on the map. X,Y,Z - The new position. |
.wearskin(int,str) | Changes the skin an NPC is using. | int - The ID of an NPC on the map. str - The name of the skin to change it to. |
@Player | ||
.achieveemblem(str) | Awards the player an emblem. | str - Emblem name. |
.addbp(int) | Give the player Battle Points. | int - Amount of Battle Points to give. |
.getbadge(int) | Given the player the given badge. | int - The badge to give(zephyr=9). |
.hiderod | Removes the fishing rod if activated. | None |
.hidepokemonfollow | Hides the following pokemon. | None |
.money(int) | Gives player money. | int - Money to add. |
.move(int) | Moves the player the given number of steps | int - Steps to move |
.receivepokedex | Gives the player the pokedex. | None |
.receivepokegear | Gives the player the pokegear. | None |
.renamerival | Allows the player to rename their rival. | None |
.save | Saves the game. | None |
.setrivalname(str) | Changes the rival's name to the given string. | str - Rival's new name. |
.showrod | Shows the fishing rod. | None |
.showpokemonfollow | Shows the following pokemon. | None |
.stopmovement | Stops the player. | None |
.togglepokemonfollow | Toggles the following pokemon. | None |
.turn(int) | Turns the player the given number of rotations. | int - The number of rotations to turn. |
.turnto(int) | Turns the player to the given rotation. | int - The rotation to turn to. |
.warp(str,X,Y,Z,int) | Warps the player. | str(optional) - Map destination file. X,Y,Z - The new position. int - Turns from start. |
.wearskin(str) | Changes the player's skin. | str - Skin to change to. |
@Pokemon | ||
.add(int1,int2,str1,int3,str2,bool,str3) | Adds the given Pokemon to your party. Only the first 2 parameters are necessary. | int1 - Pokemon dex number. int2 - Level str1 - Catch Method(defaults to "random reason") int3 - Catch Ball(defaults to Master Ball) str2 - Catch Location(defaults to current location bool - Isegg(defaults to 0(no)) str3 - Catch Trainer(defaults to <player.name>) |
.addattack(int1,int2) | Adds the given attack to the given party member. | int1 - Party index(0-5). int2 - Attack ID(1-562) |
.addfriendship(int1,int2) | Adds the given amount of friendship to the given party member. | int1 - Party index(0-5). int2 - Amount of friendship to add. |
.calcstats(int) | Recalculates the stats of the given party member. | int - Party index(0-5). |
.changelevel(int1,int2) | Changes the level of the given party member. | int1 - Party index(0-5). int2 - Level to change to. |
.clear | Resets the party. | None |
.clearattacks(int) | Clears the attacks from the selected party member. | int - Party index(0-5). |
.cry(int) | Plays the cry of the selected Pokemon. | int - Pokemon dex number. |
.evolve(int) | Evolves the given party member. | int - Party index(0-5). |
.gainexp(int1,int2) | Adds exp to the given party member. | int - Party index(0-5). |
.heal | Heals the party | None |
.hide | Hides the overworld Pokemon. | None |
.learnattack(int1,int2) | Allows the player to teach the given attack to the given party member. | int1 - Party index(0-5). int2 - Attack ID |
int2|int3|str) | Sets a roaming pokemon into the region. | int1 - Pokemon dex number. int2 - Pokemon level. int3 - Region number(johto = 0) str - Start map. |
int2|int3|int4|intarr|bool|int5| str1|int6|int7|str2|str3|str4|str5|str6|str7) |
Creates a trade with an npc. | int1 - Pokemon wanted by NPC. int2 - Pokemon given by NPC. int3(optional) - Level of Pokemon given by NPC. If blank defaults to own Pokemon's level. int4 - Gender of given Pokemon. -1 = random, 0 = Male, 1 = female, 2 = genderless intarr(optional) - Attack IDs for the given Pokemon. bool(optional) - Defines shininess. int5 - OT ID. str1 - OT Name. int6 - CatchBall. int7(optional) - Held Item. str2 - Catch Location. str3 - CatchMethod str4 - Nickname. str5 - Accept trade message. str6 - Reject trade message. str7 - Register after trade. |
.read(int) | Determines which stat has more EVs. | int - Party index(0-5). |
.registerhalloffame | Registers the current team in the Hall of Fame. | None |
.remove(int) | Removes the given party member. | int - Party index(0-5). |
.removeattack(int1,int2) | Removes given attack from the given party member. | int1 - Party index(0-5). int2 - Move Order ID(0-3). |
.rename(int) | Renames the given party member. | int - Party index(0-5). May also be 'last' to choose the last Pokemon in the party. |
.select(bool) | Opens the party menu to allow the player to choose a Pokemon. Selection is returned with <Pokemon.selected>. |
bool - Allows the player to exit the selection menu. |
.selectmove(int,bool1,bool2) | Opens the attack menu to allow the player to choose an attack fromthe given party member. Selection is returned with <Pokemon.selectedmove>. |
int - Party index(0-5). bool1 - allows HMs to be removed. bool2 - Allows menu to be exited. |
.setability(int1,int2) | Changes the ability of the given Pokemon. | int1 - Party index(0-5). int2 - New ability's index number. |
.setAdditionalValue(int,str) | Changes the additional value of the given Pokemon. | int - Party index(0-5). str - New AdditionalValue. |
.setfriendship(int1,int2) | Changes the friendship value of the given Pokemon. | int1 - Party index(0-5). int2 - New friendship value. |
.setgender(int1,int2) | Changes the gender of the given pokemon. | int1 - Party index(0-5). int2 - New gender value. |
.setnature(int1,int2) | Changes the nature of the given Pokemon. | int1 - Party index(0-5). int2 - New Nature. |
.setnickname(int,str) | Changes the nickname of the given Pokemon. | int - Party index(0-5). str - New Nickname. |
.setshiny(int,bool) | Changes the shininess of the given Pokemon. | int - Party index(0-5). bool - Represtens the shininess. |
.setstat(int1,str,int2) | Changes the given stat of the given Pokemon. | int1 - Party index(0-5). str - The stat to change. Possible inputs: chp, maxhp, hp, atk, attack, def, defense, spatk, spattack, specialattack, spdef, spdefense, specialdefense, speed int2 - New value for the stat. |
@Storage | ||
.clear | Clears all stored values. | None |
.set(str1,str2,str3) | Creates a storage with type of str 1, name of str2, and value of str3. | str1 - the type of value being stored(integer, string, Pokemon, boolean, item) str2 - The name of the Value. str3 - The Value to be stored. |
@Value | ||
.add(str,int) | Adds int to valuse str. | str - The value to be added to. int - The amount to add to the value. |
.change(str1,str2) | Changes the contents of value str1 to str2. | str1 - The value to be changed. str2 - the content replacing the contents of str1. |
.create(str1,str2) | Create value str1 with contents str2. | str1 - Name of value to be created. str2 - Contents of value to be created. |
.delete(str) | Delete the named value. | str - The name of the value to delete. |
Switches
Switches do a comparison between a given parameter and a construct. Examples:
:if:<Pokemon.level(int)>>3 :if:<register.registered(str)>=true :if:<not><Pokemon.level(int)>>3 # The above condition will be met if the Pokemon level is not more than 3
switches may use multiple parameter as well by using <and> and <or> Examples:
:if:<Pokemon.level(int)><3 <and> <register.registered(str)>=true :if:<Pokemon.level(int)>>=3 <or> <register.registered(str)>=false
:if:
- if: switches start with the line containing
:if:
Starting with Version 0.38, ':then' is no longer needed.
to switch to the opposite of the condition use, the else statement is not necessary.
:else
to end an if statement use:
:endif
here is an example of the basic layout:
:if:conditions :then scripts to execute if conditions are met. :else scripts to execute if conditions are not met. :endif
If you want the script to take the opposite condition without using :else, then you can use
:if:<not>conditions
scripts to execute if conditions are met.
- else
scripts to execute if conditions are not met.
- endif
Example: * This opposite condition script seem to be not able to mix with <and> <or>.
:if:<not><Player.facing>=0
scripts to execute if player is not facing up.
- else
scripts to execute if player is facing up.
- endif
:select:
- select: switches begin with a select statement and a condition
:select:<player.position>
- when: is used to switch the script, if the value(s) after the :when: match those returned by the construct it will execute the scripts after it. Separate multiple matches for the same result with ;
:when:0,0,0
to end a select statement use
:endwhen
Example:
:select:condition :when:value1 Scripts to execute if condition=value1. :when:value2;value3 Scripts to execute if condition=value2 or condition=value3. :endwhen
@Options.Show()
@options.show(str,str,...) displays up to 10 options at a time for the player to choose from.
- when:, and :endwhen are used here similarly to the way they are used in select
Example:
@options.show(Yes,No) :when:Yes Scripts to execte when the layer chooses Yes. :when:No Scripts to execte when the layer chooses No. :endwhen
if a choice is not given a coinciding :when: then it will simply skip to the :endwhen
:end
- end is used to end the script.
If an executing script comes to :end the script will cease to execute and control will be returned to the player. Example:
version=2 :if:<register.registered(str1)>=true :then :end :endif @text.show(str2) @register.register(str1) :end
In the example above, the player will activate the script without registering str1, so the script will skip past :endif, display str2, register str1, and then end. The next time the player activates the script, str1 will be registered, so the script will begin executing the :if: statement. This will end the script without displaying str2 or registering str1.
If a script does not reach an :end, it will continue looping through itself until it does.
:while:
- while: is used to loop a certain line of script until it met the condition given.
For example:
:while:<Entity.opacity(121)><100
@Entity.setopacity(121,<Entity.opacity(121)>+10) @Level.wait(1) @Level.update
- endwhile
The above script will loop when the opacity of the entity is less than 100. Every time it loop, it will add a value of 10 opacity of the entity. It will stop when it hit 100.
What if the loop never stops? You can use :exitwhile if your condition will never be met.
For example:
:while:<Register.registered(random)>=true
@Text.show(blah)
- endwhile
It never stop this way if it is true so... to stop this, add :exitwhile
:while:<Register.registered(random)>=true
@Text.show(blah)
- exitwhile
- endwhile
Constructs
Constructs can be used in place of any parameter for command and are used with :if: and :select: statements.
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 math 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.
- Unless otherwise specified X,Y,Z is a three dimensional position.
- Unless otherwise specified bool is either true or false.
Sub-construct | Inputs | Output |
---|---|---|
Battle | ||
.defeatmessage(str) | str - A trainer file path. | Returns the defeat message of the given trainer. |
.intromessage(str) | str - A trainer file path. | Returns the intro message of the given trainer. |
.outromessage(str) | str - A trainer file path. | Returns the outro message of the given trainer. |
.won | None | Returns true if you won the last trainer battle. |
Daycare | ||
.canbreed(int) | int - The daycare ID, the Route 34 daycare is ID = 0. | Returns the returns the percent chance the pokemon in the given daycare will have an egg. |
.canswim(int1,int2) | int1 - The daycare ID, the Route 34 daycare is ID = 0. int2 - The Pokemon's ID in the daycare(0 or 1) |
Returns a bool based on the pokemon data file entry "canswim". |
.countpokemon(int) | int - The daycare ID, the Route 34 daycare is ID = 0. | Returns the number of pokemon in the given daycare. |
.currentlevel(int1,int2) | int1 - The daycare ID, the Route 34 daycare is ID = 0. int2 - The Pokemon's ID in the daycare(0 or 1) |
Returns the current level of the given pokemon. |
.grownlevels(int1,int2) | int1 - The daycare ID, the Route 34 daycare is ID = 0. int2 - The Pokemon's ID in the daycare(0 or 1) |
Returns the amount of levels a pokemon has grown. |
.hasegg(int) | int - The daycare ID, the Route 34 daycare is ID = 0. | Returns a bool based on if there is an egg in the given daycare. |
.haspokemon(int) | int - The daycare ID, the Route 34 daycare is ID = 0. | Returns a bool based on if there are pokemon in the given daycare. |
.PokémonID(int1,int2) | int1 - The daycare ID, the Route 34 daycare is ID = 0. int2 - The Pokemon's ID in the daycare(0 or 1) |
Returns the dex number of the selected pokemon. |
.pokemonname(int1,int2) | int1 - The daycare ID, the Route 34 daycare is ID = 0. int2 - The Pokemon's ID in the daycare(0 or 1) |
Returns the name of the selected pokemon. |
.shinyindicator(int1,int2) | int1 - The daycare ID, the Route 34 daycare is ID = 0. int2 - The Pokemon's ID in the daycare(0 or 1) |
Returns 'S' if shiny and 'N' if not. |
Entity | ||
.AdditionalValue(int) | int - an Entity ID | The contents of the AdditionalValue of the given entity. |
.collision(int) | int - an Entity ID | A bool representing the collision of the given entity. |
.opacity(int) | int - an Entity ID | An int representing the percent see through the given entity is. |
.position(int) | int - an Entity ID | The X,Y,Z position of the given entity. |
.scale(int) | int - an Entity ID | The X,Y,Z scale of the given entity |
.visible(int) | int - an Entity ID | A bool representing the visibility of the given entity. |
Environment | ||
.candig | None | A bool representing if the player can dig from the map. |
.canfly | None | A bool representing if the player can fly from the map. |
.canteleport | None | A bool representing if the player can teleport from the map. |
.currentmapweather | None | Same as .weather. |
.currentmapweatherid | None | Same as .weatherid. |
.day | None | Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, or Saturday |
.dayinformation | None | day,daytime |
.daytime | None | night, morning, day, or evening |
.daytimeid | None | The ID for the time of day. night=0, morning=1, day=2, or evening=3 |
.isdark | None | A bool representing the darkness of the map. |
.mapweather | None | Same as .weather. |
.mapweatherid | None | Same as .weatherid. |
.regionweather | None | Returns the random weather effecting the whole area. Uses the same names as .weather. |
.regionweatherid | None | Returns the ID of random weather effecting the whole area. Uses the same IDs as .weatherid. |
.season | None | winter, spring, summer, or fall |
.seasonid | None | The ID for the season. winter=0, spring=1, summer=2, or fall=3 |
.weather | None | Returns the Weather effecting the current map. Clear, Rain, Snow, Underwater, Sunny, Fog , Sandstorm |
.weatherid | None | Returns the ID of the Weather effecting the current map. Clear=0, Rain=1, Snow=2, Underwater=3, Sunny=4, Fog=5, Sandstorm=6 |
.week | None | The current week in the year. |
.wildPokemoneverywhere | None | A bool representing if the player can find Pokemon on the map. |
.wildPokemongrass | None | A bool representing if the player can find Pokemon in the grass on the map. |
.wildPokemonwater | None | A bool representing if the player can find Pokemon in the water on the map. |
.year | None | The current year(e.g. 2013) |
Inventory | ||
.countitem(int) | int- Item ID. | The amount of the given item in the bag. |
.countitems | None | The number of Items in the bag. |
.name(int) | int- Item ID. | The name of the given item. |
Level | ||
.filename | None | Returns the name of the current map file without extension. |
.levelfile | None | Returns the file path of the current map relative to the maps folder. |
.mapfile | None | Same as .levelfile. |
.riding | None | Returns a bool representing if the player is riding. |
.surfing | None | Returns a bool representing if the player is surfing. |
.musicloop | None | Returns the file path of the music loop that belongs to the current level. |
Math | ||
.abs(sng) | str - A value to convert | Takes the absolute value of the given value. |
.ceiling(sng) | str - A value to convert | Rounds the given value up. |
.floor(sng) | str - A value to convert | Rounds the given value down. |
.int(int) | str - A value to convert. | Converts the given value to an integer. |
.sng(sng) | str - A value to convert. | Converts the given value to an single. |
NPC | ||
.action(int) | int - ID of an NPC on the map. | Returns the action value of the given NPC. |
.additionaldata(int) | int - ID of an NPC on the map. | Returns the additionaldata of the given NPC. |
.exists(int) | int - ID of an NPC on the map. | Checks if there is an NPC on the map with that ID. |
.facing(int) | None | Returns the ID of the direction the player is facing. |
.hasmoverectangles(int) | int - ID of an NPC on the map. | Returns a bool reflecting if the given NPC has moverectangles assigned. |
.id(int) | int - ID of an NPC on the map. | Returns the ID of the given NPC. |
.ismoving | int - ID of an NPC on the map. | Returns a bool representing if the player is moving or not. |
.moved(int) | int - ID of an NPC on the map. | Returns the distance moved by that NPC. |
.movement(int) | int - ID of an NPC on the map. | Returns the type of movement used by the given NPC. |
.name(int) | int - ID of an NPC on the map. | Returns the name of the given NPC. |
.position(int) | int - ID of an NPC on the map. | Returns the position of the given NPC. |
.skin(int) | int - ID of an NPC on the map. | Returns the name of the skin used by the given NPC. |
.trainertexture(str) | str - A trainer file, file path. | Returns the name of the texture used by the given trainer. |
Phone | ||
.callflag | None | (str) Returns if the player is calling or is being called. Possible values: "calling", "receiving" |
.got | None | (bool) Returns if the player got the Pokégear. |
Player | ||
.badges | None | Returns the number of badges obtained. |
.bp | None | Returns the amount of battle points the player has. |
.compass | None | Returns the name of the direction the player is facing. |
.facing | None | Returns the ID of the direction the player is facing. |
.gender | None | Returns 1 if male, 0 if Female. |
.hasbadge(int) | int - A badge ID. | Returns a bool representing if the player has that badge. |
.ismoving | None | Returns a bool representing if the player is moving or not. |
.money | None | Returns the amount of money the player has. |
.name | None | Returns the name of the player. |
.position | None | Returns the player's position. |
.rival | None | Returns the rival's name. |
.rivalname | None | Returns the rival's name. |
.skin | None | Returns the name of the skin used by the player. |
.thirdperson | None | Returns a bool representing if third person mode is on. |
.velocity | None | Returns the velocity of the player. |
Pokedex | ||
.caught | None | Returns the number of pokemon caught. |
.seen | None | Returns the number of pokemon seen. |
.shiny | None | Returns the number of shiny pokemon caught. |
Pokemon | ||
.additionaldata(int) | int - Party index of a Pokemon(0-5) | Returns the additionaldata of the given party member. |
.atk(int) | int - Party index of a Pokemon(0-5) | Returns the attack stat of the given party member. |
.attackname(int1,int2) | int1 - Party index of a Pokemon(0-5) int2 - Attack index of a Pokemon's attack(0-3). |
Returns the name of the given attack from the given party member. |
.catchball(int) | int - Party index of a Pokemon(0-5) | Returns the catchball of the given party member. |
.catchlocation(int) | int - Party index of a Pokemon(0-5) | Returns the catchlocation of the given party member. |
.catchmethod(int) | int - Party index of a Pokemon(0-5) | Returns the catchmethod of the given party member. |
.count | None | Returns the number of Pokemon in the party. |
.countattacks(int) | int - Party index of a Pokemon(0-5) | Returns the number of attacks on the given party member. |
.countbattle | None | Returns the number of battle-usable Pokemon in the party. |
.counthalloffame | None. | Returns the number of Hall of Fame registers the player has. |
.currentexp(int) | int - Party index of a Pokemon(0-5) | Returns the exp for the current level of the given party member. |
.data(int) | int - Party index of a Pokemon(0-5) | Returns the save data for the given party member. |
.def(int) | int - Party index of a Pokemon(0-5) | Returns the defense stat of the given party member. |
.freeplaceinparty | None | Returns a bool representing if there is an empty slot in the party. |
.friendship(int) | int - Party index of a Pokemon(0-5) | Returns the friendship value of the given party member. |
.generatefrontier(int1,int2) | ||
.has(int) | int - dex number of a Pokemon | Returns a bool representing if the given Pokemon is in the party. |
.hasattack(int1,int2) | int1 - Party index of a Pokemon(0-5) int2 - Attack index. |
Returns a bool representing if the given party member has the given attack. |
.hasegg | None | Returns a bool representing if there is an egg in the party. |
.hasfullhp(int) | int - Party index of a Pokemon(0-5) | Returns a bool representing if the given party member has full hp. |
.hp(int) | int - Party index of a Pokemon(0-5) | Returns the current HP of the given party member. |
.id(int) | int - Party index of a Pokemon(0-5) | Returns the dex number of the given party member |
.isegg(int) | int - Party index of a Pokemon(0-5) | Returns a bool representing if the given party member is an egg. |
.islegendary(int) | int - Party index of a Pokemon(0-5) | Returns a bool representing if the given party member is a legendary. |
.isshiny(int) | int - Party index of a Pokemon(0-5) | Returns a bool representing if the given party member is shiny. |
.item(int) | int - Party index of a Pokemon(0-5) | Returns the name of the item held by the given party member. |
.itemdata(int) | int - Party index of a Pokemon(0-5) | Returns the stored data for the held item of the given pokemon(used for mail). |
.itemid(int) | int - Party index of a Pokemon(0-5) | Returns the id of the item held by the given party member. |
.itemname(int) | int - Party index of a Pokemon(0-5) | Returns the name of the item held by the given party member. |
.learnedtutormove | None. | Returns a bool based on if a move was just learned via the Move Relearner. |
.level(int) | int - Party index of a Pokemon(0-5) | Returns the level of the given party member. |
.maxhp(int) | int - Party index of a Pokemon(0-5) | Returns the max HP of the given party member. |
.maxpartylevel | None | Returns the highest level of among the Pokemon in the player's party. |
.name(int) | int - Party index of a Pokemon(0-5) | Returns the name of the given party member. |
.nature(int) | int - Party index of a Pokemon(0-5) | Returns the nature of the given party member. |
.needexp(int) | int - Party index of a Pokemon(0-5) | Returns the exp needed for the next level of the given party member. |
.nickname(int) | int - Party index of a Pokemon(0-5) | Returns the nickname of the given party member. |
.noPokemon | None | Returns a bool representing if there are no Pokemon in the party. |
.number(int) | int - Party index of a Pokemon(0-5) | Returns the dex number of the given party member. |
.ot(int) | int - Party index of a Pokemon(0-5) | Returns the ot of the given party member. |
.otmatch(int,str) | int - OT to check against. str - value to return.(has, id, number, name, maxhits) |
Returns a different value based on str:
|
.ownPokemon(int) | int - Party index of a Pokemon(0-5) | Returns a bool representing if the given party member was caught by the current trainer. |
.randomot | None | Produces a random OT number. |
.selected | None | Returns the Party index of the Pokemon selected using @Pokemon.select. |
.selectedmove | None | Returns the index of the Pokemon's attack selected using @Pokemon.selectmove. |
.spatk(int) | int - Party index of a Pokemon(0-5) | Returns the spec. attack stat of the given party member. |
.spawn(int1,int2) | int1 - Pokemon dex number. int2 - Level |
Produces the save data for the given pokemon. |
.spawnwild(int) | int - encounter type | Produces the save data for a random wild pokemon encountered the given way. |
.spdef(int) | int - Party index of a Pokemon(0-5) | Returns the spec. defense stat of the given party member. |
.speed(int) | int - Party index of a Pokemon(0-5) | Returns the speed stat of the given party member. |
.totalexp(int) | int - Party index of a Pokemon(0-5) | Returns the total exp of the given party member. |
.trainer(int) | int - Party index of a Pokemon(0-5) | Returns the catch trainer of the given party member. |
Register | ||
.count | None | Returns the number of registers. |
.registered(str) | str - A register string. | A bool representing if the string has been registered. |
.type(str) | str - Register value to get the type of. | Returns the type of the value stored under the given name. |
.value(str) | str - Register name. | Returns the value stored as the given register. |
Rival | ||
.name | None | Returns the rival's name. |
Storage | ||
.count(str) | str1 - The type of values to count(integer, string, Pokemon, boolean, item). Does not need to be defined. |
Returns the number of different stored values of that type. If str is not defined then it returns a count of all types. |
.get(str1,str2) | str1 - The type of value is stored(integer, string, Pokemon, boolean, item). str2 - the name of the stored value. |
Returns the value stored as str2. |
System | ||
.booltoint(str) | Either "true", "false", or a construct that returns one of those. | Returns 0 for false and 1 for true. |
.calcint(str) | A str representing an integer, or a Construct that returns one. | Returns the str as an integer. |
.calcsng(str) | A str representing a single, or a Construct that returns one. | Returns the str as a single. (A single is a number that is a decimal) |
.dayofyear | None | Returns the day of the year as a number. |
.isinsightscript | None | Returns a bool based on if the script it is in was triggered by the player stepping into the line of sight of an NPC. |
.issng(int) | int - A value to test. | Returns true if the value is a single. |
.isint(int) | int - A value to test. | Returns true if the value is an integer. |
.lastinput | None | Returns the last thing input via @screen.input. |
.random(int1,int2) | int1 - If it is the only argument then it is the max of the range, otherwise it is the min. int2 - The max of the range. Does not need to be defined. |
Returns a random integer between the int1 and int2 if both are defined. If int2 is not defined then it chooses from between 1 and int1.(Ranges are inclusive) |
.sort(str,int,list) | str - either 'Ascending' or 'Descending' int - position in sorted list to return list - List of numbers to sort. |
Returns a number from a list of numbers after it is sorted. |
.unixtimestamp | None | Returns the Unix time stamp. (http://www.unixtimestamp.com/index.php See here for more details.) |
.year | None | Returns the current year. |
Value | ||
.get(str) | str - The name of the stored value. | Returns the value stored as str. |
Game Folder | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Content | ContentPacks | GameModes | Saves | Screenshots | Game Executable | ||||||||||||
Pokemon | Data | ContentPack Folder | GameMode folder | Savegame folder | Version History | ||||||||||||
Data | Maps | Moves | Scripts | Control Files | Content | GameMode.dat | Party.dat | Player.dat | Options.dat | ||||||||
poke | battle | structures | V1 | V2 | trainer | worldmap |