- Joined
- Jan 9, 2016
- Messages
- 1,487
How do you detect if deez unit face dat unit?
Can you explain how I can use that system? Its a bit confusing and I can't do custom scripts without proper instructions or an example.
Where angleMargin is how strictly "facing" they need to be.
Custom script: call IsUnitFacingUnit(DeezUnit, DatUnit, angleMargin)
IsUnitFacingUnit(DeezUnit, DatUnit, angleMargin)
returns a boolean, you can just put it inside some JASS if statements.Well given thatIsUnitFacingUnit(DeezUnit, DatUnit, angleMargin)
returns a boolean, you can just put it inside some JASS if statements.
Alternatively, if you want to avoid using a lot of custom script, you can store it into a global boolean variable.
Custom script: if (IsUnitFacingUnit(DeezUnit, DatUnit, angleMargin)) then
-------- do stuff --------
Custom script: endif
Custom script: set udg_SomeBoolean = IsUnitFacingUnit(DeezUnit, DatUnit, angleMargin)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SomeBoolean Equal to True
Then - Actions
-------- unit is facing unit; do stuff--------
Else - Actions
-------- unit is not facing unit --------
DeezUnit
is facing DatUnit
. If DeezUnit
is not facing DatUnit
however,nothing will be triggered. So no "Else" action means less lines.I'm sorry I'm a little confused, but simply calling the function as pOke did isn't going to do anything. You have to do either one of the suggestions I showed you![]()