Engine02 Script Commands - General
Index:
Video:
| 1258 | (D) (E) | Func_Set_ScreenMode |
Input:
| 1395 | (D) (E) | Func_Pack_Keys |
| 1396 | (D) (E) | Func_Force_Keys |
Pause:
| 1397 | (D) (E) | Func_PauseGame_Func |
| 1398 | (D) (E) | Func_PauseGame_StatObj |
Descriptions:
Music:
37 - Func_Set_ScreenMode
(ALL) (REG) (Example)
Sets the Screen Mode, and automatically updates the "Screen_Mode" Register.
This Command is required for a proper mode change; updating the Register manually will have undesirable effects.
Parameters:
- Mode
The desired Screen Mode. Valid values are:
0- Normal mode (default)
2- Split-Screen Mode
The "R" or "r" tags may be used to obtain value from a Register.
Input:
1395 - Func_Pack_Keys
(ALL) (Example)
Obtains the "Held" keystates of the specified Key Map, and stores them as a bitfield in the given Register.
A variable may only contain 32 flags, so if a Key Map is greater in size than 32 keys, only keys 0-31 will be retrieved.
Key states are stored in from least-significant-bit to most-significant bit; Bit 0 represents Key Map entry 0,Bit 1 represents entry 1, etc.
This Command can be used in conjunction with Func_Force_Keys to clone keypresses, or to play back a keylog.
Parameters:
- Map
The Key Map whose states should be obtained.
The "R" or "r" tags may be used to obtain value from a Register, including the "Curr_Player" for obtaining the key states of the Map corresponding with the "Current Player".
- Var ID
The ID number of the Register that should recieve the keystates bitfield.
The "U" tag may be used
to specify a user-defined Register. Otherwise, the ID will refer to a Game Register
1396 - Func_Force_Keys
(ALL) (Example)
Uses the bitfield stored in the given Register to manually set the "Held" keystates of the given Key Map.
A variable may only contain 32 flags, so if a Key Map is greater in size than 32 keys, only keys 0-31 can be manipulated.
Key states are stored in from least-significant-bit to most-significant bit; Bit 0 represents Key Map entry 0,Bit 1 represents entry 1, etc.
This Command can be used in conjunction with Func_Pack_Keys to clone keypresses or to play back a keylog, or by itself to script keypresses for "puppet scenes", AI, etc.
Parameters:
- Map
The Key Map whose states should be set.
The "R" or "r" tags may be used to obtain value from a Register, including the "Curr_Player" for obtaining the key states of the Map corresponding with the "Current Player".
- Var ID State
The ID number of the Register that contains the bitfield whose settings should be applied to the given Key Map. The "U" tag may be used
to specify a user-defined Register. Otherwise, the ID will refer to a Game Register
- Var ID Mask
The ID number of a Register that should be used to maintain a backup of the passed bitfields so that successive use of this
Command will generate proper "Tapped" keystates.
The "U" tag may be used
to specify a user-defined Register. Otherwise, the ID will refer to a Game Register
Pause:
1397 - Func_PauseGame_Func
1398 - Func_PauseGame_StatObj
(ALL) (Example)
Manually setting the "GamePaused" Register suspends all
Objects and Functions, which would leave the program in an inescapable pause.
These Commands assign either a Game Function or a Status Object to run
during the "pause" so that the user can be provided with a way to disable the pause (by having "GamePaused" set back
to 0), and so that the game can still perform certain actions, such as providing a "pause menu" and/or controls such as frame-stepping.
Parameters:
- Func/Script ID
In the case of Game Functions, this is the ID of the "Game Def" or "Zone Def" Function to run during the "pause". The
"G" and "Z" tags can be used to reference Functions loaded as Game-global or "Zone"-specific, respectively.
In the case of Status Object, this is the ID of the Status Script to spawn and run during the "pause". The
"G", "Z", and "A" tags can be used to reference Status Scripts loaded as Game-global, "Zone"-specific, or "Act"-specific, respectively.
Examples:
#1258 ;Set ScreenMode (Set the Screen Mode to Mode 0, Single-screen)
: 0 ;Single-screen Mode
; ----------
#1258 ;Set ScreenMode (Set the Screen Mode to Mode 2, Split-screen)
: 2 ;Split-screen Mode
; ----------
#1258 ;Set ScreenMode (Set the Screen Mode to the value stored in "User Register" 4)
: R4 ;Value stored in "User Register" 4
Input:
#1395 ;Pack Keys (Get the "Held" keystates for the Key Map associated with the "Current Player", and store them in "User Register" 7)
: r9 ;(Map) Key Map ID stored in "Game Register" 9 (Curr_Player)
: U7 ;(Dest) "User Register" 7
; ----------
#1395 ;Pack Keys (Get the "Held" keystates for Key Map 3, and store them in "User Register" 5)
: 3 ;(Map) Key Map 3
: U5 ;(Dest) "User Register" 5
1396 - Func_Force_Keys
(Description)
#1396 ;Force Keys (Set the "Held" keystates for Key Map 1 [also associated with Player 2] according to the bitfield stored in "User Register" 7, using the backup keystate mask stored in "User Register" 8 to generate appropriately-corresponding "Tapped" states)
: 1 ;(Map) P2 Map
: U7 ;(State) "User Register" 7
: U8 ;(Mask) "User Register" 8
; ----------
#1396 ;Force Keys (Set the "Held" keystates for the Key Map associated with the "Current Player" according to the bitfield stored in "User Register" 5, using the backup keystate mask stored in "User Register" 6 to generate appropriately-corresponding "Tapped" states)
: r9 ;(Map) Key Map ID stored in "Game Register" 9 (Curr_Player)
: U5 ;(State) "User Register" 5
: U6 ;(Mask) "User Register" 6
Pause:
#1397 ;PauseGame Function(Pause the game, and call Game-global Function 10 to run during the pause)
: G10 ;Game-global Function 10
; ----------
#1398 ;PauseGame StatObj (Pause the game, and spawn Game-global Status Object 4 to run during the pause)
: G4 ;Game-global Status Object 4