Make a unit perform an order from a variable?

Icyculyr

I'm a Mac
Reaction score
68
Ok, I have this:

Trigger:
  • Map Orders
    • Events
      • Unit - A unit Is issued an order targeting an object
      • Unit - A unit Is issued an order targeting a point
      • Unit - A unit Is issued an order with no target
    • Conditions
      • ((Triggering unit) is an illusion) Equal to False
      • ((Unit-type of (Triggering unit)) is A Hero) Equal to False
    • Actions
      • Set PN = ((Player number of (Owner of (Triggering unit))) - 1)
      • Set oLastOrder[PN] = (Issued order)


What command can I do to make my unit follow oLastOrder[PN]?

Kind Regards
 

Yizzy

New Member
Reaction score
20
You need diffrent commands for diffrent types of orders,
A unit Is issued an order with no target:
Trigger:
  • Custom script: call IssueImmediateOrder( GetTriggerUnit(), udg_oLastOrder[udg_PN])

A unit Is issued an order targeting a point:
Trigger:
  • Custom script: call IssuePointOrderLoc( GetTriggerUnit(), udg_oLastOrder[udg_PN], GetOrderPointLoc())

A unit Is issued an order targeting an object:
Trigger:
  • Custom script: call IssueTargetOrder( GetTriggerUnit(), udg_oLastOrder[udg_PN], GetOrderTarget() )
 

Icyculyr

I'm a Mac
Reaction score
68
Thanks, is there a way to detect what type of order was issued? from the variable, or should I just use three separate triggers? and another variable to track what type it is?

Kind Regards
 

Icyculyr

I'm a Mac
Reaction score
68
Why does this custom script show this error?

Trigger:
  • Custom script: call IssuePointOrderLoc(GetTriggerUnit(), udg_oLastOrder[udg_PN], GetOrderPointLoc())

It says "Invalid Argument Type (integer)"

EDIT: oops was supposed to be a new thread, anyways?

Kind Regards
 

Icyculyr

I'm a Mac
Reaction score
68
Thanks, what about these?

Trigger:
  • Custom script: call IssueImmediateOrder(GetTriggerUnit(), udg_oLastOrder[udg_PN])


Trigger:
  • Custom script: call IssueImmediateOrder(GetTriggerUnit(), udg_oLastOrder[udg_PN])


EDIT NVM Guessed them, just added ByID at the end of the function

EDIT 2 NVM I guessed wrong, the trigger was disabled, any know how to fix them?

EDIT 3 ... Lolz, ID to Id, working now thx

Kind Regards
 
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