dnenb Posted December 22, 2013 Share Posted December 22, 2013 I made a tutorial for my game yesterday, and I thought I'd share it. It's a very simple beginner guide showing new players a few pages in your game. Easily customized to yours. How it works When a new player logs in for the first time, the only thing he or she usually sees is the userstats page. With this mod what's visible is: [ATTACH=CONFIG]1246[/ATTACH] And what it does is basically show the player a selection of pages in your game along with some text to explain. A couple of other screens: [ATTACH=CONFIG]1247[/ATTACH][ATTACH=CONFIG]1248[/ATTACH] How to install First you need another field in the users table called `tutorial_step` with default value 1. Then create a file called tutorial.php and add this: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then you just include tutorial.php somewhere in your header, and you're good to go! Hope you like this :) Quote Link to comment Share on other sites More sharing options...
Raven1992 Posted February 5, 2014 Share Posted February 5, 2014 anyone tested this for v2 Quote Link to comment Share on other sites More sharing options...
dnenb Posted February 6, 2014 Author Share Posted February 6, 2014 Did you even glance at the code? :P It's for v2. Quote Link to comment Share on other sites More sharing options...
spikereloaded Posted February 7, 2014 Share Posted February 7, 2014 This is a little old but could you save using another column in the users table by setting a $_SESSION variable instead, as it's likely they'll only use it once? Quote Link to comment Share on other sites More sharing options...
dnenb Posted February 7, 2014 Author Share Posted February 7, 2014 This is a little old but could you save using another column in the users table by setting a $_SESSION variable instead, as it's likely they'll only use it once? Sure. I guess you could set a session variable when they register, and check if that exists when they log in. Or you could just check if "lastactive" has been set previously, and set a session variable for the tutorial if lastactive=0. Too many options :) But I like the way I did it, as it's easy to add a new tutorial step if there's a new feature in the game. Quote Link to comment Share on other sites More sharing options...
Newbie Posted February 7, 2014 Share Posted February 7, 2014 yeh session seems better but well done and thanks for the mod :P Quote Link to comment Share on other sites More sharing options...
dnenb Posted February 8, 2014 Author Share Posted February 8, 2014 Glad you like it! :) Quote Link to comment Share on other sites More sharing options...
Razor42 Posted February 11, 2014 Share Posted February 11, 2014 When I add this all I see is.... "you shouldn't see this"? Quote Link to comment Share on other sites More sharing options...
dnenb Posted February 11, 2014 Author Share Posted February 11, 2014 When I add this all I see is.... "you shouldn't see this"? Then $ir['tutorial_step'] doesn't have a value recognised. Did you add the field `tutorial_step` to the users table, as I said above? Quote Link to comment Share on other sites More sharing options...
Razor42 Posted February 11, 2014 Share Posted February 11, 2014 Yeah, default 1 also :) Quote Link to comment Share on other sites More sharing options...
dnenb Posted February 11, 2014 Author Share Posted February 11, 2014 Yeah, default 1 also :) Well, the code is simple enough. If you get to the default case in the switch, then $ir['tutorial_step'] has a value (if any) different than 1 or 2. Try echoing it out to see. Quote Link to comment Share on other sites More sharing options...
Tangled Posted November 12, 2014 Share Posted November 12, 2014 (edited) This works fine, but the tutorial doesn't disappear when the last link is done. I have to manually go in and enter a 0 in the database to clear it. G7470 gave me this fix to set the user in the data base to the next number signifying that the tutourial was finished and it disappears with the next click. Original code You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. add this into your last case: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. This is an example of what I did in mine You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited November 12, 2014 by Tangled Quote Link to comment Share on other sites More sharing options...
realmoflegends Posted June 7, 2015 Share Posted June 7, 2015 Just a bit confused...how would I add this one into my header.php? Thanks! Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted June 7, 2015 Share Posted June 7, 2015 You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. like so Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.