OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Delta on 19 Jul 2007, 10:40:27

Title: mapclick spawn marker
Post by: Delta on 19 Jul 2007, 10:40:27
Hello to all !

   I'm working on a little project at the mo which uses map placed markers which can be placed using onmapsingleclick.

Thing is that I'd rather not have these already placed on the map.

How can I spawn a marker at the same time as I use the onmapsingleclick command?



onMapSingleClick "_Marker setpos _pos"

_Marker = createmarker ["Position1", position _pos]
_Marker setMarkerType "Marker"
_Marker setMarkerColor "ColorGreen"
_Marker setMarkertext  format ["%1",_lmark]





Y'see I cant get it working so that the marker is created,then setpos'd on the mapclick.

Anyone know how to sort this?

Cheers,

SSD
Title: Re: mapclick spawn marker
Post by: macguba on 19 Jul 2007, 13:47:08
I'm not sure about arma but in ofp there was no way to create a marker.   The solution was to create a whole bunch of markers in the editor and park them in the corner of the map out at sea.  Make them type "empty" so they are invisible.   On the mapclick setpos it and set it to a new type and colour.

Title: Re: mapclick spawn marker
Post by: h- on 19 Jul 2007, 14:08:52
It is possible in ArmA to create markers (as well as fully functional triggers and waypoints)..

@Delta
You need to execute a script with the mapclick, and use the _pos it gives to create the marker on that spot..
I mean why would you need to setPos it separately?

EDIT:
put this in your mission init
Code: [Select]
onMapSingleClick "_pos exec ""markerthingylee.sqs"""
markerthingylee.sqs
Code: [Select]
onMapSingleClick ""

_Marker = createmarker ["Position1", _this]
_Marker setMarkerType "Marker"
_Marker setMarkerColor "ColorGreen"
_Marker setMarkertext  "Hello World"

Same in sqf:
init.sqf
Code: [Select]
onMapSingleClick "void = _pos execVM ""markerthingylee.sqf"""
markerthingylee.sqf
Code: [Select]
onMapSingleClick "";

_Marker = createmarker ["Position1", _this];
_Marker setMarkerType "Marker";
_Marker setMarkerColor "ColorGreen";
_Marker setMarkertext  "Hello World";
Title: Re: mapclick spawn marker
Post by: Delta on 19 Jul 2007, 15:49:56
fantastic h- !


I never considered running a second script to set the positioning.

Thanks very much.