Page 1 of 1

[HL2:DM] player_death effect combine_ball

Posted: Sun Sep 23, 2018 12:00 pm
by Painkiller
Would someone be so good and could rewrite me this little script.
Maybe you can simplify it now, too.

Many Thanks


Syntax: Select all

event player_death
{
if (event_var(weapon) = combine_ball) do
{
es_give event_var(userid) env_Smokestack
es_fire event_var(userid) env_Smokestack addoutput "basespread 50"
es_fire event_var(userid) env_Smokestack addoutput "spreadspeed 5"
es_fire event_var(userid) env_Smokestack addoutput "speed 5"
es_fire event_var(userid) env_Smokestack addoutput "startsize 1"
es_fire event_var(userid) env_Smokestack addoutput "endsize 3"
es_fire event_var(userid) env_Smokestack addoutput "rate 0.5"
es_fire event_var(userid) env_Smokestack addoutput "jetlength 0.5"
es_fire event_var(userid) env_Smokestack addoutput "twist 0"
es_fire event_var(userid) env_Smokestack addoutput "SmokeMaterial effects/bluespark.vmt"
es_fire event_var(userid) env_Smokestack addoutput "rendercolor 255 255 255"
es_fire event_var(userid) env_Smokestack addoutput "angles 0 0 0"
es_fire event_var(userid) env_Smokestack turnon
es_delayed 20 es_fire event_var(userid) env_Smokestack kill
}
}

Re: [HL2:DM] WCS Effects

Posted: Fri Sep 28, 2018 11:23 am
by Painkiller
Please, can someone rewrite?

Re: [HL2:DM] player_death effect combine_ball

Posted: Mon Oct 08, 2018 3:42 am
by VinciT
Give this a shot:

Syntax: Select all

# ../death_effect/death_effect.py

# Source.Python
from colors import Color
from events import Event
from entities.entity import Entity
from players.dictionary import PlayerDictionary


EFFECT_ALPHA = 255
EFFECT_COLOR = Color(255, 255, 255)
EFFECT_LIFETIME = 20


player_instances = PlayerDictionary()


@Event('player_death')
def player_death(event):
if 'combine_ball' not in event['weapon']:
return

player = player_instances.from_userid(event['userid'])

create_smokestack(
position=player.origin,
start_size=1,
end_size=3,
initial_state=True,
base_spread=50,
twist=0,
roll=0,
smoke_material='effects/bluespark.vmt',
wind_angle=0,
wind_speed=0,
jet_length=0.5,
spread_speed=5,
speed=5,
rate=0.5,
color=EFFECT_COLOR,
lifetime=EFFECT_LIFETIME,
alpha=EFFECT_ALPHA
)


def create_smokestack(
position, start_size, end_size, initial_state, base_spread, twist,
roll, smoke_material, wind_angle, wind_speed, jet_length,
spread_speed, speed, rate, color, lifetime, alpha=255):
# More information about the 'env_smokestack' entity:
# https://developer.valvesoftware.com/wiki/Env_smokestack
smokestack = Entity.create('env_smokestack')
smokestack.origin = position
smokestack.start_size = start_size
smokestack.end_size = end_size
smokestack.initial_state = initial_state
smokestack.base_spread = base_spread
smokestack.spread_speed = spread_speed
smokestack.twist = twist
smokestack.roll = roll
smokestack.wind_angle = wind_angle
smokestack.wind_speed = wind_speed
smokestack.rate = rate
smokestack.jet_length = jet_length
smokestack.speed = speed
smokestack.render_color = color
smokestack.set_key_value_string('SmokeMaterial', smoke_material)
smokestack.spawn()

# Is the lifetime set?
if lifetime > 0:
# Turn off the 'env_smokestack' before removing it.
smokestack.delay(lifetime, smokestack.call_input, ('TurnOff',))
# Remove the 'env_smokestack' after all the sprites fade out.
smokestack.delay(lifetime + jet_length / speed, smokestack.remove)

return smokestack
Using the values from your script, the effect is very hard to see. I suggest setting rate to a higher value (at least 30).

Re: [HL2:DM] player_death effect combine_ball

Posted: Tue Oct 09, 2018 8:30 pm
by Painkiller
Work good thanks mate.