I need help, I am trying to just make a single player RPG very low quality and kinda similar to the older runescape. I can’t seem to figure something out although. Right now I wrote a script so if I type in the AccountID field, “admin”. And the Password field, “admin”. And click “LogIn” Then it will do what I tell it. It works, I tested it and when I click Log in it replys to the console “ID & Password Are Correct.” (I know how to Application.LoadLevel and all that) But I don’t know how to make it to where while playing the game it’s saving everything that changes when my XP goes up, if I pick up some new items in the game. So when I go back to the game, type in my info and click log in it loads the players saved/stored information ie; items, experience, etc. How would I go about doing this? Here is my current code for the part mentioned above, i left out a couple other parts like the other gui buttons, this is just an example.
PS. I don’t care if i have to make more scripts than just one (Im sure I can’t get what im wanting to do into just a single script.
var stringToEdit : String = "AccountID";
var passwordToEdit : String = "My Password";
function OnGUI
{
// Make a text field that modifies stringToEdit.
stringToEdit = GUI.TextField (Rect (260, 240, 136, 20), stringToEdit, 25);
// Make a password field that modifies passwordToEdit.
passwordToEdit = GUI.PasswordField (Rect (266, 262, 138, 20), passwordToEdit, "*"[0], 25);
if (GUI.Button (new Rect(288,340,98,22), "Log In")) //If "Log In" button is pressed.
{
if(stringToEdit == "admin" && passwordToEdit == "admin") //If The text field is equal to "admin" and the password field is equal to "admin".
{
print("ID & Password Are Corect.");
//DoSomethingAlso
}
}
}