Trait System (Passive, Active, Conditional)

Any documentation, tutorials, tips and tricks, or examples on how to use the IB2 Toolset

Trait System (Passive, Active, Conditional)

Postby youngneil1 » Mon Apr 10, 2017 4:40 pm

The trait system has gotten some new functionalities with IB2 Beta v22+. It allows an author to make use of the flexible effect system, tying it in as building stone (like spells do already).

Please note that a trait can be active and passive at the same time. Also you can assign as many passive effects to a single trait as you like (but only one active spell on top).

1. Active traits:
Active traits work in many ways like spells, allowing non-casters to have more options in battle (and - if designed for - on adventure map, too). The player gets a new button in the ingame interface for directly using them (in battle or outside).

1) In order to make an active trait you first have to enter an associatedSpellTag (entering it manually), replacing the standard value of "none".

2) To determine when your active trait can be used you can use the useableInSituation property. It accepts three values:

Always: Always marks an active trait that can be used in and outside combat.

InCombat: InCombat marks an active trait that can be used only in combat.

OutOfCombat: OutOfCombat marks an active trait that can be used only outside combat.

Please note that spells also have an useableInSituation property. The spell's useableInSituation property is not used though for traits that just refer to an associated spell. In other words: the useableInSituation property of a trait takes precedence over the same named property of an associated spell.

2. Passive traits:
Passive traits work all the time for a player who has them (unless conditional and condition is not met, see below). In other words: they do not have to be used, they are just applied automatically.

In the traitEffectTagList you can set all effects that shall be applied due to the passive trait.

3. Conditionals for traits (active, passive):
All traits can be set to require certain conditions (for passive traits to get applied, for active traits to appear as usable in the trait use selector menu).

There are two different lists with conditions:

traitWorksOnlyWhen: You can list keywords here that have to appear in a player character's pcTags list in order to make the trait work. They are connected with a logical "or", meaning that one of them is enough to make the trait work. When you equip an item, any entry in the item's entriesForPcTags is automatically written into the equipping player character's pcTags list (and removed again when unequipping the item). Another way to access a player charcater's pcTags list would be by custom made ibscript (yet todo to cerate such a script).

traitWorksNeverWhen: Basically the same as traitWorksOnlyWhen, but any matching entry in a player character's pcTags list stops a trait from working. This overrides the enabling entries in traitWorksOnlyWhen. Again, all entries here are connected via a logical "or".

4. Skill roll modifiers: Trait tag conventions and ranks
The code expects a certain structure for the tag of a trait that shall modify a skill roll: it is tag+number for rank, like sneak7. Please note that the rank can only be single digit (0 to 9). Only the highest rank of a known trait is used. Please also note that rank is not the modifier for the skill roll (there's a separate property for that) but just used to recognize lower rank from higher rank traits. The tag without digit is also used for eg automatic item descriptions, so it ideally is something nciely readable.
User avatar
youngneil1
Backer
Backer
 
Posts: 4475
Joined: Sat Dec 08, 2012 7:51 am

Re: Trait System (Passive, Active, Conditional)

Postby youngneil1 » Thu Apr 13, 2017 4:11 pm

Done :) .
User avatar
youngneil1
Backer
Backer
 
Posts: 4475
Joined: Sat Dec 08, 2012 7:51 am

Re: Trait System (Passive, Active, Conditional)

Postby youngneil1 » Tue Jan 02, 2018 8:31 am

Expanded above tutorial by short section for "Skill roll modifiers: Trait tag conventions and ranks".
User avatar
youngneil1
Backer
Backer
 
Posts: 4475
Joined: Sat Dec 08, 2012 7:51 am


Return to Users Guide and Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest