• 🏆 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] Frost Storm

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
343
Hello there again, for some reason, the units picked don't get any damage, what could be wrong in this setup?
The idea of the spell is to be like Anivia ultimate from League of Legends

  • Mage Orb Frost Talent Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blizzard (Mage FROST)
      • (Current research level of Mage Orb (Mage Talent) for (Owner of (Triggering unit))) Greater than or equal to 1
    • Actions
      • Set MO_Index = (MO_Index + 1)
      • Set MO_Caster[MO_Index] = (Triggering unit)
      • Set MO_Position[MO_Index] = (Target point of ability being cast)
      • Set MO_Damage[MO_Index] = (Real((Intelligence of MO_Caster[MO_Index] (Include bonuses))))
      • Set MO_Duration[MO_Index] = 5
      • Unit - Create 1 Dummy Empty for (Owner of MO_Caster[MO_Index]) at MO_Position[MO_Index] facing Default building facing degrees
      • Set MO_Dummy[MO_Index] = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of MO_Dummy[MO_Index] using Sleet Storm.mdx
      • Set MO_SFX[MO_Index] = (Last created special effect)
      • Animation - Change MO_Dummy[MO_Index]'s size to (200.00%, 200.00%, 200.00%) of its original size
      • Custom script: call RemoveLocation(udg_MO_Position[udg_MO_Index])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MO_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Mage Orb Frost Talent Loop <gen>
        • Else - Actions
  • Mage Orb Frost Talent Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MO_Loop) from 1 to MO_Index, do (Actions)
        • Loop - Actions
          • Set MO_Duration[MO_Loop] = (MO_Duration[MO_Loop] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MO_Duration[MO_Loop] Greater than or equal to 0
              • (MO_Caster[MO_Loop] is alive) Equal to True
              • (Current order of MO_Caster[MO_Loop]) Equal to (Order(channel))
            • Then - Actions
              • Set MO_Position[MO_Loop] = (Position of MO_Dummy[MO_Loop])
              • Set MO_Group[MO_Loop] = (Units within 500.00 of MO_Position[MO_Loop])
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in MO_Group[MO_Loop] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) belongs to an enemy of (Owner of MO_Caster[MO_Loop])) Equal to True
                    • Then - Actions
                      • Unit - Cause MO_Caster[MO_Loop] to damage (Picked unit), dealing MO_Damage[MO_Loop] damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\LichMissile\LichMissile.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_MO_Position[udg_MO_Loop])
            • Else - Actions
              • Set MO_Caster[MO_Loop] = MO_Caster[MO_Index]
              • Set MO_Damage[MO_Loop] = MO_Damage[MO_Index]
              • Set MO_Dummy[MO_Loop] = MO_Dummy[MO_Index]
              • Set MO_Duration[MO_Loop] = MO_Duration[MO_Index]
              • Set MO_SFX[MO_Loop] = MO_SFX[MO_Index]
              • Set MO_Index = (MO_Index - 1)
              • Set MO_Loop = (MO_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MO_Index Equal to 0
                • Then - Actions
                  • Special Effect - Destroy MO_SFX[MO_Loop]
                  • Unit - Add a 0.10 second Generic expiration timer to MO_Dummy[MO_Loop]
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
Get rid of the unit group variable.
just do :

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in (Units within 500.00 of MO_Position[MO_Loop]) and do (Actions)
Also
1638825767562.png
 
Level 9
Joined
Dec 16, 2017
Messages
343
Why it doesn't work with the group variable?
It still doesn't work, does no damage and removes dummy very fast

  • Mage Orb Frost Talent Cast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Blizzard (Mage FROST)
      • (Current research level of Mage Orb (Mage Talent) for (Owner of (Triggering unit))) Greater than or equal to 1
    • Actions
      • Set MO_Index = (MO_Index + 1)
      • Set MO_Caster[MO_Index] = (Triggering unit)
      • Set MO_Position[MO_Index] = (Target point of ability being cast)
      • Set MO_Damage[MO_Index] = (Real((Intelligence of MO_Caster[MO_Index] (Include bonuses))))
      • Set MO_Duration[MO_Index] = 5
      • Unit - Create 1 Dummy Empty for (Owner of MO_Caster[MO_Index]) at MO_Position[MO_Index] facing Default building facing degrees
      • Set MO_Dummy[MO_Index] = (Last created unit)
      • Special Effect - Create a special effect attached to the origin of MO_Dummy[MO_Index] using Sleet Storm.mdx
      • Set MO_SFX[MO_Index] = (Last created special effect)
      • Animation - Change MO_Dummy[MO_Index]'s size to (200.00%, 200.00%, 200.00%) of its original size
      • Custom script: call RemoveLocation(udg_MO_Position[udg_MO_Index])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MO_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Mage Orb Frost Talent Loop <gen>
        • Else - Actions

  • Mage Orb Frost Talent Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MO_Loop) from 1 to MO_Index, do (Actions)
        • Loop - Actions
          • Set MO_Duration[MO_Loop] = (MO_Duration[MO_Loop] - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MO_Duration[MO_Loop] Greater than or equal to 0
              • (MO_Caster[MO_Loop] is alive) Equal to True
              • (Current order of MO_Caster[MO_Loop]) Equal to (Order(channel))
            • Then - Actions
              • Set MO_Position[MO_Loop] = (Target point of ability being cast)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within 500.00 of MO_Position[MO_Loop]) and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) belongs to an enemy of (Owner of MO_Caster[MO_Loop])) Equal to True
                    • Then - Actions
                      • Unit - Cause MO_Caster[MO_Loop] to damage (Picked unit), dealing MO_Damage[MO_Loop] damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Weapons\LichMissile\LichMissile.mdl
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_MO_Position[udg_MO_Loop])
            • Else - Actions
              • Special Effect - Destroy MO_SFX[MO_Loop]
              • Unit - Add a 0.10 second Generic expiration timer to MO_Dummy[MO_Loop]
              • Set MO_Caster[MO_Loop] = MO_Caster[MO_Index]
              • Set MO_Damage[MO_Loop] = MO_Damage[MO_Index]
              • Set MO_Dummy[MO_Loop] = MO_Dummy[MO_Index]
              • Set MO_Duration[MO_Loop] = MO_Duration[MO_Index]
              • Set MO_SFX[MO_Loop] = MO_SFX[MO_Index]
              • Set MO_Index = (MO_Index - 1)
              • Set MO_Loop = (MO_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MO_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
343
It's based of Blizzard spell

Screenshot 2021-12-07 011030.png
Screenshot 2021-12-07 011210.png
Screenshot 2021-12-07 011419.png



Later edit:
-If i remove the channel order, the spells works perfectly as it should, but if i move, the spell doesn't end.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
This action in your Loop trigger is the problem:
  • Set MO_Position[MO_Loop] = (Target point of ability being cast)
Your trigger has absolutely no idea what this means. There was no ability cast so how can there be a target point of ability being cast?

Remember that Event Responses are paired with Events. You shouldn't be using an Event Response without the Event that goes with it.

And in this case, your Event has NO Event Responses:
  • Time - Every 1.00 seconds of game time
You shouldn't be referencing any Event Responses in this trigger. The exception of course is (Picked unit) since it goes along with the Pick Every Unit function. Another exception would be (Matching unit) if used in Matching conditions.

The solution is simple, delete these 2 Actions:
  • Set MO_Position[MO_Loop] = (Target point of ability being cast)
  • Custom script: call RemoveLocation(udg_MO_Position[udg_MO_Loop])
You've already Set MO_Position[] in your Mage Orb Frost Talent Cast trigger, it doesn't need to get Set again. It's not like the Blizzard is going to move or anything.

Then when it comes time to end the spell you need to Destroy the point and "de-index" it like you do with your other variables:
  • Else - Actions
  • Special Effect - Destroy MO_SFX[MO_Loop]
  • Custom script: call RemoveLocation(udg_MO_Position[udg_MO_Loop])
  • Set MO_Position[MO_Loop] = MO_Position[MO_Index]

This line may look like it creates a Point leak:
  • Set MO_Position[MO_Loop] = MO_Position[MO_Index]
But understand that it's not creating a new Point. It's assigning MO_Position[MO_Loop] to the Point stored in the MO_Position[MO_Index] variable. So they're both assigned to the same Position in the game world (aka Location). It makes more sense once you understand how Point variables actually work, which can be easily be done if you look into the Jass code used to make them.
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
343
Thanks, i've fixed those too, but the real problem is
If i delete this it works perfectly, but when the caster moves, the spell doesn't end tho..

  • (Current order of MO_Caster[MO_Loop]) Equal to (Order(channel))
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
Thanks, i've fixed those too, but the real problem is
If i delete this it works perfectly, but when the caster moves, the spell doesn't end tho..

  • (Current order of MO_Caster[MO_Loop]) Equal to (Order(channel))
That's because channel is the order id for the Channel ability.
blizzard is the order id for the Blizzard ability.

These are hardcoded for each ability so you can't change them to something else. If your ability is based on Blizzard then it's order will ALWAYS be blizzard.

You can view any abilities order in the Object Editor -> Text - Order String - Use/Turn On

Note that a handful of abilities in the Object Editor have the special property of being able to use any order you want.
Channel, Charge Gold and Lumber, etc. all have the Base Order ID field which can be customized to do exactly that.

If Current order still gives you trouble then you can create a new trigger which uses the "Stops casting an ability" Event and use that to "de-index" and end the spell for the caster. You would Loop from 1 to Index checking to see if MO_Caster[MO_Loop] is Equal to the (Triggering unit), and if it is, you would "de-index" that Loop cycle right then and there the same way you did in your Loop trigger.
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
343
Oh, yea, it seems logic, i was taking the order based of the animation and not the spell, haha xD. Because i have some spells based of death pact and worked with channel order, but since the spell is based of channel, it was alright.

I'm having some trouble into doing a shield based spell, i tried to use DDS, but when i import into my map, it crashes, so i guess it won't work..when i import and try to save the map or start, the map just crashes and WE is exited without save.

I need it so i can make a shield spell type but from triggers, it can be casted on an ally target, and give's him an amount of shield, that decreases when he is attacked by attacks or spells or when the shield duration is over..

How can i make a little DDS just for this shield?
For example, if i have a 500 hp shield and someone does a 600 damage to the unit with the shield, he gets damaged 100, if the shield has 500 hp, and someone damages it for 300, it still is there and can block 200 damage more.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
Oh, yea, it seems logic, i was taking the order based of the animation and not the spell, haha xD. Because i have some spells based of death pact and worked with channel order, but since the spell is based of channel, it was alright.

I'm having some trouble into doing a shield based spell, i tried to use DDS, but when i import into my map, it crashes, so i guess it won't work..when i import and try to save the map or start, the map just crashes and WE is exited without save.

I need it so i can make a shield spell type but from triggers, it can be casted on an ally target, and give's him an amount of shield, that decreases when he is attacked by attacks or spells or when the shield duration is over..

How can i make a little DDS just for this shield?
For example, if i have a 500 hp shield and someone does a 600 damage to the unit with the shield, he gets damaged 100, if the shield has 500 hp, and someone damages it for 300, it still is there and can block 200 damage more.
Are you using Bribe's Damage Engine?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
I tried, that is the one that crashes my map.
This is the version.
Here's one way of doing it using Bribe's system. It's also using a Unit Indexer to track the life of the Shield:
  • Example
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
    • Actions
      • Set VariableSet Shield_CV = (Custom value of DamageEventTarget)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Shield_Life[Shield_CV] Greater than 0.00
        • Then - Actions
          • Set VariableSet Shield_LifeBefore = Shield_Life[Shield_CV]
          • Set VariableSet Shield_Life[Shield_CV] = (Shield_Life[Shield_CV] - DamageEventAmount)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Shield_Life[Shield_CV] Greater than 0.00
            • Then - Actions
              • -------- Shield absorbed all of the damage: --------
              • Set VariableSet DamageEventAmount = 0.00
            • Else - Actions
              • -------- Shield was broken and damage bypassed it: --------
              • Set VariableSet DamageEventAmount = (DamageEventAmount - Shield_LifeBefore)
        • Else - Actions

This concept can be applied to other Damage Engines as well. You'll have to find one that works with your current version, I'd still try to use one made by Bribe if possible.
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,787
Yikes how old of a version are you playing on?
This version only has the damage engine triggers.
Edit: also 3.5.1 version
Edit2: also super old version from 2018 but it doesn't say what version. (Damage engine demo)
 

Attachments

  • Bone Armor v1.13.1.wtg
    22.2 KB · Views: 13
  • Damage Engine v3.5.1.0 (1).w3x
    50 KB · Views: 6
  • Damage Engine demo.w3x
    28.4 KB · Views: 28
Level 9
Joined
Dec 16, 2017
Messages
343
Yikes how old of a version are you playing on?
This version only has the damage engine triggers.
Edit: also 3.5.1 version
Edit2: also super old version from 2018 but it doesn't say what version. (Damage engine demo)
I use 1.28.5 version
The damage engine v3.5.1.0 seems to work, i will import now into map to see if it will crash like the 3.8 version and come back with a feedback
After that i will try it
As for bone armor the one you posted here, it still doesn't work to import.
 
Status
Not open for further replies.
Top