• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] More Custom Spell Troubles ( Hopefully Simple )

Status
Not open for further replies.
Level 2
Joined
Apr 29, 2012
Messages
20
Came across some more issues on another spell im trying to make. What I want to happen is your unit seemingly dissappears ( hence the hide functions ) then reappars at the targetted enemy shortly afterwards, with a big special effect. here's my triggers so far:

  • Grand Discharge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grand Discharge
    • Actions
      • Unit - Pause (Triggering unit)
      • Unit - Hide (Triggering unit)
      • Wait 2.20 seconds
      • Set tempPoint[1] = (Position of (Target unit of ability being cast))
      • Unit - Unhide (Triggering unit)
      • Unit - Unpause (Triggering unit)
      • Unit - Move (Triggering unit) instantly to tempPoint[1], facing (Position of (Target unit of ability being cast))
      • Unit - Create 1 Grand Discharge for Neutral Passive at tempPoint[1] facing Default building facing degrees
      • Set GrandDischarge = (Last created unit)
      • Unit - Cause (Triggering unit) to damage circular area after 0.01 seconds of radius 450.00 at (Position of (Triggering unit)), dealing 400.00 damage of attack type Chaos and damage type Normal
      • Wait 1.10 seconds
      • Custom script: call RemoveLocation(udg_tempPoint[1])
      • Unit - Remove GrandDischarge from the game
Currently, my hero disappears, then reappears in the same spot. i tested it a couple of times, and one of the times my hero actually died somehow, lol.

Thats the main issue, but I have another problem aswell.

For the special effect, i have created a unit and changed the model to the effect. I can see the unit effect fine when placed in the editor, but ingame the effect is nowhere to be found!

Anyone have any ideas on these two questions?
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
You CANNOT have a wait between GetSpellTargetUnit/TriggerUnit/Etc. being referenced.

In other words:

You get the name of SpellTargetUnit, then wait 5 seconds in the same trigger and try to get the name again, you will get null.

What you need to do is save those to a variable right at the beginning. I prefer local variables for MUI, but global variables will work if you dont give the spell to anyone but one unit.

So, save TriggeringUnit and SpellTargetUnit to different variables. (Not too different from how you saved the newly made unit)

Then just use those variables instead of the GetTriggerUnit and SpellTargetUnit.

I suggest just using DestroyEffect + AddSpecialEffectLoc or Point or Target instead of using a unit. A unit typically doesn't work unless you kill the unit to get it to play it's death effect instead of remove it, which may be the problem. Or maybe you have to set its "Set Unit Animation String" or something like that to "birth" or "stand".
 
Level 2
Joined
Apr 29, 2012
Messages
20
Ah I really appreciate the help, thank you.

One thing is unfortunately I cant completely understand what you meant ( I'm stupid ) about the GetName or wait thing. Are you talking about the first wait or the second wait?

Also, I think I might have to use a unit or destructible or something for my effect, because I use a imported effect, but enlarged like 5x by increasing unit size.

EDIT: After I posted I think i may have figured out what you meant. Do you mean ( triggering player ) stops working after a wait function?
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
Yar, that's what I mean. Anything like that stops working after a wait function.

You may just have to do that for your effect too. I'm not sure what effect you're using.

I know this:

  • Animation - Play GrandDischarge's birth animation
May help you, depending on if you want to do the birth, death, or stand animation. If the model/effect has no animations, then you can always try the stand animation.

I haven't tested this though. For all I know your model may use ribbons which don't scale/scale well.
 
Level 2
Joined
Apr 29, 2012
Messages
20
Ok I revised my trigger a bit ( and learned a few things in the process ) here it is:

  • Grand Discharge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grand Discharge
    • Actions
      • Set DischargeTarget = (Target unit of ability being cast)
      • Set DischargeCaster = (Casting unit)
      • Set tempPoint[1] = (Position of DischargeTarget)
      • Unit - Pause DischargeCaster
      • Unit - Hide DischargeCaster
      • Wait 2.20 seconds
      • Unit - Unhide DischargeCaster
      • Unit - Unpause DischargeCaster
      • Unit - Move DischargeCaster instantly to tempPoint[1], facing (Position of DischargeTarget)
      • Unit - Create 1 Grand Discharge for Neutral Passive at tempPoint[1] facing Default building facing degrees
      • Set GrandDischarge = (Last created unit)
      • Unit - Cause DischargeCaster to damage circular area after 0.01 seconds of radius 450.00 at (Position of (Triggering unit)), dealing 400.00 damage of attack type Chaos and damage type Normal
      • Wait 1.10 seconds
      • Custom script: call RemoveLocation(udg_tempPoint[1])
      • Unit - Remove GrandDischarge from the game
Unfortunately it still doesn't work. My hero disappears and appears in same spot again. I wonder, does hide or pause prevent the unit from being used in triggers??

Also, I have the same effect set to appear on my caster in ability editor, however when I cast it ingame nothing appears on me ingame. The custom effect looks great in world editor, is it possible it just doesnt work ingame for some reason?










EDDDDDDDDDIIIIIIIIIITTTTTTT: Ohhhhhhhhhh myyyyyy gooooddddnesssss

I forgot I had recently saved as copy "backup" in a different location, so every time i made a change it didnt affect the map I was trying to test the change on...................................Well the spell works :D Looolll

Thanks for all the help!
 
Last edited:
Level 2
Joined
Apr 29, 2012
Messages
20
Glad it works. I've been there before, saving and testing the wrong vers.

Anyways, for your question it is possible. I couldn't tell you, I don't what the effect is. Make sure it has a death animation I guess.

Luckily that problem was fixed when I started testing the correct map xP. But yeah, I didnt notice until I tried testing some new terrain and it didn't appear. Was like "oshi"

Leak: (Position of DischargeTarget)
Leak: (Position of (Triggering unit))
Damages all units, including the caster: Unit - Cause DischargeCaster to damage circular area...

Yeah im new to fixing leaks, I only know about "remove temp point" and "clear group" or whatev's.

Here's what I have so far, and it works pretty good except for one thing:

  • Grand Discharge
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Grand Discharge
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Set DischargeTarget = (Target unit of ability being cast)
      • Set tempPoint[1] = (Position of DischargeTarget)
      • Set DischargeCaster = (Casting unit)
      • Set tempPoint[2] = (Position of DischargeCaster)
      • Special Effect - Create a special effect at tempPoint[2] using war3mapImported\LightningWrath.mdx
      • Wait 0.10 seconds
      • Unit - Hide DischargeCaster
      • Unit - Pause DischargeCaster
      • Wait 2.20 seconds
      • Special Effect - Destroy LightningDischarge
      • Unit - Unhide DischargeCaster
      • Unit - Unpause DischargeCaster
      • Unit - Move DischargeCaster instantly to tempPoint[1], facing (Position of DischargeTarget)
      • Unit - Create 1 Grand Discharge for Neutral Passive at tempPoint[1] facing Default building facing degrees
      • Set GrandDischarge = (Last created unit)
      • Unit Group - Pick every unit in (Units within 375.00 of (Position of DischargeCaster) matching ((Owner of (Picked unit)) Equal to Player 11 (Dark Green))) and do (Unit - Cause DischargeCaster to damage (Picked unit), dealing 300.00 damage of attack type Chaos and damage type Normal)
      • Unit Group - Pick every unit in (Units within 375.00 of (Position of DischargeCaster) matching (((Picked unit) is A Hero) Equal to True)) and do (Do nothing)
      • Selection - Select DischargeCaster for (Owner of DischargeCaster)
      • Wait 1.10 seconds
      • Custom script: call RemoveLocation(udg_tempPoint[1])
      • Custom script: call RemoveLocation(udg_tempPoint[2])
      • Unit - Remove GrandDischarge from the game
I also want the spell to give any nearby hero's an attack speed buff. I was glancing through the triggers and couldnt find one for "Add buff" or something. I think I heard someone say something about "dummy units" sometime, do I need those?
 
Level 13
Joined
Jul 26, 2008
Messages
1,009
Yeah, you need dummy casters. They are just special models with special unit properties. You create one with a trigger, give it the spell you want to cast on individual units, and order it to cast that spell on something (Giving them a buff or effect, like bloodlust for example) and then have it dissappear after a second by setting it to a Applied Life Timer.
 
Level 2
Joined
Apr 29, 2012
Messages
20
Yeah I thought it was something like that. Before I get started messing around with dummies, will I need one dummy unit for each Hero within range? Or can 1 dummy unit instantly cast it on all Heroes?
 
Status
Not open for further replies.
Top