Difference between revisions of "03EE"
m |
m |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | {{Icon| | + | {{OpCode |
− | + | | games = {{Icon|t}} | |
− | + | | command = CAN_PLAYER_START_MISSION | |
− | + | | description = Checks if the player is controllable | |
− | + | | syntax1 = 03EE: player [''player handle''] controllable | |
− | + | | p1t = [''player handle''] | |
− | + | | p1d = The [[0053|handle of the player]] | |
− | + | | native = [[CAN_PLAYER_START_MISSION]] | |
− | + | }} | |
− | This opcode returns true if the player is controllable. The player is controllable if the animation sequences of the player character can be controlled through input keys. Animation sequences that do not allow direct control of the player character ( | + | This conditional opcode returns true if the player is controllable. The player is controllable if the animation sequences of the player character can be controlled through input keys. Animation sequences that do not allow direct control of the player character (e.g. falling through the air, entering a vehicle, ejecting from a vehicle, death) are considered not controllable and the opcode would return false. Opcodes that freeze control of the character (e.g. [[01B4]]) do not apply. If controls are frozen but the animation would otherwise permit direct control of the character, the opcode will still return true. |
== Example == | == Example == | ||
The following example, using Sanny Builder, will allow you to see when the opcode returns true or false. | The following example, using Sanny Builder, will allow you to see when the opcode returns true or false. | ||
− | < | + | {{Pre|class=sb-code|1= |
− | while true | + | <span class="k">while</span> <span class="k">true</span> |
− | wait 10 | + | <span class="k">wait</span> <span class="m">10</span> |
− | if | + | <span class="k">if</span> |
− | 03EE: player $PLAYER_CHAR controllable | + | 03EE: player <span class="nv">$PLAYER_CHAR</span> controllable |
− | then | + | <span class="k">then</span> |
− | 01E5: text_1number_highpriority 'NUMBER' 1 10 ms 1 // display 1 (true) | + | 01E5: text_1number_highpriority <span class="s1">'NUMBER'</span> <span class="m">1</span> <span class="m">10</span> ms <span class="m">1</span> <span class="c1">// display 1 (true)</span> |
− | else | + | <span class="k">else</span> |
− | 01E5: text_1number_highpriority 'NUMBER' 0 10 ms 1 // display 0 (false) | + | 01E5: text_1number_highpriority <span class="s1">'NUMBER'</span> <span class="m">0</span> <span class="m">10</span> ms <span class="m">1</span> <span class="c1">// display 0 (false)</span> |
− | end | + | <span class="k">end</span> |
− | end | + | <span class="k">end</span> |
− | </ | + | }} |
== Keywords == | == Keywords == | ||
− | check, player, control, controllable | + | check, player, control, controllable, can, start, mission |
− | |||
− |
Latest revision as of 23:24, 4 December 2016
- Description
- Checks if the player is controllable
- Syntax
- 03EE: player [player handle] controllable
- Parameter
- [player handle]
- The handle of the player
- Native analog
- CAN_PLAYER_START_MISSION
This conditional opcode returns true if the player is controllable. The player is controllable if the animation sequences of the player character can be controlled through input keys. Animation sequences that do not allow direct control of the player character (e.g. falling through the air, entering a vehicle, ejecting from a vehicle, death) are considered not controllable and the opcode would return false. Opcodes that freeze control of the character (e.g. 01B4) do not apply. If controls are frozen but the animation would otherwise permit direct control of the character, the opcode will still return true.
Example
The following example, using Sanny Builder, will allow you to see when the opcode returns true or false.
while true wait 10 if 03EE: player $PLAYER_CHAR controllable then 01E5: text_1number_highpriority 'NUMBER' 1 10 ms 1 // display 1 (true) else 01E5: text_1number_highpriority 'NUMBER' 0 10 ms 1 // display 0 (false) end end
Keywords
check, player, control, controllable, can, start, mission