Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

*Save Game*

Status
Not open for further replies.

boredaholic

Programmer
Aug 20, 2007
6
US
ok i want to save like hit point and happiness points to a file on my server. to where they login and they start from where they were at.

What im doing is making an online feedable pet. but i need it to where the click the pet to login *no pass* and then feed the pet, play with the pet, click the pet to save what they did then come back later to find they need to feed it again. i dont have knowlege in php to do that but i figured i could make a save file for flash... how do i do that? i know it can be done... i just dont know how.

Please explain step by step.

Thank you.
 
YES EXACTLY!!! please help me set it up... im a little stupid at the moment lol...
 
Say you want to store a pet name in a SharedObject "petStatus".

The following reads a SharedObject - but if there isn't one it will create one. Then try reading "petName". If "petName" isn't set, it will set it to "Bob":
Code:
var so:SharedObject = SharedObject.getLocal("petStatus");
if (so.data.petName == undefined) {
	so.data.petName = "Bob";
	so.flush();
} else {
	trace(so.data.petName);
}
The first time you run this code you'll get nothing because the SharedObject does not exist. But the second time onwards you'll get "Bob".

Kenneth Kawamoto
 
ok so for the hp bar i would have to do this

var so:SharedObject = SharedObject.getLocal("petStatus");
if (so.data.hpbar == undefined) {
so.data.hpbar = "HPB";
so.flush();
} else {
trace(so.data.petName);
}

???

and then the same for the happy bar? if so then how does this.... uh... how does this save it on the server?
 
oops i forgot to change the last petName to hpbar... oh well you get the idea. I understand it says local... that mean it finds it on the persons pc's cache or w/e? or would it be on the internet? like my server's file?
 
where do i put that local thing? that local stuff will work fine... thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top