ID:267636
 
I was woundering if it is possible to change the players type like from mob/robber to mob/frog? And also could this be done using world.pc = /mob/frog?

What are the procedures for the world/pc variable really for any way? and changing the world.turf to somthing diffrent would that change all void tiles to that too?
I've never heard of a world.pc var. I always used world.mob....
I think you mean world.mob, not world.pc.

That being said, there is a way to do what you want, but it's not as simple as what you're thinking. You have two mob types, /mob/robber and /mob/frog, right?

Players start as a /mob/robber.

To change their type, you have to make a new mob like this:
mob/proc/changemobtype(type)
var/mob/M = new type() //make a new mob of the desired typ
for(var/v in src.vars)
M.vars[v] = src.vars[v] //change the new mob's variables to the player's variables
M.key = src.key //Put the player in the new mob


In the above example, you'd call the changemobtype proc of the mob your trying to change

src.changemobtype(/mob/frog)
In response to sapphiremagus
sapphiremagus wrote:
I think you mean world.mob, not world.pc.

That being said, there is a way to do what you want, but it's not as simple as what you're thinking. You have two mob types, /mob/robber and /mob/frog, right?

Players start as a /mob/robber.

To change their type, you have to make a new mob like this:
> mob/proc/changemobtype(type)
> var/mob/M = new type() //make a new mob of the desired typ
> for(var/v in src.vars)
> M.vars[v] = src.vars[v] //change the new mob's variables to the player's variables
> M.key = src.key //Put the player in the new mob
>

In the above example, you'd call the changemobtype proc of the mob your trying to change

src.changemobtype(/mob/frog)

Messa thanks you.
[link] - Changing a player's mob type