OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: hashmus on 01 Jan 2003, 19:22:04

Title: variables
Post by: hashmus on 01 Jan 2003, 19:22:04
i want the position of marker1 saved as x and z but i cant find out how... ive tried like this:
getMarkerPos marker1 == [x,z]
but it doesnt work... what then???
Title: Re:variables
Post by: MorMel on 02 Jan 2003, 00:06:43
I didn't quite understood what you want, bur you can store a marker's position through this way:

(in a script)
***
_x = GetMarkerPos "marker1" select 0
_y = GetMarkerPos "marker1" select 1
_z = GetMarkerPos "marker1" select 2
***
-the variables don't realy need to be z, y or x...

(I'm not sure if the command position is the right one, but i think it works!) :-\
Title: Re:variables
Post by: hashmus on 02 Jan 2003, 18:55:18
i want to make a marker on my map... i want this marker to be moved around on the players command... one is to move by draggin it with mouse but i dont know how to do that... then i thought about using radiocommands...
on alpha command: [x,z](from getmarkerposition) "store as" [x,z+10]... is it possible??
Title: Re:variables
Post by: Ranger on 02 Jan 2003, 20:13:29
If you have Resistance, you can use the onMapSingleClick command.

In your init.sqs, put the following code:

Code: [Select]
onMapSingleClick {"Marker1" setMarkerPos _pos}
This sets the position of Marker1 to the location on the map where the player clicked.  Good luck!  8)