Alternative Scope Not Work with Object List? [Solved]

I'm back already :P

Title actually says it all -- Made a barebones game with room1 and room2. Player starts in room1 and there is a generic object gizmo in room2. Made a kick command. Under the Start tab, I created a couple of object lists that each contain gizmo (game.MyObjectList;game.MyObjectList2). The kick command has in its Scope both object lists.

When the player tries to kick the gizmo from room1, it doesn't work as gizmo can't be seen. The player can, of course, kick the gizmo in room2. What gives?

Barebones game code:

<!--Saved by Quest 5.8.6809.15141-->
<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="TEST Alternative Scope">
    <gameid>ae561d54-bde5-4866-8ca0-2e44978c97c5</gameid>
    <version>1.0</version>
    <firstpublished>2018</firstpublished>
    <start type="script">
      game.MyObjectList = NewObjectList()
      list add (game.MyObjectList, gizmo)
      game.MyObjectList2 = GetAllChildObjects(room2)
    </start>
  </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_object" />
    <object name="gizmo">
      <inherit name="editor_object" />
      <take />
      <displayverbs type="stringlist">
        <value>Look at</value>
        <value>Take</value>
        <value>Kick</value>
      </displayverbs>
    </object>
    <exit alias="north" to="room1">
      <inherit name="northdirection" />
    </exit>
  </object>
  <command name="kick">
    <pattern>kick #object#</pattern>
    <scope>game.MyObjectList;game.MyObjectList2</scope>
    <script>
      msg ("You kick the crap out of it!")
    </script>
  </command>
</asl>

Object lists (in the form of attributes) should be acceptable in alternative scopes. Here's the official Quest documentation (near the bottom):

http://docs.textadventures.co.uk/quest/advanced_scope.html


You can't use game.MyObjectList in scope. Looking at the code, it doesn't seem to parse the dot. (The version I was playing around with did, but I think Pixie wanted to make it simpler).

You can have <scope>MyObjectList;MyObjectList2</scope>, as long as the lists are either attributes of the player, or attributes of the current room. (Note that in this case they must be objectlists. You can also use object attributes of the room, but not of the player)


Ok, thanks.


MrAngel's explanation should probably be incorporated into the documentation...


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums