Jump to content

Recommended Posts

2 hours ago, TK-7919 Aster said:

Thanks

 

Thank you TK-7919 Aster ! :thumbs-up:

Share this post


Link to post
Share on other sites

16.  How to make AI shoot only after the player shot

 

Once the player is in a disance from the enemies , the enemy will stop shooting.

 

initPlayerLocal.sqf

//	Once the player is in a disance from the enemies , the enemy will stop shooting.

GF_Captive_Safe_Distance = 10;	//	10m test


GF_Captive ={


player setCaptive true;

	player addEventHandler ["FiredMan", {
		params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"];
		
		params ["_unit"];
		_unit setCaptive false;
		hint "setCaptive false";
		_unit setVariable ["Var_GF_Captive",true];
	}];

	
		while {true} do {	
			waituntil{sleep 1;
				_nearestobjects = nearestObjects [getpos player, ["Man"],worldsize];
				{
					if (
						!(side _x isEqualto playerside)
						&& ((_x distance player) > GF_Captive_Safe_Distance)
						)then{	
							player setCaptive true;
							//	systemchat format["player > %1",GF_Captive_Safe_Distance];
						}else{
							//	systemchat "CLOSE";
					};
				}forEach _nearestobjects;	
				hint format["captive : %1",captive player];
			};
		};	
		
};	
	
player call GF_Captive;

 

Share this post


Link to post
Share on other sites

17. How to create a moving rad zone

 

5 hours ago, EO said:

So there are probably a million other ways to create a moving rad zone, but this is my method...

 

Create a rad zone trigger name it rad1.

Place down a unit, name it r1, give this unit some predefined move waypoints or alternatively use BIS_fnc_taskPatrol in the units init, lastly open the units Special States tab and uncheck Show Model. 

Place down another unit, name it r2, set the units Health/Armor slider to 0%, then open the units Special States tab and uncheck Show Model.  

Place down a game logic trigger...

Condition: !alive r2

On Activation: rad1 attachto [ r1, [0,0,0]];

 

On mission start, the game logic trigger will attach the rad zone (rad1) to the unit (r1) when unit (r2) is dead. It will also hide both r1 and r2 models. 

This creates a moving rad zone that will move around the map depending on which method you've used for r1.

 

In this video example r1 and r2 haven't been hidden in order to show how this set-up works.

:goodnight:

 

  • Thanks 2

Share this post


Link to post
Share on other sites

18. (Ravage) huntable animal spawner:

Spoiler

_VD_Animalspawn = {

  waitUntil {count ((allPlayers select {lifeState _x != "DEAD-RESPAWN"}) - entities "HeadlessClient_F") > 0};

  _allplayer = (allPlayers select {lifeState _x != "DEAD-RESPAWN"}) - entities "HeadlessClient_F";
  _player = selectRandom _allplayer;

_pos1 = [getPosATL _player, 90, 700, 0, 0, 0.9	, 0,[]] call BIS_fnc_findSafePos; // the first two numbers are the minimum and maximum range that the animals spawn related to the players position
_type = ["Goat_random_F","Sheep_random_F"] call BIS_fnc_selectRandom; // you can add more animals here - rabbits spawn by default. other animals might not be recognized by ravage as edible

_animals = createGroup east;
 	_animal = _animals createUnit [_type, _pos1, [], 1, "FORM"];
	_animal setVariable ["BIS_fnc_animalBehaviour_disable", true];
	_animal setSpeaker "NoVoice";
  _animal disableAI "FSM";
	_animal disableAI "AIMINGERROR";
	_animal disableAI "SUPPRESSION";
	_animal disableAI "AUTOTARGET";
	_animal disableAI "TARGET";
	_animal setCombatMode "BLUE";
	_animal setBehaviour "CARELESS";
[_animals, _pos1, 250] call BIS_fnc_taskPatrol;



sleep 600; // increase fix amount of time before animals may check for distance to player and wait for despawn.
sleep random 400; // ads a random amount 0-400 to above
waituntil {{_x distance _animal > 900}foreach allplayers - entities [["allplayers"], ["HeadlessClient_F"], true, true]}; // 900 is the distance to player, if the player is more than 900 meters away, and time timers have run out - animals will despawn and respawn closer to you.

{	deleteVehicle _x;
}forEach units _animals;
call _VD_Animalspawn;
};

waitUntil {count ((allPlayers select {lifeState _x != "DEAD-RESPAWN"}) - entities "HeadlessClient_F") > 0};


call _VD_Animalspawn;

 

copy + paste the above code in a new file in your mission folder called VD_Animalspawner.sqf.

 

create a file init.sqf in your mission folder or add the following line to it:

 

[] execVM "VD_Animalspawner.sqf";

 

It is a very old script and surely not perfect, but it does the job. let me know if you need help tunig it to your needs.

 

cheers

vd

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 2/5/2019 at 12:25 AM, EO said:

Ravage Zed Detector

 

 

This script "converts" the mine detector into a basic zed detector.

Player must have a mine detector in their inventory, bring up the Zed Detection HUD by pressing the "[" or "]" keys. (or whatever keybinds you have for the Custom Info Panels)  

 

zedDetector.sqf

  Reveal hidden contents


//zedDetector.sqf
if(!isDedicated) then {
	private _mineClass = "DemoCharge_Remote_Ammo";
	CMD_run = true;
	private _nearObjects = [];

	while { CMD_run } do {
		private _newObjects = (player nearEntities [["zombie"], 50]);

		{ 
			private _mine = _x getVariable ["CMD_attachedMine", objNull];
			deleteVehicle _mine;
			_x setVariable ["CMD_attachedMine", nil];
		} forEach (_nearObjects-_newObjects);
		
		_nearObjects = _newObjects;

		{
			if( !(player isEqualTo _x) && (vehicle _x isEqualTo _x) ) then {
				private _mine = _x getVariable ["CMD_attachedMine", objNull];
				if(abs speed _x >= 3) then {
					if(isNull _mine) then {
						_mine = _mineClass createVehicleLocal getPos _x;
						_mine attachTo [_x, [0,0,0]];
						_mine hideObject true;
						_x setVariable ["CMD_attachedMine", _mine];
						if(group _x isEqualTo group player) then {
							playerSide revealMine _mine;
						};
					};
				} else {
					if(!isNull _mine) then {
						detach _mine;
						deleteVehicle _mine;
					};
				};
			};
		} forEach _nearObjects;
		sleep 0.1;
	};
};

 


execvm "zedDetector.sqf"

 Credits: Original script by mrcurry. (slightly modified by EO) 

 

Hi EO,

i tried this in a mission of mine but somehow it dosent turn the mine detector into a z-detector, any advise or clue what im doing wrong?

Share this post


Link to post
Share on other sites

19. How to create a restriction for the pickable items :

 

15 minutes ago, GEORGE FLOROS GR said:

disabling , picking up stuff :

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#Take

ex:

On 12/20/2018 at 4:47 AM, GEORGE FLOROS GR said:

You can add the items that you want to be available or excluded , if you remove the "!" from the code :



if (!(_item in GF_List))  then { 

 



GF_List =[
//	add your list
"classname",
"classname"
]; 

player addEventHandler ["Take",{ 
params ["_unit", "_container", "_item"];

hint format["You picked a %1",_item];

if (!(_item in GF_List))  then { 
_unit unassignItem _item; 
_unit removeItem _item; 
hint "You can't wear that!"};
}];
  • Like 1

Share this post


Link to post
Share on other sites

George is back in action 🙂 nice script! 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank you very much Vandeanson !  :thumbs-up:

 

To be honest i was looking for it to post this in an other topic and while i was searching for this in the Ravage thread ( it took me a lot of time ! ) i decided to add this here as well.

 

Share this post


Link to post
Share on other sites

20.How to add a random or certain , loadout for everyone :

 

Spoiler




//________________	Author : GEORGE FLOROS [GR]	___________	19.06.19	_____________ 


/*
________________ GF Zombie Spawner Script - Mod	________________

Not Published yet	SOON !

Please keep the Credits or add them to your Diary

https://community.bistudio.com/wiki/SQF_syntax
Don't try to open this with the simple notepad.
For everything that is with comment  //  in front  or between /*
means that it is disabled , so there is no need to delete the extra lines.

You can open this ex:
with notepad++
https://notepad-plus-plus.org/

ArmA 3 | Notepad ++ SQF tutorial
https://www.youtube.com/watch?v=aI5P7gp3x90

and also use the extra pluggins
(this way will be better , it will give also some certain colors to be able to detect ex. problems )
http://www.armaholic.com/page.php?id=8680

or use any other program for editing .

For the Compilation List of my GF Scripts , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-scripts/

BI Forum Ravage Club Owner :
https://forums.bohemia.net/clubs/73-bi-forum-ravage-club/
*/



//________________ Debug info _____________
//________________ Set true or false  _____________

GF_ZS_Systemchat_info				= true;		
GF_ZS_diag_log_info					= true;

GF_ZS_Loadout_Select 				= 2;		//	1 = No change , 2 = Random , 3 = Custom (paste from arsenal)



if(GF_ZS_Systemchat_info)then{
	systemchat "GF_ZS_Loadout initializing";			
};	

if(GF_ZS_diag_log_info)then{
	diag_log "//________________	GF_ZS_Loadout initializing	________________";
};


GF_ZS_Loadout = {


//________________	exclude list	________________
	_list = [

	//  Max_Zombies  classnames
	
		"max_zombie_dog",
		"Max_zombie_female1_2",
		"Max_zombie_female1_5",
		"Max_zombie_female1_4",
		"Max_zombie_female1_3",
		"Max_zombie_female1_1",
		"Max_zombie_female1",
		"Max_zombie_female2_2",
		"Max_zombie_female2_5",
		"Max_zombie_female2_4",
		"Max_zombie_female2_3",
		"Max_zombie_female2_1",
		"Max_zombie_female2"
	];
	
	
	switch (GF_ZS_Loadout_Select) do{

		case 1 : {
			//	No change
		};
		
		
		case 2 : {

			if(!local _this) exitWith {};
			
			removeallweapons _this;
			removeAllItems _this;
			removeAllAssignedItems _this;
			if!(typeof _this in _list)then{removeUniform _this;};
			removeVest _this;
			removeBackpack _this;
			removeHeadgear _this;
			removeGoggles _this;


			//________________	_Uniform_array	________________
			_Uniform_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 801 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons"))apply{configName _x};

			//________________	_handgunWeapon_array	________________
			_handgunWeapon_array = ("getNumber (_x >> 'type') isEqualTo 2 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons"))apply{configName _x};

			_primaryWeapon_array = ("getNumber (_x >> 'type') isEqualTo 1 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons"))apply{configName _x};
			_secondaryWeapon_array = ("getNumber (_x >> 'type') isEqualTo 4 && getNumber (_x>> 'scope') isEqualTo 2" configClasses (configfile >> "CfgWeapons"))apply{configName _x};
			_Magazines_array = ("getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines"))apply{configName _x};

			_Vests_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 701 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons"))apply{configName _x};
			_Headgear_array = ("getNumber (_x >> 'itemInfo' >> 'type') isEqualTo 605 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons"))apply{configName _x};
			_Backpacks_array = ("getNumber (_x >> 'isbackpack') isEqualTo 1 && getNumber (_x>> 'scope') >1 && getNumber (_x>> 'maximumLoad') != 0" configClasses (configfile >> "CfgVehicles"))apply{configName _x};
			_Goggles_array = ("getNumber (_x >> 'scope') > 1" configClasses (configfile >> "CfgGlasses"))apply{configName _x};

			_Items_array = ("getNumber (_x >> 'type') isEqualTo 4096 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons"))apply{configName _x};
			_Attachments_array = ("getNumber (_x >> 'type') isEqualTo 131072 && getNumber (_x>> 'scope') >1" configClasses (configfile >> "CfgWeapons"))apply{configName _x};

			_Binocular_and_Nvg_array = (
				"(!(getText( _x >> 'DLC' ) == 'mcc_sandbox_a3'))
				&& getNumber ( _x >> 'scope' ) isEqualTo 2	
				&& getNumber ( _x >> 'type' ) in [ 131072, 4096 ]
				&& getNumber ( _x >> 'ItemInfo' >> 'type' ) in [ 0 , 616 ] 
				"configClasses (configfile >> "CfgWeapons")
				)apply {configName _x};



			_Uniform = selectRandom _Uniform_array;
			_Headgear = selectRandom _Headgear_array; 
			_Goggles = selectRandom _Goggles_array; 
			_Vests = selectRandom _Vests_array; 
			_Backpacks = selectRandom _Backpacks_array;
			_primaryWeapon = selectRandom _primaryWeapon_array;
			_secondaryWeapon = selectRandom _secondaryWeapon_array;
			_handgunWeapon = selectRandom _handgunWeapon_array;


			//________________ _Items	________________

			_Items = selectRandom _Items_array;
			_Attachments = selectRandom _Attachments_array;
			_Magazines = selectRandom _Magazines_array;

			
			//________________	add Gear	________________
			
			if!(typeof _this in _list)then{_this forceAddUniform _Uniform;};
			if(random 10 < 3)then{_this addVest _Vests;};
			if(random 10 < 3)then{_this addHeadgear _Headgear;};
			if(random 10 < 3)then{_this addGoggles _Goggles;};
			if(random 10 < 3)then{_this addWeapon _primaryWeapon;};
			if(random 10 < 3)then{_this addWeaponGlobal _handgunWeapon;};

			if(random 10 < 3)then{_this addBackpack _Backpacks;};
			if(!(backpack _this isEqualTo ""))then{
				if(random 10 < 3)then{_this addWeapon _secondaryWeapon};
			};
			
			//________________	addItemToUniform	________________
			
			for "_i" from 1 to 1 do{_this addItemToUniform "FirstAidKit";};


			//________________	addItemToVest	________________
			
			for "_i" from 1 to 1 do{_this addItemToVest "FirstAidKit";};
			//	for "_i" from 1 to 1 do{_this addItemToVest "HandGrenade";};
			//	for "_i" from 1 to 1 do{_this addItemToVest "MiniGrenade";};
			//	for "_i" from 1 to 1 do{_this addItemToVest "SmokeShell";};

			if(random 10 < 3)then{_this addItemToVest _Items;};
			if(random 10 < 3)then{_this addItemToVest _Attachments;};
			if(random 10 < 3)then{_this addItemToVest _Magazines;};
			
			
			for "_i" from 1 to random 6 do{
				_assignableItems = selectRandom _Binocular_and_Nvg_array;
				if(random 10 < 3)then{_this linkItem _assignableItems;};	
			};
			
			//________________	add _primaryWeapon's compatible attachments	________________

			_primaryWeapon_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
			if(count _primaryWeapon_MuzzleSlot >= 1)then{_primaryWeapon_Muzzle = selectRandom _primaryWeapon_MuzzleSlot;
			if(random 10 < 3)then{_this addPrimaryWeaponItem _primaryWeapon_Muzzle;};}; 

			_primaryWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
			if(count _primaryWeapon_CowsSlot >= 1)then{_primaryWeapon_Optic = selectRandom _primaryWeapon_CowsSlot;
			if(random 10 < 3)then{_this addPrimaryWeaponItem _primaryWeapon_Optic;};}; 

			_primaryWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
			if(count _primaryWeapon_PointerSlot >= 1)then{_primaryWeapon_Pointer = selectRandom _primaryWeapon_PointerSlot;
			if(random 10 < 3)then{_this addPrimaryWeaponItem _primaryWeapon_Pointer;};}; 

			_primaryWeapon_UnderBarrelSlot = getArray (configFile / "CfgWeapons" >> _primaryWeapon >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems");
			if(count _primaryWeapon_UnderBarrelSlot >= 1)then{_primaryWeapon_UnderBarrel = selectRandom _primaryWeapon_UnderBarrelSlot;
			if(random 10 < 3)then{_this addPrimaryWeaponItem _primaryWeapon_UnderBarrel;};}; 

			
			//________________	add _secondaryWeapon 's compatible attachments	________________

			_secondaryWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _secondaryWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
			if(count _secondaryWeapon_CowsSlot >= 1)then{_secondaryWeapon_Optic = selectRandom _secondaryWeapon_CowsSlot;
			if(random 10 < 3)then{_this addSecondaryWeaponItem _secondaryWeapon_Optic;};}; 

			_secondaryWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _secondaryWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
			if(count _secondaryWeapon_PointerSlot >= 1)then{_secondaryWeapon_Pointer = selectRandom _secondaryWeapon_PointerSlot;
			if(random 10 < 3)then{_this addSecondaryWeaponItem _secondaryWeapon_Pointer;};}; 

			
			//________________	add _handgunWeapon's compatible attachments	________________

			_handgunWeapon_MuzzleSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems");
			if(count _handgunWeapon_MuzzleSlot >= 1)then{_handgunWeapon_Muzzle = selectRandom _handgunWeapon_MuzzleSlot;
			if(random 10 < 3)then{_this addHandgunItem _handgunWeapon_Muzzle;};}; 

			_handgunWeapon_CowsSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems");
			if(count _handgunWeapon_CowsSlot >= 1)then{_handgunWeapon_Optic = selectRandom _handgunWeapon_CowsSlot;
			if(random 10 < 3)then{_this addHandgunItem _handgunWeapon_Optic;};}; 

			_handgunWeapon_PointerSlot = getArray (configFile / "CfgWeapons" >> _handgunWeapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems");
			if(count _handgunWeapon_PointerSlot >= 1)then{_handgunWeapon_Pointer = selectRandom _handgunWeapon_PointerSlot;
			if(random 10 < 3)then{_this addHandgunItem _handgunWeapon_Pointer;};}; 

			
			//________________	add _primaryWeapon's mags	________________

			_primaryWeapon_Magazines_array = getArray (configFile / "CfgWeapons" / _primaryWeapon / "magazines");
			if(count _primaryWeapon_Magazines_array > 0)then{
				private _primaryWeapon_magazines = selectRandom _primaryWeapon_Magazines_array;
				
				if!(primaryWeapon _this isEqualto "")then{
					for "_i" from 1 to 2 do{_this addItemToUniform _primaryWeapon_magazines;};
					for "_i" from 1 to 5 do{_this addItemToVest _primaryWeapon_magazines;};
				};
			};

			//________________	add _secondaryWeapon's mags	________________

			_secondaryWeapon_Magazines_array = getArray (configFile / "CfgWeapons" / _secondaryWeapon / "magazines");
			if(count _secondaryWeapon_Magazines_array > 0)then{
				private _secondaryWeapon_Magazines = selectRandom _secondaryWeapon_Magazines_array;
				
				if(!(backpack _this isEqualTo ""))then{
					if(!(secondaryWeapon _this isEqualTo ""))then{
						for "_i" from 1 to 5 do{_this addItemTobackpack _secondaryWeapon_Magazines;};
					};
				};
			};

			//________________	add _handgunWeapon's mags	________________

			_handgunWeapon_Magazines_array = getArray (configFile / "CfgWeapons" / _handgunWeapon / "magazines");
			if(count _handgunWeapon_Magazines_array > 0)then{
				private _handgunWeapon_Magazines = selectRandom _handgunWeapon_Magazines_array;
				
				if!(handgunWeapon _this isEqualto "")then{
					for "_i" from 1 to 2 do{_this addItemToUniform _handgunWeapon_Magazines;};
				};
			};

		};
	
	
		case 3 : {
		
			comment "You must change , this to _this";
			
			
			comment "Exported from Arsenal by [GR]GEORGE F";

			comment "[!] UNIT MUST BE LOCAL [!]";
			if(!local _this) exitWith {};

			comment "Remove existing items";
			removeAllWeapons _this;
			removeAllItems _this;
			removeAllAssignedItems _this;
			removeUniform _this;
			removeVest _this;
			removeBackpack _this;
			removeHeadgear _this;
			removeGoggles _this;

			comment "Add containers";
			_this forceAddUniform "U_B_HeliPilotCoveralls";
			_this addItemToUniform "FirstAidKit";
			_this addItemToUniform "HandGrenade";
			_this addItemToUniform "Chemlight_green";
			_this addItemToUniform "30Rnd_65x39_caseless_green";
			_this addVest "V_TacVestIR_blk";
			_this addItemToVest "Chemlight_green";
			for "_i" from 1 to 2 do {_this addItemToVest "30Rnd_65x39_caseless_green";};
			for "_i" from 1 to 3 do {_this addItemToVest "11Rnd_45ACP_Mag";};
			_this addHeadgear "H_Cap_blk";

			comment "Add weapons";
			_this addWeapon "arifle_Katiba_C_F";
			_this addWeapon "hgun_Pistol_heavy_01_F";
			_this addHandgunItem "optic_MRD";
			_this addWeapon "Rangefinder";

			comment "Add items";
			_this linkItem "ItemMap";
			_this linkItem "ItemCompass";
			_this linkItem "ItemWatch";
			_this linkItem "ItemRadio";

			comment "Set identity";
			[_this,"WhiteHead_09","male05eng"] call BIS_fnc_setIdentity;
		};
	};
};



[]spawn{
	while{true}do{		
		{		
		if(
		((alive _x)) 
		&& (!(_x getVariable ["Var_GF_ZS_Loadout",false])) 
		
		/*
		//________________	You can filter the side here	________________	
		&& {((side group _x) == west || 
			(side group _x) == east || 
			(side group _x) == independent || 
			(side group _x) == civilian)}
		*/
		
		//	&& (side group _x == playerSide)
		//	&& (!(side group _x == playerSide))
		
		)then{
			
			_x spawn GF_ZS_Loadout;			
			};						
			_x setVariable ["Var_GF_ZS_Loadout",true];
			{waitUntil {!alive _x};
			_x setVariable ["Var_GF_ZS_Loadout",false];		 
			};
		}forEach allUnits;
		sleep 3;
	};
};



if(GF_ZS_Systemchat_info)then{
	systemchat "GF_ZS_Loadout initialized";			
};	

if(GF_ZS_diag_log_info)then{
	diag_log "//________________	GF_ZS_Loadout initialized	________________";
};

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

21.How to add ifinitive ammo for your group units AI

 

{
if!(isplayer _x)then{	
	_x addEventHandler["Fired", {
		params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
		
		if({_x isEqualTo _magazine}count magazines _unit < 2)then{
			_unit addMagazines [_magazine, 3];
			//	systemchat "addMagazines";
		};
	}];
	};
}foreach units group player;

 

Share this post


Link to post
Share on other sites

22.How to add crows over dead bodies/animals/zombies

 

4 hours ago, EO said:

TPW was kind enough to edit a script for me that spawns a few crows over dead bodies/animals/zombies, it's pretty neat as a natural visual marker for a potential looting opportunity, it works for player kills and AI kills during the day. Feel free to tinker and/or improve etc. etc......

  Reveal hidden contents


// VARIABLES
tpw_crowonly_active = true; // global activate/deactivate
tpw_crowonly_sunrise = ([] call BIS_fnc_sunriseSunsetTime) select 0;
tpw_crowonly_sunset = ([] call BIS_fnc_sunriseSunsetTime) select 1;

// CROWS
tpw_crowonly_fnc_crows = 
	{
	private ["_closedead","_fardead","_crow","_crowflag"];
	tpw_crowonly_crows = [];
	while {true} do
		{
		if (daytime > tpw_crowonly_sunrise && {daytime < tpw_crowonly_sunset}) then 
			{
			_crowflag = true;
			} else
			{
			_crowflag = false;
			};		
		
		if (tpw_crowonly_active && _crowflag) then
			{
			_closedead = alldead select {_x distance player <200};
			_fardead = alldead select {_x distance player >200};
			
			// Add crows to nearby bodies 
				{
				if (_x getvariable ["tpw_crows",-1] == -1) then
					{
					_crows = [getposasl _x,15,ceil random 3,15] call bis_fnc_crows;
					tpw_crowonly_crows = tpw_crowonly_crows + _crows;	
					_x setvariable ["tpw_crows",1];	
					sleep random 10;
					};
				} foreach _closedead;

			// Remove crow spawning flag from distant bodies
				{
				_x setvariable ["tpw_crows",-1];			
				} foreach _fardead;	
			};	
				
		// Crow wrangling	
		for "_i" from 0 to (count tpw_crowonly_crows - 1) do 
			{
			_crow = tpw_crowonly_crows select _i;
			// Delete distant crows
			if (!(_crowflag) || _crow distance player > 200) then 
				{
				deletevehicle _crow;
				tpw_crowonly_crows set[_i,-1];
				};
			};
		tpw_crowonly_crows = tpw_crowonly_crows - [-1];	

		// Reset bodies to not spawn crows
		if (!_crowflag) then
			{
				{
				_x setvariable ["tpw_crows",-1];	
				} foreach alldead;
			};
		sleep random 30;
		};
	};	

[] spawn tpw_crowonly_fnc_crows;

while {true} do
	{
	// dummy loop so script doesn't terminate
	sleep 10;
	};

 

 

Boars...

AI...

:rthumb:

  • Like 2

Share this post


Link to post
Share on other sites
On 7/31/2019 at 11:35 PM, GEORGE FLOROS GR said:

22.How to add crows over dead bodies/animals/zombies

 

 

On 8/1/2019 at 4:41 AM, GEORGE FLOROS GR said:

this is also my approach without loops :

 


//________________ Settings ________________

GF_Crows_Limit 					= 4;	
GF_Crows_time					= 40;
GF_Crows_areaSize 				= 20;
GF_Crows_areaSize_random 		= 20;	//	+ random
GF_Crows_height 				= 20;
GF_Crows_height_random 			= 20;	//	+ random




GF_Crows_Count = 0;


GF_Crows = {
	
	if(GF_Crows_Count > GF_Crows_Limit)then{GF_Crows_Count = GF_Crows_Limit;};
	
	if(GF_Crows_Count < GF_Crows_Limit)then{
		
		GF_Crows_Count = GF_Crows_Count + 1;
			systemchat format ["%1",GF_Crows_Count];
			
		//	[position,areaSize,number,height]call BIS_fnc_crows
		_crow = [_this, GF_Crows_areaSize + random GF_Crows_areaSize_random, 1, GF_Crows_height + random GF_Crows_height_random]call BIS_fnc_crows;		
		_time = time + GF_Crows_time;
		waituntil{time > _time};
		{deleteVehicle _x;}foreach _crow;
		GF_Crows_Count = GF_Crows_Count - 1;
		if(GF_Crows_Count < 0)then{GF_Crows_Count = 0;};
			systemchat format ["%1",GF_Crows_Count];		
	};
};


addMissionEventHandler ["EntityKilled",{
	params ["_killed", "_killer", "_instigator"];
	if(isNull _instigator)then{_instigator = _killer};	// player driven vehicle road kill

	if(_killed isKindOf "CAManBase"

		/*
		//________________	You can filter the side here	________________
		
		&& {((side group _killed) == west or 
			 (side group _killed) == east or 
			 (side group _killed) == independent or 
			 (side group _killed) == civilian)}
			
		*/
	)then{

	_killed spawn GF_Crows;
	};
}];

 

if(_killed isKindOf "CAManBase"

 

# This is in order to exclude the script working for animals ! this can be removed !

  • Like 1

Share this post


Link to post
Share on other sites
On 8/1/2019 at 4:48 AM, GEORGE FLOROS GR said:

if(_killed isKindOf "CAManBase"

 

# This is in order to exclude the script working for animals ! this can be removed !

Share this post


Link to post
Share on other sites

23. How to set a Zed face to a unit

 

On 8/29/2019 at 12:14 AM, GEORGE FLOROS GR said:
On 8/28/2019 at 10:52 PM, EO said:

setFace command and add a zed face to an armed unit...

  Reveal hidden contents

Mrjk7V7.jpg

Add this to the init of a unit...



comment "Set identity"; 
this spawn {sleep 1; _this setFace "rvg_zed_face_2"};
this setSpeaker ""; 
this setVariable ["BIS_enableRandomization", false] 

 

 

On 8/28/2019 at 11:10 PM, EO said:

There is also the option of the Renegade faces, those guys are pretty evil looking too. ^^

Here are the full set of classnames for Ravage Zeds and Renegades...

  Reveal hidden contents
  • Like 1

Share this post


Link to post
Share on other sites

24. Template mission that will spawn haleks Ghosts

818B2E2804B686F47CD75AC8F70A5C767D238585

48 minutes ago, EO said:

@Stalk1st aka NaUdachu Okay here is a template mission that will spawn haleks awesome Ghostshttps://www.dropbox.com/sh/v6fl4blsc9f04yc/AAD7VfzqZBnOIbIdzqEwlDaKa?dl=0

 

If you want to port it to another map you will need to do the following:

Open the template mission in the Editor, copy/paste the Ambient Zombie module and the z-source object (in the template mission it's an invisible helipad named z_source) and drop them into a map of your choice, then save your new mission.

You then need to move the scripts from the template mission over to your newly saved mission, (init.sqf, myst_z.sqf, spalsh_hit.sqf)  These scripts basically turn the Ambient Zombie module into a Ghost spawner.

Now you can edit the Ambient Zombie Ghost module to suit your own play style then your free to build a mission around the framework you've just created. :icon_biggrin:

  • Like 1

Share this post


Link to post
Share on other sites

25. How to make reserved slots

 

On 9/9/2019 at 1:09 AM, GEORGE FLOROS GR said:

below the whole stuff :

 

 

Quote

nsM81aJ.png

 

info.txt

  Reveal hidden contents







//________________  Author : Larrow ___________ Posted June 23, 2015 _____________

/*
________________ Larrow_Reserved_Slot Script ________________

https://forums.bohemia.net/forums/topic/182520-script-to-lock-out-player-slots/?tab=comments#comment-2879996
*/


Then in each units init that you want to be a reserved unit place


this setVariable ["Reserved",true];


You can also change their description by filling out the Description section in the insert unit dialog with something like

Group leader (Reserved)

So people know what units not to choose in the lobby.

 

allowedIDs.txt

  Reveal hidden contents





//________________  Author : Larrow ___________ Posted June 23, 2015 _____________

/*
________________ Larrow_Reserved_Slot Script ________________

https://forums.bohemia.net/forums/topic/182520-script-to-lock-out-player-slots/?tab=comments#comment-2879996
*/


/*
allowedIDs.txt 
<< this file gets placed in the folder where your servers Arma3.exe is, 
it keeps the IDs private as they are not transmitted with the mission and 
can be updated for all your missions in one place.

server.cfg file on the server too.
allowedFilePatching = 1;


Fill the ARRAY with allowed UIDs - steam IDs
Look something like "76566179256348507"
*/

["76566179256348507","76566179256348507"];

 

 

description.ext

  Reveal hidden contents





//________________  Author : Larrow ___________ Posted June 23, 2015 _____________

/*
________________ Larrow_Reserved_Slot Script ________________

https://forums.bohemia.net/forums/topic/182520-script-to-lock-out-player-slots/?tab=comments#comment-2879996
*/

allowedFilePatching = 1;
respawn = 3;				  // 0 = none. 1 = bird. 2 = instant where died. 3 = base or respawn_INDEPENDENT marker. 4 = respawn with team, or bird. 5 = into AI or bird.
respawndelay = 10;            // Delay prior to respawn
respawnVehicleDelay = 0;      // Delay prior to respawn
respawnDialog = 0;            // default = 1. show respawn timer and scoreboard when killed.
respawnOnStart = -1;
enableDebugConsole = 1;	      // 0 = disabled. 1 = admins, 2 = everybody. 0 is recommended in MP.
allowFunctionsLog = 1;
disabledAI=1;				  // No AI in playable units
aiKills = 0;				  // disable scorelist for AI players
forceRotorLibSimulation = 0;  // Default value: 0 - options based; 1 - force enable; 2 - force disable

//____________________________________________________

corpseManagerMode = 1;
corpseLimit = 60;
corpseRemovalMinTime = 900;
corpseRemovalMaxTime = 1500;

wreckManagerMode = 1;
wreckLimit = 30;
wreckRemovalMinTime = 900;
wreckRemovalMaxTime = 1500;

//____________________________________________________

author = "Larrow";
OnLoadName = "Larrow Reserved Slot Script";	
onLoadMission = "<t color='#FF0000'>V e r s i o n    1 . 0<br /><t color='#FCEF06'>Have Fun";
loadScreen =  "images\Reserved.paa";
overviewPicture = "images\Reserved.paa";

//____________________________________________________

class Header
{
 gameType = COOP;
 minPlayers = 1;
 maxPlayers = 40;
};


//__________________________ ***  C O P Y   T H I S  *** __________________________


class CfgDebriefing
{

class NOT_ALLOWED
{
	title = "This is a reserved slot.";
	description = "This is a reserved slot. Please rejoin using a different slot. Reserved slots are clearly marked on each units description in the lobby as ( Reserved )";
	picture = "images\Reserved.paa";
};
};

 

 

initPlayerLocal.sqf

  Reveal hidden contents





//________________  Author : Larrow ___________ Posted June 23, 2015 _____________

/*
________________ Larrow_Reserved_Slot Script ________________

https://forums.bohemia.net/forums/topic/182520-script-to-lock-out-player-slots/?tab=comments#comment-2879996
*/


fnc_reservedSlot = {
player enableSimulationGlobal false;
( "reserved" call BIS_fnc_rscLayer ) cutText [ 
"
This is a reserved slot. Reserved slots are clearly marked in the lobby as ( Reserved ) . 
Please rejoin using a different slot.
", "BLACK OUT", 1, true ];

sleep 10;
endMission "NOT_ALLOWED";
};

 

 

initPlayerServer.sqf

  Reveal hidden contents







//________________  Author : Larrow ___________ Posted June 23, 2015 _____________

/*
________________ Larrow_Reserved_Slot Script ________________

https://forums.bohemia.net/forums/topic/182520-script-to-lock-out-player-slots/?tab=comments#comment-2879996
*/


_player = _this select 0;
_uid = getPlayerUID _player;

if ( _player getVariable [ "reserved", false ] && { !( _uid in allowed ) } ) then {
[ [], "fnc_reservedSlot", _player ] call BIS_fnc_MP;
};

 

 

initServer.sqf

  Reveal hidden contents





//________________  Author : Larrow ___________ Posted June 23, 2015 _____________

/*
________________ Larrow_Reserved_Slot Script ________________

https://forums.bohemia.net/forums/topic/182520-script-to-lock-out-player-slots/?tab=comments#comment-2879996
*/

/*
allowedIDs.txt 
<< this file gets placed in the folder where your servers Arma3.exe is, 
it keeps the IDs private as they are not transmitted with the mission and 
can be updated for all your missions in one place.

server.cfg file on the server too.
allowedFilePatching = 1;
*/

//allowed = call compile preprocessFileLineNumbers "allowedIDs.txt";

//	or from here
allowed = ["76566179256348507","76566179256348507"];

 

 

 

Share this post


Link to post
Share on other sites

26. How to make a Hostage , Join-Disband / Release-Tie addaction

 

ex from my GF_Missions script :

5 minutes ago, GEORGE FLOROS GR said:
  Reveal hidden contents


//________________	GF_Missions_addaction_Join_Disband_Hostage	________________

GF_Missions_addaction_Join_Disband_Hostage = {
[_this, 
[
    "<t size=""1.2"" font=""RobotoCondensedBold"" color=""#FF9933"">" + "Hostage Join Group", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];		
		private _target = _this select 0;
		private _caller = _this select 1;
		private _actionId = _this select 2;
		[_target] joinSilent _caller;	
		_target setCaptive false;
		_target enableAI 'MOVE';
		[_target, _actionid] remoteExec ["removeAction"];
		
		[_target,[
    "<t size=""1.2"" font=""RobotoCondensedBold"" color=""#FF9933"">" + "Disband Hostage", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];		
		private _target = _this select 0;
		private _caller = _this select 1;
		private _actionId = _this select 2;
		_Group = createGroup civilian;
		[_target]  joinSilent _Group; 
		_target setCaptive false;
		_target removeAction _actionId;
		_target spawn GF_Missions_addaction_Join_Disband_Hostage;
    },
    [],1.5,true,true,"","true",8,false,"", ""
]] remoteExec ["addAction"];
    },[], 1.5,true,true,"","true",8,false,"",""
]] remoteExec ["addAction"];
};
publicVariable "GF_Missions_addaction_Join_Disband_Hostage";


//________________	GF_Missions_addaction_Release_Tie_Hostage	________________

GF_Missions_addaction_Release_Tie_Hostage = {
[_this, 
[
    "<t size=""1.2"" font=""RobotoCondensedBold"" color=""#FF9933"">" + "Release Hostage", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];		
		private _target = _this select 0;
		private _caller = _this select 1;
		private _actionId = _this select 2;
		[[_target,'Acts_ExecutionVictim_Unbow'] remoteExec ['switchMove']];
		_target enableAI 'anim';		
		[_target, _actionid] remoteExec ["removeAction"];
		
		[_target,[
    "<t size=""1.2"" font=""RobotoCondensedBold"" color=""#FF9933"">" + "Tie Hostage", 
    {
        params ["_target", "_caller", "_actionId", "_arguments"];		
		private _target = _this select 0;
		private _caller = _this select 1;
		private _actionId = _this select 2;
		[[_target,'Acts_ExecutionVictim_Loop'] remoteExec ['switchMove']];
		_target disableAI 'anim';	
		_target removeAction _actionId;
		_target spawn GF_Missions_addaction_Release_Tie_Hostage;
    },
    [],1.5,true,true,"","true",8,false,"", ""
]] remoteExec ["addAction"];
    },[], 1.5,true,true,"","true",8,false,"",""
]] remoteExec ["addAction"];
};
publicVariable "GF_Missions_addaction_Release_Tie_Hostage";

 

  Reveal hidden contents


//________________ Spawn the Hostage	________________

_Hostage = createGroup civilian;
GF_Missions_Hostage_11 = _Hostage createUnit ["C_journalist_F", _Pos_1, [], 0, "CAN_COLLIDE"];

//________________	addaction	________________

GF_Missions_Hostage_11 setskill 1;
GF_Missions_Hostage_11 setdamage 0.5;
GF_Missions_Hostage_11 disableai "MOVE";

removeAllWeapons GF_Missions_Hostage_11;
removeAllItems GF_Missions_Hostage_11;
removeAllAssignedItems GF_Missions_Hostage_11;
removeUniform GF_Missions_Hostage_11;
removeVest GF_Missions_Hostage_11;
removeBackpack GF_Missions_Hostage_11;
removeHeadgear GF_Missions_Hostage_11;
removeGoggles GF_Missions_Hostage_11;

GF_Missions_Hostage_11 forceAddUniform "U_C_WorkerCoveralls";
[GF_Missions_Hostage_11,[0,"GF_Missions\images\GF_Uniform_Prisoner.paa"]] remoteExec ["setObjectTexture",0,true];
GF_Missions_Hostage_11 setcaptive true;
[[GF_Missions_Hostage_11,"Acts_ExecutionVictim_Loop"] remoteExec ["switchMove"]];
GF_Missions_Hostage_11 disableAI "anim";


 
//________________	GF_Missions_addaction_Join_Disband_Hostage	________________

GF_Missions_Hostage_11 spawn GF_Missions_addaction_Join_Disband_Hostage;

//________________	GF_Missions_addaction_Release_Tie_Hostage	________________

GF_Missions_Hostage_11 spawn GF_Missions_addaction_Release_Tie_Hostage;

 

 

Share this post


Link to post
Share on other sites

×