Since the start_radius and end_radius arguments are floats, you can actually set them even closer than 1 apart. You cannot set them equal to each other, as that will cause the effect to not show at all. And, while it might be true that the 'life' argument causes the ring to expand/contract slower, its main purpose is the amount of time the effect is shown. I have tested setting the life to 5.0 and then testing with life set to 20.0, and both times, the effect was shown for exactly that number of seconds.
Here is my test code:
Syntax: Select all
from colors import BLUE
from colors import RED
from effects import temp_entities
from engines.precache import Model
from events import Event
from filters.players import PlayerIter
from filters.recipients import RecipientFilter
from mathlib import Vector
from players.entity import PlayerEntity
from players.helpers import index_from_userid
colors = {
2: RED,
3: BLUE,
}
"""
Arguments
"""
# filter (RecipientFilter) - handled in function
# delay (float)
delay = 0.0
# center (Vector) - handled in function
# start_radius (float)
start_radius = 50.1
# end_radius (float)
end_radius = 50.0
# model_index and halo_index - handled in function
model = Model('sprites/laserbeam.vmt')
# startframe (int)
startframe = 255
# framerate (int)
framerate = 255
# life (float)
life = 20.0
# width (float)
width = 1.0
# spread (int)
spread = 1
# amplitude (float)
amplitude = 1.0
# red, green, blue, alpha - handled in function
# speed (int)
speed = 1
# flags (int)
flags = 0
"""
End of arguments
"""
@Event
def player_say(game_event):
player = PlayerEntity(index_from_userid(game_event.get_int('userid')))
other = player.get_view_player()
if other is None:
print('No player')
return
if other.team not in colors:
print('Not on team')
return
color = colors[other.team]
temp_entities.beam_ring_point(
RecipientFilter(player.index), delay,
other.origin + Vector(0.0, 0.0, 20.0),
start_radius, end_radius, model.index, model.index,
startframe, framerate, life, width, spread, amplitude,
color.r, color.g, color.b, color.a, speed, flags)
@Event
def round_freeze_end(game_event):
for player in PlayerIter('bot', return_types='player'):
player.freeze = True