Jump to content
avibird 1

How to adjust the weapon sway and stamina/fatigue for playable units.

Recommended Posts

I use this bit of code block in my mission init to adjust the weapon sway and stamina/fatigue it works for my initial playable unit at mission start however if I team switch to a different playable unit it does not work. When I team switch back to the original unit the code block works.

 


//**********Mission cheats**********
//turns off Fatigue for player unit**********
if (local player) then {
   player enableFatigue false;
   player addMPEventhandler ["MPRespawn", {player enableFatigue false}];
};

//Custom Weapon Sway & Recoil**********
 player setCustomAimCoef 0.3;
 player setUnitRecoilCoefficient 0.3;

 player addEventHandler ["Respawn", {player setCustomAimCoef 0.3;}];
 player addEventHandler ["Respawn", {player setUnitRecoilCoefficient 0.3}];

 

I have attempted to put this in each playable units init with no luck

 

this setCustomAimCoef 0.3;
this  player setUnitRecoilCoefficient 0.3;

this enableFatigue false;

 

I also attempted to add this to my mission init

 

{

if (side _x == West) then {enableFatigue false}

then {setCustomAimCoef 0.3} then {setUnitRecoilCoefficient 0.3}

foreach playableunits+switchableunits;


 

I don't mind the stamina as much as the weapon sway. The weapon sway is a bit much in my opinion and takes some of the enjoyment of playing at times. I know there are a few MOD's that can reduce the sway but I like to limit the amount of MOD's that a mission is required to have. I know this can be done via simple code but don' t know how LOL that is the story of editing with ARMA.  Help would be greatly appreciated. Avibird 

Share this post


Link to post
Share on other sites


{

if (side _x == West) then

{

_x enableFatigue false;

_x setCustomAimCoef 0.3;

_x setUnitRecoilCoefficient 0.3;

_x addEventHandler

[

"Respawn",

{

(_this select 0) enableFatigue false;

(_this select 0) setCustomAimCoef 0.3;

(_this select 0) setUnitRecoilCoefficient 0.3;

}

];

};

} foreach (playableUnits + switchableUnits);

  • Like 1

Share this post


Link to post
Share on other sites

thanks jshock I will give it a go hope it works. Like I said don't really care that much about the Fatigue/stamina thing. To me that is more realistic and enjoyable while playing.  Run and move to cover relax a bit scan the environment and then move again but the weapon sway just sucks ass. I don' t want to take it all way but the default is a bit much Bohemia :unsure: it takes a lot of the enjoyment out of the game and just adds to the frustration at times with the game.

Share this post


Link to post
Share on other sites

I use this bit of code block in my mission init to adjust the weapon sway and stamina/fatigue it works for my initial playable unit at mission start however if I team switch to a different playable unit it does not work. When I team switch back to the original unit the code block works.

 


//**********Mission cheats**********

//turns off Fatigue for player unit**********

if (local player) then {

   player enableFatigue false;

   player addMPEventhandler ["MPRespawn", {player enableFatigue false}];

};

//Custom Weapon Sway & Recoil**********

 player setCustomAimCoef 0.3;

 player setUnitRecoilCoefficient 0.3;

 player addEventHandler ["Respawn", {player setCustomAimCoef 0.3;}];

 player addEventHandler ["Respawn", {player setUnitRecoilCoefficient 0.3}];

 

I have attempted to put this in each playable units init with no luck

 

this setCustomAimCoef 0.3;

this  player setUnitRecoilCoefficient 0.3;

this enableFatigue false;

 

I also attempted to add this to my mission init

 

{

if (side _x == West) then {enableFatigue false}

then {setCustomAimCoef 0.3} then {setUnitRecoilCoefficient 0.3}

foreach playableunits+switchableunits;


 

I don't mind the stamina as much as the weapon sway. The weapon sway is a bit much in my opinion and takes some of the enjoyment of playing at times. I know there are a few MOD's that can reduce the sway but I like to limit the amount of MOD's that a mission is required to have. I know this can be done via simple code but don' t know how LOL that is the story of editing with ARMA.  Help would be greatly appreciated. Avibird 

If you use the Ultimate soldier mod it will sort out stamina and sway for you and every one of your squadmates-you can teamswitch and it will carry over and back as well.I can't play without it anymore :)

Share this post


Link to post
Share on other sites

@ ineptaphid I will check it out TY. What else does this mod do?

I try to limit the number of mod's in a mission because as you know that just opens a can of worms with updates or adding other scripts and mod's to your mission. You never know what it will happen lol.

Share this post


Link to post
Share on other sites

Man this futures are for player only. AI has his own commands for that like setskill  [" ", value]

Share this post


Link to post
Share on other sites
On ‎2‎/‎6‎/‎2016 at 0:39 PM, jshock said:

 



 

{

if (side _x == West) then

{

_x enableFatigue false;

_x setCustomAimCoef 0.3;

_x setUnitRecoilCoefficient 0.3;

_x addEventHandler

[

"Respawn",

{

(_this select 0) enableFatigue false;

(_this select 0) setCustomAimCoef 0.3;

(_this select 0) setUnitRecoilCoefficient 0.3;

}

];

};

} foreach (playableUnits + switchableUnits);

 

Where do I put this code

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×