Lua questions
Posted: Fri Dec 19, 2014 6:16 pm
Lua is a great addtion to CMANO, thanks again to developers for this feature. Now I have a couple of questions:
1. How to use UnitX feature? I've setup a trigger "unit remains in area" and added Lua script action. The event is fired and so is the script, but I don't know how to use UnitX to get to the unit that triggered event. I've tried:No luck
No luck either.
2. Is there a way to do some debug printing in actions? print() works in script console, but I don't see output when script is run as action.
1. How to use UnitX feature? I've setup a trigger "unit remains in area" and added Lua script action. The event is fired and so is the script, but I don't know how to use UnitX to get to the unit that triggered event. I've tried:
Code: Select all
my_var=UnitX
my_var=ScenEdit_GetUnit({side="A", name=my_var})
ScenEdit_AddReferencePoint({side="A", name=my_var, latitude="N54.44.42", longitude="E18.48.42"})
Code: Select all
my_var=UnitX.name
ScenEdit_AddReferencePoint({side="A", name=my_var, latitude="N54.44.42", longitude="E18.48.42"})
2. Is there a way to do some debug printing in actions? print() works in script console, but I don't see output when script is run as action.