AnGuS 0 Posted May 15, 2002 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
suma 8 Posted May 15, 2002 </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE"> "_USER_DEFINED #0/%1",_counter 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. <span id='postcolor'> Identical naming convention is used, but instead of #0 there is #<internal_id>, where <internal_id> is arbitrary integer identifying each player. This integer can be any 32-bit value, is not necessarily small integer and first player is by no means gurannteed to have Id 1 (or any other small number). Share this post Link to post Share on other sites
AnGuS 0 Posted May 15, 2002 Hi, First of all thanks for u reply Suma, and in second place i have another question. Is there any scripting command that returns the value of the arbitrary integer identifying? Thanks Suma very much in advance -AnGuS- www.leofp.com Share this post Link to post Share on other sites
suma 8 Posted May 16, 2002 No, there is no such function. ... and no, we are probably not going to provide such a function. Share this post Link to post Share on other sites
AnGuS 0 Posted May 16, 2002 Thanks anyway Suma. It's too bad you can not implement the reading of markers in Mp since this is a very powerful tool to interact with the players. In any way, if you plan to implement something in this direction in the future we will appreciate if you let us know. Thank you very much once again -AnGuS- Share this post Link to post Share on other sites