mirror of https://github.com/pret/pokeemerald.git
Reordered macros to make more sense.
parent
83d37f85b2
commit
0a6dfe9730
|
@ -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`.
|
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:**
|
**Table of Contents:**
|
||||||
|
- [applymove](#applymove)
|
||||||
- [applymoveplayer](#applymoveplayer)
|
- [applymoveplayer](#applymoveplayer)
|
||||||
- [turnplayer](#turnplayer)
|
|
||||||
- [stepinplace](#stepinplace)
|
- [stepinplace](#stepinplace)
|
||||||
- [stepinplaceplayer](#stepinplaceplayer)
|
- [stepinplaceplayer](#stepinplaceplayer)
|
||||||
- [applymove](#applymove)
|
- [turnplayer](#turnplayer)
|
||||||
- [moncryscript](#moncryscript)
|
- [moncryscript](#moncryscript)
|
||||||
- [emote](#emote)
|
- [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
|
## applymoveplayer
|
||||||
Credits to Deokishisu.
|
Credits to Deokishisu.
|
||||||
|
|
||||||
|
@ -25,7 +61,7 @@ The scripting macro, with commented description:
|
||||||
.endif
|
.endif
|
||||||
.endm
|
.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:
|
Example usages:
|
||||||
```c
|
```c
|
||||||
|
@ -41,27 +77,6 @@ This will emit:
|
||||||
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterLeft
|
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
|
## stepinplace
|
||||||
Credits to Deokishisu.
|
Credits to Deokishisu.
|
||||||
|
|
||||||
|
@ -152,40 +167,25 @@ This will emit:
|
||||||
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp
|
applymovement OBJ_EVENT_ID_PLAYER, Common_Movement_WalkInPlaceFasterUp
|
||||||
```
|
```
|
||||||
|
|
||||||
## applymove
|
## turnplayer
|
||||||
Credits to Deokishisu.
|
Credits to Deokishisu.
|
||||||
|
|
||||||
The scripting macro, with commented description:
|
The scripting macro, with commented description:
|
||||||
```c
|
```c
|
||||||
@ applymovement with waitmovement built-in.
|
@ alias of turnobject with OBJ_EVENT_ID_PLAYER as the localid argument
|
||||||
@ If wait is not provided, waitmovement 0 is emitted.
|
.macro turnplayer direction:req
|
||||||
@ If wait has a value, the emitted waitmovement will have that value.
|
turnobject OBJ_EVENT_ID_PLAYER, \direction
|
||||||
@ 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
|
.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
|
```c
|
||||||
applymove 4, Common_Movement_Delay48
|
turnplayer DIR_NORTH
|
||||||
@ separated for clarity
|
|
||||||
applymove 6, Common_Movement_Delay32, 10
|
|
||||||
```
|
```
|
||||||
This will emit:
|
This will emit:
|
||||||
```c
|
```c
|
||||||
applymovement 4, Common_Movement_Delay48
|
turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH
|
||||||
waitmovement 0
|
|
||||||
@ separated for clarity
|
|
||||||
applymovement 6, Common_Movement_Delay32
|
|
||||||
waitmovement 10
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## moncryscript
|
## moncryscript
|
||||||
|
|
Loading…
Reference in New Issue