Open KVonGit opened 1 month ago
Test game:
<!--Saved by Quest 5.8.9010.29474-->
<asl version="580">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="AllRooms Only Works in the Editor?">
<inherit name="devmode" />
<gameid>3fbf822c-779c-4ac6-987f-af46c552cbb2</gameid>
<version>0.0.1</version>
<firstpublished>2024</firstpublished>
<menufont>Georgia, serif</menufont>
<subtitle>v{game.version}</subtitle>
<author>kv</author>
<description><![CDATA[Test game.<br/><br/>Playing from the editor (whether online or in the desktop version), AllRooms() will return room, foo, and bar. But in the published game, it will only return room.]]></description>
<feature_devmode />
</game>
<object name="room">
<inherit name="editor_room" />
<isroom />
<description>{command:testme}</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
<object name="foo">
<inherit name="editor_room" />
</object>
<object name="bar">
<inherit name="editor_room" />
</object>
<command name="testme_cmd">
<pattern>testme;test me</pattern>
<script>
msg ("AllRooms():")
msg (AllRooms())
</script>
</command>
</asl>
The .aslx file: AllRoomsTester.zip
The .quest file: https://textadventures.co.uk/games/download/9f_y-hmjmewmzd2mvrlixg
In Quest 5.8, the function
AllRooms()
was added to return a list of rooms. (And yes: it was me who submitted this.)The initial
room
object in English.template (and every other template) has a new boolean attribute:isroom
which is set totrue
.https://github.com/textadventures/quest/blob/f47a55b960082f559053209e1fbae7366e8f3036/WorldModel/WorldModel/Core/Templates/English.template#L12-L14
Any other room created is supposed to have
isroom
added and set totrue
by default -- unless you uncheck the checkbox in the editor.This works when you play a game from the editor, but any newly created room's
isroom
attribute does not carry over into a published game.The Issue
I added
isroom
to theeditor_room
type, thinking it would carry over.https://github.com/textadventures/quest/blob/f47a55b960082f559053209e1fbae7366e8f3036/WorldModel/WorldModel/Core/CoreEditor.aslx#L19-L21
I just now unwittingly happened to use
AllRooms()
in a test game and discovered this issue.I searched the forum for "AllRooms", but I didn't get any results with anyone talking about this not working.
I made an example game, just for this issue. I turned on DevMode and left it on when I published the game. (It still works fine after publishing a game; it just doesn't have the GUI.)
Here is a link to play it from the editor: https://play.textadventures.co.uk/Play.aspx?id=editor/81f17eb0-ebd0-4aa6-981f-828287f15e46%2fAllRooms+Only+Works+in+the+Editor.aslx
And here is a link to play the published version: https://play.textadventures.co.uk/Play.aspx?id=9f_y-hmjmewmzd2mvrlixg
As stated, I just discovered this, and I can't think of any possible fixes at this moment.