• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

GUI Spell

Status
Not open for further replies.
Level 2
Joined
Jul 30, 2007
Messages
19
I have made a spell that is supposta` hit every enemy unit within 350 of the casting unit, it works. Problem is ti hits all allies and the casting unit. Any advice on how to fix this?
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Kablastum
  • Actions
  • Unit Group - Pick every unit in (Units within 350.00 of (Position of (Casting unit))) and do (Actions)
  • Loop - Actions
  • Unit - Cause (Triggering unit) to damage (picked unit. dealing (50.00x(Real((Level of Kablastum for (Triggering unit))))) damage of attack type Splls and damage type fire
  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
 
Level 15
Joined
Sep 3, 2006
Messages
1,738
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Kablastum
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (50.00x(Real((Level of Kablastum for (Triggering unit))))) damage of attack type Spells and damage type Fire
          • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Custom script: call RemoveLocation(udg_TempPoint)
Try this. It uses a variable called "TempPoint" which is a Point.
 
I'm not having my worldeditor open right now, but I'll try my best :)

  • Melee Initialization
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Kablastum
  • Actions
  • Set TempPoint = (Position of (Triggering unit))
  • Unit Group - Pick every unit in (Units within 540.00 of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
  • Loop - Actions
    • If/Then/Else(Picked unit is alive = true)
    • Then
    • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (50.00x(Real((Level of Kablastum for (Triggering unit))))) damage of attack type Spells and damage type Fire
    • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
    • Special Effect - Destroy (Last created special effect)
    • Else
  • Custom script: call RemoveLocation(udg_TempPoint)
It's almost the same as En_Fuego trigger, but he forgot some things, this should work.
 
Level 2
Joined
Jul 30, 2007
Messages
19
Woaahhh... that looks sweet, but i cant find those options =\ such as the new unit group action and the three if/then/else(Picked unit is alive = true) then and else lol =\
 
Well, I don't know how much you know about variables or leaks, but I've added comments to all actions, explaining what they do.


Basics: A variable is a collector that can store data, such as integers (number such as, 1,2,3, 4,5, 6, 7, 8, etc) or reals (decimals, 0.00, 0.01, 3.23, 54.23, etc), and alot of other variables.

To open the variable window you'll have to press Ctrl + B while you have your trigger editor open or you can simply press the Golden X at the top menu.

Step 1,
> While you have your variable window open, press Ctrl + N or pres the green X to open a new window.

Step 2,
> In this new window you can select a variable and select an option if you want the variable to be an array or not (arrays = you can store alot of data with the same variable)

Step 3,
> Select a variable in the scroll menu and then type a name for your variable in the Variable Name textbox.

Step 4,
> Press the little square with the text Array if you want the variable to be an array.

Step 5,
> Press the OK button and you're done creating your variable!



A leak is simply a stored data thing that haven't been deleted and still uses the computers RAM. When alot unused data is still in the game eating the computers RAM your Warcraft III game will run slower and slower after the time goes. That's why it's important to remove leaks.

A simple custom script action to remove a leak may be:
  • Custom script: call RemoveLocation(udg_TempPoint)
This custom script will remove a leak from a point variable.

Once you've used your variable and have no need of it anymore you'll have to remove it.


I hope this information helped you abit, tell me if you don't understand something.

Well, my trigger uses four variables, those:
1 Unit Group variable named UnitGroup
1 Point variable named TempPoint
2 Real variables named SpellDamage and SpellAoE

None of those variables uses the Array option!


Create those variables and copy this trigger:


  • Your Ability Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YOUR ABILITY
    • Actions
      • -------- This action sets the position of the ability using unit. --------
      • Set TempPoint = (Position of (Triggering unit))
      • -------- This action is were you set how much AoE (Area of Effect) your ability will have. --------
      • Set SpellAoE = 350.00
      • -------- This action do you set to how much damage the ability will cause. --------
      • Set SpellDamage = (50.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))
      • -------- This action set a special unit group that lay what units will be picked, in this case all enemies of the caster. --------
      • Set UnitGroup = (Units within SpellAoE of TempPoint matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))
      • -------- This action picks all units that the UnitGroup has been set to. --------
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • -------- This If/Then/Else action checks if the picked unit is alive or not, if it is alive, then the Then actions will run, or else till the Else actions run. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • -------- This action damages the picked unit with the amount your SpellDamage variable has been set to. --------
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing SpellDamage damage of attack type Spells and damage type Fire
              • -------- This action creates the special effect attached to the chest of the picked unit. --------
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
              • -------- This action removes the special effect immediately, don't worry, the special effect will still show, because it has no birth animation. --------
              • -------- You'll have to remove special effects or else they'll cause leaks. --------
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • -------- Those two actions are custom scripts that will remove leaks, or else your game will run slower. --------
      • -------- This custom script action will remove the location leak --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • -------- This custom script action will remove the unit group leak. --------
      • Custom script: call DestroyGroup(udg_UnitGroup)


GL & HF :D
 
Level 1
Joined
Jul 4, 2009
Messages
3
Like when the spell casts it would add the casting unit and allied units to the unit group that would take damage. I thank you for your help aswell :)
 
He leaks only unit group.

No, you are wrong. He leak two leaks.

This unit group action AND (check the red colored)
Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit)) matching (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)) and do (Actions)
 
Level 15
Joined
Sep 3, 2006
Messages
1,738
Sorry to keep it going, but I was just giving him a rough draft of what to do. Seriously, if you just make people triggers they never learn. They only become more dependent. Yeah, I left out some stuff that I probably should have kept. Sorry I wrote the trigger by hand.

Oh well.
 
Status
Not open for further replies.
Top