Script won't load

Please post any questions about developing your plugin here. Please use the search function before posting!
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Script won't load

Postby arawra » Thu Aug 29, 2013 11:59 pm

This script just plain fails to load. No error in console.

SP version gives no output. Download from Aug-07-2013

[SP] Loading addon 'dnd'....
[SP] Addon 'dnd' was unable to be loaded.


Code: Select all

from messages import Chat

from Source import Player
from Source import Engine
from Source import Entity

from events import GameEvent


def round_start(GameEvent):
    userid = GameEvent.GetInt('userid')
    player = Player.EdictOfUserid(userid)
    index = Engine.IndexOfEdict(player)
    Chat(index, '[DND] Loaded!')
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri Aug 30, 2013 2:25 am

http://www.sourcepython.com/forumdisplay.php?37-Source-Python-Wiki

The plugin has undergone many changes. Pretty much none of that script will work with the current version.

Satoon
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Fri Aug 30, 2013 2:45 am

There wouldn't happen to be a script I could look at for syntax, would there? The tutorial script also seems to be from an older version.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri Aug 30, 2013 2:52 am

Which tutorial script would that be? For a script that does what your example attempts to, look at these pages:
http://www.sourcepython.com/showwiki.php?title=Wiki:events
[url]http://www.sourcepython.com/showwiki.php?title=Wiki :p layers+helpers[/url]
http://www.sourcepython.com/showwiki.php?title=Wiki:messages

Sorry for the lack of example on events, but basically use the Event class like the following to register the function for the event:

Code: Select all

from events import Event

@Event
def round_start(game_event):
    pass
Also, there is no need to import GameEvent (or game_event) as that is just automatically passed to each event.

Satoon
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Fri Aug 30, 2013 2:57 am

With JUST that in my script, it still fails to load. Still no errors, still just "unable to load".

Windows 7
CS:GO Dedi Server Executable 1.30.2.0
CS:GO Dedi Server build 13:34:39 Aug 26 2013 (5406) (730)
SP Zip download from Aug 7 2013
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Fri Aug 30, 2013 3:03 am

To get proper tracebacks in console, you need to set the logging level in your ../cfg/source-python/core_settings.ini file.

Satoon
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Postby arawra » Fri Aug 30, 2013 3:07 am

Thank ya.

Yeah the problem is from the update, not the script. Thanks for the help.
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sun Sep 01, 2013 1:28 am

I knew what your error was, but I hadn't fixed it yet in the repository. It is fixed now, and I will upload a new version in a few days. In the meantime, you can get the update yourself from the repository.

Satoon

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 13 guests