Excluding an object from 'get all'

Is there a way to to exclude an object when the command is 'get all'?

(I've looked through the attributes, the docs, and the forums. I bet it's there, but I can't find it.)


I don't think so for the Function itself, but you can do this (after the fact):

get input {
  if (not result = "YOUR_UNWANTED_INPUT") {
    // do whatever for your WANTED inputs
  }
  <!--
  // optionally:
  else {
    // whatever for your unwanted input
  }
  -->
}

or

get input {
  if (result = "YOUR_UNWANTED_INPUT") {
   // whatever for your unwanted input
  } else {
    // do whatever for your WANTED inputs
  }
}

oops... you said a 'get all' command for Objects...

I don't recognise this... unless you're refering to the 'AllObjects ()' Function ???

here's how you would use this:

(I'm not sure what you actually want to do, so just taking a guess, as an example for you, lol)

// the 'AllObjects ()' Function creates an Objectlist VARIABLE of EVERY Object in your game! (the lazy-HK's favorite Function, lol)

// 'foreach' Function then iterates through every item in an Objectlist VARIABLE (which in this case, we're iterating through EVERY Object in the game)

game.wanted_objects_objectlist_attribute = NewObjectList ()
game.unwanted_objects_objectlist_attribute = NewObjectList ()

foreach (object_variable, AllObjects () ) {
  if (object_variable = NAME_OF_YOUR_UNWANTED_OBJECT) {
    list add (game.unwanted_objects_objectlist_attribute, object_variable)
  } else {
    list add (game.wanted_objects_objectlist_attribute, object_variable)
  }
}

or

game.wanted_objects_objectlist_attribute = NewObjectList ()
game.unwanted_objects_objectlist_attribute = NewObjectList ()

foreach (object_variable, AllObjects () ) {
  if (not object_variable = NAME_OF_YOUR_UNWANTED_OBJECT) {
    list add (game.wanted_objects_objectlist_attribute, object_variable)
  } else {
    list add (game.unwanted_objects_objectlist_attribute, object_variable)
  }
}

// you can then use these new Objectlist VARIABLES (Attributes), for whatever you want. Now, you don't have to use the 'AllObjects()' Function anymore, you can use the 'game.unwanted_objects_objectlist_attribute' to check if you got any of them in some other list or whatever usage.

Hi there, HK!

I apologize for the way I phrased that.

Let's say there's an NPC named 'Ralph' in the room along with object2 and object3, and object2 and object3 can both be taken.

Now, the player has played through this part once already, so he/she is going to enter GET ALL, which will print:

object2: You pick it up
Ralph: You can't take him.
object3: You pick it up.

I'd like to exclude certain objects (or objects with a certain attribute I could create, like 'not_included_all') from the TAKE/GET ALL command.

I think it may be something involving this part of DoTake:


prefix = ""
if (ismultiple) {
  prefix = GetDisplayAlias(object) + ": "
}

AND especially this part of DoTake when the command is GET/TAKE ALL, I don't want it to print the TakeUnsuccessfull message for any of the NPCs:


   if (not found and takemsg = null) {
      takemsg = DynamicTemplate("TakeUnsuccessful", object)
    }

Note I am re-reading your replies, and I may be able to use the second method (foreach with the list of objects in player.parent) to exclude certain items from triggering a response from GET/TAKE ALL.
Alternatively, I could do it just like you've written it in a start script, but, if I can figure out how to exclude an object when entering TAKE ALL (i.e., it doesn't list the scenery: YOU CAN'T TAKE THE GROUND), I can probably just add the attributes up-front and not bog the game down via extra start scripts.


I'm not familiar with how the built-in stuff works... you'd have to find the relevant part of code that you need from it (filter -> show library elements -> 'toggled on/check-in' -> above in the "tree of stuff" as now-revealed light grey text, look under 'take' and/or whatever else that might be related to 'take', and/or maybe the 'handlecommand' too... no idea... don't know the built-in stuff, lol. And add in the needed scripting for what you want... once you found the relevant code for it, lol.

Also, there's a 'multiple' feature of Commands, but I don't really understand it and/or how it works, but you can take a look at Chase's 'wearables' (equipment) Library as he uses it in and with his code design. maybe you can understand it and how it works. Also, it may not even be relevant too for the scripting you want to add/adjust for doing your exclusion stuff.


as for the exclusion action, there's only two ways of doing it (I think):

with an 'if' Script

and/or

with using lists (there's lots of functionality, comparisons you do can, with them: ListContains (xxx), ListExclude(xxx), ListCombine (xxx), ListCount (xxx), sorting too btw, etc etc etc):

http://docs.textadventures.co.uk/quest/guides/using_lists.html
http://docs.textadventures.co.uk/quest/using_lists.html


Getting dangerous now:

If I alter the beginning of the DoTake script like so:


prefix = ""
if (ismultiple) {
  prefix = GetDisplayAlias(object) + ": "
        if ((GetDisplayAlias(object) = "Ralph")) {
      msg ("You just took all on RP.")
    }

...it prints YOU JUST TOOK ALL ON RP.

So, I've found where to insert the code to remove him from the list. Now I need only know the name of the list.

This problem is not insurmountable.

NOTE: I totally copied this script from the GUI before I toyed with it. I never alter the source file.

Here's the whole script, with the lines I added in notated:

prefix = ""
if (ismultiple) {
  prefix = GetDisplayAlias(object) + ": "
  
//added this bit in, in an attempt to find out where to alter the list to exclude Ralph (and all NPCs in general)  from GET/TAKE ALL:

      if ((GetDisplayAlias(object) = "Ralph")) {
        msg ("You just took all on RP.")
      }
//END OF ADDED IN BIT

}
if (object.parent = game.pov) {
  msg (prefix + DynamicTemplate("AlreadyTaken", object))
}
else if (not ListContains(ScopeReachable(), object)) {
  msg (prefix + DynamicTemplate("ObjectNotOpen", GetBlockingObject(object)))
}
else {
  volume = 0
  continue = true
  foreach (obj, GetAllChildObjects(game.pov)) {
    if (HasInt(obj, "volume")) {
      volume = volume + obj.volume
    }
  }
  if (not Contains(game.pov, object)) {
    volume = volume + GetVolume(object,true)
  }
  if (HasInt(game.pov, "maxvolume")) {
    if (volume > game.pov.maxvolume) {
      continue = false
      if (HasString(game.pov, "containerfullmessage")) {
        message = prefix + game.pov.containerfullmessage
      }
      else {
        message = prefix + DynamicTemplate("FullInventory", object)
      }
    }
  }
  children = GetDirectChildren(game.pov)
  if (HasInt(game.pov, "maxobjects")) {
    if (game.pov.maxobjects > 0) {
      if (ListCount(children) >= game.pov.maxobjects) {
        continue = false
        if (HasString(game.pov, "containermaxobjects")) {
          message = prefix + game.pov.containermaxobjects
        }
        else {
          message = prefix + DynamicTemplate("MaxObjectsInInventory", object)
        }
      }
    }
  }
  if (continue = false) {
    msg (message)
  }
  else {
    found = true
    takemsg = object.takemsg
    switch (TypeOf(object, "take")) {
      case ("script") {
        if (ismultiple) {
          OutputTextNoBr (prefix)
        }
        do (object, "take")
        takemsg = ""
      }
      case ("boolean") {
        if (object.take = true) {
          object.parent = game.pov
          if (takemsg = null) {
            takemsg = DynamicTemplate("TakeSuccessful", object)
          }
        }
        else {
          found = false
        }
      }
      case ("string") {
        object.parent = game.pov
        takemsg = object.take
      }
      default {
        found = false
      }
    }
    if (not found and takemsg = null) {
      takemsg = DynamicTemplate("TakeUnsuccessful", object)
    }
    if (LengthOf(takemsg) > 0) {
      msg (prefix + takemsg)
    }
    if (HasScript(object, "ontake")) {
      do (object, "ontake")
    }
    if (found and GetBoolean (object, "scenery") and object.parent = game.pov) {
      object.scenery = false
    }
  }
}

Making progress:

This successfully allows me to add an attribute to an object which excludes it from the TAKE/GET ALL command. (It will ignore said object, as if it were scenery.)

This prints no output at all, just like it would if there were nothing to get.

I'm working on adding "There is no all to get." when there are no objects to take.


I copied the 'take' command then edited the script thusly:


foreach (obj, object) {
  if (not HasAttribute(obj, "not_all")) {
    DoTake (obj, multiple)
  }
}

Then, I just add the attribute 'not_all' to any object I don't want a printed response for when the player's command is TAKE/GET ALL.


SUCCESS!


To exclude an object from TAKE/GET ALL

Created an attribute called 'not_all' for the object. (NOTE: You can use a Boolean and set it to "True" to maintain a professional appearance. You can also just leave it as an empty string. Either, way the code remains the same. (Thanks Pixie!))

Altered script for the command 'take':

anything_to_take = false
foreach (obj, object) {
  if (not HasAttribute(obj, "not_all")) {
    DoTake (obj, multiple)
    anything_to_take = true
    //this signals the presence of an object that is included in TAKE ALL
  }
}
if (not anything_to_take) {
  ///Meaning there is not an object that would be included in TAKE ALL present
  msg ("There is no all to take.")
}

And that's it!

If there is nothing to get, it will print, "There is no all to take."

Otherwise, it will take everything marked 'can be taken', printing each object's takemsg, just like it normally would.

Thanks for all the help, hegemonkhan and Pixie!


you can use a String Attribute, a Boolean Attribute, an Integer/Double Attribute, the 'name' of the Object (using the String Manipulation Functions and a naming/labeling convention/system), or an Object Type for your 'indicator/flag' on your Objects:

// 'Has'-vs-'Get'-Attribute Functions:
//
// the 'Has' just checks if the Object has an Attribute named as specified, the Value of the Attribute is ir-relevant/ignored
// the 'Get' not only checks if the Object has an Attribute named as specified, but also checks if it's Value is the same as specified

-----------

note that there's the 'HasAttribute' and 'GetAttribute', which quest will parse/determine for you (they can be used for any of the specfici Attribute Types or more usually when the Attribute Type is dynamic: you don't know what Attribute Type it will be / it's different each time. Also, they may work with List and Dictionary Attributes too, but I've not tested it yet --- lazy me/HK)

otehrwise, if you know for certain of the Attribute Type, you can use the specific individual types:

HasString, HasInt, HasBoolean, etc etc etc
GetString, GetInt, GetBoolean, etc etc etc

--------

String Attribute usage:

if (HasString (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE")) { /* scripting */ }

if (GetString (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") = "STRING_VALUE_A") { /* scripting */ }

if (GetString (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") = "STRING_VALUE_B") { /* scripting */ }
if (not GetString (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") = "STRING_VALUE_A") { /* scripting */ }
if (GetString (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") <> "STRING_VALUE_A") { /* scripting */ } // requires the 'CDATA' tags for its use if coding directly in code, the '<>' is/will-ve recognized by quest as 'not equals', it's an alternative to: not xxx = xxx

-----------

Boolean Attribute:

if (NAME_OF_OBJECT.NAME_OF_BOOLEAN_ATTRIBUTE) { /* scripting */ }
if (not NAME_OF_OBJECT.NAME_OF_BOOLEAN_ATTRIBUTE) { /* scripting */ }

if (HasBoolean (NAME_OF_OBJECT, "NAME_OF_Boolean_ATTRIBUTE")) { /* scripting */ }

if (GetBoolean (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") = BOOLEAN_VALUE_A) { /* scripting */ }

if (GetBoolean (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") = BOOLEAN_VALUE_B) { /* scripting */ }
if (not GetBoolean (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") = BOOLEAN_VALUE_A) { /* scripting */ }
if (GetBoolean (NAME_OF_OBJECT, "NAME_OF_STRING_ATTRIBUTE") <> BOOLEAN_VALUE_A) { /* scripting */ }

----------

Integer (or Double) Attribute:

if (HasInt (NAME_OF_OBJECT, "NAME_OF_INTEGER_ATTRIBUTE")) { /* scripting */ }

if (GetInt (NAME_OF_OBJECT, "NAME_OF_INTEGER_ATTRIBUTE") = INTEGER_VALUE_A) { /* scripting */ }

if (not GetInt (NAME_OF_OBJECT, "NAME_OF_INTEGER_ATTRIBUTE") = INTEGER_VALUE_A) { /* scripting */ }
if (GetInt (NAME_OF_OBJECT, "NAME_OF_INTEGER_ATTRIBUTE") <> INTEGER_VALUE_A) { /* scripting */ }
if (GetInt (NAME_OF_OBJECT, "NAME_OF_INTEGER_ATTRIBUTE") = INTEGER_VALUE_B) { /* scripting */ }

-----------

the String Manipulation Functions:

http://docs.textadventures.co.uk/quest/functions/ (scroll down to the very bottom/bottom-last-section: 'string functions')

StartsWith, EndsWith, Mid, Instr, InstrRev, etc etc etc (maybe)

for example:

<object name="potion_1">
</object>
<object name="potion_2">
</object>
<object name="potion_3">
</object>
<object name="sword_1">
</object>
<object name="sword_2">
</object>
<object name="sword_3">
</object>

// scripting:

foreach (object_variable, AllObjects ()) {
  if (StartsWith (object_variable, "potion")) {
    list add (game.potion_objectlist_attribute, object_variable)
  } else if (StartsWith (object_variable, "sword")) {
    list add (game.sword_objectlist_attribute, object_variable)
  }
}

--------------------

Object Types / Types / Inherited Attributes:

for example:

<type name="monster_type">
</type>

<object name="orc">
  <inherit name="monster_type" />
</object>

<object name="ogre">
  <inherit name="monster_type" />
</object>

<type name="equipment_type">
</type>

<object name="sword">
  <inherit name="equipment_type" />
</object>

<object name="axe">
  <inherit name="equipment_type" />
</object>

// scripting:

foreach (object_variable, AllObjects ()) {
  if (DoesInherit (object_variable, "monster_type")) {
    list add (game.monster_objectlist_attribute, object_variable)
  } else if (DoesInherit (object_variable, "equipment_type")) {
    list add (game.equipment_objectlist_attribute, object_variable)
  }
}

StartsWith andEndsWith ???

Cool!


What's the difference between Inherited types and Attributes?


Object Types / Types: are quest's user-level 'groups/classes' ("baskets:Object_Types of a bunch of eggs:Attributes"), which are then added to Objects as 'Inherited Attributes'

for example:

VERY YUCK:

<object name="orc_1">
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">95</attr>
  <attr name="dexterity" type="int">90</attr>
  <attr name="agility" type="int">85</attr>
  <attr name="speed" type="int">80</attr>
  <attr name="luck" type="int">75</attr>
  <attr name="piety" type="int">70</attr>
  <attr name="intelligence" type="int">65</attr>
  <attr name="spirituality" type="int">60</attr>
  <attr name="mentality" type="int">55</attr>
  <attr name="personality" type="int">50</attr>
  <attr name="charisma" type="int">45</attr>
  <attr name="leadership" type="int">40</attr>
  <attr name="alignment" type="int">35</attr>
  <attr name="morality" type="int">30</attr>
</object>

<object name="orc_2">
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">95</attr>
  <attr name="dexterity" type="int">90</attr>
  <attr name="agility" type="int">85</attr>
  <attr name="speed" type="int">80</attr>
  <attr name="luck" type="int">75</attr>
  <attr name="piety" type="int">70</attr>
  <attr name="intelligence" type="int">65</attr>
  <attr name="spirituality" type="int">60</attr>
  <attr name="mentality" type="int">55</attr>
  <attr name="personality" type="int">50</attr>
  <attr name="charisma" type="int">45</attr>
  <attr name="leadership" type="int">40</attr>
  <attr name="alignment" type="int">35</attr>
  <attr name="morality" type="int">30</attr>
</object>

<object name="orc_3">
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">95</attr>
  <attr name="dexterity" type="int">90</attr>
  <attr name="agility" type="int">85</attr>
  <attr name="speed" type="int">80</attr>
  <attr name="luck" type="int">75</attr>
  <attr name="piety" type="int">70</attr>
  <attr name="intelligence" type="int">65</attr>
  <attr name="spirituality" type="int">60</attr>
  <attr name="mentality" type="int">55</attr>
  <attr name="personality" type="int">50</attr>
  <attr name="charisma" type="int">45</attr>
  <attr name="leadership" type="int">40</attr>
  <attr name="alignment" type="int">35</attr>
  <attr name="morality" type="int">30</attr>
</object>

VS

much much better:

<object name="orc_1">
  <inherit name="orc_type" /> // this is the 'Inherited Attribute', which is adding the Object Type (and thus all of its Attributes) to this Object
</object>

<object name="orc_2">
  <inherit name="orc_type" />
</object>

<object name="orc_3">
  <inherit name="orc_type" />
</object>

// this is the Object Type and the Attributes it holds:

<type name="orc_type">
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">95</attr>
  <attr name="dexterity" type="int">90</attr>
  <attr name="agility" type="int">85</attr>
  <attr name="speed" type="int">80</attr>
  <attr name="luck" type="int">75</attr>
  <attr name="piety" type="int">70</attr>
  <attr name="intelligence" type="int">65</attr>
  <attr name="spirituality" type="int">60</attr>
  <attr name="mentality" type="int">55</attr>
  <attr name="personality" type="int">50</attr>
  <attr name="charisma" type="int">45</attr>
  <attr name="leadership" type="int">40</attr>
  <attr name="alignment" type="int">35</attr>
  <attr name="morality" type="int">30</attr>
</type>

because the Attributes within an Object Type are 'inherited' via as an 'Inherited Attribute', you can over-ride them:

<object name="orc_1">
  <inherit name="orc_type" />
</object>

<object name="orc_2">
  <inherit name="orc_type" />
  <attr name="strength" type="int">0</attr>
  <attr name="endurance" type="int">0</attr>
  <attr name="dexterity" type="int">0</attr>
  <attr name="agility" type="int">0</attr>
  <attr name="speed" type="int">0</attr>
  <attr name="luck" type="int">0</attr>
</object>

<object name="orc_3">
  <inherit name="orc_type" />
  <attr name="intelligence" type="int">0</attr>
  <attr name="spirituality" type="int">0</attr>
  <attr name="mentality" type="int">0</attr>
  <attr name="personality" type="int">0</attr>
  <attr name="charisma" type="int">0</attr>
  <attr name="leadership" type="int">0</attr>
  <attr name="alignment" type="int">0</attr>
  <attr name="morality" type="int">0</attr>
</object>

<type name="orc_type">
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">95</attr>
  <attr name="dexterity" type="int">90</attr>
  <attr name="agility" type="int">85</attr>
  <attr name="speed" type="int">80</attr>
  <attr name="luck" type="int">75</attr>
  <attr name="piety" type="int">70</attr>
  <attr name="intelligence" type="int">65</attr>
  <attr name="spirituality" type="int">60</attr>
  <attr name="mentality" type="int">55</attr>
  <attr name="personality" type="int">50</attr>
  <attr name="charisma" type="int">45</attr>
  <attr name="leadership" type="int">40</attr>
  <attr name="alignment" type="int">35</attr>
  <attr name="morality" type="int">30</attr>
</type>

// results (final Attribute Values):

orc_1:

  <inherit name="orc_type" />
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">95</attr>
  <attr name="dexterity" type="int">90</attr>
  <attr name="agility" type="int">85</attr>
  <attr name="speed" type="int">80</attr>
  <attr name="luck" type="int">75</attr>
  <attr name="piety" type="int">70</attr>
  <attr name="intelligence" type="int">65</attr>
  <attr name="spirituality" type="int">60</attr>
  <attr name="mentality" type="int">55</attr>
  <attr name="personality" type="int">50</attr>
  <attr name="charisma" type="int">45</attr>
  <attr name="leadership" type="int">40</attr>
  <attr name="alignment" type="int">35</attr>
  <attr name="morality" type="int">30</attr>

orc_2:

  <inherit name="orc_type" />
  <attr name="strength" type="int">0</attr>
  <attr name="endurance" type="int">0</attr>
  <attr name="dexterity" type="int">0</attr>
  <attr name="agility" type="int">0</attr>
  <attr name="speed" type="int">0</attr>
  <attr name="luck" type="int">0</attr>
  <attr name="piety" type="int">0</attr>
  <attr name="intelligence" type="int">65</attr>
  <attr name="spirituality" type="int">60</attr>
  <attr name="mentality" type="int">55</attr>
  <attr name="personality" type="int">50</attr>
  <attr name="charisma" type="int">45</attr>
  <attr name="leadership" type="int">40</attr>
  <attr name="alignment" type="int">35</attr>
  <attr name="morality" type="int">30</attr>

orc_3:

  <inherit name="orc_type" />
  <attr name="strength" type="int">100</attr>
  <attr name="endurance" type="int">95</attr>
  <attr name="dexterity" type="int">90</attr>
  <attr name="agility" type="int">85</attr>
  <attr name="speed" type="int">80</attr>
  <attr name="luck" type="int">75</attr>
  <attr name="piety" type="int">70</attr>
  <attr name="intelligence" type="int">0</attr>
  <attr name="spirituality" type="int">0</attr>
  <attr name="mentality" type="int">0</attr>
  <attr name="personality" type="int">0</attr>
  <attr name="charisma" type="int">0</attr>
  <attr name="leadership" type="int">0</attr>
  <attr name="alignment" type="int">0</attr>
  <attr name="morality" type="int">0</attr>

also note:

you can add Script Attributes, List Attributes, Dictionary Attributes, and even Inherited Attributes (layers of Object Types: Object Types within Object Types) to Object Types as well as String Attributes, Boolean Attributes, Integer/Double Attribute and Object (reference/pointer) Attributes

also note 2: (a caveat):

however, if you want to change the Value of an Inherited Attribute (an Attribute from an Object Type) on an Object... you must first, create the same Attribute within the Object, as this will cause the Inherited Attribute to be over-ridden/over-writen, and thus now no longer it's an Inherited Attribute, but now a normal Attribute, which you can now adjust it's Value, whereas as an Inherited Attribute, it (The Inherited Attribute's Value) is blocked/restricted from being manipulated/changed/adjusted.


for an example of a more complex (layered) system of Object Types:

just some ideas for you (using a bunch of different games' mechanics/features/concepts, lol)

<type name="item_type">
</type>

<type name="event_item_type">
  <inherit name="item_type" />
  // this would be your non-interactive (non-usable) 'items', really more of like achievements/trophies/progress: event/quest/key items
</type>

<type name="normal_item_type">
  <inherit name="item_type" />
  // these are your 'normal' (interactive/usable) items
  <attr name="quantity" type="int">0</attr>
  <attr name="weight/volume" type="int">0</attr>
</type>

<type name="consumable_item_type">
  <inherit name="normal_item_type" />
  // can be used anywhere
  // using the built-in 'use' stuff works fine here
</type>

<type name="battle_item_type">
  <inherit name="normal_item_type" />
  // these items can be used in battle: they cast a spell and may or may not use up the item
  // using the built-in 'use' stuff works fine here too
</type>

<type name="world_item_type">
  <inherit name="normal_item_type" />
  // these can only be used on the world map area: such as items that 'warp to towns', 'sleeping tent for recovering hp/mp', 'transportation calling/summoning items', etc etc etc
  // using the built-in 'use' stuff works fine here too
</type>

<type name="equipment_type">
  <inherit name="normal_item_type" />
  <attr name="equipable" type="boolean">true</attr>
  <attr name="unequipable" type="boolean">true</attr>
  <attr name="equip" type="script">
  </attr>
  <attr name="unequip" type="script">
  </attr>
  <attr name="slot_layer_integer_attribute" type="int">0</attr>
  <attr name="slot_stringlist_attribute" type="simplestringlist">unknown</attr>
</type>

<type name="cursed_type">
  <attr name="unequipable" type="boolean">false</attr>
</type>

<type name="weapon_type">
  <inherit name="equipment_type" />
  <attr name="damage" type="int">0</attr>
  <attr name="reach" type="int">0</attr>
  <attr name="speed" type="int">0</attr>
  <attr name="damage_modifier_string_attribute" type="string">unknown</attr> // if you want multiple damage modifiers, than make this be a Stringlist Attribute
  <attr name="damage_modifier_integer_attribute" type="int">0</attr> // actually we can combine these two damage modifiers (string and int) by using a Dictionary Attribute...
</type>

<type name="armor_type">
  <inherit name="equipment_type" />
  <attr name="armor_class/armor_rating/defense/defense_rating/etc" type="int">0</attr>
</type>

<type name="clothing_type">
  <inherit name="equipment_type" />
  <attr name="quality" type="int">0</attr>
</type>

<type name="bladed_type">
  <inherit name="weapon_type" />
  // swords (most of them), axes, daggers, knives, shield, etc
  <attr name="damage_modifier_string_attribute" type="string">armored</attr>
  <attr name="damage_modifier_integer_attribute" type="int">-50</attr> // actually, we need to work with decimals (Double Atributes), as this is to be 'half damage' (bladed is weak vs armored)
</type>

<type name="blunted_type">
  <inherit name="weapon_type" />
  // maces, hammers, clubs, whips, scepters, staffs, spears (the staff part), rods, wands, shield, etc
</type>

<type name="pointed_type">
  <inherit name="weapon_type" />
  // projectiles: bows, crossbows, guns/firearms (ignoring bluntness of musket ball, as the speed still makes it very piercing), Throwing (most), spear (point end), etc
</type>

<type name="two_handed_type">
  <attr name="slot_stringlist_attribute" type="simplestringlist">left_hand; right_hand</attr>
</type>

<type name="one_handed_type">
  // more complex coding/scripting is needed to handle being able to do: 'left_hand' or 'right_hand', slots
</type>

<type name="right_handed_type">
  <attr name="slot_stringlist_attribute" type="simplestringlist">right_hand</attr>
</type>

<type name="left_handed_type">
  <attr name="slot_stringlist_attribute" type="simplestringlist">left_hand</attr>
</type>

<type name="sword_type">
  <inherit name="bladed_type" />
</type>

<type name="axe_type">
  <inherit name="bladed_type" />
  <attr name="damage_modifier_string_attribute" type="string">demonic</attr> // if you want multiple damage modifiers, than make this be a Stringlist Attribute
  <attr name="damage_modifier_integer_attribute" type="int">200</attr> // actually we can combine these two damage modifiers (string and int) by using a Dictionary Attribute...
</type>

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

I think you probably get the idea... a lot above is very incomplete without finishing the showing of the layers and layers of Object Types.... as I'm still game-designing this type of stuff myself for my rpg I'm... slowly working on.... lol

ask me if you got any questions or need help with anything


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

Support

Forums