kvntvan 13 Posted August 20, 2020 Hello, I'm trying to add a custom ace interaction to build a camp when certain conditions are met by the player. However I do not want them to be able to build a second camp after the first is already built, I thought the easiest way to accomplish this was by setting a publicvariable to true and to only have the action available when the variable was false. this is what the add ace interaction code looks like if !(hasInterface) exitWith {}; _condition = { ('murshun_cigs_lighter' in (VestItems player + Uniformitems player + backpackItems player)) && campspawn == false; }; _statement = { execVM "Camp_Script\spawn.sqf"; }; _build = ["buildcamp","Build Camp","\a3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_fire_in_flame_ca",_statement,_condition] call ace_interact_menu_fnc_createAction; [(typeOf player), 1, ["ACE_SelfActions"], _build] call ace_interact_menu_fnc_addActionToClass; the part I'm having problems with is the second part of the condition, the entire code worked perfectly until I added this line && campspawn == false; additional things I added, I added this campspawn = false; publicVariable "campspawn"; into my init.sqf placed campspawn = true; into the end of my camp building script and campspawn = false; into my camp packing script. But I get this error when loading into the game It says the error is a missing ";" but I don't think thats the actual issue because I've tried it with and without semicolons and have tried semicolons in a few different places to no avail, so would anyone happen to know what I'm doing wrong? Share this post Link to post Share on other sites
Harzach 2517 Posted August 20, 2020 A "missing ;" error is generally not literal - it means something is wrong with the code in such a way that the engine expects the expression to end somewhere it doesn't. In this case, the error message shows one "=" where there should be two, so it thinks the condition should actually end with "campspawn" (I.E. checking if campspawn is true). 1 Share this post Link to post Share on other sites
pierremgi 4862 Posted August 20, 2020 more exactly: ... && ! campspawn instead of ... && campspawn = false 2 Share this post Link to post Share on other sites
kvntvan 13 Posted August 20, 2020 ah thank you guys that pretty much worked perfectly! Share this post Link to post Share on other sites