Page 1 of 2

Dissolver v1.3

Posted: Sun Feb 28, 2016 2:18 pm
by satoon101
Dissolver causes player ragdolls to dissolve when a player dies. This is an updated version of your-name-here's Dissolver that works for the newest SP version and can be used on more games than just CS:GO and CS:S.

There are config translations involved, and only English and German (thank you, BackRaw) are currently supported. If you have translations, please issue a Pull Request on the repository:
https://github.com/satoon101/Dissolver

This plugin has been tested to work on CS:S, CS:GO, TF2, DOD:S, HL2:DM, and BM:S. The effects on CS:GO aren't very spiffy, but they "work". There's not much we can do about that, unfortunately.

The current configuration allows for setting the dissolve type and the magnitude of the dissolving. There is also a configuration variable for the number of seconds to wait before starting the dissolve. The current default configuration looks like:

Code: Select all

// Options
//   * 0 = NORMAL
//   * 1 = ELECTRICAL
//   * 2 = ELECTRICAL_LIGHT
//   * 3 = CORE
//   * 4 = RANDOM
//   * 5 = REMOVE
// Default Value: 0
// The type of dissolver to use.
   dissolver_type 0


// Default Value: 2
// The magnitude to use when dissolving.
   dissolver_magnitude 2


// Default Value: 0
// The amount of time (in seconds) to wait before dissolving.
   dissolver_delay 0


Setting the dissolve type to REMOVE will simply remove the ragdoll instead of dissolving it. Setting the dissolve type to RANDOM will cause a random dissolve type to be chosen each time.

This plugin requires SP version 265 or newer.

Posted: Wed Mar 02, 2016 10:35 am
by Jerome69
Hello,

For me the pluggin successfully loads, but I have this error after a dead :

The attachment Dissolver.jpg is no longer available


I'm using this version of SP : Construction #267 (1 mars 2016 14:41:20)

Posted: Wed Mar 02, 2016 10:51 am
by Ayuto
You can fix this error by removing the '1' in the string in line 117.

Posted: Wed Mar 02, 2016 11:43 am
by Jerome69
And the same at the line 133 :)

Thanks

Posted: Wed Mar 02, 2016 12:11 pm
by satoon101
Sorry about that, I will fix that shortly.

*Edit: updated to fix those errors. Version 1.1b now available in the first post.

Re: Dissolver v1.2

Posted: Sat Apr 08, 2017 7:17 pm
by satoon101
Updated plugin for newest SP changes.

Re: Dissolver v1.2

Posted: Mon Jun 19, 2017 1:21 am
by decompile
Hey, looks like something doesnt work right here.

File "..\addons\source-python\plugins\dissolver\dissolver.py", line 115, in _dissolve_ragdoll
entity = Entity(index_from_inthandle(inthandle))

OverflowError: can't convert negative value to unsigned int

CS:S Windows

Re: Dissolver v1.2

Posted: Mon Jun 19, 2017 4:44 pm
by iPlayer
What if you replace line 113

Syntax: Select all

if inthandle == INVALID_ENTITY_INTHANDLE:


with this:

Syntax: Select all

if inthandle < 0:

?

Re: Dissolver v1.2

Posted: Mon Jun 19, 2017 5:52 pm
by satoon101
Well, if I remember correctly, inthandles on Linux can be negative, so that wouldn't fix the issue. It seems more like it could be an issue with index_from_inthandle than specifically with this script, but I could be wrong.

Re: Dissolver v1.2

Posted: Mon Jun 19, 2017 6:39 pm
by Ayuto
It depends on how the value of the inthandle is retrieved (int or unsigned int).

What's the output of print(inthandle) in the erroneous situation?

Re: Dissolver v1.2

Posted: Mon Jun 19, 2017 6:44 pm
by iPlayer
If I remember correctly, back in the day Invincible explained something incorrect with SP and why INVALID_ENTITY_INTHANDLE doesn't work for checking for inthandle validity, and why -1 works (I might indeed be wrong about negative indexes - those besides -1 - in general).

viewtopic.php?p=7523#p7523

But I'm afraid that post was one of those 3 posts which vanished during vBulletin -> phpBB migration... You told you had the screenshots. You might look up there, I remember there was something important.

Re: Dissolver v1.2

Posted: Mon Jun 19, 2017 6:56 pm
by satoon101
@decompile - please replace line 115 with the following and post the output here (note that the 'try' should have 4 leading spaces...we really need to fix that issue on the forums):

Syntax: Select all

try:
entity = Entity(index_from_inthandle(inthandle))
except OverflowError:
print('Invalid inthandle:', inthandle)

Re: Dissolver v1.2

Posted: Tue Jun 20, 2017 12:52 pm
by decompile
Output: Invalid inthandle: -1

Re: Dissolver v1.2

Posted: Tue Jun 20, 2017 2:54 pm
by L'In20Cible
iPlayer wrote:If I remember correctly, back in the day Invincible explained something incorrect with SP and why INVALID_ENTITY_INTHANDLE doesn't work for checking for inthandle validity, and why -1 works (I might indeed be wrong about negative indexes - those besides -1 - in general).

viewtopic.php?p=7523#p7523

But I'm afraid that post was one of those 3 posts which vanished during vBulletin -> phpBB migration... You told you had the screenshots. You might look up there, I remember there was something important.

The issue is because the Entity class is reading "raw" values while INVALID_ENTITY_INTHANDLE comparison would works if it was internally using the proxy of the SendProp. See also: viewtopic.php?f=14&t=585&p=4285#p4285

Re: Dissolver v1.2

Posted: Sun Jun 25, 2017 1:38 pm
by satoon101
decompile wrote:Hey, looks like something doesnt work right here.

File "..\addons\source-python\plugins\dissolver\dissolver.py", line 115, in _dissolve_ragdoll
entity = Entity(index_from_inthandle(inthandle))

OverflowError: can't convert negative value to unsigned int

CS:S Windows

I cannot seem to replicate this issue. It always seems to work fine for my testing on CS:S Windows. What exact scenario happens when this error occurs?

Re: Dissolver v1.2

Posted: Sun Jun 25, 2017 1:52 pm
by iPlayer
Maybe they get respawned before dissolving? Then the ragdoll is removed by the game on respawn.

Re: Dissolver v1.2

Posted: Sun Jun 25, 2017 2:33 pm
by satoon101
Yep, I can replicate it now. So, it would seem to be a setup issue, not an issue with the plugin itself. Try setting the dissolver_delay to a lower value if you have deathmatch enabled. If this is for a plugin where there is no set time before the player is respawned (waves or left-click to respawn), I would suggest implementing the functionality in your plugin directly and calling it prior to respawning any players.

Re: Dissolver v1.2

Posted: Sun Jun 25, 2017 4:31 pm
by L'In20Cible
Could also be fixed easily by retrieving the ragdoll into your player_death event and use Entity.delay on it passing it to the dissolve method instead of passing the player so the delay gets cancelled if the ragdoll entity itself gets removed. This would also fix an exception into Player.from_userid in case the player disconnect prior the delay expires (common rage quit :tongue:).

Re: Dissolver v1.2

Posted: Wed Jun 28, 2017 9:04 pm
by decompile
L'In20Cible wrote:Could also be fixed easily by retrieving the ragdoll into your player_death event and use Entity.delay on it passing it to the dissolve method instead of passing the player so the delay gets cancelled if the ragdoll entity itself gets removed. This would also fix an exception into Player.from_userid in case the player disconnect prior the delay expires (common rage quit :tongue:).


Pretty much this :D

But ye, I tried to add a fast team join plugin, and suddenly respawned right after I switched the team, but had no clue this was the issue, lol.

Re: Dissolver v1.3

Posted: Sat Jul 01, 2017 1:43 pm
by satoon101
Release 1.3 is now available in the first post. Please try that and let me know if you have any further issues.