More information on containers?

I've read the tutorial section on containers, but am looking for more information about the logical consequences of the different types you can chose from - i.e. what types are logically appropriate for what type of object. e.g. a chest,a letter, a hole etc. Is there a document I can read anywhere? I tend to end up getting the right solution by trial and error.


see here:

http://docs.textadventures.co.uk/quest/elements/object.html (scroll down to the very bottom: 'object types defined by core aslx')

(I'm still having a bit of trouble myself with the exactly what some of them do and their inheritance heirarchy, as for me, the descriptions of them are still a bit unclear or confusing)


Object Types / Types: these are quest's user-level 'groups/classes', see an example below:

<object name="player_1">
  <inherit name="player_type" />
</object>

<object name="player_2">
  <inherit name="player_type" />
</object>

<object name="monster_1">
  <inherit name="character_type" />
</object>

<object name="monster_2">
  <inherit name="character_type" />
</object>

<object name="npc_1">
  <inherit name="character_type" />
</object>

<object name="npc_2">
  <inherit name="character_type" />
</object>

<type name="character_type">
  <attr name="condition_string_attribute" type="string">unknown</attr>
  <attr name="life_string_attribute" type="string">unknown</attr>
  <attr name="level_integer_attribute" type="int">0</attr>
  <attr name="cash_integer_attribute" type="int">0</attr>
  <attr name="experience_integer_attribute" type="int">0</attr>
  <attr name="current_life_integer_attribute" type="int">1</attr>
  <attr name="maximum_life_integer_attribute" type="int">1</attr>
  <attr name="current_mana_integer_attribute" type="int">0</attr>
  <attr name="maximum_mana_integer_attribute" type="int">0</attr>
  <attr name="strength_integer_attribute" type="int">0</attr>
  <attr name="endurance_integer_attribute" type="int">0</attr>
  <attr name="dexterity_integer_attribute" type="int">0</attr>
  <attr name="agility_integer_attribute" type="int">0</attr>
  <attr name="speed_integer_attribute" type="int">0</attr>
  <attr name="luck_integer_attribute" type="int">0</attr>
  <attr name="changedcurrent_life_integer_attribute" type="script"><![CDATA[
    if (this.current_life_integer_attribute > this.maximum_life_integer_attribute) {
      this.current_life_integer_attribute = this.maximum_life_integer_attribute
    } else if (this.current_life_integer_attribute < 1) {
      this.current_life_integer_attribute = 0
      this.condition_string_attribute = "dead"
    }
    this.life_string_attribute = this.current_life_integer_attribute + "/" + this.maximum_life_integer_attribute
  ]]></attr>
  <attr name="changedmaximum_life_integer_attribute" type="script">
    this.life_string_attribute = this.current_life_integer_attribute + "/" + this.maximum_life_integer_attribute
  </attr>
</type>

<type name="player_type">
  <inherit name="character_type" />
  <attr name="statusattributes" type="simplestringdictionary">level_integer_attribute = Level: !; cash_integer_attribute = Cash: !; experience_integer_attribute = Experience: !; strength_integer_attribute = Strength: !; ETC ETC ETC; condition_string_attribute = Condition: !; life_string_attribute = Life: !</attr>
  <attr name="changedcondition_string_attribute" type="script">
    if (this.condition_string_attribute = "dead") {
      msg ("You died or were killed.")
      msg ("GAME OVER")
      finish
    }
  </attr>
</type>

the NOT 'container' Object Types:

  1. the 'openable' Object Type ( http://docs.textadventures.co.uk/quest/attributes/openable.html ):

it provides the Object with all the code stuff needed for or used with 'opening/closing' feature/capability:

A. the 'isopen' Boolean Attribute is what actually determines the state of whether the Object is open or closed
B. the 'Open' Verb is added to the Object (which is done through the 'displayverbs' and/or 'inventoryverbs' Stringlist Attributes)
C. the 'Close' Verb is added to the Object (which is done through the 'displayverbs' and/or 'inventoryverbs' Stringlist Attributes)
D. the 'open' Boolean Attribute is actually how quest checks if an Object has the feature/capability of being openable
D. the 'close' Boolean Attribute is actually how quest checks if an Object has the feature/capability of being close'able

http://docs.textadventures.co.uk/quest/attributes/isopen.html
http://docs.textadventures.co.uk/quest/attributes/open.html
http://docs.textadventures.co.uk/quest/attributes/close.html

  1. container_lockable: this does NOT implement any 'container' features/capabilities (you've got to use one of the other 'container' Object Types if you want 'container' capabilities/features), but what it does do is to provide the 'lockable' capability/feature

  2. switchable ( http://docs.textadventures.co.uk/quest/attributes/switchable.html ): 'on/off' feature/capabilities

  3. edible

etc etc etc


the 'container' Object Types:

  1. surface: a 'put/hold-on-top-of' container: a 'table' Object (you can put stuff/Objects on top of the table, but there's no door you have to open/close to see and/or get/take the stuff/Objects being contained by the 'table' Object)

  2. container_limited: a 'container' capability/feature, but with the added code stuff needed for handling/implementing 'maxobject/limiting items that can be contained within the container Object' capability/feature

  3. container_closed: 'container' features/capabilies, and it starts out in the 'closed' state

  4. container_open: 'container' features/capabilies, and it starts out in the 'open' state

  5. container_base: this what provides the 'container' features/capabilities (the other 'container' Object Types that are containers already use this Object Type, so you shouldn't normally ever choice/use this container Object Type)

  6. container: I'm still baffled as to exactly what makes the 'container' Object Type different from the 'container_open' Object Type, meh


so the 'container' inheritance heirarchy looks like this... as my best guess, lol:

openable -> container_base
openable -> container_base -> surface (transparent: you can see the Objects "inside/on-top-of" it, open container, and can NOT be closed)
openable -> container_base -> container_closed
openable -> container_base -> container_open
openable -> container_base -> container_open -> container
openable -> container_base -> container_open -> container -> container_limited

and completely separately from the above, for your use too:

openable: if you want Objet to be openable/close'able, but NOT have 'container' features/capabilities

container_lockable: lockable features/capabilites, and... (if you also want 'container' features/capabilities, you've got to use/include/'inherit' one of the 'container' Object Types for your Object, on top of the 'container_lockable' Object Type)


Thanks! This helps, reassuring that it's not just me that gets baffled, I have more problems with containers than anything else.


just edited my post up a bit, so you may want to refresh and take a look at it again (sorry about that).


Thanks, really appreciate the detail and effort you go to in your replies.


I always use limited containers. Largely because some dolt will try to stick an elephant in an envelope or put all their inventory in one small container.


also, the rest of this link (NOT the very bottom part on the Object Types) is very useful too:

http://docs.textadventures.co.uk/quest/elements/object.html

as these are all/most of the Object's Attributes... (especially notice that in-discreet/discreet-meh-whatever/insignificant 'visited' Boolean Attribute, laughs. It's actually extremely important for quest and/or you)

also, the special 'game' Game Settings/Etc Object's Attributes can be useful too for those who mess with some of this type of stuff (refering to the grid/map and UI type of stuff, as this is stuff I don't understand yet, lol), and of course there's some really useful stuff here too (the 'start' Script Attribute for an example), that you probably do want to mess with, lol:

http://docs.textadventures.co.uk/quest/elements/game.html

also, all of these links/sections under/within ' http://docs.textadventures.co.uk/quest/elements/ ' are very useful to study and read up on and/or jsut be aware of.


What if you want one object to contain a container? E.G. a car with a boot (trunk).


Just have two separate containers. The player will not know that the trunk is not in the car.


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

Support

Forums