I didn't know where to put this, in triggers or data, so I put it here. Sorry D:
Is it possible to refund a building's cost if its killed during construction? If so, how do I go about doing that?
I know the "is unit under construction" condition doesnt work on dead units, so I can't use that here.
Make an effect:
any effect that will be picked up by a 'unit uses effect' event (i used a create persistant)
Make a behaviour:
with a Removal Validator - Is Constructing
duration - 0
Make the Effect - Final to the above created effect
Make a trigger
event - unit uses effect
condition - unit is alive == false
action - increases *resource* of owning player by *resource* cost of unit type of triggering effect unit
Or you could have just given it a buff with a death response that uses a Modify Player effect and is removed when construction is completed. This is presuming you have not enabled the flag that disabled behaviours while under construction.
can the Modify Player effect refund a percent of the buffed unit? cause I don't wanna create a seperate effect for each building that needs to be refunded
I didn't know where to put this, in triggers or data, so I put it here. Sorry D:
Is it possible to refund a building's cost if its killed during construction? If so, how do I go about doing that? I know the "is unit under construction" condition doesnt work on dead units, so I can't use that here.
Help would be appriciated : )
Bump~
Figured it out (mix of data and triggers):
Make an effect:
any effect that will be picked up by a 'unit uses effect' event (i used a create persistant)
Make a behaviour:
with a Removal Validator - Is Constructing
duration - 0
Make the Effect - Final to the above created effect
Make a trigger
event - unit uses effect
condition - unit is alive == false
action - increases *resource* of owning player by *resource* cost of unit type of triggering effect unit
Or you could have just given it a buff with a death response that uses a Modify Player effect and is removed when construction is completed. This is presuming you have not enabled the flag that disabled behaviours while under construction.
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
can the Modify Player effect refund a percent of the buffed unit? cause I don't wanna create a seperate effect for each building that needs to be refunded
Nope but that is an alternative.
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