Game mounting Luas.

Not sure if it’s the right place to put this thread, but I would like to know where the lua script is for mounting games in GMod 13, I might make a custom script out of it…

im glad you asked son,

garry has added an engine library that allows you to control the mounted content on the client (and server if its a listen server)

engine.SetMounted(int iGameID, boolean bMount);

heres an example:
// Mount CSS!
engine.SetMounted(240, true); // 240 is the GameID of CSS

// Unmount CSS!
engine.SetMounted(240, false);

the game id of a game can be found by viewing it in the steam store: <-- /240/ (CSS)

i know you didnt ask but my personal opinion is that its probably not the best idea to force content mounting on the client (maybe they havent mounted for a reason?) but ye…thats how you control content mounting :slight_smile:

just to clarify this is a shared library although the client has more options.

to get a full list of the engine commands just type
lua_run_cl PrintTable(engine) // for the client
lua_run PrintTable(engine) // for the server

in the console

Thank you so much! You answered more than I wished for! You are actually more helpful than Garry himself!

no problem, glad i helped :slight_smile:

if you need anything else let me know :D.

I actually used the ran the 2 lines of code that you gave with “Lua Pad” and it worked perfectly!
now I would like t know if it it possible to disable the feature that Garry Added that detects that your game is fully installed so It can be mounted, i.e. L4D2 is at %90 and you can wait to play with it’s models but GMod wont mount it because it’s not fully installed. Is there a way to bypass or disable it, if somebody answers I WILL LOVE THEM FOREVER :smiley:

you cant…and its there so that you dont get errors when mounting content.

its coded in C++ with steam works and the only way to change that would be to alter the binaries which will get you vac banned.