[HL2:DM] Crossbow

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [HL2:DM] Crossbow

Postby VinciT » Wed May 13, 2020 6:32 pm

daren adler wrote:This is a great plugin if you could get it to stop crashing, It dont show in logs or sourcepython logs any errors, it just crashes about every 5 mins or so,,without log errors,i cant figer out why it crashes,sure hope you can fix it,,from what ive read,,u seem real good at this,,:)
I tried running the same code with L'In20Cible's cached_property branch, and I didn't get any crashes. Give that a shot and tell me if it works for you as well.
ImageImageImageImageImage
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Wed May 13, 2020 7:42 pm

what is cached_property branch and do i have to add somthing?
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Crossbow

Postby Painkiller » Wed May 13, 2020 7:52 pm

The bots are outdated and basically completely broken. http://www.hurrikhan.eu/
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [HL2:DM] Crossbow

Postby VinciT » Wed May 13, 2020 8:01 pm

daren adler wrote:what is cached_property branch and do i have to add somthing?
At the bottom of the first post here, you'll find a link for Source.Python builds based on the previously mentioned cached_property branch.
Download the hl2dm.zip and update your SP installation manually.

I just did another test to see if I could get the plugin to cause a crash, and nothing happened. I've been running around the map, picking up all the weapons, without any crashes. When I ran the same plugin on the main build of SP, the crash happened anywhere from the third to the fifteenth pickup.

Apologies for not making my point clear in the earlier post.
ImageImageImageImageImage
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Wed May 13, 2020 9:37 pm

VinciT wrote:
daren adler wrote:what is cached_property branch and do i have to add somthing?
At the bottom of the first post here, you'll find a link for Source.Python builds based on the previously mentioned cached_property branch.
Download the hl2dm.zip and update your SP installation manually.

I just did another test to see if I could get the plugin to cause a crash, and nothing happened. I've been running around the map, picking up all the weapons, without any crashes. When I ran the same plugin on the main build of SP, the crash happened anywhere from the third to the fifteenth pickup.

Apologies for not making my point clear in the earlier post.


Yes works great now. Thank you for all your help. :smile:
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Re: [HL2:DM] Crossbow

Postby arawra » Tue Sep 08, 2020 11:53 am

Hey, I'm trying to use your code in order to create a light effect. Unfortunately it looks like TempEntity can only spawn one at a time...?

Syntax: Select all

@Event('player_jump')
def jump(e):

for player in PlayerIter():
print("trying to create effects")
light = TempEntity('Dynamic Light')
light.origin = player.get_eye_location()
light.color = Color(255,0,0)
light.radius = 200
light.life_time = 3
# Strength of the glow.
light.exponent = 8
# By how much the radius is lowered each second.
light.decay = 150
# Send the TempEntity to everyone if 'recipients' weren't specified.
light.create(RecipientFilter())


Image
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [HL2:DM] Crossbow

Postby VinciT » Wed Sep 09, 2020 12:12 am

Yeah, sadly that is one of the limitations of that TempEntity. You could try using the light_dynamic entity instead.
ImageImageImageImageImage
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Crossbow

Postby Painkiller » Sat Dec 19, 2020 9:35 am

Hello Vincit,
i noticed an error in my logs.

Maybe it is not important but a clean log is always better.
Greeting Painkiller

Code: Select all

2020-12-19 06:19:39 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/listeners/tick.py", line 80, in _tick
    self.pop(0).execute()
  File "../addons/source-python/packages/source-python/listeners/tick.py", line 161, in execute
    return self.callback(*self.args, **self.kwargs)
  File "../addons/source-python/plugins/lights/lights.py", line 340, in on_actual_entity_spawned
    grenade_instances[base_entity.index].start_pulsing()
  File "../addons/source-python/packages/source-python/entities/dictionary.py", line 53, in __missing__
    instance = self._factory(index, *self._args, **self._kwargs)
  File "../addons/source-python/packages/source-python/entities/_base.py", line 132, in __call__
    obj = super().__call__(index)
  File "../addons/source-python/plugins/lights/lights.py", line 78, in __init__
    self.glow = BaseEntity(index_from_inthandle(self.main_glow))

OverflowError: can't convert negative value to unsigned int
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [HL2:DM] Crossbow

Postby VinciT » Sat Dec 19, 2020 10:32 pm

This should fix the error you received:

Syntax: Select all

# ../lights/lights.py

# Python
from random import choice
from colorsys import hsv_to_rgb

# Source.Python
from colors import Color
from effects.base import TempEntity
from effects.hooks import TempEntityPreHook
from engines.precache import Model
from entities.constants import EntityEffects, RenderMode, RenderEffects
from entities.entity import Entity
from entities.helpers import index_from_pointer
from entities.hooks import EntityPreHook, EntityCondition
from filters.entities import BaseEntityIter
from filters.recipients import RecipientFilter
from filters.weapons import WeaponClassIter
from listeners import OnEntityOutput, OnNetworkedEntitySpawned, OnEntityDeleted
from mathlib import QAngle
from stringtables import string_tables


class ColorEx(Color):
"""Extended Color class."""

def __init__(self, r, g, b, a=255):
"""Initializes the object."""
super().__init__(r, g, b, a)

raw = r + (g << 8) + (b << 16) + (a << 24)
self.raw = raw - 2**32 if raw >= 2**31 else raw


# Colors used when the 'prop_combine_ball' bounces and explodes.
COLOR_BALL_BOUNCE = Color(0, 191, 255)
COLOR_BALL_EXPLODE = Color(170, 0, 255)
# Color used when the 'crossbow_bolt' bounces.
COLOR_BOLT_BOUNCE = Color(255, 88, 0)
# Colors used when the 'npc_grenade_frag' pulses and explodes.
COLOR_FRAG_PULSE = ColorEx(0, 255, 88)
COLOR_FRAG_EXPLODE = ColorEx(0, 255, 88)
# Should the grenade color be random? (0 - no, 1 - yes)
COLOR_FRAG_RANDOM = 1
# Default color used for weapons.
COLOR_WEAPON_DEFAULT = Color(255, 25, 0)


# How wide should the 'point_spotlight' beam be?
SPOTLIGHT_DEFAULT_WIDTH = 20
# How tall should the 'point_spotlight' beam be?
SPOTLIGHT_DEFAULT_LENGTH = 300


item_colors = {
'item_battery': Color(255, 255, 25),
'item_healthkit': Color(25, 255, 55),
'item_healthvial': Color(25, 255, 55),
'weapon_default': COLOR_WEAPON_DEFAULT
}


spotlight_pairs = {}
# Angle to make the 'point_spotlight' point upwards.
SPOTLIGHT_ANGLE = QAngle(-90, 0, 0)


# Globalized instances of temporary entities.
light_bolt_bounce = TempEntity(
'Dynamic Light', radius=200, decay=175, life_time=3, exponent=8,
color=COLOR_BOLT_BOUNCE)

light_ball_bounce = TempEntity(
'Dynamic Light', radius=200, decay=150, life_time=3, exponent=8,
color=COLOR_BALL_BOUNCE)
light_ball_explode = TempEntity(
'Dynamic Light', radius=600, decay=600, life_time=1, exponent=8,
color=COLOR_BALL_EXPLODE)

light_frag_pulse = TempEntity(
'Dynamic Light', radius=200, decay=280, life_time=0.6, exponent=8,
color=COLOR_FRAG_PULSE)
light_frag_explode = TempEntity(
'Dynamic Light', radius=400, decay=560, life_time=0.6, exponent=8,
color=COLOR_FRAG_EXPLODE)


class Grenade(Entity):
"""Extended Entity class."""

glow_replacement = Model('sprites/physcannon_blueglow.vmt')

def __init__(self, index, caching=True):
"""Initializes the object."""
super().__init__(index, caching)
self.change_trail_color(COLOR_FRAG_PULSE)

def start_pulsing(self):
"""Starts looping the `self.pulse()` function."""
self.repeat(self.pulse).start(interval=0.75)

def pulse(self):
"""Creates a dynamic light effect at the current origin."""
# Should the color be random?
if COLOR_FRAG_RANDOM:
color = choice(grenade_colors)
# Change the color of the glow and trail.
self.change_trail_color(color)
# Change the color of the dynamic light effect.
light_frag_pulse.color = color

# Adjust the origin of the dynamic light effect and create it.
light_frag_pulse.origin = self.origin
light_frag_pulse.create(RecipientFilter())

def boom(self):
"""Creates a dynamic light effect upon detonation."""
if COLOR_FRAG_RANDOM:
light_frag_explode.color = choice(grenade_colors)

light_frag_explode.origin = self.origin
light_frag_explode.create(RecipientFilter())

def change_trail_color(self, color):
"""Changes the color of the parented sprite and spritetrail."""
try:
# Try to get the glow and trail parented to this grenade.
glow = Entity.from_inthandle(self.main_glow)
trail = Entity.from_inthandle(self.glow_trail)
except OverflowError:
# Invalid inthandle (-1).
return

# The default sprite ('sprites/redglow1.vmt') is almost always going to
# look red, so let's replace it.
glow.model = Grenade.glow_replacement
# Change the colors of the 'glow' and the 'trail'.
glow.set_network_property_int('m_clrRender', color.raw)
trail.set_network_property_int('m_clrRender', color.raw)


def get_pretty_colors(amount):
"""Returns a list of vibrant colors.

Args:
amount (int): How many colors should be generated?

Returns:
list of ColorEx: A list containing ColorEx instances.
"""
colors = []
step = 1 / amount

for hue in range(0, amount):
colors.append(
ColorEx(*(int(255 * x) for x in hsv_to_rgb(step * hue, 1, 1))))

return colors


# List of vibrant colors.
grenade_colors = get_pretty_colors(amount=25)


# =============================================================================
# >> PLUGIN LOADING AND UNLOADING
# =============================================================================
def load():
"""Called when the plugin is loaded."""
# In case of a late plugin load, find the entities that need spotlights.
for base_entity in BaseEntityIter(
{weapon.name for weapon in WeaponClassIter()}.union(
item_colors.keys())):

# Avoid weapons equipped by players.
if base_entity.owner_handle != -1:
continue

# Avoid disabled weapons.
if base_entity.effects & EntityEffects.NODRAW:
continue

create_item_spotlight(
base_entity.classname, base_entity.index, base_entity.origin)


def unload():
"""Called when the plugin is unloaded."""
# Go through all the 'point_spotlight' entities and remove them.
for spotlight in spotlight_pairs.values():
spotlight.remove()


# =============================================================================
# >> DYNAMIC_LIGHT: crossbow_bolt, prop_combine_ball, npc_grenade_frag
# =============================================================================
@EntityPreHook(
EntityCondition.equals_entity_classname('npc_grenade_frag'), 'detonate')
def detonate_pre(stack_data):
"""Called when an 'npc_grenade_frag' is about to explode."""
try:
grenade = Grenade.cache[index_from_pointer(stack_data[0])]
except KeyError:
return

grenade.boom()


@TempEntityPreHook('EffectDispatch')
def effect_dispatch_pre(temp_entity, recipient_filter):
# Get the name of the effect.
effect_name = string_tables.EffectDispatch[temp_entity.effect_name_index]

# Did the 'prop_combine_ball' bounce?
if 'cball_bounce' in effect_name:
light_ball_bounce.origin = temp_entity.origin
# Delay the effect by a single frame, otherwise the server will crash!
temp_entity.entity.delay(
0, light_ball_bounce.create, (RecipientFilter(),))

# Or did it explode?
elif 'cball_explode' in effect_name:
light_ball_explode.origin = temp_entity.origin
temp_entity.entity.delay(
0, light_ball_explode.create, (RecipientFilter(),))


@EntityPreHook(
EntityCondition.equals_entity_classname('crossbow_bolt'), 'start_touch')
def bolt_touch_pre(stack_data):
entity = Entity._obj(stack_data[0])

# Is this a bolt?
if 'crossbow_bolt' in entity.classname:
light_bolt_bounce.origin = entity.origin
light_bolt_bounce.create(RecipientFilter())

# Try not to freeze the server. (thank you L'In20Cible)
parent = entity.parent
if parent is not None:
parent.start_touch.skip_hooks(stack_data[1])
return False


# =============================================================================
# >> POINT_SPOTLIGHT: items and weapons
# =============================================================================
class Spotlight(Entity):
"""Modified Entity class for properly removing a 'point_spotlight'."""
caching = True

def remove(self):
"""Turns off the 'point_spotlight' before removing it."""
try:
self.call_input('LightOff')
except RuntimeError:
pass

self.delay(0, super().remove)


def create_spotlight(origin, color, **kwargs):
"""Creates a 'point_spotlight' at the specified origin.

Args:
origin (Vector): Spawn position of the 'point_spotlight'.
color (Color): Color of the light.
**kwargs: Additional keywords arguments.
"""
spotlight = Spotlight.create('point_spotlight')
spotlight.origin = origin
spotlight.angles = kwargs.get('angle', SPOTLIGHT_ANGLE)
spotlight.color = color

spotlight.render_mode = RenderMode.NORMAL
spotlight.render_amt = 0
spotlight.render_fx = RenderEffects.NONE
spotlight.set_key_value_bool('disablereceiveshadows', False)
spotlight.set_key_value_float('HDRColorScale', 1)
spotlight.set_key_value_int(
'spotlightwidth', kwargs.get('width', SPOTLIGHT_DEFAULT_WIDTH))
spotlight.set_key_value_int(
'spotlightlength', kwargs.get('length', SPOTLIGHT_DEFAULT_LENGTH))

# Make sure the 'point_spotlight' spawns turned on.
spotlight.spawn_flags = 1
spotlight.spawn()
return spotlight


def create_item_spotlight(classname, index, origin):
# Is this a weapon without a set color?
if classname not in item_colors and 'weapon' in classname:
classname = 'weapon_default'

# Is there a color set for this item/weapon?
if classname in item_colors:
# Check if there's a 'point_spotlight' tied to this index already.
try:
# If there is, remove it.
spotlight_pairs.pop(index).remove()
except KeyError:
pass
# Store the 'point_spotlight' instance in a dictionary, but tie it to
# the index of the specified item/weapon.
spotlight_pairs[index] = create_spotlight(
origin, item_colors[classname])


@OnEntityOutput
def on_entity_output(output, activator, caller, value, delay):
# Items (item_battery, item_healthkit) send out 'OnPlayerTouch' whenever
# they are applied to a player, while weapons send out 'OnPlayerPickup'.
if output in ('OnPlayerTouch', 'OnPlayerPickup'):
# Is there a 'point_spotlight' for this item/weapon?
try:
spotlight = spotlight_pairs.pop(caller.index)
except KeyError:
return

# Delay the removal by a single frame to avoid crashing the server.
spotlight.delay(0, spotlight.remove)


@EntityPreHook(
EntityCondition.equals_entity_classname('weapon_frag'), 'materialize')
@EntityPreHook(
EntityCondition.equals_entity_classname('item_battery'), 'materialize')
def materialize_pre(stack_data):
"""Called when an item or weapon becomes enabled."""
entity = Entity._obj(stack_data[0])
create_item_spotlight(entity.classname, entity.index, entity.origin)


@OnNetworkedEntitySpawned
def on_networked_entity_spawned(entity):
"""Called when a new networked entity has been spawned."""
# Delay our checks for a single frame. Without this, checking for
# EntityEffects.NODRAW doesn't seem to work.
entity.delay(0, entity_spawn_post, (entity,))


def entity_spawn_post(entity):
"""Called a single frame after a networked entity has been spawned."""
classname = entity.classname

# Is this a grenade?
if 'npc_grenade_frag' in classname:
Grenade(entity.index).start_pulsing()

# Or is it a weapon?
elif 'weapon' in classname:
# Does it have an owner? (player equipped it)
if entity.owner_handle != -1:
return

# When a player picks up a map placed weapon, another one gets spawned
# right away, but it's disabled. This line helps avoid spawning
# another 'point_spotlight' for the disabled weapon.
# More information: https://git.io/JfIFH
if entity.effects & EntityEffects.NODRAW:
return

create_item_spotlight(classname, entity.index, entity.origin)


@OnEntityDeleted
def on_entity_deleted(base_entity):
"""Called when an entity is removed."""
try:
index = base_entity.index
except ValueError:
return

# Does this entity have a 'point_spotlight' tied to it?
try:
spotlight_pairs.pop(index).remove()
except KeyError:
pass
I've also made some tiny improvements in the Grenade class and in a couple of hooks.
Last edited by VinciT on Wed Dec 23, 2020 9:42 pm, edited 1 time in total.
ImageImageImageImageImage
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [HL2:DM] Crossbow

Postby Painkiller » Sun Dec 20, 2020 11:41 am

I have just tested it this way.
Unfortunately nothing works anymore.
but I found this error code

Code: Select all

[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin
    plugin = self.manager.load(plugin_name)
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 194, in load
    plugin._load()
  File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
    self.module = import_module(self.import_name)
  File "../addons/source-python/plugins/lights/lights.py", line 18, in <module>
    from listeners import OnEntityOutput, OnNetworkedEntitySpawned, OnEntityDeleted

ImportError: cannot import name 'OnNetworkedEntitySpawned'
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [HL2:DM] Crossbow

Postby VinciT » Sun Dec 20, 2020 4:55 pm

It appears you are running an older version of SP. Try running the sp update server command or update it manually to resolve the issue.
ImageImageImageImageImage
User avatar
PEACE
Member
Posts: 50
Joined: Mon Oct 12, 2020 1:13 pm

Re: [HL2:DM] Crossbow

Postby PEACE » Sun Dec 20, 2020 5:36 pm

Painkiller wrote:The bots are outdated and basically completely broken. http://www.hurrikhan.eu/


My Bots work fine and mine were a bit newer , also i just heard back from hurrikhan and he going to see if her can get me a working ver for BMS
in response to my weapons what ones were you speaking of ? and yes most of the good one are private like my egon _
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Tue Dec 22, 2020 4:32 am

I got this when i tryed this script, It does work, just gives this error.

Code: Select all

2020-12-21 22:27:57 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\listeners\tick.py", line 80, in _tick
    self.pop(0).execute()
  File "..\addons\source-python\packages\source-python\listeners\tick.py", line 161, in execute
    return self.callback(*self.args, **self.kwargs)
  File "..\addons\source-python\packages\source-python\entities\_base.py", line 470, in _callback
    callback(*args, **kwargs)
  File "..\addons\source-python\plugins\lights\lights.py", line 251, in remove
    self.call_input('LightOff')
  File "..\addons\source-python\packages\source-python\entities\_base.py", line 544, in call_input
    self.get_input(name)(*args, **kwargs)
  File "..\addons\source-python\packages\source-python\entities\_base.py", line 529, in get_input
    return self.inputs[name]
  File "..\addons\source-python\packages\source-python\entities\_base.py", line 342, in inputs
    input
  File "..\addons\source-python\packages\source-python\entities\classes.py", line 542, in fget
    return InputFunction(desc, make_object(BaseEntity, pointer))

RuntimeError: Access violation - no RTTI data!
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Wed Dec 23, 2020 3:42 am

I also get this, it dont say its from lights but it came up after adding it to server.

2020-12-22 21:38:33 - sp - EXCEPTION
[SP] Caught an Exception:
Traceback (most recent call last):
File "..\addons\source-python\packages\source-python\effects\hooks.py", line 98, in pre_playback_temp_entity
make_object(RecipientFilter, stack_data[1]))

RuntimeError: Access violation - no RTTI data!
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: [HL2:DM] Crossbow

Postby VinciT » Wed Dec 23, 2020 9:43 pm

I've updated the plugin in the previous post to fix the issues you ran into.
ImageImageImageImageImage
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Wed Dec 23, 2020 10:34 pm

Thank you, I will give it a try.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Thu Dec 24, 2020 12:25 am

VinciT wrote:
Painkiller wrote:I noticed that some medications are blue instead of green, and some suit kits are yellow instead of blue.
You can change the spotlight colors in the item_colors dictionary:

Syntax: Select all

item_colors = {
'item_battery': Color(255, 255, 25),
'item_healthkit': Color(25, 255, 55),
'item_healthvial': Color(25, 255, 55)
}
Pick a color you like, copy the RGB value, and put it between the parentheses.
Painkiller wrote:That grenade is not working at all.
It appears that it only lights up when touching another entity (and not the world). I'd like to avoid using VPhysicsCollision() if at all possible, as it seems like it gets called quite often. What if the grenade pulsed the effect each second, and every time someone grabs or throws it, as well as when it explodes? Would that be okay?

L'In20Cible wrote:Some information was left out so I will clarify. First of all, the server do not crash but freeze due to the post handler being called infinitely after a recursive call. Basically, the map mentioned above is using a trigger_multiple that triggers a func_door that is parented to a solid prop_dynamic used to lift the players up and down once they step onto it. The issue arise when a player is touching the prop_dynamic, which internally forward the call to the parented func_door. DynamicHooks relies on the ESP register to be unique, but it appears to be re-used for the parent's call, which cause the original frame to never be resumed.
Ah.. So that is why you usually advise against touch hooks. Is there no way this can be adjusted within DynamicHooks? Maybe with a recursion limit?
L'In20Cible wrote:I suggested to hook CCrossbowBolt::BoltTouch as a workaround until it can be looked further into, but I would rather suggest the following instead:
Cheers for the fix, I've updated the code in my previous post.


I still got this

Code: Select all

2020-12-23 16:40:21 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\effects\hooks.py", line 98, in pre_playback_temp_entity
    make_object(RecipientFilter, stack_data[1]))

RuntimeError: Access violation - no RTTI data!
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Fri Mar 05, 2021 3:50 am

I still get this, please help.

Code: Select all

2021-03-04 19:01:34 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\effects\hooks.py", line 98, in pre_playback_temp_entity
    make_object(RecipientFilter, stack_data[1]))

RuntimeError: Access violation - no RTTI data!


2021-03-04 19:01:34 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\effects\hooks.py", line 98, in pre_playback_temp_entity
    make_object(RecipientFilter, stack_data[1]))

RuntimeError: Access violation - no RTTI data!
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: [HL2:DM] Crossbow

Postby L'In20Cible » Fri Mar 05, 2021 11:00 am

daren adler wrote:I still get this, please help.

Code: Select all

2021-03-04 19:01:34 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\effects\hooks.py", line 98, in pre_playback_temp_entity
    make_object(RecipientFilter, stack_data[1]))

RuntimeError: Access violation - no RTTI data!


2021-03-04 19:01:34 - sp   -   EXCEPTION   
[SP] Caught an Exception:
Traceback (most recent call last):
  File "..\addons\source-python\packages\source-python\effects\hooks.py", line 98, in pre_playback_temp_entity
    make_object(RecipientFilter, stack_data[1]))

RuntimeError: Access violation - no RTTI data!


I guess this happens when an effect is created by Sourcemod, right? If so, then it is likely related to #314. Try to replace ../effects/hooks.py#L90-L98 with the following (untested):

Syntax: Select all

# =============================================================================
# >> HOOKS
# =============================================================================
@PreHook(get_virtual_function(engine_server, 'PlaybackTempEntity'))
def pre_playback_temp_entity(stack_data):
"""Handle pre hooks."""
temp_entity = TempEntity(stack_data[3])
try:
recipients = make_object(RecipientFilter, stack_data[1])
except RuntimeError:
recipients = RecipientFilter()
(stack_data[1] + 4).copy(
get_object_pointer(recipients) + 4,
get_size(RecipientFilter) - 4
)
recipients.update(*tuple(recipients), clear=True)
return temp_entity.template.handle_hook(temp_entity, recipients)
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Fri Mar 05, 2021 4:01 pm

OK,,where do i add it,, i looked for that to add and dont kno ?, please help

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 22 guests