Changes between Version 19 and Version 20 of WikiStart


Ignore:
Timestamp:
Jul 24, 2023, 8:01:08 PM (11 months ago)
Author:
pulkomandy
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v19 v20  
    113113== "COND" files
    114114
    115 These probably implement the game logic.
    116 
    117 CONDSAL is the scripts for each room. I guess this because it has the same number of toplevel chunks as MSG.DAT, and also because "SAL" can be for "salles" (French for "rooms").
    118 
    119 CONDGALE may be "conditions générales" and associated with MSGGEN.DAT?
     115These implement the game logic.
     116
     117CONDSAL is the scripts for each room. I found this because it has the same number of toplevel chunks as MSG.DAT, and also because "SAL" can be for "salles" (French for "rooms").
     118
     119CONDGALE may be "conditions générales" and associated with MSGGEN.DAT? It contains the initialization script that is run at the start of the game and a few other global things.
    120120
    121121I don't know what CONDULTI is for yet, but maybe it is for global things and associated with the INIT file?
    122122
    123 Each of the COND script contains chunks that contain sub-chunks, in a similar format to the messages files. But the content of the chunks is not decoded yet.
     123Each of the COND script contains chunks that contain sub-chunks, in a similar format to the messages files. The content of each script is a sequence of opcodes. Most but not all of them start with the 0D opcode that checks if a specific button was clicked. If this is not the case, the script is not run and the next one is tried. There can be multiple scripts matching a specific button event, usually with extra conditions.
    124124
    125125The rehex script, for now:
     
    154154=== Opcodes
    155155
    156 ==== 09: ??
     156==== 00: Return
     157
     158"Return" or "End of line". If this is not present at the end of a line, the execution may continue with the next one?
     159
     160==== 01 xx: CheckFlag
     161
     162Check if flag number xx is set. This is used for internal flags tracking the game state.
     163
     164==== 03 xx: HasItem
     165
     166Check if the player is carrying item xx.
     167
     168==== 09 xx yyyy: IfEqual
     169
     170Compare counter xx with value yyyy and continue executing the line if they are equal
     171
     172==== 0A xx yyyy: IfLess
     173
     174Compare counter with value and continue if it is less than the value
    157175
    158176==== 0D xx yy: Check event
     
    166184Actions involving objects use the second parameter, for example {{{0D 68 05}}} corresponds to action 68 done on object 05.
    167185
    168 ==== 0E: ??
     186==== 0E xx: Check global event
     187
     188Check global events, for example event 00 is the start of the game.
     189
     190==== 7E: Or
     191
     192Used to combine multiple conditions (0D, 09, 0A, ...)
     193
     194==== 7F: And?
     195
     196Probably And, also used to combine several conditions.
     197
     198==== 80 xx: ?
     199
     200Currently unknown
     201
     202==== 81 xx: Set flag
     203
     204Set flag xx
     205
     206==== 82 xx: Clear flag
     207
     208Clear flag xx
     209
     210==== 83 xx: Get item
     211
     212Add item number x to the player's inventory
     213
     214==== 85 xx: Remove item
     215
     216Remove item from the inventory.
     217
     218==== 87 xx yyyy: Set counter
     219
     220Set counter xx to value yyyy
     221
     222==== 89 xx yyyy: Add to counter
     223
     224Add value yyyy to counter xx
     225
     226==== 8A xx yyyy: Subtract from counter
     227
     228Subtract value yyyy from counter xx
    169229
    170230==== 8F xx: Go to room
     
    172232Go to room passed as a parameter (single byte)
    173233
    174 ==== 90 xx xx: Go to screen
     234==== 90 xx: Go to screen
    175235
    176236Go to a screen (in the same room) passed as a parameter.
    177237
    178 TODO parameter on 1 or 2 bytes? Probably 2.
    179 
    180 ==== 91 xx xx: ??
    181 
    182 Followed by a 16 bit value
    183 
    184 ==== 93 xx xx: ??
    185 
    186 {{{93 01 00}}}
     238==== 91 xx: Show global screen
     239
     240Show one of the global screens (from the unique room in MSGGEN).
     241
     242==== 93 xx: WithScreen
     243
     244Combined with a "Go to room", allows to set the target screen in the new room
     245
     246==== 95 xx yy: Initialize flag
     247
     248==== A0 xx yyyy
     249
     250Compare counter xx with value yyyy. This triggers an evaluation of the scripts with matching of the corresponding IfLess/IfEqual operations
     251
     252==== FA: stop interpreter
     253
     254Do not test the remaining script lines
     255
     256==== FC: Game over
     257
     258Trigger 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.
     259
     260==== FD: Continue
     261
     262Continue execution with the next script line.
     263
     264==== FE xx: Goto
     265
     266Call script number xx in the current room
     267
     268==== FF: Winning the game
     269
     270The game is won if you manage to execute this opcode!
    187271
    188272== INIT file