bolbies 13 Posted March 21, 2015 Is it possible for an addaction to call 2 completely different scripts at once? I need one that will execute a completely separate script as well as call a subscript(?). So something like this. _action = _helo addaction ["<t color='#00b7ff'>Give a LZ to the pilot</t>", {[arg1, 2, 3] call taxi; "mapclick.sqf"}, "", 0, true, true, "", "_this == player"]; Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted March 21, 2015 execute a script that executes both scripts. helo addaction ["Give LZ to Pilot","scripts.sqf"]; then in scripts.sqf null = []execVM script1.sqf; null = []execVM script2.sqf; or similar of course. Share this post Link to post Share on other sites
fight9 14 Posted March 21, 2015 Don't need a separate file. Just use execVM instead of just the quotations alone. _action = _helo addAction ["Give LZ to Pilot",{_null = [arg1, 2, 3] call taxi; _null = [] execVM "mapclick.sqf";}, "", 0, true, true, "", "_this == player"]; Share this post Link to post Share on other sites
epicgoldenwarrior 11 Posted March 21, 2015 I usually don't need to do that, it was my makeshift method. :P Share this post Link to post Share on other sites
bolbies 13 Posted March 22, 2015 Don't need a separate file. Just use execVM instead of just the quotations alone. _action = _helo addAction ["Give LZ to Pilot",{_null = [arg1, 2, 3] call taxi; _null = [] execVM "mapclick.sqf";}, "", 0, true, true, "", "_this == player"]; Oh my god I forgot execVM. Thank you! But in the taxi subscript, how would I assign those arguments? I know that typically addaction arguments would be (_this select 3) select 0; but I don't know about this. Share this post Link to post Share on other sites
fight9 14 Posted March 22, 2015 This would yield the same results as the my first post. _action = _helo addAction [ "Give LZ to Pilot", {_null = [color="#FF0000"](_this select 3)[/color] call taxi; _null = [] execVM "mapclick.sqf"}, [color="#FF0000"][arg1,2,3][/color], 0, true, "", "_this == player" ]; I made [arg1,2,3] the the third element of the addAction array, the arguments. That array becomes _this select 3 in the addAction code block. Send that array to your taxi function and presto... Share this post Link to post Share on other sites
bolbies 13 Posted March 22, 2015 Alright I got that but how do I define them in taxi? I tried what I mentioned above with _this select 3 select 0 but that doesn't work. My rpt says it's getting an object but expects an array. Share this post Link to post Share on other sites
fight9 14 Posted March 22, 2015 Your taxi function will work the same... _this select 0 is arg1 _this select 1 is 2 _this select 2 is 3 Share this post Link to post Share on other sites
bolbies 13 Posted March 22, 2015 That works thanks! Share this post Link to post Share on other sites