LizardX 0 Posted March 31, 2003 Good afternoon, is there anyone who could help me? I'd like to know how I can use the "caller unit" of the "init" EH in a script. What I mean: config.cpp: init = "(_this select 0) exec ""\blabla\script.sqs"""; It works, calls the script. But if try this: script.sqs: _vehicle = _this select 0 ... there will be an error, I think because the "init" has no returning variable, it could only be "false" or "true". (???) How could I define the caller unit in the script? thx Share this post Link to post Share on other sites
suma 8 Posted March 31, 2003 You want to do one of this: Either: config.cpp: init = "(_this select 0) exec ""\blabla\script.sqs"""; script.sqs: _vehicle = _this or: config.cpp: init = "_this exec ""\blabla\script.sqs"""; script.sqs: _vehicle = (_this select 0) The explanation why is left to the reader. Share this post Link to post Share on other sites
LizardX 0 Posted March 31, 2003 Whoa, thanks, Suma, for the real fast answer. The first one already works (in 95%)! Just one word: have to apply if () then {} <= look for the different signs! My shame, it was in the comref, I wasn't smart enough. Holy syntax errors! Thx again. Share this post Link to post Share on other sites
Guest BratZ Posted March 31, 2003 Here's some I use: init="[_this select 0] exec ""\iegf4u\manager.sqs"""; gear = "if (_this Select 1) then {[_this select 0] exec ""\iegf4u\geardn.sqs""} else {[_this select 0] exec ""\iegf4u\gearup.sqs""}"; getin="this animate [""corcanopy"", 1]"; getout="this animate [""corcanopy"", 0]"; They all work Share this post Link to post Share on other sites