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

[Solved] Spell Bug

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,601
Hello.

I got a big problem I've been trying to fix last few weeks without any results. It's about spells. I made a spell book system when the player clicks a dummy hero player's selection will be moved to another dummy unit(building) that has some "spell book spells".

The spells have 99999 range. All spells bugs, even if the coding should be alright.

1) Spells that are casted to X point are always put to the middle
2) Spells that are casted to units to friendly and enemy units... Just doesn't work(no effect, no damage, no healing)

Most of the abilities are made of Channel spell.

Here's for example spell "Volcanic Fissure". Currently when player cast it to anywhere it always happen in the middle of map.

  • Volcanic Fissure
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 1Volcanic Fissure (Fire 2)
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: volcanic
      • Set TempLoc = (Target point of ability being cast)
      • Unit - Create 1 Volcanic Fissure Dummy for Neutral Passive at TempLoc facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Set VolcanicFissure_Unit = (Last created unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of SPELL_SpellBook[2] for Restore_Panel[6]) Equal to 3
        • Then - Actions
          • Animation - Change VolcanicFissure_Unit's size to (125.00%, 125.00%, 125.00%) of its original size
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Wait 0.50 seconds
      • Set TempLoc = (Position of VolcanicFissure_Unit)
      • Set TempGroup2 = (Units owned by Neutral Hostile)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of SPELL_SpellBook[2] for Restore_Panel[6]) Equal to 3
        • Then - Actions
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Set TempGroup = (Units within 450.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup2) Equal to True) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to 0))))
              • Unit - Create 1 Ability Dummy Unit for Player 1 (Red) at TempLoc facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Set level of STUN (0,5 sec / lvl DUMMY STUN) for (Last created unit) to 12
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
              • Unit - Create 1 Ability Dummy Unit 3 for Neutral Passive at TempLoc facing TempLoc
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Set level of AAAStagger for (Last created unit) to 6
              • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Picked unit)
              • Unit - Cause AAAPhodom to damage (Picked unit), dealing ((Real(YMultiboard__VOLCANO)) + 1.50) damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
              • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Set TempGroup = (Units within 300.00 of TempLoc matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is in TempGroup2) Equal to True) and ((Level of Invulnerable (Neutral) for (Matching unit)) Equal to 0))))
              • Unit - Create 1 Ability Dummy Unit for Player 1 (Red) at TempLoc facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Set level of STUN (0,5 sec / lvl DUMMY STUN) for (Last created unit) to 8
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
              • Unit - Create 1 Ability Dummy Unit 3 for Neutral Passive at TempLoc facing TempLoc
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Set level of AAAStagger for (Last created unit) to 4
              • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Picked unit)
              • Unit - Cause AAAPhodom to damage (Picked unit), dealing (Real(YMultiboard__VOLCANO)) damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Volcano\VolcanoDeath.mdl
              • Special Effect - Destroy (Last created special effect)
      • Custom script: call DestroyGroup(udg_TempGroup2)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Set VolcanicFissure_Unit = No unit
      • Trigger - Turn on (This trigger)

And here's another example spell Fire Ward. When it's cast on a unit it doesn't do anything.

  • Fire Ward
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to 1Fire Ward (Fire 1)
    • Actions
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: fire ward
      • Set TempLoc = (Position of (Target unit of ability being cast))
      • Set Holy_Sign_Unit = (Target unit of ability being cast)
      • Unit - Create 1 Holy Sign Dummy for Neutral Passive at TempLoc facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Remove Negative buffs from Holy_Sign_Unit
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Special Effect - Create a special effect attached to the origin of Holy_Sign_Unit using war3mapImported\LightStrikeArray.mdx
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of SPELL_SpellBook[1] for Restore_Panel[6]) Equal to 1
        • Then - Actions
          • For each (Integer Flame_Thrower_Integer) from 1 to 5, do (Actions)
            • Loop - Actions
              • Unit - Set life of Holy_Sign_Unit to ((Life of Holy_Sign_Unit) + (Real(YMultiboard__DIVINESHIELD)))
              • Wait 1.00 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of SPELL_SpellBook[1] for Restore_Panel[6]) Equal to 2
            • Then - Actions
              • For each (Integer Flame_Thrower_Integer) from 1 to 10, do (Actions)
                • Loop - Actions
                  • Unit - Set life of Holy_Sign_Unit to ((Life of Holy_Sign_Unit) + (Real(YMultiboard__DIVINESHIELD)))
                  • Wait 1.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of SPELL_SpellBook[1] for Restore_Panel[6]) Equal to 3
                • Then - Actions
                  • For each (Integer Flame_Thrower_Integer) from 1 to 5, do (Actions)
                    • Loop - Actions
                      • Unit - Set life of Holy_Sign_Unit to ((Life of Holy_Sign_Unit) + ((Real(YMultiboard__DIVINESHIELD)) x 10.00))
                      • Unit - Set life of Holy_Sign_Unit to ((Life of Holy_Sign_Unit) + (Real(YMultiboard__DIVINESHIELD)))
                      • Wait 1.00 seconds
                • Else - Actions
      • Set Holy_Sign_Unit = No unit
      • Trigger - Turn on (This trigger)
Ask more, I'm eager to solve this bug.

Rep and credits for the helpers.
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
Set TempLoc declaration to be the first line in the trigger.

That's how I fixed mine (had same problem).

Hope it works.

Okay I try that but I'm very sceptical because there are some spells that doesn't even use "TempLoc" and they still bug.

Isn't it The Choosen One?
I love that campaign <3 Although boss fights are too random and unfair sometimes ;/

And don't worry I got your campaign on disc, it lags like hell on my 10 yers old CPU. Thanks god I bought 5 days ago new one.

Haha, like I would have time for other projects.

Bosses will be fixed... Will be, will be, will be. That's off-topic anyway.
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
Yes indeed there's that bug and I'll fix it later. However the main bug is not fixed by that. Still the volcano is cast to the middle of map.

  • Set TempLoc = (Target point of ability being cast)
  • Unit - Create 1 Volcanic Fissure Dummy for Neutral Passive at TempLoc facing Default building facing degrees
  • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
  • Set VolcanicFissure_Unit = (Last created unit)
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
Fire Ward is made from Anti Magic Shield(no effect or heal when cast on unit)
Volcanic Fissure is made from Dispel(effect always go to middle)

Other info:

- Spell are added to dummy unit at beginning of game or when player actually receives an item
- Dummy doesn't have model(.mdl)

EDIT: Okay guys I found the bug. I paused the dummy unit whenever it started to cast a spell. This was part of my new system I never checked that trigger... Sorry guys for this mess.
 
Last edited:
Status
Not open for further replies.
Top