Incontinentia 339 Posted July 19, 2016 Hi all, I'm trying to get a playable character starting with setcaptive true on a mission run on a dedicated server and haven't had any luck. I've tried putting "this setcaptive true;" into the unit's init and "[this setcaptive true] call BIS_fnc_MP;". Also tried setting it in the init.sqf. None of these options seems to work (along with quite a few methods I've forgotten!). Also, how would I get a script that changes the unit to setcaptive false to run properly in a MP environment as well as a SP one? Share this post Link to post Share on other sites
Incontinentia 339 Posted July 19, 2016 This is the script I'm using to switch setcaptive to false when certain conditions are met: spook sideChat (format ["Compromised"]); spotted = true; publicVariable "spotted"; [spook setcaptive false] call BIS_fnc_MP; _cooldownTimer = (60 + (random 60)); uiSleep _cooldownTimer; waituntil { uiSleep 10; ((2.2 > (INDEPENDENT knowsAbout spook)) && (2.2 > (EAST knowsAbout spook))); }; spotted = false; publicVariable "spotted"; [spook setcaptive true] call BIS_fnc_MP; //["INS_HINT_EH",["You escaped."]] call CBA_fnc_globalEvent; spook groupChat (format ["Got away with it"]); Thanks in advance to anyone that can help! Share this post Link to post Share on other sites
kylania 568 Posted July 19, 2016 // Side chat to everyone. [spook, "Compromised"] remoteExec ["sideChat"]; // Publicize spotted variable to true. missionNamespace setVariable ["spotted", true, true]; // SetCaptive on spook where spook is local since setCaptive arguments are Local [spook, false] remoteExec ["setCaptive", spook]; // Your timer thing. _cooldownTimer = (60 + (random 60)); uiSleep _cooldownTimer; // Your waituntil thing. waituntil { uiSleep 10; ((2.2 > (INDEPENDENT knowsAbout spook)) && (2.2 > (EAST knowsAbout spook))); }; // Publicize spotted to false. missionNamespace setVariable ["spotted", false, true]; // SetCaptive back to true. [spook, true] remoteExec ["setCaptive", spook]; // Group chat to everyone. [spook, "Got away with it!"] remoteExec ["groupChat"]; 2 Share this post Link to post Share on other sites
Incontinentia 339 Posted July 19, 2016 Thank you!! I haven't tested yet but this looks perfect. Any ideas what the best way to execute this through a killed eventhandler? No worries about the handler itself, just wondering whether evecVM "sneakyscript.sqf"; would be fine of if it would be better to do it another way. Share this post Link to post Share on other sites
HallyG 239 Posted July 19, 2016 // Side chat to everyone. [spook, "Compromised"] remoteExec ["sideChat"]; // Publicize spotted variable to true. missionNamespace ["spotted", true, true]; // SetCaptive on spook where spook is local since setCaptive arguments are Local [spook, false] remoteExec ["setCaptive", spook]; // Your timer thing. _cooldownTimer = (60 + (random 60)); uiSleep _cooldownTimer; // Your waituntil thing. waituntil { uiSleep 10; ((2.2 > (INDEPENDENT knowsAbout spook)) && (2.2 > (EAST knowsAbout spook))); }; // Publicize spotted to false. missionNamespace ["spotted", false, true]; // SetCaptive back to true. [spook, true] remoteExec ["setCaptive", spook]; // Group chat to everyone. [spook, "Got away with it!"] remoteExec ["groupChat"]; Not meaning to be pedantic, but: missionNamespace ["spotted", true, true]; missionNamespace ["spotted", false, true]; to missionNamespace setVariable ["spotted", true, true]; missionNamespace setVariable ["spotted", false, true]; 2 Share this post Link to post Share on other sites
kylania 568 Posted July 19, 2016 Erm, yeah, what hally said. :) Edited the post. And of course missing setVariable is kinda critical. heh 1 Share this post Link to post Share on other sites
Incontinentia 339 Posted July 19, 2016 Thanks guys! Works flawlessly. Share this post Link to post Share on other sites