[solved]order of processed traits
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
[solved]order of processed traits
if i put two traits on a unit, one says
not_living=yes
the other
not_living=no
is that even possible?
what status will the unit finally have and what is responsible for that.
i guess whatever trait that is processed last, but how to influence which trait is processed last? Alphabetical order?
or will "not_living=yes" always override?
Background:
undead units are potencially better bc they are undrainable, unpoisionable etc.
i would simply add a trait which just set "undrainable=no", since being unpoisionable is advantage enough, and i my opinion you can also drain "power" from not living units so they get weaker. its just a matter how you define "drain" or what is actually being drained.
so question is if it is possible to just add a trait to every unit and be done with it or is more effort needed.
i already made a working solution for attacker hits /defnder hits that will drain undrainable units, or better heal the amount that drain would heal etc
but after all these workarounds wont go into the "prebattle calculations" which, as faulty they may be, are useful indicators nevertheless.
so every solution that would make these unuseable is bad. so i would need to adress the units directly.
and the simplest solution would be giving them all a trait
not_living=yes
the other
not_living=no
is that even possible?
what status will the unit finally have and what is responsible for that.
i guess whatever trait that is processed last, but how to influence which trait is processed last? Alphabetical order?
or will "not_living=yes" always override?
Background:
undead units are potencially better bc they are undrainable, unpoisionable etc.
i would simply add a trait which just set "undrainable=no", since being unpoisionable is advantage enough, and i my opinion you can also drain "power" from not living units so they get weaker. its just a matter how you define "drain" or what is actually being drained.
so question is if it is possible to just add a trait to every unit and be done with it or is more effort needed.
i already made a working solution for attacker hits /defnder hits that will drain undrainable units, or better heal the amount that drain would heal etc
but after all these workarounds wont go into the "prebattle calculations" which, as faulty they may be, are useful indicators nevertheless.
so every solution that would make these unuseable is bad. so i would need to adress the units directly.
and the simplest solution would be giving them all a trait
Last edited by Mabuse on July 31st, 2023, 5:40 am, edited 3 times in total.
The best bet is your own, good Taste.
Re: order of processed traits
They apply in the order that they are in array unit.modifications.trait. Either add them in suitable order, or manually sort them.
Re: order of processed traits
ok, so the last added counts.
fair enough
The best bet is your own, good Taste.
Re: order of processed traits
just for the books, adding a trait via [side][modifications] seeems to be applied before any [unit] stuff, so [unit] traits will override
either way, i was successful with adding [object] that modify unit status which seems also be more permanent since they will modify whatever happens later also
The best bet is your own, good Taste.