PDA

View Full Version : Force Respawn : Where is it hidden?



System_Crush
01-07-2009, 06:33 AM
So I have this trap scripted and which correctly xPawn(Other).Died(None, None, Other.Location)'s the player.
Then the trap resets(takes 10 seconds), however if the player still hadn't respawned by then the rag doll counts as a pawn and sets off the trap.

I figured that; instead of making it ignore dead things, it would be better to just set my custom gametype to ForceRespawn.

Problem:
It's a little check box in the create game screen, I thought it would be a variable somewhere.
I've looked through GameInfo, DeathMatch and GameRules, none of them seem to have it as a property.

Is there even a boolean for it, or is it handled some other way?
If so what is the easiest way to activate it with a script.

Thank you in advance
System_Crush

INIQUITOUS
01-07-2009, 07:03 AM
Hmm you may run into more problems because afaik the destroying of the ragdoll happens at different times for all players and the server, depending on things such as who can see it etc..

How about in your trap you do a check and make sure the players health > 0.

System_Crush
01-07-2009, 07:50 AM
Hmm you may run into more problems because afaik the destroying of the ragdoll happens at different times for all players and the server, depending on things such as who can see it etc..That doesn't matter as long as the ragdoll is no longer that player's pawn(in other words, when that player's camera stops folowing it)

Because the player respawning is synchronised across the clients.


How about in your trap you do a check and make sure the players health > 0.I might have to do that anyway as a back up yea, but forcing spawn will hopefully make the gametype more platformer, which is what I'm going for.

INIQUITOUS
01-07-2009, 09:04 AM
If you really need to make them respawn you could try Level.Game.RestartPlayer( xPawn.Controller );

..or it might be ServerRestartPlayer(). There is definately something like that in Level.Game afaik


edit: found some old code of mine.

heres some code I used once to restart players



Level.Game.RestartPlayer(Controller);
Controller.ServerReStartPlayer();