Jump to content
  • 0

How does cloning work on a code level?


Jboy2000000

Question

What I mean is, how does cloning check if you can clone someone? Id assume the only criteria is that their body needs to be dead, but what happens when their body is gone, like the player was changed into something else, and was scanned earlier that shift? Will they be able to be cloned because their body is "dead," and if so, what happens to the clone and the player's new body, and if not, how does it work?

Link to comment

2 answers to this question

Recommended Posts

  • 0

Here's how I believe it works:


Scan for cloning saves a copy of the character's UI's, UE's and SE's, along with the player's Ckey. Then when you attempt cloning, it checks two things: if the body is alive, and if there's a CKey assigned to it. If the body lives, cloning fails because the player is already in possession of an active body. If the body is dead and there's a CKey, it creates a new body in the cloning machine and assigns the Ckey to that new body. If there IS no Ckey, it checks if the Ckey is assigned to an entity with the assignment "ghost" (because that's how ghosts work - it's just characters assigned to it, I'll explain later), and if there is, it tells the player that they're attempting to be cloned (at which point they can refuse if I'm not mistaken). If the Ckey is absent, assigned to a non-ghost mob or refuses transfer, the cloning either fails or the clone spawns SSD.


Now, as far as assignment goes - it's not exactly like you'd expect. Assignment is how the game counts players - only the assignments given 'on spawn' are true assignments. The reason for this is that assignment is the umbrella term for "name of the category on which there's code". So a Captain assignment, for instance, has the code to spawn with the Captain's attire, ID and PDA. A scientist assignment spawns with scientist equipment. But assignments are other things, too - a player with the "Wizard" assignment spawns with the code to give them basic wizard attire and the hook of code that allows them to learn spells. Changeling assignment spawns with the changeling powers.


I'm not entirely sure, but I think that players can have three assignments, in order of priority: custom loadout, job and antag assignments. Custom loadout is never seen because that's the custom items loading. Job shows whatever title they have. And if they're an antagonist/special role, the antag assignment is the one that the server knows them by, with a few exceptions.


I'm far from being expert and I'm going off speculation based on observations of the server, someone who actually looks at the code would most likely know better. But that's my two cents anyway.

Link to comment
  • 0

What I mean is, how does cloning check if you can clone someone?

 

It needs a ckey in the body. It checks if you're dead, and then if there is a ckey in the body. For when there is no body in the cloner, it just sees if there is a ghost with the mind of the dead character. A mind is given to a ghost if they exit the body under the right conditions. (When you are actually dead, and then ghost. Ghost before actually dying doesn't transfer the mind, ergo, you cannot be cloned after that.)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...