pdxiv / sk2sadat

Convert ScottKit to Scott Adams DAT format
GNU General Public License v2.0
1 stars 1 forks source link

ERROR: unable to find room "_ROOM0" in action on line 1716 #1

Open pdxiv opened 3 years ago

pdxiv commented 3 years ago

sk2sadat fails to compile some ScottKit-decompiled game files that contain a reference to an undefined "_ROOM0" which sk2sadat can't resolve. This has been encountered in decompiled game files as follows: adv04.sck adv05.sck adv06.sck adv13.sck quest1.sck r.sck

pdxiv commented 3 years ago

Maybe _ROOM0 appears when an action refers to an undefined room. If so, ScottKit should perhaps simply not generate actions that reference an invalid room, or die with an error message. Needs to be further investigated.

pdxiv commented 3 years ago

The way forward, to preserve compatibility, appears to be to implicitly create an inaccessible dummy room for every encountered room id which matches the regexp pattern /^(_ROOM\d+)$/.

From the ScottKit documentation: Tolerate out-of-range room-numbers as the locations of items, and also compile such room-names using special names of the form _ROOMnumber. (This is not necessary when dealing with well-formed games, but Buckaroo Banzai is not well-formed.)

pdxiv commented 3 years ago

In some of these games, "phantom rooms" are simply part of "useless" actions with no commands. These actions should probably be removed anyway (and produce a warning when encountered). This is the case with the following game files:

pdxiv commented 3 years ago

The compiler should probably allow for the possibility to use "undefined rooms" using the /_ROOM\d+/ convention. What game interpreters do with that, shouldn't be a concern for the compiler.