DO/CTL/OpCodes
From Dark Omen Wiki
Op | Mnemonic | Parameter | Explanation |
---|---|---|---|
00 | init_unit
| - | At the start of every regiment script. |
01 | wait_for_deploy
| - | Pause script until deployment is finished |
02 | reset_call_stack
| - | ? |
03 | restoreip
| - | Jumps to last saveip-call |
04 | saveip
| - | Saves Instruction Pointer |
05 | do
| - | |
06 | always
| - | Jump to last do statement |
07 | while
| - | Jump to do if previous statement is true |
08 | whilenot
| - | Jump to do if previous statement is false |
09 | for
| - | |
0A | next
| - | |
0B | goto
| func_id | Jump to func_id |
0C | branch1
| func_id | Used in eventhandler, Jump to func_id |
0D | branch2
| func_id | Used in eventhandler, Jump to func_id |
0E | branch3
| func_id | Used in eventhandler, Jump to func_id |
0F | branch4
| func_id | Used in eventhandler, Jump to func_id |
10 | branch5
| func_id | Used in eventhandler, Jump to func_id |
11 | call
| func_id | Jump to func_id (return pos saved) |
12 | return
| - | Continue from last call statement |
13 | return_from_event_handler
| - | Continue from last event call? |
15 | call_event_handler
| - | Executes all associated event handlers |
16 | if_true_do_events
| - | Call event handler if last statement was true |
17 | if_true_skip
| value | Skip value number of opcodes followed by this command |
18 | set_wait_time
| time | set wait-time of wait to time |
19 | test_waiting
| - | true if still waiting for timer |
1A | wait
| - | Same as sleep but time can be set |
1B | set_x_i
| value | ? |
1C | add_x_i
| value | ? |
1D | test_x_eq_0
| - | true if value == 0 |
1E | set_unit_r_i
| register, value | Set register to value |
1F | add_unit_r_i
| register, value | reg_value = reg_value + value |
20 | test_unit_r_eq_i
| register, value | true if register == value |
21 | test_unit_r_eq_r
| register1, register2 | true if register1 == register2 |
22 | set_unit_r_random1to10
| register | loads a value from 1-10 in a register The value changes every ~2seconds |
28 | move_to_node
| node_id | Unit moves to node with id node_id |
29 | retreat_to_node
| node_id | Caller tries to reach node_id when retreating. If it's near the boundaries the unit will escape. |
34 | clear_unit_flag
| flag | Remove Flag of caller |
35 | set_unit_flag
| flag | Set flag of caller |
36 | wait_for_unit_flag
| flag | Wait until flag of caller is set |
38 | test_unit_flag
| flag | true if flag of caller is set |
39 | set_ctrl_flag
| flag | Set flag of CTL-Engine |
3A | clear_ctrl_flag
| flag | Clear flag of CTL-Engine |
3B | test_ctrl_flag
| flag | true if CTL-Engine-Flag flag is set |
3D | set_event_handler
| func | Registers func as an event handler |
3F | set_threadid
| thread_id | Sets thread_id of a unit to thread_id |
41 | test_threadid_alive
| thread_id | true if unit with thread_id is alive |
52 | move_rand_in_radius
| waypoint_id (<11>) | Move to a random position in the radius of the waypoint Used for Peasants |
5C | retreat
| - | Caller retreats (yellow arrow) but without(!) white flag |
69 | raise_event1
| event_id | executes event of caller |
6b | raise_event2
| event_id | executes event of caller |
6d | raise_event3
| event_id | executes event of caller |
6e | raise_event4
| event_id | executes event of caller |
70 | raise_event5
| event_id | executes event of caller |
72 | get_event
| - | Get the next event from the unit's event queue |
73 | test_more_events
| - | True if there are more events in the unit's event queue |
74 | on_event
| event_id | If the current event matches event_id then continue, otherwise skip this event handler. |
75 | end_event
| value | leave the event-statement. Value is 0x1abc to skip to the next 0xabc label, or 0xdef to fall through to next event handler. |
76 | iftrue
| - | |
77 | iffalse
| - | |
78 | else
| - | |
79 | endif
| - | |
97 | teleport_to
| node_id | Caller teleports to node_id |
AC | check_unit_info
| unk, unk, unk | ??? |
AE | play
| voice_id | display portrait of caller and say text voice_id |
AF | play_other_unit
| unit_id, voice_id | display portrait of unit_id and say text voice_id |
B2 | test_unit_afraid
| - | true if unit has fear |
B3 | test_unit_at_node
| node_id | true if unit reached node_id |
B6 | raise_event_in_thread
| thread_id, event | Calls event in unit with thread_id |
B8 | test_event_caused_by_enemy
| - | true if event was caused by an enemy |
BA | test_unit_class
| unit_class | true if unit has unit type unit_class (ignores first 3 bits) |
C1 | test_threadid
| thread_id | true if unit with thread_id is on the map (= deployed) and alive |
D8 | test_unit_alive
| unit_id | true if unit_id is still alive? |
D9 | test_user_action
| ? | |
DA | ui_effect
| x, y, size | display 4 arrows that are placed around a rectangle If x and y are -1, size is the unit_id |
DE | test_other_unit_at_node
| node_id | True if unit_id reached node |
DF | test_other_unit_attacking
| unit_id | True if unit_id is fighting |
E0 | test_other_unit_flags
| unit_id, flag | true if flag of unit_id is set |
E2 | test_unit_selected
| unit_id | true if unit with unit_id is selected |
E6 | test_mapmode
| - | true if worldmap (spacebar) is displayed |
E6 | test_other_unit_status
| unit_id | true if ? |
EA | test_sound_playing
| - | true if last "play" is still playing |
EE | test_other_unit_dead
| unit_id | true if unit_id is dead |
ED | fail_mission
| - | Display "End Mission" message |
likely and tested
Highly likely but not tested
Guess and/or untested
|
Note: node_id can be calculated by counting the subsections (starting from 0)