• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Trigger Help

Status
Not open for further replies.
Level 4
Joined
Dec 6, 2008
Messages
84
All I'm doing is instantly moving a dummy unit and ordering it to attack another dummy unit. It doesn't work: "Attack_Dummy" moves but doesn't attack.

  • Unit - Move Attack_Dummy[((Player number of (Owner of (Ordered unit)))] instantly to (Position of (Ordered unit)), facing (Facing of (Ordered unit)) degrees
  • Unit - Order Attack_Dummy[((Player number of (Owner of (Ordered unit)))] to Attack Attack_Dummy_Target[((Player number (Owner of (Ordered unit)))]
However, if I use "create Attack_Dummy at location of unit" and then order it to attack, it works, but I can't use this because I want to preserve Attack_Dummy's weapon cooldown. Any idea why this isn't working? It seems simple enough.
 
Level 4
Joined
Dec 6, 2008
Messages
84
First part leaks of position. Copy whole trigger pls coz I cannot say what exactly is wrong... The most probadly is the position as I told. And remove the leaks.

I have this now:

  • Events
    • Unit - A unit is issued an order targeting a point
  • Conditions
    • (issued order) equal to (Order((attack + ground)))
  • Actions
    • Set Location_Hero = (Position of (Ordered unit)
    • Set Location_Attack_Ground = (Target point of issued order)
    • Unit - Kill Attack_Dummy_Target[(Player number of (Owner of (Ordered unit)))]
    • Unit - Create 1 Dummy Target for Neutral Passive at Location_Attack_Ground Facing of (Ordered unit)) degrees
    • Set Attack_Dummy_Target[(Player number of (Owner of (Ordered unit)))] = (Last created unit)
    • Unit - Move Attack_Dummy[((Player number of (Owner of (Ordered unit)))] instantly to Location_Hero, facing (Facing of (Ordered unit)) degrees
    • Unit - Order Attack_Dummy[((Player number of (Owner of (Ordered unit)))] to Attack Attack_Dummy_Target[((Player number (Owner of (Ordered unit)))]
    • Custom script: call RemoveLocation(udg_Location_Hero)
    • Custom script: call RemoveLocation(udg_Location_Attack_Ground)
It doesn't do anything =/ Should I create variables for the triggering unit and owner of triggering unit?
 
You need a wait between those two actions :/
E.g. Wait 0.3 seconds.
Else, use a timer, e.g.
Unit - Move Attack_Dummy
Set Timer1 = (Last started timer)
Countdown Timer - Start Timer1 as a one shot-timer that will expire in 0.01 seconds
...

Trigger2
Events
Timer - Timer1 expires
Conditions
Actions
Unit - Order Attack_Dummy to attack
Custom script: call DestroyTimer (udg_Timer1)
 
Level 4
Joined
Dec 6, 2008
Messages
84
You need a wait between those two actions :/
E.g. Wait 0.3 seconds.
Else, use a timer, e.g.
Unit - Move Attack_Dummy
Set Timer1 = (Last started timer)
Countdown Timer - Start Timer1 as a one shot-timer that will expire in 0.01 seconds
...

Trigger2
Events
Timer - Timer1 expires
Conditions
Actions
Unit - Order Attack_Dummy to attack
Custom script: call DestroyTimer (udg_Timer1)

Oh, okay. The only thing is I would need 12 timer triggers to make that MUI.
 
Level 4
Joined
Dec 6, 2008
Messages
84
Its the condition methinks. Remove that ugly + sign and throw "attack" and "ground" together and see what happens

That + sign is to indicate that they are concatenate strings. The condition is correct and works perfectly.
 
Level 12
Joined
Dec 10, 2008
Messages
850
Ok then, expalin then, how I'm able to use "attackground" without conflict. Just because WE desn't flag it, doesn't mean theres a problem with it. If you try converting the action Unit - Issue unit to attack ground bla bla bla, it will turn out w/e the JASS action is, with yourunit,"attackground", bla bla bla.
 
Level 4
Joined
Dec 6, 2008
Messages
84
Ok then, expalin then, how I'm able to use "attackground" without conflict. Just because WE desn't flag it, doesn't mean theres a problem with it. If you try converting the action Unit - Issue unit to attack ground bla bla bla, it will turn out w/e the JASS action is, with yourunit,"attackground", bla bla bla.

That's just how I've been told to do it, it doesn't matter.
 
Level 4
Joined
Dec 6, 2008
Messages
84
Umm, I added a wait command of a few seconds just to test if the dummy would attack but it still doesn't.

I even removed the move order and it still didn't attack... You can't give attack orders to units that were created in a different trigger? I'm totally confused.
 
Last edited:
Level 18
Joined
Feb 28, 2009
Messages
1,970
Don`t double posts before 48 hrs. Use
edit.gif
button.
 
Status
Not open for further replies.
Top