Hi Mapster, I'm currently doing a map and I need help for creating a building that will Heal nearby units within range. But only when those units are in ''this Region'' for an elapsed time.
Trigger event: Periodic event (however often you want the healing to happen)
Actions:
Pick each unit in region and do actions
actions: set (picked unit) life to 100% (or you could add 10% every couple of seconds, if you want it to go slower)
Oh, do you want the unit to have to stay in the region for X seconds before being healed? That's a bit more complicated.
Event: Unit enters region
Local Variable: Healing Unit (unit) == Triggering Unit
Actions:
Wait X seconds
If (Healing Unit is in region == True)
Then
Set Healing Unit life to 100%
The If/Then checks to see if the unit is still in the region after X seconds, and if so then it heals it.
There are a couple problems with it, which I'm not sure how to solve (I don't have my editor with me at the moment).
One is that if you go into the region, then leave, and then back in again within X seconds, then the healing will still apply.
The other is I don't know how it would react if several units enter the region together, it might only heal the last unit that entered. I don't know without testing.
Hi Mapster, I'm currently doing a map and I need help for creating a building that will Heal nearby units within range. But only when those units are in ''this Region'' for an elapsed time.
Thx
Trigger event: Periodic event (however often you want the healing to happen)
Actions:
Pick each unit in region and do actions
actions: set (picked unit) life to 100% (or you could add 10% every couple of seconds, if you want it to go slower)
And for the time ?
Oh, do you want the unit to have to stay in the region for X seconds before being healed? That's a bit more complicated.
Event: Unit enters region
Local Variable: Healing Unit (unit) == Triggering Unit
Actions:
Wait X seconds
If (Healing Unit is in region == True)
Then
Set Healing Unit life to 100%
The If/Then checks to see if the unit is still in the region after X seconds, and if so then it heals it.
There are a couple problems with it, which I'm not sure how to solve (I don't have my editor with me at the moment).
One is that if you go into the region, then leave, and then back in again within X seconds, then the healing will still apply.
The other is I don't know how it would react if several units enter the region together, it might only heal the last unit that entered. I don't know without testing.
Anyway, it's a place to start.
Thank you! I'll try !