Jelajahi Sumber

updated jumppack scripts

Namenai 7 tahun lalu
induk
melakukan
4001c8938a

+ 3 - 2
Scripts/initPlayerLocal.sqf

@@ -1,4 +1,4 @@
-/*
+
 (_this select 0) addEventHandler ["InventoryOpened", {
 	
 	namUnit=(_this select 0);
@@ -10,6 +10,7 @@
 		[namUnit] execVM "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpAssinger.sqf";
 		[namUnit] execVM "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpShort.sqf";
 		[namUnit] execVM "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpLong.sqf";
+		[namUnit] execVM "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpVertical.sqf";
 		[namUnit] execVM "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpHandler.sqf";
 		namUnit setVariable ["namJumpPackConfig", true, true];
 
@@ -23,7 +24,7 @@
 namUnit=(_this select 0);
 namUnit setVariable ["namJumpPackConfig", false, true];
 }];
-*/
+
 
 //delets body on death
 Player addEventHandler ["GetInMan", {

+ 13 - 2
Scripts/scripts/zeus3denScripts/playerBased/airborne/HJS Protocal/jumpAssinger.sqf

@@ -13,7 +13,7 @@ jumpData=[false,0,0,5,2];
 
 personToApply setVariable ["jumpArray", jumpData,true];
 
-_namShortJumpDistY=5;//in meters
+_namShortJumpDistY=2;//in meters
 _namShortJumpDistX=10;//in meters
 
 _namShortJumpVeloY=1;//meters/second
@@ -26,6 +26,12 @@ _namLongJumpDistX=45;//in meters
 _namLongJumpVeloY=1;//meters/second
 _namLongJumpVeloX=1;//meters/second
 
+_namVertJumpDistY=20;//in meters
+_namVertJumpDistX=5;//in meters
+
+_namVertJumpVeloY=1;//meters/second
+_namVertJumpVeloX=1;//meters/second
+
 
 
 
@@ -39,7 +45,12 @@ _namLongJumpVeloY=sqrt(-2*-9.8*_namLongJumpDistY);
 _tLong=(-_namLongJumpDistY)/(-9.8);
 _namLongJumpVeloX=_namLongJumpDistX/(2*_tLong);
 
+//Vert calculations
+_namVertJumpVeloY=sqrt(-2*-9.8*_namVertJumpDistY);
+_tVert=(-_namVertJumpDistY)/(-9.8);
+_namVertJumpVeloX=_namVertJumpDistX/(2*_tVert);
+
 
-jumpPhysicsData=[[_namShortJumpVeloX,_namShortJumpVeloY],[_namLongJumpVeloX,_namLongJumpVeloY]];
+jumpPhysicsData=[[_namShortJumpVeloX,_namShortJumpVeloY],[_namLongJumpVeloX,_namLongJumpVeloY],[_namVertJumpVeloX,_namVertJumpVeloY]];
 
 personToApply setVariable ["jumpPhysicsArray", jumpPhysicsData,true];

+ 59 - 62
Scripts/scripts/zeus3denScripts/playerBased/airborne/HJS Protocal/jumpDecider.sqf

@@ -1,83 +1,80 @@
+//Params["personToApply"];
+	
 
+	_namUnit=_this select 0;
+	_namThisJumpData=_namUnit getVariable["jumpArray",[false,0,0,5,2]];
+	_namResult=false;
+	
 
 	
-		_namUnit=_this select 0;
-		_namThisJumpData=_namUnit getVariable["jumpArray",[]];
-		_result=false;
+	
+	
+	comment "data from jump array";
+	
+	comment "is Jumping-0
+	last jump time-1
+	jump counter-2
+	cooldown-3
+	max consecutive jumps-4
+	!C or (!A and B)";
+	
+	_namIsJumping=_namThisJumpData select 0;
+	_namLastJumpTime=_namThisJumpData select 1;
+	_namJumpCounter=_namThisJumpData select 2;
+	_namJumpCooldownTime=_namThisJumpData select 3;
+	_namMaxJump=_namThisJumpData select 4;
+	comment "A-is jumping B-is cooled C-is over counter /// karnugh map variables";
+	
+	_namTimeSinceLastJump=time-_namLastJumpTime;
+	
+	_A=_namIsJumping;
+	comment "true if cooled";
+	_B=(_namTimeSinceLastJump)>_namJumpCooldownTime;
+	comment "true if u just 'double jumped'";
+	_C=_namJumpCounter>=_namMaxJump;
+	
+	[west, "HQ"] sideChat format["jumpdata %1 %2",_namThisJumpData,time];
+	
+	if((count _namThisJumpData) !=0) then
+	{
 		
-		if((count _namThisJumpData) ==0) then 
+		_namIsOverCounter=_C;
+		_namIsCool=(time-_namLastJumpTime)>=_namJumpCooldownTime;
+		
+		comment "if ur cooled then reset counter";
+		if(_B)then
 		{
-			_namThisJumpData=[false,0,0,5,2];
+			_namJumpCounter=0;
+			_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
 		};
+
 		
-		
-		
-		comment "data from jump array";
-		
-		comment "is Jumping-0
-		last jump time-1
-		jump counter-2
-		cooldown-3
-		max consecutive jumps-4
-		!C or (!A and B)";
-		
-		_namIsJumping=_namThisJumpData select 0;
-		_namLastJumpTime=_namThisJumpData select 1;
-		_namJumpCounter=_namThisJumpData select 2;
-		_namJumpCooldownTime=_namThisJumpData select 3;
-		_namMaxJump=_namThisJumpData select 4;
-		comment "A-is jumping B-is cooled C-is over counter /// karnugh map variables";
-		
-		_namTimeSinceLastJump=time-_namLastJumpTime;
-		
-		_A=_namIsJumping;
-		comment "true if cooled";
-		_B=(_namTimeSinceLastJump)>_namJumpCooldownTime;
-		comment "true if u just 'double jumped'";
-		_C=_namJumpCounter>=_namMaxJump;
-		
-		if((count _namThisJumpData) !=0) then
+
+		if(!_C || {!_A && {_B}}) then 
 		{
 			
-			_namIsOverCounter=_C;
-			_namIsCool=(time-_namLastJumpTime)>=_namJumpCooldownTime;
+	
+			_namResult=true;
+
+		}
+		else
+		{
+
+			hint parseText  format["Can not boost. <t color='#40e0d0'>Cooldown done in</t> <t color='#FF0000'>%1</t>",(_namJumpCooldownTime-(time-_namLastJumpTime))];
 			
-			comment "if ur cooled then reset counter";
-			if(_B)then
-			{
+			if(_B || {(_namJumpCooldownTime-(time-_namLastJumpTime))<0}) then 
+			{	
 				_namJumpCounter=0;
 				_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
 			};
-
-			
-
-			if(!_C || {!_A && {_B}}) then //true if u can jump
-			{
-				_result=true;
-				_result
-
-			}
-			else
-			{
-
-				hint parseText  format["Can not boost. <t color='#40e0d0'>Cooldown done in</t> <t color='#FF0000'>%1</t>",(_namJumpCooldownTime-(time-_namLastJumpTime))];
-				
-				if(_B || {(_namJumpCooldownTime-(time-_namLastJumpTime))<0}) then 
-				{	
-					_namJumpCounter=0;
-					_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
-				};
-				_result=false;
-			};
-
-
-		_result//return value
+		};
 
 
 
-		};
+	_namResult
 
 
+	};
 
 
 

+ 6 - 6
Scripts/scripts/zeus3denScripts/playerBased/airborne/HJS Protocal/jumpHandler.sqf

@@ -11,15 +11,15 @@ personToApply=_this select 0;
 		if(_namIsJumping && {isTouchingGround _namUnit} ) then
 		{		
 			
-			
+			_namResult=0;
 			_null = _this spawn
 			{
 				_namUnitSpawn=_this select 0;
 				_namJumpDataSpawn=_namUnitSpawn getVariable["jumpArray",[false,0,0,5,2]];
-				[west, "HQ"] sideChat format["%1 v1",time];
-				hint format["%1",time];
-				sleep 0.05;
-				[west, "HQ"] sideChat format["%1 v2 killable",time];
+				
+				
+				sleep 0.5;
+				
 				_namUnitSpawn setVariable ["jumpArray", [false,(_namJumpDataSpawn select 1),(_namJumpDataSpawn select 2),(_namJumpDataSpawn select 3),(_namJumpDataSpawn select 4)],true];
 				
 				
@@ -34,7 +34,7 @@ personToApply=_this select 0;
 		_namResult=_this call ACE_medical_fnc_handleDamage;
 		};
 		
-		[west, "HQ"] sideChat format["dmg %1 %2",_namResult,time];
+		
 		_namResult
 		
 	}];

+ 36 - 75
Scripts/scripts/zeus3denScripts/playerBased/airborne/HJS Protocal/jumpLong.sqf

@@ -1,97 +1,58 @@
 //Params["personToApply"];
 personToApply=_this select 0;
-	personToApply  addAction ["<t color='#886600'>Long Jump--------U14</t>",
+	personToApply  addAction ["<t color='#00FF00'>Long Jump--------U14</t>",
 	{
 		_namUnit=_this select 0;
-		_namThisJumpData=_namUnit getVariable["jumpArray",[]];
 		
 		
-		if((count _namThisJumpData) ==0) then 
-		{
-			_namThisJumpData=[false,0,0,5,2];
-		};
+		
+
+		
 		
 		
 		
-		comment "data from jump array";
 		
-		comment "is Jumping-0
-		last jump time-1
-		jump counter-2
-		cooldown-3
-		max consecutive jumps-4
-		!C or (!A and B)";
 		
-		_namIsJumping=_namThisJumpData select 0;
-		_namLastJumpTime=_namThisJumpData select 1;
-		_namJumpCounter=_namThisJumpData select 2;
-		_namJumpCooldownTime=_namThisJumpData select 3;
-		_namMaxJump=_namThisJumpData select 4;
-		comment "A-is jumping B-is cooled C-is over counter /// karnugh map variables";
 		
-		_namTimeSinceLastJump=time-_namLastJumpTime;
+		_jumpResult = compile preprocessFile "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpDecider.sqf";
+		_jumpDecision = [_namUnit] call _jumpResult;
 		
-		_A=_namIsJumping;
-		comment "true if cooled";
-		_B=(_namTimeSinceLastJump)>_namJumpCooldownTime;
-		comment "true if u just 'double jumped'";
-		_C=_namJumpCounter>=_namMaxJump;
 		
-		if((count _namThisJumpData) !=0) then
+		if(_jumpDecision) then
 		{
+			comment "data from jump array";
+		
+			comment "is Jumping-0
+			last jump time-1
+			jump counter-2
+			cooldown-3
+			max consecutive jumps-4
+			!C or (!A and B)";
 			
-			_namIsOverCounter=_C;
-			_namIsCool=(time-_namLastJumpTime)>=_namJumpCooldownTime;
 			
-			comment "if ur cooled then reset counter";
-			if(_B)then
-			{
-				_namJumpCounter=0;
-				_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
-			};
-
+			_namThisJumpData=_namUnit getVariable["jumpArray",[false,0,0,5,2]];
 			
-
-			if(!_C || {!_A && {_B}}) then 
-			{
-				_namJumpPhysicsArray=_namUnit getVariable["jumpPhysicsArray",[[5,5],[20,40]]];
+			
+			_namJumpPhysicsArray=_namUnit getVariable["jumpPhysicsArray",[[5,5],[20,40],[1,40]]];
+		
+			_namSpeed=(_namJumpPhysicsArray select 1) select 0;
+			_namSpeedUp=(_namJumpPhysicsArray select 1) select 1;
+			
+			comment "initiate jump";
+			(_namUnit) setVelocity 
+			[
+			((vectordir (_namUnit)) select 0)*_namSpeed,
+			((vectordir (_namUnit)) select 1)*_namSpeed,
+			(velocity (_namUnit) select 2)+_namSpeedUp
+			];
+			
+			comment "update variables";
+			
+			
+			
+			//variables are (isJumping),(last jump time),(jump counter),(cooldown),(max consecutive jumps)
+			_namUnit setVariable ["jumpArray", [true,time,(_namThisJumpData select 2)+1,_namThisJumpData select 3,_namThisJumpData select 4],true];
 		
-				_namSpeed=(_namJumpPhysicsArray select 1) select 0;
-				_namSpeedUp=(_namJumpPhysicsArray select 1) select 1;
-				
-				comment "initiate jump";
-				(_namUnit) setVelocity 
-				[
-				((vectordir (_namUnit)) select 0)*_namSpeed,
-				((vectordir (_namUnit)) select 1)*_namSpeed,
-				(velocity (_namUnit) select 2)+_namSpeedUp
-				];
-				
-				comment "update variables";
-				_namIsJumping=true;
-				_namLastJumpTime=time;
-				_namJumpCounter=_namJumpCounter+1;
-				
-				_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
-
-			}
-			else
-			{
-
-				hint parseText  format["Can not boost. <t color='#40e0d0'>Cooldown done in</t> <t color='#FF0000'>%1</t>",(_namJumpCooldownTime-(time-_namLastJumpTime))];
-				
-				if(_B || {(_namJumpCooldownTime-(time-_namLastJumpTime))<0}) then 
-				{	
-					_namJumpCounter=0;
-					_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
-				};
-			};
-
-
-
-
-
-
 		};
 
 

+ 36 - 75
Scripts/scripts/zeus3denScripts/playerBased/airborne/HJS Protocal/jumpShort.sqf

@@ -1,97 +1,58 @@
 //Params["personToApply"];
 personToApply=_this select 0;
-	personToApply  addAction ["<t color='#FF66FF'>Short Jump--------U13</t>",
+	personToApply  addAction ["<t color='#FF0000'>Short Jump--------U13</t>",
 	{
 		_namUnit=_this select 0;
-		_namThisJumpData=_namUnit getVariable["jumpArray",[]];
 		
 		
-		if((count _namThisJumpData) ==0) then 
-		{
-			_namThisJumpData=[false,0,0,5,2];
-		};
+		
+
+		
 		
 		
 		
-		comment "data from jump array";
 		
-		comment "is Jumping-0
-		last jump time-1
-		jump counter-2
-		cooldown-3
-		max consecutive jumps-4
-		!C or (!A and B)";
 		
-		_namIsJumping=_namThisJumpData select 0;
-		_namLastJumpTime=_namThisJumpData select 1;
-		_namJumpCounter=_namThisJumpData select 2;
-		_namJumpCooldownTime=_namThisJumpData select 3;
-		_namMaxJump=_namThisJumpData select 4;
-		comment "A-is jumping B-is cooled C-is over counter /// karnugh map variables";
 		
-		_namTimeSinceLastJump=time-_namLastJumpTime;
+		_jumpResult = compile preprocessFile "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpDecider.sqf";
+		_jumpDecision = [_namUnit] call _jumpResult;
 		
-		_A=_namIsJumping;
-		comment "true if cooled";
-		_B=(_namTimeSinceLastJump)>_namJumpCooldownTime;
-		comment "true if u just 'double jumped'";
-		_C=_namJumpCounter>=_namMaxJump;
 		
-		if((count _namThisJumpData) !=0) then
+		if(_jumpDecision) then
 		{
+			comment "data from jump array";
+		
+			comment "is Jumping-0
+			last jump time-1
+			jump counter-2
+			cooldown-3
+			max consecutive jumps-4
+			!C or (!A and B)";
 			
-			_namIsOverCounter=_C;
-			_namIsCool=(time-_namLastJumpTime)>=_namJumpCooldownTime;
 			
-			comment "if ur cooled then reset counter";
-			if(_B)then
-			{
-				_namJumpCounter=0;
-				_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
-			};
-
+			_namThisJumpData=_namUnit getVariable["jumpArray",[false,0,0,5,2]];
 			
-
-			if(!_C || {!_A && {_B}}) then 
-			{
-				_namJumpPhysicsArray=_namUnit getVariable["jumpPhysicsArray",[[5,5],[20,40]]];
+			
+			_namJumpPhysicsArray=_namUnit getVariable["jumpPhysicsArray",[[5,5],[20,40],[1,40]]];
+		
+			_namSpeed=(_namJumpPhysicsArray select 0) select 0;
+			_namSpeedUp=(_namJumpPhysicsArray select 0) select 1;
+			
+			comment "initiate jump";
+			(_namUnit) setVelocity 
+			[
+			((vectordir (_namUnit)) select 0)*_namSpeed,
+			((vectordir (_namUnit)) select 1)*_namSpeed,
+			(velocity (_namUnit) select 2)+_namSpeedUp
+			];
+			
+			comment "update variables";
+			
+			
+			
+			//variables are (isJumping),(last jump time),(jump counter),(cooldown),(max consecutive jumps)
+			_namUnit setVariable ["jumpArray", [true,time,(_namThisJumpData select 2)+1,_namThisJumpData select 3,_namThisJumpData select 4],true];
 		
-				_namSpeed=(_namJumpPhysicsArray select 0) select 0;
-				_namSpeedUp=(_namJumpPhysicsArray select 0) select 1;
-				
-				comment "initiate jump";
-				(_namUnit) setVelocity 
-				[
-				((vectordir (_namUnit)) select 0)*_namSpeed,
-				((vectordir (_namUnit)) select 1)*_namSpeed,
-				(velocity (_namUnit) select 2)+_namSpeedUp
-				];
-				
-				comment "update variables";
-				_namIsJumping=true;
-				_namLastJumpTime=time;
-				_namJumpCounter=_namJumpCounter+1;
-				
-				_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
-
-			}
-			else
-			{
-
-				hint parseText  format["Can not boost. <t color='#40e0d0'>Cooldown done in</t> <t color='#FF0000'>%1</t>",(_namJumpCooldownTime-(time-_namLastJumpTime))];
-				
-				if(_B || {(_namJumpCooldownTime-(time-_namLastJumpTime))<0}) then 
-				{	
-					_namJumpCounter=0;
-					_namUnit setVariable ["jumpArray", [_namIsJumping,_namLastJumpTime,_namJumpCounter,_namJumpCooldownTime,_namMaxJump],true];
-				};
-			};
-
-
-
-
-
-
 		};
 
 

+ 66 - 0
Scripts/scripts/zeus3denScripts/playerBased/airborne/HJS Protocal/jumpVertical.sqf

@@ -0,0 +1,66 @@
+//Params["personToApply"];
+personToApply=_this select 0;
+	personToApply  addAction ["<t color='#0000FF'>Vertical Jump--------U15</t>",
+	{
+		_namUnit=_this select 0;
+		
+		
+		
+
+		
+		
+		
+		
+		
+		
+		
+		_jumpResult = compile preprocessFile "scripts\zeus3denScripts\playerBased\airborne\HJS Protocal\jumpDecider.sqf";
+		_jumpDecision = [_namUnit] call _jumpResult;
+		
+		
+		if(_jumpDecision) then
+		{
+			comment "data from jump array";
+		
+			comment "is Jumping-0
+			last jump time-1
+			jump counter-2
+			cooldown-3
+			max consecutive jumps-4
+			!C or (!A and B)";
+			
+			
+			_namThisJumpData=_namUnit getVariable["jumpArray",[false,0,0,5,2]];
+			
+			
+			_namJumpPhysicsArray=_namUnit getVariable["jumpPhysicsArray",[[5,5],[20,40],[1,40]]];
+		
+			_namSpeed=(_namJumpPhysicsArray select 2) select 0;
+			_namSpeedUp=(_namJumpPhysicsArray select 2) select 1;
+			
+			comment "initiate jump";
+			(_namUnit) setVelocity 
+			[
+			((vectordir (_namUnit)) select 0)*_namSpeed,
+			((vectordir (_namUnit)) select 1)*_namSpeed,
+			(velocity (_namUnit) select 2)+_namSpeedUp
+			];
+			
+			comment "update variables";
+			
+			
+			
+			//variables are (isJumping),(last jump time),(jump counter),(cooldown),(max consecutive jumps)
+			_namUnit setVariable ["jumpArray", [true,time,(_namThisJumpData select 2)+.75,_namThisJumpData select 3,_namThisJumpData select 4],true];
+		
+		};
+
+
+
+	}
+	,[1],0,false,true,"User15"," driver  _target == _this"];
+
+
+
+
+

+ 3 - 2
Scripts/scripts/zeus3denScripts/vehicleBased/vehicleVariants/landBased/AAT/aatMohawkClassBase.sqf

@@ -5,9 +5,10 @@ rexiAttMohawk=
 		
 		
 		
+		//also locks the aat
+		_vic setVehicleLock "LOCKED";
 		
-	
-		//by default will add the new gusn
+		//by default will add the new guns
 		_vic addWeaponTurret ["Cannon_EWEBSWBFgun", [0]];
 		for [{_i=0}, {_i<4}, {_i=_i+1}] do
 		{