ID:263395
 
Code:
client/North()
if(src.drivemove)
step(src.mob, src.mob.dir)
else
..()
client/South()
if(src.drivemove)
src.mob.dir = turn(src.mob.dir, 180)
src.North()
src.mob.dir = turn(src.mob.dir, 180)
else
..()
client/East()
if(src.drivemove)
src.dir = turn(mob.dir, -45)
else
..()
client/West()
if(src.drivemove)
mob.dir = turn(mob.dir, 45)
else
..()
client/Northeast()
client/Northwest()
client/Southeast()
client/Southwest()


Problem description:
I want the character to move differently depending on wether or not the "drivemove" var is 1 but it says the variable isnt defined because it's not a client variable. If I make it a client variable then I get weird results (world turns 90 degrees... pretty cool)

Try typecasting...

Hint: "usr." (term used loosely) for the client's mob is "mob."


And try to learn how to manipulate client/Move(), less mess in my opinion :P

- GhostAnime
Carved in Shadows wrote:

I want the character to move differently depending on wether or not the "drivemove" var is 1 but it says the variable isnt defined because it's not a client variable. If I make it a client variable then I get weird results (world turns 90 degrees... pretty cool)

Because the client also has a dir var that changes the direction the world is displayed. To change the mob dir var, use:
C.mob.dir

Of course, replace C with the right variable for the client.
In response to GhostAnime
GhostAnime wrote:
And try to learn how to manipulate client/Move(), less mess in my opinion :P

Yep, it is less writing (or copying), but it's actually shorter (...in 1/1000000000000 sec) to use the moving client procs, because client/Move() is called by them; they run first. What you could do is just write a new proc and call it from the client moving procs.
In response to Kaioken
what I want is for my charater to move normaly then gets in a vehicle and I change his drivemove variable to 1 and the charater moves in a different way while driving the car