• 🏆 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!

create a dummy at attachment position?

Status
Not open for further replies.
Level 22
Joined
Feb 4, 2005
Messages
3,971
I am making a flying unit shoot from more than 1 place, that is I need to create a DUmmy at the Weapon attachment point of the flying unit and order it to attack, thus making the 'additioinal attack'. The flying unit has the attachment point but I dont see a trigger to create it exactly at the position of the flying unit's attachment

Is there something like create 1 (unit) at (Weapon attachment position) of the flying unit ? I can set insantly flying height to be the same but I need to 'attach' the dummy to the Weapon attachment point and order than dummy to shoot.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
There is no way to determine where a target attachment point is (in coordinates). I think your best bet would be to manually hard-code values for the offsets that you want to be used on each unit, after all, attachment points are just offsets from the unit's position.
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Ok then, if you create a unit at position of a unit, basically it is created in the center of the unit.

So I just need to create the 2 Dummies, one on the left of the Unit (for flying unit's left wing) and one on the right of the unit (for it's right wing). What would be the trigger for 'left and 'right of a unit, there I can test how much on the left and how much on the right.
 
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • Set Points[1] = (Position of (Triggering unit))
    • For each (IntegerA) from 1 to 2, do (Actions)
      • Loop - Actions
        • Set Points[2] = (Points[1] offset by 50.00 towards ((Facing of (Triggering unit)) + (250.00 / (Real(IntegerA))) degrees)
        • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Points[2] facing (Facing of (Triggering unit))
        • Custom script: call RemoveLocation (udg_Points[2])
    • Custom script: call RemoveLocation (udg_Points[1])
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
Thanks Pharaoh! I couldn't make it from the weapon edges exactly but it still fires from the wings, so that's fine. I just modified your trigger a little to fit my taste, as I didn't want the two to shoot at the same time. You too Burb
reputation_smallpos.gif


  • Multi-Attack
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Battlecruiser
    • Actions
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • Wait 0.50 seconds
          • Unit - Create 1 |c0045ACF6Energy|r for Player 7 (Green) at ((Position of (Attacking unit)) offset by 100.00 towards ((Facing of (Attacking unit)) + (250.00 / (Real((Integer A))))) degrees) facing (Facing of (Attacking unit)) degrees
          • Unit - Order (Last created unit) to Attack (Attacked unit)
      • For each (Integer B) from 1 to 1, do (Actions)
        • Loop - Actions
          • Wait 0.50 seconds
          • Unit - Create 1 |c0045ACF6Energy|r for Player 7 (Green) at ((Position of (Attacking unit)) offset by -100.00 towards ((Facing of (Attacking unit)) + (250.00 / (Real((Integer B))))) degrees) facing (Facing of (Attacking unit)) degrees
          • Unit - Order (Last created unit) to Attack (Attacked unit)
 
Status
Not open for further replies.
Top