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: 112
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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