I Think "AllRooms()" Is Bugged! [SOLVED BUT DEFAULT SETTING SHOULD BE CHANGED]

Dcoder
11 Aug 2019, 05:49[Desktop TA Quest v5.8]
I have a simple "places" command that prints out how many rooms are in the game by using the AllRooms()
function to iterate through each room and tally them up. There are 3 rooms in this bare-bones game, each denoted by the "Object is a room" checkmark.
When the game is run FROM THE EDITOR, the "places" command works just fine -- "3" is printed. This works in a new or restored game.
However, when I PUBLISH the game and run it, the "places" command always prints "1"! So I think somehow the AllRooms()
function is bugged?!
<!--Saved by Quest 5.8.6809.15141-->
<asl version="580">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="AllRoomsTest">
<gameid>eb53263c-71d7-45d7-bc4a-83894f256e98</gameid>
<version>1.0</version>
<firstpublished>2019</firstpublished>
</game>
<object name="room1">
<inherit name="editor_room" />
<isroom />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<exit alias="south" to="room2">
<inherit name="southdirection" />
</exit>
</object>
<object name="room2">
<inherit name="editor_room" />
<exit alias="north" to="room1">
<inherit name="northdirection" />
</exit>
<exit alias="south" to="room3">
<inherit name="southdirection" />
</exit>
</object>
<object name="room3">
<inherit name="editor_room" />
<exit alias="north" to="room2">
<inherit name="northdirection" />
</exit>
</object>
<command name="places">
<pattern>p; places</pattern>
<script>
total = 0
foreach (place, AllRooms()) {
total = total + 1
}
msg (total)
</script>
</command>
</asl>

Dcoder
11 Aug 2019, 06:25UPDATE:
I know what the problem is -- inheritance. When I check and uncheck the isroom
attribute for room2 and room3, the attribute is then sourced from the room itself, not from the default source. Then the "places" command works in a published game! I don't know why this isn't an issue in a non-published game though?
I would still consider this a "bug", because you have to manually set every isroom
attribute to be sourced from its room in order for AllRooms()
to work right. What if you have a hundred rooms in the game?

Dcoder
11 Aug 2019, 07:27I don't know why this isn't an issue in a non-published game though?
Oh, because the editor_object
type only works in the editor, not in a published game.

Dcoder
11 Aug 2019, 16:04CONCLUSION:
Whenever you create a new room, the room's isroom
Boolean attribute (default is true
) should be inherited from defaultobject
rather than editor_room
. Otherwise the author will have to manually set this attribute to true
for every room to get AllRooms()
to work in a published game -- and how would they know to do that?

Richard Headkid
11 Aug 2019, 16:31Whoops.
My mistake.
That is code that I submitted. Sorry about that.
I don't currently have a way to fix it, either.
I wonder if isroom
can be added to defaultobject
with the value set to false
, then have editor_room
set to true
. . .
That would probably have the same issue -- not working once the game is published, but it's the only fix I can theorize (and, again, I currently have no way to run Quest; so, I can't test anything).
Sorry again, everyone!
If it's any consolation, I am no longer submitting any Quest code (and I haven't since the last release). So, the chances of me messing something up next time are nil.

Dcoder
11 Aug 2019, 16:38It's good to hear from you, KV! Thanks for the reply! You're always welcome to submit code!

Richard Headkid
11 Aug 2019, 16:50Hello!
I kind of maybe uninstalled Windows. (Curse all that blasted, constant updating!)
I am a Linux man, now.
(...and I shall remain a Linux man until I can afford a Mac. Bwahahahaha!)
I tried to get Quest to successfully run under WINE for quite some time, but Quest simply needs an actual Windows environment. That sucks because I cannot thrive in such an environment.
So, yeah . . . No Windows means no way to really work with Quest. I do appreciate the hospitality, though!
PS
mrangel has no Windows and still really works with Quest, but I think the only reason he can do that is because he is a wizard.

Dcoder
11 Aug 2019, 17:00May you thrive unfettered in Linuxland!