Author Topic: Effect XMLs  (Read 1838 times)

ChupaReaper

  • Guest
Effect XMLs
« on: 2 March 2012, 18:13:51 »
Rather than defining effects in unit xmls could there instead be effect xmls?
When an effect is applied to a skill, as well as defining a new effect for just that unit, effects can work by referencing an xml:
For example, this would be valid:
Code: [Select]
<effects>
<effect name="per_unit_blindness_effect" bias="detrimental" stacking="extend" duration="5">
<multipliers>
<sight value="0.5"/>
<attack-range value="0.5"/>
</multipliers>
<flags/>
</effect>
<effect xml= "../../../../effects/shared_blindness_effect.xml"/>
</effects>

The effect XML could look like this:
Code: [Select]
<effect>
<name value="shared_blindness_effect"/>
<bias value="detrimental"/>
<stacking value="extend"/>
<duration value="5"/>
<multipliers>
<sight value="0.5"/>
<attack-range value="0.5"/>
</multipliers>
<flags/>
</effect>

It would make using effects a lot tidier, and will allow multiple units to use the same effects, even cross-faction. The location of the xmls isn't really important either. Per unit xmls could be kept for effects that are to be entirely unique to that one unit and for backwards compatibility.

Another interesting idea would be to mix effects with upgrades, where upgrades can apply permanent duration effects to units (effects applied by upgrades shouldn't appear in the units stats like how normal effects do though, for example if a unit has increased health from an upgrade effect it would be shown as if they had their health increased by an upgrade essentially making upgrade effects 'invisible' like normal upgrades).

lazyanttu

  • Guest
Re: Effect XMLs
« Reply #1 on: 2 March 2012, 21:29:10 »
This would really be useful! There are 2 different cases where my mod would need it! Currently I have rounded the problem with some cumbersome solutions...

 

anything