Home   Help Search Login Register  

Author Topic: to marker or not to marker...  (Read 637 times)

0 Members and 2 Guests are viewing this topic.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
to marker or not to marker...
« on: 03 Sep 2005, 11:27:56 »
m'kay, i have used this tutorial here which explains how to use user-defined markers, and i have implemented these ideas into a satellite script. what happens is the player goes to the map, double clicks to create a marker, and then on opening the satellite viewing device, the marker is there to be selected.

there is (of course) a problem. it works each and every time in my own missions. however, i have incorporated this script into the 1985 campaign, and sometimes it works, sometimes it doesn't. the satellite works a charm, but there are sometimes no extra markers available, even if i put ten of the buggers on the map. so far, having looked at the offending missions in the editor i can't find a reason for the temperamental nature of this bug.

anyone out there have experience with user-defined markers?

bored_onion

  • Guest
Re:to marker or not to marker...
« Reply #1 on: 03 Sep 2005, 12:08:46 »
Quote
but there are sometimes no extra markers available
as far as I am aware it doesnt matter what markers are already there, it simply depends on which number user defined marker you have placed. if the satellite is called from user defined marker 0 then the first marker you put down will work but no others. so maybe if you have put down one already and not deleted it before you placed another one (i.e. user defined marker 1) it has gotten itself all out of order. that could be the problem, maybe?

Quote
anyone out there have experience with user-defined markers?
i used it in Shadows of the Motherland  :)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:to marker or not to marker...
« Reply #2 on: 03 Sep 2005, 13:16:22 »
hmmm... well here's the script excerpt that i use to collate the user defined markers -

Code: [Select]
_markernum = 0

#seek_marker

_mpos = getMarkerPos format["_USER_DEFINED #0/%1",_markernum]

? ((_markernum >= 13) and (not _found)) : goto "begin_satcomm"
? (_mpos select 0) == 0 and (_mpos select 1) == 0 and _found : goto "begin_satcomm"
? ((_mpos select 0) == 0) and ((_mpos select 1) == 0) and (not _found) : _markernum = _markernum + 1 ; goto "seek_marker"

satcomm_targ = satcomm_targ + [_mpos]
_found = true
_markernum = _markernum + 1
goto "seek_marker"

on the assumption that the player will not place markers at 0/0, i give the loop 13 chances to find a marker that is elsewhere. if one is found, it's added to the marker array satcomm_targ. then, if markers have been found and the next is at 0/0, it breaks out of the loop.

like i say, some missions it works just fine, finding all user-defined markers. then other missions it won't even see one.  :-\

bored_onion

  • Guest
Re:to marker or not to marker...
« Reply #3 on: 03 Sep 2005, 13:19:25 »
Quote
i give the loop 13 chances

i found your problem - you chose an unlucky number of loops ;D
« Last Edit: 03 Sep 2005, 13:19:39 by bored_onion »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:to marker or not to marker...
« Reply #4 on: 03 Sep 2005, 14:37:20 »
of course... now why didn't i think of that... ::)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:to marker or not to marker...
« Reply #5 on: 15 Sep 2005, 20:05:15 »
discovered what the problem was - it lies here, in the tutorial on user defined markers...

Quote
Note that all markers in the mission (including those inserted by mission designer) are counted to this number - so if you have three markers in the mission, the first user defined marker (during the mission) is automaticaly named "_USER_DEFINED #0/3"...

so if there are more than, say, 13 markers already on the map (which in many missions, especially those with dots marking a path, is the case) then my script won't work. i've increased the marker count to 200, and suddenly it works.

let this be a lesson - always read the tutorials properly, kids ;)
« Last Edit: 15 Sep 2005, 20:05:49 by bedges »