OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Combat-Agent on 30 Dec 2005, 21:04:50

Title: Detecting which unit activated an action
Post by: Combat-Agent on 30 Dec 2005, 21:04:50
Is there a way to detect which unit activated an action? Here is the the syntax:

[this,(UNIT WHO ACTIVATED ACTION),"wtypeA"] exec "script.sqs"
Title: Re:Detecting which unit activated an action
Post by: THobson on 30 Dec 2005, 21:13:38
Have a look at the Comref on Addaction - particularly the notes:
http://www.ofpec.com/editors/comref.php?letter=A#addAction

_obj = _this select 0
_man = _this select 1
_index = _this select 2


_obj is the object the action is on
_man is the unit that actioned the action
_index is the action index number