3lockad3 11 Posted November 25, 2013 Does anyone know of an argument or solution to handcuffing ? "West" = cops the rest suspects or arrestable ? Love to finish my mission :D mission is: tvt/coop. This is not a life mission. Thank you in advance no matter the effect. Share this post Link to post Share on other sites
wok 1 Posted November 25, 2013 (edited) Here's some tests I was working on but never finished, it may be useful for you: init.sqf player addAction ["Hands up!", "test.sqf", "", 1, true, true, "", "side cursorTarget == east && player distance cursorTarget <= 10"] test.sqf target = cursorTarget; caller = _this select 1; _value = 1; caller playActionNow "GestureFreeze"; target reveal caller; fnc_surrender = { _target = _this select 0; _target playMoveNow "AmovPercMstpSsurWnonDnon"; _target disableAI "ANIM"; }; _courage = target skill "courage"; if (_courage < 0.25) then { _value = 1; }; if (_courage >= 0.25 && _courage <= 0.45) then { _value = 2; }; if (_courage > 0.45 && _courage <= 0.65) then { _value = 3; }; if (_courage > 0.65 && _courage <= 0.85) then { _value = 4; }; if (_courage > 0.85) then { _value = 5; }; if( _value == 1 ) then { [cursorTarget] call fnc_surrender; }; if ( _value == 2) then { if( floor(random(11)) == 0 ) then { target addEventHandler [ "Hit", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } else { target addEventHandler [ "FiredNear", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } }; if ( _value == 3) then { if( floor(random(2)) == 0 ) then { target addEventHandler [ "Hit", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } else { target addEventHandler [ "FiredNear", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } }; if ( _value == 4) then { if( floor(random(11)) == 0 ) then { target addEventHandler [ "Hit", { if (_this select 1 == caller && getDamage (_this select 0) < 0.45) then { [_this select 0] call fnc_surrender; }; }]; } else { target addEventHandler [ "Hit", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } }; if ( _value == 5) then { target addEventHandler [ "Hit", { if (_this select 1 == caller && getDamage (_this select 0) < 0.45) then { [_this select 0] call fnc_surrender; }; }]; }; Depending on the AI skill (courage value) the surrender/handcuff will be different: /* Novice < 0.25 // 1 surrender always Rookie >= 0.25 && < 0.45 // 2 surrender if you shoot around him but there's a small chance that you need to hurt him Recruit > 0.45 && < 0.65 // 3 surrender if you shoot around him but there's a 50% chance that you need to hurt him Veteran > 0.65 && < 0.85 // 4 surrender if you hurt him but there's a small chance that you need to hurt him badly Expert > 0.85 // 5 surrender if you hurt him badly */ So for example, if you place an AI unit on the editor and set the skill really low, then when you run the "hands up" action the AI will surrender, if you put a little more skill then you will need to shoot near him to "scare" him, or he wont surrender, if you put even more skill you will need to shoot at him and hurt him to make him surrender, etc. If you don't want any of that stuff you can just use the fnc_surrender function, but A3 doesn't have many animations suitable for handcuffing. You can put the unit hands behind his head, or behind his back but you can't make him walk like that, or make him sit with hands behind back like in A2. Another animation you could use instead of AmovPercMstpSsurWnonDnon is InBaseMoves_HandsBehindBack2, and I think there was a few more but they looked kinda exactly like InBaseMoves_HandsBehindBack2. Edited November 25, 2013 by wok Share this post Link to post Share on other sites
3lockad3 11 Posted November 30, 2013 Okay,, I will see if I can't play with this a bit. I would really like to add this to my mission for new dynamics. Sorry for the delay, but My daughter had plans of being born :D Thank you for your response! Share this post Link to post Share on other sites
k i n g 0 Posted February 10, 2016 Here's some tests I was working on but never finished, it may be useful for you: init.sqf player addAction ["Hands up!", "test.sqf", "", 1, true, true, "", "side cursorTarget == east && player distance cursorTarget <= 10"] test.sqf target = cursorTarget; caller = _this select 1; _value = 1; caller playActionNow "GestureFreeze"; target reveal caller; fnc_surrender = { _target = _this select 0; _target playMoveNow "AmovPercMstpSsurWnonDnon"; _target disableAI "ANIM"; }; _courage = target skill "courage"; if (_courage < 0.25) then { _value = 1; }; if (_courage >= 0.25 && _courage <= 0.45) then { _value = 2; }; if (_courage > 0.45 && _courage <= 0.65) then { _value = 3; }; if (_courage > 0.65 && _courage <= 0.85) then { _value = 4; }; if (_courage > 0.85) then { _value = 5; }; if( _value == 1 ) then { [cursorTarget] call fnc_surrender; }; if ( _value == 2) then { if( floor(random(11)) == 0 ) then { target addEventHandler [ "Hit", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } else { target addEventHandler [ "FiredNear", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } }; if ( _value == 3) then { if( floor(random(2)) == 0 ) then { target addEventHandler [ "Hit", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } else { target addEventHandler [ "FiredNear", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } }; if ( _value == 4) then { if( floor(random(11)) == 0 ) then { target addEventHandler [ "Hit", { if (_this select 1 == caller && getDamage (_this select 0) < 0.45) then { [_this select 0] call fnc_surrender; }; }]; } else { target addEventHandler [ "Hit", { if (_this select 1 == caller) then { [_this select 0] call fnc_surrender; }; }]; } }; if ( _value == 5) then { target addEventHandler [ "Hit", { if (_this select 1 == caller && getDamage (_this select 0) < 0.45) then { [_this select 0] call fnc_surrender; }; }]; }; Depending on the AI skill (courage value) the surrender/handcuff will be different: /* Novice < 0.25 // 1 surrender always Rookie >= 0.25 && < 0.45 // 2 surrender if you shoot around him but there's a small chance that you need to hurt him Recruit > 0.45 && < 0.65 // 3 surrender if you shoot around him but there's a 50% chance that you need to hurt him Veteran > 0.65 && < 0.85 // 4 surrender if you hurt him but there's a small chance that you need to hurt him badly Expert > 0.85 // 5 surrender if you hurt him badly */ So for example, if you place an AI unit on the editor and set the skill really low, then when you run the "hands up" action the AI will surrender, if you put a little more skill then you will need to shoot near him to "scare" him, or he wont surrender, if you put even more skill you will need to shoot at him and hurt him to make him surrender, etc. If you don't want any of that stuff you can just use the fnc_surrender function, but A3 doesn't have many animations suitable for handcuffing. You can put the unit hands behind his head, or behind his back but you can't make him walk like that, or make him sit with hands behind back like in A2. Another animation you could use instead of AmovPercMstpSsurWnonDnon is InBaseMoves_HandsBehindBack2, and I think there was a few more but they looked kinda exactly like InBaseMoves_HandsBehindBack2. Wow! That's exactly what I'm looking for. Unfortunnately this is an old thread and the script is not working. Has anybody something similar? AI will surrender based on the skill and damage level? Share this post Link to post Share on other sites