157 | | === Opcodes |
158 | | |
159 | | ==== 00: Return |
160 | | |
161 | | "Return" or "End of line". If this is not present at the end of a line, the execution may continue with the next one? |
162 | | |
163 | | ==== 01 xx: CheckFlag |
164 | | |
165 | | Check if flag number xx is set. This is used for internal flags tracking the game state. |
166 | | |
167 | | ==== 03 xx: HasItem |
168 | | |
169 | | Check if the player is carrying item xx. |
170 | | |
171 | | ==== 09 xx yyyy: IfEqual |
172 | | |
173 | | Compare counter xx with value yyyy and continue executing the line if they are equal |
174 | | |
175 | | ==== 0A xx yyyy: IfLess |
176 | | |
177 | | Compare counter with value and continue if it is less than the value |
178 | | |
179 | | ==== 0D xx yy: Check event |
180 | | |
181 | | A lot of the conditions start with {{{0D}}}. This matches with an event from a button click. |
182 | | |
183 | | For example, if a room has a button number 1, {{{0D 01 00}}} will match that, and the corresponding action will be triggered. |
184 | | |
185 | | Every button click is matched with conditions in the current room as well as the ones in CONDGEN and/or CONDULTI. |
186 | | |
187 | | Actions involving objects use the second parameter, for example {{{0D 68 05}}} corresponds to action 68 done on object 05. |
188 | | |
189 | | ==== 0E xx: Check global event |
190 | | |
191 | | Check global events, for example event 00 is the start of the game. |
192 | | |
193 | | ==== 7E: Or |
194 | | |
195 | | Used to combine multiple conditions (0D, 09, 0A, ...) |
196 | | |
197 | | ==== 7F: And? |
198 | | |
199 | | Probably And, also used to combine several conditions. |
200 | | |
201 | | ==== 80 xx: ? |
202 | | |
203 | | Currently unknown |
204 | | |
205 | | ==== 81 xx: Set flag |
206 | | |
207 | | Set flag xx |
208 | | |
209 | | ==== 82 xx: Clear flag |
210 | | |
211 | | Clear flag xx |
212 | | |
213 | | ==== 83 xx: Get item |
214 | | |
215 | | Add item number x to the player's inventory |
216 | | |
217 | | ==== 85 xx: Remove item |
218 | | |
219 | | Remove item from the inventory. |
220 | | |
221 | | ==== 87 xx yyyy: Set counter |
222 | | |
223 | | Set counter xx to value yyyy |
224 | | |
225 | | ==== 89 xx yyyy: Add to counter |
226 | | |
227 | | Add value yyyy to counter xx |
228 | | |
229 | | ==== 8A xx yyyy: Subtract from counter |
230 | | |
231 | | Subtract value yyyy from counter xx |
232 | | |
233 | | ==== 8F xx: Go to room |
234 | | |
235 | | Go to room passed as a parameter (single byte) |
236 | | |
237 | | ==== 90 xx: Go to screen |
238 | | |
239 | | Go to a screen (in the same room) passed as a parameter. |
240 | | |
241 | | ==== 91 xx: Show global screen |
242 | | |
243 | | Show one of the global screens (from the unique room in MSGGEN). |
244 | | |
245 | | ==== 93 xx: WithScreen |
246 | | |
247 | | Combined with a "Go to room", allows to set the target screen in the new room |
248 | | |
249 | | ==== 95 xx yy: Initialize flag |
250 | | |
251 | | ==== A0 xx yyyy |
252 | | |
253 | | Compare counter xx with value yyyy. This triggers an evaluation of the scripts with matching of the corresponding IfLess/IfEqual operations |
254 | | |
255 | | ==== FA: stop interpreter |
256 | | |
257 | | Do not test the remaining script lines |
258 | | |
259 | | ==== FC: Game over |
260 | | |
261 | | Trigger the "game over" and stop interpreting. This will ask the user if they want to restart from the last saving point or from the start of the adventure. |
262 | | |
263 | | ==== FD: Continue |
264 | | |
265 | | Continue execution with the next script line. |
266 | | |
267 | | ==== FE xx: Goto |
268 | | |
269 | | Call script number xx in the current room |
270 | | |
271 | | ==== FF: Winning the game |
272 | | |
273 | | The game is won if you manage to execute this opcode! |
| 157 | The complete list of [[Opcodes]] (the ones known so far) in a separate page. |