Page 1 of 1

Upgrades With Different Effects for Different Units

Posted: Sun Apr 19, 2015 4:45 am
by PerseusSpartacus
Just looking at the code for Aleona's Tales, I haven't found any instances of a single upgrade/research effecting multiple units in different ways.

So, for example, suppose I wanted a single upgrade that did two things: A) it gave Castles extra Hitpoints; and B) it made Swordsmen deal more damage. How would I get that to work?

I imagine this sort of thing must be possible, considering that a few instances of it can be seen in StarCraft and, presumably, Stargus (for instance, researching vehicle weapons as a Terran adds maybe +2 damage for a Goliath, but then adds +5 or something like that for a Tank in Siege Mode).

Thank you in advance.

Vale,
Perseus

Re: Upgrades With Different Effects for Different Units

Posted: Wed Apr 22, 2015 3:11 am
by Andrettin
Yes, this is possible. You just have to define two different modifiers (an upgrade can have as many modifiers as you want).

Here's an example of how something like that would look like:

Code: Select all

DefineModifier("upgrade-teuton-iron-shield",
	{"Armor", 2},
	{"apply-to", "unit-teuton-swordsman"}
)

DefineModifier("upgrade-teuton-iron-shield",
	{"Armor", 1},
	{"apply-to", "unit-teuton-spearman"}
)