• 🏆 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] just a trigger needing fixing a spell ofc

Status
Not open for further replies.
Level 6
Joined
Aug 31, 2014
Messages
137
[trigger=acid arrow]
  • Acid Arrow
    • Events
      • Unit - Demon Archer 0042 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Acid Arrow
    • Actions
      • Set point = (Position of (Target unit of ability being cast))
      • Wait 2.00 seconds
      • Unit - Create 1 Dummy-2 for Player 8 (Pink) at point facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Target unit of ability being cast)
      • Wait 0.10 seconds
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation (udg_point)
dont know why the unit doesnt want to cast the spell i had other spell then the unit cast it just fine just want it to cast the spell after 2 seconds after the acid spell stun is down the dummy after that should cast acid bomb
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Try:
  • Acid Arrow
    • Events
      • Unit - Demon Archer 0042 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Acid Arrow
    • Actions
      • Wait 2.00 seconds
      • Set point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy-2 for Player 8 (Pink) at point facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Target unit of ability being cast)
      • Wait 0.10 seconds
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation (udg_point)
 
Level 25
Joined
May 11, 2007
Messages
4,651
" Wait 0.10 seconds
Unit - Remove (Last created unit) from the game"

What if a unit is created before those 0.10 seconds? Then you're going to remove it and not your dummy unit.

Add a timed life to the dummy unit instead.
 
Level 6
Joined
Aug 31, 2014
Messages
137
Try:
  • Acid Arrow
    • Events
      • Unit - Demon Archer 0042 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Acid Arrow
    • Actions
      • Wait 2.00 seconds
      • Set point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 Dummy-2 for Player 8 (Pink) at point facing Default building facing degrees
      • Unit - Order (Last created unit) to Neutral Alchemist - Acid Bomb (Target unit of ability being cast)
      • Wait 0.10 seconds
      • Unit - Remove (Last created unit) from the game
      • Custom script: call RemoveLocation (udg_point)

then a unit dosent spawn...... for some odd reson if i move the wait

[trigger=mytrigger]cripple
Events
Unit - Demon Archer 0042 <gen> Starts the effect of an ability
Conditions
(Ability being cast) Equal to Entangling Arrow
Actions
Set point = (Target point of ability being cast)
Unit - Create 1 Dummy for Player 8 (Pink) at point facing Default building facing degrees
Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Target unit of ability being cast)
Wait 0.10 seconds
Unit - Remove (Last created unit) from the game
Custom script: call RemoveLocation (udg_point)[/trigger]

this worked not sure if its just the spell because i know that you have to use the spell that is allr there in the edior
 
Last edited by a moderator:
Level 19
Joined
Jul 14, 2011
Messages
875
This should be exactly what you want:
  • Acid Arrow
    • Events
      • Unit - Demon Archer 0042 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Acid Arrow
    • Actions
      • Custom script: local unit udg_target = GetSpellTargetUnit()
      • Custom script: local location udg_point = GetUnitLoc(udg_target)
      • Custom script: local unit udg_u
      • Wait 2.00 seconds
      • Unit - Create 1 Dummy-2 for Player 8 (Pink) at point facing Default building facing degrees
      • Set u = (Last created unit)
      • Unit - Order u to Neutral Alchemist - Acid Bomb target
      • Wait 0.10 seconds
      • Unit - Remove u from the game
      • Custom script: call RemoveLocation (udg_point)
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Maybe you lose the variable "Target point of ability being cast" or "Target unit of ability being cast"...

Try this:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Entangling Arrow
    • Actions
      • Custom script: local location udg_TempLocation
      • Custom script: local unit udg_TempUnit
      • Set TempLocation = (Target point of ability being cast)
      • Set TempUnit = (Target unit of ability being cast)
      • Wait 2.00 game-time seconds
      • Unit - Create 1 DUMMY for Neutral Extra at TempLocation facing Default building facing degrees
      • Set TempUnit2 = (Last created unit)
      • Unit - Order TempUnit2 to Night Elf Keeper Of The Grove - Entangling Roots TempUnit
      • Unit - Add a 1.00 second Generic expiration timer to TempUnit2
      • Custom script: call RemoveLocation(udg_TempLocation)
      • Custom script: set udg_TempLocation = null
      • Custom script: set udg_TempUnit = null
But anyway... why do you want that wait?

EDIT:
@Gismo359
Yea you got the basics.
To tell you the difference between ours
Yours leak units and a location.
You seem familiar with the RemoveLocation() function but I mean local variables.
When you create a local variable, you create data (pointer).
You have to null that pointer again to remove that data.
All you have to do is just set the variables to null again.

Also never ever use normal waits (unless you really know what they do).
The waits that you use are not paused when the game is.
So you can create a wait for 30 seconds, pause the game, wait 30 seconds in reallife, unpause the game, and you will see that the wait has finished immediately.
 
Level 6
Joined
Aug 31, 2014
Messages
137
A arrow that is thrown at an enemy unit dealing 100 + 20 per level , stuning the target and after 2 seconds the arrow will blow up in the target's area causing 10 dmage per second and reducing the targets armor by 2 to all hit units

ty wietlol that helped alot :) +rep and gis as well :)

wietlol said:
Also never ever use normal waits (unless you really know what they do).
The waits that you use are not paused when the game is.
So you can create a wait for 30 seconds, pause the game, wait 30 seconds in reallife, unpause the game, and you will see that the wait has finished immediately.

didnt know this thank you :) learn something new eveyday

wietlol said:
Also never ever use normal waits (unless you really know what they do).
The waits that you use are not paused when the game is.
So you can create a wait for 30 seconds, pause the game, wait 30 seconds in reallife, unpause the game, and you will see that the wait has finished immediately.

didnt know this thank you :) learn something new eveyday
 
Last edited by a moderator:
Level 12
Joined
Mar 24, 2011
Messages
1,082
Another thing about waits, they have a minimal duration of ~0.27 sec and are very inaccurate as they always add some time on top of it (I do not remember exactly how much but if you search the forum you will probably find it).
 
Level 19
Joined
Jul 14, 2011
Messages
875
@Gismo359
Yea you got the basics.
To tell you the difference between ours
Yours leak units and a location.
You seem familiar with the RemoveLocation() function but I mean local variables.
When you create a local variable, you create data (pointer).
You have to null that pointer again to remove that data.
All you have to do is just set the variables to null again.

Also never ever use normal waits (unless you really know what they do).
The waits that you use are not paused when the game is.
So you can create a wait for 30 seconds, pause the game, wait 30 seconds in reallife, unpause the game, and you will see that the wait has finished immediately.

Yeah, didnt think about removing leaks. Also, I'm pretty sure a removed location is already null.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Well... the location is removed but there is still someone who redirects/points to that "location".
That is the local variable.
As long as a variable is pointing to something, that variable is using data.
When you set the variable to null, you remove that reserved piece of data.

Global variables do not have to be nulled, because they get overwritten anyway.
 
Status
Not open for further replies.
Top