ID:147973
 
I am trying to make an object go 3 from the usr in his/her direction and then turn into a flick of a movie icon

mob/proc/portal()
var
targetloc
obj/energy/E = new /obj/energy
src.locked = 1
step(E,usr.dir)
sleep(1)
step(E,usr.dir)
sleep(1)
step(E,usr.dir)
targetloc = E.loc
del(E)
flick(/obj/overlay/portaleffect,targetloc)
src.locked = 0
Not helpful, Garthor.

A few things to fix here, Xallius. Firstly, you haven't actually put the /obj/energy object anywhere. That helps. =P

You also don't need to repeat the type path, in this case. So you can leave out the second /obj/energy on that line. The var declaration bit then looks like this:

<code> var targetloc obj/energy/E = new(src.loc)</code>

Secondly, you have "usr" scattered all over that proc. It's fine to use usr in verbs, but it's usually out of place in procs. In this case, "src" would work better; so change all those "usr"s to "src"s.

Thirdly, flick() doesn't work like that. You have to use an icon. For example:

<code>flick('portaleffect.dmi',targetloc)</code>