Search found 27 matches

by Hymns For Disco
Tue Feb 11, 2020 5:20 am
Forum: Plugin Development Support
Topic: Getting Player Reference on Connect and Disconnect (ValueError: Conversion from "Index" to "BaseEntity" failed)
Replies: 3
Views: 145

Re: Getting Player Reference on Connect and Disconnect (ValueError: Conversion from "Index" to "BaseEntity" failed)

map dust2 ---- Host_Changelevel ---- [SP] Caught an Exception: Traceback (most recent call last): File "..\addons\source-python\plugins\myplugin\accounts.py", line 111, in on_disconnect player = Player(index) File "..\addons\source-python\packages\source-python\entities\_base.py"...
by Hymns For Disco
Tue Feb 11, 2020 2:24 am
Forum: Plugin Development Support
Topic: Getting Player Reference on Connect and Disconnect (ValueError: Conversion from "Index" to "BaseEntity" failed)
Replies: 3
Views: 145

Getting Player Reference on Connect and Disconnect (ValueError: Conversion from "Index" to "BaseEntity" failed)

ValueError: Conversion from "Index" (1) to "BaseEntity" failed I get this error when trying to get the player reference for a player on disconnect. @listeners.OnClientDisconnect def on_disconnect(index): player = Player(index) This error seemingly only happens on...
by Hymns For Disco
Wed Jan 22, 2020 7:54 am
Forum: Plugin Development Support
Topic: Difference in float numbers.
Replies: 5
Views: 436

Re: Difference in float numbers.

My first thought is that gpGlobals->frametime is not guarenteed to be constant. Perhaps it changes to reflect the real time passed on a given tick, and not the ideal exact same time every tick. I haven't combed through the source sdk code to verify. Also note that the wishspeed is derived from the l...
by Hymns For Disco
Tue Jan 21, 2020 3:43 am
Forum: Plugin Development Support
Topic: m_angRotation
Replies: 2
Views: 164

Re: m_angRotation

What is wrong with standard http://wiki.sourcepython.com/developing/modules/entities.entity.html?highlight=rotation#entities.entity.BaseEntity.rotation property? It works properly when entity.set_network_property_vector('m_angRotation', ...) Perhaps you should answer your own question here, what's ...
by Hymns For Disco
Tue Jan 21, 2020 3:28 am
Forum: Plugin Development Support
Topic: Trouble with psycopg2-binary
Replies: 5
Views: 195

Re: Trouble with psycopg2-binary

So here's the trouble: The _psycopg2 C module must be built in order to be loaded by django to access my database. Installing it with my builtin pip3 (3.7 64 bit), will result in it building a _psycopg.cpython-37m-x86_64-linux-gnu.so, which sourcepython will fail to import. If I install psycopg2 fro...
by Hymns For Disco
Tue Jan 21, 2020 12:49 am
Forum: Plugin Development Support
Topic: Trouble with psycopg2-binary
Replies: 5
Views: 195

Re: Trouble with psycopg2-binary

Thank you, that wheel seemed to work. I've updated my install plugins script to act as a "pip for source-python" effectively. #!/bin/bash SOURCEPYTHON="/home/csgoserver/serverfiles/csgo/addons/source-python" echo Installing package requirements to game server pip3 install -q --no...
by Hymns For Disco
Mon Jan 20, 2020 8:04 am
Forum: Plugin Development Support
Topic: Trouble with psycopg2-binary
Replies: 5
Views: 195

Re: Trouble with psycopg2-binary

You need the psycopg2-2.8.4-cp36-cp36m-win32 build. Thank you, I notice this package name contains win32. I'm running my server on Debian 10. Is this correct, does the embedded Python of source-python allow running win32 versions of packages while on a linux os, or will I have to look for something...
by Hymns For Disco
Mon Jan 20, 2020 7:50 am
Forum: Plugin Development Support
Topic: Trouble with psycopg2-binary
Replies: 5
Views: 195

Trouble with psycopg2-binary

I'm trying to use psycopg-binary in my source-python plugin, as its the database driver used by Django for my models. The trouble is that the version of psycopg2 installed in the django project is a 64 bit version, and the embedded python installation of source-python is 32 bit, and so source-python...
by Hymns For Disco
Sun Jan 19, 2020 4:22 am
Forum: General Discussion
Topic: Custom ingame UI elements
Replies: 4
Views: 186

Re: Custom ingame UI elements

I'm wondering if there's a possibility to add a custom menu, or other interactive flat surface element? Would be great to have an HTML-based one, for example. Really depends on the game. Some games have the MOTD window letting the player open an HTML page, but as stated this is removed from CS:GO. ...
by Hymns For Disco
Sun Jan 19, 2020 4:00 am
Forum: General Discussion
Topic: Custom ingame UI elements
Replies: 4
Views: 186

Re: Custom ingame UI elements

L'In20Cible wrote:You can have a look at how iPlayer did for Source.Python.Admin: https://github.com/Source-Python-Dev-Te ... thon.Admin

https://www.youtube.com/watch?v=84HMc5G76ww

MOTD window feature has been removed from CS:GO some time ago in the Panorama UI overhaul
by Hymns For Disco
Mon Dec 24, 2018 9:57 pm
Forum: General Discussion
Topic: PyCharm Project Setup
Replies: 3
Views: 1011

Re: PyCharm Project Setup

You might check out my reply here: https://forums.sourcepython.com/viewtopic.php?f=9&t=1314 I did read this post when I originally set up my project, and read it again this time. That all works to set up the SP modules, but what im more concerned with configuring the interpreter so that install...
by Hymns For Disco
Mon Dec 24, 2018 9:21 am
Forum: General Discussion
Topic: PyCharm Project Setup
Replies: 3
Views: 1011

PyCharm Project Setup

A while ago, I was working on a source-python plugin in PyCharm, and had the project nicely setup to recognise the sp packages, but also, most importantly, under the project interpreter tab, if I installed a site package, it would automatically install it to the source-python site-packages folder al...
by Hymns For Disco
Fri Mar 23, 2018 8:23 pm
Forum: Plugin Development Support
Topic: EntityHook test_function not working?
Replies: 8
Views: 1710

Re: EntityHook test_function not working?

Thank you for helping with this problem. I think I now have a better understanding of how these hooks work. So turns out I was just being dumb before thinking that pothooks were safe, same issue. I've implemented the fix like you said and it seems to work fine, however there are still crashes if the...
by Hymns For Disco
Wed Mar 21, 2018 10:28 pm
Forum: Plugin Development Support
Topic: EntityHook test_function not working?
Replies: 8
Views: 1710

Re: EntityHook test_function not working?

Well I've realised finally that I can use EntityPostHook instead of EntityPreHook and it seems to avoid this whole server freezing situation, which is great since post hooks will work fine in my circumstances. However I, and I'm sure other people too, would like to know how to safely use EntityPreHo...
by Hymns For Disco
Wed Mar 21, 2018 9:40 pm
Forum: Plugin Development Support
Topic: EntityHook test_function not working?
Replies: 8
Views: 1710

Re: EntityHook test_function not working?

The second problem im having is that I can't find the entity property names for the start_touch and end_touch functions (if they exist). For touch you use m_pfnTouch, but I can't seem to find any other properties like this for touch function. If these properties dont exist, is there any alternate me...
by Hymns For Disco
Wed Mar 21, 2018 8:40 pm
Forum: Plugin Development Support
Topic: EntityHook test_function not working?
Replies: 8
Views: 1710

Re: EntityHook test_function not working?

I've tried implementing this solution however I am now getting errors thrown when picking up weapons. [SP] Caught an Exception: Traceback (most recent call last): File "..\addons\source-python\plugins\timer\core\zone.py", line 163, in pre_to uch parent.touch.call_trampoline(other) File &qu...
by Hymns For Disco
Wed Mar 21, 2018 5:08 am
Forum: Plugin Development Support
Topic: EntityHook test_function not working?
Replies: 8
Views: 1710

Re: EntityHook test_function not working?

The reason I wanted to filter the entities like this is because when the hooked event is fired for an entity with a parent, the server freezes. This seems like a major issue with a fundamental part of many plugins. I saw your workaround for this in another thread , but Im hoping there's a simpler wa...
by Hymns For Disco
Wed Mar 21, 2018 1:02 am
Forum: Plugin Development Support
Topic: EntityHook test_function not working?
Replies: 8
Views: 1710

EntityHook test_function not working?

I'm creating a custom class which extends Entity. When an object is made, it will create EntityPreHook decorators to bind entity events to class functions. I have created a test function which will only return true when the test entity is equal to my entity. Printing the tests, I can see that it is ...
by Hymns For Disco
Thu Mar 15, 2018 7:40 pm
Forum: Plugin Development Support
Topic: Player predicted angles
Replies: 2
Views: 1173

Re: Player predicted angles

Thank you for the reply. the documentation is a bit unclear about if the angles are the 'predicted' angles or not. It's important for my purposes to be able to set the predicted angles. My plugin will be repeatedly loading this data for a replay feature. Since the viewing client does not get updated...
by Hymns For Disco
Thu Mar 15, 2018 6:19 am
Forum: Plugin Development Support
Topic: Player predicted angles
Replies: 2
Views: 1173

Player predicted angles

In sourcemod, the OnPlayerRunCmd forward gives access to get/set the player's predicted view angles. I would like to be able to get/set these angles in my sourcepython plugin, but I'm not sure how to do this. Ideally I would like to be able to get/set at directly from the Player reference and not ne...

Go to advanced search