This is getting to be beyond frusterating! [17]

Posted by Nighthawk on June 5, 2007, 11:46 p.m.

Okay, THE most demanded feature on my MMORPG project, Element, is saving and loading. EVERY RPG must have this, it'd be a real shame to spend all day leveling up your character only to start over the next day. So I tried adding it, and it seems to do okay, but I get a TON of errors when I try loading. When I turn errors off and load, the player stops moving properly and the chat doesn't work! I really could use a hand, as no one I've asked knows what's wrong, it really should work.

Things in stars are things that could be used to hack, to be safe, I won't share them publicly.

Saving:

io_clear()
var fid;
fid=file_text_open_write(string(*Variable Name*)+string(".ele"))
file_text_write_string(fid,scr_cipher(string(*Variable Name*),*Encryption Key*,1))
file_text_writeln(fid)

This part is repeated for the rest of the variables:

file_text_write_string(fid,scr_cipher(string(*Variable Name*),*Encryption Key*,1))
file_text_writeln(fid)

Loading:

io_clear()
var fid;
fid=file_text_open_read(string(global.username)+string(".ele"))
*Variable Name*=scr_cipher(file_text_read_string(fid),*Encryption Key*,0)
file_text_readln(fid)

At the end:

*Variable Name*=real(*Variable Name*)

Thanks for the help!

P.S.

Totally different topic, can I join a faction on ST? I was thinking Archaotica or Team Awesome. Do you just join? Or do you have to get invited?

Comments

Austin 17 years, 5 months ago

Suggestions:

Use INI files

Make the save files server side (if you do this, you won't need encryption)

Only save important things (x,y,room,password,name,level,etc.)

Nighthawk 17 years, 5 months ago

A) ini files are insecure, and a bit of a pain

B) With all these variables, the accounts folder could get pretty large.

C) Everything I save is 100% necessary.

Nighthawk 17 years, 5 months ago

But thanks anyway. [:)]

shad0w 17 years, 5 months ago

Do you close the files?

DFortun81 17 years, 5 months ago

First off, you should NEVER do this:

Quote:
*Variable Name*=real(*Variable Name*)
It's a bad idea in case you're using any prebuilt variables. (E.G: x)

When loading, just convert it to real. Like so:

io_clear();
var fid;
fid = file_text_open_read(string(global.username) + string(".ele"));
*Variable Name* = real(scr_cipher(file_text_read_string(fid),*Encryption Key*,0));
file_text_readln(fid);

-DF81

Kaz 17 years, 5 months ago

If I were making an MMORPG, I would save all the stats in a database to prevent any local hacking attempt. Plus it would get a bit cluttered with a bunch of random text files everywhere.

Bryan 17 years, 5 months ago

I was thinking Archaotica or Team Awesome

Archaotica is pretty much dead, and no, you can't join Team Awesome.

Arcalyth 17 years, 5 months ago

Archaotica is dead. There was only one loyal member. I'm with Team Awesome now.

I miss the name though. >_<

Nighthawk 17 years, 5 months ago

Aw… So I can't join either of them? [:(]

jsorgeagames 17 years, 5 months ago

Do you need to save just the stats, or could you just use game_load()?