ID:141170
 
Code:
obj
LightningStr
New()
flick("lightining[src.icon_state]",src)
src.pixel_x=rand(-64,64)
src.pixel_y=rand(-64,64)
sleep(10)
del src

mob/verb/Lightning()
usr.overlays+=new/obj/LightningStr



Problem description:

Wont Display the lightning striking down
That's flicking an icon state, do you want the lightning to be a overlay?
In response to Scizzes
Scizzes wrote:
That's flicking an icon state, do you want the lightning to be a overlay?

its supposed to be an overlay that isnt set ontop of the user..so i use pixels to randomly place it around the player..as for the flick thats the iconstate i want it to show when it is summoned
In response to Galacticus
Galacticus wrote:
Scizzes wrote:
That's flicking an icon state, do you want the lightning to be a overlay?

its supposed to be an overlay that isnt set ontop of the user..so i use pixels to randomly place it around the player..as for the flick thats the iconstate i want it to show when it is summoned

Well, I made a little demo for you let me add a few things and I will upload it for you.
In response to Scizzes
Scizzes wrote:
Galacticus wrote:
Scizzes wrote:
That's flicking an icon state, do you want the lightning to be a overlay?

its supposed to be an overlay that isnt set ontop of the user..so i use pixels to randomly place it around the player..as for the flick thats the iconstate i want it to show when it is summoned

Well, I made a little demo for you let me add a few things and I will upload it for you.

thnxs
In response to Galacticus
http://www.mediafire.com/?sharekey=69f89a3e8090ce36d2db6fb9a 8902bda

7.6 KB you need winrar to open it. If that's what you wanted, your welcome.

Edit: Move into the center of the map to see the lightning better.
That should be more like this in order to work properly, I doubt overlays were made to specifically support flicking which is just for animations (nothing overlay-related):
obj
LightningStr
icon = 'icon you want'
New()
src.icon_state = "dynamic state you want"
src.pixel_x=rand(-64,64)
src.pixel_y=rand(-64,64)

mob/proc/Lightning()
var/obj/LightningStr/O = new()
src.overlays += O
spawn(10)
src.overlays -= O //remove the overlay with the object used to add it
//after this point, the obj should be automatically \
deleted by the garbage collector, we don't need to do anything

Note that deleting an object doesn't cause any overlays to be removed. When you add anything to overlays, its appearance is used to create an internally-formatted copy, or 'snapshot'; it's not the actual obj you've added that ends up in overlays. This means changing the obj afterward doesn't affect the overlay. You must remove the same appearance from the overlays list to remove the overlay (or remove it from that list in another way).
In response to Kaioken
thnxs very helpfull