• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] My first custom spell, naturally conflicts with other spells.

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2008
Messages
243
If I cast this spell, then cast a different spell, then cast this spell again, it casts the other spell. Since I didn't make the other spell I'm guessing it's mine that's messing up so... 'lil help please. Don't give me to much criticism, despite how awful it may be. :pal:

  • Divine Blessing
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Divine Blessing
    • Actions
      • -------- ------------------------------------------------ --------
      • -------- Seting Spell Constants --------
      • -------- ------------------------------------------------ --------
      • Set DivineBlessing_Caster = (Casting unit)
      • Set DivineBlessing_Owner = (Owner of DivineBlessing_Caster)
      • Set DivineBlessing_Target = (Target unit of ability being cast)
      • -------- ------------------------------------------------ --------
      • -------- Setting Invulnerability Variables --------
      • -------- ------------------------------------------------ --------
      • Set DivineBlessing_Ability = Divine Blessing
      • Set DivineBlessing_AbilityLevel = (Real((Level of Divine Blessing for DivineBlessing_Caster)))
      • -------- ------------------------------------------------ --------
      • -------- Setting Special Effects --------
      • -------- ------------------------------------------------ --------
      • Special Effect - Create a special effect attached to the overhead of DivineBlessing_Target using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
      • Set DivineBlessing_SpecialEffect = (Last created special effect)
      • -------- ------------------------------------------------ --------
      • -------- Setting Invulnerability --------
      • -------- ------------------------------------------------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Divine Blessing for (Triggering unit)) Equal to 1
        • Then - Actions
          • Special Effect - Create a special effect attached to the overhead of DivineBlessing_Target using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
          • Special Effect - Destroy DivineBlessing_SpecialEffect
          • Unit - Make DivineBlessing_Target Invulnerable
          • Wait 15.00 seconds
          • Unit - Make DivineBlessing_Target Vulnerable
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Divine Blessing for (Triggering unit)) Equal to 2
        • Then - Actions
          • Special Effect - Create a special effect attached to the overhead of DivineBlessing_Target using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
          • Special Effect - Destroy DivineBlessing_SpecialEffect
          • Unit - Make DivineBlessing_Target Invulnerable
          • Wait 30.00 seconds
          • Unit - Make DivineBlessing_Target Vulnerable
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Divine Blessing for (Triggering unit)) Equal to 3
        • Then - Actions
          • Special Effect - Create a special effect attached to the overhead of DivineBlessing_Target using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
          • Special Effect - Destroy DivineBlessing_SpecialEffect
          • Unit - Make DivineBlessing_Target Invulnerable
          • Wait 45.00 seconds
          • Unit - Make DivineBlessing_Target Vulnerable
        • Else - Actions
          • Do nothing
 
First off, you can make it this way (shorter version):
  • Divine Blessing
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Divine Blessing
  • Actions
    • -------- ------------------------------------------------ --------
    • -------- Seting Spell Constants --------
    • -------- ------------------------------------------------ --------
    • Set DivineBlessing_Target = (Target unit of ability being cast)
    • Special Effect - Create a special effect attached to the overhead of (Target unit of ability being cast) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Unit - Make (DivineBlessing_Target) Invulnerable
    • Wait ((Level of (Ability being cast) for (Triggering unit)) * 15) seconds
    • Unit - Make DivineBlessing_Target Vulnerable
Secondly, if the abilities have the same Base Order Id (go to the Abilities tab, scroll to "Data - Ability Id" and change it to something else), they do tend to overlap.

Thirdly, if you mean using the same ability result a non-working spell, it's because the spell isn't MUI: Multi Unit Instanceable = supporting many units casting the same spell at the same time.

To make it, do this:

  • Trigger1
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hash = (Last created Hashtable)
  • Trigger2
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast Equal to Divine Blessing
  • Actions
    • Special Effect - Create a special effect on head of (Target unit of ability being cast), using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
    • Special Effect - Destroy (Last created special effect)
    • Unit - Make (Target unit of ability being cast) Invulnerable
    • Hashtable - Save Timer1 as (Key(timer)) of (Key(Target unit of ability being cast)) in Hash
    • Countdown Timer - Start (Load (Key(timer)) of (Key(Target unit of ability being cast)) in Hash) as a one-shot timer that will expire in ((Real(Level of (Ability being cast) for (Triggering unit)) * 15) seconds
    • Hashtable - Save (Target unit of ability being cast) as (Key(target)) of (Key(Last started timer)) in Hash
  • Trigger3
  • Events
    • Time - Timer1 expires
  • Conditions
  • Actions
    • Unit - Make (Load (Key(target)) of (Key(Expiring Timer)) in Hash) Vulnerable
    • Hashtable - Clear all hashtables of child (Key(Load Key(target) of Key(Expiring Timer)) in Hash)
    • Hashtable - Clear all hashtables of child (Key(Expiring timer)) in Hash
For info, visit these pages:
http://www.hiveworkshop.com/forums/tutorials/
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/starting-gui-64286/
 
Level 7
Joined
Dec 8, 2008
Messages
243
How did you get the "Wait ((Level of (Ability being cast) for (Triggering unit)) * 15) seconds" trigger? I cant seem to find this anywhere.
 
Status
Not open for further replies.
Top