mob/Move()
if(usr.pertr==1 && usr.incar==1 && usr.ricte==1)return 0
else return 1
Problem description: For some reason, whenever I log in I while not go to the specified location in my programming. I was fine before I put this in.
ID:264313
Jan 12 2009, 8:12 pm
|
|
Code:
mob/Move() Problem description: For some reason, whenever I log in I while not go to the specified location in my programming. I was fine before I put this in. |
Jan 12 2009, 8:24 pm
|
|
The reason is that code annihilates the Move() proc's function, which of course controls movement. You're preventing any mob movement from taking place by not letting the proc perform its default action ( ..() ). Just returning 0 or 1 isn't going to cause movement to take place, you may be confusing this with other procs, so I suggest looking up the Move() proc.
|
In response to Kaioken
|
|
I did look it up, guess I may've looked at it wrong or something. Thanks for your help.
|
In response to Mizukouken Ketsu
|
|
Yeah, I figure that out thanks to Kaioken.
Thanks anyway! |
It'd be wise not to use usr in movement related procs as it can easily throw a runtime error at you if say, an NPC moves. Also boolean shortcuts could make your code easier to read.
I advise you to read this here : - http://www.byond.com/members/ DreamMakers?command=view_post&post=35932 - http://www.byond.com/members/ DreamMakers?command=view_post&post=37940 Also, I won't bother telling you what others have already said, I just thought this would be good to point out ;) |
In response to Andre-g1
|
|
Thanks. I'm too used to using usr in procs, I really need to get out of that habit >_<.
|
I think you also want the OR ("||") operator instead of the AND ("&&") operator. As it is now, one has to be petrified, incarcerated, and.. and.. <small>ricte?</small> before they will actually be unable to move. I imagine any of three should disable movement.
|
In response to DarkCampainger
|
|
Yeah, thanks. I figured it out a while ago, but thanks anyway.
And ricte is short for rictusempra, which would mean the mob has been been hit with the tickling charm and is laughing so hard they are unable to move. |