Jump to content

[AOG] Player Respawn System


Ainz Ooal Gown

Recommended Posts

Description:

This is a respawn system that I currently use in my games. It is very staright farward but allows your players to set a respawn location you put on your map.

 

Video:

https://www.ascensiongamedev.com/resources/filehost/48a67458f15947e6130fbdb70c3acbd3.mp4

 

Process:

Players can walk up to a respawn point and interact with it to set a respawn location and if they die it will respawn them at that point.

 

Issue:

Event doesnt trigger fast enough, so we create a blank black map and a black image to prevent a "Map Bounce" (what I mean by this is when a player dies he will respawn back to the class set start location before the respawn event kicks in, so the class starter map will show for a split second, before the player is warped to the map set by the respawn system. It will make sense as we go on)

 

Build: 

First we need to make a variable:

  1. Type: INTEGER, Name: Player Respawn LOC

 

Second we need to make a common event

Spoiler

Way Ive done it is so each new page is a respawn location, so you can make as many locations as you wish.

 

Make sure each page is TRIGGER= "On Respawn" and has a "Spawn/Execution Condition" of the player respawn location, Like so:

  1. PAGE 1 is: IF "Player Respawn LOC" = 1 RUN
  2. PAGE 2 is: IF "Player Respawn LOC" = 2 RUN

 

What is happening here is

  1. Show a picture, which is just a black image which is set to full screen.
  2. Show Text that player has died
  3. Warp player to the location of respawn point
  4. Hide image

 

Page 1

9f7be3b43dfa8928addf8dc55b460dc4.png

Page 2

dc8757d8c3b90e6960d746c739bfff73.png

 

Lastly we need to make the respawn points, which I call "Pathfinders", which is just an event on a map.

Spoiler

So all that is happening here is when a player interactions with the set reswpan loaction is asks do they wish to set location here, if the player hits yes, it sets variable "Player Respawn LOC" to 1

93f340d3aac14dadf8e0a6d7af4b2a71.png

 

Now you have set the core build of the respawn system, but you have to do one more thing which depends on how you have your game setup. Becuase of the issue I mentioned above, with a slight delay happening on the event trigger to warp player, I have had to set a "Blank" map which I called "Eternity".

 

I set all my classes in game to have this map "Eternity" as a spawn point

Spoiler

d99bffe6c6bbf16f4c0ba70d0249ba72.png

 

So this isnt good for when a new player starts the game, as they will just spawn on a blank map... so you add (which I have in all my games) is a common event "Set New Player Variables".

Spoiler

This is useful if you have other variables you need to set for a new player joining the game.

 

Create a new variable and call it "New Player Start Done", variable is a "Boolean"

Make sure event "Spawn/Execution condition" is "New Player Start Done = FALSE"

Make the event trigger is "Login"

 

First thing in the common event commands is to warp the player to your actual starting location of your game.

Last thing in the common event commands is to set a boolean variable to "TRUE" (this is so event only runs once for a new player)

 

2a35d70d37acad8c2c5dae2e818cac2b.png

 

Complete!

 

Now you should have a fully working respawn location system in your game.

 

Enjoy :)

Link to comment
Share on other sites

  • 2 months later...

It looks like the latest update (B6.1) breaks this.

Maybe it's just me but I am pretty sure something breaks now after the sceen goes black.

 

All that happens to me now after I die is just the black screen. I have to re-log and teleport to the place I wanna be.

Link to comment
Share on other sites

15 hours ago, Mapyo said:

It looks like the latest update (B6.1) breaks this.

Maybe it's just me but I am pretty sure something breaks now after the sceen goes black.

 

All that happens to me now after I die is just the black screen. I have to re-log and teleport to the place I wanna be.

 

I will have a look but dont think anything has changed that would affect this system.

Link to comment
Share on other sites

18 hours ago, Mapyo said:

It looks like the latest update (B6.1) breaks this.

Maybe it's just me but I am pretty sure something breaks now after the sceen goes black.

 

All that happens to me now after I die is just the black screen. I have to re-log and teleport to the place I wanna be.

 

Ive had a look and for some reason when setting and image on respawn it stops the continuation of the event...

 

Removing the show image makes the system work. A work around is to hide the player, then show player instead of images.

 

I believe this is a bug so I will report it and see what the devs say.

Link to comment
Share on other sites

2 hours ago, Ainz Ooal Gown said:

 

Ive had a look and for some reason when setting and image on respawn it stops the continuation of the event...

 

Removing the show image makes the system work. A work around is to hide the player, then show player instead of images.

 

I believe this is a bug so I will report it and see what the devs say.

 

54 minutes ago, jcsnider said:

The picture was rendering above the event text so while it was working there was no way to continue with the event.

 

Fixed in 0.6.1.229. @Incubugs I think this solves everything for you as well, granted im not sure why I didn't see the issue using your gamedb.

 

@Ainz Ooal Gown You were right!

 

@jcsnider Thanks man!

 

EDIT:

Just upgraded and im still having the problem.

Edited by Mapyo
Link to comment
Share on other sites

1 hour ago, jcsnider said:

The picture was rendering above the event text so while it was working there was no way to continue with the event.

 

Fixed in 0.6.1.229. @Incubugs I think this solves everything for you as well, granted im not sure why I didn't see the issue using your gamedb.


Thanks JC :)

Link to comment
Share on other sites

  • 1 year later...
On 11/23/2019 at 8:48 PM, Ainz Ooal Gown said:

Description:

This is a respawn system that I currently use in my games. It is very staright farward but allows your players to set a respawn location you put on your map.

 

Video:

https://www.ascensiongamedev.com/resources/filehost/48a67458f15947e6130fbdb70c3acbd3.mp4

 

Process:

Players can walk up to a respawn point and interact with it to set a respawn location and if they die it will respawn them at that point.

 

Issue:

Event doesnt trigger fast enough, so we create a blank black map and a black image to prevent a "Map Bounce" (what I mean by this is when a player dies he will respawn back to the class set start location before the respawn event kicks in, so the class starter map will show for a split second, before the player is warped to the map set by the respawn system. It will make sense as we go on)

 

Build: 

First we need to make a variable:

  1. Type: INTEGER, Name: Player Respawn LOC

 

Second we need to make a common event

  Reveal hidden contents

Way Ive done it is so each new page is a respawn location, so you can make as many locations as you wish.

 

Make sure each page is TRIGGER= "On Respawn" and has a "Spawn/Execution Condition" of the player respawn location, Like so:

  1. PAGE 1 is: IF "Player Respawn LOC" = 1 RUN
  2. PAGE 2 is: IF "Player Respawn LOC" = 2 RUN

 

What is happening here is

  1. Show a picture, which is just a black image which is set to full screen.
  2. Show Text that player has died
  3. Warp player to the location of respawn point
  4. Hide image

 

Page 1

9f7be3b43dfa8928addf8dc55b460dc4.png

Page 2

dc8757d8c3b90e6960d746c739bfff73.png

 

Lastly we need to make the respawn points, which I call "Pathfinders", which is just an event on a map.

  Reveal hidden contents

So all that is happening here is when a player interactions with the set reswpan loaction is asks do they wish to set location here, if the player hits yes, it sets variable "Player Respawn LOC" to 1

93f340d3aac14dadf8e0a6d7af4b2a71.png

 

Now you have set the core build of the respawn system, but you have to do one more thing which depends on how you have your game setup. Becuase of the issue I mentioned above, with a slight delay happening on the event trigger to warp player, I have had to set a "Blank" map which I called "Eternity".

 

I set all my classes in game to have this map "Eternity" as a spawn point

  Reveal hidden contents

d99bffe6c6bbf16f4c0ba70d0249ba72.png

 

So this isnt good for when a new player starts the game, as they will just spawn on a blank map... so you add (which I have in all my games) is a common event "Set New Player Variables".

  Reveal hidden contents

This is useful if you have other variables you need to set for a new player joining the game.

 

Create a new variable and call it "New Player Start Done", variable is a "Boolean"

Make sure event "Spawn/Execution condition" is "New Player Start Done = FALSE"

Make the event trigger is "Login"

 

First thing in the common event commands is to warp the player to your actual starting location of your game.

Last thing in the common event commands is to set a boolean variable to "TRUE" (this is so event only runs once for a new player)

 

2a35d70d37acad8c2c5dae2e818cac2b.png

 

Complete!

 

Now you should have a fully working respawn location system in your game.

 

Enjoy :)

How to make option after killed (death) 

Can revival with money?

Link to comment
Share on other sites

common event > trigger > on death -> add "SHOW options" with a few options, for example spawn in city = free, or spawn near. if they select near add a conditional branch, if player has 100 golds take 100 golds and warp him where you want or if he doesnt have money show a message instead, you need a contiditional or he will spawn even if he doesnt have gold.

to change default spawn points is more complex, you have to create a player variable and call it for example "spawn1", "spawn2" etc anything you want, then an npc change this, for example you go to a city talk to an npc and he says "would you like to change spawning point here"? if you select the option yes, change the player variable you created, if it was bool set it true or false and in a common event you control where player spawn easily with a contidional branch. If player spawn point variable = "spawn1" warp him city 1, if variable is "spawn2"  teleport to city 2 etc

Edited by Andical
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...