Results 1 to 10 of 12
Thread: Soccer's Training
-
03-09-09, 10:24 PM #1
Soccer's Training
Now that I've got the IDE and the code and the tutorials, what's a good way to start learning? Can you give me some simple task/program/function, even if it's one that's already been done, for me to try to come up with myself? I find that's a good way to learn a language.
-
03-10-09, 12:55 AM #2
Re: Soccer's Training
One of the things I'm trying to do is migrate more of lonestar's feature code to extensions.
LoneStar originally didn't support extensions, so every feature lived in lib/lonestar. Now that it supports extensions, most of the features don't really need to live there and should instead be in lib/lonestar/extensions.
It's not a very creative assignment, but it also isn't going to be a confusing one either. It'll introduce you to the classes and the code that exists without making you pour through every API.
For me the end-goal is that lib/lonestar/commands.py gets split off into multiple extensions, each with a different theme.
So for instance there could be a "system-utils" extensions that absorbed "DebugTargetConsoleCommand" and "ReloadConfigsConsoleCommand"
There could be a "punishment" extension that aborbed all of the admin punishments for players (ban, kick, slay, etc).
There could be an "admin-chat" extension that handled admin-chat and god-chat
There could be a "chat-utils" extension that handled all of those chat commands for players like "timeleft", "nextmap", and "ff"
The idea is to group up the commands in commands.py, and break them off into their own extensions.
_________________________________________________
If your feeling like you want to tackle something harder, maybe you should try you're hand at a weapon-restriction extension (for CSS) or a class-restriction extension (for TF2/DoDS)
For that matter you could try both at the same time. Your call
-
03-10-09, 01:00 AM #3
Re: Soccer's Training
Originally Posted by Ewok
-
03-10-09, 01:13 AM #4
Re: Soccer's Training
Well then the extension just got easier.... use the supported cvars but allow admins to change their values at will.
For extra flair allow players to start a vote to change the restrictions, like how there are awp votes in CSS.
-
03-10-09, 09:19 AM #5
Re: Soccer's Training
Nifty.
The cvar is tf_tournament_classlimit_X with X being the name of class.
i.e. tf_tournament_classlimit_scout "2" or tf_tournament_classlimit_soldier "3".
I believe setting the value to -1 then removes the class limit for that class.
-
-
03-10-09, 01:58 PM #7
Re: Soccer's Training
Dang it, I bet it does now that you mention it. That would be silly of valve to restrict it as a dependent on that mode...so it sounds probable that its true.
I'll test tonight.
UPDATE: The class restriction cvar does require tournament mode to be on so it won't work. Scratch this thought. :|
-
03-12-09, 10:11 PM #8
Re: Soccer's Training
Originally Posted by Ewok
Also, one thing I just noticed in the code:
Code:class StopMusicChatCommand(SingleWordChatCommand): def __init__(self): SingleWordChatCommand.__init__(self, "stopmusic", "Stops the the intro music if it is currently playing") def doSingleWordCommand(self, invoker, team, cmd): if invoker: hud.showUrl(invoker, "about:blank") return True
-
03-12-09, 10:21 PM #9
Re: Soccer's Training
Yes its more or less just a matter of moving code around and changing the import statements. It's not complicated, which is why its an easy starting point.
The purpose of extensions is to allow outside people to write extra functionality that server admins can optionally include in their mod. It's how you develop a community around a mod. It also allows people to replace functionality in the mod with a different implementation (for instance the reserved slot manager is now an extension, so someone could replace the default lonestar one with a different one). Extensions make it easy to do this because all functionality for an extension is in one file; so you simply add and remove files to add and remove functionality.
The way you stop the music in the game is by launching the in-game web browser. It doesn't matter what URL it's pointing at, as just launching the browser stops the music. In the past other mods have pointed at Google. I figure it should just be a blank screen; why bother loading any site if all you need is the browser to launch?
(The reason you need the browser to launch is because the intro music is actually a background music tag in the HTML MOTD. So the browser is essentially running in the background playing the music, and so the only way to get it to stop is by having it load some other page so it unloads the MOTD).
-
03-13-09, 11:09 AM #10
Re: Soccer's Training
I have my env. setup and I pulled all the punishment related code to it's own extension, but once I added it to my test server the lonestar mod stopped responding to the menu command and nothing is being logged. I only changed commands and added punishment files. Is there a syntax checker I can run against my changes to make sure I didn't bork something up?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks