TempEntites.beam_points() crashs my game

Please post any questions about developing your plugin here. Please use the search function before posting!
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

TempEntites.beam_points() crashs my game

Postby stonedegg » Wed Sep 10, 2014 8:38 pm

Syntax: Select all

from engines.server import EngineServer
from effects import TempEntities
from filters.players import index from userid
from filters.recipients import RecipientFilter
from events import Event
from mathlib import Vector

model_index = EngineServer.precache_decal("sprites/laserbeam.vmt")
halo_index = EngineServer.precache_decal("sprites/halo.vmt")

@Event
def player_say(game_event):
userid = game_event.get_int('userid')
index = index_from_userid(userid)

"""
void TE_BeamPoints( IRecipientFilter& filter, float delay,
const Vector* start, const Vector* end, int modelindex, int haloindex, int startframe, int framerate,
float life, float width, float endWidth, int fadeLength, float amplitude,
int r, int g, int b, int a, int speed );
"""

TempEntities.beam_points(RecipientFilter(index), 0, Vector(100, 100, 100), Vector(200, 200, 200), model_index, halo_index, 1, 1,
5, 5, 5, 0, 0, 255, 0, 0, 255, 0)


Am I doing something wrong, or why does this crash my game (not server) as soon as I say something in chat?


EDIT: I had to precache_model, not precache_decal :D It's working now!
Hedgehog
Member
Posts: 62
Joined: Sun Nov 03, 2013 8:54 pm

Postby Hedgehog » Thu Sep 11, 2014 4:31 am

Try to setup haloindex to 0, worked for me (CS:S, haven't tried on CS:GO).

Also, why you are setting startframe to 1? Effect start from 0 frame...
User avatar
satoon101
Project Leader
Posts: 2703
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Thu Sep 11, 2014 4:41 am

If you notice his edit, he did get it working. He had precache_decal instead of precache_model.

A couple notes, though. I'm sure you wrote this all out instead of copy/paste from an actual script (line 3 gives that away for multiple reasons). However, I feel I should let you know that the current release includes all the name changes I mentioned in another thread. So, you will need to make the appropriate changes to the following 2 objects:

Syntax: Select all

from engines.server import EngineServer
from effects import TempEntities

# Are now
from engines.server import engine_server
from effects import temp_entities
Image
stonedegg
Senior Member
Posts: 141
Joined: Sun Aug 12, 2012 11:45 am

Postby stonedegg » Thu Sep 11, 2014 1:43 pm

Well, I copy/pasted the related lines out of my script, no idea how line 3 happened.
And I forgot to update the libraries, that's why I used that.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 129 guests