ID:157145
 
I am having a little trouble with getting blood to spray from a mob when I click on them.

I used the click() proc and it all works fine but how do you make the blood appear ontop of the mob. (<< confusing)


do i use flick cos i used:
flick("blood",src) << mob turns into blood then back again
flick("blood",src.loc) << the turf below the mob flickers black
flick("blood",src.overlays) << nothing happens

but I want blood as if it was an overlay and it was as if it was done using flick

Note: I understand how flick works so don't comment telling me that i should learn the basics for i was just trying different things.

I have a feeling that the answer is really simple and is probably just hidden in the back of my head
Create an object where the person is and have it as a higher layer than the mob. Under its New(), make it:
- Show the flicking of the blood
- After the flick is done, change the layer to be lower than the mob and make a puddle of blood remain (... or simply cause it to delete itself)
In response to GhostAnime
GhostAnime wrote:
Create an object where the person is and have it as a higher layer than the mob. Under its New(), make it:
- Show the flicking of the blood
- After the flick is done, change the layer to be lower than the mob and make a puddle of blood remain (... or simply cause it to delete itself)

I understand but still not sure how to use New()
is it just:

new/obj/blood(src.loc) //sorry I have barely any idea.

I made an obj whose icon state is an animation of blood splattering and set it's layer to:
MOB_LAYER + 1
just not sure how to make it flick in the New() proc
In response to Lusodante
Lusodante wrote:
I understand but still not sure how to use New()

just not sure how to make it flick in the New() proc

You can always press F1 in DreamMaker (Windows) or visit the Reference Guide.
Then look up New() and flick(), it'll give you an example (most of the time) and the general ideal behind it.
In response to Dark Vendetta
yeah I did but....
where do I fit flick in the New() proc
In response to Lusodante
Say your blood is obj/Blood

obj
Blood
icon = 'Blood.dmi'
layer = MOB_LAYER+1
New()
..()
src.icon_state = "puddle"
flick("Blood Spray",src) // Be sure to have the icon_state to loop once, although, i'm not sure if it'll work either way.
src.icon_state = "puddle" // This MAY be unneeded
src.layer = MOB_LAYER-1


When you want blood to appear
just do
var/obj/Blood/o = new(mob.loc) // Mob is the person blood appears on!

In response to Asellia
I had to make a few minor changes but worked PERFECTLY. thankyou very much