Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

external save files that a player can load in the game

New Here ,
Jun 09, 2015 Jun 09, 2015

I am making a V-pet like game and I want my flash game to create a .txt file when the player saves his pet and can access it again at any time to battle against it. the saved information is its name,race,age,size,hunger level,happiness level,its rank and its state(asleep,hurt,etc) age,size and health will be Number var and the rest will be String var

any idea on how to make this? I plan to distribute the first prototype on a dedicated facebook page as soon as I get a basic race rooster and the save mechanic done so any help on making the saving system will be great.

TOPICS
ActionScript
328
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2015 Jun 09, 2015

it's easier to use a non-text file called a sharedobject.  that will also prevent players from 'hacking' your game.

var so:SharedObject=SharedObject.getLocal('pet_game','/');

if(so.data['your_pet_name']){

// this pet exists assign its characteristics from the saved data

} else {

// no such pet exists.  do whatever.

}

// when a player is ready to save their pet, call saveF passing the pet's name

function saveF(pet_nameS:String):void{

so.data[pet_nameS]={};

so.data[pet_nameS].race=

so.data[pet_nameS].age=

etc

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2015 Jun 09, 2015

will players still be able to share their save file with other players using this method?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2015 Jun 09, 2015

no, not easily.

if you want to save a text file so users can edit/share etc, use the filereference class to (or file class if you're creating an air app).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2015 Jun 09, 2015

could you point me to a site where I could learn how to work with classes? I got flash cc a week ago so im kinda n00b in the program

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2015 Jun 09, 2015

you don't need to use class file structure to use a flash class, though learning how to work with classes is a good idea, Learning ActionScript 3 | Adobe Developer Connection

here's the api to learn how to use the filereference class, Adobe ActionScript® 3 (AS3) API Reference

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2015 Jun 09, 2015

thanks a lot man

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2015 Jun 09, 2015
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines