Author Topic: Dynamically customizing respawn time  (Read 1181 times)

I need to have the respawn timer in a minigame individually decided for each client at the moment the client dies. It's not that hard to do functionally by just scheduling a lockout period on respawning that triggers when a player dies, but then the default spawn timer for the minigame will be counted on the client's centerprint. Does anyone know an elegant solution?

Can you not just switch whichever variable (I'm guessing it's in the minigame object) is being used to determine the respawn time just before it's used (again, guessing somewhere in onDeath)? It's kind of cheap but it removes a lot of work.

Can you not just switch whichever variable (I'm guessing it's in the minigame object) is being used to determine the respawn time just before it's used (again, guessing somewhere in onDeath)? It's kind of cheap but it removes a lot of work.

If you change the variable while they're dead, they can either respawn earlier or later than the time shows.

I'm guessing it checks minigame.respawnTime in ::onDeath and schedules stuff appropriately. What I meant was changing minigame.respawnTime before it's used, or am I missing something here?

I'll give that a shot. I'd still prefer another method if anyone has one since it'll make it harder for me to make the minigame GUI setting a scalar multiplier on the respawn time down the road.

EDIT: doesn't work; the centerprint is determined at the moment of death but whether or not clicking will respawn the player depends entirely on the time elapsed and the current .respawnTime of the mini at the moment of the click. I suspect it's based on a sim-time subtraction, and not a schedule, which explains why nothing trace()s out server-side when respawn becomes available for a player.
« Last Edit: March 30, 2011, 07:43:18 PM by Mr. Wallet »

I guess if nobody comes up with anything else you could go with a combination of that and your original idea. Then you have the correct countdown and no respawn ability still.

I think the only way is to make it yourself. You'll need to schedule a variable when someone dies and then package Observer::onTrigger to refuse to let them spawn while the schedule exists.

Both together may work: Set minigame.respawnTime on death to give them the countdown right and when they try to respawn to block it.
« Last Edit: April 01, 2011, 12:27:06 PM by Space Guy »

That seems like the easiest thing to do, Space; I'll go with that. Thanks everyone.