[BMS] Snow Help

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

Please request only one plugin per thread.
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

[BMS] Snow Help

Postby Painkiller » Sat Oct 08, 2016 2:55 pm

Hello, this plugin does not work with the latest SP version.

Could someone help me to repair?

Syntax: Select all

from entities.entity import Entity
from entities.helpers import create_entity
from filters.entities import EntityIter
from colors import Color
from listeners import LevelInit


@LevelInit
def level_init(map_name):
for worldspawn in EntityIter("worldspawn"):
break
else:
raise NotImplementedError("No world on round start ~ wut?")
for func_precipitation in EntityIter("func_precipitation"):
if func_precipitation.get_key_value_int("preciptype") == 3:
break
else:
func_precipitation = Entity(create_entity("func_precipitation"))
func_precipitation.set_key_value_string("model", "maps/{0}.bsp".format(map_name))
func_precipitation.set_key_value_int("preciptype", 3)
func_precipitation.set_key_value_int("renderamt", 255)
func_precipitation.color = Color(218, 243, 255)
func_precipitation.set_key_value_int("renderfx", 255)
func_precipitation.set_key_value_int("rendermode", 3)
func_precipitation.get_input("Alpha")(250)
func_precipitation.spawn()
func_precipitation.mins = worldspawn.get_property_vector("m_WorldMins")
func_precipitation.maxs = worldspawn.get_property_vector("m_WorldMaxs")
func_precipitation.origin = (func_precipitation.mins + func_precipitation.maxs) / 2


Code: Select all

Player "stratege57" joined team spectator
sp plugin reload snow
[SP] Unable to unload plugin 'snow' as it is not currently loaded.
[SP] Loading plugin 'snow'...

[SP] Caught an Exception:
Traceback (most recent call last):
  File "../addons/source-python/packages/source-python/plugins/manager.py", line 75, in __missing__
    instance = self.instance(plugin_name, self.base_import)
  File "../addons/source-python/packages/source-python/plugins/instance.py", line 82, in __init__
    self._plugin = import_module(import_name)
  File "../addons/source-python/plugins/snow/snow.py", line 2, in <module>
    from entities.helpers import create_entity

ImportError: cannot import name 'create_entity'


[SP] Plugin 'snow' was unable to be loaded.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: [BMS] Snow Help

Postby satoon101 » Sat Oct 08, 2016 3:34 pm

Change:

Syntax: Select all

func_precipitation = Entity(create_entity("func_precipitation"))

to:

Syntax: Select all

func_precipitation = Entity.create("func_precipitation")
Image
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [BMS] Snow Help

Postby Painkiller » Sat Oct 08, 2016 3:53 pm

Code: Select all

[SP] Plugin 'snow' was unable to be loaded.
sp plugin reload snow
[SP] Unable to unload plugin 'snow' as it is not currently loaded.
[SP] Loading plugin 'snow'...

[SP] Caught an Exception:
Traceback (most recent call last):  File "../addons/source-python/packages/source-python/plugins/manager.py", line 75, in __missing__
    instance = self.instance(plugin_name, self.base_import)  File "../addons/source-python/packages/source-python/plugins/instance.py", line 82, in __init__
    self._plugin = import_module(import_name)
  File "../addons/source-python/plugins/snow/snow.py", line 2, in <module>
    from entities.helpers import create_entity

ImportError: cannot import name 'create_entity'


[SP] Plugin 'snow' was unable to be loaded.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: [BMS] Snow Help

Postby satoon101 » Sat Oct 08, 2016 3:56 pm

Well, you also have to remove that import line, cause create_entity doesn't exist anymore.
Image
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [BMS] Snow Help

Postby Painkiller » Sat Oct 08, 2016 4:04 pm

[SP] Plugin 'snow' was unable to be loaded.
sp plugin reload snow
[SP] Unable to unload plugin 'snow' as it is not currently loaded.
[SP] Loading plugin 'snow'...
[SP] Successfully loaded plugin 'snow'.


In game no snow, standart maps.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: [BMS] Snow Help

Postby satoon101 » Sat Oct 08, 2016 4:08 pm

Wait a minute. This never worked on any game other than CS:GO anyway:
viewtopic.php?f=37&t=967
Image
User avatar
Painkiller
Senior Member
Posts: 725
Joined: Sun Mar 01, 2015 8:09 am
Location: Germany
Contact:

Re: [BMS] Snow Help

Postby Painkiller » Sat Oct 08, 2016 4:19 pm

Ok thanks.

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 19 guests