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
 
---

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

ReplaceableTextures\DisabledCommandButtons\DISBTNiconname.jpg

or

ReplaceableTextures\CommandButtonsDisabled\DISBTNiconname.jpg

the second... Replaceable...\CommandButtonsDisabled\...
 
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
 
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.
 
@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.
 
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 The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/
  • The Helper The Helper:
    Happy Thursday!
  • Ghan Ghan:
    I'm not so sure, there's still a lot of Thursday left for it to become unhappy.
    +3
  • The Helper The Helper:
    still a few hours
  • The Helper The Helper:
    Its Friday!!!!
    +1
  • Ghan Ghan:
    Thursday 7/10 would Thursday again
    +3

      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