In response to Naokohiro
That will allow them to move when they're already moving.
In response to Popisfizzy
Okay, let me fix this, I'm just learning bitwise stuff really quickly...
In response to Alaris123
Okay, it was as simple as this, I believe:
mob
Move()
if(src.busy)
src << "You're busy doing something else right now!"
return 0
if(!(movement_state & MOVING))
. = ..()
if(src.movement_state == SWIMMING)
movement_state |= MOVING
sleep(max(60 - (5 * round((src.swimming - 1) / 10)), 3))
src.stamina -= rand(1, 2)
src.swimming += src.swimmingmod*0.1
else
movement_state |= MOVING
sleep(max(60-(8 * round((src.speed -1) / 10)), 1))
movement_state &= ~MOVING
else
return 0
There's also another way, but I'll leave it at that.
In response to Alaris123
mob/Move()
if(busy)
src << "You are busy doing something else."
return 0

if(movement_state & MOVING) return 0

movement_state |= MOVING

if(movement_state & SWIMMING)
sleep(max(60 - (5 * round((src.swimming - 1) / 10)), 3))
stamina -= rand(1, 2)
swimming += src.swimmingmod*0.1

else if(movement_state & WALKING)
//I'd change this, by-the-way. Waiting six seconds
//to take one step is a bit excessive.
sleep(max(60-(8 * round((src.speed -1) / 10)), 1))

movement_state &= ~MOVING
return ..()
In response to Popisfizzy
I hadn't thought of using else if. :P
Though, shouldn't you remove that ! now?
In response to Naokohiro
Yea, I should, and have. A small oversight.
In response to Naokohiro
Okay, now I'm pretty much confused... you guys were arguing in the thread at what did what... and I'm just left very VERY confused with some code that doesn't work properly...

HELP!
In response to Alaris123
Alaris123 wrote:
Okay, now I'm pretty much confused... you guys were arguing in the thread at what did what... and I'm just left very VERY confused with some code that doesn't work properly...

HELP!

This?
In response to Alaris123
Seriously, you guys claim you're supposedly fixing it, and I'm left confused and without a fix. Any help?
In response to Alaris123
Seriously, we've no obligation to help you. In case you're not aware, all help is given voluntarily, and you should be grateful for it. At any case, be patient, don't bump up your topic in the same day, wait at least 24 hours since the last reply AND until your topic is off the first page of the forum. Otherwise, there's no point in it and it's simply spam.
In response to Alaris123
We already gave you a fix. Read the DM Guide or some other guide if you can't understand our code.
Page: 1 2 3