Upgrades With Different Effects for Different Units

PerseusSpartacus
Posts: 8
Joined: Tue Mar 10, 2015 4:11 pm

Upgrades With Different Effects for Different Units

Postby PerseusSpartacus » Sun Apr 19, 2015 4:45 am

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
User avatar
Andrettin
Posts: 433
Joined: Sun Jun 30, 2013 9:58 pm
Location: Vienna, Austria
Contact:

Re: Upgrades With Different Effects for Different Units

Postby Andrettin » Wed Apr 22, 2015 3:11 am

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"}
)

Who is online

Users browsing this forum: No registered users and 1 guest