Moving a unit issues

THUNDERPOWER

New Member
Reaction score
1
For some strange reason, whenever I press Z, a missile is created (as it should), however, it stops being moved after 1 second. Any help on helping me fix the problem would be greatly appreciated. (Yes, aware the triggers suck.)

Trigger:
  • Attack
    • Events
      • UI - Player Any Player presses Z key Down with shift Allow, control Allow, alt Allow
    • Local Variables
      • player = (Triggering player) <Integer>
    • Conditions
    • Actions
      • Variable - Set Untitled Variable 002 = (Facing of unitHero[player])
      • Unit - Create 1 Weapon - Default Missile for player player at (Position of unitHero[player]) facing Untitled Variable 002 degrees (No Options)
      • Unit - Make (Last created unit) face Untitled Variable 002 over 0.0 seconds
      • Variable - Set Untitled Variable 002 2 = (Last created unit)
      • Unit - Order (Last created unit) to ( Move targeting ((Position of unitHero[player]) offset by 1.0 towards Untitled Variable 002 degrees)) (Replace Existing Orders)


Trigger:
  • Attack 2
    • Events
      • Timer - Every 0.1 seconds of Game Time
    • Local Variables
    • Conditions
    • Actions
      • Unit - Order Untitled Variable 002 2 to ( Move targeting ((Position of unitHero[1]) offset by 1.0 towards Untitled Variable 002 degrees)) (Replace Existing Orders)
 

cleeezzz

The Undead Ranger.
Reaction score
268
why is the offset based on the unitHero? it should be based on the position of the missile or else it'll just be stuck next to the unitHero

(referring to the trigger Attack 2, the first trigger seems fine)
 

Kelv

TH.net Regular
Reaction score
7
He's right above. Also, you should name your variables and this trigger only allows for one missile at a time. You probably want to switch to an array.
 

THUNDERPOWER

New Member
Reaction score
1
Damn it! Must have changed this accidentally as I had it right before!

Thanks for pointing it out! :)

^^^ Also this was just a test trigger: I always name variables and do things properly in real triggers.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top