Page 1 of 2

Making the login and register.

Posted: September 16th, 2010, 6:50 pm
by daltonds1
*Before doing this tutorial please note this. we will be changing the menu when you get into the game and other things.
Please Backup your files and do this to the copy.

Also this is not 100% but it works
UPDATES ON THIS WILL BE POSTED SOON WITH A BETTER REG AND LOGIN SYSTEM


Now lets get started

This is what we will be adding today.


Now the first thing we will be doing is changing the screen when you get into the game

Go ahead and open up this
PlatinumArtsSandbox2.5 - Copy\data\lang\en\menus.cfg

In menus.cfg You are going to want to Search this

Code: Select all

            guibutton "Exit The Game"    quit    exit
Now you will come up with this

Code: Select all

        guilist [
            guibutton "Toggle Editmode (e)"    "edittoggle"
            guibutton "Load Map"        "showgui maps; MODE = (getmode); mode (getmode); initmapgui"
            guibutton "Load Custom Map"    "showgui loadmap"
            guibutton "Multiplayer"        "showgui multiplayer"
            guibutton "Help"        "showgui help"
            guibar
            guibutton "Options"        "showgui options"
            guibutton "Jukebox"        "showgui jukebox"
            guibutton "Change Skill Level"     "showgui skilllvl"
            guibutton "About"        "showgui authors"
            guibutton "Exit The Game"    quit    exit
Now. If you want, you change Keep all of these options on here or you can do what i did
If not skip to Option 2.

OPTION 1
(DELETE SOME POINTLESS THINGS AND THINGS FOR EDITING THE GAME)
So to make it cleaner you want to delete some pointless things.
I deleted this

Code: Select all

            guibutton "Change Skill Level"     "showgui skilllvl"
            guibutton "Jukebox"        "showgui jukebox"
            guibutton "Toggle Editmode (e)"    "edittoggle"
            guibutton "Load Map"        "showgui maps; MODE = (getmode); mode (getmode); initmapgui"
            guibutton "Load Custom Map"    "showgui loadmap"
            guibutton "Multiplayer"        "showgui multiplayer"
Now when you go to the menu all of these options will be gone. remeber you can also add them back
Now skip past option 2 since you did this

OPTION 2
So you dont want to delete them so what you will do is just Add the things i add above Toggle Edit mode (E)
----------------------

So after you have deleted those or keep them We are now going to want to start adding the Login and register Menu

So above one of the buttons one line of those codes you are going to add this

Code: Select all

			guibutton "Login"		"showgui login"
This basically will Add a button telling it to show a new GUI
Now for the register
Add this under the Login code

Code: Select all

            guibutton "register"        "showgui reg"
This is what it should look like

IF DELETED

Code: Select all

            guibutton "Login"        "showgui login"
            guibutton "register"        "showgui reg"
            guibutton "Options"        "showgui options"
            guibutton "About"        "showgui authors"
            guibutton "Exit The Game"    quit    exit
IF NOT DELETED

Code: Select all

   guibutton "Login"        "showgui login"
            guibutton "register"        "showgui reg"   
            guibutton "Toggle Editmode (e)"    "edittoggle"
            guibutton "Load Map"        "showgui maps; MODE = (getmode); mode (getmode); initmapgui"
            guibutton "Load Custom Map"    "showgui loadmap"
            guibutton "Multiplayer"        "showgui multiplayer"
            guibutton "Help"        "showgui help"
            guibar
            guibutton "Options"        "showgui options"
            guibutton "Jukebox"        "showgui jukebox"
            guibutton "Change Skill Level"     "showgui skilllvl"
            guibutton "About"        "showgui authors"
            guibutton "Exit The Game"    quit    exit
--------------------------

Alright so now if you go in the game you will see those 2 buttons but they do nothing atm if you click on them.
Now lets go ahead and add the LOGIN Menu
Go ahead and search (CTRL + F)

Code: Select all

newgui scratchpad
and right under the LAST ]

add this

Code: Select all

newgui login [
    guititle "Login"
    guibar
    guitext "Username:"
    guifield username 18
    guitext "Password:"
    guifield password 18
    guibutton "Login" "showgui UserMenu"
]
Now to explain
Gutititle = This is the title of the GUI
guibar = makes a bar separating them
guifield = This creates a text box and 18 = How many chars you can put in
guibutton = This makes a clickable button

Now for the register
Right under this ] of the login you are going to add

Code: Select all

newgui reg [
    guititle "register"
    guibar
    guitext "Username:"
    guifield username 18
    guitext "Password:"
    guifield password 18
    guitext "Email:"
    guifield email 30
    guibutton "Submit" "showgui login"
]
Now when you press Sumbit it will go ahead and show the LOGIN menu with your user id and pw already typed in.

Now you notice here

Code: Select all

    guibutton "Login" "showgui UserMenu"
You see showgui UserMenu

But we have no user menu.

This is also optional It will just create a new menu.
You can see at the end of the video

Right under the barracks add this

Code: Select all

newgui UserMenu [
    guititle "Welcome to the Game"
    guibar
    guitext "Welcome to the game. Please choose a option"
    guibutton "Play" [sp "dalton"]
    guibutton "Options" "showgui options"
    guibutton "Website" "showgui options"
    guibutton "Exit" quit    exit
]
Now. I do not have website working yet.

Now this will create that last menu.

Now to make the PLAY BUTTON WORK to go to your map
You are going to want to replace the word DALTON with your map name.

Save and thats it. Have fun

Re: Making the login and registar.

Posted: September 16th, 2010, 7:36 pm
by chocolatepie33
Nice tut, please try to simplify it, I almost got lost :)
quick FYI: It's register, not registar.

Re: Making the login and register.

Posted: September 16th, 2010, 7:51 pm
by PizzaLover101
lol, Nice tut, didn't read it all, and I have no use for it (yet) but hope I can someday

Re: Making the login and register.

Posted: September 18th, 2010, 10:30 am
by klimyriad
maybe when the master server is up mike/hirato and offtools may use this to keep online play under like a admin control which would be better for kids nice work.

Re: Making the login and register.

Posted: September 21st, 2010, 11:40 am
by arcones
Wow that's beautiful... Thank you so much for this tut!

I'm going to be using this for my game (eventually :P)

Arcones

Re: Making the login and register.

Posted: November 14th, 2010, 7:09 am
by goldstylez
thanks i will use:)

Re: Making the login and register.

Posted: November 17th, 2010, 2:54 pm
by Dial3ct
err... i didnt watch the vid but did you create a place that actually stores the values typed into the register part so that when it come to the login, it can verify if the username exists and if it does, does the password match the username?

Re: Making the login and register.

Posted: December 8th, 2010, 1:50 pm
by PizzaLover101
I have an idea:
Couldn't you make an svn type thing, and have it connect to a file there with a list of user names and encrypted passwords?

Re: Making the login and register.

Posted: December 10th, 2010, 8:19 pm
by daltonds1
I could but it would take time

Re: Making the login and register.

Posted: December 10th, 2010, 11:24 pm
by GR1M
Can you make it to where, once you hit register that information will send to a certain "email address"