This is a snippet from the movement code i use. It works so that if the user is in the field (defined by the var "speed") then it waits 4 seconds before it will allow you to move. at least thats what im hoping its doing XD.
(walking var to stop player holding in the arrow keys defeating the purpose of waiting)
North()
if(usr.stunned>=1)
return
if(usr.walking==1)
return
if(usr.speed==1)
usr.walking=1
spawn(40)
usr.walking=0
if(cont) step(cont,NORTH)
else..()
And this is the actual field. It works as if you enter it your "speed" var =1, therefor in the movement code, you wait 4 seconds before each step. The "Speed" var with a capital S is in my projectile code and has nothing to do with the movement code. (I know it might get confusing lol)
dialationfield
icon='field.dmi'
layer=98
Entered(mob/m)
m.speed=1
return
Entered(obj/Bullet/b)
b.Speed = 6
return
Problem description:
Ive been trying to do this for days now. I want it to so if someone fires a gun and its bullet enters the field, the bullet slows down.
Also i want it to if a person enters the field, the person slows down.
Now, i have changed the field code over and over and over, from fors to ifs to enters absolutely everywhere, trying to get it to work. The closest ive gotten is having the bullets slow down but not any mobs.
when i tryed using...
dialationfield
icon='field.dmi'
layer=98
Entered(atom/moveable)
for(var/mob/m)
m.speed=1
for(var/obj/Bullet/b)
b.speed=6
(or something along those lines, it was a few days ago.) I get runtime errors. i tweaked it a bit and any time a bullet would enter, the mob would slow down to, even if the mob didnt enter the field.
Anyhoo, any help whatso ever would be appreciated.
=P