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

Annoying Error

Status
Not open for further replies.
Level 20
Joined
Jan 6, 2008
Messages
2,627
I just tried for a Grenade spell, but it errors

  • Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Gr|cffffcc00e|rnade
    • Actions
      • Custom script: local effect udg_GrenadeEffect
      • Custom script: local integer udg_GrenadeInteger
      • Custom script: local unit udg_GrenadeUnit
      • Custom script: local unit udg_GrenadeMissile
      • Custom script: local location udg_GrenadePoint
      • Set GrenadeInteger = 50
      • Set GrenadeUnit = (Triggering unit)
      • Special Effect - Create a special effect attached to the left, hand of GrenadeUnit using war3mapImported\Grenade2.mdx
      • Set GrenadeEffect = (Last created special effect)
      • Unit - Pause GrenadeUnit
      • Special Effect - Destroy GrenadeEffect
      • Wait 0.10 seconds
      • Animation - Play GrenadeUnit's Spell Throw Alternate animation
      • Wait 1.00 seconds
      • Unit - Unpause GrenadeUnit
      • Animation - Play GrenadeUnit's Stand animation
      • Set GrenadePoint = (Position of GrenadeUnit)
      • Unit - Create 1 Grenade for (Owner of GrenadeUnit) at GrenadePoint facing (Facing of GrenadeUnit) degrees
      • Set GrenadeMissile = (Last created unit)
      • Set GrenadePoint2 = (GrenadePoint offset by (5000.00, 0.00))
      • Custom script: call RemoveLocation(udg_GrenadePoint)
      • Unit - Order GrenadeMissile to Move To GrenadePoint2
      • For each (Integer A) from 1 to 200, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GrenadeInteger Less than or equal to 100
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GrenadeInteger Less than or equal to 100
                • Then - Actions
                  • Wait 0.01 seconds
                  • Set GrenadeInteger = (GrenadeInteger + 30)
                  • Animation - Change GrenadeMissile flying height to (Real(GrenadeInteger)) at 0.00
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GrenadeInteger Greater than or equal to 100
                    • Then - Actions
                      • Wait 0.01 seconds
                      • Animation - Change GrenadeMissile flying height to ((Current flying height of GrenadeMissile) - 30.00) at 0.00
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Integer((Current flying height of GrenadeMissile))) Equal to 0
                        • Then - Actions
                          • Unit - Kill GrenadeMissile
                        • Else - Actions
                    • Else - Actions
                • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_GrenadePoint2)
It seems to work, but it wont move down, and 100 is WAY TO LITTLE but it just keeps going on
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I did notice 1 thing: shouldn't the last if/then/else (GrenadeInteger Greater than or equal to 100) be in the else-section of the previous if/then/else, instead of the then-section?
You've also used "GrenadeInteger Less than or equal to 100" twice, I don't know what the point of that is...

Now you can compare it with this:
If GrenadeInteger < 100
Then If GrenadeInteger > 100
Actions

(since grenadeinteger can't be exactly 100, the "equal to" doesn't matter)

Edit: even if you change that, I doubt it will work, though, if the integer is greater than 100 (in your trigger) it just won't do anything... at all, so if you say it keeps going up, the problem lies somewhere else.
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
oh ap0calypse i just tested something i moved it to else but still didnt work

and i use the taunt spell due i cant use a spell with an area to choose kind of spell

Im making a grenade spell but there are two errors

I GOT IT TO WORK(1, It just keeps going up to the air.)
2, I dont know how to make the offset depending on the angle
 
Last edited:
Status
Not open for further replies.
Top