OpenLoad - The first open-source sv_loadingurl framework!

A huge update coming soon:

• Steam API Data caching (Since Steam’s API is so slow, players data is cached upon joining; Steam Profile Picture and Steam Name. The cache is updated at each connect but does not have an impact on loading times. I have implemented this due to players loading into the game faster than the loading URL will load all data)
• The #steamid#map#serverip URL parameters will be ignored in the next patch, OpenLoad will take advantage of the JS function GameDetails instead which Garry’s Mod invokes upon connect.
• Major improvements to the StrapQuery template, also finishing it off completely.
• Installation instructions added - [Link] (Will be updated along with the next update)
• Custom Template instructions added - [Link]

Update in action:

Will push it in a moment.

EDIT: Pushed, files are live. Make sure you update!

I thank you for all your help, but it seems that my problem is related to my hoster. I will try a driffrent setup soon and hopefully it will work there.

If you want, I can host a copy for you on my webspace? PM me a copy of your file and I’ll reply with a URL you can use until you get everything sorted out.

Thank you, but i can use my old loading screen until then. If I don’t get it to work I will PM you. :slight_smile:

Thanks for all your great work, this is awesome :3

This looks amazing, I hope you keep working on it, maybe release some templates that people can use if they want?

Yeah I’m constantly working on improvements.

It’s open-source and hosted on GitHub, so you are free to create a template too, if you feel like it.

Now, I pray to god people stop using crappy loading screens made on Paint with stupidly loud music.


You should switch from Mysqli to PDO.

What for? The only reason would be because PDO supports PostgreSQL and a few others, while the SQL modules for Garry’s Mod only supports MySQL as far as I’m aware.

Please append your statement with some information why you would like to see that instead.

After setting up my new webspace, I finally got this thing to work. And its pretty amazing!
Here you can see it
Down below I wrote some things I experienced trying out OpenLoad.

I do like the look of the standart template, but I made some changes, so it fits better to my server.
After saving it in a new folder under templates and mapping it in template.list.php, i changed the ?template=*** in sv_loadingurl to my new template. Now here’s where the curious starts: When I joined the server there seemed to be a 50/50 chance that either my template or the standart “strapquery” template loaded.
I fixed that bug by allocating the strapquery template to my new one in the template.list.php config, so it looks like this:

I need your help!
There are some features that I would like to implement in my loading screen.
The first one is realy simple, but I just don’t know how to do it:

I want that it says “Points” after the amount of pointshop points, so that players know these are their points.
How can I change my template or the src files to display that?

For my second question you need to know that I made screenshots of all my maps on the server, because the ones on gametracker have a very low resolution. I put them in a folder called “maps” and changed the openload.class.php so that it would load the image files from there (with the full web-path to my webspace).

Because the files are located on the same webspace as the loading screen, it would improve the loading time of the image if it would path to these automatically, instead of making an external connection to the same server to pull the image.
How can I change it, so the image will be loaded from my webspace directly? I tryed “…/…/maps/$this->mapname.png” but it didn’t work.

My third question is: Can I make it, so that the background of the loading screen changes either random or per map (make the map screenshot as background)? I know the background is set in the template.css file and you can’t use php commands there. So maybe I can somehow set the background in the index.html file? Again I don’t have any clue how to do that :).

I thank everyone who wants to help me and of course Svenskunganka for his great work!

For the issue with the 50/50 chance of getting the real template and the Pointshop issue, I will push a patch in a moment! I’ll PM you when that’s done with the commit so you can see what changes I’ve made.

As for the background images, you can use jQuery to fade between different background images.

[editline]14th May 2014[/editline]

Seems like you’ve disabled Private Messaging in your settings. Anyway, here’s the commit changes:


[editline]14th May 2014[/editline]

Here’s how you’d want to change background depending on what map:

  1. Add this snippet to line 17 in src/js/openload.js:

if(typeof change_bg == 'function') { change_bg(mapname); }

  1. In templates/strapquery/js/strapquery.js add this function somewhere:

function change_bg(mapname) {
	var maplist = {};
	maplist['map_name'] = "path/to/image";

	Add more array values.
	maplist['ttt_rooftops_a2'] = "templates/strapquery/img/ttt_rooftops_a2.jpg";
	if(mapname in maplist) {

(Not tested, but should work)

Hm… Making a maplist for every map seems to complicated :wink:
I tried this:

function change_bg(mapname) {
	var pathtoimage = "maps/";
	pathtoimage += mapname;
	pathtoimage += ".png";

	if(mapname in maplist) {

but it didn’t worked.

One last thing
What about something like this:
if gamemode = “terrortown” then display “Trouble in Terrorist Town” etc.
I don’t know how exactly you would code it.
Anyway, thank you for your quick reply.

function change_bg(mapname) {
	var pathtoimage = "maps/"+mapname+".png";

[editline]14th May 2014[/editline]

Add this to src/js/openload.js on line 16 before $(’#gamemode’).html(gamemode);

if(gamemode == "terrortown") {
  gamemode = "Trouble in Terrorist Town";

Working on a new template!

Here’s some eye candy for you! (Press Enter to pause music, it’s on 30% volume tho.)

I thought you couldnt interact with the loading screen

I’m fully aware of that, added the functionality temporarily in case someone wants to view the source so they don’t have to listen to the music.

People will go off adding music to their loading screens either way, so atleast they have to start off with some calm, nice music!

It automatically sanitizes database input, and has lots of nice driver options and run-time attribute options, one in particular I think would be useful for this project is PDO::ATTR_PERSISTENT, which maintains a persistent connection to the MySQL database to avoid the overhead of establishing a connection for every page request - would be handy for a loading screen. There’s probably more I’m missing.

Looking very good sir, will be looking into using this soon. My coming project will need it…