D. Patterson 14 Posted November 5, 2014 Is there a way to force a player to lower their weapon, and keep it that way, until it's unforced? Share this post Link to post Share on other sites
dreadedentity 278 Posted November 5, 2014 I believe setBehavior "SAFE" can mimic the effect you are looking for. Units should have their weapons lowered until they spot an enemy or get fired upon. EDIT: if that doesn't work you could use: while {true} do { waitUntil {behavior GROUP != "safe"}; GROUP setBehavior "SAFE"; }; Might do the trick Share this post Link to post Share on other sites
iceman77 18 Posted November 5, 2014 https://community.bistudio.com/wiki/ArmA_3:_Actions#WeaponInHand_.2F_WeaponOnBack << Doesn't actually place weapon on back, but lowers it rather. Share this post Link to post Share on other sites
D. Patterson 14 Posted November 5, 2014 Im trying to make it so the player cannot raise their weapon. The weapononback allows the player to raise their weapon immediately after. Share this post Link to post Share on other sites
iceman77 18 Posted November 5, 2014 (edited) Yup. I posted an action to lower your weapon. You'd need to check if the weapon isn't lowered and activate the action on the player object if it's true. Something like a loop or stacked EH onEachFrame. Untested. Add sleeps where you see fit (except in stacked EH). Or not.. W/e. loop #1 if (isDedicated) exitWith {}; waitUntil {!(isNull player)}; while {true} do { waitUntil {!(weaponLowered player)}; player action ["WeaponOnBack", player]; }; loop#2 if (isDedicated) exitWith {}; waitUntil {!(isNull player)}; while {true} do { if (!(weaponLowered player)) then { player action ["WeaponOnBack", player]; }; }; stacked EH if (isDedicated) exitWith {}; waitUntil {!(isNull player)}; ["WOBID", "onEachFrame", { if (!(weaponLowered player)) then { player action ["WeaponOnBack", player]; }; }] call BIS_fnc_addStackedEventHandler; ---------- Post added at 01:18 ---------- Previous post was at 00:02 ---------- Alternatively, I just noticed there are animation eventhandlers. I'm unfamiliar with these particular Ehs and animations in general, but maybe something like this could work :confused: if (isDedicated) exitWith {}; waitUntil {!(isNull player)}; player addEventhandler ["animDone", { // also available: "AnimStateChanged", "AnimChanged" if (!(weaponLowered player)) then { player action ["WeaponOnBack", player]; }; }]; Edited November 5, 2014 by Iceman77 1 Share this post Link to post Share on other sites
Tajin 349 Posted November 5, 2014 I'm not sure if the anim-Events trigger for "gestures". I think they're a separate system. Share this post Link to post Share on other sites
tpw 2315 Posted November 5, 2014 I tried something similar to Iceman77's last bit of code a while ago and ended up with AI just sliding along the ground in a frozen stance. I would dearly love a way to have squad AI not constantly run around with raised weapons. Probably needs some kind of FSM editing, which I have no smarts with. Share this post Link to post Share on other sites
iceman77 18 Posted November 5, 2014 It's for players. Share this post Link to post Share on other sites
tpw 2315 Posted November 5, 2014 I know mate. I wasn't dissing your code ideas, merely saying that using eventhandlers to switch between animation states can lead to player/AI apparently not animating at all. Share this post Link to post Share on other sites
iceman77 18 Posted November 5, 2014 Ahh okay gotcha. Thought you meant it was Ai specific =) Share this post Link to post Share on other sites