Chain Frost Spell Problem

Igor_Z

You can change this now in User CP.
Reaction score
61
I got a problem with the triggers for the Chain Frost spell. Can you tell me what is wrong with them. When my hero casts the spell it instantly kills the Bouncing Glaive which means there is something wrong with the second if/then/else action in my second trigger. Thank you for your time

Triggers:

Trigger:
  • Bouncing Glaive Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bouncing Glaive
    • Actions
      • -------- set up variables --------
      • Set BG_Caster = (Triggering unit)
      • Set BG_Target = (Target unit of ability being cast)
      • Set BG_Speed = 50.00
      • Set BG_Level = (Level of Bouncing Glaive for BG_Caster)
      • Set BG_Loc = (Position of BG_Caster)
      • Set BG_Max_Jumps = (3 + BG_Level)
      • -------- creating dummy --------
      • Unit - Create 1 Bouncing Glaive for (Owner of BG_Caster) at BG_Loc facing (Facing of BG_Caster) degrees
      • Set BG_Glaive = (Last created unit)
      • -------- add dummy ability to dummy --------
      • Unit - Add Bouncing Glaive (Dummy Cast) to BG_Glaive
      • Unit - Set level of Bouncing Glaive (Dummy Cast) for BG_Glaive to BG_Level
      • -------- set fly height --------
      • Unit - Add Crow Form to BG_Glaive
      • Unit - Remove Crow Form from BG_Glaive
      • Animation - Change BG_Glaive flying height to 60.00 at 0.00
      • Custom script: call RemoveLocation(udg_BG_Loc)
      • Trigger - Turn on Bouncing Glaive Timed <gen>


Trigger:
  • Bouncing Glaive Timed
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set BG_Loc = (Position of BG_Glaive)
      • Set BG_Loc2 = (Position of BG_Target)
      • Set BG_Real = (Distance between BG_Loc and BG_Loc2)
      • -------- check the distance betwen target and dummy --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BG_Real Less than or equal to 50.00
        • Then - Actions
          • -------- check some condition: target is alive, not immune and visible => order dummy to cast FrostNova onto it. --------
          • -------- or if your dummy's cast isn't fast enough and you got bug, create another dummy to cast the Frost Nova instead --------
          • Unit - Create 1 Bouncing Glaive Dummy for (Owner of BG_Caster) at BG_Loc2 facing (Facing of BG_Caster) degrees
          • Set BG_Dummy2 = (Last created unit)
          • Unit - Add a 1.00 second Generic expiration timer to BG_Dummy2
          • Unit - Add Bouncing Glaive (Dummy Cast) to BG_Dummy2
          • Unit - Set level of Bouncing Glaive (Dummy Cast) for BG_Dummy2 to (Level of Bouncing Glaive (Dummy Cast) for BG_Glaive)
          • Unit - Order BG_Dummy2 to Undead Lich - Frost Nova BG_Target
          • -------- pick a new target --------
          • Set BG_Group = (Units within 600.00 of BG_Loc2 matching (((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Magic Immune) Equal to False)) and (((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to BG_Target)) and ((((Matchin
          • Set BG_Target = (Random unit from BG_Group)
          • Unit Group - Add BG_Target to BG_Affected
          • Set BG_Num_of_Units = (Number of units in BG_Group)
          • -------- decrease the number of jump --------
          • Set BG_Max_Jumps = (BG_Max_Jumps - 1)
          • Custom script: call DestroyGroup(udg_BG_Group)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_BG_Loc2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • BG_Max_Jumps Equal to 0
              • BG_Target Equal to No unit
              • BG_Num_of_Units Equal to 0
        • Then - Actions
          • -------- stop ! --------
          • Custom script: call RemoveLocation(udg_BG_Loc)
          • Unit - Kill BG_Glaive
          • Unit Group - Remove all units from BG_Affected
          • Trigger - Turn off (This trigger)
          • Skip remaining actions
        • Else - Actions
      • -------- move the dummy towards the target --------
      • Set BG_Loc2 = (Position of BG_Target)
      • Set BG_Real = (Angle from BG_Loc to BG_Loc2)
      • Custom script: call RemoveLocation(udg_BG_Loc2)
      • Set BG_Loc2 = (BG_Loc offset by BG_Speed towards BG_Real degrees)
      • Unit - Move BG_Glaive instantly to BG_Loc2, facing BG_Real degrees
      • Custom script: call RemoveLocation(udg_BG_Loc)
      • Custom script: call RemoveLocation(udg_BG_Loc2)
      • -------- if there is no target left or the number of jump has reached 0 --------
 

feelingparty

New Member
Reaction score
3
The problem might come from the fact that you're using globals and they could get overwritten. I read the triggers trough and didn't find anything unlogical. Why don't you try storing the values which you take from trigger to trigger in a hashtable?
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Nevermind the hashtables. Don't want MUI, don't need MUI. I can't figure out a way to fix this
 

Bogrim

y hello thar
Reaction score
154
There may be something wrong with the conditions in the set unit group action, but I can't tell because you cut out some of the conditions. Use in-game text to display the values of the variables in your "or" conditions and see which variable isn't getting the right value, then fix it.

Edit: I think I see the problem. You don't add the target unit to the unit group you use to check which targets are in range, so the unit group starts out at 0. If the initial casting distance is greater than 50, then the trigger will not attempt to find any available targets either. With other words, "BG_Num_of_Units" is most likely always 0 and therefore your dummy unit is killed instantaneously. That's just a guess though.
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Yeah. You got a point there. That is true. When I remove the BG_Num_of_Units variable the spell works perfectly(but hits same units also) but I want the trigger to check whether there are targets that haven't been hit... It's not that much of a problem but I want the spell to run like that. What do you suggest me to do? I wanna fix this as soon as possible. I'll play with the trigger a bit and see if I can make it work
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top