• 🏆 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!

2 very big problems!

Status
Not open for further replies.
Level 14
Joined
Aug 8, 2010
Messages
1,022
Hi! I want you to help me with my triggers. My triggers are for 2 units and different spells. The first 3 triggs. are for the first unit, the last three - for the second trigg. First unit&spell :
  • VariableSetTrigDF
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Deep Freeze
    • Actions
      • Set Caster = (Triggering unit)
      • Set Timer = 1.50
  • WhileCastingDF
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • (Ability being cast) Equal to Deep Freeze
    • Actions
      • Set TempPoint = ((Position of Caster) offset by 120.00 towards 180.00 degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Timer Greater than 0.00
        • Then - Actions
          • Floating Text - Create floating text that reads (|CFF1BE6D8Deep Freeze|R in + ((String(Timer)) + sec.)) at TempPoint with Z offset 240.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set FloatingText[0] = (Last created floating text)
          • Floating Text - Change FloatingText[0]: Disable permanence
          • Floating Text - Change the lifespan of FloatingText[0] to 0.25 seconds
          • Floating Text - Change the age of FloatingText[0] to 0.12 seconds
        • Else - Actions
      • Set Timer = (Timer - 0.10)
  • StoppedCastingDF
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Deep Freeze
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Timer Greater than 0.01
        • Then - Actions
          • Set Timer = 0.00
          • Floating Text - Destroy FloatingText[0]
          • Floating Text - Create floating text that reads Interrupted! at TempPoint with Z offset 240.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Set FloatingText[1] = (Last created floating text)
          • Floating Text - Set the velocity of FloatingText[1] to 64.00 towards 90.00 degrees
          • Wait 1.50 seconds
          • Floating Text - Destroy FloatingText[1]
        • Else - Actions
          • Set Timer = 0.00
          • Floating Text - Destroy FloatingText[0]
          • Floating Text - Create floating text that reads |CFF1BE6D8Deep Free... at TempPoint with Z offset 240.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Set FloatingText[1] = (Last created floating text)
          • Floating Text - Set the velocity of FloatingText[1] to 64.00 towards 90.00 degrees
          • Wait 1.50 seconds
          • Floating Text - Destroy FloatingText[1]
Second unit&spell :
  • VariableSetTrigWB
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Water Bolt
    • Actions
      • Set Caster = (Triggering unit)
      • Set Timer = 1.50
  • WhileCastingWB
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
      • (Ability being cast) Equal to Water Bolt
    • Actions
      • Set TempPoint = ((Position of Caster) offset by 120.00 towards 180.00 degrees)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Timer Greater than 0.00
        • Then - Actions
          • Floating Text - Create floating text that reads (|CFF1BE6D8Water Bolt|R in + ((String(Timer)) + sec.)) at TempPoint with Z offset 240.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Set FloatingText[0] = (Last created floating text)
          • Floating Text - Change FloatingText[0]: Disable permanence
          • Floating Text - Change the lifespan of FloatingText[0] to 0.14 seconds
          • Floating Text - Change the age of FloatingText[0] to 0.12 seconds
        • Else - Actions
      • Set Timer = (Timer - 0.10)
  • StoppedCastingWB
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Water Bolt
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Timer Greater than 0.01
        • Then - Actions
          • Set Timer = 0.00
          • Floating Text - Destroy FloatingText[0]
          • Floating Text - Create floating text that reads Interrupted! at TempPoint with Z offset 240.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Set FloatingText[1] = (Last created floating text)
          • Floating Text - Set the velocity of FloatingText[1] to 64.00 towards 90.00 degrees
          • Wait 1.50 seconds
          • Floating Text - Destroy FloatingText[1]
        • Else - Actions
          • Set Timer = 0.00
          • Floating Text - Destroy FloatingText[0]
          • Floating Text - Create floating text that reads |CFF1BE6D8Water Bol... at TempPoint with Z offset 240.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Set FloatingText[1] = (Last created floating text)
          • Floating Text - Set the velocity of FloatingText[1] to 64.00 towards 90.00 degrees
          • Wait 1.50 seconds
          • Floating Text - Destroy FloatingText[1]
In the first trigg. a floating text shows above my hero how many seconds are left till my magic 'Deep Freeze' casts. The second trig is the same, but with my magic 'Water Bolt'. The 2 problems are in-game. The first one is that when i cast 'Water Bolt' appears the trigg. for 'Deep Freeze'. The second problem is that when two units cast at the same time the magic 'Deep Freeze' the timer appears only above the first one (no timer for the second). PLEASE HELP ME! I WILL GIVE YOU +REP EVERY DAY! :thumbs_up:
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
well, I didn't read all the triggers, but, the second issue is because it is not MUI.

I also believe this is causing the issue with the first problem as well. Because you use waits, it can mess with things.
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Either use Indexing or Hashtables in order to fix your problem.

I think the first problem is because you use the same variables for both spells, without clearing the data first, so it's confusing it. Or something like that.
 
Status
Not open for further replies.
Top