Restarting game from a certain point of the scene
InovaTech
Member Posts: 161
hello guys
I was worried because did not find the way to start the game from a certain point of the scene when actor dies or gets destroyed.
my scenes are very long so I dont want people to start over from the begining when they die.
thanks. hope I explain well
I was worried because did not find the way to start the game from a certain point of the scene when actor dies or gets destroyed.
my scenes are very long so I dont want people to start over from the begining when they die.
thanks. hope I explain well
Best Answers
-
VW_Games Posts: 31This may sound confusing but i hope i help you
what you want to do is make an actor in this case i will refer to it as a checkpoint flag because that seems to be what you are aiming for
the way i would go about this is creating a real attribute called checkpoint_1
then under your player create a rule
(when player overlaps or collides with actor of type checkpoint flag change attribute game.checkpoint_1 to true
now create another actor and call it spawner and change its opacity to 0
in the spawner create a rule stating that when attribute game.checkpoint_1 is true spawn actor (then enter the location )
the only problem is that you will need an attribute for each checkpoint flag you have for example
checkpoint_1
checkpoint_2
checkpoint_3
hope this helped message back if you need any more help!! -
bjandthekatz Orlando, FlPosts: 1,375Let me try to explain it a little different. Ill use an example with 2 checkpoints
Attributes
Create a integer attribute called "Checkpoint"
Create a real attribute "Checkpoint_X
Create a real attribute "Checkpoint_Y"
Actors
Create an actor called "Checkpoint"
Place 2 Checkpoint actors on the scene and unlock them
Place them in different parts of the scene
Checkpoint 1:
When Character collides with first Checkpoint change attribute Checkpoint to 1
If checkpoint = 1 change attribute Checkpoint_X to self.position.X and change attribute Checkpoint_Y to self.position.Y
Checkpoint 2: When character collides with second Checkpoint change attribute Checkpoint to 2
If checkpoint = 2 change attribute Checkpoint_X to self.position.X and change attribute Checkpoint_Y to self.position.Y
Inside character:
When dies change attribute self.position.x to Checkpoint_X and change attribute self.position.y to Checkpoint_Y
You can also use the interpolate behavior to move the character back instead of changing its position immediately.
This way you don't spawn a character, but instead reuse it.
If you need a template feel free to ask
---------------------------------------------------------------------------
If you want to do it via Gamers_Inc's method here are the answers to your questions:
what kind of attribute should I use? Real
does opacity mean visible? Yes
who is the spawner? The spawner is an actor that will respawn the player at the last checkpoint
so when I overlap that "checkpoint flag actor" and then when my actor gets destroy it will go to that point? Yes
Need Help? Email Me | Templates | Full Game Source Code
Answers
just to finish understanding you and to like your comment
what kind of attribute should I use?
does opacity mean visible?
who is the spawner?
so when I overlap that "checkpoint flag actor" and then when my actor gets destroy it will go to that point or missing something?
sorry for having so much questions. I promess I will like all your post. thannks