OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Duke Dax on 06 May 2003, 12:48:04
-
Hi,
i've got a question. How can i force a Marker-Addon to start a script, if a special Marker of this Addon was placed on map?
Greetz
Duke Dax
-
Since you did'nt specify the problem (placing marker during play OR in editor?) I'll give you an example of editorplaced markers.
Editor example:
Place your marker and name it let's say "Mark1".
In your init or wherever you wanna put it write this:
Marktype=(getmarkertype "Mark1")
In your init or wherever you wanna execute the script write this:
?Marktype=="Destroy":exec "destroy.sqs"
?Marktype=="Start" exec "start.sqs"
Sometimes the class-name is different from the editor-name.
To get the correct markertype-name do this:
hint format ["%1",getmarkertype "Mark1"]
For some strange reason the markertype "Objective" is recognised as "Flag". Beats me.
-
i'm quiet interessted, how do you make a script run when smone has doubled clicked on the map and placed a marker.
like if in game you just placed a maker that had to be named HELLO then a group of units would walk to this marker, but of course you'll have to make it check if it was in a certain radius so that the player doesn't lead the units far off. So how d'you do that?
tnx
-
Look in the online command ref in the Ed Depot and learn about the command onMapSingleClick
-
Tnx mac, I'll do that right away! :D