1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Player Blob destruction on disconnect.

Discussion in 'Modding Help' started by Pirate-Rob, Dec 9, 2016.

  1. Pirate-Rob

    Pirate-Rob Haxor Staff Alumni Tester

    Messages:
    270
    So I've been looking through kag's files, and I can't seem to find the code that remove's a players blob upon them leaving the server. Is this hard-coded or is it just in a really obscure place?

    My plan is to stop player blobs from being destroyed so they can reconnect and take over their old blob.

    If this mechanic is hardcoded, I really hope the devs will consider converting it~
     
    Osmal likes this.
  2. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    It is part of the engine, but you can disconnect the player from their blob in the onPlayerLeave hook and the blob wont be deleted. The onPlayerLeave hook is called before the player is checked for a blob and that blob is removed.

    Note that you'll probably want to store any permanent stats "somewhere else" (probably use a TCPR link over a config file since you'd want to write it out pretty often but i'm not your keeper) so when the server goes down or nextmaps or whatever, the player's stats are kept.
     
  3. Pirate-Rob

    Pirate-Rob Haxor Staff Alumni Tester

    Messages:
    270
    Thank you very much Geti! I'll implement that then. I'm looking to save the player's body part data and inventory, so no permanant stats really.
     
    Geti likes this.