• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Chain spell not working as it should

Status
Not open for further replies.
Level 2
Joined
Jun 8, 2009
Messages
6
(For u dudes and chicks (if ther is any1) this trigger will cast chain heal on ur target and then target the one who have the lowest hp using %)
My "chain heal" spell dosent work as it should and dont know why sometimes it heals 3 as it should and sometimes it heals the 1 and 3 target but it allways heals the 1 target. Pleas dont tell me to use "healing wave" becouse i want to use a trigger that activates when they are targeted by the spell the dummy target cast so i can use other variables on the heal that will change under the game.Oh yeah and the dummy target allwasy spawn at the right place for me but dont cast the spell. (have reamoved all the leaks on my own trigger ,(they i know about so if u see any leak in the image plz tell me)).(the healing way used in trigger are a one target heal). I whould be happy if u write something if u have read this thread so i know if i can w8 for awnser or put this spell / trigger in the garbage.
my trigger.jpg

Chain heal
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Chain Heal
Actions
Set CH_prev = (Triggering unit)
Set CH_targ = (Target unit of ability being cast)
Set CH_point = (Position of CH_prev)
Set CH_tp = (Position of CH_targ)
Unit Group - Add CH_targ to Chain_heal
Unit - Create 1 CH for Player 1 (Red) at CH_point facing CH_tp
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Add Healing Wave to (Last created unit)
Unit - Set level of Healing Wave for (Last created unit) to 1
Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave CH_targ
Custom script: call RemoveLocation(udg_CH_point)
Custom script: call RemoveLocation(udg_CH_tp)
Wait 0.30 seconds
Set CH_prev = CH_targ
Set CH_point = (Position of CH_prev)
Set CH_grp = (Units within CH_range of CH_point matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is in Chain_heal) Not equal to True)))
Set CH_lowHP = (Random unit from CH_grp)
Set CH_lowHProt = (Percentage life of CH_lowHP)
Unit Group - Pick every unit in CH_grp and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Picked unit)) Less than CH_lowHProt
Then - Actions
Set CH_lowHP = (Picked unit)
Set CH_lowHProt = (Percentage life of CH_lowHP)
Else - Actions
Do nothing
Set CH_targ = CH_lowHP
Set CH_tp = (Position of CH_targ)
Unit - Create 1 CH for Player 1 (Red) at CH_point facing CH_tp
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Add Healing Wave to (Last created unit)
Unit - Set level of Healing Wave for (Last created unit) to 1
Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave CH_targ
Unit Group - Add CH_targ to Chain_heal
Set CH_lowHProt = 100.00
Custom script: call RemoveLocation(udg_CH_tp)
Custom script: call RemoveLocation(udg_CH_point)
Custom script: call DestroyGroup(udg_CH_grp)
Wait 0.30 seconds
Set CH_prev = CH_targ
Set CH_point = (Position of CH_prev)
Set CH_grp = (Units within CH_range of CH_point matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is in Chain_heal) Not equal to True)))
Set CH_lowHP = (Random unit from CH_grp)
Set CH_lowHProt = (Percentage life of CH_lowHP)
Unit Group - Pick every unit in CH_grp and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is in Chain_heal) Not equal to True
(Percentage life of (Picked unit)) Less than CH_lowHProt
Then - Actions
Set CH_lowHP = (Picked unit)
Set CH_lowHProt = (Percentage life of CH_lowHP)
Else - Actions
Do nothing
Set CH_targ = CH_lowHP
Set CH_tp = (Position of CH_targ)
Unit Group - Add CH_targ to Chain_heal
Unit - Create 1 CH for Player 1 (Red) at CH_point facing CH_tp
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Add Healing Wave to (Last created unit)
Unit - Set level of Healing Wave for (Last created unit) to 1
Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave CH_targ
Unit Group - Remove all units from Chain_heal
Set CH_lowHProt = 100.00
Custom script: call RemoveLocation(udg_CH_tp)
Custom script: call RemoveLocation(udg_CH_point)
Custom script: call DestroyGroup(udg_CH_grp)
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Chain Heal
  • Actions
  • Set CH_prev = (Triggering unit)
  • Set CH_targ = (Target unit of ability being cast)
  • Set CH_point = (Position of CH_prev)
  • Set CH_tp = (Position of CH_targ)
  • Unit Group - Add CH_targ to Chain_heal
  • Unit - Create 1 CH for Player 1 (Red) at CH_point facing CH_tp
  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
  • Unit - Add Healing Wave to (Last created unit)
  • Unit - Set level of Healing Wave for (Last created unit) to 1
  • Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave CH_targ
  • Custom script: call RemoveLocation(udg_CH_point)
  • Custom script: call RemoveLocation(udg_CH_tp)
  • Wait 0.30 seconds
  • Set CH_prev = CH_targ
  • Set CH_point = (Position of CH_prev)
  • Set CH_grp = (Units within CH_range of CH_point matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is in Chain_heal) Not equal to True)))
  • Set CH_lowHP = (Random unit from CH_grp)
  • Set CH_lowHProt = (Percentage life of CH_lowHP)
  • Unit Group - Pick every unit in CH_grp and do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Percentage life of (Picked unit)) Less than CH_lowHProt
  • Then - Actions
  • Set CH_lowHP = (Picked unit)
  • Set CH_lowHProt = (Percentage life of CH_lowHP)
  • Else - Actions
  • Do nothing
  • Set CH_targ = CH_lowHP
  • Set CH_tp = (Position of CH_targ)
  • Unit - Create 1 CH for Player 1 (Red) at CH_point facing CH_tp
  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
  • Unit - Add Healing Wave to (Last created unit)
  • Unit - Set level of Healing Wave for (Last created unit) to 1
  • Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave CH_targ
  • Unit Group - Add CH_targ to Chain_heal
  • Set CH_lowHProt = 100.00
  • Custom script: call RemoveLocation(udg_CH_tp)
  • Custom script: call RemoveLocation(udg_CH_point)
  • Custom script: call DestroyGroup(udg_CH_grp)
  • Wait 0.30 seconds
  • Set CH_prev = CH_targ
  • Set CH_point = (Position of CH_prev)
  • Set CH_grp = (Units within CH_range of CH_point matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is in Chain_heal) Not equal to True)))
  • Set CH_lowHP = (Random unit from CH_grp)
  • Set CH_lowHProt = (Percentage life of CH_lowHP)
  • Unit Group - Pick every unit in CH_grp and do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • ((Picked unit) is in Chain_heal) Not equal to True
  • (Percentage life of (Picked unit)) Less than CH_lowHProt
  • Then - Actions
  • Set CH_lowHP = (Picked unit)
  • Set CH_lowHProt = (Percentage life of CH_lowHP)
  • Else - Actions
  • Do nothing
  • Set CH_targ = CH_lowHP
  • Set CH_tp = (Position of CH_targ)
  • Unit Group - Add CH_targ to Chain_heal
  • Unit - Create 1 CH for Player 1 (Red) at CH_point facing CH_tp
  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
  • Unit - Add Healing Wave to (Last created unit)
  • Unit - Set level of Healing Wave for (Last created unit) to 1
  • Unit - Order (Last created unit) to Orc Shadow Hunter - Healing Wave CH_targ
  • Unit Group - Remove all units from Chain_heal
  • Set CH_lowHProt = 100.00
  • Custom script: call RemoveLocation(udg_CH_tp)
  • Custom script: call RemoveLocation(udg_CH_point)
  • Custom script: call DestroyGroup(udg_CH_grp)
i think people will see it better on this way...
 
Level 2
Joined
Jun 8, 2009
Messages
6
chain heal

I want it to cast (or if i must just set hp on my target, (already done that but want to have many variables like , a chane to crit on the heal and healing+ on the heal and for that i need to have a dummy cast a spell on the target or els i dont know how to do it in the trigger. and i dont know how make the special effect)). And after that I want it to target the one who have the leest health by % of total hp x2. (my dummies allways get spawnd by they dont cast the spell dont know why evrything els works as i can ses. ( cheacked by using so all the chain heal targets gets a text just saying CH_Targ and changed the dummis to the human footman just to se if they spawn and have the skill and se if thay cast the spell, and sometimes they do and sometimes they dont.

And yes i know i can do a loop and I had 1 from the beggining but dident know how the loop thing works so thought i could be something wrong in it so I just copied down all the thing i had in the loop.
 
Last edited:
Level 13
Joined
Mar 4, 2009
Messages
1,156
Your action i s working but on wrong unit as u said it works but sometimes
problem is probably in this unit group Random unit from CH_grp (you must be shure that there is only 1 unit in CH_grp and it will work always...(i hope im correct)
 
Level 2
Joined
Jun 8, 2009
Messages
6
sry dont think so becouse i know this always work (or i think so anyway used a set life of unit(ch_targ) and that works just fine):
Set CH_lowHP = (Random unit from CH_grp)
Set CH_lowHProt = (Percentage life of CH_lowHP)
Unit Group - Pick every unit in CH_grp and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Percentage life of (Picked unit)) Less than CH_lowHProt
Then - Actions
Set CH_lowHP = (Picked unit)
Set CH_lowHProt = (Percentage life of CH_lowHP)
Else - Actions
Do nothing
Set CH_targ = CH_lowHP

and becouse if it dont the dummis whouldent spawn on 3 diferent spots but they just dont cast the spell. (If all is standing in a griup nest to eachother it works but if they dont it is like 15% chance it will hit 3 targets, 35% to hit 2 and 50% chance it will only hit the first 1. but the wierd thing is that when it hits 2 targets it is the 1 and 3 dummy that cast the spell...
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
why do you have this Unit - Add Healing Wave to (Last created unit)
Unit - Set level of Healing Wave for (Last created unit) to 1

why adding ability in trigger and why setting it to 1 ...:hohum:.....

try to set CH_targ befor before waits and it should work (after more time wait the trigger cant work on generic units accept if you set them before waits)

  • Set CH_grp = (Units within CH_range of CH_point matching ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is in Chain_heal) Not equal to True)))
where is that CH_range ?

try this
set X [1] = casting unit
-unit starts effect of an ability
-ability being cast equal tp your ability
-create your unit
order him to cast the ability on the target
set POSITION = target of ability being cast
set X [2] = target of ability being cast
wait 0.3 sec
create your unit at POSITION
set unit group=unit within 300 range of POSITION matching (matching unit not equal to [X] 1 and matching unit not equal to [X] 2 and matching unit belongs to an all of player 1 red
order your unit to (heal) ...............
 
Level 2
Joined
Jun 8, 2009
Messages
6
why do you have this Unit - Add Healing Wave to (Last created unit)
Unit - Set level of Healing Wave for (Last created unit) to 1

where is that CH_range ?.
I have the add thing and set it to lvl1 becouse i use it as a dummy for a couple of skills.
CH_range is preset and i have trigger that will increas it. but i will try to make them chose a traget before the wait. And if that dont work i will break the trigger down in parts and make so i will get 2 triggers.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
I have the add thing and set it to lvl1 becouse i use it as a dummy for a couple of skills.
CH_range is preset and i have trigger that will increas it. but i will try to make them chose a traget before the wait. And if that dont work i will break the trigger down in parts and make so i will get 2 triggers.

You cant make them chose the target before waits but you can set the target in a variable before waits....maybe you could do it pausing units (as it says unit will continue his orders after unpause)
 
Status
Not open for further replies.
Top