Initiative Script

From HLKitWiki
Revision as of 01:00, 20 February 2009 by Rob (Talk | contribs) (Technical Details)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Context: HL KitKit Reference … Script Types 

Technical Details

Initial Context: Pick
Alternate Context: None
Fields Finalized? No
Where Used: Definition File
Procedure Use: None

The Initiative script utilizes the following special symbols:

initiative (Number) Entry: The previous initiative value for the actor or zero if not yet specified.

Exit: Calculated initiative value to use for the actor.

tiebreaker (Number) Entry: The previous tie-breaker value for the actor or zero if not yet specified.

Exit: Calculated tie-breaker initiative value to use for the actor.

Description

The Initiative script is used to generate appropriate initiative values for each actor. It is invoked whenever a new initiative value is needed, as determined by the configuration settings in the definition file. It is always invoked after any NewCombat or NewTurn script is invoked.

There are two separate initiative values that must be generated. The first is the standard initiative value used for the game system. Once it is calculated, it should be assigned to the "initiative" special symbol. The second initiative value is the tie-breaker to be used if the two actors have the exact same primary initiative score. For example, in the d20 System, the dexterity bonus is used as a tie-breaker. This value should be assigned to the "tiebreaker" special symbol.

When invoked, the Initiative script starts with the "actor" pick of an actor in the combat as its initial context. From there, you can access whatever facets of the character are necessary to properly calculate the initiative scores.

Example

In the d20 System, the initiative score is a d20 roll plus the initiative bonus, while the dexterity bonus is used as the tie-breaker. This yields a script that looks like the following.

~Initiative is a d20 roll (0 to 19 + 1) plus initiative bonus
@initiative = random(20) + 1 + hero.child[trInit].field[trtFinal].value
~Tie-breaker is the dexterity bonus
@tiebreaker = hero.child[attrDex].field[trtFinal].value