OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Nedal on 31 Jan 2004, 17:48:44
-
i am working on a DM map with different start locations
a part of the script works, the soldiers S1+S2 are moved to the same Random Startlocation
here the script
? !(Local LocalServerObject):Exit
~0.3
_totalLocations = Count startingLocations
#Start
westStartingLocation = startingLocations Select Random _totalLocations;PublicVariable "westStartingLocation"
;player sidechat(format["%1",GetPos westStartingLocation])
#Placepos
   _destination = GetPos westStartingLocation
   S1 SetPos _destination
   S2 SetPos _destination
   respawn_west SetPos _destination
S1 SetPos _destination works and moves the soldier to the right destination but
respawn_west SetPos _destination does not work, if you get killed you respawn at the respawn marker, but the marker is not moved to the right position
can someone help me??
  ÂÂ
-
Markers use setmarkerpos, not setpos. :)
and it is "markername" setmarkerpos position.
Use quotes around marker name.
-
i changed it to
   "respawn_west" setmarkerpos _destination
it works now if i play in from the editor
but it does not work if i play it on ded server
played on local pc the respawn marker is moved to the right position, but played on server the marker is not moved :-[
is the problem because of the local server condition on start of the script?
? !(Local LocalServerObject):Exit
-
Yes, markers are local to each machine. Moving a marker on one machine will not move it on another.
This is useful for using one marker to show the position of the player (for example).
"playermarker" setmarkerpos getpos player
will be different on each machine but only one marker name is needed.
What you should do is to leave the respawn marker where it is and just setpos the units where you want them to go. Or you have to ensure that the respawn marker is moved on each machine, not just the server.
-
deaddog thanks a lot for your help
i solved the problem
i took this out of the first script and placed it in a second script wich starts at mission start,
and it runns WITHOUT ? !(Local LocalServerObject):Exit
means it runns an all pcs
~4
_destination = GetPos westStartingLocation
"respawn_west" setmarkerpos _destination
now my random Start location with moving respawn to selectet Startlocation works !!! ;D ;D ;D