Beam Effects

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Beam Effects

Postby Painkiller » Fri Sep 13, 2019 2:24 pm

The test in my script unfortunately doesn't look like the original in event scripts.

Could someone help me with the customization please?

(it is only a part of a larger script)


This is the original code from Eventsripts:

Syntax: Select all

# dessine un beam
def beamEffect(self, userid, radius, c1, loop = 0):
if loop >= 10: return
x,y,z = es.getplayerlocation(userid)
effectlib.drawCircle( (x,y,z + 15),
radius, steps = 10,
width = 5, endwidth = 5,
seconds = .1,
red = c1[0], green = c1[1], blue = c1[2],
model = "sprites/laserbeam.vmt",
halo = "sprites/laserbeam.vmt")

radius += 13
loop += 1
gamethread.delayed(.05, self.beamEffect, (userid, radius, c1, loop))



Test Script:

Syntax: Select all

def blitz(index):
player = playerinfo_from_index(index)
vec1 = player.origin
vec2 = player.origin
vec1.z += 500
vec2.z += 5
functions.emitsound(index, 'npc/strider/fire.wav', 1.0, 0.6)

blitz_model_index = engine_server.precache_model('sprites/laserbeam.vmt')
blitz_halo_index = engine_server.precache_model('sprites/laserbeam.vmt')

for player in PlayerIter('human'):
index = player.index
steamid = player.steamid
if steamid not in settings or settings[steamid]['effects'] == 1:
#TempEntity('BeamPoints', (0, vec2, vec1, blitz_model_index, blitz_halo_index, 0, 1, 1, 3, 3, 3, 100, 113, 208, 255, 255, 0)).create()
eff = TempEntity('BeamPoints')
eff.alpha = 255
eff.blue = 255
eff.green = 208
eff.red = 113
eff.start_point = vec1
eff.amplitude = 3
eff.end_with = 3
eff.start_width = 3
eff.life_time = 3
eff.speed = 1
eff.end_point = vec2
eff.halo_index = blitz_halo_index
eff.model_index = blitz_model_index
eff.frame_rate = 1
eff.create()
sparks(index, player, vec2)
Delay(0.1, sparks, (index, player, vec2))
Delay(0.2, sparks, (index, player, vec2))
Delay(0.3, sparks, (index, player, vec2))
Delay(0.4, sparks, (index, player, vec2))
Delay(0.5, sparks, (index, player, vec2))
Delay(0.6, sparks, (index, player, vec2))
Delay(0.7, sparks, (index, player, vec2))
Delay(0.8, sparks, (index, player, vec2))
Delay(0.9, sparks, (index, player, vec2))
Delay(1.0, sparks, (index, player, vec2))



Thanks in Advance
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: Beam Effects

Postby Painkiller » Wed Sep 18, 2019 11:31 am

Nobody can help ?
InvisibleSoldiers
Senior Member
Posts: 114
Joined: Fri Mar 15, 2019 6:08 am

Re: Beam Effects

Postby InvisibleSoldiers » Sat Dec 28, 2019 3:39 pm

Noticed that the TempEntity.create takes a delay before creating the effect and maybe you can simply do this and behavior will be different:

Syntax: Select all

sparks = TempEntity('BeamPoints')
sparks.alpha = 255
sparks.blue = 255
sparks.green = 208
sparks.red = 113
#...
for i in range(1, 11):
sparks.create(delay=0.1 * i)

I don't know what exactly inside sparks function, but if there the same BeamPoints, probably it will work.
http://wiki.sourcepython.com/developing ... ity.create
Also you pass the same reference to Vector origin, but maybe it's value changes in 0.1 0.2, etc
I really don't know what you wanted to do and you didn't say what to expect and what you got.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 43 guests