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

Spell is not working properly

Status
Not open for further replies.
Level 3
Joined
Dec 27, 2006
Messages
34
The spell does not work properly, it's suppose to create 10 crystals, or ice shards, and place them in a circle around the target, then its suppose to wait and do the 2nd special effects part which does basically the whole inner circle with trap frost up special effects. then its suppose to remove the crystals and the traps special effects at the same time, as soon as the special effects for the traps finish. However, it just creates 10 crystals, waits, SOMETIMES makes the 2nd part, i have no clue why but sometimes it wont do the 2nd part at all and in the same game later after using the spell a few times it starts doing the 2nd part with no other edits to it, and then it removes the 2nd parts special effects, waits for some amount of time im not sure why, then finally removes the crystals.
  • Frost Bite
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FrostBite
    • Actions
      • Game - Display to (All players) the text: should work
      • Set FBDamage = (((Real((Level of FrostBite for (Triggering unit)))) x 150.00) + (Real((Intelligence of IceWardenCaster (Include bonuses)))))
      • Set FrostBitePoint = (Target point of ability being cast)
      • Set FrostBiteTarget = (Target unit of ability being cast)
      • Set FrostBiteOff[(Integer A)] = (Position of FrostBiteTarget)
      • Set FrostBiteCaster = (Casting unit)
      • Set FBSFKPart2 = False
      • Set FBDESTROYSFX = False
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set FrostBiteOff[(Integer A)] = (FrostBitePoint offset by -300.00 towards (36.00 x ((Real((Integer A))) - 1.00)) degrees)
          • Special Effect - Create a special effect at FrostBiteOff[(Integer A)] using Doodads\Icecrown\Rocks\Icecrown_Crystal\Icecrown_Crystal3.mdl
          • Set FrostBiteSFX[(Integer A)] = (Last created special effect)
          • Unit - Create 1 Frost Bite Dummy for (Owner of FrostBiteCaster) at FrostBiteOff[(Integer A)] facing Default building facing degrees
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Set FrostBiteOff[(Integer A)] = (FrostBitePoint offset by 300.00 towards (36.00 x ((Real((Integer A))) - 1.00)) degrees)
          • Unit - Order (Last created unit) to Human Archmage - Blizzard FrostBiteOff[(Integer A)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Equal to 10
            • Then - Actions
              • Game - Display to (All players) the text: 10
              • Set FBSFKPart2 = True
              • Wait 1.00 seconds
            • Else - Actions
          • Special Effect - Destroy FrostBiteSFX[(Integer A)]
          • Game - Display to (All players) the text: destroyed crystals
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FBSFKPart2 Equal to True
        • Then - Actions
          • For each (Integer A) from 1 to 90, do (Actions)
            • Loop - Actions
              • Set FrostBitePoint2[(Integer A)] = (FrostBitePoint offset by -100.00 towards (4.00 x ((Real((Integer A))) - 1.00)) degrees)
              • Set FrostBitePoint3[(Integer A)] = (FrostBitePoint offset by -200.00 towards (4.00 x ((Real((Integer A))) - 1.00)) degrees)
              • Set FrostBiteOff[(Integer A)] = (FrostBitePoint offset by -300.00 towards (4.00 x ((Real((Integer A))) - 1.00)) degrees)
              • Special Effect - Create a special effect at FrostBitePoint2[(Integer A)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
              • Set FBP2SFX[(Integer A)] = (Last created special effect)
              • Special Effect - Create a special effect at FrostBitePoint3[(Integer A)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
              • Set FBP3SFX[(Integer A)] = (Last created special effect)
              • Special Effect - Create a special effect at FrostBiteOff[(Integer A)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
              • Set FBP4SFX[(Integer A)] = (Last created special effect)
              • Set FrostBitePoint2[(Integer A)] = (FrostBitePoint offset by 100.00 towards (4.00 x ((Real((Integer A))) - 1.00)) degrees)
              • Set FrostBitePoint3[(Integer A)] = (FrostBitePoint offset by 200.00 towards (4.00 x ((Real((Integer A))) - 1.00)) degrees)
              • Set FrostBiteOff[(Integer A)] = (FrostBitePoint offset by 300.00 towards (4.00 x ((Real((Integer A))) - 1.00)) degrees)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Integer A) Equal to 90
                • Then - Actions
                  • Game - Display to (All players) the text: 90
                  • Set FBDESTROYSFX = True
                  • Wait 1.00 seconds
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FBDESTROYSFX Equal to True
        • Then - Actions
          • For each (Integer A) from 1 to 100, do (Actions)
            • Loop - Actions
              • Special Effect - Destroy FBP2SFX[(Integer A)]
              • Special Effect - Destroy FBP3SFX[(Integer A)]
              • Special Effect - Destroy FBP4SFX[(Integer A)]
        • Else - Actions
 
Level 3
Joined
Dec 27, 2006
Messages
34
Okays, heres what i have, i have to leave the waits in though because i want it to wait a second before it does the 2nd part of the graphics, and then the wait for the end makes it so that it actually shows the graphics instead of just delete them before you get to seem it.

  • Frost Bite Test2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FrostBite
    • Actions
      • Game - Display to (All players) the text: should work
      • Set FBDamage = (((Real((Level of FrostBite for (Triggering unit)))) x 150.00) + (Real((Intelligence of IceWardenCaster (Include bonuses)))))
      • Set FrostBitePoint = (Target point of ability being cast)
      • Set FrostBiteTarget = (Target unit of ability being cast)
      • Set FrostBiteOff[(Integer A)] = (Position of FrostBiteTarget)
      • Set FrostBiteCaster = (Casting unit)
      • Custom script: call RemoveLocation(udg_FrostBiteOff[GetForLoopIndexA()])
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Set FrostBiteOff[(Integer A)] = (FrostBitePoint offset by -300.00 towards (36.00 x ((Real((Integer A))) - 1.00)) degrees)
          • Special Effect - Create a special effect at FrostBiteOff[(Integer A)] using Doodads\Icecrown\Rocks\Icecrown_Crystal\Icecrown_Crystal3.mdl
          • Set FrostBiteSFX[(Integer A)] = (Last created special effect)
          • Unit - Create 1 Frost Bite Dummy for (Owner of FrostBiteCaster) at FrostBiteOff[(Integer A)] facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_FrostBiteOff[GetForLoopIndexA()])
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Set FrostBiteOff[(Integer A)] = (FrostBitePoint offset by 300.00 towards (36.00 x ((Real((Integer A))) - 1.00)) degrees)
          • Unit - Order (Last created unit) to Human Archmage - Blizzard FrostBiteOff[(Integer A)]
          • Custom script: call RemoveLocation(udg_FrostBiteOff[GetForLoopIndexA()])
          • Game - Display to (All players) the text: destroyed crystals
          • Special Effect - Destroy FrostBiteSFX[(Integer A)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Equal to 10
            • Then - Actions
              • Game - Display to (All players) the text: 10
              • Wait 1.00 seconds
              • For each (Integer B) from 1 to 90, do (Actions)
                • Loop - Actions
                  • Set FrostBitePoint2[(Integer B)] = (FrostBitePoint offset by -100.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostBitePoint3[(Integer B)] = (FrostBitePoint offset by -200.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostBiteOff[(Integer B)] = (FrostBitePoint offset by -300.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Special Effect - Create a special effect at FrostBitePoint2[(Integer B)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
                  • Set FBP2SFX[(Integer B)] = (Last created special effect)
                  • Special Effect - Create a special effect at FrostBitePoint3[(Integer B)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
                  • Set FBP3SFX[(Integer B)] = (Last created special effect)
                  • Special Effect - Create a special effect at FrostBiteOff[(Integer B)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
                  • Set FBP4SFX[(Integer B)] = (Last created special effect)
                  • Custom script: call RemoveLocation(udg_FrostBitePoint2[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostBitePoint3[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostBiteOff[GetForLoopIndexB()])
                  • Set FrostBitePoint2[(Integer B)] = (FrostBitePoint offset by 100.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostBitePoint3[(Integer B)] = (FrostBitePoint offset by 200.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostBiteOff[(Integer B)] = (FrostBitePoint offset by 300.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Custom script: call RemoveLocation(udg_FrostBitePoint2[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostBitePoint3[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostBiteOff[GetForLoopIndexB()])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Integer B) Equal to 90
                    • Then - Actions
                      • Game - Display to (All players) the text: 90
                      • Wait 1.00 seconds
                      • For each (Integer A) from 1 to 100, do (Actions)
                        • Loop - Actions
                          • Special Effect - Destroy FBP2SFX[(Integer A)]
                          • Special Effect - Destroy FBP3SFX[(Integer A)]
                          • Special Effect - Destroy FBP4SFX[(Integer A)]
                    • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_FrostBitePoint)
      • Custom script: call RemoveLocation(udg_FrostBitePoint)
the crystals still delay for some reason, it takes them awhile to be deleted, but the 2nd part gets deleted just fine... I think all I need to do now is to get it so that it deletes the First graphics part after the 2nd graphics part fades away. This has been my problem.
 
Level 12
Joined
Aug 22, 2008
Messages
911
You can make the SFX as a dummy unit with locust and then remove it. Make sure it has no shadow and stuff.
If you're having trouble with waits you can try using timers. It isn't MUI but it's much more efficient.
 
Level 3
Joined
Dec 27, 2006
Messages
34
Alright, thanks, well i've been testing it and it works fine except that the 2nd sfx part sometimes shows, and sometimes doesn't, if i remake the game without editing it will show, but sometimes if i remake the game without editing it won't show. It only shows sometimes, idk why any ideas?

  • Frost Bite Test2
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frostbite
    • Actions
      • Game - Display to (All players) the text: should work
      • Set FBDamage = (((Real((Level of Frostbite for (Triggering unit)))) x 150.00) + (Real((Intelligence of IceWardenCaster (Include bonuses)))))
      • Set FrostbitePoint = (Target point of ability being cast)
      • Set FrostbiteTarget = (Target unit of ability being cast)
      • Set FrostbiteOff[(Integer A)] = (Position of FrostbiteTarget)
      • Set FrostbiteCaster = (Casting unit)
      • Set FrostbiteDamageGroup = (Units within 300.00 of FrostbitePoint 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) belongs to an enemy of (Owner of F
      • Custom script: call RemoveLocation(udg_FrostbiteOff[GetForLoopIndexA()])
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation(udg_FrostbiteOff[GetForLoopIndexA()])
          • Set FrostbiteOff[(Integer A)] = (FrostbitePoint offset by -300.00 towards (36.00 x ((Real((Integer A))) - 1.00)) degrees)
          • Special Effect - Create a special effect at FrostbiteOff[(Integer A)] using Doodads\Icecrown\Rocks\Icecrown_Crystal\Icecrown_Crystal3.mdl
          • Set FrostbiteSFX[(Integer A)] = (Last created special effect)
          • Custom script: call RemoveLocation(udg_FrostbiteOff[GetForLoopIndexA()])
          • Set FrostbiteOff[(Integer A)] = (FrostbitePoint offset by 300.00 towards (36.00 x ((Real((Integer A))) - 1.00)) degrees)
          • Game - Display to (All players) the text: destroyed crystals
          • Special Effect - Destroy FrostbiteSFX[(Integer A)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Equal to 10
            • Then - Actions
              • Game - Display to (All players) the text: 10
              • Wait 1.00 seconds
              • For each (Integer B) from 1 to 90, do (Actions)
                • Loop - Actions
                  • Set FrostbitePoint2[(Integer B)] = (FrostbitePoint offset by -100.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostbitePoint3[(Integer B)] = (FrostbitePoint offset by -200.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostbiteOff[(Integer B)] = (FrostbitePoint offset by -300.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Special Effect - Create a special effect at FrostbitePoint2[(Integer B)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
                  • Set FBP2SFX[(Integer B)] = (Last created special effect)
                  • Special Effect - Create a special effect at FrostbitePoint3[(Integer B)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
                  • Set FBP3SFX[(Integer B)] = (Last created special effect)
                  • Special Effect - Create a special effect at FrostbiteOff[(Integer B)] using Doodads\Cinematic\FrostTrapUp\FrostTrapUp.mdl
                  • Set FBP4SFX[(Integer B)] = (Last created special effect)
                  • Unit - Create 1 Frost Bite Dummy for (Owner of FrostbiteCaster) at FrostbiteOff[(Integer B)] facing Default building facing degrees
                  • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                  • Unit - Order (Last created unit) to Human Archmage - Blizzard FrostbiteOff[(Integer B)]
                  • Custom script: call RemoveLocation(udg_FrostbitePoint2[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostbitePoint3[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostbiteOff[GetForLoopIndexB()])
                  • Set FrostbitePoint2[(Integer B)] = (FrostbitePoint offset by 100.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostbitePoint3[(Integer B)] = (FrostbitePoint offset by 200.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Set FrostbiteOff[(Integer B)] = (FrostbitePoint offset by 300.00 towards (4.00 x ((Real((Integer B))) - 1.00)) degrees)
                  • Custom script: call RemoveLocation(udg_FrostbitePoint2[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostbitePoint3[GetForLoopIndexB()])
                  • Custom script: call RemoveLocation(udg_FrostbiteOff[GetForLoopIndexB()])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Integer B) Equal to 90
                    • Then - Actions
                      • Game - Display to (All players) the text: 90
                      • Unit Group - Pick every unit in FrostbiteDamageGroup and do (Actions)
                        • Loop - Actions
                          • Unit - Cause FrostbiteCaster to damage (Picked unit), dealing FBDamage damage of attack type Spells and damage type Cold
                          • Floating Text - Create floating text that reads (- + (String((Integer(FBDamage))))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                          • Floating Text - Change (Last created floating text): Disable permanence
                          • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                          • Unit Group - Add (Picked unit) to FrostbiteSideEffect
                          • Unit - Create 1 CasterDummy for (Owner of FrostbiteCaster) at FrostbitePoint facing Default building facing degrees
                          • Unit - Add FrostbiteSlow to (Last created unit)
                          • Unit - Set level of FrostbiteSlow for (Last created unit) to (Level of Frostbite for FrostbiteCaster)
                          • Unit - Order (Last created unit) to Undead Necromancer - Cripple (Picked unit)
                          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                          • Unit Group - Remove (Picked unit) from FrostbiteDamageGroup
                      • Wait 0.50 seconds
                      • Custom script: call DestroyGroup(udg_FrostbiteDamageGroup)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (FrostbiteDamageGroup is empty) Equal to True
                        • Then - Actions
                          • For each (Integer A) from 1 to 100, do (Actions)
                            • Loop - Actions
                              • Special Effect - Destroy FBP2SFX[(Integer A)]
                              • Special Effect - Destroy FBP3SFX[(Integer A)]
                              • Special Effect - Destroy FBP4SFX[(Integer A)]
                        • Else - Actions
                    • Else - Actions
            • Else - Actions
      • Custom script: call RemoveLocation(udg_FrostbitePoint)
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Set FrostbiteOff[(Integer A)] = (Position of FrostbiteTarget)
You shouldn't use (Integer A) there. Just use normal non-array point type variable for example.

Is the spell unit or locations targetable? Or both? You need to use IF/THEN/ELSE in that case.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
But there can only be one <target unit of ability being cast>, so you don't need to use an array for that. The integer A screws that up.

Is the spell unit, point or unit and point targetable?

If it's unit and point, you only need a few lines of code to set the correct point.
 
Level 3
Joined
Dec 27, 2006
Messages
34
For testing purposes its a point atm, will be a target point, the FrostbiteOffs target point stays the same, when you do the math for the FrostbiteOff is changes it for each integer, i don't see how this could be the problem, the 2nd part is the only screwed up thing atm, and i think thats due to the destroy effects are the very end.

Edit: point and unit target*
 
Level 5
Joined
Dec 20, 2008
Messages
67
I don't see why everyone says its the wait
Just because most problems in MUI spells and triggers are caused by that.

Maybe you didn't do that here but when:
unit cast a spell
trigger run
then you put wait
after it you cause Casting Unit to do something,
it won't be working because the unit you need is not Casting Unit anymore ! I think Triggering Unit could work, I'm not sure...

There is few more problems with that, I heard something about that wait can't be placed in loop... I don't know, I don't like wait

its fixed
Gratz :)
 
Level 3
Joined
Dec 27, 2006
Messages
34
hmmm yeah i think its where you place the wait, and what you want it to do exactly, placing it in a for loop, for example in my spell, if i had the wait in the first for loop from 1 to 10, it would just create 1 crystal every second 10 times, it just depends on how you want it to work. I think theres a few things waits can mess up though, i was working on something with a debuff and had a wait for condition, and that doesnt seem to be working properly so im gonna have to change that.
 
Level 4
Joined
Nov 7, 2009
Messages
83
I would suggest you only removed locations once at the end of the spell. You are removing locations two or three times in the spell and you are working with about 300 effects (that has to be long for sure). I don't think it is necesary to remove effects or anything if you are going to use it with a new value, so just nullify everything at the end of the spell (I'm still not sure why you have to nullify something you are not using, but it seems it's the way it works, so I will not argue about that).
 
Status
Not open for further replies.
Top