jordanbache97 47 Posted February 6, 2016 Hi there For my milsim group I have tried removing the stamina system but still have no luck. In my init.sqf I have player enableFatigue false; Now this only works 50% of the time sometimes everyone has no fatigue , then sometimes we all have the stamina system. Is there a better way of removing this? Jordan Share this post Link to post Share on other sites
ineptaphid 6413 Posted February 6, 2016 Could you just ask them all to download one of the stamina removing mods?Or do you want to do it through the .sqf? I use the Ultimate Soldier addon for stamina-works great :) Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted February 6, 2016 // 'initPlayerLocal.sqf' player enableStamina FALSE; player addEventHandler ['Respawn',{player enableStamina FALSE;}]; // or // 'init.sqf' if (!isDedicated) then { player enableStamina FALSE; player addEventHandler ['Respawn',{player enableStamina FALSE;}]; }; Share this post Link to post Share on other sites
davidoss 552 Posted February 6, 2016 You can just add mission parameters to ON/OFF stamina, adjust recoil and sway, in mission lobby parameters . in description.ext: class Params { class PStamina { title = "Enable/Disable Player's Stamina"; values[] = {0,1}; texts[] = {"Disable","Enable"}; default = 1; }; class PRecoil { title = "Player's Weapon Recoil"; values[] = {10,40,70,100}; texts[] = {"No recoil","Poor recoil","Standard recoil","Intensive recoil"}; default = 70; }; class PAimCoef { title = "Player's Weapon Sway"; values[] = {10,40,70,100}; texts[] = {"No sway","Poor sway","Standard sway","Intensive sway"}; default = 70; }; }; file pgunhandle.sqf fnc_setPgunHandle = { params ["_player","_pstamina", "_pwrecoil", "_pwsway"]; _pstamina = paramsArray select 0; _pwrecoil = (paramsArray select 1)/100; _pwsway = (paramsArray select 2)/100; if (_pstamina == 0) then { _player enableStamina false; } else { _player enableStamina true; }; _player setUnitRecoilCoefficient _pwrecoil; _player setCustomAimCoef _pwsway; }; init.sqf: if (hasInterface) then { [] call compile preprocessfile "pgunhandle.sqf"; [player] call fnc_setPgunHandle; player addeventhandler ["respawn",{[player] call fnc_setPgunHandle}]; }; 1 Share this post Link to post Share on other sites
dr death jm 117 Posted February 7, 2016 You can just add mission parameters to ON/OFF stamina, adjust recoil and sway, in mission lobby parameters . in description.ext: class Params { class PStamina { title = "Enable/Disable Player's Stamina"; values[] = {0,1}; texts[] = {"Disable","Enable"}; default = 1; }; class PRecoil { title = "Player's Weapon Recoil"; values[] = {10,40,70,100}; texts[] = {"No recoil","Poor recoil","Standard recoil","Intensive recoil"}; default = 70; }; class PAimCoef { title = "Player's Weapon Sway"; values[] = {10,40,70,100}; texts[] = {"No sway","Poor sway","Standard sway","Intensive sway"}; default = 70; }; }; file pgunhandle.sqf fnc_setPgunHandle = { params ["_player","_pstamina", "_pwrecoil", "_pwsway"]; _pstamina = paramsArray select 0; _pwrecoil = (paramsArray select 1)/100; _pwsway = (paramsArray select 2)/100; if (_pstamina == 0) then { _player enableStamina false; } else { _player enableStamina true; }; _player setUnitRecoilCoefficient _pwrecoil; _player setCustomAimCoef _pwsway; }; init.sqf: if (hasInterface) then { [] call compile preprocessfile "pgunhandle.sqf"; [player] call fnc_setPgunHandle; player addeventhandler ["respawn",{[player] call fnc_setPgunHandle}]; }; Recoil isn't working in the way is should, but the other seam to work good _pwrecoil = (paramsArray select 1)/100; the 100; isn't changed much it param, but if set to a lower number works good , I advise not to set it to 0 , its kinda over kill.. real good script. thanks for sharing Share this post Link to post Share on other sites
4-325Ranger 62 Posted February 6, 2017 A year later and I'm trying this, if there is something newer out for this problem, I have yet to find. I'm getting an error message, but I am also trying to scale this back as I have no interest in modifying the recoil/sway through this script (I use Mao's for that). I'm getting this error: '... ["_player","_pstamina"]; _pstamina = I#IparamsArray select 0; if (_pstamina == ...' Error undefined variable in expression: paramsarray My description.ext class Params { class PStamina { title = "Enable/Disable Player's Stamina"; values[] = {0,1}; texts[] = {"Disable","Enable"}; default = 1; }; }; My pgunhandle.sqf fnc_setPgunHandle = { params ["_player","_pstamina"]; _pstamina = paramsArray select 0; if (_pstamina == 0) then { _player enableStamina false; } else { _player enableStamina true; }; }; My init.sqf (placed at the bottom): if (hasInterface) then { [] call compile preprocessfile "pgunhandle.sqf"; [player] call fnc_setPgunHandle; player addeventhandler ["respawn",{[player] call fnc_setPgunHandle}]; }; Share this post Link to post Share on other sites
jakeplissken 81 Posted February 6, 2017 Just put this in the initPlayerLocal.sqf. player setCustomAimCoef 0.35; player setUnitRecoilCoefficient 0.75; player enablestamina false; And this in the onPlayerRespawn.sqf file. player setCustomAimCoef 0.35; player setUnitRecoilCoefficient 0.75; player enablestamina false; This will take care of it. Share this post Link to post Share on other sites
serena 151 Posted February 6, 2017 _player enableStamina ((paramsArray select 0) > 0); Share this post Link to post Share on other sites
BlacKnightBK 47 Posted February 6, 2017 Here is how i do it, i place this code in both the "initplayerlocal.sqf" and "onPlayerRespawn.sqf". It works perfectly fine for me every time. The reason i have it in both is because if the player died and re-spawned he the stamina system is back on again. however with "onPlayerRespawn.sqf" it sets them of again every time player enableFatigue FALSE; player enableStamina FALSE; player forceWalk FALSE; if you do not like the weapon sway and recoil you can change the values in the following: player setAnimSpeedCoef 1; player setCustomAimCoef 0.2; player setUnitRecoilCoefficient 3; Share this post Link to post Share on other sites
Midnighters 152 Posted February 6, 2017 How would you be able to set it in the description.ext? Seems to me that the stamina resets for each player respawn. Would the description.ext disable fatigue permanently throughout the mission? I see that Quiksilver had mentioned above about adding a respawn event handler. but the description.ext meothod still confuses me. Share this post Link to post Share on other sites
BlacKnightBK 47 Posted February 6, 2017 Just now, Midnighters said: How would you be able to set it in the description.ext? Seems to me that the stamina resets for each player respawn. Would the description.ext disable fatigue permanently throughout the mission? and like i said, you do not place it in there you place it in the following two files instead "initplayerlocal.sqf" and "onPlayerRespawn.sqf" Share this post Link to post Share on other sites
Midnighters 152 Posted February 6, 2017 Just now, BlacKnightBK said: and like i said, you do not place it in there you place it in the following two files instead "initplayerlocal.sqf" and "onPlayerRespawn.sqf" Right, that's always how I've done it. Just not sure what a lobby param is going to do for all the players even after a respawn Share this post Link to post Share on other sites
BlacKnightBK 47 Posted February 6, 2017 5 minutes ago, Midnighters said: Right, that's always how I've done it. Just not sure what a lobby param is going to do for all the players even after a respawn me neither, just by looking at that script i am not bothered to read it to understand it since i already have a much simpler way Share this post Link to post Share on other sites
Midnighters 152 Posted February 6, 2017 1 minute ago, BlacKnightBK said: me neither, just by looking at that script i am not bothered to read it to understand it since i already have a much simpler way Aye, sorry. I'm a bit blind today. As Ranger and davidoss mentiod above, it'd take the param value and from the param value insert it into an event handler for respawn. Share this post Link to post Share on other sites
4-325Ranger 62 Posted February 6, 2017 Hey, thanks for the replies on this, however I had tried: player enableFatigue FALSE; player enableStamina FALSE; player forceWalk FALSE; to no success. I also tried adding it to the init.sqf as well just to see if that would make a difference - nope. I followed Davidoss' technique from last year, because initPlayerLocal / initPlayerRespawn techniques weren't working, still aren't - in editor or on server for me. I'm only running ACE (no options), CBA_A3 and TFAR. I've had limited success setting the ACE advanced fatigue module with really high tolerance settings, but still not the effect like Drift's old NoFatigue mod that i'm trying to achieve. With that said, many thanks for the input, I'll keep trying, if anyone has any other ideas, I'll try those too! Share this post Link to post Share on other sites
BlacKnightBK 47 Posted February 7, 2017 6 hours ago, 4-325Ranger said: Hey, thanks for the replies on this, however I had tried: player enableFatigue FALSE; player enableStamina FALSE; player forceWalk FALSE; to no success. I also tried adding it to the init.sqf as well just to see if that would make a difference - nope. I followed Davidoss' technique from last year, because initPlayerLocal / initPlayerRespawn techniques weren't working, still aren't - in editor or on server for me. I'm only running ACE (no options), CBA_A3 and TFAR. I've had limited success setting the ACE advanced fatigue module with really high tolerance settings, but still not the effect like Drift's old NoFatigue mod that i'm trying to achieve. With that said, many thanks for the input, I'll keep trying, if anyone has any other ideas, I'll try those too! I am guessing you placed the code in only one of the following files right?? "initPlayerLocal.sqf" "initPlayerRespawn.sqf" If answer is yes, you should have the code in both, if your answer is no i have no idea how to help you sorry Share this post Link to post Share on other sites
4-325Ranger 62 Posted February 7, 2017 Yup put it in both, tested in editor and on my server, then added it to the init.sqf as well, tested again. No go... Appreciate your input. Share this post Link to post Share on other sites
BlacKnightBK 47 Posted February 7, 2017 2 minutes ago, 4-325Ranger said: Yup put it in both, tested in editor and on my server, then added it to the init.sqf as well, tested again. No go... Appreciate your input. Thats weird, it works fine for me and my friends on both dedictated server, single player and PC hosted servers Share this post Link to post Share on other sites
4-325Ranger 62 Posted February 7, 2017 Yup it is a bugger. Share this post Link to post Share on other sites
Midnighters 152 Posted February 7, 2017 1 hour ago, 4-325Ranger said: Yup it is a bugger. your best bet is to remove the advanced fatigue ace pbo. unless ACE has some documented form? Share this post Link to post Share on other sites
Midnighters 152 Posted February 7, 2017 1 hour ago, 4-325Ranger said: Yup it is a bugger. I'd try just doing this: player addEventHandler["Respawn",{ player enableFatigue false; player forceWalk false; }]; make sure you have no ACE advanced fatigue, as it's a different system alltogether. I think the lobby method is really neat, but I believe you're just looking to force fatigue off? Share this post Link to post Share on other sites
Jnr4817 215 Posted February 7, 2017 This is how I set mine up for MP missions. init.sqf // SA: Recoil execVM "SA\scripts\sa_recoil.sqf"; description.ext class PARAM_Recoil { title = "Player Recoil:"; values[] = {1,0}; texts[] = {"ON","OFF"}; default = 0; }; sa_recoil.sqf if(!isDedicated) then { if(alive player and ("PARAM_Recoil" call BIS_fnc_getParamValue == 0)) then { player setCustomAimCoef 0.25; player setUnitRecoilCoefficient 0.50; }; player addEventHandler ["Respawn", { if(alive player and ("PARAM_Recoil" call BIS_fnc_getParamValue == 0)) then { player setCustomAimCoef 0.25; player setUnitRecoilCoefficient 0.50; }; }]; }; Share this post Link to post Share on other sites
4-325Ranger 62 Posted February 8, 2017 21 hours ago, Midnighters said: I'd try just doing this: player addEventHandler["Respawn",{ player enableFatigue false; player forceWalk false; }]; make sure you have no ACE advanced fatigue, as it's a different system alltogether. I think the lobby method is really neat, but I believe you're just looking to force fatigue off? I had the ACE module removed when I did the testing so that isn't the issue. I am running a number of scripts in this particular mission. It is possible one of these is overriding somehow. I will test and report back. Share this post Link to post Share on other sites
Midnighters 152 Posted February 8, 2017 5 minutes ago, 4-325Ranger said: I had the ACE module removed when I did the testing so that isn't the issue. I am running a number of scripts in this particular mission. It is possible one of these is overriding somehow. I will test and report back. okie dokie. Look forward to hearing back then, this is a rather confusing situation, Share this post Link to post Share on other sites
WPK-ArmedVeteran 7 Posted February 8, 2017 You can always use 3den Enhanced, where you can set stamina for every unit. Share this post Link to post Share on other sites