Page 1 of 1

Effects Box

Posted: Sun Jul 03, 2016 9:55 am
by decompile
Hey,

I was always using the normal way to draw boxes with effects.box,
but now im getting some weird errors which says "Only 3 keywords are avaible, 18 were given"

Re: Effects Box

Posted: Sun Jul 03, 2016 10:21 am
by Ayuto
Might want to provide the full traceback and code to reproduce the issue? Note that the effects package has been updated (see also: Development status update (June 2016). It now requires you to specify the keywords of the temporary entity "BeamPoints".

Re: Effects Box

Posted: Sun Jul 03, 2016 10:41 am
by decompile

Code: Select all

    box(RecipientFilter(), 10, self.coord1, self.coord2, beam_model.index, beam_model.index, 0, 255, 5, 1, 1, 3, 0, r, g, b, 255, 1)

TypeError: box() takes 3 positional arguments but 18 were given


Re: Effects Box

Posted: Sun Jul 03, 2016 10:51 am
by Ayuto
Well, that's not the full traceback, but like I said you need to specify the keywords for the temporary entity BeamPoints.

Example:

Syntax: Select all

from effects import box
from filters.recipients import RecipientFilter
from engines.precache import Model
from events import Event
from players.entity import Player

model = Model('sprites/laser.vmt')

@Event('player_say')
def player_say(event):
player = Player.from_userid(event['userid'])
box(
RecipientFilter(),
player.origin,
player.view_coordinates,
alpha=255,
blue=0,
green=0,
red=255,
amplitude=0,
end_width=1,
life_time=7,
start_width=1,
fade_length=0,
flags=0,
frame_rate=255,
halo=model,
model=model,
start_frame=0
)