• SLS - Loading Screen
    29 replies, posted
Hello Facepunch! This is my first "addon" release, although I wouldn't really call this a real addon that goes in the addons folder. This is SLS (Sabre's Loading Screen). This is a very simple loading screen that can display text and change the background image of the page based on what map is being played on currently. Here is SLS running on my webserver: [url]http://thesabreslicer.site.nfoservers.com/opgaming/exloading/index.php?mapname=[/url] (change mapname to whatever map you want to see). [B]Requirements[/B] 1) A webserver that runs PHP 2) A garrysmod server 3) sv_loadingurl set to the url of your webserver / where you are going to upload the files, with ?mapname=%m on the end of the url 4) Images for the background to change to (they also have to be named the same as the map intended for them to load on) [B]Instructions[/B] 1) Download the zip 2) Place images in the images directory (named correctly) 3) Change sv_loadingurl in your config.cfg if you haven't already 4) Upload the files to your webserver [B]Download[/B] Download here (v1.0): [url]https://www.github.com/TheSabreSlicer/SLS/[/url] Direct download link (master): [url]https://github.com/TheSabreSlicer/SLS/archive/master.zip[/url] If you have any questions please ask. The license is GPL v2. ---------------------------------- Appreciate my work? [URL="http://thesabreslicer.site.nfoservers.com/thesabreslicer/donate.html"]Donate[/URL]. I thank you so much if you choose to, I am trying to buy a new domain name. Thanks to [B]Scratch.[/B]
Seems cool, I assume music is auto-set to some random radio/yt video? I don't really like hearing music in loading screen.
[QUOTE=zerothefallen;43490400]Seems cool, I assume music is auto-set to some random radio/yt video? I don't really like hearing music in loading screen.[/QUOTE] The music portion is not included in this release. It actually uses Flash player to randomly play music on my webserver. It currently doesn't work in garry's mod, though. :pwn:
Why there's a 'pause' button ? Correct me if i'm wrong but we can't even click it while joining.
[QUOTE=dexon;43525645]Why there's a 'pause' button ? Correct me if i'm wrong but we can't even click it while joining.[/QUOTE] Yes, you are right! It's just that the only way to play audio in the garry's mod loading screen is with Flash, and there are no flash audio players with no pause button. Sorry. Also, the music is only on my loading screen, not on the public release. If you want me to get you one with music, just PM me.
[QUOTE=thesabreslice;43527780]Yes, you are right! It's just that the only way to play audio in the garry's mod loading screen is with Flash, and there are no flash audio players with no pause button. Sorry.[/QUOTE] lol no
[QUOTE=thesabreslice;43527780]Yes, you are right! It's just that the only way to play audio in the garry's mod loading screen is with Flash, and there are no flash audio players with no pause button. Sorry. Also, the music is only on my loading screen, not on the public release. If you want me to get you one with music, just PM me.[/QUOTE] Chuck up a youtube embed, and make it essentially invisible with your stylescript That way you won't get fined for distributing music (If your music is not loyalty free) [code] var html='<div class="video"><iframe width="1" height="1" src="http://www.youtube.com/v/MPxVMpeVRGI&start=25?version=3&autoplay=1&loop=1;vq=medium" frameborder="0" allowfullscreen></iframe></div>'; document.write(html); [/code]
Oh how I remember the days of Garry's Mod when icons flew across your screen as it loaded and if you tried clicking anything you'd most likely stop responding.
[QUOTE=Scratch.;43532255]Chuck up a youtube embed, and make it essentially invisible with your stylescript That way you won't get fined for distributing music (If your music is not loyalty free) [code] var html='<div class="video"><iframe width="1" height="1" src="http://www.youtube.com/v/MPxVMpeVRGI&start=25?version=3&autoplay=1&loop=1;vq=medium" frameborder="0" allowfullscreen></iframe></div>'; document.write(html); [/code][/QUOTE] I would do this, but I want to randomly play one of nine songs every time the page is loaded. This cannot be achieved with YouTube embeds very simply.
[QUOTE=thesabreslice;43534170]I would do this, but I want to randomly play one of nine songs every time the page is loaded. This cannot be achieved with YouTube embeds very simply.[/QUOTE] They're called arrays for a reason [url]http://thunderwave.net/vinylchan/rpload[/url] F5 spam all you want
Sorry, I'm new to php and coding. I'll look into that. Thanks.
Well, it's not that bad. Just need to work a bit more on the style. :D
I actually really appreciate this! I've recently been looking into how to get the loading screen to be dependent on the map and was thinking of making a coderhire job since while I know the design aspect of loading screens, I'm absolutely useless at the coding side. So thanks a lot for this. Quick thing, will the image size scale to the player's monitor?
[QUOTE=NiandraLades;43542090]I actually really appreciate this! I've recently been looking into how to get the loading screen to be dependent on the map and was thinking of making a coderhire job since while I know the design aspect of loading screens, I'm absolutely useless at the coding side. So thanks a lot for this. Quick thing, will the image size scale to the player's monitor?[/QUOTE] I believe it does when you go from a big image to a small screen, but if the screen resolution is bigger than the image, it will align in the top left. That's why I have all my images at least 1080x1920.
[QUOTE=thesabreslice;43542265]I believe it does when you go from a big image to a small screen, but if the screen resolution is bigger than the image, it will align in the top left. That's why I have all my images at least 1080x1920.[/QUOTE] I tested it with a 24" desktop (like 1920x1200) The bottom shows the background colour [url]http://quirktools.com/screenfly/#u=http%3A//gmod.piedmontmc.net/%3Fmapname%3Dttt_forest_final&w=1920&h=1200&a=1[/url] I'll probably find a css value to fix this, It crops off a side to display an image across the whole screen (Like Fill mode on Windows Backgrounds) Edit: [CODE]background-size:cover;[/CODE] Don't hold me too it
[QUOTE=Scratch.;43543371]I tested it with a 24" desktop (like 1920x1200) The bottom shows the background colour [url]http://quirktools.com/screenfly/#u=http%3A//gmod.piedmontmc.net/%3Fmapname%3Dttt_forest_final&w=1920&h=1200&a=1[/url] I'll probably find a css value to fix this, It crops off a side to display an image across the whole screen (Like Fill mode on Windows Backgrounds) Edit: [CODE]background-size:cover;[/CODE] Don't hold me too it[/QUOTE] Yeah, my images are not all the same, and I still have to add some for some maps. I will check this out and possibly fix it, but I am busy with exams coming up soon, so we'll see.
Isn't this song from like Geometry dash or uhh some other IOS game similar to Impossible game?
No, it's from a steam game called Electronic Super Joy.
Hey, I placed the files and such on my dedi, but I get an error when I go to the url in a browser. The issue is: [quote] Notice: Use of undefined constant mapname - assumed 'mapname' in FILEPATH on line 5 Notice: Undefined index: mapname in FILEPATH on line 5 [/quote] I'm not sure if this is an issue on my end, but I've tried a couple of things out to fix it, but can't seem to get it working. Any help is appreciated, and I apologize if this is an issue on my end.
[QUOTE=NiandraLades;43552120]Hey, I placed the files and such on my dedi, but I get an error when I go to the url in a browser. The issue is: I'm not sure if this is an issue on my end, but I've tried a couple of things out to fix it, but can't seem to get it working. Any help is appreciated, and I apologize if this is an issue on my end.[/QUOTE] Let me look into it. It works fine on my server, but I will test it on my secondary server. I'll post back here in a few minutes. [B]EDIT:[/B] Try going to your URL and adding ?mapname=insertmapnamehere See if that fixes the errors. Also, would you mind PMing me your url (if it's public) so I can take a look?
[QUOTE=thesabreslice;43552860]Let me look into it. It works fine on my server, but I will test it on my secondary server. I'll post back here in a few minutes. [B]EDIT:[/B] Try going to your URL and adding ?mapname=insertmapnamehere See if that fixes the errors. Also, would you mind PMing me your url (if it's public) so I can take a look?[/QUOTE] [yoururl].php?mapname=%m The %m is changed to the current map automatically Also, have some dough
[QUOTE=Scratch.;43555943][yoururl].php?mapname=%m The %m is changed to the current map automatically Also, have some dough[/QUOTE] I appreciate that. Sorry I wasn't able to work on this last night, I had some school stuff. Scratch is right, that is what you should have set to your sv_loadingurl, but I was wondering if the problem was because $mapname wasn't defined. Niandra, try replacing this: [code] <?php $mapname = $_GET[mapname]; ?> [/code] with this: [code] <?php $mapname = $_GET[mapname]; if (empty($mapname)) { $mapname = 'default'; } ?> [/code] Tell if this works, and if it doesn't, we can try something else.
[QUOTE=thesabreslice;43557993]I appreciate that. Sorry I wasn't able to work on this last night, I had some school stuff. Scratch is right, that is what you should have set to your sv_loadingurl, but I was wondering if the problem was because $mapname wasn't defined. Niandra, try replacing this: [code] <?php $mapname = $_GET[mapname]; ?> [/code] with this: [code] <?php $mapname = $_GET[mapname]; if (empty($mapname)) { $mapname = 'default'; } ?> [/code] [/quote] The first error is your usage of $_GET[mapname] rather than $_GET['mapname'], PHP defaults to treating this as a string, but will give a notice. The second issue is attempting to index $_GET['mapname'] when it isn't defined, your fix above is going to still give of the notice, you should first check it using empty($_GET['mapname']) or isset($_GET['mapname']) [url]http://php.net/empty[/url] [url]http://php.net/isset[/url] You should also look in to upping the error level / outputting of whatever web server you're developing this on.
[QUOTE=Willox;43558137]The first error is your usage of $_GET[mapname] rather than $_GET['mapname'], PHP defaults to treating this as a string, but will give a notice. The second issue is attempting to index $_GET['mapname'] when it isn't defined, your fix above is going to still give of the notice, you should first check it using empty($_GET['mapname']) or isset($_GET['mapname']) [url]http://php.net/empty[/url] [url]http://php.net/isset[/url] You should also look in to upping the error level / outputting of whatever web server you're developing this on.[/QUOTE] Thanks for this info, I really don't know php that much. This is the first thing I have made in php, ever. I am going to put this on GitHub so people like you can submit PRs. Could you give me an example of what I should change it to?
[QUOTE=thesabreslice;43558622]Thanks for this info, I really don't know php that much. This is the first thing I have made in php, ever. I am going to put this on GitHub so people like you can submit PRs. Could you give me an example of what I should change it to?[/QUOTE] I'm not really a PHP developer. [code]if (isset($_GET['mapname'])) { $mapname = $_GET['mapname']; else { $mapname = "Undefined"; }[/code]
[QUOTE=Willox;43558923]I'm not really a PHP developer. [code]if (isset($_GET['mapname'])) { $mapname = $_GET['mapname']; else { $mapname = "Undefined"; }[/code][/QUOTE] I changed the code with some help from a friend. You can see it on GitHub. [url]https://github.com/TheSabreSlicer/SLS[/url] Does that work?
[QUOTE=thesabreslice;43558999]I changed the code with some help from a friend. You can see it on GitHub. [url]https://github.com/TheSabreSlicer/SLS[/url] Does that work?[/QUOTE] I can view the git and all (I'm unsure how github mainly works though) Also I'm recommending the use of an [URL="http://www.w3schools.com/css/css_howto.asp"]external stylesheet[/URL]
[QUOTE=Scratch.;43559701]I can view the git and all (I'm unsure how github mainly works though) Also I'm recommending the use of an [URL="http://www.w3schools.com/css/css_howto.asp"]external stylesheet[/URL][/QUOTE] Yeah, you are right about that. I was about to do that, but I realized the map changes because of the PHP in the css, and I don't know enough PHP to have style.css grab the variable from index.php. I will look into it, and if I figure it out, I will post it here.
You can always put one part of the style in the php, then have the rest externally
[QUOTE=Scratch.;43560106]You can always put one part of the style in the php, then have the rest externally[/QUOTE] I didn't know you could do that, I will commit that as soon as I can. Bit busy right now. Expect it in an a few hours.
Sorry, you need to Log In to post a reply to this thread.