• 🏆 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] Problem with Real Variables

Status
Not open for further replies.
Level 7
Joined
Apr 17, 2017
Messages
316
I don't know how to explain this. Here are the codes i am gonna explain the problem in the end.

  • Embracement of Lightning
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Embracement of Lightning
    • Actions
      • Set EOL_Caster = (Casting unit)
      • Trigger - Turn on Embracement of Lightning Loop <gen>
  • Embracement of Lightning Loop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set EOL_Real = (EOL_Real + 100.00)
      • Set EOL_Real2 = (EOL_Real2 + 100.00)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Embracement of Lightning Dummy 1 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy1[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy1[(Integer A)]
          • Special Effect - Create a special effect at (Position of EOL_Dummy1[(Integer A)]) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
          • Set EOL_Spec1[(Integer A)] = (Last created special effect)
          • Special Effect - Destroy EOL_Spec1[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 2 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy2[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy2[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 3 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy3[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy3[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 4 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy4[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy4[(Integer A)]
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Embracement of Lightning Dummy 1 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy5[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy5[(Integer A)]
          • Special Effect - Create a special effect at (Position of EOL_Dummy5[(Integer A)]) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
          • Set EOL_Spec2[(Integer A)] = (Last created special effect)
          • Special Effect - Destroy EOL_Spec2[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 2 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy6[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy6[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 3 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy7[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy7[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 4 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy8[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy8[(Integer A)]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EOL_Real Greater than or equal to 200.00
        • Then - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Unit - Remove EOL_Dummy1[(Integer A)] from the game
              • Unit - Remove EOL_Dummy2[(Integer A)] from the game
              • Unit - Remove EOL_Dummy3[(Integer A)] from the game
              • Unit - Remove EOL_Dummy4[(Integer A)] from the game
              • Unit - Remove EOL_Dummy5[(Integer A)] from the game
              • Unit - Remove EOL_Dummy6[(Integer A)] from the game
              • Unit - Remove EOL_Dummy7[(Integer A)] from the game
              • Unit - Remove EOL_Dummy8[(Integer A)] from the game
          • Wait 2.00 seconds
          • Trigger - Turn on Embracement of Lightning Loop2 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Embracement of Lightning Loop2
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set EOL_Real = (EOL_Real - 100.00)
      • Set EOL_Real2 = (EOL_Real2 - 100.00)
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Embracement of Lightning Dummy 1 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy1[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy1[(Integer A)]
          • Special Effect - Create a special effect at (Position of EOL_Dummy1[(Integer A)]) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
          • Set EOL_Spec1[(Integer A)] = (Last created special effect)
          • Special Effect - Destroy EOL_Spec1[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 2 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy2[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy2[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 3 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy3[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy3[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 4 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by EOL_Real towards (60.00 x (Real((Integer A)))) degrees) facing Default building facing degrees
          • Set EOL_Dummy4[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy4[(Integer A)]
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Embracement of Lightning Dummy 1 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy5[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy5[(Integer A)]
          • Special Effect - Create a special effect at (Position of EOL_Dummy5[(Integer A)]) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
          • Set EOL_Spec2[(Integer A)] = (Last created special effect)
          • Special Effect - Destroy EOL_Spec2[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 2 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy6[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy6[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 3 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy7[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy7[(Integer A)]
          • Unit - Create 1 Embracement of Lightning Dummy 4 for (Owner of EOL_Caster) at ((Position of EOL_Caster) offset by (150.00 + EOL_Real2) towards (30.00 + (60.00 x (Real((Integer A))))) degrees) facing Default building facing degrees
          • Set EOL_Dummy8[(Integer A)] = (Last created unit)
          • Unit - Add a 2.00 second Generic expiration timer to EOL_Dummy8[(Integer A)]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • EOL_Real Less than or equal to 200.00
        • Then - Actions
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Unit - Remove EOL_Dummy1[(Integer A)] from the game
              • Unit - Remove EOL_Dummy2[(Integer A)] from the game
              • Unit - Remove EOL_Dummy3[(Integer A)] from the game
              • Unit - Remove EOL_Dummy4[(Integer A)] from the game
              • Unit - Remove EOL_Dummy5[(Integer A)] from the game
              • Unit - Remove EOL_Dummy6[(Integer A)] from the game
              • Unit - Remove EOL_Dummy7[(Integer A)] from the game
              • Unit - Remove EOL_Dummy8[(Integer A)] from the game
          • Trigger - Turn off (This trigger)
        • Else - Actions

The problem here if i set the time event like lowering it, the effect goes farther than it is supposed to be. I dont know why tho.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
Might need a demonstration map to recreate your problem. The way you describe it is a bit ambiguous.

What are there 2 triggers that are almost the same? Wait action is not time accurate and since globals are used it may suffer from global variable conflicts.
 
Status
Not open for further replies.
Top