First steps in Sp

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
mister-man
Member
Posts: 70
Joined: Wed Aug 29, 2012 7:09 pm
Location: Germany

First steps in Sp

Postby mister-man » Mon Feb 11, 2013 12:33 pm

Hay,

I want start to learn SP. But the first problem is to send an message o an player.

Syntax: Select all

from Source import Player
from Source import Engine
from messages import chat
from events import Event

@Event
def player_spawn(GameEvent):
# Chat Messages
userid = GameEvent.GetInt('userid')
player = Player.EdictOfUserid(userid)
index = Engine.IndexOfEdict(player)
chat(index, 'Test')


If a player joins, the whole server crashes with with the error "MESSAGE_END called with no active message".

A secound Question is, whats up with the wiki? Is there a way to restore it?
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Feb 11, 2013 3:18 pm

The message system has gotten a major overhaul, not only on the Python side, but on the C++ side as well (due to the protobuf system). So, if this is for CS:GO, you will need to compile the newest version yourself in order to send messages, then use the most up-to-date Python API.

Info on the message module updates:
http://www.sourcepython.com/showthread.php?204
http://www.sourcepython.com/showthread.php?261

Also, info on the translation module:
http://www.sourcepython.com/showthread.php?260

We are currently working on a complete overhaul of the plugin (C++ side) which will make things much more maintainable in the future, so we will not be releasing a build until that is further along in development:
http://www.sourcepython.com/showthread.php?274

If you are running a Windows server, you can build by using this tutorial:
http://www.sourcepython.com/showthread.php?26#post129

Unfortunately, we are having build issues on Linux with the default branch, so we cannot release a build for that branch at this time. And, since we are working on the overhaul, it would not serve us well to work on those issues when our time would be better spent finishing the overhaul and getting that build ready for release.

As for the Wiki, unfortunately we were not able to recover anything from it. I have a thread asking if anyone wants to become a Wiki Contributor to get it back up and running, but have not received any replies on that as of yet:
http://www.sourcepython.com/showthread.php?270

The development team, at this time, does not have any time to be working on the Wiki, so until we get some volunteers, it will remain empty.

*Edit: I went ahead and removed the download, as it will cause crashing when using the messaging system (since it no longer exists in CS:GO).

Satoon
User avatar
mister-man
Member
Posts: 70
Joined: Wed Aug 29, 2012 7:09 pm
Location: Germany

Postby mister-man » Mon Feb 11, 2013 4:52 pm

Sorry for the question about the wiki.

Of course I can help to write the wiki but my knowledge about SP is currently bad. So I will learn it and later I can help...
User avatar
mister-man
Member
Posts: 70
Joined: Wed Aug 29, 2012 7:09 pm
Location: Germany

Postby mister-man » Mon Feb 11, 2013 7:36 pm

I tryed to test it, but there is no saytext2 in lib's and the sp download link is broken... (http://code.google.com/p/source-python/downloads/list) ---> No download :(


It seems I must wait for the next release...
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Mon Feb 11, 2013 7:51 pm

I removed the download because that version causes crashing when using the messaging system, as you have seen in your testing. Due to Valve updating to use the new protobuf system in CS:GO, the old UserMessage system got removed completely for that version of the engine. Again, as I posted earlier, if you are running a Windows server, you will need to compile yourself. If you are running Linux, it will not compile, and you will just have to wait until the overhaul has gotten far enough along that we can release a build.

Satoon
User avatar
mister-man
Member
Posts: 70
Joined: Wed Aug 29, 2012 7:09 pm
Location: Germany

Postby mister-man » Thu Jun 13, 2013 11:04 am

Hay all,

after the last release, I tried a second start in SP.

I tried to send a message at spawn to every alive player in CT and T Team. But every time I tried to start my script, there are import bugs from source.
Omega_K2
Senior Member
Posts: 227
Joined: Sat Jul 07, 2012 3:05 am
Location: Europe
Contact:

Postby Omega_K2 » Fri Jun 14, 2013 2:25 pm

That's because of the rewrite. Some stuff doesn't exist anymore and "Source" has been replaced.
Libraries: k2tools
Plugins (any): GSRPG (soon) | Pretty Status List | MySQLAds (soon)
Plugins (game-specific): None atm

If you happen to find a bug or need help, either post in the release threads or contact me in IRC gamesurge.net:6667 / #sourcepython
User avatar
mister-man
Member
Posts: 70
Joined: Wed Aug 29, 2012 7:09 pm
Location: Germany

Postby mister-man » Sat Jun 15, 2013 3:11 pm

Okay,

are there some examples of basic functions like messaging or weapon or player?
Everything I found doesn't work...
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Sun Jun 16, 2013 12:18 am

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

Not everything "works" right now. This is an alpha still, so don't expect everything to work 100%.

Satoon
User avatar
mister-man
Member
Posts: 70
Joined: Wed Aug 29, 2012 7:09 pm
Location: Germany

Postby mister-man » Tue Jun 18, 2013 11:39 am

It seems the wiki is empty....
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Postby satoon101 » Tue Jun 18, 2013 12:51 pm

Yeah, sorry about that. I am reworking it a little bit. I will hopefully have it back up by the end of the day. Sorry for the inconvenience.

Satoon

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 12 guests