Page 1 of 1

[BMS] Snow Help

Posted: Sat Oct 08, 2016 2:55 pm
by Painkiller
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.

Re: [BMS] Snow Help

Posted: Sat Oct 08, 2016 3:34 pm
by satoon101
Change:

Syntax: Select all

func_precipitation = Entity(create_entity("func_precipitation"))

to:

Syntax: Select all

func_precipitation = Entity.create("func_precipitation")

Re: [BMS] Snow Help

Posted: Sat Oct 08, 2016 3:53 pm
by Painkiller

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.

Re: [BMS] Snow Help

Posted: Sat Oct 08, 2016 3:56 pm
by satoon101
Well, you also have to remove that import line, cause create_entity doesn't exist anymore.

Re: [BMS] Snow Help

Posted: Sat Oct 08, 2016 4:04 pm
by Painkiller
[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.

Re: [BMS] Snow Help

Posted: Sat Oct 08, 2016 4:08 pm
by satoon101
Wait a minute. This never worked on any game other than CS:GO anyway:
viewtopic.php?f=37&t=967

Re: [BMS] Snow Help

Posted: Sat Oct 08, 2016 4:19 pm
by Painkiller
Ok thanks.