PDA

View Full Version : Creating new conditions



graphil
January 10th, 2013, 20:10
In 35e there are a load of stock conditions. Is there a way to create your own ones? For example creating haste as a condition so it is a key word with all the underlying effects rather than having them listed out individually?

Trenloe
January 10th, 2013, 20:28
This can be done - but it requires changes to the underlying ruleset code as the modifiers are coded there.

Places to look:
\scripts\data_common.lua the "conditions = {" section defines the condition names.

Then the various manager scripts perform the required modifiers for the stated condition name.

For example, "fatigued" is coded in scripts\manager_action_skill.lua:

elseif EffectsManager.hasEffectCondition(rSource, "Fatigued") then
if sActionStat == "strength" or sActionStat == "dexterity" then
bEffects = true;
nAddMod = nAddMod - 1;
end
and scripts\manager_actor.lua:

if sAbility == "dexterity" or sAbility == "strength" then
if EffectsManager.hasEffectCondition(rActor, "Exhausted") then
nEffectMod = nEffectMod - 6;
nAbilityEffects = nAbilityEffects + 1;
elseif EffectsManager.hasEffectCondition(rActor, "Fatigued") then
nEffectMod = nEffectMod - 2;
nAbilityEffects = nAbilityEffects + 1;
end
end

So, there is not a high-level, non coding way to do what you're asking. The above should give a better understanding of how condition labels map through to the actual modifiers and so give an idea what is possible and perhaps provide some pointers if someone wants to code an extension with some commonly used conditions/effects keywords.

Trenloe
January 10th, 2013, 20:36
A better example would actually be "sickened" as this impacts 5 scripts due to the 5 different modifiers: ATK: -2; DMG: -2; SAVE: -2; SKILL: -2; ABIL: -2

scripts\manager_action_attack.lua
scripts\manager_action_damage.lua
scripts\manager_action_spell.lua
scripts\manager_action_skill.lua
scripts\manager_action_ability.lua

One script for each type of effect.