Hi,
I have an effect that deals damage equal to 10% of units in an area's max hp. I'd like to drain resources equal to the damage dealt (multiplied by a factor).
I could do this in triggers easily enough, and I probably will have done already by the time someone replies, but it'd be nice to know if there's a way to do this with data?
drain resources equal to the damage dealt (multiplied by a factor)
Not really possible.
Well, it is possible..
But that would include that you create sets and validators for every vitality value the unit had before and every vitality value the unit had afterwards resulting in an effect. Basically you would branch out for each possible vitality value the unit had before, then deal damage effect and a set effect in each branch. That set effect would result in another branch for every possible vitality value.
In short: you create a graph/tree with every possible combination of outcomes and check each path, if it is the correct one.
That's a ton of data stuff just for 1 weapon (as this might result in thousands of entries for 1 weapon). This makes it possible with data, but it's just the worst solution you can imagine.
Yep, I kind of came to that conclusion. It's a shame really, that'd be a really nice data editor feature, though I can see why they didn't implement it because I'd have no idea how to either.
Seconded triggers have the on the fly adjustability. Best solutions always are data/trigger hybrids. Sadly few people recognise the potential eg. the archangel battle.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Hi, I have an effect that deals damage equal to 10% of units in an area's max hp. I'd like to drain resources equal to the damage dealt (multiplied by a factor). I could do this in triggers easily enough, and I probably will have done already by the time someone replies, but it'd be nice to know if there's a way to do this with data?
Cheers, Alex
Not really possible.
Well, it is possible..
But that would include that you create sets and validators for every vitality value the unit had before and every vitality value the unit had afterwards resulting in an effect. Basically you would branch out for each possible vitality value the unit had before, then deal damage effect and a set effect in each branch. That set effect would result in another branch for every possible vitality value.
In short: you create a graph/tree with every possible combination of outcomes and check each path, if it is the correct one.
That's a ton of data stuff just for 1 weapon (as this might result in thousands of entries for 1 weapon). This makes it possible with data, but it's just the worst solution you can imagine.
-> Use triggers.
Yep, I kind of came to that conclusion. It's a shame really, that'd be a really nice data editor feature, though I can see why they didn't implement it because I'd have no idea how to either.
Cheers. I did use triggers :)
Seconded triggers have the on the fly adjustability. Best solutions always are data/trigger hybrids. Sadly few people recognise the potential eg. the archangel battle.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg