Jump to content
Sign in to follow this  

Recommended Posts

The US have engineers, but the TK militia dosent.Is there anyway to make a TK militia have the repair ability that engineers have? I have a MP tvt map (us vs Tk militia) and I need to simulate a TK militia engineer without using extensive script(s), but using little or no scripting at all.Is this possible?

Share this post


Link to post
Share on other sites

thanks for replying.I actually need a script that dosent require any code in the vehicle init. I just need a TK militia soldier to be able to repair any damaged vehicle on the map.

Share this post


Link to post
Share on other sites

only tested in SP editor, should be MP compatible.

its simple and not very adjusted, unit bow head into vehicel when repairing, better animation (shorter) can be used instead.

/*

Save the script as vehicleRepairs.sqf, and place in your mission folder.

place this in init.sqf:
[player] execVM "vehicleRepairs.sqf";

*/

if (count _this > 1) then {
(_this select 1) playMove "ActsPercSnonWnonDnon_carFixing2";		// here the player starts the repair animation, can be changed for another animation of choise.
sleep 10;		// some sleep time for the repairs to take place
(_this select 0) setDammage 0;	// here we reset the damage of the vehicle to 0.
//(_this select 0) setFuel 1;	// here we fill up the fuel tank. (uncomment this if you want to refuel the vehicle as well)
};

if (!isNil ("vehicleRepairInitiated")) exitWith {};
vehicleRepairInitiated = true;
waitUntil {sleep 1; alive player};

while {true} do {
{

	if (!(_x getVariable ["militiaRepairsInitiated", false])) then {
		_id = _x addAction ["Repair Vehicle", "vehicleRepairs.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND (faction _this) == 'BIS_TK_INS' AND (vehicle _this) == _this"];
		_x setVariable ["militiaRepairsInitiated", true, false];
	};
} foreach vehicles;
sleep 5;
};

will run for each player, each 5 seconds it will automatically add the repair action to any vehicle, wich wil show for TK militia faction only and only when damaged, remove the two // infront of the setFuel line in top if you want refuel to happen with repairs aswell.

Share this post


Link to post
Share on other sites

Demonized

mate that is not working for me

       if (count _this > 1) then {
       	(_this select 1) playMove "amovpsitmstpsraswrfldnon_smoking";		// here the player starts the repair animation, can be changed for another animation of choise.
       	sleep 10;
       	(_this select 0) setDammage 0;
       	(_this select 0) setFuel 1;
       };

       if (!isNil ("vehicleRepairInitiated")) exitWith {};
       vehicleRepairInitiated = true;
       waitUntil {sleep 1; alive player};

       while {true} do {
       	{

       		if (!(_x getVariable ["RepairsInitiated", false])) then {
       			_id = _x addAction ["Repair Vehicle", "HOG_scripts\Vehicle_Repair\vehicleRepair.sqf", [], 1, false, true, "", "(getDammage _target) < 1 AND (getDammage _target) > 0 AND (faction _this) == 'soldierWB' AND (vehicle _this) == _this"];
       			_x setVariable ["RepairsInitiated", true, false];
       		};
       	} foreach vehicles;
       	sleep 5;
       };


Share this post


Link to post
Share on other sites

hogmason, you dug up an oldie here... I don't think Demonized is around much any more, if at all.

One thing I did notice, you are trying to check faction against SoldierWB...

Here is a list of factions:

faction command

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
Sign in to follow this  

×