Jump to content

Gelid Nitro - In Car Option


Donnovan

Recommended Posts

If you like my work, please consider a donation.

btn_donate_LG.gif $USD

btn_donate_LG.gif $EURO

*** WE ARE ON VERSION 2.0 *** UPDATED ON 10 OF OCTOBER OF 2014 ***
*** UPDATE YOUR NITRO IS HIGLY RECOMENDED *** THANKYOU! ***

THE BADIE: infiSTAR will disable the custom binds even if you set Disable Custon Binds to False. So if you use infiSTAR, a work arround is needed.You can try Lord George Fix:

Hi,

I want to say thanyou to Sandbird, for his Nitro script, that gave me the initial kick for Gelid Nitro.

GELID NITRO

1.1) Nitro don't need to be installed.
1.2) Nitro is limited to a list of vehicles.
1.3) Fuel decrease faster, you can do 7/8 of the coast travel with Nitro on and full fuel.

2.0) Tree sounds: Nitro Injection / Air flow / Exhauster Pipe Blow.

3.0) The cost of speed: When the exhauster pipe blows, there is an sudenly extra gain in speed that can cause lost of vehicle control. So pay atention on the pipe blow.

4.1) Tweak: boost only happens if the vehicle is touching the ground.
4.2) Tweak: boost happens when the vehicle is facing the travel direction.

5.1) Aesthetics: impulse tweaked to not generate the "desync like" effect that happens when adding velocity to things.

MISSION FILES: N.O.S. FILES

All the new files goes to your mission folder, inside the folder NOS.

Example: Arma 2 Operation Arrowhead\MPMissions\DayZ_Epoch_11.Chernarus\NOS.

MISSION FILES: NEW FILE nitro.sqf
 

donn_nitroOn = false;
donn_speedometer = false;
donn_nitroCars = [
	"car_sedan",
	"car_sedan_DZE1",
	"car_sedan_DZE2",
	"car_sedan_DZE3",
	"car_sedan_DZE4",
	"VWGold",
	"VWGold_DZE1",
	"VWGold_DZE2",
	"VWGold_DZE3",
	"VWGold_DZE4",
	"car_hatchback",
	"car_hatchback_DZE1",
	"car_hatchback_DZE2",
	"car_hatchback_DZE3",
	"car_hatchback_DZE4",
	"datsun1_civil_1_open",
	"datsun1_civil_1_open_DZE1",
	"datsun1_civil_1_open_DZE2",
	"datsun1_civil_1_open_DZE3",
	"datsun1_civil_1_open_DZE4",
	"SUV_Camo",
	"SUV_Camo_DZE1",
	"SUV_Camo_DZE2",
	"SUV_Camo_DZE3",
	"SUV_Camo_DZE4",
	"datsun1_civil_3_open",
	"datsun1_civil_3_open_DZE1",
	"datsun1_civil_3_open_DZE2",
	"datsun1_civil_3_open_DZE3",
	"datsun1_civil_3_open_DZE4",
	"GLT_M300_ST",
	"HMMWV_DZ"
];
kDownFunc = {
	private ["_theCar","_keyDown"];
	_keyDown = _this;
	if (_keyDown == 42 && donn_nitroOn) then {
		_theCar = vehicle player;
		if (isEngineOn _theCar && ((getPosATL _theCar) select 2) < 0.1 && speed _theCar >= 50) then {
			private ["_vel","_dir"];
			_dir = direction _theCar;
			_vel = velocity _theCar;
			_theCar setVelocity [
				(_vel select 0) + (sin _dir * 0.1),
				(_vel select 1) + (cos _dir * 0.1),
				(_vel select 2)
			];
			_theCar setFuel ((fuel _theCar) - 0.000035);
			if ((diag_tickTime - donn_airStarted) >= donn_airWait) then {
				[nil,_theCar, rSAY,["suction", 100]] call RE;		
				if (donn_airWait == 3.5) then {
					[nil,_theCar, rSAY,["exhaustor", 100]] call RE;
					donn_airStarted = diag_tickTime;
					donn_airWait = 3;
					donn_problem = true;
					[] spawn {
						private ["_theCar","_vel","_calcDir","_magnitude","_dir","_intensity"];
						_theCar = vehicle player;
						for "_x" from 1 to 200 do {
							if (vehicle player == _theCar && isEngineOn _theCar && ((getPosATL _theCar) select 2) < 0.1 && speed _theCar >= 50) then {
								_vel = velocity _theCar;
								_dir = direction _theCar;
								_magnitude = sqrt((_vel select 0)^2 + (_vel select 1)^2);
								if ((_vel select 0) < 0) then {_calcDir = 360 - aCos ((_vel select 1)/_magnitude);} else {_calcDir = aCos ((_vel select 1)/_magnitude);};
								if (abs(_dir-_calcDir) <= 5) then {
									_theCar setVelocity [(_vel select 0) * 1.01, (_vel select 1) * 1.01, (_vel select 2)];
								};
							};
							uiSleep 0.01;
							if (!donn_problem) exitWith {};
						};
					};
				} else {
					donn_airStarted = diag_tickTime;
					donn_airWait = random 3.5;
					if (donn_airWait > 3) then {donn_airWait = 3.5;};
				};
			};
		};
	};
};
kUpFunc = {
	private ["_keyUp"];
	_keyUp = _this;
	if (_keyUp == 41) then {
		donn_problem = false;
	};
	if (_keyUp == 57) then {
		if (donn_nitroOn) then {
			donn_nitroOn = false;
			systemChat ("Nitro Off!");
		} else {
			donn_nitroOn = true;
			systemChat ("Nitro On!");
			if (donn_speedometer) then {
				[] spawn {
					while {donn_nitroOn} do {
						cutText [format ["Speed in Km/h: %1", round (speed (vehicle player))], "PLAIN"];
						uiSleep 0.5;
					};
				};			
			};
		};
	};
};
[] spawn {
	while {true} do {
		//WAIT TO BE IN VEHICLE
		waitUntil {sleep 0.25; vehicle player != player && (driver (vehicle player)) == player};
		if ((typeOf (vehicle player)) in donn_nitroCars) then {
			donn_nosOk = true;
			donn_airStarted = diag_tickTime;
			donn_airWait = 1.5;
			donn_problem = false;
			[nil, (vehicle player), rSAY, ["nitro", 100]] call RE;
			[player,25,true,(getPosATL player)] spawn player_alertZombies;
			systemChat ("Press Space Bar to turn Nitro On/OFF!");
			nosKeyDown = (findDisplay 46) displayAddEventHandler ["KeyDown","_this select 1 call kDownFunc; false;"];
			nosKeyUp = (findDisplay 46) displayAddEventHandler ["KeyUp","_this select 1 call kUpFunc; false;"];
		} else {
			donn_nosOk = false;
		};
		//WAIT TO BE OUT OF THE VEHICLE
		waitUntil {sleep 0.25; vehicle player == player || (driver (vehicle player)) != player};
		if (donn_nosOk) then {
			donn_nitroOn = false;
			donn_airStarted = nil;
			donn_airWait = nil;
			donn_problem = nil;
			(findDisplay 46) displayRemoveEventHandler ["KeyDown", nosKeyDown];
			(findDisplay 46) displayRemoveEventHandler ["KeyUp", nosKeyUp];
		};
	};
};

MISSION FILES: NEW FILES SOUNDS

Download the file in the link bellow and unzip it to the NOS folder. Those are the 3 sounds:
 
https://www.dropbox.com/s/0p7xiu69f798rto/Donn%20Nitro%20Sounds%20v2.0.7z?dl=0
 
MISSION FILES: SOUND DECLARATIONS

In your description.ext (this is not a new file), located in your mission folder, you need to declare the 3 sounds useds on Gelid Nitro. You may have other sounds already delcared, if so just add Gelid Nitro sounds along with then. The sound names are nitro, suction and exhaustor:



class CfgSounds {
    class nitro  {
        name="nitro";
        sound[]={NOS\nitro.ogg,0.9,1};
        titles[] = {};
    };
    class suction  {
        name="suction";
        sound[]={NOS\suction.ogg,0.1,1};
        titles[] = {};
    };
    class exhaustor  {
        name="exhaustor";
        sound[]={NOS\exhaustor.ogg,1,1};
        titles[] = {};
    };
};

MISSION FILES: init.sqf

At the end of your init.sqf add this code:



[] execVM "nitro\nitro.sqf";

HOW TO USE

1 - Enter in a car that have Nitro, see list bellow.
2 - You will listem am initial air flow sound (this happens on cars that have Nitro).
3 - Press space bar to turn Nitro On/Off.
4 - When you reach 50 Km/h, the Nitro sound will start, and your car will receive a boost.

List of cars with Nitro:


donn_nitroCars = [
	"car_sedan",
	"car_sedan_DZE1",
	"car_sedan_DZE2",
	"car_sedan_DZE3",
	"car_sedan_DZE4",
	"VWGold",
	"VWGold_DZE1",
	"VWGold_DZE2",
	"VWGold_DZE3",
	"VWGold_DZE4",
	"car_hatchback",
	"car_hatchback_DZE1",
	"car_hatchback_DZE2",
	"car_hatchback_DZE3",
	"car_hatchback_DZE4",
	"datsun1_civil_1_open",
	"datsun1_civil_1_open_DZE1",
	"datsun1_civil_1_open_DZE2",
	"datsun1_civil_1_open_DZE3",
	"datsun1_civil_1_open_DZE4",
	"SUV_Camo",
	"SUV_Camo_DZE1",
	"SUV_Camo_DZE2",
	"SUV_Camo_DZE3",
	"SUV_Camo_DZE4",
	"datsun1_civil_3_open",
	"datsun1_civil_3_open_DZE1",
	"datsun1_civil_3_open_DZE2",
	"datsun1_civil_3_open_DZE3",
	"datsun1_civil_3_open_DZE4",
	"GLT_M300_ST",
	"HMMWV_DZ"
];
Link to comment
Share on other sites

Last tweak 99% done.

Acceleration mode completely changed!

In the new acelleration process two directions are considered:

1) From the Velocity Vector - The direction the car in moving*.

2) From the Car Vector - The direction the car is facing.

Those directions are coincident in most of the cases... but if you lost control of your car, they can differs from a bit to a lot!

Result in a few words:

- Better car control

- More real feel

- More real skidings

*********************************************
*********************************************
*** To be released when i get home today! ***
*********************************************
*********************************************
----//----

If someone have a list of Cars that would have Nitro, and want to share, i can implement it on the script.

* thanks ebay.

Link to comment
Share on other sites

i have a overpoch server and i do have a few list of vehicles, if you need any help with that , but i mostly only wanted to add it to maybe locked vehicles or 350z so the list for them would be

"350z_yellow",

"350z_city",
"350z_ruben",
"350z_v",
"350z_mod",
"350z_white",
"350z_pink",
"350z_gold",
"350z_blue",
"350z_silver,
"350z_green",
"350z_black",
"350z_kiwi",
"350z",Item,
"350z_red",

 

heres another script looks about the same , has a few changes in it that make it a bit different 

 

http://opendayz.net/threads/release-nos-for-cars.20620/

 

Thanks again for your response and time =] have a great day.

Link to comment
Share on other sites

Installed, looks great so far, any way of adding a timer for the process to limit how long the nitro lasts for, and then some form of regeneration time afterwards

Link to comment
Share on other sites

TehGunz, is you using the nitro.sqf script from post #15?

----//----

A timer?

There are two nitro levels:

First you need to turn on Nitro on the context menu:

Level 1) Normal Boost, happens when you press shift.

Level 2) Extra Boost, happens aleatory, after the pipe explosion, and is more intense than Level 1 Boost.

You want a timer for what Level?

Link to comment
Share on other sites

Hey thanks for the quick reply,

 

Im using the one from post #15 (very nice btw, added a check to limit the script to around 200kmph)

 

Would be good if once activated using the scroll option it would then wait 20-30 seconds and disable it again.

 

Thanks, Gunz

Link to comment
Share on other sites

TNT,

Gelid Nitro is based on this one: http://opendayz.net/threads/release-nos-for-cars.20620/

And "this one" is based in the unreleased Nitro script by Sandbird, the user give full credits to Sandbird. This is why i just mention Sandbird on the op.

 

Hey iam not getting any problems at rpt but i am not either getting the option to install the Nitro to cars.

Here is my files what i think i might do something wrong.

http://pastebin.com/G2WVPMgC

Link to comment
Share on other sites

Nitro updated to 2.0!

It's awesome-me-me-me!!!

Sadies: If you use infiStar and you is not a admin, the custom binds used in this script (space bar and left shift) will be disabled.

Set Disable Custom Binds to False in infiSTAR will not fix the problem.

I did a work arround changing code in infiSTAR AH.SQF file. If you have any other idea, tell me please.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...