Tom212 11 Posted September 8, 2020 (edited) Hey all, I've written some scripts that accept objects as parameters but if I try to execute them inside an object's init while parsing 'this' I get undeclared variable errors. Is there anyway around this? Thanks in advance! Edited September 8, 2020 by Tom212 Solved. Share this post Link to post Share on other sites
Harzach 2517 Posted September 8, 2020 Share your code. Share this post Link to post Share on other sites
Tom212 11 Posted September 8, 2020 I'm running this in the init line of an object. Attempting to hand over 'this' as a parameter to be used inside of hackingDevice.sqf. The scripts themselves work fine, I know this because I've been using them up until now using declared variables instead of magic variables and they function as expected, I haven't shared those to avoid confusion. My question is specifically regarding the use of the 'this' magic variable as a parameter. this addAction ["Hack Dish", {[this, 0.4, "scripts\Hacking\Outcomes\dishHacked.sqf"] execVM "scripts\Hacking\hackingDevice.sqf";}, nil, 1.5, false, true, "", "true", 5]; Share this post Link to post Share on other sites
Harzach 2517 Posted September 8, 2020 https://community.bistudio.com/wiki/addAction this addAction [ "Hack Dish", { params ["_target", "_caller", "_actionId", "_arguments"]; [_target, 0.4, "scripts\Hacking\Outcomes\dishHacked.sqf"] execVM "scripts\Hacking\hackingDevice.sqf"; }, nil, 1.5, false, true, "", "true", 5 ]; 1 Share this post Link to post Share on other sites
Tom212 11 Posted September 8, 2020 26 minutes ago, Harzach said: https://community.bistudio.com/wiki/addAction this addAction [ "Hack Dish", { params ["_target", "_caller", "_actionId", "_arguments"]; [_target, 0.4, "scripts\Hacking\Outcomes\dishHacked.sqf"] execVM "scripts\Hacking\hackingDevice.sqf"; }, nil, 1.5, false, true, "", "true", 5 ]; Thanks for the responses, ah okay cool I see now, thanks for the help. 1 Share this post Link to post Share on other sites