Jump to content
WaIdoZ

Marker on Vehicle Array??

Recommended Posts

I am new to scripting on arma 3 so ill try my best to understand. How do I script a marker on a vehicle that will spawn from array? 

this is all i have done,

 

//======vehicle Array==========
_vArray = [
	"B_MRAP_01_F"
] call BIS_fnc_selectRandom;

_vArray createVehicle position player;

//===========Marker============
_marker1 = createMarker ["Marker", [0, 0]];
"Marker" setMarkerShape "ELLIPSE";
"Marker" setMarkerSize [50, 50];
"Marker" setMarkerColor "ColorWhite";

 

Share this post


Link to post
Share on other sites

Just test:

 

private _vArray = ["B_MRAP_01_F","B_LSV_01_unarmed_F","B_Quadbike_01_F"];
private _veh = selectRandom _vArray createVehicle (player getpos [30,getdir player]);
private _mk = createMarkerLocal [str random 1, getPos _veh];
_mk setMarkerShapeLocal "ELLIPSE";
_mk setMarkerSizeLocal [50,50];
_mk setMarkerColorLocal "colorWhite";
private _mkText = createMarkerLocal [str random 1, getpos _veh];
_mkText setMarkerTypeLocal "mil_dot";
_mkText setMarkerTextLocal typeOf _veh;
_mkText setMarkerColorLocal ([side player, true] call BIS_fnc_sideColor);

 

selectRandom command is faster than older BI function;

Local is for local player visibility only (you can remove them for global visibility);

The vehicle spawns 30m ahead from player (example);
Marker name is unique. If same for 2 markers, you'll work always with the same marker. Here, I don't care for marker's name, but I want them never same. So str (string) random 1 is a string, changing at each occurrence. Probability for the same string, even for 1000 markers is not probable. Then working with local variable referring to the created marker (here _mk or _mkText) is handy;

Don't forget to place your markers where you need (here at vehicle(s) position);

You can call for side color of the player as shown on last line.

 

Wait for next Arma3 version 2.20 for more shape of marker, like PENTAGON or TRIANGLE instead of ELLIPSE.

  • 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

×