[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
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Sat Mar 06, 2021 2:34 am

It crashes and give only 1 error :confused: , and it says the error is from the hooks, please can someone try and see if this could be fixed. Thank you. :grin: , I dont know what causes the crash, but when i // block the crossbow script, it gives no errors or crashes.

Code: Select all

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

RuntimeError: Access violation - no RTTI data!


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

RuntimeError: Access violation - no RTTI data!


Heres the script i am using. https://www.dropbox.com/s/f771xppp417te ... n.zip?dl=0 PLEASE HELP
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 » Sat Mar 06, 2021 6:37 am

daren adler wrote:It crashes and give only 1 error :confused: , and it says the error is from the hooks, please can someone try and see if this could be fixed. Thank you. :grin: , I dont know what causes the crash, but when i // block the crossbow script, it gives no errors or crashes.

Code: Select all

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

RuntimeError: Access violation - no RTTI data!


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

RuntimeError: Access violation - no RTTI data!


Heres the script i am using. https://www.dropbox.com/s/f771xppp417te ... n.zip?dl=0 PLEASE HELP


Well, you didn't follow the instructions. The proposed fix was to be applied to ../addons/source-python/packages/source-python/effects/hooks.py, not to be added to lights.py. Just undo everything you did, and this will be fixed in the next SP build.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Sun Mar 07, 2021 5:28 pm

i did what you said, and it crashes it and still gives that error

Code: Select all

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

RuntimeError: Access violation - no RTTI data!
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: [HL2:DM] Crossbow

Postby cssbestrpg » Sun Mar 07, 2021 5:36 pm

You need to wait that the next sp build is avaible, its fixed there.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Sun Mar 07, 2021 8:28 pm

ok.
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 » Mon Mar 08, 2021 4:02 am

daren adler wrote:i did what you said, and it crashes it and still gives that error

Code: Select all

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

RuntimeError: Access violation - no RTTI data!

Although you think you did, you didn't. :grin:

That traceback shows it as well; that line do not even exists anymore in the fix I proposed. But anyways it doesn't matter, since it has been fixed and tested. It will be available in the next build, or if you are on HL2DM/Windows as I believe you are, you can use the following: hl2dm-windows-d97b5ce.zip
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Mon Mar 08, 2021 6:31 am

Code: Select all

2021-03-07 22:42:28 - sp - EXCEPTION
[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 207, 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 273, in <module>
@PreHook(get_virtual_function(engine_server, 'PlaybackTempEntity'))

NameError: name 'PreHook' is not defined


Here, so you can see what i am using https://www.dropbox.com/s/uivvio3a0pinq ... s.zip?dl=0 I really like this plugin. And i added what you gave me also.
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 » Mon Mar 08, 2021 8:51 am

daren adler wrote:

Code: Select all

2021-03-07 22:42:28 - sp - EXCEPTION
[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 207, 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 273, in <module>
@PreHook(get_virtual_function(engine_server, 'PlaybackTempEntity'))

NameError: name 'PreHook' is not defined


Here, so you can see what i am using https://www.dropbox.com/s/uivvio3a0pinq ... s.zip?dl=0 I really like this plugin. And i added what you gave me also.


You get this error because of the changes you did that you shouldn't have done. As previously stated, un-do everything you did and make sure you use an unmodified version of the code provided by VinciT.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Mon Mar 08, 2021 4:14 pm

it still crashes, i had someone try it and it crashed his also. i do not know why it does it, no errors, did what u said to do, i went to the last one VinciT did and used that and crashed, i did what you said and still crashes. a please tell me what i did wrong,,i did what the other scripter said to do,,i guess that was wrong,,i did what u said to do and it still crashes. i went and copyed the last script that Vincit did on here and used that and still crashes with no errors.
Last edited by daren adler on Mon Mar 08, 2021 4:26 pm, edited 1 time in total.
cssbestrpg
Senior Member
Posts: 287
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: [HL2:DM] Crossbow

Postby cssbestrpg » Mon Mar 08, 2021 4:24 pm

If your server is windows you can download https://drive.google.com/file/d/1XW4vkimbMeON_0n778J4Lu-jgdnI2ADx/view, that link L'In20Cible gave, in that it should be fixed
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Mon Mar 08, 2021 4:37 pm

Im sorry but my server does keep crashing when i use it, no errors so i cant say why. I dont know why it keeps crashing without errors, so i was thinking it was me ( like you said) so, i went on here copyed again what VinciT wrote and gave it to a friend (with the other dl u just gave me) and his crashed also. So please put the one i am to use here please, so i know i am using the right one. and hopefully i can get it to work on myside without crashes.
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 » Tue Mar 09, 2021 12:39 am

Just to clarify, the error I fixed wasn't the cause of any crash. It was simply a run-time error caused by temp entity hooks for effects created by SM. If your server crash using this, or any other plugin, then it is caused by an entirely different issue and I cannot help with that.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Tue Mar 09, 2021 3:24 am

OK, i guess its a no go for this script then, is a great script tho, to bad. Thanks for all your help.
.PS. Me and a friend ( trying same thing) removed the lights script and left the hook you gave me, and it wont let my postal or effects work at all. If i remove it, it works fine, if you guys add that to the next update, wont it make my server postal not work even tho i dont have the lights script ?

If i am wrong i am sorry, but i was thinking if you guys put that on the next update, it would stop my postal effects and others, like it does now. I do not want to mess up other server with postal or effects like mine, and if you add that hook, i would think it would do same thing.
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 » Tue Mar 09, 2021 4:21 am

daren adler wrote:OK, i guess its a no go for this script then, is a great script tho, to bad. Thanks for all your help.
.PS. Me and a friend ( trying same thing) removed the lights script and left the hook you gave me, and it wont let my postal or effects work at all. If i remove it, it works fine, if you guys add that to the next update, wont it make my server postal not work even tho i dont have the lights script ?

If i am wrong i am sorry, but i was thinking if you guys put that on the next update, it would stop my postal effects and others, like it does now. I do not want to mess up other server with postal or effects like mine, and if you add that hook, i would think it would do same thing.

I have no idea what you are doing, but again, the fix I pushed shouldn't affect anything. All it does is wrap the content of recipient filters that do not have RTTI data (like that is the case for effects created by SM) to fix the run-time errors you received and allow temp entity hooks to read them. It was fully tested on my side, and is working as intended. If you want assistance, then upload your whole server so that someone can look at it. Nobody can magically guess what the issue could be if they can't see for themselves.
User avatar
daren adler
Senior Member
Posts: 328
Joined: Sat May 18, 2019 7:42 pm

Re: [HL2:DM] Crossbow

Postby daren adler » Tue Mar 09, 2021 4:54 am

Ok sorry for all the trouble i caused about this.
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 11, 2021 8:22 pm

Hey is there a possibility that someone makes this for Black Mesa Source?

Because I got this error

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 207, 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/crossbow/crossbow.py", line 17, in <module>
    @PreHook(find_binary('server')['_ZN13CCrossbowBolt9BoltTouchEP11CBaseEntity'].make_function(

ValueError: Could not find symbol: _ZN13CCrossbowBolt9BoltTouchEP11CBaseEntity


2021-12-11 21:27:36 - sp   -   MESSAGE   [SP] Plugin 'crossbow' was unable to be loaded.
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 Jan 22, 2022 3:15 pm

HEllo @VinciT,

I noticed that your plugin crashes in combination with my Battle Royal plugin.

If you have time and could take a look at this that would be great.

I could not find any errors. The server just crashes.

Syntax: Select all

# ../weapon_effects/weapon_effects.py

# Source.Python
from colors import Color
from engines.precache import Model
from entities.constants import RenderMode, RenderEffects
from entities.entity import BaseEntity, Entity
from entities.hooks import EntityPreHook, EntityCondition
from listeners import OnEntityDeleted, OnEntityOutput
from mathlib import Vector


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

def __init__(self, r, g, b, a=255):
super().__init__(r, g, b, a)

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

self.string = f'{r} {g} {b}'


# Sprite used for the spinning trails.
WEAPON_TRAIL_MODEL = Model('sprites/laser.vmt')
weapon_trails = {
'weapon_default': (ColorEx(255, 127, 000), ColorEx(255, 255, 000)),
'weapon_rpg': (ColorEx(255, 50, 20), ColorEx(255, 150, 50))
}


trail_pairs = {}


@EntityPreHook(
EntityCondition.equals_entity_classname('weapon_frag'), 'materialize')
def weapon_materialize_pre(stack_data):
"""Called when a weapon becomes enabled."""
base_entity = BaseEntity._obj(stack_data[0])
create_weapon_trail(
base_entity.classname, base_entity.index, base_entity.origin)


@OnEntityOutput
def on_entity_output(output, activator, caller, value, delay):
if output == 'OnPlayerPickup':
try:
trail_pairs.pop(caller.index).remove()
except KeyError:
return


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

try:
trail_pairs.pop(index).remove()
except KeyError:
pass


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

# Is there a color set for this weapon?
if classname in weapon_trails:
# Check if there's a 'point_spotlight' tied to this index already.
try:
# If there is, remove it.
trail_pairs.pop(index).remove()
except KeyError:
pass

trail_pairs[index] = SpinningTrails(
origin, WEAPON_TRAIL_MODEL, colors=weapon_trails[classname])


class SpinningTrails:
"""Class used to create a spinning effect using 'func_rotating' and
'env_spritetrail' entities.

Args:
origin (Vector): Spawn position of the effect.
sprite (Model): Sprite for the 'env_spritetrail' entity.
**kwargs: Additional keyword arguments.

"""
def __init__(self, origin, sprite, **kwargs):
self.rotators = []
self.trails = []

self.create(origin, sprite, **kwargs)

def create(self, origin, sprite, **kwargs):
# Lift the effect a bit from the ground.
origin.z += 0.5
# How many trails should there be?
number_of_trails = kwargs.get('number_of_trails', 2)
# Rotation speed.
max_speed = kwargs.get('max_speed', 250)
# The radius of the first trail.
min_radius = kwargs.get('min_radius', 16)
# How far apart should the trails be?
spacing = kwargs.get('spacing', 4)
# Colors of the trails. If more than one color is specified, the colors
# will alternate. These should be instances of ColorEx.
colors = kwargs.get('colors', (ColorEx(255, 255, 255),))
colors_num = len(colors)
# Speed at which the trail fades (in seconds).
life_time = kwargs.get('life_time', 0.8)

for i in range(0, number_of_trails):
# No need to create more than two of these. One for each direction.
if i < 2:
rotator = Entity.create('func_rotating')
rotator.origin = origin
rotator.max_speed = max_speed
# How quickly does the 'func_rotating' speed up or slow down?
# (0 - very slowly, 100 - very quickly)
rotator.fan_friction = 100
# Change the direction of every other trail.
rotator.reversed = bool(i % 2)
# Set certain spawn flags for the entity.
# 1: Starts rotating as soon as it spawns.
# 64: Not solid.
rotator.spawn_flags = 1 + 64
rotator.spawn()
# Add the rotator to a list.
self.rotators.append(rotator)

# Was more than one color specified?
if colors_num > 1:
# Change the colors based on trail order.
color = colors[i % colors_num]
else:
color = colors[0]

trail = create_sprite_trail(
origin, sprite.path, 4, 1, color.string, life_time)
# Alternate the parent every other trail.
trail.set_parent(self.rotators[i % 2], -1)
# Offset the position of the 'env_spritetrail' on the
# 'func_rotating' entity. The amount of offset is based on the
# given 'min_radius', 'spacing', and order of the trail.
trail.set_property_vector(
'm_vecOrigin', Vector(min_radius + spacing * i, 0, 0))

# Add the 'env_spritetrail' to the list.
self.trails.append(trail)


def remove(self):
"""Removes both 'func_rotating' entities after a single frame delay."""
for rotator in self.rotators:
rotator.delay(0, rotator.remove)


def create_sprite_trail(
origin, sprite_path, start_width, end_width, color_str, life_time):
"""Creates an 'env_spritetrail' entity.

Args:
origin (Vector): Spawn position.
sprite_path (string): Path to the sprite material.
start_width (float): Starting width of the trail.
end_width (float): Ending width of the trail.
color_str (str): String containing the RGB values of the color.
(e.g. '255 255 255' for white)
life_time (float): How long does the trail last before it starts to
fade (in seconds)?

Returns:
Entity: The entity instance of the created 'env_spritetrail'.

"""
trail = Entity.create('env_spritetrail')
trail.sprite_name = sprite_path
trail.origin = origin

trail.life_time = life_time
trail.start_width = start_width
trail.end_width = end_width

trail.render_mode = RenderMode.TRANS_ADD
trail.render_amt = 255
trail.render_fx = RenderEffects.NONE
trail.set_key_value_string('rendercolor', color_str)
trail.spawn()

# Texture resolution of the trail.
trail.texture_res = 0.05
return trail

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 14 guests