Raised This Month: $18 Target: $400
 4% 

Mscript - Load sourcemod plugins on specific maps (vscript for older games)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
bottiger
AlliedModders Donor
Join Date: Dec 2010
Plugin ID:
7785
Plugin Version:
1.1
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Load sourcemod plugins on specific maps (vscript for older games)
    Old 09-09-2021 , 01:28   Mscript - Load sourcemod plugins on specific maps (vscript for older games)
    Reply With Quote #1

    Github

    https://github.com/bottiger1/mscript

    What is this?

    This plugin will automatically load a plugin with the name of the map in the addons/disabled/mscript directory.

    When the map ends, the plugin will be unloaded.

    For example if you made a plugin in addons/disabled/mscript/ctf_2fort.smx it will be loaded when your server changes to ctf_2fort.

    When the map ends it will be unloaded.

    Why is this needed?

    Valve added real scripting languages for mappers called vscript in newer games like l4d and csgo but never bothered to port it back to older games such as TF2.

    While mappers are making use of vscript in these new games, maps in older games are stagnating and some mappers are even changing games so they can use vscripts.

    This is not necessary at all, almost anything you can do in vscript is possible in sourcemod and sourcemod can also do things that vscript cannot do.

    Why do you need this plugin to run a plugin

    This plugin is simply a framework that makes loading and unloading map specific plugins cleanly. One major reason why people don't want to use plugins is because sourcemod automatically loads them all on startup and then you'd have 20 map specific plugins taking up ram and cpu. This plugin solves that issue completely.

    How do I use this?

    Put mscript.smx in your plugins directory. If you have a map named ctf_mymap, make a plugin called ctf_mymap, and put the smx in addons/disabled/mscript.

    https://github.com/bottiger1/mscript/tree/main/examples

    Commands

    These commands are mostly for debugging purposes. You do not need these for normal usage.

    mscript_load [plugin]
    Load a plugin in the addons/disabled/mscript directory. Do not add .smx to the end. Plugins with the same name of the map will be loaded automatically so you do not need this unless you want to load more plugins.

    mscript_unload
    Unload all plugins loaded through mscript_load this map.

    mscript_reload
    Reload all plugins loaded through mscript_load this map.

    TODO

    Add more examples of map to plugin communication

    Add example of custom entity inputs

    Add example of custom filters

    I may add more examples depending on how many mappers are interested in using this. You can also submit an example and I will add it.
    Attached Files
    File Type: sp Get Plugin or Get Source (mscript.sp - 296 views - 2.6 KB)
    __________________

    Last edited by bottiger; 09-09-2021 at 01:45.
    bottiger is offline
    thewintersoldier97
    Senior Member
    Join Date: Aug 2021
    Location: Vietnam
    Old 11-16-2021 , 14:38   Re: Mscript - Load sourcemod plugins on specific maps (vscript for older games)
    Reply With Quote #2

    Could I do this but with specific players count or difficulty?
    __________________

    Looking for some fun!
    thewintersoldier97 is offline
    Sreaper
    髪を用心
    Join Date: Nov 2009
    Old 11-16-2021 , 15:49   Re: Mscript - Load sourcemod plugins on specific maps (vscript for older games)
    Reply With Quote #3

    I like the idea of automatically loading and unloading plugins. But personally I think it would probably be better if you looked for the folder name 'ctf_2fort' instead of the map name in the plugin. Renaming something to example 'ctf_2fort_friendlymode.smx' does not seem very ideal. I wouldn't want to rename all of my plugins to fit the various maps.

    Ideally it would be preferable to have something like plugins/ctf_2fort/ -> load plugins when on 2fort and just stay out of the disabled directory.

    Last edited by Sreaper; 11-17-2021 at 05:49.
    Sreaper is offline
    ownage13
    AlliedModders Donor
    Join Date: Apr 2015
    Old 11-19-2021 , 13:30   Re: Mscript - Load sourcemod plugins on specific maps (vscript for older games)
    Reply With Quote #4

    Quote:
    Originally Posted by Sreaper View Post
    I like the idea of automatically loading and unloading plugins. But personally I think it would probably be better if you looked for the folder name 'ctf_2fort' instead of the map name in the plugin. Renaming something to example 'ctf_2fort_friendlymode.smx' does not seem very ideal. I wouldn't want to rename all of my plugins to fit the various maps.

    Ideally it would be preferable to have something like plugins/ctf_2fort/ -> load plugins when on 2fort and just stay out of the disabled directory.
    I agree with Sreaper. It would be quite weird having to rename the plugin to get it to function per map. It should just load a map folder and inside the map folder should be the map specific plugins. Having it so you have to change the plugin name means you can only have 1 unique plugin for the map where you may need to put more than just 1 for the map.

    Would be a perfect plugin if you can make the change to a folder it looks for instead of the plugin just as Sreaper has mentioned.
    ownage13 is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 11:51.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode