Need help on triggering a very simple spell.

Demerzel2

New Member
Reaction score
0
I'm really new to Triggering and stuff, and I want help in a spell:

1) I want to make a single target spell. Which spell do I use as a base? When I use Frost Nova, a slow effect is caused; when I use Entangle, a Vine effect. I've gotten rid of the buffs etc, but it won't work.

2) Another problem is that I set the targeted unit as a variable called 'HumbleVar'. If more than one unit uses the spell, only the last used unit will explode. I'd also like help in making a channeling spell.

(The concept of the spell is that a unit is targeted, and it goes invulnerable. After 10 seconds, it explodes. Channeling).

I'd love to attach the trigger here, but for some reason I can't really work out that trigger inserting thing.

---

A short question, which is the correct path for disabled icons?

ReplaceableTextures\DisabledCommandButtons\DISBTNiconname.jpg

or

ReplaceableTextures\CommandButtonsDisabled\DISBTNiconname.jpg
 

Laiev

Hey Listen!!
Reaction score
188
---

A short question, which is the correct path for disabled icons?

ReplaceableTextures\DisabledCommandButtons\DISBTNiconname.jpg

or

ReplaceableTextures\CommandButtonsDisabled\DISBTNiconname.jpg

the second... Replaceable...\CommandButtonsDisabled\...
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
1.) Unless you intend to have an AI system in your map, then base your spell off the neutral "channel" ability. It is amazing in that you can change the targetting method, channelling duration, and other things. Just make sure under 'data - options', you set it to 'visible'. Then use a trigger to create the necessary effects.

To insert a trigger on these forums, you use tags. Right click on your trigger's name (above events) and select 'copy as text'. Then paste your trigger in these tags: [-wc3-]trigger[-/wc3-] (without the hyphens), or highlight your trigger and click the golden "a" above the smilies.

It will then look like this:
Trigger:
  • trigger
 

tooltiperror

Super Moderator
Reaction score
231
2) Another problem is that I set the targeted unit as a variable called 'HumbleVar'. If more than one unit uses the spell, only the last used unit will explode. I'd also like help in making a channeling spell.​

The answer to this horrible problem is the JASS. But I suspect you have not the effort nor desire to learn it, so just use Hashtables.
 

Demerzel2

New Member
Reaction score
0
@Laiev, da1nOnlyEd: thanks! I've heard of this channel but I couldn't get it to display. Thanks, now this will really help me.

@ToolTipError: Yeah, I'm not. But what are hashtables? And thanks for the help.
 

N(O.O)B

New Member
Reaction score
27
For such a simple spell I would not use hashtables, as it is overly complicated. Simply use local variables. This is "sort of" JASS, but it is very easy to use in a GUI setting. A "Local Variable" is basically a variable that only exists in a single trigger, unlike a "Global Variable" which can be accessed from all triggers. Though you must use the "custom script" to initialize and use them, they can be easily used in GUI. Note that Local variables must be initialized at the start of the trigger. Here's an example of a local variable:

local unit a = GetTriggerUnit()
local indicates that you are initializing the local variable
unit indicates the type of local variable (others would be effect for special effects, real for real, integer for integer, location for points, etc)
a is the name of the local variable that you will use to refer to it later on
GetTriggerUnit() is the initial value that is given to local variable a, this is "JASS" for Event Respone - Triggering Unit (most of them are this obvious, targeted unit is GetSpellTargetUnit())

Note: you do not have to give a local variable an initial value, you can also intialize the variable by simply typing: local unit a

After initializing a local variable you can set it to a value, and use that value later on. They work just like Global Variables, except you can't set their value using GUI, however, there is an easy work-around for this, as you can set the value of a local variable to the value of a local variable, and vice versa. What this means is you can use local variables as a temporary storage place for information, and later reset it to a temporary global variable to use it in your functions! Easy as pie, right? ;)

Here's an example of a trigger:

Trigger:
  • Explode
    • Events
    • Conditions
    • Actions
      • ---First we will intialize the local variables:
      • Custom script: local unit a
      • Custom script: local effect b
      • ---They have no value, however, we can easily set their value:
      • Set TempUnit = (Target unit of ability being cast)
      • ---You should know this, this is a simple global variable function in GUI, however, now we will store this value into a local variable, this is pretty straightforward:
      • Custom script: set a = udg_TempUnit
      • ---NOTE: As you can see I used "udg_TempUnit" instead of "TempUnit" when referring to the variable. This is because ALL GLOBAL VARIABLES have to have the "udg_" prefix so warcraft can see the difference between global and local variables (it stands for User Defined Global)
      • ---Now let's set the value of "b"
      • Special Effect - Create a special effect attached to the origin of TempUnit using Abilities\Spells\Orc\Bloodlust\BloodlustTarget.mdl
      • Set TempEffect = (Last created special effect)
      • Custom script: set b = udg_TempEffect
      • ---Now b is set to an effect, and a is set to a unit. Normally we couldn't use waits and keep this MUI as, when another unit uses the same spell, the global variables would be overwritten. However, as we use locals now, we can safely use waits:
      • Wait 10.00 seconds
      • ---Now we will store the effects into globals so we can use them in GUI actions by simply reversing what we did previously:
      • Custom script: set udg_TempUnit = a
      • Custom script: set udg_TempEffect = b
      • ---And now we can use them in GUI actions:
      • Unit - Explode TempUnit
      • Special Effect - Destroy TempEffect
      • ---Note that you will ALWAYS have to null locals to prevent them from leaking (unless they are real/integer):
      • Custom script: set a = null
      • Custom script: set b = null


And an example map of the spell using local variables (using channel as a base so you can always copy that ;))
 

Attachments

  • Explode.w3x
    13.7 KB · Views: 114
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top