PDA

View Full Version : Checkpoints?



giggles
12-03-2009, 05:18 PM
Good Afternoon,

I am currently working on a project that requires checkpoint-esque behavior.

The level has multiple floors, and whenever the player dies, they have to go back to the very top, I'd like them to respawn in the same level.

My guess for implementing this would be a trigger volume that triggers whenever they goto the next floor (there is only one way to each level so this would work) and sets a variable to that floor. Then, whenever they die spawn at the associated spawnpoint with that variable.

I don't have much experience with unrealscript so I am not sure where to start, but I do know how to code so maybe some snippets or some hints or a basic rundown, heck anything to help me start this would be very helpful!

Thanks in advance :)

TheSpaceMan
12-04-2009, 05:40 AM
What you could do, even if i don't know if thats the right way.
Would be to put multiple PlayerStarts in the level.

and overload this function in GameInfo.

Probably you would need to overload your PlayerStart class some how. Adding a flag to the current spawnpoint.

the function name is:
RatePlayerStart(PlayerStart P, byte Team, Controller Player)

Here you could cast the PlayerStarts to your type and se if it is the active spawn. But I have no idea to set said value. Well I guess, that if you don't use multiple teams. That you could hack it, using the Team value somehow, thus removing the need for your own type, leaving you with just a own function.

There is maybe some easier way. And you need to figure out yourself how to hook this up with a trigger.

giggles
12-04-2009, 02:35 PM
Thank you for your reply SpaceMan!

I have implemented that method you suggested and well... it sort of works!

I think what I really need is to have triggers store the current 'state' of the game, then whenever my pawn dies I should load that state.

Is that WorldInfo()?

TheSpaceMan
12-04-2009, 03:39 PM
Not sure really sound like a resonable place.