I would like to "Issue Order Targeting Point" to a Unit stored as a Global Variable. I would like the unit to "Move" to the Mouse-clicked (X,Y) upon a Left-click.
This trigger works correctly when the Unit is on the terrain.(1st Example) The bottom trigger, however, does not work when the Unit is stored as a Global Variable instead of being placed on the map.
Works:
Events
UI - Player Any Player clicks Left mouse button Down.
Actions
Unit - Order Archon [118.86, 132.35] to ( Move targeting (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) (Replace Existing Orders)
Doesn't Work:
Events
UI - Player Any Player clicks Left mouse button Down.
Actions
- Unit: Issue "Move" Order
Unit - Order [ENGINE] Link to ( Move targeting (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) (Replace Existing Orders)
Events
UI - Player Any Player clicks Left mouse button Down.
Local Variables
Conditions
Actions
Unit - Order all units in Unit Group to ( Move targeting relative points near (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) (Replace Existing Orders)
I would make a unit creation trigger if the unit is not already placed:
Action - Create 1 <unit type> at location
Action - Set variable <Global Unit Variable> to Last created unit
I might be off on my assumption of what your trying to do. Explain a bit more about what your trying to do and others will jump in.
I would like to "Issue Order Targeting Point" to a Unit stored as a Global Variable. I would like the unit to "Move" to the Mouse-clicked (X,Y) upon a Left-click.
This trigger works correctly when the Unit is on the terrain.(1st Example) The bottom trigger, however, does not work when the Unit is stored as a Global Variable instead of being placed on the map.
Works: Events UI - Player Any Player clicks Left mouse button Down. Actions Unit - Order Archon [118.86, 132.35] to ( Move targeting (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) (Replace Existing Orders)
Doesn't Work: Events UI - Player Any Player clicks Left mouse button Down. Actions
-Unit: Issue "Move" Order Unit - Order [ENGINE] Link to ( Move targeting (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) (Replace Existing Orders)Does this work using a unit group?
Events UI - Player Any Player clicks Left mouse button Down. Local Variables Conditions Actions Unit - Order all units in Unit Group to ( Move targeting relative points near (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world)))) (Replace Existing Orders)
i dont get your problem :D
@Mille25: Go
Ah sorry...
I'm creating a unit. Then I'm trying to order the unit to move when the player left-clicks. But the unit won't move.
Are you assigning the unit to the variable?
I would make a unit creation trigger if the unit is not already placed:
Action - Create 1 <unit type> at location
Action - Set variable <Global Unit Variable> to Last created unit
I might be off on my assumption of what your trying to do. Explain a bit more about what your trying to do and others will jump in.