diff --git a/Supplementary-Scripting-Macros.md b/Supplementary-Scripting-Macros.md index 15b2e4b..3c839e3 100644 --- a/Supplementary-Scripting-Macros.md +++ b/Supplementary-Scripting-Macros.md @@ -1,14 +1,50 @@ This page will detail helpful or time-saving extensions to the existing scripting macros. These should be placed with the other supplementary macros at the end of `asm/macros/event.inc`. **Table of Contents:** +- [applymove](#applymove) - [applymoveplayer](#applymoveplayer) -- [turnplayer](#turnplayer) - [stepinplace](#stepinplace) - [stepinplaceplayer](#stepinplaceplayer) -- [applymove](#applymove) +- [turnplayer](#turnplayer) - [moncryscript](#moncryscript) - [emote](#emote) +## applymove +Credits to Deokishisu. + +The scripting macro, with commented description: +```c + @ applymovement with waitmovement built-in. + @ If wait is not provided, waitmovement 0 is emitted. + @ If wait has a value, the emitted waitmovement will have that value. + @ i.e. if wait is 7, waitmovement 7 will be emitted. + @ If you don't want a waitmovement emitted, use applymovement instead. + .macro applymove localid:req, movements:req, wait, map + applymovement \localid, \movements, \map + .ifb \wait + waitmovement 0 + .else + waitmovement \wait + .endif + .endm +``` +This is `applymovement` but with `waitmovement` built-in. `applymove` is also shorter to type. If `wait` is not supplied, `waitmovement 0` is emitted. Contrary to the next commands, a supplied `wait` becomes the parameter for `waitmovement`. If you don't want to use a `waitmovement`, use the regular `applymovement` macro instead. + +Example usages: +```c + applymove 4, Common_Movement_Delay48 + @ separated for clarity + applymove 6, Common_Movement_Delay32, 10 +``` +This will emit: +```c + applymovement 4, Common_Movement_Delay48 + waitmovement 0 + @ separated for clarity + applymovement 6, Common_Movement_Delay32 + waitmovement 10 +``` + ## applymoveplayer Credits to Deokishisu. @@ -25,7 +61,7 @@ The scripting macro, with commented description: .endif .endm ``` -This is an `applymovement` command specifically for the player. This prevents having to type `OBJ_EVENT_ID_PLAYER`. It also has `waitmovement 0` built-in by default if the `wait` argument is not provided. If you don't want `waitmovement 0` to be emitted, provide any argument for `wait`. +This is the aforementioned `applymove` specifically for the player. This prevents having to type `OBJ_EVENT_ID_PLAYER`. If `wait` is not supplied, `waitmovement 0` is emitted. *Unlike* `applymove`, if `wait` *is* supplied, no `waitmovement` command is emitted. Example usages: ```c @@ -41,27 +77,6 @@ This will emit: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterLeft ``` -## turnplayer -Credits to Deokishisu. - -The scripting macro, with commented description: -```c - @ alias of turnobject with OBJ_EVENT_ID_PLAYER as the localid argument - .macro turnplayer direction:req - turnobject OBJ_EVENT_ID_PLAYER, \direction - .endm -``` -This is a `turnobject` command specifically for the player. This prevents having to type `OBJ_EVENT_ID_PLAYER`. - -Example usage: -```c - turnplayer DIR_NORTH -``` -This will emit: -```c - turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH -``` - ## stepinplace Credits to Deokishisu. @@ -152,40 +167,25 @@ This will emit: applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp ``` -## applymove +## turnplayer Credits to Deokishisu. The scripting macro, with commented description: ```c - @ applymovement with waitmovement built-in. - @ If wait is not provided, waitmovement 0 is emitted. - @ If wait has a value, the emitted waitmovement will have that value. - @ i.e. if wait is 7, waitmovement 7 will be emitted. - @ If you don't want a waitmovement emitted, use applymovement instead. - .macro applymove localid:req, movements:req, wait, map - applymovement \localid, \movements, \map - .ifb \wait - waitmovement 0 - .else - waitmovement \wait - .endif + @ alias of turnobject with OBJ_EVENT_ID_PLAYER as the localid argument + .macro turnplayer direction:req + turnobject OBJ_EVENT_ID_PLAYER, \direction .endm ``` -This is `applymovement` but with `waitmovement` built-in. `applymove` is also shorter to type. If `wait` is not supplied, `waitmovement 0` is emitted. Contrary to the previous commands, a supplied `wait` becomes the parameter for `waitmovement`. If you don't want to use a `waitmovement`, use the regular `applymovement` macro instead. +This is a `turnobject` command specifically for the player. This prevents having to type `OBJ_EVENT_ID_PLAYER`. -Example usages: +Example usage: ```c - applymove 4, Common_Movement_Delay48 - @ separated for clarity - applymove 6, Common_Movement_Delay32, 10 + turnplayer DIR_NORTH ``` This will emit: -```c - applymovement 4, Common_Movement_Delay48 - waitmovement 0 - @ separated for clarity - applymovement 6, Common_Movement_Delay32 - waitmovement 10 +```c + turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH ``` ## moncryscript