Legacy Addon Spawnlist Loader/Converter

Figured this might come in handy for someone. Pretty much it is just a workaround until garry fixes settings files not loading from legacy addons, but this will go through all your addons and load the spawnlists rather than having to copy them to your garrysmod folder every time an addon updates… with the added benefit of loading and converting pre-gm13 style lists.

Also clientside autorun scripts are still broken so this really is only useful if it’s installed on a server or if you’re playing singleplayer.

Console commands:
reload_spawnmenu - reloads the spawnmenu (for debug purposes)
spawnlist_export - saves all the converted pre-gm13 spawnlists to the data folder as gm13-style so you can either move them to settings/spawnlist/ or replace the file in the addon
spawnlist_loader_enabled 0 / 1 - Enables or disables the loading of spawnlists

Download

Looks awesome,thx.I was looking for these props

For some readson it doesnt work for me.


[ERROR] addons/spawnlist_loader/lua/autorun/client/spawnlist_loader.lua:63: bad argument #1 to 'KeyValuesToTable' (string expected, got no value)
  1. KeyValuesToTable - [C]:-1
   2. LoadSpawnlists - addons/spawnlist_loader/lua/autorun/client/spawnlist_loader.lua:63
    3. unknown - addons/spawnlist_loader/lua/autorun/client/spawnlist_loader.lua:90




] reload_spawnmenu
] 
Unknown command: reload_spawnmenu
] reload_spawnmenu
] 
Unknown command: reload_spawnmenu
] spawnlist_export
]

Please help :frowning:

I’m pretty sure the command is spawnmenu_reload though

Just posted an update, try that and see if it fixes your problem.

More new stuff


v. 3 (02/25/2013)
- Added cvar spawnlist_loader_enabled 0 / 1
- Spawnlists add to the bottom of the list and sort properly now

None of the Commands works

Okay works perfectly now! Thanks :slight_smile:

I have no idea where to put this in the Garrysmod folder, and the readme doesn’t say. sorry haven’t manually put mods/addons into garrys mod for a long time so i forgot :v:

http://forum.facepunch.com/showthread.php?t=1250937 cough

Edit: I also looked through your code and saw this:



-- If addon.txt doesn't exist then its content won't be mounted anyway, so skip it
if not file.Exists( "addons/" .. dirname .. "/addon.txt", "garrysmod" ) then continue end


Just thought I’d point out the need for addon.txt isn’t required anymore. :s