ID:161848
 
How would i set a movment delay when someone walks in, so when they get on roler blades, a bike or in a car its faster?

would it be like
mob
login
set_movmentdelay = 1.5


then

obj
bike
verb
get_on
switch (usr.icon = "bike.dmi)
set_movmentdelay = 0
get_off
switch (usr.icon = "base.dmi")
set_movmentdelay = 1.5
That would work, but it would be better to do something like
mob/var/set_movementdelay=1.5

since if a mob logs in on a bike, they wont slow down. Remember you also need a proc for the movement delay.
In response to Demon_F0rce
ty
In response to RanEsu
Actually, i know where to put it now, i just need to know what code i would put in to make someone move slower... :(
In response to RanEsu
RanEsu wrote:
Actually, i know where to put it now, i just need to know what code i would put in to make someone move slower... :(

spawn a proc that sleeps for a few ticks before setting an allow movement variable back to true.
In response to Obs
what would that code be? sleep wouldent work, so idk how to do it :(
In response to RanEsu
mob/var/tmp/moving
mob/var/delay=5 //or whatever
mob/Move()
if(!moving)
moving=1
..()
spawn(delay) moving=0
In response to Dragonn
Dragonn wrote:
mob/var/tmp/moving
> mob/var/delay=5
> mob/Move()
> if(!moving)
> moving=1
> ..()
> spawn(delay) moving=0



Thanks, it works exeactly how i want it to, but what would i put on this to make it go faster?
obj
AT's
name = "Air Trecks"
icon = 'Ats.dmi'
worn = 0
verb
Wear()//you wear the shirt
if(src.worn == 1)
src:worn = 0
usr.overlays -= 'Ats.dmi'
usr << "You remove the [src.name]."
else
src:worn = 1
usr.overlays += 'Ats.dmi'
usr << "You wear the [src.name]."
delay=1
Look()// just a look verb
usr<<"These are Air Trecks!"
Drop()
if(src:worn == 1)
usr << "Not while its being worn."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y,usr.z)
Get() from the ground
set src in oview(1)
src.loc = usr
usr<<"You picked up a [src]"
In response to RanEsu
It should work perfectly. Just add that as a new thing (code provided by Dragonn) altogether.
In response to Demon_F0rce
tnks but i ended up just doin somthin like this (im @ a different comp. so im re-writeing it, bleh :< )
mob/var/tmp/moving
mob/var/delay=5
mob/Move()
if(!moving)
moving=1
..()
spawn(delay) moving=0
if(src.ats==1)
delay = 2.5


obj
ATS
name = "Air Trecks"
icon = 'Ats.dmi'
worn = 0
mob/var/ats=0
verb
Wear()//you wear the shirt
if(src.worn == 1)
src:worn = 0
usr.overlays -= 'Ats.dmi'
usr << "You remove the [src.name]."
ats = 0
else
src:worn = 1
usr.overlays += 'Ats.dmi'
usr << "You wear the [src.name]."
ats = 1
Look()// just a look verb
usr<<"These are Air Trecks!"
Drop()
if(src:worn == 1)
usr << "Not while its being worn."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y,usr.z)
Get() from the ground
set src in oview(1)
src.loc = usr
usr<<"You picked up a [src]"