Jump to content
anthonyfromtheuk

How do you make placed objects show on the map screen?

Recommended Posts

Whenever I put down a building, a wall or alike in the editor it doesn't show up on the map. is there a way to make objects show up on the map screen? Thanks.

Share this post


Link to post
Share on other sites

Most of the time it is easy just to put a Grey marke over the object. It shows in the map then

Share this post


Link to post
Share on other sites

Do you mean like the grey boxes for houses, yellow roads. I don't believe you can change that. All you can do is place a marker, such as trev suggests.

Share this post


Link to post
Share on other sites

oh thats dissapointing, I have quite alot of walls set up. The problem with setting up markers is they scale when you zoom the map in or out but i guess that will have to do unless anybody else has any ideas?

Share this post


Link to post
Share on other sites
The problem with setting up markers is they scale when you zoom the map in or out
Erm no they dont

init.sqf

call compile preprocessFileLineNumbers "markerBoundArea.sqf";
{
[_x] call fnc_markerBoundArea;
}forEach (player nearObjects ["house_f",400]);

markerBoundArea.sqf

fnc_markerBoundArea = {

_object = _this select 0;
_pos = getPosATL _object;
_bound = boundingBoxReal _object;
_rot = getDir _object;

_bmin = _bound select 0;
_min = _object modelToWorld _bmin;

_bmax = _bound select 1;
_max = _object modelToWorld _bmax;

//base corners
_b1 = _object modelToWorld _bmin;
_b2 = _object modelToWorld [_bmax select 0, _bmin select 1, _bmin select 2];
_b3 = _object modelToWorld [_bmax select 0, _bmax select 1, _bmin select 2];
_b4 = _object modelToWorld [_bmin select 0, _bmax select 1, _bmin select 2];

_randomName = "";
while {true} do {
	_randomName = str (random 2000);
	if (([getMarkerPos _randomName, [0,0,0]] call BIS_fnc_arrayCompare)) exitWith {};
};

//player sideChat format["creating marker %1",_randomName];
_marker = createMarker [_randomName, _pos];
_marker setMarkerShape "RECTANGLE";
_marker setMarkerSize [_bmax select 0, _bmax select 1];
_marker setMarkerColor "ColorRed";
_marker setMarkerDir _rot;
};

Its just a test piece be careful where you run it, e.g not on Altis :D. Ive run it in Agia Marina with no problems

Share this post


Link to post
Share on other sites

Do you know how to make markers i have put down not scale? i tried what you put and it works but still does not show the walls i have put down on the map just a few objects show up. i have put markers all over the objects i have created and i just need them to not scale, i really like the idea of how far you can see objects markers. <--- oh i just tested it and its not like i thought it was, i assumed it showed all objects in red to within 400m of your player but its 400m from where i spawn?

Edited by Anthonyfromtheuk

Share this post


Link to post
Share on other sites

It is a test piece you where meant to take that script and feed into it what ever you wanted marking rather than the (player nearObjects ["house_f",400]) which just shows a random selection of stuff of class house_f within 400m of the players start position.

Delete all the markers you have made, place down a gamelogic, in the gamelogics initialisation put

if(isserver) then {
fnc_markerBoundArea = {
	_object = _this select 0;
	_pos = getPosATL _object;
	_bound = boundingBoxReal _object;
	_rot = getDir _object;
	_bmin = _bound select 0;
	_randomName = "";
	while {true} do {
		_randomName = str (random 2000);
		if (([getMarkerPos _randomName, [0,0,0]] call BIS_fnc_arrayCompare)) exitWith {};
	};
	_marker = createMarker [_randomName, _pos];
	_marker setMarkerShape "RECTANGLE";
	_marker setMarkerSize [_bmin select 0, _bmin select 1];
	_marker setMarkerDir _rot;
};
{
	[_x] call fnc_markerBoundArea;
}forEach (synchronizedObjects this );
};

Then sync all the objects you want to be shown as markers to the gamelogic.

You can put down as many of these gamelogics as you need and each one can have any number of objects synced to them.

How this affects performance is questionable depending on how many objects your actually marking. Most likely not JIP compatible as is.

GameLogic

gamelogic.jpg

Sync objects

ineditor.jpg

In Game

ingame.jpg

EDIT: cleaned up the script, i had left a lot of code in there that was not needed, was left over from something else i was doing.

Edited by Larrow
clean up erronious rubbish in code

Share this post


Link to post
Share on other sites

Icon markers will always show the same size (so cover a larger area when zooming out). Those are best at marking important spots such as positions of objectives, important landmarks, players and vehicles.

Rectangle and ellipse markers always cover the same real-world surface, so are best for "mapping" purposes such as marking walls, houses, compounds and any other kinds of "area" that has pre-defined boundaries.

  • Like 1

Share this post


Link to post
Share on other sites
It is a test piece you where meant to take that script and feed into it what ever you wanted marking rather than the (player nearObjects ["house_f",400]) which just shows a random selection of stuff of class house_f within 400m of the players start position.

Delete all the markers you have made, place down a gamelogic, in the gamelogics initialisation put

if(isserver) then {
fnc_markerBoundArea = {
	_object = _this select 0;
	_pos = getPosATL _object;
	_bound = boundingBoxReal _object;
	_rot = getDir _object;
	_bmin = _bound select 0;
	_min = _object modelToWorld _bmin;
	_bmax = _bound select 1;
	_max = _object modelToWorld _bmax;
	_b1 = _object modelToWorld _bmin;
	_b2 = _object modelToWorld [_bmax select 0, _bmin select 1, _bmin select 2];
	_b3 = _object modelToWorld [_bmax select 0, _bmax select 1, _bmin select 2];
	_b4 = _object modelToWorld [_bmin select 0, _bmax select 1, _bmin select 2];
	_randomName = "";
	while {true} do {
		_randomName = str (random 2000);
		if (([getMarkerPos _randomName, [0,0,0]] call BIS_fnc_arrayCompare)) exitWith {};
	};
	_marker = createMarker [_randomName, _pos];
	_marker setMarkerShape "RECTANGLE";
	_marker setMarkerSize [_bmax select 0, _bmax select 1];
	_marker setMarkerDir _rot;
};
{
	[_x] call fnc_markerBoundArea;
}forEach (synchronizedObjects this );
};

Then sync all the objects you want to be shown as markers to the gamelogic.

You can put down as many of these gamelogics as you need and each one can have any number of objects synced to them.

How this affects performance is questionable depending on how many objects your actually marking. Most likely not JIP compatible as is.

GameLogic

https://dl.dropboxusercontent.com/u/96095460/ARMA3/markers/gamelogic.jpg

Sync objects

https://dl.dropboxusercontent.com/u/96095460/ARMA3/markers/ineditor.jpg

In Game

https://dl.dropboxusercontent.com/u/96095460/ARMA3/markers/ingame.jpg

Thanks for such a decent reply that did exatcly what i wanted but your right about questionable performance i have too many objects, very useful though thank you very much.galzohar your right i didnt know that i guess thats a less performance degrading way just will take some time. thanks to you both :D

Share this post


Link to post
Share on other sites

Will this script work on Altis, as I am trying to design a mission where I am building a base that is bombed, The issue I have is that most of the objects are scripted, and they dont show up in the editor, so I end having difficulties placing markers for bombing runs in the right place.

Share this post


Link to post
Share on other sites

If objects are scripted you already know where they are and placing a marker should be effortless. :)

_house = createVehicle ["House_Class_F", getMarkerPos "bombingRunMarker", [], 0, "CAN_COLLIDE"];

Place the marker and spawn the house on it.

Share this post


Link to post
Share on other sites

Interesting solution, so will all the objects need to be named to work with this initialisation code. As my base script has 4 hangers so would I need to name each hanger or will it just use the classnames.

---------- Post added at 11:38 ---------- Previous post was at 11:26 ----------

after reading other post here, will this coding work on altis.

Share this post


Link to post
Share on other sites

It is a test piece you where meant to take that script and feed into it what ever you wanted marking rather than the (player nearObjects ["house_f",400]) which just shows a random selection of stuff of class house_f within 400m of the players start position.

Delete all the markers you have made, place down a gamelogic, in the gamelogics initialisation put

if(isserver) then {
fnc_markerBoundArea = {
_object = _this select 0;
_pos = getPosATL _object;
_bound = boundingBoxReal _object;
_rot = getDir _object;
_bmin = _bound select 0;
_randomName = "";
while {true} do {
_randomName = str (random 2000);
if (([getMarkerPos _randomName, [0,0,0]] call BIS_fnc_arrayCompare)) exitWith {};
};
_marker = createMarker [_randomName, _pos];
_marker setMarkerShape "RECTANGLE";
_marker setMarkerSize [_bmin select 0, _bmin select 1];
_marker setMarkerDir _rot;
};
{
[_x] call fnc_markerBoundArea;
}forEach (synchronizedObjects this );
};

Then sync all the objects you want to be shown as markers to the gamelogic.

You can put down as many of these gamelogics as you need and each one can have any number of objects synced to them.

How this affects performance is questionable depending on how many objects your actually marking. Most likely not JIP compatible as is.

 

 

 

It generates a lot of synchronization lines so its hard to navigate in editor.

Can I put it directly into object ini? What part of code should i delete? 

Share this post


Link to post
Share on other sites

Something like..

//description.ext
class CfgFunctions {
	class MarkerBounds {
		tag = "LARs";
		class Markers {
			class markerBoundArea {};
		};
	};
};


//fn_markerBoundArea.sqf
if ( isServer ) then {

	params[ "_object" ];

	_pos = getPosATL _object;
	_bound = boundingBoxReal _object;
	_rot = getDir _object;

	_bmin = _bound select 0;
	
	_markerName = format[ "bound_%1", netId _object ];

	_marker = createMarker [_markerName, _pos];
	_marker setMarkerShape "RECTANGLE";
	_marker setMarkerSize [_bmin select 0, _bmin select 1];
	_marker setMarkerDir _rot;

};


//Objects init
this call LARs_fnc_markerBoundArea;

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

×