Jump to content

Recommended Posts

Simple weapon jam script :

 

initplayerlocal.sqf

player addEventHandler ["Fired", {
	params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

	_probability = 9.5;
	if(random 10 > _probability)then{
	
		GF_WJ_id = player addAction ["", {
			playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
		}, "", 0, false, true, "DefaultAction", ""];
			
		_magazines = magazinesAmmoFull player;
		_count = count _magazines;
		_currentMagazine = currentMagazine player;
		player setAmmo [currentWeapon player, 0];
		for "_i" from 0 to(_count)do{
			if(((_magazines select _i) select 0) isequalto _currentMagazine)then{
				if((_magazines select _i) select 2)then{
					_countAmmo = ((_magazines select _i) select 1);
					player addMagazine [_currentMagazine, _countAmmo];
				};
			};
		};
		systemChat "JAMMED - Reload";
	};	
}];


player addEventHandler ["Reloaded", {
	params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
	
	player removeAction GF_WJ_id;
}];

 

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

@GEORGE

 

Thanks for the weapon jam script, added to my warfare and becti edits. 😉

 

What's next? 😊

 

Have a happy new year George. Best wishes to you and your family for 2020 and beyond. 😉

  • Thanks 1

Share this post


Link to post
Share on other sites
8 hours ago, law-giver said:

Have a happy new year George. Best wishes to you and your family for 2020 and beyond. 😉

 

Happy New Year to everyone !

cda7e5155925761c42773ed171722182.jpg

My best wishes from Greece  !

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites
23 hours ago, GEORGE FLOROS GR said:

Simple weapon jam script :

 

11 hours ago, law-giver said:

What's next? 😊

 

and overheat  added :

//	initplayerlocal.sqf

GF_WJ_probability = 9.5;
GF_WJ_overheat_limit = 100;


GF_WJ_overheat = 0;

[]spawn{
	while{true}do{
		if!(GF_WJ_overheat isEqualto 0)then{GF_WJ_overheat = GF_WJ_overheat - 1;};
		hint format ["%1",GF_WJ_overheat];
		uisleep 3;
	};
};

player addEventHandler ["Fired", {
	params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

	GF_WJ_overheat = GF_WJ_overheat + 1;
	
	if(
		(random 10 > GF_WJ_probability)
		or 
		(GF_WJ_overheat > GF_WJ_overheat_limit)
	)then{
	
		GF_WJ_id = player addAction ["", {
			playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
		}, "", 0, false, true, "DefaultAction", ""];
			
		_magazines = magazinesAmmoFull player;
		_count = count _magazines;
		_currentMagazine = currentMagazine player;
		player setAmmo [currentWeapon player, 0];
		for "_i" from 0 to(_count)do{
			if(((_magazines select _i) select 0) isequalto _currentMagazine)then{
				if((_magazines select _i) select 2)then{
					_countAmmo = ((_magazines select _i) select 1);
					player addMagazine [_currentMagazine, _countAmmo];
				};
			};
		};
		systemChat "JAMMED - Reload";
	};	
}];


player addEventHandler ["Reloaded", {
	params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
	
	player removeAction GF_WJ_id;
}];

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
8 hours ago, GEORGE FLOROS GR said:

 

 

and overheat  added :


//	initplayerlocal.sqf

GF_WJ_probability = 9.5;
GF_WJ_overheat_limit = 100;


GF_WJ_overheat = 0;

[]spawn{
	while{true}do{
		if!(GF_WJ_overheat isEqualto 0)then{GF_WJ_overheat = GF_WJ_overheat - 1;};
		hint format ["%1",GF_WJ_overheat];
		uisleep 3;
	};
};

player addEventHandler ["Fired", {
	params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];

	GF_WJ_overheat = GF_WJ_overheat + 1;
	
	if(
		(random 10 > GF_WJ_probability)
		or 
		(GF_WJ_overheat > GF_WJ_overheat_limit)
	)then{
	
		GF_WJ_id = player addAction ["", {
			playSound3D ['a3\sounds_f\weapons\Other\dry9.wss', _this select 0];
		}, "", 0, false, true, "DefaultAction", ""];
			
		_magazines = magazinesAmmoFull player;
		_count = count _magazines;
		_currentMagazine = currentMagazine player;
		player setAmmo [currentWeapon player, 0];
		for "_i" from 0 to(_count)do{
			if(((_magazines select _i) select 0) isequalto _currentMagazine)then{
				if((_magazines select _i) select 2)then{
					_countAmmo = ((_magazines select _i) select 1);
					player addMagazine [_currentMagazine, _countAmmo];
				};
			};
		};
		systemChat "JAMMED - Reload";
	};	
}];


player addEventHandler ["Reloaded", {
	params ["_unit", "_weapon", "_muzzle", "_newMagazine", "_oldMagazine"];
	
	player removeAction GF_WJ_id;
}];

 

 

Nice one George, but dare i ask again. Hehe 😁

  • Haha 1

Share this post


Link to post
Share on other sites
19 hours ago, GEORGE FLOROS GR said:

and overheat  added :

great idea bro.  Happy New Year!

  • Thanks 1

Share this post


Link to post
Share on other sites
37 minutes ago, johnnyboy said:

great idea bro.  Happy New Year! 

 

Thank you very much Johnnyboy !

Happy new year to you and your family !

 

But your new middle finger script rocks !!!! 

source.gif

Spoiler

 

 

  • Haha 1

Share this post


Link to post
Share on other sites

Ejection from air vehicles ,

with parachute and once the land is over the bag with the stuff is loaded again.

2 minutes ago, GEORGE FLOROS GR said:

initplayerlocal.sqf


GF_Eject = {
	
	unassignvehicle _this;
	moveOut _this;
	
	private _data = [backpack _this,backpackitems _this];
    removeBackpack _this;
	_this addBackPack "B_parachute";	
	
	cutText ["", "BLACK FADED",999];
	[_this]spawn{
		private "_unit";
		_unit = _this select 0;
		
		uisleep 0.5;
		
		"dynamicBlur" ppEffectEnable true;
		"dynamicBlur" ppEffectAdjust [8];
		"dynamicBlur" ppEffectCommit 0;
		"dynamicBlur" ppEffectAdjust [0.0];
		"dynamicBlur" ppEffectCommit 6;
		
		cutText ["", "BLACK IN", 3];
	};
	
	waitUntil {animationState _this == "para_pilot"};
	
	enableCamShake true;
	addCamShake [5, 5, 25];

	setAperture 0.05;
	setAperture -1;
	"DynamicBlur" ppEffectEnable true;
	"DynamicBlur" ppEffectAdjust [8.0];
	"DynamicBlur" ppEffectCommit 0.01;
	uisleep 1;
	"DynamicBlur" ppEffectAdjust [0.0];
	"DynamicBlur" ppEffectCommit 3;
	uisleep 3;
	"DynamicBlur" ppEffectEnable false;
	"RadialBlur" ppEffectAdjust [0.0, 0.0, 0.0, 0.0];
	"RadialBlur" ppEffectCommit 1.0;
	"RadialBlur" ppEffectEnable false;
	
	enableCamShake false;
	
	[_this,_data] spawn {
	private ["_unit","_data"];
	_unit = _this select 0;
	_data = _this select 1;
	waitUntil {uisleep 1; isTouchingGround _unit or (position _unit select 2) < 1 };
	uisleep 1;
	removeBackpack _unit;
	_unit addbackpack (_data select 0);
	{_unit additemtobackpack _x;} foreach (_data select 1);
	};
};

player addAction ["<t size='1.2' font='RobotoCondensedBold' color='#FF9933'>'Eject</t><br/><img size='4' image='\a3\ui_f\data\gui\cfg\CommunicationMenu\supplydrop_ca.paa'/>", "player call GF_Eject", [], -1, false, false, "", "_target iskindof 'AIR' && { driver (vehicle _target) == _this} && {(position _target select 2) > 100} "];

 

  • Like 3

Share this post


Link to post
Share on other sites

Raising the dead?

6 hours ago, GEORGE FLOROS GR said:

add this in the init of the unit that you want :


//	as @pierremgi said , 
  if (isServer) then {this execVM "GF_Play_dead.sqf"}; 

 

and add this file :

 

GF_Play_dead.sqf


GF_Wake_up_Distance 	= 10;	//	meters


GF_Play_dead = {

	params ["_unit"];
	
	[_unit,true]remoteExec["setUnconscious",_unit];
	[_unit,true]remoteExec["setCaptive",0];
	_unit spawn GF_Wake_up_Distance_Check;
	[_unit,false]remoteExec["allowDamage",_unit];
	
	systemchat "GF_Play_dead";
};

GF_Wake_up = {

	params ["_unit"];

	[_unit,false]remoteExec["setUnconscious",_unit];
	["#rev",1,_unit]remoteExecCall["BIS_fnc_reviveOnState",_unit];
	uisleep 1;
	[_unit,true]remoteExec["allowDamage",_unit];
	
	systemchat "GF_Wake_up";
};

GF_Wake_up_Distance_Check = {

	private _false = false;
	while{!_false}do{

		_allPlayers = allUnits select {isPlayer _x && {alive _x} && {!(_x isKindOf "HeadlessClient_F")}};
		if(isMultiplayer)then{

			if({_x distance _this < GF_Wake_up_Distance}count _allPlayers > 0)then{
				[_this] call GF_Wake_up;
				_false = true;
			};
		}else{
			if((_this distance player) < GF_Wake_up_Distance)then{
				[_this] call GF_Wake_up;
				_false = true;
			};
		};
		uisleep 3;
		systemchat "GF_Wake_up_Distance_Check";
	};
};


_this call GF_Play_dead;
Edited by GEORGE FLOROS GR
as @pierremgi said , if (isServer) then {this execVM "GF_Play_dead.sqf"};
  • Like 4

Share this post


Link to post
Share on other sites

Hello there to everyone !

 

This is what i'm using to get more FPS , playing on my old laptop with the minimum requirements.

 

If there is anyone with any  solution etc , it would be great to oppose his opinion and share the discussion.

Thanks !

 

initPlayerLocal.sqf

enableEnvironment [false, true];
setTerrainGrid 40;
setShadowDistance 0;
setDetailMapBlendPars [0,0];


GF_fps_debug 			= true;
GF_scoped_VD 			= 800;	//	setViewDistance distance 
GF_noscoped_VD 			= 600;	//	setViewDistance distance 
GF_scoped_OVD 			= 700;	//	setObjectViewDistance [objectDistance, shadowDistance]
GF_noscoped_OVD 		= 500;	//	setObjectViewDistance [objectDistance, shadowDistance]


if(hasinterface)then{
	addMissionEventHandler ["EachFrame", {
		
		if(GF_fps_debug)then{
			hintsilent format ["fps: %1 \n VD: %2 \n OVD: %3",round diag_fps,viewDistance,getObjectViewDistance];
		};
		
		if(cameraView isEqualTo "GUNNER")then{
			setViewDistance GF_scoped_VD;
			setObjectViewDistance GF_scoped_OVD;
		}else{
			setViewDistance GF_noscoped_VD;
			setObjectViewDistance GF_noscoped_OVD;
		};
	}];
};

 

initServer.sqf

_filter	= 3; 	//	out of 10 , 1 = 100% , 10 = 0%


/*
https://community.bistudio.com/wiki/nearestTerrainObjects
Here is a readout for Altis (as of 1.76), showing you the actual usefulness of the different object-types 
(some of them are apparently not used/defined at all). Especially the road type names sadly return nothing.
*/

//	comment from the list to exclude
_list = [
	//	Altis
	"TREE",	//	: 263630
	"SMALL TREE",	//	: 0
	"BUSH",	//	: 747193
	//	"BUILDING",	//	: 0
	//	"HOUSE",	//	: 17472
	"FOREST BORDER",	//	: 0
	"FOREST TRIANGLE",	//	: 0
	"FOREST SQUARE",	//	: 0
	"CHURCH",	//	: 54
	//	"CHAPEL",	//	: 165
	"CROSS",	//	: 0
	"BUNKER",	//	: 0
	"FORTRESS",	//	: 0
	"FOUNTAIN",	//	: 0
	"VIEW-TOWER",	//	: 0
	//	"LIGHTHOUSE",	//	: 7
	"QUAY",	//	: 0
	//	"FUELSTATION",	//	: 32
	//	"HOSPITAL",	//	: 1
	//	"FENCE",	//	: 47940
	//	"WALL",	//	: 38943
	"HIDE",	//	: 655066
	"BUSSTOP",	//	: 0
	"ROAD",	//	: 0
	"FOREST",	//	: 0
	//	"TRANSMITTER",	//	: 23
	//	"STACK",	//	: 48
	//	"RUIN",	//	: 3
	//	"TOURISM",	//	: 1
	//	"WATERTOWER",	//	: 10
	"TRACK",	//	: 0
	"MAIN ROAD",	//	: 0
	"ROCK",	//	: 5483
	"ROCKS",	//	: 0
	//	"POWER LINES",	//	: 2224
	//	"RAILWAY",	//	: 0
	//	"POWERSOLAR",	//	: 10
	//	"POWERWAVE",	//	: 51
	//	"POWERWIND",	//	: 128
	"SHIPWRECK",	//	: 43
	"TRAIL"	//	: 0
];


_a = 0;
_centerPosition = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
if(isMultiplayer)then{
	{
		_x enableSimulationGlobal false;
		if(random 10 > _filter)then{_x hideobjectGlobal true};
		_a = _a + 1;
		systemchat format["hide Objects : %1",_a];
	}forEach nearestTerrainObjects [_centerPosition, _list,worldsize,TRUE];
}else{
	{
		_x enablesimulation false;
		if(random 10 > _filter)then{_x hideobject true};
		_a = _a + 1;
		systemchat format["hide Objects : %1",_a];
	}forEach nearestTerrainObjects [_centerPosition, _list,worldsize,TRUE];
};

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Interesting. I too suffer from bad FPS due to old hardware and only recently I found this old post showing a possibly long forgotten @tpw's script that helped me a lot.

The major difference to yours might be the detection of current FPS and automatic adjustment to view distance.

His also doesn't mess with enableSimulation, which you might have something there. 😉

Good job nonetheless. 👍

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
21 hours ago, RCA3 said:

current FPS

 

Thank you very much RCA3 !

 

Just out of curiosity ,

if you try this , if you want tell me your fps with this script running.

I was trying to find also a way to delay the zoom ,by pressing the right click button

inputAction "ZoomTemp"

like the dayz , maybe it should be the same for arma 2 , it's slower and the fps are not getting low to freeze when rendering , but i don't have any idea so far !

Share this post


Link to post
Share on other sites

Not sure what you wanted me to compare with so here you go: 😆

Quote

Vanilla VD:1600 OVD:1105

Frames: 2403 - Time: 60000ms - Avg: 40.050 - Min: 28 - Max: 56

InitServer VD:600 OVD:500
Frames: 2734 - Time: 60000ms - Avg: 45.567 - Min: 29 - Max: 65

InitPlayerLocal VD:600 OVD:500
Frames: 3748 - Time: 60000ms - Avg: 62.467 - Min: 32 - Max: 87

InitServer & InitPlayerLocal VD:600 OVD:500
Frames: 4551 - Time: 60000ms - Avg: 75.850 - Min: 47 - Max: 98

InitServer VD:1600 OVD:1105

Frames: 2721 - Time: 60000ms - Avg: 45.350 - Min: 32 - Max: 63

InitPlayerLocal VD:1600 OVD:1105
Frames: 3237 - Time: 60000ms - Avg: 53.950 - Min: 32 - Max: 71

InitServer & InitPlayerLocal VD:1600 OVD:1105
Frames: 3776 - Time: 60000ms - Avg: 62.933 - Min: 39 - Max: 82

Edited by RCA3
Added InitServer VD:1600 OVD:1105.
  • Like 1

Share this post


Link to post
Share on other sites
On 1/7/2020 at 9:48 PM, RCA3 said:

Not sure what you wanted me to compare with so here you go: 😆

 

Those are very good results @RCA3 and a very detailed answer!

 

PS: Could you share your InitServer & InitPlayerLocal files with us?

 

Thank you!

Share this post


Link to post
Share on other sites
4 hours ago, LSValmont said:

PS: Could you share your InitServer & InitPlayerLocal files with us?

Hi, thanks. I'm just using George's inits above. 🙂

Share this post


Link to post
Share on other sites
4 hours ago, RCA3 said:

Hi, thanks. I'm just using George's inits above. 🙂

 

Exclusively or merged with TPW''s Solution?

 

PS: If merged, I would still love how you ordered them inside your files. 

Share this post


Link to post
Share on other sites
1 hour ago, LSValmont said:

Exclusively or merged with TPW''s Solution?

Exclusively.

Share this post


Link to post
Share on other sites
4 minutes ago, RCA3 said:

Exclusively.

 

Any particular reason you removed TPW's script in favor of George's exclusivity? Or it would benefit to use all of them?

Share this post


Link to post
Share on other sites
1 hour ago, LSValmont said:

 

Any particular reason you removed TPW's script in favor of George's exclusivity? Or it would benefit to use all of them?

Haven't tested with both yet, I posted here for George to do it. 😄

initplayerLocal.sqf and TPW's are both defining viewDistance, so still remains to see which one performs better (can't really compare them, it's a matter of preference, if you want dynamic viewDistance or not).

  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, RCA3 said:

it's a matter of preference, if you want dynamic viewDistance or not

 

I totally agree with that ,

the distance generally will make a great difference not only with fps but with the gameplay as well ,so it's hard to limit it.

The whole thing in this story is if there is something more than that !

  • Like 1

Share this post


Link to post
Share on other sites
On 1/8/2020 at 2:48 AM, RCA3 said:

Not sure what you wanted me to compare with so here you go: 😆

Quote

Vanilla VD:1600 OVD:1105

Frames: 2403 - Time: 60000ms - Avg: 40.050 - Min: 28 - Max: 56

InitServer VD:600 OVD:500
Frames: 2734 - Time: 60000ms - Avg: 45.567 - Min: 29 - Max: 65

InitPlayerLocal VD:600 OVD:500
Frames: 3748 - Time: 60000ms - Avg: 62.467 - Min: 32 - Max: 87

InitServer & InitPlayerLocal VD:600 OVD:500
Frames: 4551 - Time: 60000ms - Avg: 75.850 - Min: 47 - Max: 98

InitServer VD:1600 OVD:1105

Frames: 2721 - Time: 60000ms - Avg: 45.350 - Min: 32 - Max: 63

InitPlayerLocal VD:1600 OVD:1105
Frames: 3237 - Time: 60000ms - Avg: 53.950 - Min: 32 - Max: 71

InitServer & InitPlayerLocal VD:1600 OVD:1105
Frames: 3776 - Time: 60000ms - Avg: 62.933 - Min: 39 - Max: 82

 

there is a better performance though as i see , thanks also !  :wave:

 

  • Like 2

Share this post


Link to post
Share on other sites

it's definitely improving the FPS in my old laptop in the minimum requirements !

So the above video is working !

Share this post


Link to post
Share on other sites
9 hours ago, GEORGE FLOROS GR said:

it's definitely improving the FPS in my old laptop in the minimum requirements !

So the above video is working !

the sceneComplexity is related to the object detail setting in the video options, so you can change it from there if you want = )

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@George 

Apologies if this has been asked before and I missed it....

I'm playing around with the Random Missions script (awesome work BTW) but with the changes to WaitUntil I keep seeing issues with the waitUntil {count list _Trigger_Present > 4}; waitUntil {count list _Trigger_Present < 3}; lines in the Check Task section. 

 

Any advice?

 

  • Like 1

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

×