OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Duke Dax on 06 May 2003, 12:48:04

Title: Marker-Addons --> If Marker was set, script should start
Post 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
Title: Re:Marker-Addons --> If Marker was set, script should start
Post by: Blackblood on 15 May 2003, 14:07:20
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.


Title: Re:Marker-Addons --> If Marker was set, script should start
Post by: headshot_snipe on 15 May 2003, 20:59:20
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
Title: Re:Marker-Addons --> If Marker was set, script should start
Post by: macguba on 15 May 2003, 21:52:00
Look in the online command ref in the Ed Depot and learn about the command onMapSingleClick
Title: Re:Marker-Addons --> If Marker was set, script should start
Post by: headshot_snipe on 16 May 2003, 07:48:06
Tnx mac,  I'll do that right away!  :D