Page 1 of 1

Source.Python Dissolver!

Posted: Sun Mar 08, 2015 9:45 pm
by your-name-here
Hi guys, just wanted to release a really simple plugin showcasing the entities and config APIs.

Current version: 1.0
Supported games: Counter-Strike: Source (may also work on CS:GO).
Description: This plugin causes player's ragdolls to dissolve on player death.

Configuration: The plugin creates a configuration file under <modname>/cfg/source-python/sp_dissolver.cfg. See the configuration file for a description of what you can change.

Posted: Sun Mar 08, 2015 10:05 pm
by satoon101
Nice!! I just tested and it does work for CS:GO. However, the effects are not the same. Actually, there is really no "effect" in the way of sparks/flashiness, but the entity does get removed.

Posted: Sun Mar 08, 2015 10:11 pm
by L'In20Cible
Awesome! You could get it working on TF2 as well using tf_ragdoll on that game. Also, I wonder if EntityFlags.KEEP_ON_RECREATE_ENTITIES could be useful here. :)

Posted: Sun Mar 08, 2015 10:15 pm
by your-name-here
Unfortunately, you have to recreate the dissolver every round because CSS strips everything. It does not look at the KEEP_ON_RECREATE_ENTITIES flag :P

Posted: Sun Mar 08, 2015 10:19 pm
by L'In20Cible
Too bad, then. I noticed that flag yesterday and thought about it when I saw your comments about recreation. :D

Posted: Fri Sep 25, 2015 11:04 am
by Jerome69
Hello,

after install the plugin, I have this error :

The attachment dissolver.jpg is no longer available


Can you help me please?

Thanks

Posted: Fri Sep 25, 2015 1:36 pm
by satoon101
A lot has changed since this was released. I have a new version I will release soon that supports more games. I have already asked ynh if it was ok if I did, and he encouraged it. You can find the current version here:
https://github.com/satoon101/Dissolver

Posted: Sat Sep 26, 2015 3:03 pm
by Jerome69
Thanks satoon, it works :)

Posted: Fri Oct 02, 2015 12:00 pm
by Jerome69
Is it possible to add a timer before dissolving, with a value in the cfg file?

Thanks

Posted: Fri Oct 02, 2015 2:14 pm
by stonedegg
Put this to the imports in the header of dissolver.py:

Syntax: Select all

from listeners.tick import tick_delays

Change Line 123 to this:

Syntax: Select all

tick_delays.delay(<seconds>, dissolver_entity.dissolve, ragdoll_classname)

And replace <seconds> with the the number of seconds you want to delay the dissolving.

Posted: Fri Oct 02, 2015 2:28 pm
by satoon101
I can add that to the plugin with a ConVar when I get the chance. Good suggestion, thank you.

Posted: Fri Oct 02, 2015 4:44 pm
by Jerome69
I added this code in "Configuration"

Syntax: Select all

# Create the dissolver delay cvar
dissolver_delay = _config.cvar(
'delay', 2, ConVarFlags.NONE,'Delay before dissolving')


stonedegg wrote:Put this to the imports in the header of dissolver.py:

Syntax: Select all

from listeners.tick import tick_delays


Change Line 123 to this:

Syntax: Select all

tick_delays.delay(<seconds>, dissolver_entity.dissolve, ragdoll_classname)

And replace <seconds> with the the number of seconds you want to delay the dissolving.


Done. I have replaced <seconds> by "dissolver_entity.dissolve_delay". But if I change the value in the cfg file (5, to have a long time to see the difference), it seems to don't work, it keeps 2 seconds...

And if two people are killed with an interval of 1 second, they are dissolved at the same moment.

Any idea?

Posted: Fri Oct 02, 2015 5:30 pm
by satoon101
I will update the script to accommodate for that last issue. The dissolver entity dissolves using the entity classname/targetname. I will have to do some testing to make sure I do it right. Give me some time, though, as I am fairly busy for the next week or two.

For your first issue, you need to use dissolver_delay.get_int() to get the current value of the ConVar.

Posted: Fri Oct 02, 2015 5:50 pm
by Jerome69
No problem, take your time :)

Tell us here when you do the upgrade.

Posted: Tue Feb 02, 2016 3:40 pm
by Jerome69
Hello Satoon101,

I have this problem now :
The attachment Dissolver.jpg is no longer available


Can you resolve it please?

And if you can add a timer, it will be great :)

Thanks.

Posted: Tue Feb 02, 2016 4:12 pm
by Ayuto
Development status update (December 2015) wrote:ConVar creation changes.

http://forums.sourcepython.com/showthread.php?1037-Development-status-update-%28December-2015%29

At least nobody can tell me we haven't documented all these changes. :D

Posted: Wed Feb 03, 2016 2:02 am
by satoon101
I will fix this shortly and create a new thread for my version.

Posted: Tue Feb 09, 2016 11:55 am
by Jerome69
I tried to make change but it doesn't work...

I will wait for your update and your own post satoon :)

Posted: Tue Feb 09, 2016 1:18 pm
by satoon101
Sorry for the delay. I encountered something during my re-write which requires a bit of updating in SP itself. We are working on making those changes, then I will release the new version.