• 🏆 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] Targeting problem

Status
Not open for further replies.
Level 9
Joined
Dec 6, 2007
Messages
233
I have a trigger that makes an artillery cannon fire at a point.
  • Artillery
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Target
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • Unit - Create 1 Artillery target for Neutral Passive at (Target point of ability being cast) facing Default building facing degrees
      • Set Artillery_target = (Last created unit)
      • Wait 5.00 seconds
      • Unit - Change ownership of Artillery to (Owner of (Triggering unit)) and Retain color
      • Unit - Order Artillery to Neutral Tinker - Cluster Rockets (Position of Artillery_target)
      • Wait 1.50 seconds
      • Unit - Change ownership of Artillery to Neutral Passive and Retain color
      • Unit - Kill Artillery_target
Explanation: the wait 5 seconds is so the enemy has time to react to the sudden appearance of the target. Ownership is briefly changed so the kills count toward the player who used it (the artillery itself is neutral).

Supposedly, the artillery will target the dummy unit. but the dummy unit, for some reason, keeps spawning in the center of playable map area. The "target" ability is based off shock wave. Any ideas on why the dummy unit won't go to target point of ability being cast?
 
Level 9
Joined
Dec 6, 2007
Messages
233
It's not the event that is the problem, it's the dummy unit. The dummy unit is supposed to spawn at the spot you selected with the "target" ability. The "artillery" ability targets the dummy. for some reason, the dummy keeps spawning in center of playable map area instead of point of ability being cast
 
Level 5
Joined
Jan 3, 2008
Messages
164
Try putting "Unit - Create 1 Artillery target for Neutral Passive at (Target point of ability being cast) facing Default building facing degrees" before the unit is ordered to stop the ability.. Also, "Triggering unit" and those kind of lines don't always work after a Wait action, so in the beginning you should store the caster in a variable, and store the target point of ability in a variable as well.
 
Level 24
Joined
May 9, 2007
Messages
3,563
  • Unit - Change ownership of Artillery to (Owner of (Triggering unit)) and Retain color
  • Unit - Order Artillery to Neutral Tinker - Cluster Rockets (Position of Artillery_target)

Where are you defining "Artillery"?

Anyway, do try the other ability triggers, but I would also like to advise you to read about leaks. It would be easier to do it like this too.

Unit Starts effect of ability <Trigger Ability>

Set TempPoint1 = Location of Triggering Unit

Set TempPoint2 = Location of Ability Being Cast

Create <dummy> for owner of triggering unit at TempPoint1

Order LastCreated Unit to Orc Chieftan Shockwave at TempPoint2

Add Exparation Timer to Last Created Unit 2 seconds.

customscript: call RemoveLocation(udg_TempPoin21)
customscript: call RemoveLocation(udg_TempPoint2)
 
Level 9
Joined
Dec 6, 2007
Messages
233
Thanks, it works now. How it works is i have the artillery, and the control center. the artillery is neutral, the control center can be captured. wherever the control center "targets", there is a 5 second delay, then artillery fires a 5-bullet barrage (based of cluster rockets).
 
Status
Not open for further replies.
Top