Page 1 of 1

HL2DM Spawn effect

Posted: Sat Dec 26, 2020 9:24 pm
by daren adler
Was wondering if i can get one of you great scripters :smile: to make me a spawn effect like this https://steamcommunity.com/sharedfiles/ ... dsuccess=1 picture but with diffrent colors (red,blue,green) everytime you respawn,,thank you and have a great new year coming up. :cool: :cool:

Re: HL2DM Spawn effect

Posted: Sat Dec 26, 2020 10:05 pm
by Kami
Should the colors be inside of one spawn effect or should you have a random chance to either get a red or a blue or a green spawn effect? Or is it ment for team play, where every team gets a different color?

Re: HL2DM Spawn effect

Posted: Sat Dec 26, 2020 10:17 pm
by daren adler
Kami wrote:Should the colors be inside of one spawn effect or should you have a random chance to either get a red or a blue or a green spawn effect? Or is it ment for team play, where every team gets a different color?

Be ok if you can do all 3 kinds in one,,if not do what you think is best, and no its not a team. (the random sounds good)

Re: HL2DM Spawn effect

Posted: Sat Dec 26, 2020 10:29 pm
by Kami
Mhmm, how about random colors all together? Like every spawn you can get one random color for your spawn effect. Or are you set on the three colors?

Re: HL2DM Spawn effect

Posted: Sat Dec 26, 2020 10:39 pm
by daren adler
Kami wrote:Mhmm, how about random colors all together? Like every spawn you can get one random color for your spawn effect. Or are you set on the three colors?
Sounds great :smile: if you can do that , yes random colors

Re: HL2DM Spawn effect

Posted: Sat Dec 26, 2020 10:54 pm
by Kami
Try this:

Syntax: Select all

from colors import GREEN
from effects.base import TempEntity
from engines.precache import Model
from events import Event
from mathlib import Vector
from players.entity import Player
import random

model = Model("sprites/lgtning.vmt")

@Event('player_spawn')
def _player_spawn(ev):
player = Player.from_userid(ev['userid'])
x = 0
r = random.randrange(0, 255)
g = random.randrange(0, 255)
b = random.randrange(0, 255)
while x < 70:
create_ring(Vector(player.origin[0],player.origin[1],player.origin[2]+x),r,g,b)
x += 10


def create_ring(position,r,g,b):
te = TempEntity('BeamRingPoint')
te.model = model
te.halo = model
te.center = position
te.start_radius = 40
te.end_radius = 60
te.frame_rate = 100
te.life_time = 1
te.start_width = 10
te.end_width = 60
te.fade_length = 6
te.amplitude = 10
te.red = r
te.green = g
te.blue = b
te.alpha = 255
te.speed = 100
te.create()



You can change the model to whatever you like, but I kinda like the lgtning sprite.

Things you can play around with to change the appearance:

Syntax: Select all

te.start_width = 10 
This will change the size of the sprite. The lower you set this the more it looks like a lightning. The higher you set it the less you see a gap between the rings. Setting it too high will make it look like a blob, instead of rings.


Syntax: Select all

te.amplitude = 10
This will set how flat each ring is. The higher you set it the more fluctuation you get.


Syntax: Select all

te.start_radius = 40
te.end_radius = 60
The more the end_radius differs from the start_radius the faster it goes (it will go from start to end in its life time, so it has to cover more distance if the distance is higher)



You can also try the x/killstreak sprites you have. smokeball2 and smoke create some cool effects too.

Re: HL2DM Spawn effect

Posted: Sat Dec 26, 2020 10:59 pm
by daren adler
:smile: Will do, thank you for all your good work. :cool: :cool: What can i do to make the spawn effect last a little longer before its gone away?

Re: HL2DM Spawn effect

Posted: Sun Dec 27, 2020 12:38 am
by Kami

Syntax: Select all

te.life_time = 1


This sets how long it lasts in seconds.

Re: HL2DM Spawn effect

Posted: Sun Dec 27, 2020 12:53 am
by daren adler
Kami wrote:

Syntax: Select all

te.life_time = 1


This sets how long it lasts in seconds.


ok got it, Thank you. :cool: