Beam Effects

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Painkiller
Senior Member
Posts: 490
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: 490
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 ?

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 6 guests