• Tutorials

  • Home
  • AdjustInitiative

    At the start of each round of combat, just after the engine assigns initiatives to each combatant (determining what in order the combatants will have their chance to take some action), we call this hook for each combatant in the contest. We search the Special Abilities belonging the the 'Combatant', the 'Character', and the 'MonsterType', in that order. Initiatives take the form of an integer in the range for nine through eightteen (9 - 18). Combatants with lower numbers get to go first. Combatants with an initiative of 23 will be excluded from any combat action.

    Return Value:
    The script should return a number which will be added to the initiative. The default initiative can be found in Hook Parameter [5].

    Parameters

    Parameter [5] = initiative as determined by the engine. This value will always be in the range 9 through 18. The value of this parameter is set before running the first script for each combatant and the engine does not change it for that combatant. Normally this would not be changed by the scripts. But it can be changed and the final value of Hook Parameter [5] plus the value returned by the last script that is run will be used as the final value of the initiative for that combatant. The final value of the initiative will be limited to the range 1 through 23.
    Parameter[6] = the 'Morale' of the individual combatant.
    Parameter[7] = the 'Morale' of the combat as a whole as set by the designer in the Combat Editor.
    Parameter [0] = the result of the previous “Adjust Initiative” script that was run or to the empty string if it is the first script to run. So, several scripts can make adjustments by returning the value of Hook Parameter[0] plus or minus any additional adjustment. Or, of course, a script could ignore the results of previous scripts and return a value that will override all previous results.

    Context

    Combatant - $CombatantContext()