Items in description

Heya all,

Just something I was considering and thought I'd ask those with more experience than myself.

Iff you give the player clothes, say you're sorting out an armour system, or a dressware system (And I guess this would apply to other items too) what would be best way to integrate this into descriptions be?

Say we had...

"The hand grabs the bottom of your leather pants,"
"The hand grabs the bottom of your steel plate legs,"
"The hand grabs the bottom of your light blue skirt,"

Each one activating in the same event, but only if the player is wearing and equipping them. I was thinking oit might be a case of when a player equips an item, it sets a flag, and then that flag is used with the 'If' function. If player has flag platelegs then print message... But this seems a bit messy. Is there a better way to reference equipped equipment?

Thanks!


Clothing will be implemented in the next version of Quest,but for now, look at my clothing library (when Quest 5.7 finally comes out, just remove the library from your game, and the clothing should continue to work fine):

https://github.com/ThePix/quest/wiki/Clothing-Library

You can assign garments to slots, then during play get the garment in that slot.


Oh, I know how to make a clothing system work, I was more just considering the best way to alter the descriptions and messages that happen depending on what you have equipped, without having to make large IF strings and making things seem messy. If there was an alternative route. But even still, I'll check the library out! ^__^


player.lowerarmor= "leather pants"
msg("The hand grabs the bottom of your " + player.lowerarmor + ".")

then you would see: The hand grabs the bottom of your leather pants.


Yeah, that's the kind of thing I was looking for. I'll see if I can set an object as an attribute. If not, then I can always modify the attribute upon equipping.


Object (holds only one Object reference/pointer) Attributes and/or Objectlist (can hold many Object references/pointers) Attributes:

<object name="player">
  <attr name="trunk_object_attribute" type="object">pants</attr>
  // or:
  <attr name="trunk_objectlist_attribute" type="objectlist">boxers;pants</attr> // this requires more code work though to implement and is quite advanced (you'll need 'layer/level' Integer Attributes on your equipment, using greater/less than and/or equal operations: you don't want to be able to put your 'boxers' on after you got pants on, or, you don't want to be able to take off your 'boxers' before you've taken off your 'pants', or, you don't want to be able to wear 'boxers' and 'underware' at the same time, for examples. Also, you're dealing with List and/or Dictionary Attributes, which are quite a bit more advanced than the normal Attributes, as you got to iterate, 'foreach' or 'for', through them, but it does allow for you to add/remove your equipment items/Objects from your List Attributes. Very effective for advanced equipment systems and/or really large equipment systems)
</object>

<object name="pants">
  <attr name="attractiveness" type="int">1</attr>
</object>

<object name="boxers">
  <attr name="attractiveness" type="int">2</attr>
</object>

// scripting examples:

<object name="player">
  // blah Attributes seen above
  <attr name="attractiveness_integer_attribute" type="int">0</attr>
  <attr name="torso_object_attribute" type="object">shirt</attr>
  <attr name="changedtrunk_object_attribute" type="script">
    player.attractiveness_integer_attribute = player.trunk_object_attribute.attractiveness_integer_attribute + player.torso_object_attribute.attractiveness_integer_attribute
  </attr>
  <attr name="changedtorso_object_attribute" type="script">
    player.attractiveness_integer_attribute = player.trunk_object_attribute.attractiveness_integer_attribute + player.torso_object_attribute.attractiveness_integer_attribute
  </attr>
</object>

<object name="shirt">
  <attr name="attractiveness_integer_attribute" type="int">1</attr>
</object>

// -----------

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

msg ("You pull up your {player.trunk_object_attribute.name}.")

msg ("{if player.trunk_object_attribute=pants: You pull up, and zip up, your pants}{if player.trunk_object_attribute=boxers: You pull up your boxers}")

or, you can do the scripting the 'normal' way:

msg ("You pull up your " + player.trunk_object_attribute.name + ".")

string_variable = "unknown"
if (player.trunk_object_attribute = pants) {
  string_variable = "You pull up, and zip up, your pants"
} else if (player.trunk_object_attribute = boxers) {
  string_variable = "You pull up your boxers"
}
msg (string_variable)

unfortunately, within the GUI/Editor, there's no way of creating Objectlist Attributes, but you can do so via scripting (in code, but hopefully you can figure out how to do the scripting through the GUI/Editor's Script options: you can always use the [EXPRESSION] option if you have to... ask if you need help with doing this stuff through the GUI/Editor, and I'll open up quest and figure out how to do it and then help you through it):

game.trunk_objectlist_attribute = NewObjectList ()
list add (game.trunk_objectlist_attribute, boxers)
list add (game.trunk_objectlist_attribute, pants)

lastly, for the advanced equipment systems:

check out Pixie's equipment/clothing/combat library

and there's also Chase's 'Wearables' (equipment) library, though Pixie might have implemented some of Chase's code/design (levels/layers, equipment slots, etc) in Pixie's library too, along with Pixie's own coding designs of course, if these things weren't already done as part of Pixie's own coding design.

(there's also Pertex' combat library, which has an equipment system too, but it's a bit more specific to his own design and not as noobie friendly as Pixie's)


ask if you need any help with anything


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

Support

Forums