Hello people, my building has a behavior (Buff) that triggers an effect (Modify Player) every X seconds, giving the player Y minerals. But what I want is that the amount of minerals received is based on the amount of energy the building has. Example: Building has 3 energy and I want to receive 2 minerals for every energy I would get 6 minerals.
Hmm could be tricky with data, quite easy with a trigger.
For data I would try a buff that adds the minerals for each energy and places a stacking buff on the building that restores the energy that was used to generate minerals.
Not sure it it works tho, might have a lot of bugs due to timings....
How I would do it is to have the periodic effect go to a Create Persistent effect that has a validator to remove it when the caster has 0 energy and to use the max energy cap number of periods. The periods are set to 0 (instant) and perform a Set effect containing a Set effect with a Modify Player effect giving you 2 minerals and a Modify Unit effect that uses Effect - Vitals - Change for -1 energy. The other effect in the first set is a Create Persistent that acts as a delay (look at the colossus weapon one for inspiration) which after the delay refunds 1 energy via a Modify Unit effect.
In short your unit will periodically chew all its energy giving you 2x in minerals and then near instantly be refunded the missing energy.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Hello people, my building has a behavior (Buff) that triggers an effect (Modify Player) every X seconds, giving the player Y minerals. But what I want is that the amount of minerals received is based on the amount of energy the building has. Example: Building has 3 energy and I want to receive 2 minerals for every energy I would get 6 minerals.
Anyone knows how to do this?
Hmm could be tricky with data, quite easy with a trigger.
For data I would try a buff that adds the minerals for each energy and places a stacking buff on the building that restores the energy that was used to generate minerals.
Not sure it it works tho, might have a lot of bugs due to timings....
How I would do it is to have the periodic effect go to a Create Persistent effect that has a validator to remove it when the caster has 0 energy and to use the max energy cap number of periods. The periods are set to 0 (instant) and perform a Set effect containing a Set effect with a Modify Player effect giving you 2 minerals and a Modify Unit effect that uses Effect - Vitals - Change for -1 energy. The other effect in the first set is a Create Persistent that acts as a delay (look at the colossus weapon one for inspiration) which after the delay refunds 1 energy via a Modify Unit effect.
In short your unit will periodically chew all its energy giving you 2x in minerals and then near instantly be refunded the missing energy.
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