OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Killzone on 16 Dec 2005, 18:43:06

Title: mapclick
Post by: Killzone on 16 Dec 2005, 18:43:06
Hi

I am trying to use the mapclick feature to move a marker so that I can have a heli go to that marker. My problem is if I dont click the map fast enough it starts the rest of the script before I have even clicked the map.

I remember there was a map click where it would wait for me (no matter how long) to click the map before moving on. This is the one I am using but its not right

Hint "Click Map for Repel Zone"; onMapSingleClick {heli setPos _pos; variable1=true; onMapSingleClick {}};player sidechat "roger that"

One should I be using?

Thanks ;D
Title: Re:mapclick
Post by: macguba on 16 Dec 2005, 19:02:11
Hint "Click Map for Repel Zone"
onMapSingleClick {heli setPos _pos; variable1=true; onMapSingleClick {}}
@variable1
player sidechat "roger that"
Title: Re:mapclick
Post by: Meatball0311 on 17 Dec 2005, 03:00:01
Hey where do you put that into a script? or what?
Title: Re:mapclick
Post by: bedges on 17 Dec 2005, 12:02:43
it could go into a script, but from the look of the first example it's in a trigger's on activation field - going by all the semi-colons...

Title: Re:mapclick
Post by: macguba on 17 Dec 2005, 12:03:04
Yes.  Although I'm normally the first to recommend triggers or waypoints over scripts, in the case of mapclick - which is slightly tricky to work with - I would recommend a script simply because that gives you the most space to work with.  It's easier if you can see what's going on.

Your current problem is that the script does not pause to wait for the player to click, it just keeps going.    You need to add the @ command so that the script waits for the player to click.