Home   Help Search Login Register  

Author Topic: mapclick spawn marker  (Read 1545 times)

0 Members and 1 Guest are viewing this topic.

Offline Delta

  • Members
  • *
  • Shazayme, Babye !
mapclick spawn marker
« 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

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re: mapclick spawn marker
« Reply #1 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.

Plenty of reviewed ArmA missions for you to play

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: mapclick spawn marker
« Reply #2 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";
« Last Edit: 19 Jul 2007, 16:58:59 by h- »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Delta

  • Members
  • *
  • Shazayme, Babye !
Re: mapclick spawn marker
« Reply #3 on: 19 Jul 2007, 15:49:56 »
fantastic h- !


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

Thanks very much.