I'm trying to get a blood spurt sfx to work, but while it does, color doesn't seem to work all of the time, resulting in NPCs spurting gray blood. It seems viewing it from certain angles will only allow you to see the red.
The script in question:
Params sent to it:
The script in question:
Code:
//statotionary, temporary sprite (why is there no function for this?)
//- remember to precache sprite
#scope client
{ client_activate //<owner index> <sprite_name> <render_props> <duration> <model height> <model width>
//render props format: fadeout:0|1;scale;renderamt;rendermode;rendercolor;framerate;frames
setvard SFX_OWNER PARAM1
setvard SPRITE_NAME PARAM2
setvard RENDER_PROPS PARAM3
setvard SPRITE_DURATION PARAM4
setvard MODEL_HEIGHT PARAM5
setvard MODEL_WIDTH PARAM6
setvard ANG_OFFSET $rand(-100,100)
callevent 0.1 spurt_blood
callevent SPRITE_DURATION remove_me
}
{ spurt_blood
local L_POS $getcl(SFX_OWNER,origin)
vectoradd L_POS $vec(0,0,$math(multiply,0.6,MODEL_HEIGHT))
cleffect tempent sprite SPRITE_NAME L_POS setup_temp_sprite redo_color
callevent 0.1 spurt_blood
}
{ setup_temp_sprite
local L_VEL $relvel($vec(0,$math(add,ANG_OFFSET,$getcl(SFX_OWNER,angles.yaw)),0),$vec(0,$math(add,MODEL_WIDTH,30),20))
cleffect tempent set_current_prop death_delay 1
if ( $get_token(RENDER_PROPS,0) == 1 ) cleffect tempent set_current_prop fadeout lifetime
cleffect tempent set_current_prop scale $get_token(RENDER_PROPS,1)
cleffect tempent set_current_prop renderamt $get_token(RENDER_PROPS,2)
cleffect tempent set_current_prop rendermode $get_token(RENDER_PROPS,3)
cleffect tempent set_current_prop rendercolor $get_token(RENDER_PROPS,4)
cleffect tempent set_current_prop framerate $get_token(RENDER_PROPS,5)
cleffect tempent set_current_prop frames $get_token(RENDER_PROPS,6)
cleffect tempent set_current_prop velocity L_VEL
cleffect tempent set_current_prop gravity 0.3
cleffect tempent set_current_prop collide none
cleffect tempent set_current_prop update 1
}
{ redo_color
cleffect tempent set_current_prop rendercolor $get_token(RENDER_PROPS,4)
}
{ remove_me
removescript
}
Params sent to it:
Code:
local L_RENDER_PROPS "0;0.15;255;color;"
stradd L_RENDER_PROPS $clcol(255,0,0)
stradd L_RENDER_PROPS ";10;10"
clientevent new all effects/sfx_bleed $get(PARAM1,index) bloodspray.spr L_RENDER_PROPS 10 $get(PARAM1,height) $get(PARAM1,width)