Skip to content

A collection of SourceMod stock functions.

License

Notifications You must be signed in to change notification settings

nosoop/stocksoup

Folders and files

NameName
Last commit message
Last commit date
Jan 6, 2022
Feb 4, 2024
Aug 17, 2016
Apr 6, 2016
Mar 16, 2016
Aug 5, 2021
Sep 19, 2016
Feb 1, 2018
Feb 6, 2017
Jul 31, 2019
Mar 22, 2021
Jan 22, 2019
Sep 17, 2016
Dec 9, 2016
Jun 19, 2019
Jul 13, 2016
Nov 6, 2023
Jun 27, 2019
Jan 25, 2022
Aug 15, 2022
Feb 2, 2019
Mar 6, 2021
Aug 21, 2017
Jul 13, 2016
Apr 19, 2017
Nov 16, 2023
Mar 15, 2021
Feb 12, 2017
Nov 2, 2022
Aug 8, 2019
Sep 9, 2016
Oct 13, 2023
Jan 21, 2018
Jun 8, 2020
Aug 17, 2016
Dec 24, 2019
May 21, 2020

Repository files navigation

stocksoup

A mishmashed collection of various SourceMod stock functions that I've written for use in my projects. Might be useful to you at some point as well.

Usage (simplified)

For your sanity's sake, just copy the stocks that you need into your own project. This repository is a moving target that gets changed fairly often; if you just sync this repository to your main scripting includes, you may will have a bad time if any stock functions change.

Usage (traditional)

Install stocksoup as a git submodule. The directory structure is set up this way with includes at the root so the repository has its own nice little folder to sit in.

Using this as a submodule means effectively pinning the dependencies; you and possible contributors won't be tripped up by function and include renames whenever I feel like doing them. Of course, you'll have to be on a git-compatible system for your repository in the first place.

  1. Add the repository as a submodule (as an include relative to your scripting directory).

    $ git submodule add https://github.com/nosoop/stocksoup scripting/include/stocksoup
    
  2. If not already, make sure your SourcePawn compiler looks into the custom include directory.

    spcomp "scripting/in_progress_file.sp" -i"scripting/include"
    
  3. Include a specific file and use a stock.

    #include <stocksoup/client>
    
    public void Example_OnPlayerSpawn(int client) {
            SetClientScreenOverlay(client, "combine_binocoverlay");
    }
    
  4. For collaboration, you should know how to recursively initialize a repository:

    $ git clone --recurse-submodules $YOUR_GIT_REPOSITORY
    

Updates (as a submodule)

  1. Pull in updates for all the submodules.

    $ git submodule update --remote --checkout
    
  2. Make sure your project actually builds; fix things as necessary. No stability guaranteed.

  3. Commit as usual.

Releases

If I remember to do so, I may publish a tag on a commit prior to a major breaking change to mark commits that projects should be able to move up to without significant problems.

I consider a major breaking change as one that:

  • Removes a function, or an argument within a function (keyword changes are not major).
  • Moves functions between filenames in a way that referencing the old include doesn't work.

Directory structure

Pretty simple:

  • Base directory has stocks applicable to all games.
    • The sdkports/ directory contains ports of select Source SDK functions.
  • Other subdirectories have stocks applicable to a specific mod. Mainly TF2, since that's the only game I write for. Any stock functions for a specific game should be prefixed with a game abbreviation, similar to SourceMod functions.

Questions and Answers

Is the name of the library a reference to Weird Al's Talk Soup? Yes. Yes it is.