ID:162947
Nov 4 2007, 10:17 am
|
|
I would like to know if there is a way to make a verb to switch two players mobs. So that means they literly switch bodies I guess, including stats, items, and what not. Would it be through client or something..Please tell me if you know anything. Thanks
|
Nov 4 2007, 11:14 am
|
|
client.mob
|
In response to GhostAnime
|
|
Wouldn't that be just the screen? I thought it would be more like
mob/verb/switch_bodies(mob/M in get_step(src,src.dir)) Like a savefile of some sort... |
In response to Jman9901
|
|
Maybe you should experiment, or at the very least, read upon the entry in the DM Ref.
And savefiles is for storing data, how would that do anything for what Valen wants? |
In response to GhostAnime
|
|
Just the variables for saving it, Switching the variables. I just used savefiles as an example.
|
In response to Jman9901
|
|
You could loop through the vars list of each mob and then store them in a list. After that, loop through the lists that stored the vars and swap.
|
In response to Kakashi24142
|
|
No point since the save directly having "usr.client.mob" (though it really should be usr, or really src from the main uses of src in that verb... after all, the client.mob is referring back to the same src) should have all (non-temp.) variables and objects saved.
|
You need 3 mobs: the two switching and one as a placeholder. Call the first player mob A and the second mob B and the placeholder mob C.
First switch mob A to the empty mob C by setting C's key to A. Then switch mob B to the now empty mob A by setting A's key to B. Finally switch mob A to mob B by setting B's key to A and delete C. ~X |
In response to GhostAnime
|
|
well if his is talking just stats and icons
mob ~~~Marcmacman~~~ |
In response to One Piece Entertainment
|
|
mob/verb/Switch_Bodies()
var/mob/m = usr.target2 var/c = m.client m.client = usr.client usr.client = c So would this work? If it does, would they revert back after they relog? Would it only work on players, not NPCs? |
In response to Valen45
|
|
No, that won't work. Read my post above. You need to set mob.key to log a client into a mob, not the client variable. Also, if you only switch between two mobs, and they both have clients, the fist one to have his key set will be kicked from the game. The only way to do this is to use 3 mobs. Read my post above and it should be clear.
~X |
In response to Xooxer
|
|
Here:
proc // The proc can't be one of the mob's procs ~X |
In response to Xooxer
|
|
You can avoid creating a new mob like this:
proc/SwitchMobs(mob/A,mob/B) |