OK so for some reason my DM reference won't open. It tells me it can't open the browser so I'm asking in here.
What I want to do is to switch the mob I'm controlling. I've tried just switching src.client with M.client (var/mob/M in world) and I know it switches because my stat panel changes but I get a black screen. The same happens when I switch keys. If I switch client.mob I get NO change at all.
Thoughts? Or is this because I'm switching with an NPC?
ID:162330
![]() Jan 24 2008, 6:54 am (Edited on Jan 24 2008, 7:47 am)
|
|
![]() Jan 24 2008, 1:40 pm
|
|
You need to change the client.mob variable. If nothing is happening then you're changing the wrong client's mob.
|
Mob I want to control is A(var/mob/A in world). Mob I am currently controlling is B(src).
src.client.mob = A.client.mob A.client.mob = B.client.mob don't work. am I missing something? ps: it would be totally awesome if I could type this stupid thing without a million typos... |
See, that changes all my stats and says that the mob I switch to has entered the world but I have a blank screen.
|
Look up client.perspective and client.eye in the DM Ref.
I'm thinking perspective needs to be set to MOB_PERSPECTIVE. Not certain if you really need to bother with eye at all. |
No, that isn't the problem.
I think his problem is that he has a log in script based on mob/Login(). He shouldn't get the "has entered the world" message...the mob should already exist. Instead of mob/Login, try client/New(). |
No good. What's happening is that mob A (me) is becoming mob B (test subject) and mob A is not changing. when I try to switch usr or src anything it stops functioning.
|
I am telling you, you have a login script somewhere interfering. I used that exact same verb and I don't get any issue.
What is your login script? |
mob/Login() |
There is your problem, you have a universal mob/login script. Now, everytime a mob gets a player it runs this script. You dont want that.
Instead, if you can't do client/New() then you need to have something like a basecamp. Here is my code on how I do this: mob/creating_character See how I use "mob/creatingcharacter", then switch it to mob/player/(something)? This means it only executes when creatingcharacter mobs login, and the player will never log in as mob/creatingcharacter again unless they are creating a character. Makes sense? |
I have 1 problem with this so far and that is that my login screen is a turf item and this is not allowing me to get to that screen. I just go to the map with no mob at all and the rest of my world does not initiate.
|
Well, this is embarrassing... My login is working fine. The reason I'm getting a black screen is because I'm being teleported to random locations. Out of the 20 maps I have available I've only mapped 2 and it's moving me around. Although it IS deleting my old character...
|
Is there a reason you do it like that? No offense, but that sounds kinda silly to me.
Still, just edit that tile in the map builder to have the tag "entrance" or what have you. That way, you create your character, and then you just locate them to "entrance". |
Trust me, having just mob/login and then switching mobs will end badly for you everytime regardless. You want to change how you create your characters if you are going to have mob switching.
As for the random teleportation, exactly what have you coded that causes that? |
Ah, so you use the same turf. Bad idea, in fact using a turf as a log in location is a bad idea. Instead, set a tag on the turf to something, and then just:
src.loc = locate("entrance")
That way you don't have a turf you can't use. To set a tag, just go into the map maker, right click the turf you want, click edit and then set the tag. |