Jump to content
Vasily.B

Real Tank Crew - Improved behavior addon

Recommended Posts

Hi!
I created simply addon with help from people from ACE 3 team.

Its allowcrewinimmobile for all vehicles in default, including modded. In other words, it prevent crew disembarking from tanks beacuse of damaged track straight undern enemy fire, if it have working turret, hull. Same gouse to all armed vehicles. Crew will disembark only if damage will be very serious (vehicle will be close to explode), so they could run away, before it makes BOOM ;)


*Updated :
Update released, changes are ;
- All crew have got repair kits now (including backpacks, till bohemia will not fix/change it)
- Driver will disembark to repair broken component, when he will not see any enemy.

http://steamcommunity.com/sharedfiles/filedetails/?id=632781728




			
		
  • Like 15

Share this post


Link to post
Share on other sites

Thanks for this! I was missing this feature for long time .)

  • Like 1

Share this post


Link to post
Share on other sites

Nice!

 

Would it be possible to increase the time it takes for crew to repair? I mean fixing a track in RL would probably take hours with all crew members helping.

 

The goal of mining a road is to stop/slow down armor so I think it should take at least 5+ minutes for the AI to repair, as is it's fixed in seconds. Maybe making it a user defined setting in a config file?

 

/KC

  • Like 1

Share this post


Link to post
Share on other sites

Nice!

 

Would it be possible to increase the time it takes for crew to repair? I mean fixing a track in RL would probably take hours with all crew members helping.

 

The goal of mining a road is to stop/slow down armor so I think it should take at least 5+ minutes for the AI to repair, as is it's fixed in seconds. Maybe making it a user defined setting in a config file?

 

/KC

Can be done, no problem but i wanna hear other opinions about this idea first.

Share this post


Link to post
Share on other sites

Its a good idea, If it could be a user defined setting then that would be helpful for the many types of mission styles... its just great to have this tweak available so nice work.

  • Like 2

Share this post


Link to post
Share on other sites

Beside increased repair time a small random chance that crew can not repair it at all due to lack of spare parts. Was a tank mech back in the 80's and it was only minor things the crew could fix them self in the field. Commonly they requested a tank recover vehicle to pull them back behind the lines and then call in us.

 

Just thinking out loud ;)

 

/KC

Share this post


Link to post
Share on other sites

Beside increased repair time a small random chance that crew can not repair it at all due to lack of spare parts. Was a tank mech back in the 80's and it was only minor things the crew could fix them self in the field. Commonly they requested a tank recover vehicle to pull them back behind the lines and then call in us.

 

Just thinking out loud ;)

 

/KC

You, as tank mech was storming trees, driving up to 80km/h then 90 degree turn, right? Its maybe not perfect but its aimed at those stupid situation in wchich bots is making ridiculus moves leading to track/wheel damage or even hull damage (lighter vehicles). Besides that, there is hard to damage vehicle in 50% - if you will shot from tank in some vehicle you will damage its tracks (100%) and hull (100% too if penetrated), so vehicle will explode. This mod allow to repair only damages made by bugs. Off cothere is other not planned thing - ai repair wheels after you destroy it by grenades etc - all depend if they detect you - i cannot prevent all situations. Same with geting back to vehicle - ai searching enter point is sometimes very deadly to him. Main aim of this mod is AI.

Share this post


Link to post
Share on other sites

Looks great.

 

Can you make it AI skill dependent? Something like:

- Skill < 0.25: crew bails exactly as currently in vanilla because they are untrained and easily demoralized

- 0.25 < Skill < 0.50: crew bails with current vanilla level of damage but only when not under fire

- 0.50 < skill < 0.75: crew bails with your modded level of damage and when not under fire but do not repair

- 0.75 < Skill: crew behaves as in your mod, bails after heavy damage not under fire and repairs when possible.

Share this post


Link to post
Share on other sites

Looks great.

 

Can you make it AI skill dependent? Something like:

- Skill < 0.25: crew bails exactly as currently in vanilla because they are untrained and easily demoralized

- 0.25 < Skill < 0.50: crew bails with current vanilla level of damage but only when not under fire

- 0.50 < skill < 0.75: crew bails with your modded level of damage and when not under fire but do not repair

- 0.75 < Skill: crew behaves as in your mod, bails after heavy damage not under fire and repairs when possible.

Little too much combination for me, but feel free to eventually change it as you like it.

Share this post


Link to post
Share on other sites

Great work Vasily! I do agree with the idea of making the repair take a long time too, if there's a way to do it with a user configurable duration? Really good mod. Thanks for making it. 

  • Like 1

Share this post


Link to post
Share on other sites

Great work Vasily! I do agree with the idea of making the repair take a long time too, if there's a way to do it with a user configurable duration? Really good mod. Thanks for making it. 

Well, userconfig file is bad idea here, here is what Glowbal from ACE sayed:

"If at all possible, avoid the use of a userconfig file. A serverconfig like ACE has (optionally) is about as far as I'd go."

So propably there will be no userconfig, more, if ieven there would be possibility to increase "sleeptime" value, there would appear a bug with animation of repairing, which doesnt look fine...

Share this post


Link to post
Share on other sites

Hello, is that ace3 compatible ? Driver is not disembarking at all (vanilla or modded tank).

Share this post


Link to post
Share on other sites

Hello, is that ace3 compatible ? Driver is not disembarking at all (vanilla or modded tank).

Strange... I'm using ACE 3+RTC and it run well. Did You tried disabling all other mods?

Share this post


Link to post
Share on other sites

I'll try, thanks for your work btw.

  • Like 1

Share this post


Link to post
Share on other sites

New update, same link.
- Changed backpack type to "Assault Khaki"

- Increased detection of enemy to 1200M (helpfull on open areas, where driver was disembarking while fight, when enemy was not detected on 300 M)
- increased repair time to 19 seconds (max)

  • Like 1

Share this post


Link to post
Share on other sites

Well, i wanna modify my addon, but scripting in arma language is worse than chinese to me.
I wanna make condition, before whole script will start. The condition would be damaged track or wheels. For now this look like this :

0 = [] spawn {
  if (!isServer) exitWith {};
  {

   (vehicle _x)  addEventHandler ["hit",{
    _veh = _this select 0;
    _d = driver _veh;

    if (_veh getVariable ["willBeRepaired", false]) exitWith {};
    _veh setVariable ["willBeRepaired", true];

    if (_d != _veh && alive _d && !(_veh iskindof "plane")) then {
      _d setCombatMode "COMBAT";
      _veh allowCrewInImmobile true;
      _d addBackpackGlobal "B_assaultPack_khk";
      _d additemtobackpack "toolKit";

      [_d,_veh] spawn {
        _d = _this select 0;
        _veh = _this select 1;
        waitUntil {(_d findNearestEnemy _d) distance _d > 1200};
        doGetOut _d;
        waitUntil {!(_d in _veh)};
        sleep 1;
        _d setVectorDir (getpos _d vectorFromTo getpos _veh);
        _d playMoveNow "Acts_carFixingWheel";
        sleep 19;
        _d switchMove "";

        if (alive _d) then {
          _veh setDamage 0;
          _veh setVariable ["willBeRepaired", false];

Now, ACE 3 guys talked to me to use getallhitpoints syntax, but how?

I was wondering about :

    if (getHitPointDamage "HitLTrack"; "HitRTrack"; "wheel_1_1_steering"; "wheel_1_2_steering"; "wheel_2_1_steering"; "wheel_2_2_steering" ) exitWith {};
    _veh setVariable ["willBeRepaired", true];

But he say its not right. How it should look like?

Maybe :
if [[getHitPointDamage _veh "HitEngine" , "HitLTrack" , "HitRTrack" , "wheel_1_1_steering" , "wheel_1_2_steering" , "wheel_2_1_steering" , "wheel_2_2_steering"]
["engine" , "LTrack" , "RTrack" , "LFWheel" , "RFWheel" , "RRWheel" , "LRWheel"]
[1 , 1 , 1 , 1 , 1 , 1 , 1]] exitWith {};
_veh setVariable ["willBeRepaired", true];

I dont know what wheel names have most of vehicles (including modded content)

Share this post


Link to post
Share on other sites

Don't know if this the right section for your question, I'd rather look for answers in the "Editing" section. It's only a wild guess, but I think you'll get help there quicker. ;)

 

I want to take this oppurtinity to thank you for this addon, everything that makes tanks not huge one shot one kill bullseyes is welcome :) Sad that BI made tanks or rather vehicles so easy destroyable. Hated this for a long time. 

One thing I've noticed with this addon however is, that it doesn't seem to be restricted to vehicles, as I have seen numerous helos land and repair too, which honestly is a bit odd.

 

best of luck with this mod and thanks again for making it

  • Like 1

Share this post


Link to post
Share on other sites

OK, since week i wanna upgrade this mod, so driver will jump out if component will be damaged enough (fully), so tank will be not able to move, right now even Under barrel grenade launchers can detonate next to vehicle, and drivers disembark.

So i modified it like that :
(vehicle _x) addEventHandler ["hit",{
_veh = _this select 0;
_d = driver _veh;

if (getHitPointDamage _veh ["HitEngine" , "HitLTrack" , "HitRTrack" , "wheel_1_1_steering" , "wheel_1_2_steering" , "wheel_2_1_steering" , "wheel_2_2_steering"]
["engine" , "LTrack" , "RTrack" , "LFWheel" , "RFWheel" , "RRWheel" , "LRWheel"]
[1 , 1 , 1 , 1 , 1 , 1 , 1]) exitWith {};
_veh setVariable ["willBeRepaired", true];

But dont know if its ok, i need more testing. If you could help me with that i would be thankful. Also, did i writed right wheel names? I was looking on google but could find anything good enough, to name good hitpoints. I wanna make this work for all vehicles, even modded. Off course there could be problem if modders will call wheels diferent, but it will be up to them to fix compatibility, for now lets just say, i'm interested to get it working with vanilla + RHS mod.

EDIT:
Arma is not making this easier :
12:19:54 Error in expression <d = driver _veh;

if (getHitPointDamage _veh ["HitEngine" , "HitLTrack" , "HitRT>
12:19:54 Error position: <_veh ["HitEngine" , "HitLTrack" , "HitRT>
12:19:54 Error Missing )
12:19:54 File RTC\rtc\init.sqf, line 9
12:19:54 Error in expression <d = driver _veh;

if (getHitPointDamage _veh ["HitEngine" , "HitLTrack" , "HitRT>
12:19:54 Error position: <_veh ["HitEngine" , "HitLTrack" , "HitRT>
12:19:54 Error Missing )
12:19:54 File RTC\rtc\init.sqf, line 9

EDIT 2:
CORRECTED IT TO :

if (getHitPointDamage _veh ["HitEngine" , "HitLTrack" , "HitRTrack" , "wheel_1_1_steering" , "wheel_1_2_steering" , "wheel_2_1_steering" , "wheel_2_2_steering"]["engine" , "LTrack" , "RTrack" , "LFWheel" , "RFWheel" , "RRWheel" , "LRWheel"][1 , 1 , 1 , 1 , 1 , 1 , 1]) exitWith {};

But still :
12:24:46 Error in expression <d = driver _veh;

if (getHitPointDamage _veh ["HitEngine" , "HitLTrack" , "HitRT>
12:24:46 Error position: <_veh ["HitEngine" , "HitLTrack" , "HitRT>
12:24:46 Error Missing )
12:24:46 File RTC\rtc\init.sqf, line 9
12:24:46 Error in expression <d = driver _veh;

if (getHitPointDamage _veh ["HitEngine" , "HitLTrack" , "HitRT>
12:24:46 Error position: <_veh ["HitEngine" , "HitLTrack" , "HitRT>
12:24:46 Error Missing )
12:24:46 File RTC\rtc\init.sqf, line 9

I'm done, game not recognize where ( is starting and where ) is finishing, i cant work on this anymore.... Please help me, while i'm cooling down......

Share this post


Link to post
Share on other sites

Followed instruction from BIS site :
getAllHitPointsDamage player;
//[
// ["HitFace","HitNeck","HitHead","HitPelvis","HitAbdomen","HitDiaphragm","HitChest","HitBody","HitArms","HitHands","HitLegs"],
// ["","neck","head","pelvis","spine1","spine2","spine3","body","","hands","legs"],
// [0,0.0939002,0.0319932,0.0858595,0.174491,1,1,0.168495,1,0.5,0.195907]
//]

ME
(vehicle _x) addEventHandler ["hit",{
_veh = _this select 0;
_d = driver _veh;

if getAllHitPointsDamage _veh;
[
["HitEngine" , "HitLTrack" , "HitRTrack" , "wheel_1_1_steering" , "wheel_1_2_steering" , "wheel_2_1_steering" , "wheel_2_2_steering"],
["engine" , "LTrack" , "RTrack" , "LFWheel" , "RFWheel" , "RRWheel" , "LRWheel"],
[1 , 1 , 1 , 1 , 1 , 1 , 1]
]
exitWith {};
_veh setVariable ["willBeRepaired", true];

ARMA

13:00:19 Error in expression <eh = _this select 0;
_d = driver _veh;

if getAllHitPointsDamage _veh;
[
["HitE>
13:00:19 Error position: <if getAllHitPointsDamage _veh;
[
["HitE>
13:00:19 Error if: Type Array, expected Bool
13:00:19 Ragdoll - loading of ragdoll source "Soldier" started.
13:00:19 Ragdoll - loading of ragdoll source "Soldier" finished successfully.
13:00:20 Error in expression <eh = _this select 0;
_d = driver _veh;

if getAllHitPointsDamage _veh;
[
["HitE>
13:00:20 Error position: <if getAllHitPointsDamage _veh;
[
["HitE>
13:00:20 Error if: Type Array, expected Bool
13:00:20 Error in expression <eh = _this select 0;
_d = driver _veh;

if getAllHitPointsDamage _veh;
[
["HitE>
13:00:20 Error position: <if getAllHitPointsDamage _veh;
[
["HitE>
13:00:20 Error if: Type Array, expected Bool
13:00:20 Error in expression <eh = _this select 0;
_d = driver _veh;

This game is unmoddable!

Share this post


Link to post
Share on other sites

This game is unmoddable!

unmoddable - not sure how you can say that. Your probably doing something incorrectly with the scripting setup.

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

×