Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Soccer's Training

  1. Registered TeamPlayer
    Join Date
    10-09-07
    Posts
    1,815
    Post Thanks / Like
    Stat Links

    Soccer's Training
    Gamer IDs

    Gamertag: soccerdog8 Steam ID: soccerdog
    #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.

  2. Registered TeamPlayer
    Join Date
    10-29-07
    Posts
    4,953
    Post Thanks / Like
    Stat Links

    Soccer's Training
    #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

  3. Registered TeamPlayer Captain Coors's Avatar
    Join Date
    06-18-08
    Posts
    3,612
    Post Thanks / Like
    Stat Links

    Soccer's Training Soccer's Training Soccer's Training
    Gamer IDs

    Steam ID: 76561197993685827
    #3

    Re: Soccer's Training

    Quote Originally Posted by Ewok

    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)
    TF2 recently got cvars issued to control class restrictions...just as a heads up in case you didn't know. Maybe your idea is for something more powerful and dynamic than the plain cvar class control though.

  4. Registered TeamPlayer
    Join Date
    10-29-07
    Posts
    4,953
    Post Thanks / Like
    Stat Links

    Soccer's Training
    #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.

  5. Registered TeamPlayer Captain Coors's Avatar
    Join Date
    06-18-08
    Posts
    3,612
    Post Thanks / Like
    Stat Links

    Soccer's Training Soccer's Training Soccer's Training
    Gamer IDs

    Steam ID: 76561197993685827
    #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.


  6. Registered TeamPlayer
    Join Date
    10-29-07
    Posts
    4,953
    Post Thanks / Like
    Stat Links

    Soccer's Training
    #6

    Re: Soccer's Training

    Does tournament mode need to be on those to work?

  7. Registered TeamPlayer Captain Coors's Avatar
    Join Date
    06-18-08
    Posts
    3,612
    Post Thanks / Like
    Stat Links

    Soccer's Training Soccer's Training Soccer's Training
    Gamer IDs

    Steam ID: 76561197993685827
    #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. :|

  8. Registered TeamPlayer
    Join Date
    10-09-07
    Posts
    1,815
    Post Thanks / Like
    Stat Links

    Soccer's Training
    Gamer IDs

    Gamertag: soccerdog8 Steam ID: soccerdog
    #8

    Re: Soccer's Training

    Quote Originally Posted by Ewok
    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.
    Alright, I'm looking at this now. Is it as simple as moving the code over and making a header? Would I have to change the syntax and have to go through and change the command each time it's used? Out of curiosity, how does using extensions make things easier?

    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
    Why does a blank url have to show up? Is that really the only way to stop the music from playing? This always bothers me and I'm sure many others.

  9. Registered TeamPlayer
    Join Date
    10-29-07
    Posts
    4,953
    Post Thanks / Like
    Stat Links

    Soccer's Training
    #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).

  10. Registered TeamPlayer
    Join Date
    05-20-08
    Posts
    587
    Post Thanks / Like
    #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?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Title