• 🏆 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] Trigger doesnt create unit at point.

Status
Not open for further replies.
Level 25
Joined
May 11, 2007
Messages
4,651
  • Raw Power lvl1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Raw Power (Bullen)
      • (Level of Raw Power (Bullen) for HeroBullen) Equal to 1
    • Actions
      • Set BullenFacingAngle = (Facing of (Casting unit))
      • Set BullenUnitType = Raw Power Dummy (Bullen lvl1)
      • Set BullenPoint1 = (Position of (Casting unit))
      • Set BullenPoint2 = (BullenPoint1 offset by 100.00 towards BullenFacingAngle degrees)
      • Set BullenPoint3 = (BullenPoint1 offset by 300.00 towards BullenFacingAngle degrees)
      • Set BullenPoint4 = (BullenPoint1 offset by 600.00 towards BullenFacingAngle degrees)
      • Unit - Create 1 BullenUnitType for (Owner of (Casting unit)) at BullenPoint2 facing BullenFacingAngle degrees
      • Unit - Add a 2.00 second Water Elemental expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
      • Special Effect - Create a special effect at BullenPoint2 using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.15 seconds
      • Unit - Create 1 BullenUnitType for (Owner of (Casting unit)) at BullenPoint3 facing BullenFacingAngle degrees
      • -------- Doesn't Create the dummy --------
      • Unit - Add a 2.00 second Water Elemental expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
      • Special Effect - Create a special effect at BullenPoint3 using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Wait 0.15 seconds
      • Unit - Create 1 BullenUnitType for (Owner of (Casting unit)) at BullenPoint4 facing BullenFacingAngle degrees
      • -------- No unit is made here!! --------
      • Unit - Add a 2.00 second Water Elemental expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
      • Special Effect - Create a special effect at BullenPoint4 using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation( udg_BullenPoint1)
      • Custom script: call RemoveLocation( udg_BullenPoint2)
      • Custom script: call RemoveLocation( udg_BullenPoint3)
      • Custom script: call RemoveLocation( udg_BullenPoint4)
The thing is that it works perfectly fine at the first Dummy, creating one. But when the other two are supposed to happen, it only creates the special effect (Thunder Clap) but not the dummy, any reason for this?
 
Level 5
Joined
Jul 14, 2008
Messages
121
For some wierd reason in GUI when you create more then 1 dummy in the same trigger it bug. Yeah waits are very buggy, they can't really be under 0.27 second. Try making a second trigger that will create your dummy every 0.15 sec.

This bug happened to me a lot it's very annoying you just have to find other ways to make the same trigger.

Edit: If you want I can make the spell for you.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Yeah waits are very buggy, they can't really be under 0.27 second. Try making a second trigger that will create your dummy every 0.15 sec.
Almost correct: a wait will give a random value between [your value] and [your value + 0.10].
When your value is lower than 0.20, it will be set to 0.20.

So there is about 10% chance that a number lower than 0.20 will results in 0.27 seconds.
I have no idea why this happens, I've just tested it with a simple loop and a calculator that calculated the avarage amount, the max and minimum amount and how much they appeared.


The reason it does not work is probably because you use "Owner of (Casting Unit)", the casting unit does not work with waits, it will be set to "No Unit", so you pick the owner of no unit -> no player.
Set the unit to a variable and then try again.
 
Level 5
Joined
Jul 14, 2008
Messages
121
There I made one that should be working.

  • Spell Trigger 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to [Your Spell]
    • Actions
      • Set SpellCaster = (Triggering unit)
      • Set SpellLoc[1] = (Position of SpellCaster)
      • Set SpellLoc[2] = (Target point of ability being cast)
      • Set SpellAngle = (Angle from SpellLoc[1] to SpellLoc[2])
      • Set SpellLoc[3] = (SpellLoc[1] offset by 100.00 towards SpellAngle degrees)
      • Set SpellLoc[4] = (SpellLoc[1] offset by 300.00 towards SpellAngle degrees)
      • Set SpellLoc[5] = (SpellLoc[1] offset by 600.00 towards SpellAngle degrees)
      • Set SpellInteger = 2
      • Trigger - Turn on Spell Trigger 2 <gen>
      • Countdown Timer - Start SpellTimer as a One-shot timer that will expire in 47.00 seconds
      • Countdown Timer - Create a timer window for SpellTimer with title Spell Timer
      • Set SpellTimerWindow = (Last created timer window)
      • Countdown Timer - Hide SpellTimerWindow
      • Custom script: call RemoveLocation(udg_SpellLoc[1])
      • Custom script: call RemoveLocation(udg_SpellLoc[2])
  • Spell Trigger 2
    • Events
      • Time - Every 0.15 seconds of game time
    • Conditions
    • Actions
      • Set SpellInteger = (SpellInteger + 1)
      • Unit - Create 1 [Your Dummy] for (Owner of SpellCaster) at SpellLoc[SpellInteger] facing Default building facing degrees
      • Unit - Set level of [Your Dummy Spell] for (Last created unit) to (Level of [Your Spell] for SpellCaster)
      • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Special Effect - Create a special effect at SpellLoc[SpellInteger] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
  • Spell Trigger 3
    • Events
      • Time - SpellTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy SpellTimerWindow
      • Trigger - Turn off Spell Trigger 2 <gen>
      • Custom script: call RemoveLocation(udg_SpellLoc[3])
      • Custom script: call RemoveLocation(udg_SpellLoc[4])
      • Custom script: call RemoveLocation(udg_SpellLoc[5])
I didn't tested it, I hope it work.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Almost correct: a wait will give a random value between [your value] and [your value + 0.10].
When your value is lower than 0.20, it will be set to 0.20.

So there is about 10% chance that a number lower than 0.20 will results in 0.27 seconds.
I have no idea why this happens, I've just tested it with a simple loop and a calculator that calculated the avarage amount, the max and minimum amount and how much they appeared.


The reason it does not work is probably because you use "Owner of (Casting Unit)", the casting unit does not work with waits, it will be set to "No Unit", so you pick the owner of no unit -> no player.
Set the unit to a variable and then try again.

Triggering Unit.

Waits work like that because they are synced with the rest of the players and that takes time.
 
Level 25
Joined
May 11, 2007
Messages
4,651
Almost correct: a wait will give a random value between [your value] and [your value + 0.10].
When your value is lower than 0.20, it will be set to 0.20.

So there is about 10% chance that a number lower than 0.20 will results in 0.27 seconds.
I have no idea why this happens, I've just tested it with a simple loop and a calculator that calculated the avarage amount, the max and minimum amount and how much they appeared.


The reason it does not work is probably because you use "Owner of (Casting Unit)", the casting unit does not work with waits, it will be set to "No Unit", so you pick the owner of no unit -> no player.
Set the unit to a variable and then try again.

I'll try that, thanks :)

Save TriggeringUnit (faster than casting unit) in a variable, but you'll have to find a way to make it MUI.

No real need for multicast, it's for one hero only (Only one player can have him).
 
Level 6
Joined
Mar 26, 2008
Messages
239
In my case it also sometimes forget triggering unit, thats why I said putting it in a variable.
What trigger can forget triggering unit???:eekani:

And it's not about remember/forget, just these units,locations,etc. change if someone other cast an ability or something else (depends on event),but triggering unit cannot be changed,because triggering unit is different for every trigger's run,but such things as attacking unit or other can be changed.
Well,I cannot explain it completely because English is not my native language=)
 
Status
Not open for further replies.
Top