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

jsorgeagames 17 years, 5 months ago

If you just need game_load(), I made an example that uses the slot system to save instead of dialog boxes or message boxes. It uses game_save() and game_load().

Nighthawk 17 years, 5 months ago

No, that works, but it messes up the online stuff so that most other players can't see you, and vice versa. I need to save only certain stats, like level, gold, ATK, DEF, Alignment, etc..

jsorgeagames 17 years, 5 months ago

Is it the file_text_write_string() stuff that's acting up? I don't know much about arrays, but maybe you could make an array of the stats?

jsorgeagames 17 years, 5 months ago

If you can't, I whipped up a little example for file_text_write_string(). Maybe you want to look at it? Here's the link: http://64digits.com/users/index.php?userid=jsorgeagames