Home   Help Search Login Register  

Author Topic: moving the respawn_west Marker by a script  (Read 1333 times)

0 Members and 1 Guest are viewing this topic.

Nedal

  • Guest
moving the respawn_west Marker by a script
« 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
Quote
? !(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??

   
« Last Edit: 31 Jan 2004, 18:29:38 by Nedal »

deaddog

  • Guest
Re:moving the respawm_west Marker by a script
« Reply #1 on: 31 Jan 2004, 17:52:42 »
Markers use setmarkerpos, not setpos.  :)

and it is "markername" setmarkerpos position.

Use quotes around marker name.
« Last Edit: 31 Jan 2004, 17:53:41 by deaddog »

Nedal

  • Guest
Re:moving the respawm_west Marker by a script
« Reply #2 on: 31 Jan 2004, 18:24:35 »
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
« Last Edit: 31 Jan 2004, 18:27:02 by Nedal »

deaddog

  • Guest
Re:moving the respawn_west Marker by a script
« Reply #3 on: 31 Jan 2004, 19:24:29 »
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.

Nedal

  • Guest
Re:moving the respawn_west Marker by a script
« Reply #4 on: 01 Feb 2004, 08:12:38 »
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