ID:150293
 
Anyways...

obj/Web
icon = 'Effects.dmi'
icon_state = "web"
density = 1
var/mob/O
Bump(O)
if(istype(O,/mob))
O.locked = 1
sleep(50)
O.locked = 0


I keep on bettering O.locked as a bad var.
This is a web that flies though the air (that part works)
and when it bumps into you, you get stuck temporarily (that works, I found that out when using "usr" instead of "O" and it locked me in place)
Hmm... I don't have a complete answer for you...

but try this:

obj/Web
icon = 'Effects.dmi'
icon_state = "web"
density = 1
Bump(mob/O)
if(ismob(O))
O.locked = 1
sleep(50)
O.locked = 0
mob
var/locked
In response to Lord of Water
Thanks, the problem must have been in my Bump() code.

Thanks Again,
-Sariat
Hi, Sariat! (couldn't resist)

  var/mob/O
Bump(O)
if(istype(O,/mob))
O.locked = 1
sleep(50)
O.locked = 0

Two problems: First, you're defining O as a variable in obj/Web, but the O in the Bump() proc is local to that proc and doesn't have a type. Since O has no type, that leads to the second problem:

Bump(O)
if(istype(O,/mob))
<FONT COLOR=#FF0000>var/mob/M=O</FONT>
<FONT COLOR=#FF0000>M</FONT>.locked = 1
sleep(50)
<FONT COLOR=#FF0000>M</FONT>.locked = 0


"locked" is a bad var because the compiler doesn't know in advance that O is type /mob. Rewriting Bump(O) as Bump(mob/O) will help that, but it will restrict Bump() so it only works with mobs, which I don't think you want.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Hi, Sariat! (couldn't resist)

  var/mob/O
> Bump(O)
> if(istype(O,/mob))
> O.locked = 1
> sleep(50)
> O.locked = 0

Two problems: First, you're defining O as a variable in obj/Web, but the O in the Bump() proc is local to that proc and doesn't have a type. Since O has no type, that leads to the second problem:

Bump(O)
if(istype(O,/mob))
<FONT COLOR=#FF0000>var/mob/M=O</FONT>
<FONT COLOR=#FF0000>M</FONT>.locked = 1
sleep(50)
<FONT COLOR=#FF0000>M</FONT>.locked = 0


"locked" is a bad var because the compiler doesn't know in advance that O is type /mob. Rewriting Bump(O) as Bump(mob/O) will help that, but it will restrict Bump() so it only works with mobs, which I don't think you want.

Lummox JR (or "you", depending on who reads this) just explained elegantly the best way to avoid using the colon operator.