Jump to content
Aseru

How to remove the bodies of dead players on a dedicated server?

Recommended Posts

Как удалить тела погибших игроков на выделенном сервере?Если консольная линия, чтобы очистить мертвых игроков?

Share this post


Link to post
Share on other sites

i build over water  so  i can   deconstruct the  ground / floor  under them and   dump them in the water ....or i bury them ;when  no ones looking ?

Share this post


Link to post
Share on other sites

but adam .. what do you do when after a day the scripting   fails?   (  which it has been constantly  doing much to the frustration of the  scripters..)

Share this post


Link to post
Share on other sites
3 hours ago, kimbuck said:

but adam .. what do you do when after a day the scripting   fails?   (  which it has been constantly  doing much to the frustration of the  scripters..)

The trouble there is the traffic some of these open servers get. That is why we are working on the Non-persistant avatars and they should be in update 1.1 hopefully (beginning of 2020).

  • Like 2
  • Upvote 1

Share this post


Link to post
Share on other sites

I recently discussed this with someone in the P1 discord. They asked the same question.

Disclaimer: I haven't tested this yet but I think it should work.


My idea on this was to handle it using the ON PLAYER DISCONNECT tile. Their body should be movable using the SET POSITION tile. Just move their body to a safe location and store their position before the move into the persistent game variable. ON PLAYER CONNECT, you can just SET POSITION back to that position you stored. 

Share this post


Link to post
Share on other sites
20 minutes ago, Malaka135 said:

Я недавно обсуждал это с кем-то из разногласий P1. Они задали тот же вопрос.

Отказ от ответственности: я еще не проверял это, но я думаю, что это должно работать.


Моя идея заключалась в том, чтобы справиться с этим, используя плитку ON PLAYER DISCONNECT. Их тело должно быть подвижным, используя плитку SET POSITION. Просто переместите их тело в безопасное место и сохраните их положение до перехода в постоянную переменную игры. При подключении проигрывателя, вы можете просто установить положение обратно в ту позицию, которую вы сохранили. 

Excellent! Can I see an example?

Share this post


Link to post
Share on other sites
On 12/19/2019 at 10:05 AM, PAVELGAMES said:

Excellent! Can I see an example?

Sorry for late response. I tried out my idea live and kinda got it to work.

I'll show you what I did and you might have to edit it to work with your game.

First, I set a persistent variable to store the player's coordinates under Game Settings -> Game Storage

I named it disconnect_Position and it is Vector type.

I placed down a Player Role so I can handle the OnConnect/Disconnect and I also handle my global storage array of "Connected Players". You'll probably want to do the same if you don't have one already. Its easy, just place down a global storage and create a new variable under Variables. It must be an array.

So when they connect, we get the value disconnect_Position to set their new position there.

onDisconnect, I actually move their body to the Reference Point 1 which you will want to make and put it somewhere safe. This will be were all the bodies will begin to pile up.

meh1.png.db26240f31c7e119e2468e004f7fbe4e.png

I set a Time Trigger to just constantly store the player's position. It is set to 1 sec interval. It loops through all players and set's their disconnect_Position value to their current position.

meh2.png.20293d239d4bb98e26a3a763462c03c2.png

 

Note* :

I tried to avoid using the timer and just store their position on the onDisconnect, but it just wouldn't work. I guess the player already disconnected and the position of get position entity just returned 0 always. So instead I store it live with the timer when I know the game can properly still get their position.

There might be a super rare chance that the timer might store their last position just as they disconnect as the safe zone. I doubt this will occur since the timing must be perfect. BUT since it is a possibility, it might be a good idea to setup a triggerzone to teleport them out of the safe zone to protect the bodies of the disconnected players.

I hope this helps or at least guides you in the right direction.

Share this post


Link to post
Share on other sites

@Malaka135

I'd recommend using a time interval of maybe 5 seconds or more. Time loops, especially in large worlds are taxing on the server system.

You should use instead an "Entity Storage", add each player that connects to the game to that storage, and assign a variable called "Save Spot". Each time you request the variable it will let you choose which player you want.

You can alternatively create a console command such as /savespot which will save the last location the player was in.

Edited by Igor Q.
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×