From 0163c1e729d484d95260571371bb1f8966cc55a6 Mon Sep 17 00:00:00 2001 From: FrenchOrange <64930003+FrenchOrange@users.noreply.github.com> Date: Thu, 21 Nov 2024 00:48:15 +0100 Subject: [PATCH 1/5] Update event_commands.md --- docs/event_commands.md | 229 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 223 insertions(+), 6 deletions(-) diff --git a/docs/event_commands.md b/docs/event_commands.md index d552b14bb45..4a562fff754 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -2,222 +2,299 @@ Defined in [macros/scripts/events.asm](https://github.com/pret/pokecrystal/blob/master/macros/scripts/events.asm) and [engine/overworld/scripting.asm:ScriptCommandTable](https://github.com/pret/pokecrystal/blob/master/engine/overworld/scripting.asm). -Until this document is filled out, the [G/S Scripting Compendium](https://hax.iimarckus.org/files/scriptingcodes_eng.htm) has descriptions for most of these commands. It was written for G/S binary hacking and not Crystal assembly hacking, so it's not 100% accurate for pokecrystal. - ## `$00`: scall script +Used to call a script inside a different one. Once this "sub script" reaches its `end`, the game will return to the rest of the script that first called it. ## `$01`: farscall script +A version of `scall` used to call scripts that are in different banks. ## `$02`: memcall script +Used in engine scripts to call a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/phone/phone.asm](../blob/master/engine/phone/phone.asm#L384) as examples. ## `$03`: sjump script +Used to jump to a script inside a different one. Once this "sub script" reaches its `end`, the game will return to the rest of the script that first called it. ## `$04`: farsjump script +A version of `sjump` used to jump to scripts that are in different banks. ## `$05`: memjump script +Used in engine scripts to jump to a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm#L852). ## `$06`: ifequal byte, script +Used in a script to compare if a value is identical to another defined value. ## `$07`: ifnotequal byte, script +Used to compare if a value is not identical to another defined value. ## `$08`: iffalse script +Used to see if an event/flag hasn't been set, or if the player told "no" to a yes or no question. ## `$09`: iftrue script +Used to see if an event/flag has been set. ## `$0A`: ifgreater byte, script +Used to compare if a value is greater than another defined value. ## `$0B`: ifless byte, script +Used to compare if a value is lesser than another defined value. ## `$0C`: jumpstd std_script +Used in map scripts to jump to an `std_script`, like Pokémon Center/Mart signs, or Gym statues. Refers to [engine/events/std_scripts.asm](../blob/master/engine/events/std_scripts.asm). ## `$0D`: callstd std_script +Unused in regular gameplay. Identical to `jumpstd`, only as a `call` instead of a `jump`. ## `$0E`: callasm asm +Used in engine scripts to call an asm function. ## `$0F`: special special_pointer +Used in scripts to call a `special` function. Refers to [data/events/special_pointers.asm](../blob/master/data/events/special_pointers.asm). ## `$10`: memcallasm asm +Used in engine scripts to call an asm function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm#L852). ## `$11`: checkmapscene map +Unused in regular gameplay. Used to check whether or not a given scene has been triggered, in a map other than the current one. ## `$12`: setmapscene map, scene_id +Used to set a given scene as having been triggered, in a map other than the current one. ## `$13`: `checkscene` +Used to check whether or not a given scene from the current map has been triggered. See [maps/PlayersHouse1F.asm](../blob/master/maps/PlayersHouse1F.asm#L113) and [maps/RuinsOfAlphResearchCenter.asm](../blob/master/maps/RuinsOfAlphResearchCenter.asm#L21) as examples. ## `$14`: setscene scene_id +Used to set a given scene from the current map as having been triggered. ## `$15`: setval value [wScriptVar] = value +Used in scripts to load a given variable into RAM. Used in a variety of situations, like calling the right Unown puzzle, the right Move Tutor option, or the right Pokémon for `MonCheck`. + ## `$16`: addval value [wScriptVar] += value +Used in scripts to add a certain number to a given variable into RAM. + ## `$17`: random value +Used to call a random number, in conjunction with a value check command like `ifequal `. See [maps/OlivineCity.asm](../blob/master/maps/OlivineCity.asm#L76) and [engine/phone/scripts/jack_gossip.asm](../blob/master/engine/phone/scripts/jack_gossip.asm#L4) as examples. ## `$18`: `checkver` +Leftover from *Gold and Silver*, where it was used in map scripts to check the version ID of the game, either *Gold* (0) or *Silver* (1). By default, using `iftrue` would assume the version played is *Silver*. ## `$19`: readmem address [wScriptVar] = [address] +Used in scripts to write a given variable from a ram address to RAM. + ## `$1A`: writemem address [address] = [wScriptVar] +Used in scripts to write a given variable from RAM to a ram address. + ## `$1B`: loadmem address, value [address] = value +Used in scripts to write a given value to a ram address. + ## `$1C`: readvar variable [wScriptVar] = GetVarAction(variable) +Used in scripts to check `wScriptVar` values and write them into RAM. + ## `$1D`: writevar variable GetVarAction(variable) = [wScriptVar] +Used in scripts to write a given variable from RAM to `wScriptVar` offsets. + ## `$1E`: loadvar variable, value GetVarAction(variable) = value +Used in scripts to write given variable to `GetVarAction` offsets. + ## `$1F`: giveitem item_id[, quantity=1] +Used to give the player a specific item in a defined quantity. ## `$20`: takeitem item_id[, quantity=1] +Used to take away a specific item in a defined quantity from the player's inventory. ## `$21`: checkitem item_id +Used to check if the player does or doesn't have a specific item in their inventory. ## `$22`: givemoney account, value +Used to give a certain sum of money to the player. ## `$23`: takemoney account, value +Used to take a given sum of money from the player. See [maps/Route39Farmhouse.asm](../blob/master/maps/Route39Farmhouse.asm#L23) as an example. ## `$24`: checkmoney account, value +Used to check whether or not the player has a given sum of money. See [maps/Route39Farmhouse.asm](../blob/master/maps/Route39Farmhouse.asm#L23) as an example. ## `$25`: givecoins value +Used to gift the player a specific amount of Game Corner coins. ## `$26`: takecoins value +Used to take away a specific amount of Game Corner coins from the player. ## `$27`: checkcoins value +Used to check if the player does or doesn't have a specific amount of Game Corner coins. ## `$28`: addcellnum contact_id +Used to save a non-trainer character's phone number to the player's PokéGear. ## `$29`: delcellnum contact_id +Used to delete a non-trainer character's phone number from the player's PokéGear. ## `$2A`: checkcellnum contact_id +Used in conjunction with an `iftrue` or an `iffalse` check to see if the player has or hasn't registered a given character's phone number. ## `$2B`: checktime time +Used to check what time of day it is, either `MORN`, `DAY`, or `NITE`. ## `$2C`: checkpoke mon_id +Used in map scripts to check if a given Pokémon is in the player's party. -## `$2D`: givepoke mon_id, level[, item=0[, ot_name, nickname]] +## `$2D`: givepoke mon_id, level[, item=0[, nickname, ot_name]] +Used in map scripts to gift the player a given Pokémon at a given level. Two extra parameters can also be set, namely the Pokémon's nickname, and its Original Trainer's name and gender (the latter is male/0 by default, but can be set to female/1). See [maps/Route35GoldenrodGate.asm](../blob/master/maps/Route35GoldenrodGate.asm#L31) as an example. ## `$2E`: giveegg mon_id, level +Used in map scripts to gift the player an egg of a specific Pokémon species. The level at which it hatches can be set manually, but using `EGG_LEVEL` will default to a level 5 hatchling. ## `$2F`: givepokemail pointer +Used in map scripts to give pokemail to an in-game gift Pokémon, specifying which type of mail and what message it will have. See [maps/Route35GoldenrodGate.asm](../blob/master/maps/Route35GoldenrodGate.asm#L32) as an example. ## `$30`: checkpokemail pointer +Used as part of the Kenya side-quest, to check if the mail matches the one that was given to the player on Route 35. See [maps/Route31.asm](../blob/master/maps/Route31.asm#L198) as an example. ## `$31`: checkevent event_flag +Used to check whether or not an event flag has been set. An event that has been set may be used in conjunction with an `iftrue` or `iffalse` check. ## `$32`: clearevent event_flag +Used to clear an event flag. A map object that is assigned a set event will be neither visible nor interactable. and so clearing said flag will make the object appear. ## `$33`: setevent event_flag +Used to set an event flag. An event that has been set may be used in conjunction with an `iftrue` or `iffalse` check. Moreover, a map object that is assigned a set event will no longer be visible nor interactable. + +Events may be set upon starting a new save by being defined as such in [engine/events/std_scripts.asm](../blob/master/maps/engine/events/std_scripts.asm#L480). ## `$34`: checkflag engine_flag +Used to check whether or not an engine flag has been set. ## `$35`: clearflag engine_flag +Used in scripts to clear an engine flag. ## `$36`: setflag engine_flag +Used to set an engine flag. ## `$37`: `wildon` +Unused in regular gameplay. If one has used `wildoff` earlier, then using `wildon` will, appropriately, re-enable wild encounters. ## `$38`: `wildoff` +Unused in regular gameplay. Using this command will disable wild encounters for all maps. ## `$39`: xycompare pointer +Unused in regular gameplay. This command compares the player's current X and Y coordinates with the ones in a table. To be useful, this code can only be used in a command queue, because with every step the player takes the bits are reset. ## `$3A`: warpmod warp_id, map - +Unused in regular gameplay. Used in map callbacks to change the destination of a warp set to `-1`. Here's an example of `warpmod` from [Polished Crystal](https://github.com/Rangi42/polishedcrystal/blob/master/maps/LavRadioTower1F.asm#L25). ## `$3B`: blackoutmod map +Used in map scripts to change the destination the player will be warped to after blacking out. Refers to [data/maps/spawn_points.asm](../blob/master/data/maps/spawn_points.asm). + +The point of this command is to avoid some story "desyncs". For example, a `blackoutmod` command set to Cherrygrove City is defined in the script for meeting Prof. Oak at [Mr Pokémon's house](../blob/master/maps/MrPokemonsHouse.asm#L37). If it weren't there, and the player hadn't visited Cherrygrove's Pokémon Center, then blacking out on Route 30 would warp them back to New Bark Town, thus skipping the first rival battle. ## `$3C`: warp map, x, y +Used to warp the player to a given location, at specified coordinates. Note that this is done silently, though a separate `playsound` command may be added to it, either before or after. + +Also note that the player will always be warped facing down. If one wishes to warp the player in another direction, see `warpfacing`. ## `$3D`: getmoney string_buffer, account GetStringBuffer(string_buffer) = PrintNum(GetMoneyAccount(account)) +Used by [engine/phone/scripts/mom.asm](../blob/master/engine/phone/scripts/mom.asm) to display the correct amount of money when calling mom to know how much money has been saved. + ## `$3E`: getcoins string_buffer GetStringBuffer(string_buffer) = PrintNum([wCoins]) +Unused in regular gameplay. Identical to `getmoney`, only with the Game Corner coins in the player's Coin Case, as opposed to money. + ## `$3F`: getnum string_buffer GetStringBuffer(string_buffer) = PrintNum([wScriptVar]) +Used in a script to display a given value in a dialogue box. See [maps/Route35NationalParkGate.asm](../blob/master/maps/Route35NationalParkGate.asm#L54) as an example. ## `$40`: getmonname string_buffer, mon_id @@ -225,6 +302,8 @@ Until this document is filled out, the [G/S Scripting Compendium](https://hax.ii If mon_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. +Used in a script to display a given Pokémon name in a dialogue box. See [maps/ElmsLab.asm](../blob/master/maps/ElmsLab.asm#L177) as an example. + ## `$41`: getitemname string_buffer, item_id @@ -232,332 +311,470 @@ If mon_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` in If item_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. +Used in a script to display a given item name in a dialogue box. See [maps/CeladonCafe.asm](../blob/master/maps/CeladonCafe.asm#L91) as an example. + ## `$42`: getcurlandmarkname string_buffer GetStringBuffer(string_buffer) = GetLandmarkName(GetWorldMapLocation()) +Used in a script to display the current location name in a dialogue box. Used by both [engine/phone/scripts/mom.asm](../blob/master/engine/phone/scripts/mom.asm#L12) and [engine/events/std_scripts.asm](../blob/master/engine/events/std_scripts.asm#L1757). + ## `$43`: gettrainername string_buffer, trainer_group, trainer_id GetStringBuffer(string_buffer) = GetTrainerName(trainer_group, trainer_id) +Used in a script to display a given trainer name in a dialogue box. See [maps/VioletGym.asm](../blob/master/maps/VioletGym.asm#L105) as an example. + ## `$44`: getstring string_buffer, text_pointer GetStringBuffer(string_buffer) = CopyName1([wScriptBank], text_pointer) +Used in a script to display a given string in a dialogue box. See [maps/LavRadioTower1F.asm](../blob/master/maps/LavRadioTower1F.asm#L34) as an example. + ## `$45`: `itemnotify` +Used in map scripts alongside a `giveitem` command. Prints the " put the in the ." message. See [maps/DragonsDenB1F.asm](../blob/master/maps/DragonsDenB1F.asm#L57) as an example. ## `$46`: `pocketisfull` +Seldom called by `GiveItemScript`, in [engine/overworld/scripting.asm](../blob/master/engine/overworld/scripting.asm#L467). ## `$47`: `opentext` +Used in map scripts before a `writetext` command, to open a dialogue box. ## `$48`: reanchormap [dummy=0] +Used in a script to trigger a complete screen refresh. ## `$49`: `closetext` +Used in map scripts after either a `waitbutton` or `promptbutton` command, to close a dialogue box. -## `$4A`: writeunusedbyte byte +## `$4A`: writeUnusedbyte byte [wUnusedScriptByte] = byte +Unused in regular gameplay. All this command does is load a byte into `wUnusedScriptByte`. + ## `$4B`: farwritetext text_pointer +Used in engine scripts, combines both `farcall` and `writetext`. ## `$4C`: writetext text_pointer +Used in map scripts after an `opentext` command, to load a given text pointer. ## `$4D`: repeattext byte1, byte2 +Seldom called by `JumpTextFacePlayerScript`, in [engine/overworld/scripting.asm](../blob/master/engine/overworld/scripting.asm#L309). ## `$4E`: `yesorno` +Used in map scripts to load a "yes or no" prompt. To be used in conjunction with an `iftrue` or `iffalse` check, for either "yes" or "no" respectively. ## `$4F`: loadmenu menu_header +Used in map scripts to load menu data. See [maps/DragonShrine.asm](../blob/master/maps/DragonShrine.asm#L21) as an example. ## `$50`: `closewindow` +Used to close a menu window. ## `$51`: jumptextfaceplayer text_pointer +Used to load the text of an `object_event`. Essentially combines `faceplayer`, `opentext`, `writetext`, `waitbutton`, and `closetext` in a single command. ## `$52`: farjumptext text_pointer +Seldom used in [engine/events/std_scripts.asm](../blob/master/engine/events/std_scripts.asm) to draw text from [data/text/std_text.asm](../blob/master/data/text/std_text.asm). ## `$53`: jumptext text_pointer +Identical to `jumptextfaceplayer`, aside from lacking the `faceplayer` aspect. May be used for NPCs, though this command is usually reserved to load the text of a `bg_event`, namely signs. ## `$54`: `waitbutton` +Used in map scripts after a `writetext` command. This will leave the dialogue box on-screen after its message is displayed, with the player needing to press either **A** or **B** to close it. ## `$55`: `promptbutton` +Used in map scripts after a `writetext` command. Behaves identically to `waitbutton`, only differing in that here a down-facing arrow will flicker in the bottom-right corner of the dialogue box. This command is meant to be used in case one needs to load two or more sets of dialogue one after another, since using `waitbutton` would not play the "next dialogue box" sound. ## `$56`: pokepic mon_id +Makes a given Pokémon's front sprite pop-up in a small window in the center of the screen. The sprite will be static, and in grayscale. Only used in Elm's Lab when interacting with the starters' poké balls. ## `$57`: `closepokepic` +Used in a script to close a `pokepic`. ## `$58`: `_2dmenu` +A 2-dimensional menu, where the player can move their cursor in all four directions. Used for the battle menus, as well as the blackboard in Earl's academy. A writeup on menu types can be found [here](https://github.com/pret/pokecrystal/blob/master/docs/menus.md). ## `$59`: `verticalmenu` +A generic menu display. A writeup on menu types can be found [here](https://github.com/pret/pokecrystal/blob/master/docs/menus.md). ## `$5A`: `loadpikachudata` +Unused in regular gameplay. All this command does is load the data for a level 5 Pikachu. ## `$5B`: `randomwildmon` +Used in engine scripts as part of the Sweet Scent, But Catching Contest, and wild Pokémon encounters. ## `$5C`: `loadtemptrainer` `[wOtherTrainer] = [wTempTrainer]` +Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it loads temporary trainer data. + ## `$5D`: loadwildmon mon_id, level +Used in map scripts to load a battle against a specific Pokémon species at a given level. See [maps/UnionCaveB2F.asm](../blob/master/maps/UnionCaveB2F.asm#L28) as an example. ## `$5E`: loadtrainer trainer_group, trainer_id +Used in map scripts to load a battle against a specific trainer class and a given party id. ## `$5F`: `startbattle` +Used in map scripts directly following either a `loadwildmon` or a `loadtrainer`. ## `$60`: `reloadmapafterbattle` +Used in map scripts following a `startbattle`. Reloads the map after the battle is over. ## `$61`: catchtutorial byte +Used to initiate the Pokémon catching tutorial on Route 29. Needs to be preceded with a `loadwildmon` command. ## `$62`: trainertext text_id +Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it loads temporary trainer dialogue data. ## `$63`: trainerflagaction action +Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it handles the "trainer defeated" flag data. ## `$64`: winlosstext win_text_pointer, loss_text_pointer +Used in trainer battle scripts to print a given string when the player either wins or loses. Note that only the rival fight in Cherrygrove can be lost without skipping straight to the blackout message. The latter issue can be corrected with the [following fix](https://github.com/pret/pokecrystal/wiki/Print-text-when-you-lose-a-trainer-battle). ## `$65`: `scripttalkafter` +Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it handles what happens when talking to a defeated trainer. ## `$66`: `endifjustbattled` +Used in map scripts as part of the trainer encounter setup. This command will make it so the "after battle" dialogue doesn't automatically play once the battle ends and the player is returned to the overworld. ## `$67`: `checkjustbattled` +Unused in regular gameplay. Used to check if a given trainer has just been battled or not. ## `$68`: setlasttalked object_id +Used in map scripts to set a character as the one last talked to. ## `$69`: applymovement object_id, data_pointer +Used in map scripts to assign either the player or a given object a movement script. ## `$6A`: applymovementlasttalked data_pointer +Used in map scripts to assign a movement script to the last talked character. ## `$6B`: `faceplayer` +Used in map scripts to make a given character face the player. ## `$6C`: faceobject object1, object2 +Used in map scripts to make a character face another given character. ## `$6D`: variablesprite variable_sprite_id, sprite_id +Used in map scripts to change the appearance of a variable sprite. A writeup on variable sprites can be found [here](https://github.com/pret/pokecrystal/wiki/Add-a-new-overworld-sprite). ## `$6E`: disappear object_id +Used in map scripts to hide an object. ## `$6F`: appear object_id +Used in map scripts to make a hidden object visible. ## `$70`: follow object2, object1 +Used to make the player follow an NPC, or vice versa. Do note that NPCs can't follow the player across map connections, nor through warps. NPCs followers are coded to jump off ledges like the player, though this won't play any sound. ## `$71`: `stopfollow` +Used to terminates a `follow` command. ## `$72`: moveobject object_id, x, y +Used in map scripts to move an object to a new location on the same map. Note that this only works if said object is not visible (see `disappear`). ## `$73`: writeobjectxy object_id +Writes the current x/y values of a trainer into RAM, and they will stand at their current location even when outside of the player's sight. They will not return to their old location until a new map loads. Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm). ## `$74`: loademote emote_id +Used to load an emote in an engine script. ## `$75`: showemote emote_id, object_id, length +Used to display an emote in map scripts, alongside which object it will appear above, and for how long. ## `$76`: turnobject object_id, facing +Used in map scripts to turn an object in a given cardinal direction. ## `$77`: follownotexact object2, object1 +Unused in regular gameplay. Used to make an NPC follow the player (doing it the other way around may cause the game to lock up). Compared to `follow`, this command doesn't account for ledges on the follower's side. Moreover, while `stopfollow` has no effect here, warping to a new map simply resumes the game as usual, whereas doing the same with `follow` causes the game to softlock after the player walks around for a bit. ## `$78`: earthquake param +Will make the screen shake for a given amount of time. ## `$79`: changemapblocks blockdata_pointer ChangeMap(blockdata_pointer) +Unused in regular gameplay. Used in map callbacks to draw a new map over a given map, as long as they share the same tileset and dimensions. Here's an example of `changemapblocks` from [Polished Crystal](https://github.com/Rangi42/polishedcrystal/tree/master/maps/LakeOfRage.asm#L69). + ## `$7A`: changeblock x, y, block +Used to change one or more blocks in a given part of the current map. If the change happens for an area happens to be on-screen, a `refreshmap` command will have to be used afterwards. ## `$7B`: `reloadmap` +Reloads the current map completely. ## `$7C`: `refreshmap` +Refreshed the part of the map that's currently on-screen. ## `$7D`: writecmdqueue queue_pointer +Writes to a command queue, namely used by maps which use Strength boulders that can fall through holes in the ground. See [maps/IcePathB1F.asm](../blob/master/maps/IcePathB1F.asm#L14) as an example. ## `$7E`: delcmdqueue byte +Unused in regular gameplay. Deletes a given command queue from ram. ## `$7F`: playmusic music_id +Used to call a given music track in a script. ## `$80`: `encountermusic` +Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it loads the right encounter music. ## `$81`: musicfadeout music_id, length +Fades out the current music track, so another one can be played instead. ## `$82`: `playmapmusic` +Makes the current map's music track play again. ## `$83`: `dontrestartmapmusic` +Makes it so no music is played after the current map reloads. ## `$84`: cry mon_id +Used to play a given Pokémon's cry. ## `$85`: playsound sfx_id +Used to play a given sound effect. ## `$86`: `waitsfx` +Wait until the chosen sound effect finishes playing until the next instruction is read. ## `$87`: `warpsound` +Plays the door warp sound effect. Seldom used in the Battle Tower scripts. ## `$88`: `specialsound` +Plays the "get item"sound effect. Seldom used in the "give item" engine scripts. ## `$89`: autoinput input_pointer +Unused in regular gameplay. Calls `StartAutoInput`, which lets the game play a series of defined actions, like in the Pokémon catching tutorial. ## `$8A`: newloadmap which_method +Used in scripts to call a new `MAPSETUP` type. Refers to [constants/map_setup_constants.asm](../blob/master/constants/map_setup_constants.asm). ## `$8B`: pause length +Used to pause the game a given number of frames until the next instruction is read. ## `$8C`: deactivatefacing length +Seldom used in `ChangeDirectionScript`. ## `$8D`: sdefer script - +Used in a map scene to run a script. ## `$8E`: `warpcheck` +Used in map scripts. If the player is under a movement script, and enters a warp (like a door), this command will trigger it and warp the player to the new map. ## `$8F`: stopandsjump script +Unused in regular gameplay. Calls `StopScript`, and then `Script_sjump`. ## `$90`: `endcallback` +Used to `terminate` a callback script. ## `$91`: `end` +Used to terminate map scripts. ## `$92`: reloadend which_method +Seldom used in `EdgeWarpScript` to load a new map, and then end the script. ## `$93`: `endall` +Seldom used to terminate `Script_Whiteout`. ## `$94`: pokemart mart_type, mart_id +Used to call the data of a sale clerk, as in what items they will propose, and what dialogue set they will use. Refers to [data/items/marts.asm](../blob/master/data/items/marts.asm). ## `$95`: elevator floor_list +Used to read what floors will appear as options in the elevator interface, and what maps the player will be warped to. Used in conjunction with a given data table, see [maps/GoldenrodDeptStoreElevator.asm](../blob/master/maps/GoldenrodDeptStoreElevator.asm#L8) as an example. ## `$96`: trade trade_id +Used to call the data for an in-game trade NPC, as in what Pokémon they're looking for, which one they offer in return, as well as what dialogue set they will use. Refers to [data/events/npc_trades.asm](../blob/master/data/events/npc_trades.asm). ## `$97`: askforphonenumber contact_id +Used to save a given character's phone number to the player's PokéGear. ## `$98`: phonecall call_id +Unused in regular gameplay. Used in map scripts to play the phonecall animation, with a defined caller name. This command needs to be preceded by an `opentext` to display properly, which in turn prints an empty dialogue box during the ringing, unlike actual phonecalls. +Also note that this command is improperly implemented, and may crash the game when used. The latter issue can be corrected with the [following fix](https://github.com/pret/pokecrystal/blob/master/docs/bugs_and_glitches.md#the-Unused-phonecall-script-command-may-crash). + +Here is an example of a script using this command: +``` +WrongPhoneNumberScript: + phonecall UnknownCallName + opentext + writetext UnknownCallerText + waitbutton + hangup + closetext + end + +UnknownCallName: + db "UNKNOWN CALL:@" + +UnknownCallerText: + text "Hey grandma, could" + line "you go pick up--" + + para "Oh, sorry. I got" + line "the wrong number." + done +``` ## `$99`: `hangup` +Unused in regular gameplay. Used in map scripts to play the phonecall hangup animation (the "Click…" string and the three beeps that follow). ## `$9A`: describedecoration byte +Used by the room decorations to call a flavor text string based on what type of decor it is (poster, doll/console, or giant doll). Refers to [engine/overworld/decorations.asm](../blob/master/engine/overworld/decorations.asm#L971). ## `$9B`: fruittree tree_id +Used by fruit trees to call what kind of berry or apricorn the player will receive from them. Refers to [data/items/fruit_trees.asm](../blob/master/data/items/fruit_trees.asm). ## `$9C`: specialphonecall call_id +Used to trigger dedicated phonecalls upon warping to a new map. See [maps/VioletGym.asm](../blob/master/maps/VioletGym.asm) and [maps/Route31 .asm](../blob/master/maps/Route31.asm) as examples. ## `$9D`: `checkphonecall` +Used in engine scripts to check if a given phonecall has or hasn't happened. ## `$9E`: verbosegiveitem item_id[, quantity=1] +Used to gift the player an item, with a corresponding message (" received . put the in the .") This command combines `itemnotify` and `giveitem` together (only with a more verbose "get item" string). ## `$9F`: verbosegiveitemvar item_id, variable +A variant of the `verbosegiveitem` command used for Kurt's "get Apricorn Ball" scripts. ## `$A0`: swarm swarm_id, map +Used in conjunction with a `setflag` command to instantly trigger a Pokémon swarm in a given map. See [engine/phone/scripts/anthony.asm](../blob/master/engine/phone/scripts/anthony.asm#L51) as an example. ## `$A1`: `halloffame` +Triggers the "entering the Hall of Fame" sequence, and then plays the credits. ## `$A2`: `credits` +Plays the end credits, and then returns the player to the title screen. ## `$A3`: warpfacing facing, map, x, y +Used to warp the player to a given location, at specified coordinates. Unlike the regular `warp` command, here one may also specify if the player will appear on the new map facing `UP`, `LEFT`, or `RIGHT`. ## `$A4`: battletowertext bttext_id +Seldom used in [maps/BattleTowerBattleRoom.asm](../blob/master/maps/BattleTowerBattleRoom.asm) to load the enemy trainer's dialogue. ## `$A5`: getlandmarkname string_buffer, landmark_id GetStringBuffer(string_buffer) = GetLandmarkName(landmark_id) +Used in engine scripts to save a given location name in a string buffer, for it to then be displayed in a dialogue box. + ## `$A6`: gettrainerclassname string_buffer, trainer_group GetStringBuffer(string_buffer) = GetName(TRAINER_NAME, trainer_group) +Used in engine scripts to save a trainer class name in a string buffer, for it to then be displayed in a dialogue box. + ## `$A7`: getname string_buffer, type, id GetStringBuffer(string_buffer) = GetName(type, id) +Used in the Pokémon stats and trainer attributes engine scripts, to draw a given name. Refers to [constants/text_constants.asm](../blob/master/constants/text_constants.asm). + ## `$A8`: wait duration +Seldom used in Goldenrod and Saffron's train station scripts. This command is used to make the player wait until the landmark sign disappears before they perform the "leave the train" animation. ## `$A9`: `checksave` +Unused in regular gameplay. May be used in conjunction with an `iftrue` or an `iffalse` check to see if the player has or hasn't saved their game. From 3c39b1c0d8dbd78cc4bb020fb233e3898ae0abf2 Mon Sep 17 00:00:00 2001 From: FrenchOrange <64930003+FrenchOrange@users.noreply.github.com> Date: Thu, 21 Nov 2024 00:52:53 +0100 Subject: [PATCH 2/5] Url change --- docs/event_commands.md | 90 +++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/docs/event_commands.md b/docs/event_commands.md index 4a562fff754..30d7d17df18 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -12,7 +12,7 @@ A version of `scall` used to call scripts that are in different banks. ## `$02`: memcall script -Used in engine scripts to call a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/phone/phone.asm](../blob/master/engine/phone/phone.asm#L384) as examples. +Used in engine scripts to call a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/phone/phone.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/phone.asm#L384) as examples. ## `$03`: sjump script @@ -24,7 +24,7 @@ A version of `sjump` used to jump to scripts that are in different banks. ## `$05`: memjump script -Used in engine scripts to jump to a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm#L852). +Used in engine scripts to jump to a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/overworld/events.asm](https://github.com/pret/pokecrystal/blob/master/engine/overworld/events.asm#L852). ## `$06`: ifequal byte, script @@ -52,7 +52,7 @@ Used to compare if a value is lesser than another defined value. ## `$0C`: jumpstd std_script -Used in map scripts to jump to an `std_script`, like Pokémon Center/Mart signs, or Gym statues. Refers to [engine/events/std_scripts.asm](../blob/master/engine/events/std_scripts.asm). +Used in map scripts to jump to an `std_script`, like Pokémon Center/Mart signs, or Gym statues. Refers to [engine/events/std_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/std_scripts.asm). ## `$0D`: callstd std_script @@ -64,11 +64,11 @@ Used in engine scripts to call an asm function. ## `$0F`: special special_pointer -Used in scripts to call a `special` function. Refers to [data/events/special_pointers.asm](../blob/master/data/events/special_pointers.asm). +Used in scripts to call a `special` function. Refers to [data/events/special_pointers.asm](https://github.com/pret/pokecrystal/blob/master/data/events/special_pointers.asm). ## `$10`: memcallasm asm -Used in engine scripts to call an asm function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/overworld/events.asm](../blob/master/engine/overworld/events.asm#L852). +Used in engine scripts to call an asm function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/overworld/events.asm](https://github.com/pret/pokecrystal/blob/master/engine/overworld/events.asm#L852). ## `$11`: checkmapscene map @@ -80,7 +80,7 @@ Used to set a given scene as having been triggered, in a map other than the curr ## `$13`: `checkscene` -Used to check whether or not a given scene from the current map has been triggered. See [maps/PlayersHouse1F.asm](../blob/master/maps/PlayersHouse1F.asm#L113) and [maps/RuinsOfAlphResearchCenter.asm](../blob/master/maps/RuinsOfAlphResearchCenter.asm#L21) as examples. +Used to check whether or not a given scene from the current map has been triggered. See [maps/PlayersHouse1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/PlayersHouse1F.asm#L113) and [maps/RuinsOfAlphResearchCenter.asm](https://github.com/pret/pokecrystal/blob/master/maps/RuinsOfAlphResearchCenter.asm#L21) as examples. ## `$14`: setscene scene_id @@ -102,7 +102,7 @@ Used in scripts to add a certain number to a given variable into RAM. ## `$17`: random value -Used to call a random number, in conjunction with a value check command like `ifequal `. See [maps/OlivineCity.asm](../blob/master/maps/OlivineCity.asm#L76) and [engine/phone/scripts/jack_gossip.asm](../blob/master/engine/phone/scripts/jack_gossip.asm#L4) as examples. +Used to call a random number, in conjunction with a value check command like `ifequal `. See [maps/OlivineCity.asm](https://github.com/pret/pokecrystal/blob/master/maps/OlivineCity.asm#L76) and [engine/phone/scripts/jack_gossip.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/jack_gossip.asm#L4) as examples. ## `$18`: `checkver` @@ -168,11 +168,11 @@ Used to give a certain sum of money to the player. ## `$23`: takemoney account, value -Used to take a given sum of money from the player. See [maps/Route39Farmhouse.asm](../blob/master/maps/Route39Farmhouse.asm#L23) as an example. +Used to take a given sum of money from the player. See [maps/Route39Farmhouse.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route39Farmhouse.asm#L23) as an example. ## `$24`: checkmoney account, value -Used to check whether or not the player has a given sum of money. See [maps/Route39Farmhouse.asm](../blob/master/maps/Route39Farmhouse.asm#L23) as an example. +Used to check whether or not the player has a given sum of money. See [maps/Route39Farmhouse.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route39Farmhouse.asm#L23) as an example. ## `$25`: givecoins value @@ -208,7 +208,7 @@ Used in map scripts to check if a given Pokémon is in the player's party. ## `$2D`: givepoke mon_id, level[, item=0[, nickname, ot_name]] -Used in map scripts to gift the player a given Pokémon at a given level. Two extra parameters can also be set, namely the Pokémon's nickname, and its Original Trainer's name and gender (the latter is male/0 by default, but can be set to female/1). See [maps/Route35GoldenrodGate.asm](../blob/master/maps/Route35GoldenrodGate.asm#L31) as an example. +Used in map scripts to gift the player a given Pokémon at a given level. Two extra parameters can also be set, namely the Pokémon's nickname, and its Original Trainer's name and gender (the latter is male/0 by default, but can be set to female/1). See [maps/Route35GoldenrodGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35GoldenrodGate.asm#L31) as an example. ## `$2E`: giveegg mon_id, level @@ -216,11 +216,11 @@ Used in map scripts to gift the player an egg of a specific Pokémon species. Th ## `$2F`: givepokemail pointer -Used in map scripts to give pokemail to an in-game gift Pokémon, specifying which type of mail and what message it will have. See [maps/Route35GoldenrodGate.asm](../blob/master/maps/Route35GoldenrodGate.asm#L32) as an example. +Used in map scripts to give pokemail to an in-game gift Pokémon, specifying which type of mail and what message it will have. See [maps/Route35GoldenrodGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35GoldenrodGate.asm#L32) as an example. ## `$30`: checkpokemail pointer -Used as part of the Kenya side-quest, to check if the mail matches the one that was given to the player on Route 35. See [maps/Route31.asm](../blob/master/maps/Route31.asm#L198) as an example. +Used as part of the Kenya side-quest, to check if the mail matches the one that was given to the player on Route 35. See [maps/Route31.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route31.asm#L198) as an example. ## `$31`: checkevent event_flag @@ -234,7 +234,7 @@ Used to clear an event flag. A map object that is assigned a set event will be n ## `$33`: setevent event_flag Used to set an event flag. An event that has been set may be used in conjunction with an `iftrue` or `iffalse` check. Moreover, a map object that is assigned a set event will no longer be visible nor interactable. -Events may be set upon starting a new save by being defined as such in [engine/events/std_scripts.asm](../blob/master/maps/engine/events/std_scripts.asm#L480). +Events may be set upon starting a new save by being defined as such in [engine/events/std_scripts.asm](https://github.com/pret/pokecrystal/blob/master/maps/engine/events/std_scripts.asm#L480). ## `$34`: checkflag engine_flag @@ -265,9 +265,9 @@ Unused in regular gameplay. This command compares the player's current X and Y c Unused in regular gameplay. Used in map callbacks to change the destination of a warp set to `-1`. Here's an example of `warpmod` from [Polished Crystal](https://github.com/Rangi42/polishedcrystal/blob/master/maps/LavRadioTower1F.asm#L25). ## `$3B`: blackoutmod map -Used in map scripts to change the destination the player will be warped to after blacking out. Refers to [data/maps/spawn_points.asm](../blob/master/data/maps/spawn_points.asm). +Used in map scripts to change the destination the player will be warped to after blacking out. Refers to [data/maps/spawn_points.asm](https://github.com/pret/pokecrystal/blob/master/data/maps/spawn_points.asm). -The point of this command is to avoid some story "desyncs". For example, a `blackoutmod` command set to Cherrygrove City is defined in the script for meeting Prof. Oak at [Mr Pokémon's house](../blob/master/maps/MrPokemonsHouse.asm#L37). If it weren't there, and the player hadn't visited Cherrygrove's Pokémon Center, then blacking out on Route 30 would warp them back to New Bark Town, thus skipping the first rival battle. +The point of this command is to avoid some story "desyncs". For example, a `blackoutmod` command set to Cherrygrove City is defined in the script for meeting Prof. Oak at [Mr Pokémon's house](https://github.com/pret/pokecrystal/blob/master/maps/MrPokemonsHouse.asm#L37). If it weren't there, and the player hadn't visited Cherrygrove's Pokémon Center, then blacking out on Route 30 would warp them back to New Bark Town, thus skipping the first rival battle. ## `$3C`: warp map, x, y @@ -280,7 +280,7 @@ Also note that the player will always be warped facing down. If one wishes to wa GetStringBuffer(string_buffer) = PrintNum(GetMoneyAccount(account)) -Used by [engine/phone/scripts/mom.asm](../blob/master/engine/phone/scripts/mom.asm) to display the correct amount of money when calling mom to know how much money has been saved. +Used by [engine/phone/scripts/mom.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/mom.asm) to display the correct amount of money when calling mom to know how much money has been saved. ## `$3E`: getcoins string_buffer @@ -294,7 +294,7 @@ Unused in regular gameplay. Identical to `getmoney`, only with the Game Corner c GetStringBuffer(string_buffer) = PrintNum([wScriptVar]) -Used in a script to display a given value in a dialogue box. See [maps/Route35NationalParkGate.asm](../blob/master/maps/Route35NationalParkGate.asm#L54) as an example. +Used in a script to display a given value in a dialogue box. See [maps/Route35NationalParkGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35NationalParkGate.asm#L54) as an example. ## `$40`: getmonname string_buffer, mon_id @@ -302,7 +302,7 @@ Used in a script to display a given value in a dialogue box. See [maps/Route35Na If mon_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. -Used in a script to display a given Pokémon name in a dialogue box. See [maps/ElmsLab.asm](../blob/master/maps/ElmsLab.asm#L177) as an example. +Used in a script to display a given Pokémon name in a dialogue box. See [maps/ElmsLab.asm](https://github.com/pret/pokecrystal/blob/master/maps/ElmsLab.asm#L177) as an example. ## `$41`: getitemname string_buffer, item_id @@ -311,36 +311,36 @@ Used in a script to display a given Pokémon name in a dialogue box. See [maps/E If item_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. -Used in a script to display a given item name in a dialogue box. See [maps/CeladonCafe.asm](../blob/master/maps/CeladonCafe.asm#L91) as an example. +Used in a script to display a given item name in a dialogue box. See [maps/CeladonCafe.asm](https://github.com/pret/pokecrystal/blob/master/maps/CeladonCafe.asm#L91) as an example. ## `$42`: getcurlandmarkname string_buffer GetStringBuffer(string_buffer) = GetLandmarkName(GetWorldMapLocation()) -Used in a script to display the current location name in a dialogue box. Used by both [engine/phone/scripts/mom.asm](../blob/master/engine/phone/scripts/mom.asm#L12) and [engine/events/std_scripts.asm](../blob/master/engine/events/std_scripts.asm#L1757). +Used in a script to display the current location name in a dialogue box. Used by both [engine/phone/scripts/mom.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/mom.asm#L12) and [engine/events/std_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/std_scripts.asm#L1757). ## `$43`: gettrainername string_buffer, trainer_group, trainer_id GetStringBuffer(string_buffer) = GetTrainerName(trainer_group, trainer_id) -Used in a script to display a given trainer name in a dialogue box. See [maps/VioletGym.asm](../blob/master/maps/VioletGym.asm#L105) as an example. +Used in a script to display a given trainer name in a dialogue box. See [maps/VioletGym.asm](https://github.com/pret/pokecrystal/blob/master/maps/VioletGym.asm#L105) as an example. ## `$44`: getstring string_buffer, text_pointer GetStringBuffer(string_buffer) = CopyName1([wScriptBank], text_pointer) -Used in a script to display a given string in a dialogue box. See [maps/LavRadioTower1F.asm](../blob/master/maps/LavRadioTower1F.asm#L34) as an example. +Used in a script to display a given string in a dialogue box. See [maps/LavRadioTower1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/LavRadioTower1F.asm#L34) as an example. ## `$45`: `itemnotify` -Used in map scripts alongside a `giveitem` command. Prints the " put the in the ." message. See [maps/DragonsDenB1F.asm](../blob/master/maps/DragonsDenB1F.asm#L57) as an example. +Used in map scripts alongside a `giveitem` command. Prints the " put the in the ." message. See [maps/DragonsDenB1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/DragonsDenB1F.asm#L57) as an example. ## `$46`: `pocketisfull` -Seldom called by `GiveItemScript`, in [engine/overworld/scripting.asm](../blob/master/engine/overworld/scripting.asm#L467). +Seldom called by `GiveItemScript`, in [engine/overworld/scripting.asm](https://github.com/pret/pokecrystal/blob/master/engine/overworld/scripting.asm#L467). ## `$47`: `opentext` @@ -371,7 +371,7 @@ Used in map scripts after an `opentext` command, to load a given text pointer. ## `$4D`: repeattext byte1, byte2 -Seldom called by `JumpTextFacePlayerScript`, in [engine/overworld/scripting.asm](../blob/master/engine/overworld/scripting.asm#L309). +Seldom called by `JumpTextFacePlayerScript`, in [engine/overworld/scripting.asm](https://github.com/pret/pokecrystal/blob/master/engine/overworld/scripting.asm#L309). ## `$4E`: `yesorno` @@ -379,7 +379,7 @@ Used in map scripts to load a "yes or no" prompt. To be used in conjunction with ## `$4F`: loadmenu menu_header -Used in map scripts to load menu data. See [maps/DragonShrine.asm](../blob/master/maps/DragonShrine.asm#L21) as an example. +Used in map scripts to load menu data. See [maps/DragonShrine.asm](https://github.com/pret/pokecrystal/blob/master/maps/DragonShrine.asm#L21) as an example. ## `$50`: `closewindow` @@ -391,7 +391,7 @@ Used to load the text of an `object_event`. Essentially combines `faceplayer`, ` ## `$52`: farjumptext text_pointer -Seldom used in [engine/events/std_scripts.asm](../blob/master/engine/events/std_scripts.asm) to draw text from [data/text/std_text.asm](../blob/master/data/text/std_text.asm). +Seldom used in [engine/events/std_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/std_scripts.asm) to draw text from [data/text/std_text.asm](https://github.com/pret/pokecrystal/blob/master/data/text/std_text.asm). ## `$53`: jumptext text_pointer @@ -434,11 +434,11 @@ Used in engine scripts as part of the Sweet Scent, But Catching Contest, and wil `[wOtherTrainer] = [wTempTrainer]` -Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it loads temporary trainer data. +Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/trainer_scripts.asm), where it loads temporary trainer data. ## `$5D`: loadwildmon mon_id, level -Used in map scripts to load a battle against a specific Pokémon species at a given level. See [maps/UnionCaveB2F.asm](../blob/master/maps/UnionCaveB2F.asm#L28) as an example. +Used in map scripts to load a battle against a specific Pokémon species at a given level. See [maps/UnionCaveB2F.asm](https://github.com/pret/pokecrystal/blob/master/maps/UnionCaveB2F.asm#L28) as an example. ## `$5E`: loadtrainer trainer_group, trainer_id @@ -458,11 +458,11 @@ Used to initiate the Pokémon catching tutorial on Route 29. Needs to be precede ## `$62`: trainertext text_id -Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it loads temporary trainer dialogue data. +Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/trainer_scripts.asm), where it loads temporary trainer dialogue data. ## `$63`: trainerflagaction action -Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it handles the "trainer defeated" flag data. +Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/trainer_scripts.asm), where it handles the "trainer defeated" flag data. ## `$64`: winlosstext win_text_pointer, loss_text_pointer @@ -470,7 +470,7 @@ Used in trainer battle scripts to print a given string when the player either wi ## `$65`: `scripttalkafter` -Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it handles what happens when talking to a defeated trainer. +Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/trainer_scripts.asm), where it handles what happens when talking to a defeated trainer. ## `$66`: `endifjustbattled` @@ -526,7 +526,7 @@ Used in map scripts to move an object to a new location on the same map. Note th ## `$73`: writeobjectxy object_id -Writes the current x/y values of a trainer into RAM, and they will stand at their current location even when outside of the player's sight. They will not return to their old location until a new map loads. Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm). +Writes the current x/y values of a trainer into RAM, and they will stand at their current location even when outside of the player's sight. They will not return to their old location until a new map loads. Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/trainer_scripts.asm). ## `$74`: loademote emote_id @@ -569,7 +569,7 @@ Refreshed the part of the map that's currently on-screen. ## `$7D`: writecmdqueue queue_pointer -Writes to a command queue, namely used by maps which use Strength boulders that can fall through holes in the ground. See [maps/IcePathB1F.asm](../blob/master/maps/IcePathB1F.asm#L14) as an example. +Writes to a command queue, namely used by maps which use Strength boulders that can fall through holes in the ground. See [maps/IcePathB1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/IcePathB1F.asm#L14) as an example. ## `$7E`: delcmdqueue byte @@ -581,7 +581,7 @@ Used to call a given music track in a script. ## `$80`: `encountermusic` -Seldom used in [engine/events/trainer_scripts.asm](../blob/master/engine/events/trainer_scripts.asm), where it loads the right encounter music. +Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/trainer_scripts.asm), where it loads the right encounter music. ## `$81`: musicfadeout music_id, length @@ -621,7 +621,7 @@ Unused in regular gameplay. Calls `StartAutoInput`, which lets the game play a s ## `$8A`: newloadmap which_method -Used in scripts to call a new `MAPSETUP` type. Refers to [constants/map_setup_constants.asm](../blob/master/constants/map_setup_constants.asm). +Used in scripts to call a new `MAPSETUP` type. Refers to [constants/map_setup_constants.asm](https://github.com/pret/pokecrystal/blob/master/constants/map_setup_constants.asm). ## `$8B`: pause length @@ -660,15 +660,15 @@ Seldom used to terminate `Script_Whiteout`. ## `$94`: pokemart mart_type, mart_id -Used to call the data of a sale clerk, as in what items they will propose, and what dialogue set they will use. Refers to [data/items/marts.asm](../blob/master/data/items/marts.asm). +Used to call the data of a sale clerk, as in what items they will propose, and what dialogue set they will use. Refers to [data/items/marts.asm](https://github.com/pret/pokecrystal/blob/master/data/items/marts.asm). ## `$95`: elevator floor_list -Used to read what floors will appear as options in the elevator interface, and what maps the player will be warped to. Used in conjunction with a given data table, see [maps/GoldenrodDeptStoreElevator.asm](../blob/master/maps/GoldenrodDeptStoreElevator.asm#L8) as an example. +Used to read what floors will appear as options in the elevator interface, and what maps the player will be warped to. Used in conjunction with a given data table, see [maps/GoldenrodDeptStoreElevator.asm](https://github.com/pret/pokecrystal/blob/master/maps/GoldenrodDeptStoreElevator.asm#L8) as an example. ## `$96`: trade trade_id -Used to call the data for an in-game trade NPC, as in what Pokémon they're looking for, which one they offer in return, as well as what dialogue set they will use. Refers to [data/events/npc_trades.asm](../blob/master/data/events/npc_trades.asm). +Used to call the data for an in-game trade NPC, as in what Pokémon they're looking for, which one they offer in return, as well as what dialogue set they will use. Refers to [data/events/npc_trades.asm](https://github.com/pret/pokecrystal/blob/master/data/events/npc_trades.asm). ## `$97`: askforphonenumber contact_id @@ -708,15 +708,15 @@ Unused in regular gameplay. Used in map scripts to play the phonecall hangup ani ## `$9A`: describedecoration byte -Used by the room decorations to call a flavor text string based on what type of decor it is (poster, doll/console, or giant doll). Refers to [engine/overworld/decorations.asm](../blob/master/engine/overworld/decorations.asm#L971). +Used by the room decorations to call a flavor text string based on what type of decor it is (poster, doll/console, or giant doll). Refers to [engine/overworld/decorations.asm](https://github.com/pret/pokecrystal/blob/master/engine/overworld/decorations.asm#L971). ## `$9B`: fruittree tree_id -Used by fruit trees to call what kind of berry or apricorn the player will receive from them. Refers to [data/items/fruit_trees.asm](../blob/master/data/items/fruit_trees.asm). +Used by fruit trees to call what kind of berry or apricorn the player will receive from them. Refers to [data/items/fruit_trees.asm](https://github.com/pret/pokecrystal/blob/master/data/items/fruit_trees.asm). ## `$9C`: specialphonecall call_id -Used to trigger dedicated phonecalls upon warping to a new map. See [maps/VioletGym.asm](../blob/master/maps/VioletGym.asm) and [maps/Route31 .asm](../blob/master/maps/Route31.asm) as examples. +Used to trigger dedicated phonecalls upon warping to a new map. See [maps/VioletGym.asm](https://github.com/pret/pokecrystal/blob/master/maps/VioletGym.asm) and [maps/Route31 .asm](https://github.com/pret/pokecrystal/blob/master/maps/Route31.asm) as examples. ## `$9D`: `checkphonecall` @@ -732,7 +732,7 @@ A variant of the `verbosegiveitem` command used for Kurt's "get Apricorn Ball" s ## `$A0`: swarm swarm_id, map -Used in conjunction with a `setflag` command to instantly trigger a Pokémon swarm in a given map. See [engine/phone/scripts/anthony.asm](../blob/master/engine/phone/scripts/anthony.asm#L51) as an example. +Used in conjunction with a `setflag` command to instantly trigger a Pokémon swarm in a given map. See [engine/phone/scripts/anthony.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/anthony.asm#L51) as an example. ## `$A1`: `halloffame` @@ -748,7 +748,7 @@ Used to warp the player to a given location, at specified coordinates. Unlike th ## `$A4`: battletowertext bttext_id -Seldom used in [maps/BattleTowerBattleRoom.asm](../blob/master/maps/BattleTowerBattleRoom.asm) to load the enemy trainer's dialogue. +Seldom used in [maps/BattleTowerBattleRoom.asm](https://github.com/pret/pokecrystal/blob/master/maps/BattleTowerBattleRoom.asm) to load the enemy trainer's dialogue. ## `$A5`: getlandmarkname string_buffer, landmark_id @@ -769,7 +769,7 @@ Used in engine scripts to save a trainer class name in a string buffer, for it t GetStringBuffer(string_buffer) = GetName(type, id) -Used in the Pokémon stats and trainer attributes engine scripts, to draw a given name. Refers to [constants/text_constants.asm](../blob/master/constants/text_constants.asm). +Used in the Pokémon stats and trainer attributes engine scripts, to draw a given name. Refers to [constants/text_constants.asm](https://github.com/pret/pokecrystal/blob/master/constants/text_constants.asm). ## `$A8`: wait duration From a16530e6c216493c4d5d8a24f7827ef4b9b28427 Mon Sep 17 00:00:00 2001 From: FrenchOrange <64930003+FrenchOrange@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:05:39 +0100 Subject: [PATCH 3/5] Redundancy --- docs/event_commands.md | 116 ++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/docs/event_commands.md b/docs/event_commands.md index 30d7d17df18..e6fc5f54e01 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -4,7 +4,7 @@ Defined in [macros/scripts/events.asm](https://github.com/pret/pokecrystal/blob/ ## `$00`: scall script -Used to call a script inside a different one. Once this "sub script" reaches its `end`, the game will return to the rest of the script that first called it. +Used to call a script inside a different one. Once the former reaches its `end`, the game will return to the rest of the script that first called it. ## `$01`: farscall script @@ -12,11 +12,11 @@ A version of `scall` used to call scripts that are in different banks. ## `$02`: memcall script -Used in engine scripts to call a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/phone/phone.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/phone.asm#L384) as examples. +Used in engine scripts to call a function via a 2byte pointer pointing to a 3byte pointer. Seldom used in [engine/phone/phone.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/phone.asm#L384). ## `$03`: sjump script -Used to jump to a script inside a different one. Once this "sub script" reaches its `end`, the game will return to the rest of the script that first called it. +Used to jump to a script inside a different one. Once the former reaches its `end`, the game will return to the rest of the script that first called it. ## `$04`: farsjump script @@ -28,7 +28,7 @@ Used in engine scripts to jump to a function via a 2byte pointer pointing to a 3 ## `$06`: ifequal byte, script -Used in a script to compare if a value is identical to another defined value. +Used in to compare if a value is identical to another defined value. ## `$07`: ifnotequal byte, script @@ -64,7 +64,7 @@ Used in engine scripts to call an asm function. ## `$0F`: special special_pointer -Used in scripts to call a `special` function. Refers to [data/events/special_pointers.asm](https://github.com/pret/pokecrystal/blob/master/data/events/special_pointers.asm). +Used to call a `special` function. Refers to [data/events/special_pointers.asm](https://github.com/pret/pokecrystal/blob/master/data/events/special_pointers.asm). ## `$10`: memcallasm asm @@ -91,14 +91,14 @@ Used to set a given scene from the current map as having been triggered. [wScriptVar] = value -Used in scripts to load a given variable into RAM. Used in a variety of situations, like calling the right Unown puzzle, the right Move Tutor option, or the right Pokémon for `MonCheck`. +Used to load a given variable into RAM. Used in a variety of situations, like calling the right Unown puzzle, the right Move Tutor option, or the right Pokémon for `MonCheck`. ## `$16`: addval value [wScriptVar] += value -Used in scripts to add a certain number to a given variable into RAM. +Used to add a certain number to a given variable into RAM. ## `$17`: random value @@ -113,42 +113,42 @@ Leftover from *Gold and Silver*, where it was used in map scripts to check the v [wScriptVar] = [address] -Used in scripts to write a given variable from a ram address to RAM. +Used to write a given variable from a ram address to RAM. ## `$1A`: writemem address [address] = [wScriptVar] -Used in scripts to write a given variable from RAM to a ram address. +Used to write a given variable from RAM to a ram address. ## `$1B`: loadmem address, value [address] = value -Used in scripts to write a given value to a ram address. +Used to write a given value to a ram address. ## `$1C`: readvar variable [wScriptVar] = GetVarAction(variable) -Used in scripts to check `wScriptVar` values and write them into RAM. +Used to check `wScriptVar` values and write them into RAM. ## `$1D`: writevar variable GetVarAction(variable) = [wScriptVar] -Used in scripts to write a given variable from RAM to `wScriptVar` offsets. +Used to write a given variable from RAM to `wScriptVar` offsets. ## `$1E`: loadvar variable, value GetVarAction(variable) = value -Used in scripts to write given variable to `GetVarAction` offsets. +Used to write given variable to `GetVarAction` offsets. ## `$1F`: giveitem item_id[, quantity=1] @@ -204,19 +204,19 @@ Used to check what time of day it is, either `MORN`, `DAY`, or `NITE`. ## `$2C`: checkpoke mon_id -Used in map scripts to check if a given Pokémon is in the player's party. +Used to check if a given Pokémon is in the player's party. ## `$2D`: givepoke mon_id, level[, item=0[, nickname, ot_name]] -Used in map scripts to gift the player a given Pokémon at a given level. Two extra parameters can also be set, namely the Pokémon's nickname, and its Original Trainer's name and gender (the latter is male/0 by default, but can be set to female/1). See [maps/Route35GoldenrodGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35GoldenrodGate.asm#L31) as an example. +Used to gift the player a given Pokémon at a given level. Two extra parameters can also be set, namely the Pokémon's nickname, and its Original Trainer's name and gender (the latter is male/0 by default, but can be set to female/1). See [maps/Route35GoldenrodGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35GoldenrodGate.asm#L31) as an example. ## `$2E`: giveegg mon_id, level -Used in map scripts to gift the player an egg of a specific Pokémon species. The level at which it hatches can be set manually, but using `EGG_LEVEL` will default to a level 5 hatchling. +Used to gift the player an egg of a specific Pokémon species. The level at which it hatches can be set manually, but using `EGG_LEVEL` will default to a level 5 hatchling. ## `$2F`: givepokemail pointer -Used in map scripts to give pokemail to an in-game gift Pokémon, specifying which type of mail and what message it will have. See [maps/Route35GoldenrodGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35GoldenrodGate.asm#L32) as an example. +Used to give pokemail to an in-game gift Pokémon, specifying which type of mail and what message it will have. See [maps/Route35GoldenrodGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35GoldenrodGate.asm#L32) as an example. ## `$30`: checkpokemail pointer @@ -242,7 +242,7 @@ Used to check whether or not an engine flag has been set. ## `$35`: clearflag engine_flag -Used in scripts to clear an engine flag. +Used to clear an engine flag. ## `$36`: setflag engine_flag @@ -265,9 +265,9 @@ Unused in regular gameplay. This command compares the player's current X and Y c Unused in regular gameplay. Used in map callbacks to change the destination of a warp set to `-1`. Here's an example of `warpmod` from [Polished Crystal](https://github.com/Rangi42/polishedcrystal/blob/master/maps/LavRadioTower1F.asm#L25). ## `$3B`: blackoutmod map -Used in map scripts to change the destination the player will be warped to after blacking out. Refers to [data/maps/spawn_points.asm](https://github.com/pret/pokecrystal/blob/master/data/maps/spawn_points.asm). +Used to change the destination the player will be warped to after blacking out. Refers to [data/maps/spawn_points.asm](https://github.com/pret/pokecrystal/blob/master/data/maps/spawn_points.asm). -The point of this command is to avoid some story "desyncs". For example, a `blackoutmod` command set to Cherrygrove City is defined in the script for meeting Prof. Oak at [Mr Pokémon's house](https://github.com/pret/pokecrystal/blob/master/maps/MrPokemonsHouse.asm#L37). If it weren't there, and the player hadn't visited Cherrygrove's Pokémon Center, then blacking out on Route 30 would warp them back to New Bark Town, thus skipping the first rival battle. +The point of this command is to avoid some story "desyncs". For example, a `blackoutmod` command set to Cherrygrove City is defined when meeting Prof. Oak at [Mr Pokémon's house](https://github.com/pret/pokecrystal/blob/master/maps/MrPokemonsHouse.asm#L37). If it weren't there, and the player hadn't visited Cherrygrove's Pokémon Center, then blacking out on Route 30 would warp them back to New Bark Town, thus skipping the first rival battle. ## `$3C`: warp map, x, y @@ -280,7 +280,7 @@ Also note that the player will always be warped facing down. If one wishes to wa GetStringBuffer(string_buffer) = PrintNum(GetMoneyAccount(account)) -Used by [engine/phone/scripts/mom.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/mom.asm) to display the correct amount of money when calling mom to know how much money has been saved. +Used by [engine/phone/scripts/mom.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/mom.asm) to display the correct amount of money when calling mom, to know how much money has been saved. ## `$3E`: getcoins string_buffer @@ -294,7 +294,7 @@ Unused in regular gameplay. Identical to `getmoney`, only with the Game Corner c GetStringBuffer(string_buffer) = PrintNum([wScriptVar]) -Used in a script to display a given value in a dialogue box. See [maps/Route35NationalParkGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35NationalParkGate.asm#L54) as an example. +Used to display a given value in a dialogue box. See [maps/Route35NationalParkGate.asm](https://github.com/pret/pokecrystal/blob/master/maps/Route35NationalParkGate.asm#L54) as an example. ## `$40`: getmonname string_buffer, mon_id @@ -302,7 +302,7 @@ Used in a script to display a given value in a dialogue box. See [maps/Route35Na If mon_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. -Used in a script to display a given Pokémon name in a dialogue box. See [maps/ElmsLab.asm](https://github.com/pret/pokecrystal/blob/master/maps/ElmsLab.asm#L177) as an example. +Used to display a given Pokémon name in a dialogue box. See [maps/ElmsLab.asm](https://github.com/pret/pokecrystal/blob/master/maps/ElmsLab.asm#L177) as an example. ## `$41`: getitemname string_buffer, item_id @@ -311,32 +311,32 @@ Used in a script to display a given Pokémon name in a dialogue box. See [maps/E If item_id = `USE_SCRIPT_VAR`, then it uses `[wScriptVar]` instead. -Used in a script to display a given item name in a dialogue box. See [maps/CeladonCafe.asm](https://github.com/pret/pokecrystal/blob/master/maps/CeladonCafe.asm#L91) as an example. +Used to display a given item name in a dialogue box. See [maps/CeladonCafe.asm](https://github.com/pret/pokecrystal/blob/master/maps/CeladonCafe.asm#L91) as an example. ## `$42`: getcurlandmarkname string_buffer GetStringBuffer(string_buffer) = GetLandmarkName(GetWorldMapLocation()) -Used in a script to display the current location name in a dialogue box. Used by both [engine/phone/scripts/mom.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/mom.asm#L12) and [engine/events/std_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/std_scripts.asm#L1757). +Used to display the current location name in a dialogue box. Used by both [engine/phone/scripts/mom.asm](https://github.com/pret/pokecrystal/blob/master/engine/phone/scripts/mom.asm#L12) and [engine/events/std_scripts.asm](https://github.com/pret/pokecrystal/blob/master/engine/events/std_scripts.asm#L1757). ## `$43`: gettrainername string_buffer, trainer_group, trainer_id GetStringBuffer(string_buffer) = GetTrainerName(trainer_group, trainer_id) -Used in a script to display a given trainer name in a dialogue box. See [maps/VioletGym.asm](https://github.com/pret/pokecrystal/blob/master/maps/VioletGym.asm#L105) as an example. +Used to display a given trainer name in a dialogue box. See [maps/VioletGym.asm](https://github.com/pret/pokecrystal/blob/master/maps/VioletGym.asm#L105) as an example. ## `$44`: getstring string_buffer, text_pointer GetStringBuffer(string_buffer) = CopyName1([wScriptBank], text_pointer) -Used in a script to display a given string in a dialogue box. See [maps/LavRadioTower1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/LavRadioTower1F.asm#L34) as an example. +Used to display a given string in a dialogue box. See [maps/LavRadioTower1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/LavRadioTower1F.asm#L34) as an example. ## `$45`: `itemnotify` -Used in map scripts alongside a `giveitem` command. Prints the " put the in the ." message. See [maps/DragonsDenB1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/DragonsDenB1F.asm#L57) as an example. +Used alongside a `giveitem` command. Prints the " put the in the ." message. See [maps/DragonsDenB1F.asm](https://github.com/pret/pokecrystal/blob/master/maps/DragonsDenB1F.asm#L57) as an example. ## `$46`: `pocketisfull` @@ -344,15 +344,15 @@ Seldom called by `GiveItemScript`, in [engine/overworld/scripting.asm](https://g ## `$47`: `opentext` -Used in map scripts before a `writetext` command, to open a dialogue box. +Used before a `writetext` command, to open a dialogue box. ## `$48`: reanchormap [dummy=0] -Used in a script to trigger a complete screen refresh. +Used to trigger a complete screen refresh. ## `$49`: `closetext` -Used in map scripts after either a `waitbutton` or `promptbutton` command, to close a dialogue box. +Used after either a `waitbutton` or `promptbutton` command, to close a dialogue box. ## `$4A`: writeUnusedbyte byte @@ -367,7 +367,7 @@ Used in engine scripts, combines both `farcall` and `writetext`. ## `$4C`: writetext text_pointer -Used in map scripts after an `opentext` command, to load a given text pointer. +Used after an `opentext` command, to load a given text pointer. ## `$4D`: repeattext byte1, byte2 @@ -375,11 +375,11 @@ Seldom called by `JumpTextFacePlayerScript`, in [engine/overworld/scripting.asm] ## `$4E`: `yesorno` -Used in map scripts to load a "yes or no" prompt. To be used in conjunction with an `iftrue` or `iffalse` check, for either "yes" or "no" respectively. +Used to load a "yes or no" prompt. To be used in conjunction with an `iftrue` or `iffalse` check, for either "yes" or "no" respectively. ## `$4F`: loadmenu menu_header -Used in map scripts to load menu data. See [maps/DragonShrine.asm](https://github.com/pret/pokecrystal/blob/master/maps/DragonShrine.asm#L21) as an example. +Used to load menu data. See [maps/DragonShrine.asm](https://github.com/pret/pokecrystal/blob/master/maps/DragonShrine.asm#L21) as an example. ## `$50`: `closewindow` @@ -399,11 +399,11 @@ Identical to `jumptextfaceplayer`, aside from lacking the `faceplayer` aspect. M ## `$54`: `waitbutton` -Used in map scripts after a `writetext` command. This will leave the dialogue box on-screen after its message is displayed, with the player needing to press either **A** or **B** to close it. +Used after a `writetext` command. This will leave the dialogue box on-screen after its message is displayed, with the player needing to press either **A** or **B** to close it. ## `$55`: `promptbutton` -Used in map scripts after a `writetext` command. Behaves identically to `waitbutton`, only differing in that here a down-facing arrow will flicker in the bottom-right corner of the dialogue box. This command is meant to be used in case one needs to load two or more sets of dialogue one after another, since using `waitbutton` would not play the "next dialogue box" sound. +Used after a `writetext` command. Behaves identically to `waitbutton`, only differing in that here a down-facing arrow will flicker in the bottom-right corner of the dialogue box. This command is meant to be used in case one needs to load two or more sets of dialogue one after another, since using `waitbutton` would not play the "next dialogue box" sound. ## `$56`: pokepic mon_id @@ -411,7 +411,7 @@ Makes a given Pokémon's front sprite pop-up in a small window in the center of ## `$57`: `closepokepic` -Used in a script to close a `pokepic`. +Used to close a `pokepic`. ## `$58`: `_2dmenu` @@ -427,7 +427,7 @@ Unused in regular gameplay. All this command does is load the data for a level 5 ## `$5B`: `randomwildmon` -Used in engine scripts as part of the Sweet Scent, But Catching Contest, and wild Pokémon encounters. +Used as part of the Sweet Scent, But Catching Contest, and wild encounter engine scripts. ## `$5C`: `loadtemptrainer` @@ -438,19 +438,19 @@ Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokec ## `$5D`: loadwildmon mon_id, level -Used in map scripts to load a battle against a specific Pokémon species at a given level. See [maps/UnionCaveB2F.asm](https://github.com/pret/pokecrystal/blob/master/maps/UnionCaveB2F.asm#L28) as an example. +Used to load a battle against a specific Pokémon species at a given level. See [maps/UnionCaveB2F.asm](https://github.com/pret/pokecrystal/blob/master/maps/UnionCaveB2F.asm#L28) as an example. ## `$5E`: loadtrainer trainer_group, trainer_id -Used in map scripts to load a battle against a specific trainer class and a given party id. +Used to load a battle against a specific trainer class and a given party id. ## `$5F`: `startbattle` -Used in map scripts directly following either a `loadwildmon` or a `loadtrainer`. +Used directly following either a `loadwildmon` or a `loadtrainer`. ## `$60`: `reloadmapafterbattle` -Used in map scripts following a `startbattle`. Reloads the map after the battle is over. +Used following a `startbattle`. Reloads the map after the battle is over. ## `$61`: catchtutorial byte @@ -474,7 +474,7 @@ Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokec ## `$66`: `endifjustbattled` -Used in map scripts as part of the trainer encounter setup. This command will make it so the "after battle" dialogue doesn't automatically play once the battle ends and the player is returned to the overworld. +Used as part of the trainer encounter setup. This command will make it so the "after battle" dialogue doesn't automatically play once the battle ends and the player is returned to the overworld. ## `$67`: `checkjustbattled` @@ -482,35 +482,35 @@ Unused in regular gameplay. Used to check if a given trainer has just been battl ## `$68`: setlasttalked object_id -Used in map scripts to set a character as the one last talked to. +Used to set a character as the one last talked to. ## `$69`: applymovement object_id, data_pointer -Used in map scripts to assign either the player or a given object a movement script. +Used to assign either the player or a given object a movement script. ## `$6A`: applymovementlasttalked data_pointer -Used in map scripts to assign a movement script to the last talked character. +Used to assign a movement script to the last talked character. ## `$6B`: `faceplayer` -Used in map scripts to make a given character face the player. +Used to make a given character face the player. ## `$6C`: faceobject object1, object2 -Used in map scripts to make a character face another given character. +Used to make a character face another given character. ## `$6D`: variablesprite variable_sprite_id, sprite_id -Used in map scripts to change the appearance of a variable sprite. A writeup on variable sprites can be found [here](https://github.com/pret/pokecrystal/wiki/Add-a-new-overworld-sprite). +Used to change the appearance of a variable sprite. A writeup on variable sprites can be found [here](https://github.com/pret/pokecrystal/wiki/Add-a-new-overworld-sprite). ## `$6E`: disappear object_id -Used in map scripts to hide an object. +Used to hide an object. ## `$6F`: appear object_id -Used in map scripts to make a hidden object visible. +Used to make a hidden object visible. ## `$70`: follow object2, object1 @@ -522,7 +522,7 @@ Used to terminates a `follow` command. ## `$72`: moveobject object_id, x, y -Used in map scripts to move an object to a new location on the same map. Note that this only works if said object is not visible (see `disappear`). +Used to move an object to a new location on the same map. Note that this only works if said object is not visible (see `disappear`). ## `$73`: writeobjectxy object_id @@ -538,7 +538,7 @@ Used to display an emote in map scripts, alongside which object it will appear a ## `$76`: turnobject object_id, facing -Used in map scripts to turn an object in a given cardinal direction. +Used to turn an object in a given cardinal direction. ## `$77`: follownotexact object2, object1 @@ -577,7 +577,7 @@ Unused in regular gameplay. Deletes a given command queue from ram. ## `$7F`: playmusic music_id -Used to call a given music track in a script. +Used to call a given music track. ## `$80`: `encountermusic` @@ -621,7 +621,7 @@ Unused in regular gameplay. Calls `StartAutoInput`, which lets the game play a s ## `$8A`: newloadmap which_method -Used in scripts to call a new `MAPSETUP` type. Refers to [constants/map_setup_constants.asm](https://github.com/pret/pokecrystal/blob/master/constants/map_setup_constants.asm). +Used to call a new `MAPSETUP` type. Refers to [constants/map_setup_constants.asm](https://github.com/pret/pokecrystal/blob/master/constants/map_setup_constants.asm). ## `$8B`: pause length @@ -636,7 +636,7 @@ Seldom used in `ChangeDirectionScript`. Used in a map scene to run a script. ## `$8E`: `warpcheck` -Used in map scripts. If the player is under a movement script, and enters a warp (like a door), this command will trigger it and warp the player to the new map. +If the player is under a movement script, and enters a warp (like a door), this command will trigger it and warp the player to the new map. ## `$8F`: stopandsjump script @@ -683,8 +683,8 @@ Also note that this command is improperly implemented, and may crash the game wh Here is an example of a script using this command: ``` WrongPhoneNumberScript: - phonecall UnknownCallName opentext + phonecall UnknownCallName writetext UnknownCallerText waitbutton hangup @@ -777,4 +777,4 @@ Seldom used in Goldenrod and Saffron's train station scripts. This command is us ## `$A9`: `checksave` -Unused in regular gameplay. May be used in conjunction with an `iftrue` or an `iffalse` check to see if the player has or hasn't saved their game. +Unused in regular gameplay. May be used in conjunction with an `iftrue` or an `iffalse` check to see if the player has saved their game or not. From ee52481f08b80d26430d87f628677afb7c2eaf29 Mon Sep 17 00:00:00 2001 From: FrenchOrange <64930003+FrenchOrange@users.noreply.github.com> Date: Thu, 21 Nov 2024 02:15:26 +0100 Subject: [PATCH 4/5] Missing lineskips --- docs/event_commands.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/event_commands.md b/docs/event_commands.md index e6fc5f54e01..4a135aae4a7 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -264,6 +264,7 @@ Unused in regular gameplay. This command compares the player's current X and Y c ## `$3A`: warpmod warp_id, map Unused in regular gameplay. Used in map callbacks to change the destination of a warp set to `-1`. Here's an example of `warpmod` from [Polished Crystal](https://github.com/Rangi42/polishedcrystal/blob/master/maps/LavRadioTower1F.asm#L25). + ## `$3B`: blackoutmod map Used to change the destination the player will be warped to after blacking out. Refers to [data/maps/spawn_points.asm](https://github.com/pret/pokecrystal/blob/master/data/maps/spawn_points.asm). @@ -355,7 +356,7 @@ Used to trigger a complete screen refresh. Used after either a `waitbutton` or `promptbutton` command, to close a dialogue box. -## `$4A`: writeUnusedbyte byte +## `$4A`: writeunusedbyte byte [wUnusedScriptByte] = byte @@ -635,6 +636,7 @@ Seldom used in `ChangeDirectionScript`. ## `$8D`: sdefer script Used in a map scene to run a script. + ## `$8E`: `warpcheck` If the player is under a movement script, and enters a warp (like a door), this command will trigger it and warp the player to the new map. From 6a8c89ff92741a7d137e42ca2c8ea7bbdf224a55 Mon Sep 17 00:00:00 2001 From: FrenchOrange <64930003+FrenchOrange@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:05:08 +0100 Subject: [PATCH 5/5] 'winlosstext' Feedback --- docs/event_commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/event_commands.md b/docs/event_commands.md index 4a135aae4a7..c68fe11bcdc 100644 --- a/docs/event_commands.md +++ b/docs/event_commands.md @@ -467,7 +467,7 @@ Seldom used in [engine/events/trainer_scripts.asm](https://github.com/pret/pokec ## `$64`: winlosstext win_text_pointer, loss_text_pointer -Used in trainer battle scripts to print a given string when the player either wins or loses. Note that only the rival fight in Cherrygrove can be lost without skipping straight to the blackout message. The latter issue can be corrected with the [following fix](https://github.com/pret/pokecrystal/wiki/Print-text-when-you-lose-a-trainer-battle). +Used in trainer battle scripts to print a given string when the player either wins or loses. Note that this command needs to be used in conjunction with `BATTLETYPE_CANLOSE`, otherwise the game will skip straight to the blackout message. See [CherrygroveCity.asm](https://github.com/pret/pokecrystal/blob/master/maps/CherrygroveCity.asm#L122) as an example. ## `$65`: `scripttalkafter`