I have created a region on a map and wish to have the units heal at the rate of 5hp/sec (or until fully healed) while in that region. How do I go about doing this?
I would do this by first creating a simple behavior that gives bonus life regeneration by 5.
To create the Behavior: 1. Open DataModule 2. Create Behavior Tab (or just go to it) 3. Right click to Add Behavior. You are free to name it whatever, but we'll call it "Heal Buff". 4. Set the Behavior Type to Buff
5. Go to the Modification field, then go to either the Unit or Behavior sub-tab (i forgot which one has the array labeled "Vital Bonus Regeneration Scaled". For this, you want to set the Life value to 5 (This will set the life regeneration bonus to 5). 6. You've created the ability. Now onto the Triggers part of this.
To create the trigger where you want units to heal at a certain rate on the map, you need to do this: 1. Create 2 Triggers, 1 for Entering, and 1 for Leaving, you can name them something like "Heal Region Enter" and "Heal Region Exit" respectively. For simplicity sake, I will refer to them as such in the rest of this tutorial. 2. For both the "Heal Region Enter" and "Heal Region Exit" triggers, add an event "Unit Enters/Leave Region". 3. Set the region to the region that you created on the map. It would be under the Value "sub-tab" thing when you click on the thing at the bottom, but it should automatically default to the sub-tab when you open it up. 4. Next, add a Action to the "Heal Region Enter" trigger called "Add Behavior" 5. Set the Unit value to Triggering Unit for the "Add Behavior" action, you can find that in the Function "sub-tab" 6. Set the Behavior to the "Heal Buff" behavior that we made. 7. For the other Unit Value, you can just set that to Triggering Unit as well, it doesn't necessarily matter where we're going, but it only matters in special cases. This is not one of them.
Next, we can move onto the "Heal Region Exit" trigger. 9. Add a action to the "Heal Region Exit" trigger called "Remove Behavior" 10. Set the Unit value to Triggering Unit for the "Remove Behavior" action, you can find that in the Function "sub-tab" 11. Like the other trigger, Set the Behavior to the "Heal Buff" behavior that we made.
You can also add conditions to ensure that only some Player's units can trigger this or some certain types of units can, but it doesn't seem like you'll be needing this. I'm not that active on SC2Mapster forums, so I can't promise a lightning fast response if you do need clarification.
However, it should work now. Other mapmakers might come along and chastise me for making such a crude trigger, but I think it's fairly simple to follow this tutorial along. Cheers and good luck o/
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Greetings,
I have created a region on a map and wish to have the units heal at the rate of 5hp/sec (or until fully healed) while in that region. How do I go about doing this?
I would do this by first creating a simple behavior that gives bonus life regeneration by 5.
To create the Behavior:
1. Open Data Module
2. Create Behavior Tab (or just go to it)
3. Right click to Add Behavior. You are free to name it whatever, but we'll call it "Heal Buff".
4. Set the Behavior Type to Buff
5. Go to the Modification field, then go to either the Unit or Behavior sub-tab (i forgot which one has the array labeled "Vital Bonus Regeneration Scaled". For this, you want to set the Life value to 5 (This will set the life regeneration bonus to 5).
6. You've created the ability. Now onto the Triggers part of this.
To create the trigger where you want units to heal at a certain rate on the map, you need to do this:
1. Create 2 Triggers, 1 for Entering, and 1 for Leaving, you can name them something like "Heal Region Enter" and "Heal Region Exit" respectively. For simplicity sake, I will refer to them as such in the rest of this tutorial.
2. For both the "Heal Region Enter" and "Heal Region Exit" triggers, add an event "Unit Enters/Leave Region".
3. Set the region to the region that you created on the map. It would be under the Value "sub-tab" thing when you click on the thing at the bottom, but it should automatically default to the sub-tab when you open it up.
4. Next, add a Action to the "Heal Region Enter" trigger called "Add Behavior"
5. Set the Unit value to Triggering Unit for the "Add Behavior" action, you can find that in the Function "sub-tab"
6. Set the Behavior to the "Heal Buff" behavior that we made.
7. For the other Unit Value, you can just set that to Triggering Unit as well, it doesn't necessarily matter where we're going, but it only matters in special cases. This is not one of them.
Next, we can move onto the "Heal Region Exit" trigger.
9. Add a action to the "Heal Region Exit" trigger called "Remove Behavior"
10. Set the Unit value to Triggering Unit for the "Remove Behavior" action, you can find that in the Function "sub-tab"
11. Like the other trigger, Set the Behavior to the "Heal Buff" behavior that we made.
You can also add conditions to ensure that only some Player's units can trigger this or some certain types of units can, but it doesn't seem like you'll be needing this. I'm not that active on SC2Mapster forums, so I can't promise a lightning fast response if you do need clarification.
However, it should work now. Other mapmakers might come along and chastise me for making such a crude trigger, but I think it's fairly simple to follow this tutorial along. Cheers and good luck o/