Jump to content
Sign in to follow this  
AnGuS

Name markers in mp

Recommended Posts

Hi all,

We have used your the User-defined Marker Detection Script from snYpir, for some sp missions and it works

fine. Howeverm when trying to use it in Mp the script does not work since the markers names

for Sp and Mp seem to be different. We are aware this is a well known problem and we are wondering

if any improvement to adapt this script to Mp has been accomplished.

Does any one known the naming convection of the markers in Mp. We think that's the only thing we need to adapt

the script to Mp.

Thank you very much in advance, i paste the SnYpir´s script here:

*-------------------------------------------------------*

; user defined marker detection script v1

; by snYpir for the OFP editing center

;---------------------------------------------

; this script will constantly monitor for new user-defined markers

; it is designed to be called right at the start of a mission

; every time a new user defined marker is created:

; the global variable 'userMarker' will equal the latest marker

; the global variable 'userMarkerPos' will equal the position of the latest marker

; the global variable 'userMarkerX' will equal the X coord of latest marker

; the global variable 'userMarkerY' will equal the Y coord of latest marker

; the global variable 'userMarkerSet' will equal true.

; it is YOUR responsibility to set userMarkerSet back to false! ie in your artillery script or wherever. If you don't it doesn't matter, if the user enters a new marker then the new marker information will override the global variables

; it does not matter how many markers already exist on the map, this script will just hunt for the first user defined marker the player places, then the next etc.

; WARNING!!!! THE DELETE BUTTON IS THE ACHILE'S HEEL OF THIS SCRIPT!!!!!

; PARAMETERS: takes the number of pre-defined markers you have already set in the editor

;----------------------------------------------

; BEGIN BITS U CAN EDIT

;----------------------

; set the time between marker checks - should be between 0.25 and 1

_pause = 0.5

; time in seconds to show 'destroy' icon before the marker will disappear, default is 1

; careful, you don't want the player adding new markers while we are waiting for the

; destroy icon to disappear, so don't make this value too high

_hidedelay = 1

; the icon to display for user-defined markers

_icon = "destroy"

; END BITS U CAN EDIT

;--------------------

userMarkerPause = false

userMarkerSet = false

_nEditorMarkers = _this select 0

; this loop will run until the end of the mission

#missionLooop

;wait for a marker to be added

#loop2

;halt the script if requested

@NOT(userMarkerPause)

; find the id of what will be the next user-defined marker

_counter = _nEditorMarkers

#loop1

_markerposn = getMarkerPos format["_USER_DEFINED #0/%1",_counter]

? ((_markerposn select 0) == 0 AND (_markerposn select 1) == 0) : goto "nextmarkerspotfound"

_counter = _counter + 1

goto "loop1"

; ok so now _counter will equal the position of where a new marker will go.

#nextmarkerspotfound

; make sure another marker has not been added during the loop above

? ((_markerposn select 0) != 0 AND (_markerposn select 1) != 0) : _counter = _counter + 1

~_pause

_markerposn = getMarkerPos format["_USER_DEFINED #0/%1",_counter]

? (_markerposn select 0) == 0 AND (_markerposn select 1) == 0 : goto "loop2"

; remember the new marker information in userMarker, userMarkerPos, userMarkerPosX, userMarkerPosY

userMarker = format["_USER_DEFINED #0/%1",_counter]

userMarkerPos = _markerposn

userMarkerX = (_markerposn select 0)

userMarkerY = (_markerposn select 1)

; change markers icon

userMarker SetMarkerType _icon

; switch the userMarkerSet flag to true - it is your responsibility to switch it back to false

userMarkerSet = true

; uncomment for information about new marker to be printed to screen

;hint format["Marker %1 placed at position: (%2,%3)",_counter,userMarkerX,userMarkerY]

; short pause to allow icon to change

~_hidedelay

; hide the marker (so the player will not intentionally delete it)

userMarker SetMarkerType "empty"

; loop back up to wait for the next marker

goto "missionLooop"

;NOTE: Due to the different marker naming convention in multiplayer missions, this script will not work in multiplayer. This situation will be rectified as soon as I find out the naming convention of user-placed markers in multiplayer

*--------------------------------------------------------*

-AnGuS-

www.leofp.com

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×