Jump to content
fiestamasta

Spawning Marker on Certain Buildings Within Altis

Recommended Posts

Greetings A3 Editing Community,

 

I would like to figure out how to spawn certain markers across an entire map on certain terrain buildings and objects.

 

These buildings and objects are already a part of the terrain itself.

 

Taking Altis as an example.

 

Spawn Red Zeus Mildot on every Military Cargo House and Military Cargo Tower

Spawn Blue Zeus Mildot on every Garage (old) and Garage (new) building

etc..

 

What would be the syntax and how would I go about doing such a thing?

 

It should be a much simpler version of an AI occupation script or Loot Spawn script however I'm having trouble translating it specifically to markers and built in buildings.

 

I would like the markers to spawn in the middle of the buildings if possible.

 

Thanks in advance. 

Share this post


Link to post
Share on other sites
_center = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_radius = getNumber(configFile >> "CfgWorlds" >> worldName >> "MapSize") / 2;
_objects = nearestObjects [_center, ["Land_Cargo_House_V1_F"], _radius];
_numberOfObjects = count _objects;

for "_i" from 0 to (_numberOfObjects - 1) do
{
    _markerName = "marker_" + str _i;
    _object = _objects select _i;
    _marker = createMarker [_markerName, getPosWorld _object];
    _markerName setMarkerType "hd_dot";
    _markerName setMarkerColor "ColorEAST";
    _markerName setMarkerAlpha 1;
    hint str _i;
    sleep 0.1; //optional
};

Hope that get's you started, simply replace the classname in line 1 with the classname of the object your are looking for.

Share this post


Link to post
Share on other sites
/*
Step 1 - Place the following in your init.sqf

//defines

	#define PP preprocessfilelinenumbers

// Server Side Scripts

	if (isServer or isDedicated) then
	{
		[] spawn compile PP "places_locations.sqf";
	};
	
Step 2 - Create places_locations.sqf and copy & paste everything
*/

//Place a Game Logic called "center" in the middle of the map (Step 3)
_gamelogic = CENTER;

//Garages
_garage_all = nearestObjects [getPosATL _gamelogic, ["Land_i_Garage_V1_F","Land_i_Garage_V2_F","Land_i_Garage_V1_dam_F ","Land_i_Garage_V2_dam_F "], 32000];

//Military Cargo Houses
_cargo = nearestObjects [getPosATL _gamelogic, ["Land_Cargo_House_V1_F","Land_Cargo_House_V2_F","Land_Cargo_House_V3_F"], 32000];

//Military Towers
_tower = nearestObjects [getPosATL _gamelogic, ["Land_Cargo_Tower_V1_F"], 32000];

//Military HQs
_hq = nearestObjects [getPosATL _gamelogic, ["Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F"], 32000];

//Military Posts
_post = nearestObjects [getPosATL _gamelogic, ["Land_Cargo_Patrol_V1_F","Land_Cargo_Patrol_V2_F","Land_Cargo_Patrol_V3_F"], 32000];

// Garages & Military Locations
{
    _pos = position _x;
    _m = createMarker [format ["mrk%1",random 100000],_pos];
    _m setMarkerShape "ICON";
    _m setMarkerColor "ColorBlue";
    _m setMarkerSize [1, 1];
    _m setMarkerType "mil_dot";

} forEach _garage_all;

{
    _pos = position _x;
    _m = createMarker [format ["mrk%1",random 100000],_pos];
    _m setMarkerShape "ICON";
    _m setMarkerColor "ColorRed";
    _m setMarkerSize [1, 1];
    _m setMarkerType "mil_dot";

} forEach _cargo;

{
    _pos = position _x;
    _m = createMarker [format ["mrk%1",random 100000],_pos];
    _m setMarkerShape "ICON";
    _m setMarkerColor "ColorRed";
    _m setMarkerSize [1, 1];
    _m setMarkerType "mil_triangle";

} forEach _tower;

{
    _pos = position _x;
    _m = createMarker [format ["mrk%1",random 100000],_pos];
    _m setMarkerShape "ICON";
    _m setMarkerColor "ColorOrange";
    _m setMarkerSize [1, 1];
    _m setMarkerType "mil_dot";

} forEach _hq;

{
    _pos = position _x;
    _m = createMarker [format ["mrk%1",random 100000],_pos];
    _m setMarkerShape "ICON";
    _m setMarkerColor "ColorOrange";
    _m setMarkerSize [1, 1];
    _m setMarkerType "mil_triangle";

} forEach _post;

?id=527182133

08A6BAC151C01C9135909C945619D14AFAC84362

 

Resources:

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

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

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

https://community.bistudio.com/wiki/File:Arma2_markers1.jpg

Share this post


Link to post
Share on other sites

Wow!!!!

 

Thank you both for your help. This is amazing. I will run it now and see if I can get it to work!

 

Thanks again.

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

×