Spent the past 2-3 hours trying to get this to work.
It should be simple.When I leep a periodic event which adds +1 damage as a buff through behaviours the next action should be to increase unit scle by 1% of its' original size.
I'm having great difficulty with this.
I've tried using math function but it didn't work so now i'm trying to set a variable to the "picked unit" and to the value of the number of attack behaviors but it's all going horribly wrong.
My code is below, you can probably tell it does not work. I'm unsure how to add every unit that is "buffed" in the region to a variable array with the number of behaviors attached to it.
The closest i've come is that the set unit scale trigger read a variable which increased every 10 seconds, however this kept on increasing for all units. So on bringing a new unit to the region he was a giant immediately.
Events
Timer - Every 1.0 seconds of Real Time
Local Variables
Conditions
Actions
Unit Group - Pick each unit in (Any units in Bottom hill owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Variable - Set Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))] = Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]
Unit - Add 1 Central Health Behaviour to (Picked unit) from (Picked unit)
Unit - Add 1 Central Attack Behaviour to (Picked unit) from (Picked unit)
Unit - Set (Picked unit) scale to ((Abs(Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]))%, (Abs(Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]))%, (Abs(Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]))%) of its original size
There is a game online that does this, it is hell-td. Conveniently, he is a sc2maptser user, go to sc2mapster.com/maps/hell-td. download his map and look at what he did.
I also spent a fair bit of time trying to work with Actors and other things to increase scale on stack. Unfortunately it seems that there is no way to perform a multiplication or anything of the sort inside an Actor, so basically you have to SET the scale directly.
So, basically, for this, I created an array variable called playerScale[8] (default 1) and one called playerScaleRamp (default 0.05) and triggers for each of my upgrades, so when an upgrade is performed, it sets playerScale[(trpl)] = (playerScale[(trpl)] + playerScaleRamp). I then call another trigger, which does a pick-all-units in unit group, and sets the scale of the unit. This only gets performed each time an upgrade is done - so it isn't overly excessive.
Then basically for my spawning triggers I set the last created unit's scale to playerScale[(owner of unit)], which represents the stacked scale amount.
Spent the past 2-3 hours trying to get this to work.
It should be simple.When I leep a periodic event which adds +1 damage as a buff through behaviours the next action should be to increase unit scle by 1% of its' original size.
I'm having great difficulty with this.
I've tried using math function but it didn't work so now i'm trying to set a variable to the "picked unit" and to the value of the number of attack behaviors but it's all going horribly wrong.
My code is below, you can probably tell it does not work. I'm unsure how to add every unit that is "buffed" in the region to a variable array with the number of behaviors attached to it.
The closest i've come is that the set unit scale trigger read a variable which increased every 10 seconds, however this kept on increasing for all units. So on bringing a new unit to the region he was a giant immediately.
Events
Timer - Every 1.0 seconds of Real Time
Local Variables
Conditions
Actions
Unit Group - Pick each unit in (Any units in Bottom hill owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Variable - Set Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))] = Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]
Unit - Add 1 Central Health Behaviour to (Picked unit) from (Picked unit)
Unit - Add 1 Central Attack Behaviour to (Picked unit) from (Picked unit)
Unit - Set (Picked unit) scale to ((Abs(Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]))%, (Abs(Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]))%, (Abs(Unit scale[(Stack count of Central Attack Behaviour on (Picked unit))]))%) of its original size
I just need to read the number of attack buffs i have added to the units in that area(picked unit) and then add that to the scale of the unit.
I'm now using this, which should work but i'm getting an error in-game "invalid actor msg"
Actor - Send actor message (MultiplyScale 2.0 2.0 2.0 2.0) to all actors contained by game region Bottom hill
There is a game online that does this, it is hell-td. Conveniently, he is a sc2maptser user, go to sc2mapster.com/maps/hell-td. download his map and look at what he did.
@gorang: Go
Hi,
I also spent a fair bit of time trying to work with Actors and other things to increase scale on stack. Unfortunately it seems that there is no way to perform a multiplication or anything of the sort inside an Actor, so basically you have to SET the scale directly.
So, basically, for this, I created an array variable called playerScale[8] (default 1) and one called playerScaleRamp (default 0.05) and triggers for each of my upgrades, so when an upgrade is performed, it sets playerScale[(trpl)] = (playerScale[(trpl)] + playerScaleRamp). I then call another trigger, which does a pick-all-units in unit group, and sets the scale of the unit. This only gets performed each time an upgrade is done - so it isn't overly excessive.
Then basically for my spawning triggers I set the last created unit's scale to playerScale[(owner of unit)], which represents the stacked scale amount.
It's messy but it works well.
Moved to Triggers.