Home   Help Search Login Register  

Author Topic: Checkpoint Respawns (coop)  (Read 1748 times)

0 Members and 1 Guest are viewing this topic.

Friznit

  • Guest
Checkpoint Respawns (coop)
« on: 11 Oct 2003, 13:05:17 »
Situation:  Group in a long mission.  All members playable.

Problem:  Want to make 'checkpoints' at various stages - ie.  Move the respawn location when each part of the mission is finished.  Saves going all the way back to the beginning.

Solution so far:  Have placed a trigger, activated when player present, as fol:

_grp = rangerteam;
"Respawn_West" setMarkerPos (getpos leader _grp);

Also, could place object with addaction comd for player to activate a switch (eg. Planetside type).

Issues:  respawn marker does not move for all players.  Do I need to have "[_x setMarkerPos ...etc] foreach units _grp" or is it a server/client side problem?  In which case I'm lost cos I don't know how to send server=>client messages.

Any help appreciated.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Checkpoint Respawns (coop)
« Reply #1 on: 11 Oct 2003, 16:44:05 »
Try to make the _grp local variable a global one.. byt removing the _. How did you even get the local variable in a trigger? I though triggers didn't allow local variables in them  ??? ::)
Not all is lost.

Rappy

  • Guest
Re:Checkpoint Respawns (coop)
« Reply #2 on: 22 Oct 2003, 18:47:25 »
I handled it this way:


respawn = respawn_west
playercords = leader
leaderpos = getpos leader
markerpos = getmarkerpos respawn_west
fort = west_fort

#outpost
~0.2
"respawn_west" setmarkerpos (getpos leader)
"west_fort" setmarkerpos (getpos leader)
flag1 setpos getpos leader
ammo1 setpos getpos leader
titletext ["Outpost created", "PLAIN"]

#end
exit



This moved the flag and ammocrate with the spawnpoint to the guy that set the spawnpoint.
However it seems to move the spawnpoint individually so everyone has to be near the leader to make the outpost or basically move the spawnpoint for themselves.

Prolly just synching error and needs to be global or something, haven't really bothered, cos it still allows everyone to move his spawn only when near the leader not separately

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Checkpoint Respawns (coop)
« Reply #3 on: 23 Oct 2003, 01:32:58 »
i wouldnt move the respawn marker, it would be better to have them respawn in the normal way then simply relocate them instantaneously, players wont notice the move.

Have the players run a respawn script that looks to see if booleans have been stated as true for each stage that you need, eg in this case i called them STAGEONE etc etc

Simply state the booleans to be true as each stage of your mission has been  achieved, but in the respawn script simply check them in reverse order so that the script acts on the latest mission stage


~10
#START
@ !alive player
@alive player
?stagefour: goto "STAGEFOUR"
?stagethree: goto "STAGETHREE"
?stagetwo: goto "STAGETWO"
?stageone: goto "STAGEONE"

#STAGEONE
player setpos[getmarkerpos "marker1"]
goto "START"

#STAGETWO
player setpos[getmarkerpos "marker2"]
goto "START"

#STAGETHREE
player setpos[getmarkerpos "marker3"]
goto "START"

#STAGEFOUR
player setpos[getmarkerpos "marker4"]
goto "START"


Then create markers at each respawn location you want called marker1, marker2 etc etc
Use empty markers then you dont need to hide them from map view using command lines

Execute the script from the init.sqs using

?!(local server): exec "Respawn.sqs"
remembering to create a game logic named "server"


the ~10 is to simply stop the script from reacting to the soldiers initial spawn

Using the @command on a client side only script in this way doesnt cause much stress on the cpu or add to lag so dont worry about that, its a damn site more efficient than using a loop within the script to check
« Last Edit: 23 Oct 2003, 01:37:07 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Friznit

  • Guest
Re:Checkpoint Respawns (coop)
« Reply #4 on: 03 Nov 2003, 13:02:41 »
Terox,

I like this alot - but I cannot get it working.  I'm putting triggers to set booleans (eg.  East/Not Present/On Act: stageone = true).

Everything else as you said.  Probs with setpos [getmarker pos...]  keeps returning error: 1 element, 3 expected.

Do I need a "publicVariable" line in their to set the booleans on all clients if the serverside player activates it?

Do I need to exec the script twice in init.sqs - once for ?!(localserver) and once for server?

slowworm

  • Guest
Re:Checkpoint Respawns (coop)
« Reply #5 on: 21 Nov 2003, 10:57:57 »
Vou have to remove the "[" and "]".
The position is given as variable (1 element) which is an [x,y,z,] array itself and not as [x position element,y position element,z position element]


cu slowworm