- Joined
- Jan 12, 2011
- Messages
- 1,523
So i need a trigger to make a unit regenerate 2 hp per second in water when the player researched an ability. x.x
|
I did not know that this existed: (Terrain pathing at Point of type Floatability is off) Equal to False
Let me make a simpler trigger that is worthy of pleasing Spartipilo.
This works:
- Heal Upgrade
- Events
- Unit - A unit Finishes research
- Conditions
- (Researched tech-type) Equal to Naga Siren Adept Training
- Actions
- Unit Group - Pick every unit in (Units owned by (Owner of (Researching unit)) of type Naga Siren) and do (Actions)
- Loop - Actions
- Unit Group - Add (Picked unit) to UnitsThatHealInWater
- Set HealsInWater[(Player number of (Owner of (Researching unit)))] = True
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Execution count of (This trigger)) Greater than or equal to 1
- Then - Actions
- Trigger - Turn on Heal In Water <gen>
- Else - Actions
- Add Units
- Events
- Unit - A unit enters (Playable map area)
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- HealsInWater[(Player number of (Owner of (Triggering unit)))] Equal to True
- Then - Actions
- Unit Group - Add (Triggering unit) to UnitsThatHealInWater
- Else - Actions
I have Heal In Water off at first so the game goes a little faster until someone researches Nada Siren Adept Training. Also, this probably goes much much faster than my past trigger. Enjoy!
- Heal In Water
- Events
- Time - Every 0.50 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in UnitsThatHealInWater and do (Actions)
- Loop - Actions
- Set Point = (Position of (Picked unit))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Terrain pathing at Point of type Floatability is off) Equal to False
- Then - Actions
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 1.00)
- Else - Actions
1. Pick Every Unit of Type LEAKS. Instead Pick Every Unit and do "If Unit Type of Picked Unit = xxx, then..."
2. (Owner of (Researching unit)) is used twice. Store it into a variable in the trigger beginning, and use the variable instead.
3. After " Trigger - Turn on Heal In Water <gen>" use "Custom script: call DestroyTrigger(GetTriggeringTrigger())or "DestroyTrigger(gg_trg_Heal Upgrade)"
4. In "Add Units" trigger you have to filter the unit type, since you only heal Naga types.
5. "Heal In Water" trigger Leaks position: Also repeats several times the "Picked Unit", Set Picked Unit to a variable and use the variable instead. Also I would prefer adding a Life Regeneration ability rather than triggering the life modification
set u = Picked Unit
set L = Life Of u
Unit - set life of u = L + 1
Custom Script: set bj_wantDestroyGroup = true
.1. Pick Every Unit of Type LEAKS. Instead Pick Every Unit and do "If Unit Type of Picked Unit = xxx, then..."
2. (Owner of (Researching unit)) is used twice. Store it into a variable in the trigger beginning, and use the variable instead.
3. After " Trigger - Turn on Heal In Water <gen>" use "Custom script: call DestroyTrigger(GetTriggeringTrigger())or "DestroyTrigger(gg_trg_Heal Upgrade)"
4. In "Add Units" trigger you have to filter the unit type, since you only heal Naga types.
5. "Heal In Water" trigger Leaks position: Also repeats several times the "Picked Unit", Set Picked Unit to a variable and use the variable instead. Also I would prefer adding a Life Regeneration ability rather than triggering the life modification
set u = Picked Unit
set L = Life Of u
Unit - set life of u = L + 1
Actually, you just have to Copy/Paste and maybe edit two or three global values
This MUST NOT BE DONE: Custom script: call DestroyGroup(udg_unitsthathealinwater). You need that group.
Then just filter the units with the ability instead of the unit type.