Jump to content

Recommended Posts

Scripting General & Library

 

Information :

Feel free to share and discuss , about Ravage Scripting and Scripting general.

 

# Follow the same form , as the first Post please .

 

 

A list with the certain page , will be here available.

 

_____________________________________________________________________________________

I also suggest to follow , the BIS Forum Members below ,

who really help and share their work and knowledge :

# the list is off course on random.

 

https://forums.bohemia.net/profile/900806-pierremgi/

https://forums.bohemia.net/profile/770615-larrow/

https://forums.bohemia.net/profile/832107-grumpy-old-man/

https://forums.bohemia.net/profile/773718-hazj/

https://forums.bohemia.net/profile/842941-davidoss/

https://forums.bohemia.net/profile/906542-schatten/

https://forums.bohemia.net/profile/759255-mrcurry/

https://forums.bohemia.net/profile/792430-dedmen/

https://forums.bohemia.net/profile/1145462-mr-h/

https://forums.bohemia.net/profile/801328-fn_quiksilver/

https://forums.bohemia.net/profile/745971-johnnyboy/

https://forums.bohemia.net/profile/754658-beno_83au/

https://forums.bohemia.net/profile/771259-sarogahtyp/

 

 

I thank personally and public , this members , for everything so far.

_____________________________________________________________________________________

 

 

______________________________        List :        ______________________________

 

1. Custom zombie spawner script, that works alo in USS Liberty or USS Freedom                

2. How to add a Custom texture respawnable uniform on players or units                       

3. Ravage Zed Detector                                                                                                           

4. How to create a trigger that counts the number of zombies in its radius and spawns a new horde if there are too few                                                                                                          

5.How to keep Zeds within a 10-20 meters radius                                                            

6.How to disable the access of an item                                                                                        

7.How to make a certain unit/s to handle more damage                                                             

8.How to add message on player death                                                                                        

9.How to create a Mod Check                                                                                        

10. How to make Ravage zombies drop items when killed                                                          

11. Object Spawner Script

12. How to destroy a certain area

13. Check if player kills members of his own side, CIVS or certain animals and make him a renegade for that

14.How how to suicide bomber zombies , in editor                                                    

15. How to script a safe zone marker that deletes any unit (besides player) entering it

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

17. How to create a moving rad zone

18. (Ravage) huntable animal spawner

19. How to create a restriction for the pickable items

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

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

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

23. How to set a Zed face to a unit

24. Template mission that will spawn haleks Ghosts

25. How to make reserved slots

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

27. How to make a simple teamkiller

28. How to make a Simple weapon jam, with or without overheat

29. How to Eject from air vehicles

Edited by GEORGE FLOROS GR

Share this post


Link to post
Share on other sites

Question:

"How can i create a custom zombie spawner script, that works on places like the USS Liberty or USS Freedom"

 

Solution (by George Floros):

 

Spoiler




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

/*
________________ GF_Unit_Spawner Script - Mod ________________

//	Not yet realesed

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/

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 Script - Mods , you can search in:
https://forums.bohemia.net/forums/topic/215850-compilation-list-of-my-gf-Script - Mods/
*/


//________________	to use	________________
/*
place an object at the editor 
i suggest UserTexture1m_F
add a name ex : spawner_1
so by copy pasting ,it will change to spawner_2
*/




//________________	GF_Unit_Spawner options	________________

GF_Unit_Spawner_Systemchat_info				= true;		
GF_Unit_Spawner_diag_log_info				= true;

GF_Unit_Spawner_Squad_Members 				= 5;
GF_Unit_Spawner_Squad_Members_random 		= 5;	// + random
GF_Unit_Spawner_Enemy_Side 					= east;	// the side
GF_Unit_Spawner_set_AiSkill					= 0.75;
GF_Unit_Spawner_set_AiSkill_random			= 0.25;


GF_Unit_Spawner_Enemy_Pool = [			//	Enemy Units classnames
	
	//	Ravage zombies
	
	"zombie_bolter",		
	"zombie_runner",
	"zombie_walker"
	];


	
if (GF_Unit_Spawner_Systemchat_info) then {
systemchat "GF Unit Spawner Script initializing";			
};	


if (GF_Unit_Spawner_diag_log_info) then {
diag_log "//________________ GF_Unit_Spawner_Script.sqf ________________";
diag_log "//________________ GF Unit Spawner Script initializing ________________";
};



	
GF_Unit_Spawner_allPlayers = allUnits select {isPlayer _x && {!(_x isKindOf "HeadlessClient_F")}};
	
	
//________________	GF_Unit_Spawner_Stalk	________________

GF_Unit_Spawner_Stalk = {


_object = _this select 0;
	
_Pos = getPosATL _object;
_Group = createGroup GF_Unit_Spawner_Enemy_Side;

for "_x" from 0 to (GF_Unit_Spawner_Squad_Members + floor random GF_Unit_Spawner_Squad_Members_random) do {

_unit = _Group createunit [selectrandom GF_Unit_Spawner_Enemy_Pool,_Pos,[],0,"None"];
[_unit] JoinSilent _Group;
(leader _Group) setSkill GF_Unit_Spawner_set_AiSkill + floor random GF_Unit_Spawner_set_AiSkill_random;

_unit setVariable ["Var_GF_Unit_Spawner_Spawn",true];
};
	
_stalked = selectrandom GF_Unit_Spawner_allPlayers;
[_Group,group _stalked] spawn BIS_fnc_stalk;
};


if (GF_Unit_Spawner_Systemchat_info) then {
systemchat "GF Unit Spawner Script initialized";			
};	

if (GF_Unit_Spawner_diag_log_info) then {
diag_log "//________________ GF Unit Spawner Script initialized ________________";
};


//________________	add below the spawners	________________

[spawner_1] spawn GF_Unit_Spawner_Stalk;
[spawner_2] spawn GF_Unit_Spawner_Stalk;
[spawner_3] spawn GF_Unit_Spawner_Stalk;	

 

 

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

2. How to add a Custom texture respawnable uniform on players or units   

 

For Player :

 

initPlayerlocal.sqf

[] execVM "GF_Custom_Uniform\GF_Custom_Uniform_init.sqf";

create a folder ex :

GF_Custom_Uniform

 

inside the GF_Custom_Uniform:

GF_Custom_Uniform_init.sqf

[] execVM "GF_Custom_Uniform\GF_Uniform_Prisoner\GF_Uniform_Prisoner.sqf";
//	or	#include "GF_Uniform_Prisoner\GF_Uniform_Prisoner.sqf";

create a folder ex :

GF_Uniform_Prisoner

 

inside the  GF_Uniform_Prisoner:

GF_Uniform_Prisoner.sqf

GF_Uniform_Prisoner = {

_Unit = _this select 0;

removeUniform _Unit;
_Unit forceAddUniform "U_C_WorkerCoveralls";
[_Unit,[0,"GF_Custom_Uniform\GF_Uniform_Prisoner\GF_Uniform_Prisoner.paa"]] remoteExec ["setObjectTexture",0,true];


_Unit addEventHandler ["Respawn", {
	params ["_Unit", "_corpse"];
	removeUniform _Unit;
	_Unit forceAddUniform "U_C_WorkerCoveralls";
	[_Unit,[0,"GF_Custom_Uniform\GF_Uniform_Prisoner\GF_Uniform_Prisoner.paa"]] remoteExec ["setObjectTexture",0,true];
}];
};

[player] spawn GF_Uniform_Prisoner;

 

GF_Uniform_Prisoner.paa or .jpg

-.paa is always prefered.

 

 

and here is my example custom made prisoner uniform :

 

eALg56h.jpg

 

Pics here :

 

4aYg4RS.png

Kt1ugMG.png

KQBVceG.png

dIw1v7B.png

 

Download also available here :

 

GF_Custom_Uniform_Script.zip

Expires in: 4 Weeks   |   Size: 2.3 MB   |

 

Thanks !

Share this post


Link to post
Share on other sites

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

Spoiler

//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) 

 

  • Like 2

Share this post


Link to post
Share on other sites

4. How to create a trigger that counts the number of zombies in its radius and spawns a new horde if there are too few 

 

On 2/14/2019 at 5:02 PM, haleks said:
On 2/14/2019 at 4:08 PM, ernave said:

 

Is it possible to have a trigger that counts the number of zombies in its radius and spawns a new horde if there are too few?

 

Where I'm going with this is, I've been putting hordes in cities. It's a great effect, but eventually they get depleted, particularly if an AI vehicle patrol comes by.

 

I haven't looked, but I bet the module is already calling a function, so I could have a trigger that does the same thing. What I'm unsure about is counting the existing ones.

 

Thanks.

 

 

I'll see what I can do for another update, meanwhile yes, you can do this with a repeatable trigger :

 


condition check (set it to "any player, present" with a short timer) :
this && (({_x inArea thisTrigger} count (entities [["zombie"], [], false, true])) < 5)

onActivation :
[_pos, _type, _fastNum, _hordeSize, _hordeRadius, _triggerRadius, _hordeBehaviour, _z_uniforms] spawn rvg_fnc_horde_spawn;

Params :
_pos = spawn pos, you can use "position thistrigger"
_hordeType = possible values are "Runners", "Walkers" and "Both"
_crawlersFactor = percentage of bolter zombies
_hordeSize = number of zeds
_hordeRadius = how far zeds spawn from _pos
_triggerRadius = player distance check before zed spawns
_hordeBehaviour = True or False. If true, spawns a group of zombie units instead of agents. False is recommended
_uniforms = Array of uniforms for this horde, or empty string

Share this post


Link to post
Share on other sites

also :

 

13 minutes ago, EO said:
5 hours ago, ernave said:

  I usually also add a zombie safe zone (so the AI aren't constantly shooting zombies near their base). Is there a way to add the safe zone within trigger code rather than putting down the safe zone system?

 

You can create a zedBlacklist zone via a trigger...

  Reveal hidden contents

GT5FM2z.jpg

:rthumb:

Share this post


Link to post
Share on other sites

5.How to keep Zeds within a 10-20 meters radius

 

On 2/17/2019 at 5:03 PM, haleks said:

put this in its init field :


this spawn {
	_uStayThere = getpos _this;
	while {alive _this} do {
		sleep 1;
		if (_this distance _uStayThere > 15 && isNil {_this getVariable "_zTarget"}) then {
			_this doMove _uStayThere;
			_this forceSpeed 2;
		};
	};
};

 

On 2/17/2019 at 7:57 PM, EO said:

Holy smokes man, that works perfectly and really adds the finishing touch to a mission idea I've toyed with for a wee while now. :f: 

 

Edit, here's the code in action...

 

 

  • Like 1

Share this post


Link to post
Share on other sites

6.How to disable the access of an item :

 

7 minutes ago, 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!"};
}];

Share this post


Link to post
Share on other sites

7.How to make a certain unit/s to handle more damage :

 

On 1/7/2019 at 2:21 AM, GEORGE FLOROS GR said:

an eventhandler for damage :


GF_HandleDamage_List = [
	"B_RangeMaster_F"	// test		
];


GF_HandleDamage = {

_this addEventHandler ["HandleDamage", {
	params ["_unit", "_selection", "_damage","_source","","_index"];
		
	if ( _index > -1 ) then {
		private _selectionDamage = _unit getHit _selection;
		private _damageRecieved = (_damage - _selectionDamage) max 0;
		_damageRecieved = _damageRecieved / 10;	// test	change this	
		_damage = _damageRecieved + _selectionDamage;
	};	
_damage	
}];
};


[] spawn {
	while {true} do {	
		{	
		if (
			(!(_x getVariable ["Var_GF_HandleDamage",false])) 
			&& (typeOf _x in GF_HandleDamage_List)
														
			) then {		
			_x call GF_HandleDamage;
			};				
				
			{waitUntil ((damage _x == 1));
			_x setVariable ["Var_GF_HandleDamage",false]; 
			};			
			
		}forEach allunits;	
		sleep 3;	// test		
	};
};

 

Share this post


Link to post
Share on other sites

8.How to add message on player death :

 

On 2/22/2019 at 10:07 PM, GEORGE FLOROS GR said:

In order to do this you need to add in your mission an

onPlayerKilled.sqf

and inside you can add your code , for example :

 


//A3\Missions_F_EPA\data\sounds\combat_deafness
playSound"combat_deafness";

[] spawn 
{		
		"dynamicBlur" ppEffectEnable true;   
		"dynamicBlur" ppEffectAdjust [20];   
		"dynamicBlur" ppEffectCommit 0;     
		"dynamicBlur" ppEffectAdjust [0.0];  
		"dynamicBlur" ppEffectCommit 12;  		
};	

sleep 3.5;
cutText ["","BLACK FADED",2];

titleText ["<t color='#ff0000' size='6'>You are Dead!</t>", "PLAIN", -1, true, true];

 

also take a look here if you want :

 

 

Share this post


Link to post
Share on other sites

9.How to create a Mod Check :

 

On 2/22/2019 at 12:23 AM, GEORGE FLOROS GR said:

in the initPlayerlocal.sqf


//	GF_Mod_Check

waitUntil {!isNull (findDisplay 46)};
waitUntil {!dialog};


GF_Mod_Check ={
 params ["_Mod"];
 isClass (configfile >> "CfgPatches" >> _Mod)
};


if("task_force_radio" call GF_Mod_Check) then {
	hintC  "Task_force_radio Mod is Enabled";	
} else {
	hintC  "Task_force_radio Mod is not Enabled ! Exiting mission";
	sleep 5;
	["",false, 2]call BIS_fnc_endMission;
};

if("cba_main" call GF_Mod_Check) then {
	hintC  "cba_main Mod is Enabled";	
} else {
	hintC  "cba_main Mod is not Enabled ! Exiting mission";
	sleep 5;
	["",false, 2]call BIS_fnc_endMission;
};

 

 

On 2/22/2019 at 6:03 PM, GEORGE FLOROS GR said:

It is possible also to add , if the mods are not loaded in the code above , instead of exiting the mission :


#include"Load the mods";	//	any word or anything

to crash the game.

Share this post


Link to post
Share on other sites

10. How to make Ravage zombies drop items when killed:

I used GF Drop Loot script as a base ,  heavily edited it & removed gear , weapons , grenades and attachments drops from it , since I wanted zeds to drop only basic items (i.e Ravage mod items).
I've put this code in to the Killed EH , inside the Ravage Ambient Zombies module (screenshot attached) placed in my mission:

Spoiler



_Systemchat_Debug_Enabled						= false;			
_12_Drop_Items							= true;         

_unit = _this select 0;
			
_Ravage_items = selectRandom [		
			
			"rvg_plasticBottleEmpty",
			"rvg_canteenEmpty",
			"rvg_hose",
			"rvg_sleepingBag_Blue", 
			"rvg_foldedTent",
			"rvg_rustyCan",
			"rvg_Geiger",
			"rvg_canisterFuel_Empty",
			"rvg_toolkit",
			"rvg_tire",
			
			"rvg_money", 
			"rvg_notepad", 
			"rvg_docFolder",
			"rvg_canOpener",
			"rvg_guttingKnife", 
			"rvg_matches",
			"rvg_plasticBottle",
			"rvg_plasticBottlePurified", 
			"rvg_spirit", 
			"rvg_franta",
			"rvg_beans", 
			"rvg_bacon", 
			"rvg_milk", 
			"rvg_rice",
			"rvg_antiRad",
			"rvg_purificationTablets",						
			
			"rvg_money", 
			"rvg_notepad", 
			"rvg_docFolder",
			"rvg_canOpener",
			"rvg_guttingKnife", 
			"rvg_matches",
			"rvg_plasticBottle",
			"rvg_plasticBottlePurified", 
			"rvg_spirit", 
			"rvg_franta",
			"rvg_beans", 
			"rvg_bacon", 
			"rvg_milk", 
			"rvg_rice",
			"rvg_antiRad",
			"rvg_purificationTablets",
			
			
			"Mask_M40_OD",
			"Mask_M40",
			"Mask_M50"
			];
			
_addItemCargoGlobal_Array_1 = selectRandom [	

	_Ravage_items
];	


if (_12_Drop_Items) then {	

if (_Systemchat_Debug_Enabled) then {

};
	
						
_Drop_Items_Amount =   1;
_Drop_Items = "WeaponHolderSimulated" createVehicle (getpos _unit); 

_Drop_Items addItemCargoGlobal [_addItemCargoGlobal_Array_1, _Drop_Items_Amount];
			
};	


 

Yes I know you can make it better , delete irrelevant stuff, but it was made as a quick solution and a pilot zombies loot drop script. Just wanted to try the basic way and use Killed EH without calling for script from init. I tried to make it work this way, cause the original way was not working for me on Exilemod integrated live server.
 
Additional things I would love to add/see:
- Make it so not every zombie drops loot , only x% of the time.
- Make specific items have higher chance of drop then the others.
- Find a way of making the items appear under the body or as inventory of the dead zed (vanilla way) and not as a dropped item (sometimes feets away from the body).
 
All credits to @GEORGE FLOROS GR for his easy to understand script.

 

j9x6pi.jpg
 

  • Thanks 1

Share this post


Link to post
Share on other sites
6 hours ago, chernaruski said:

Additional things I would love to add/see:
- Make it so not every zombie drops loot , only x% of the time.
- Make specific items have higher chance of drop then the others.
- Find a way of making the items appear under the body or as inventory of the dead zed (vanilla way) and not as a dropped item (sometimes feets away from the body).

 

Hello there chernaruski !

 

Thanks for sharing this code !

 

 

6 hours ago, chernaruski said:

- Make it so not every zombie drops loot , only x% of the time.

 

First you can add a possibility chance by adding in your code :

//________________    add _possibility    ________________

_possibility            = random 10 < 3;

if (_possibility) then {
	<code>
	};

 

6 hours ago, chernaruski said:

- Make specific items have higher chance of drop then the others.

 

 

Use the code above with multiple arrays with the certain possibility chance .

 

 

6 hours ago, chernaruski said:

- Find a way of making the items appear under the body or as inventory of the dead zed (vanilla way) and not as a dropped item (sometimes feets away from the body).

 

It is possible to do this , but i didn't do that because , as i checked , the most of the times you can't see the dropped item , but you can also instead add the code from the script to add in the inventory of the unit , the items ( uniform - vest - bags )

I don't remember to be honest if it's working this with ravage zombies though.

It probably will.

# in case you check it , please confirm this !

 

Thanks !

Share this post


Link to post
Share on other sites

Code optimization:

 

Fellow scripters,

 

If you are like me and have no coding background, then you might to end up with a project that you have been putting together for months maybe years. Learning to code in the process. 

 

It is time to review your old code! 

 

https://community.bistudio.com/wiki/Code_Optimisation

 

I read through the article and already noticed quite a lot of things that I did wrong or could be optimized in my VA mod, maybe this will help you too. 

 

If you are not as messy as I am, you might have familiarized yourself with above prior to releasing a mod - good for you:)! 

 

Cheers

Vd

 

  • Like 2

Share this post


Link to post
Share on other sites

11.Object Spawner Script

 

49 minutes ago, GEORGE FLOROS GR said:

WIP GF Object Spawner Script - Mod

  Hide contents





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


/*
________________ GF Object 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/
*/


//________________ Settings _____________
//________________ Set true or false  _____________

GF_Object_Spawner_Debug_Markers				= true;
GF_Object_Spawner_Systemchat_info			= true;		
GF_Object_Spawner_diag_log_info				= true;

GF_Object_Spawner_Number					= 100;		//	Number of spawned objects
GF_Object_Spawner_Minimum_Distance			= 1000;		//	Minimum Distance from the center , this can be changed to maximum by changing < (of the Map , _centerPosition)
GF_Object_Spawner_DynamicSimulationSystem	= true;		//	enableDynamicSimulationSystem




if (GF_Object_Spawner_Systemchat_info) then {
systemchat "GF Object Spawner Script initializing - Mod";			
};	

if (GF_Object_Spawner_diag_log_info) then {
diag_log "//________________	GF Object Spawner Script - Mod initializing	________________";
};



	
if(GF_Object_Spawner_DynamicSimulationSystem) then {
enableDynamicSimulationSystem true;
};	


_centerPosition = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");

_a = 0;
while {_a < GF_Object_Spawner_Number} do {

	_pos = [] call BIS_fnc_randomPos;
	
	_array = [
	"Land_Wreck_Commanche_F","Land_Wreck_Offroad_F","Land_UWreck_Heli_Attack_02_F","Land_UWreck_Mv22_F","Land_Wreck_BMP2_F",
	"Land_Wreck_Car_F","Land_Wreck_Car2_F","Land_Wreck_Car3_F","Land_Wreck_CarDismantled_F","Land_Wreck_Heli_Attack_01_F",
	"Land_Wreck_Heli_Attack_02_F","Land_Wreck_HMMWV_F","Land_Wreck_Hunter_F","Land_Wreck_Offroad2_F",
	"Land_Wreck_Plane_Transport_01_F","Land_Wreck_Skodovka_F","Land_Wreck_Slammer_F","Land_Wreck_Slammer_hull_F",
	"Land_Wreck_Slammer_turret_F","Land_Wreck_Slammer_turret_F","Land_Wreck_T72_turret_F","Land_Wreck_Truck_dropside_F",
	"Land_Wreck_Truck_F","Land_Wreck_UAZ_F","Land_Wreck_Ural_F","Land_Wreck_Van_F",
	"Plane_Fighter_01_wreck_F","Plane_Fighter_02_wreck_F","Plane_Fighter_04_wreck_F"
	];
	
	if (_pos distance _centerPosition > GF_Object_Spawner_Minimum_Distance) then {	//	this can be changed to maximum by changing <
		
		_a = _a + 1;
		
		_createVehicle = createVehicle [selectrandom _array, _pos, [], 0, "CAN_COLLIDE"];
		_createVehicle setDir random 360;
		_createVehicle setfuel random 1;
		_createVehicle setDamage random 1;
		//_createVehicle enableSimulationGlobal true;
		
		if(GF_Object_Spawner_DynamicSimulationSystem) then {
		_createVehicle enableDynamicSimulation true;
		};
		
		_format = format ["%1",_pos];
		_createVehicle setVehicleVarName _format;
		
		
		if(GF_Object_Spawner_Debug_Markers) then {
		
		_Marker_pos = format ["%1",_pos];
		_Marker = createMarker [_Marker_pos,_pos];		
		_Marker setMarkerShape "ICON"; 
		_Marker setMarkerType "mil_marker"; 
		_Marker setMarkerColor "ColorOrange"; 
		_Marker setMarkerText format ["object : %1",_a];	
		_Marker setMarkerSize [1,1]; 	
		};
		

		if (GF_Object_Spawner_Systemchat_info) then {
		systemchat format ["objects : %1",_a];				
		};	
		
		if (GF_Object_Spawner_diag_log_info) then {
		diag_log format ["objects : %1",_a];		
		};
	
	};
	
};


if (GF_Object_Spawner_Systemchat_info) then {
systemchat "GF Object Spawner Script - Mod initialized";			
};	

if (GF_Object_Spawner_diag_log_info) then {
diag_log "//________________	GF Object Spawner Script - Mod initialized	________________";
};

 

Share this post


Link to post
Share on other sites

12. How to destroy a certain area

 

for effects set :

_x setDamage [1, true];

 

24 minutes ago, GEORGE FLOROS GR said:

this is damage without effects :


_nearestobjects = nearestobjects [this,[],3370];{_x setDamage [1, false];} foreach _nearestobjects;

 

Check also this :


// Set here the Destructive radius
_radius = 1000;

_nearObjects = (getPos player) nearObjects ["Static",_radius];	
{_x setDamage [1, false];} forEach _nearObjects;
  • Like 1

Share this post


Link to post
Share on other sites

Hi folks,

 

Maybe someone here knows this.. 

 

I m looking for an android editor on mobile phone where arma. Sqf syntax highlighting can be imported, any ideas? 

 

I am currently using droideditor, but i does not support .Sqf. 

 

Cheers

Vd

 

  • Like 1

Share this post


Link to post
Share on other sites

13. Check if player kills members of his own side, CIVS or certain animals and make him a renegade for that:

 

This is based off a solution that Grumpy Old Man posted here in BIS forums.  I altered it for my purposes which are to punish the player for killing each of the three entity groups and regarding the animals I tested it with the warefarethai mod cows. 

 

The code goes into init.sqf:

 

Spoiler

addMissionEventHandler ["EntityKilled",{

        params ["_killed", "_killer", "_instigator"];

        if (typeOf _killed isKindOf "CAManBase" AND _killer isequalTo player AND side group _killed isequalTo civilian) exitWith {"MURDERER!!!" HintC ["You have killed an unarmed and peaceful human!"]; player addRating -10000;};


}];

addMissionEventHandler ["EntityKilled",{

        params ["_killed", "_killer", "_instigator"];

        if (typeOf _killed isKindOf "CAManBase" AND _killer isequalTo player AND side group _killed isequalTo independent) exitWith {"TRIGGERHAPPY KILLER!!!" HintC ["You have killed a non-hostile Survivor!"]; player addRating -10000;};


}];

addMissionEventHandler ["EntityKilled",{

        params ["_killed", "_killer", "_instigator"];

        if (typeOf _killed isKindOf "COREV_Animal_Cow" AND _killer isequalTo player) exitWith {"ANIMAL KILLER!!!" HintC ["You have killed a defenseless farm animal!"]; player addRating -10000;};


}];

 

Farm animals, especially dairy animals, IMHO would be held in high regard after an apocalypse, therefor the high punishment.  But change as you see fit, maybe CIVS hightest punishment, then armed, but friendly survivors a little less and lowest punishment for the barnyard animals. 

Edited by tourist
typo
  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 3/15/2019 at 4:06 PM, tourist said:

13. Check if player kills members of his own side, CIVS or certain animals and make him a renegade for that:

 

This is based off a solution that Grumpy Old Man posted here in BIS forums.  I altered it for my purposes which are to punish the player for killing each of the three entity groups and regarding the animals I tested it with the warefarethai mod cows. 

IMO a player should be penalized only if another player or AI witnessed the killing.  So maybe you should ckeck for near humans and check their knowsAbout value and distance to the killer.

  • Like 2
  • Thanks 1

Share this post


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

penalized only if another player or AI witnessed the killing. 

 

This reminds me ! :

 

 

Share this post


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

IMO a player should be penalized only if another player or AI witnessed the killing.  So maybe you should ckeck for near humans and check their knowsAbout value and distance to the killer.

Generally you are right; especially in a world without any institutional system of justice, no witnesses means no persecution.  In my missions I found, although per chance and unintended, a nice workaround: if the above script is used together with this unarmed takedown script, it goes like this:

 

a) Use a weapon and receive punishment

 

b) Use the silent takedown and get away with your crime  

 

But I'll try if I can find an improvement for the "murder" script along the guidelines you suggested. THX for the input! :icon14:

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
23 minutes ago, tourist said:

But I'll try if I can find an improvement for the "murder" script along the guidelines you suggested. THX for the input! :icon14:

Thanks for listening!  Its just an idea.  But I think especially in a SP mode, if I'm surviving and want to butcher a goat without being seen, its an immersion breaker to have everyone in the world consider me an enemy later.

 

I definitely like your silent takedown ideas too.

 

On a related note, one thing cool about open world games like GTA and Red Dead Redemption, is having some NPC remember you for a witnessed deed later.  That is cool, immersive, and impressive when it happens.  To implement that, we need to add negative (and positive?) encounters to NPC specific variables (or NPC clan specific variables). So the next time the NPC or his Clan sees you they react:  "Get that goat rustler!" or "Need some food?  I appreciate your help fighting those bandits.". Etc.  I guess what I'm getting at is player reputation with an individual NPC, or reputation with a Clan/Group of NPCs.  Easy for me to say, as I'm too busy on other projects to contribute to this...haha.

 

Oh no, more ideas are coming in dammit!  ... I can't stop them...

 

Real time Wanted Poster:  Once player is flagged as a bad guy, create wanted posters by projecting a camera on signs or posters placed here and there.   It could be real time by creating a unit, and you set his face, uniform, and headgear to match the player.  And set enableSimulation false, and place the unit in front of some generic background.  This would have to be an out of the way location, and could even be done 10000 meters up in the air.  Point a camera on the poster unit face, and broadcast the camera on any "Poster" Signs placed in game.  Text on Poster could be customized real time also with Player Name.  These posters can be pre-set up with a generic .paa/.jpg of some character, then replaced later with live camera when Player actively becomes a bad guy.

 

Wouldn't it be cool to walk into a town and see your face and name on a wanted poster?  (Then you would know how I feel every time I go to the post office.)

  • Like 3

Share this post


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

Wouldn't it be cool to walk into a town and see your face and name on a wanted poster?  (Then you would know how I feel every time I go to the post office.)

 

LOL, I know what u mean!  Whenever I get caught at speeding, the photos of me in the car they send me as proof make me look like  a really, really badass killer enroute to his next job... :rofl:

  • Haha 2

Share this post


Link to post
Share on other sites

14.How how to suicide bomber zombies , in editor

 

On 3/28/2019 at 9:26 PM, EO said:

@Gill93, funnily enough I toyed with Bomber Boss Zeds for my Sirens mission but ditched the idea, feel free to use the code in the video, obviously it's based on individually named units via triggers... 

 


Condition: s1 distance z1 <10; 

Activation: Bomb="M_PG_AT" createVehicle (getPos z1);

 

On 3/29/2019 at 1:34 AM, EO said:
On 3/28/2019 at 10:57 PM, Gill93 said:

I tested it out and its pretty awesome for how simple it is by chance would you happen to know how to directly add radiation sickness to player directly with same trigger im having trouble figuring that one out thanks 🙂

 

Not sure how to do that. ^^

 

But if your following my above video example you could:

add a rad zone trigger,

add a game logic trigger,

the game logic trigger will attach the rad zone to the zed,

when zed is dead the rad zone is spawned giving instant rad sickness to player...

:slayer: 

Share this post


Link to post
Share on other sites

15. How to script a safe zone marker that deletes any unit (besides player) entering it

 

Spoiler
On 3/31/2019 at 12:07 PM, GEORGE FLOROS GR said:

 

Here is a different approach and working now as tested with zombies.



GF_SZ_Delete = {

	while {true} do {
		waituntil{uisleep 1;	

			_centerposition = _this select 0;
			_size = _this select 1;

			_nearestobjects = nearestObjects [_centerPosition, ["CAManBase"],_size];

			{
			if (
				//(_x isKindOf "Bandit_Renegade")  
				//or(_x isKindOf "zombie")
				(_x isKindOf "Man") 
				&& !(isPlayer _x)
				)then{
				deleteVehicle _x;
				};
			}forEach _nearestobjects;			
			systemchat"delete";
		};
	};
};


//	use distance ex : 50
//[getmarkerpos "marker_1",50] call GF_SZ_Delete;

//	use the size of the marker
[getmarkerpos "marker_1",getmarkerSize "marker_1" select 0] call GF_SZ_Delete;

 

 

Thanks to: GEORGE FLOROS 

  • Thanks 1

Share this post


Link to post
Share on other sites

×