Jump to content
Sign in to follow this  
CommanderJordan

How to make an insurgency map?

Recommended Posts

Okay, so I am kind of new to editing and the editor and finally I am just barely getting into the scripts. Does anybody know where there is a guide to create an insurgency map?

Share this post


Link to post
Share on other sites

§7) Search before posting

If you have a question, please use the forum search function before posting to make sure that it hasn't been answered before. There is a big chance it has, not only does searching help to keep the forum free of multiple threads it will also help you to get an answer much quicker.

http://forums.bistudio.com/showthread.php?112579-watch-Insurgency

Share this post


Link to post
Share on other sites

hello, my english is weak.i used translator.

here is not any guide about how to make an insurgency or missions, Best way is open insurgency official mission and take a look.

You can use Eliteness.exe software for open .pbo files ( use search to find it).

btw, i searched several month's and found this thread's about insurgency

-Create random cache inside house's:

Dynamic ammo cache spawn

Or

Hostage in random building

I use this way and using an ammobox intense hostage .

-Create The Ammo Cache Explosion:

The Insurgency Ammo Cache Explosion

-Create colored area:

this is one of hard part's.

first read this: How to change Colour of Marker once condition is meet

first create a marker in center map and name it ( taskarea1)

now u had to create some script.

init.sqf

#include "defines.sqf"
#include "functions.sqf"
#include "common\initclient.sqf"

null = execvm "marker.sqf"

now we must create this scripts are inside our init.sqf. (init.sqf must be in ur mission folder )

a script for changing colors:

marker.sqf

mymissionmarkers = [];
private ["_mkr","_var","_pos","_houses"];
/// get all houses in location//////
_houses = [markerpos "taskarea1",5000, 3, true] call findHouses;
{
_pos = _x call getGridPos;
_mkr = str _pos;
if (getMarkerPos _mkr select 0 == 0) then {
	_mkr = createMarkerLocal[_mkr, _pos]; 
	_mkr setMarkerShapeLocal "RECTANGLE"; 
	_mkr setMarkerTypeLocal "SOLID";		
	_mkr setMarkerSizeLocal [50,50]; 
	_mkr setMarkerAlphaLocal 0.6; 
	_mkr setMarkerColorLocal "ColorGreen";
};

// would I add it here if so is this correct ?
mymissionmarkers set [count mymissionmarkers, _mkr];


} forEach _houses;

private["_temvariable","_cv","_sc","_vardone","_vardone2","_objects","_mkr","_eastside","_westside"];
_vardone = 0;
while {_vardone == 0} do {
_temvariable = [];
{if ((count (nearestObjects [(getmarkerpos _x),["MAN","TANK","CAR","TRUCK"],50])) > 0) then {_temvariable = _temvariable + [_x]};} foreach mymissionmarkers;
sleep 0.1;
_cv = count _temvariable;
if (_cv > 0) then
{
	_sc = 0;
	_vardone2 = 0;
	while {_vardone2 == 0} do {
		if (_sc < _cv) then
		{
			_mkr = _temvariable select _sc;
			_objects = nearestObjects [(getmarkerpos _mkr),["MAN","TANK","CAR","TRUCK"],50];
			_westside = [];
			_eastside = [];
			{if (side _x == WEST) then {_westside = _westside + [_x]};} foreach _objects;
			{if (side _x == EAST) then {_eastside = _eastside + [_x]};} foreach _objects;
			if ((count _westside) > (count _eastside)) then
			{
				_mkr setMarkerColorLocal "ColorGreen"
				} else {
				if (count _eastside > 0) then 
				{
					_mkr setMarkerColorLocal "ColorRed"
				};
			};
			_sc = _sc + 1;
			} else {
			_vardone2 = 1;
		};
	};
};
};

this code wil change our sector's color at specific condition, if there is not any opfor it ll change to green color, and if opfor are in , sector colors will stay in red color.

u can see we have a command inside this code (CALL findhouses and CALL getgridpos )

later we must create a Function for our call command but now we create a define (look to our init.sqf)

defines.sqf

//////map specific definitions/macros
//spawnPos must remain available in global missionNamespace, a definition does not
spawnPos =					[0,0,0];
#define CENTERPOS			[4382.35,2559.66,0]
#define AORADIUS 			5000
#define CACHEHOUSEPOSITIONS ["Land_House_K_1_EP1",[1,2,3,4],"Land_House_L_4_EP1",[6],"Land_House_C_5_V3_EP1",[0,2,6],"Land_House_C_12_EP1",[5,6],"Land_House_K_3_EP1",[9,1,2,3,5],"Land_House_C_5_V2_EP1",[4,0,1,5],"Land_House_L_8_EP1",[7,8],"Land_House_C_4_EP1",[7,12,13,15],"Land_House_C_2_EP1",[1,2,5,6,7,8,9],"Land_House_L_7_EP1",[0,1,2,3,4,5],"Land_House_C_10_EP1",[7,8,9,10,11,12,13,14],"Land_House_K_6_EP1",[6,7,8,9,10],"Land_House_C_11_EP1",[7,8,9,10],"Land_House_C_9_EP1",[2,3,4,5],"Land_House_C_3_EP1",[7,8,9,10,11,12,13,28,29,30,31,32],"Land_A_Office01_EP1",[5,6],"Land_A_Mosque_small_1_EP1",[3,4,5],"Land_A_Stationhouse_ep1",[6,9,13],"Land_House_C_5_EP1",[3,4,5],"Land_House_K_7_EP1",[4,5,6,11],"Land_Mil_ControlTower_EP1",[2,3,4,6],"Land_House_C_5_V1_EP1",[6,7],"Land_House_K_8_EP1",[4,0,1,2,3],"Land_A_BuildingWIP_EP1",[18,20,24,25,26,27,28,29,30,31],"Land_A_Villa_EP1",[4,6,7,8,9],"Land_House_C_1_EP1",[3],"Land_House_L_6_EP1",[4,0,3],"Land_House_L_3_EP1",[0,1,2],"Land_House_K_5_EP1",[1,2],"Land_House_C_1_v2_EP1",[0,1,2,3]]
#define GUNROOFPOSITIONS   	["Land_House_L_4_EP1",[[2,0],[3,0.2],[5,0]],"Land_House_L_3_EP1",[[3,0.8],[4,0.1]],"Land_House_C_12_EP1",[[7,0.9],[8,0.9],[9,0.6],[10,0.5]],"Land_House_C_5_V2_EP1",[[6,0.6],[7,0.7]],"Land_House_L_8_EP1",[[10,0.9],[11,0.9],[12,0.9],[13,1],[14,0.2],[15,0.8],[17,0.8]],"Land_House_C_4_EP1",[[5,0.1],[14,0.2]],"Land_House_L_6_EP1",[[1,0],[2,0]],"Land_House_C_10_EP1",[[18,0.9],[19,0.9],[20,0.6],[21,0.9]],"Land_House_K_6_EP1",[[11,0.1]],"Land_House_C_9_EP1",[[6,0.2]],"Land_House_C_3_EP1",[[14,0],[15,0],[16,0.4],[18,0],[19,0.4],[20,0],[21,0.1],[22,0],[23,0.3],[24,0.4],[25,0.4],[26,0.3],[27,0.4]],"Land_A_Office01_EP1",[[1,0.5]],"Land_A_Minaret_Porto_EP1",[[3,0],[5,0],[8,0],[9,0],[10,0.9],[11,0],[12,0],[13,0]],"Land_A_Stationhouse_ep1",[[14,0.8],[15,0.8],[16,0],[17,0],[18,0.1],[19,0],[20,0.1],[22,0.1],[23,0.3],[24,0.1],[25,0.2]],"Land_House_C_5_EP1",[[0,0.7],[1,0.9],[2,1],[6,0.8],[7,0.6]],"Land_House_K_7_EP1",[[12,0.1],[13,0],[14,0]],"Land_Mil_ControlTower_EP1",[[9,0.2],[10,0],[11,0],[12,0],[13,0],[14,0.3],[15,0],[16,0]],"Land_A_Mosque_big_hq_EP1",[[11,1],[12,0]],"Land_A_Mosque_big_minaret_2_EP1",[[2,0.9]],"Land_House_C_5_V1_EP1",[[0,0.7],[1,0.7],[5,0.6]],"Land_A_BuildingWIP_EP1",[[19,0.7],[22,0.9],[23,0.4],[33,0.1],[39,0.6],[40,0.5],[41,0.6],[47,0],[48,0.5],[53,0.6],[54,0.5],[55,0.1],[56,0.3],[57,0.2],[60,0.3]],"Land_House_K_8_EP1",[[5,0.2],[12,0.1]],"Land_Ind_Oil_Tower_EP1",[[2,0],[3,0],[4,0]],"Land_A_Villa_EP1",[[10,0.5],[11,0.5],[12,0.5],[13,0.5],[14,0.5]]]
#define ILLEGALHOUSES		["Land_Mil_hangar_EP1", "Land_Mil_ControlTower_EP1", "Land_Mil_Guardhouse_EP1", "Land_Mil_Repair_center_EP1","Land_Mil_Barracks_i_EP1","Land_A_Minaret_EP1","Land_Ind_Coltan_Main_EP1"]
// set EP1HOUSES to 'true' in order to have the param ignored and AI will spawn in every building, which got positions
#define EP1HOUSES			(configName(inheritsFrom (configFile >> "CfgVehicles" >> typeOf _x)) == "HOUSE_EP1")
#define randPos				[(CENTERPOS select 0)+random 6000-random 6000,(CENTERPOS select 1)+random 6000-random 6000, 0]

i get this code from insurgency mission.in my way at moment this defines using for config what houses must be get colors and what houses don't need as ILLEGALHOUSES

now we create our first function.sqf

findHouses = { 
private ["_buildings","_minPositions","_enterables","_alive"];
_buildings = nearestObjects [_this select 0, ["House"], _this select 1]; 
_minPositions = (_this select 2) - 1;
_alive = _this select 3;

_enterables = []; 	
{ 
	if (
		format["%1", _x buildingPos _minPositions] != "[0,0,0]" 
	&& EP1HOUSES 
	&& !(typeOf _x in ILLEGALHOUSES) && (alive _x || !_alive)
	) then { 
		_enterables set [count _enterables, _x]; 
	}; 
} forEach _buildings; 
_enterables
}; 

save it in same address with mission.sqm

this function will find house's. find all valid houses which offer a certain minimum count of positions.

now create a folder in ur mission folder and name it (common).

u had to create 2 script file in there.

initclient.sqf

#include "functions.sqf"

to call our function getgridpos

functions.sqf

findHouses = { 
private ["_buildings","_minPositions","_enterables","_alive"];
_buildings = nearestObjects [_this select 0, ["House"], _this select 1]; 
_minPositions = (_this select 2) - 1;
_alive = _this select 3;

_enterables = []; 	
{ 
	if (
		format["%1", _x buildingPos _minPositions] != "[0,0,0]" 
	&& EP1HOUSES 
	&& !(typeOf _x in ILLEGALHOUSES) && (alive _x || !_alive)
	) then { 
		_enterables set [count _enterables, _x]; 
	}; 
} forEach _buildings; 
_enterables
}; 

countPositions = { 
private ["_i","_house","_hPos"]; 
   _house = _this select 0; 
   _i 	 = _this select 1; 

_hPos	 = format["%1", _house buildingPos _i]; 
if (_hPos == "[0,0,0]") exitWith { _i; }; 
[_house, _i+1] call countPositions; 
}; 

#define nPos(X) ([X,0] call countPositions)

getGridPos = { 		
   private ["_pos","_x","_y"];

	_pos = getPosATL _this; 
	_x = _pos select 0;
	_y = _pos select 1;
	_x = _x - (_x % 100); 
	_y = _y - (_y % 100); 
[_x + 50, _y + 50, 0]
}; 

insurgency is a Complex coding and i just find out this code's until now. i suggested u to try to create a PVP insurgency , it is easier then coop.

im not scripter, just searching and copy/paste, as i said, search is ur best friend in community.

  • 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
Sign in to follow this  

×