How to save...

Game Editor comments and discussion.

How to save...

Postby regine » Sun Jun 03, 2007 9:43 am

How to save texts written with the Text Input function?
And how to load them later?
My project: Packs Adventure
Now finished: Packs Adventure Demo:http://game-editor.com/forum/viewtopic.php?f=4&t=3491
Demo features:
Level 1-3
Leveleditor
Full edition features:
50 Levels
Big Leveleditor
Bonus features
Fighting mode
...and more
regine
 
Posts: 109
Joined: Mon Aug 15, 2005 7:19 pm
Location: Germany
Score: 1 Give a positive score

Postby DilloDude » Mon Jun 04, 2007 2:36 am

Quite simple. You need to create a text variable in a savegroup. When you want to save the text, use this code:
Code: Select all
strcpy(string, text);//replace string with the name of your variable
saveVars...//fill in the appropriate data

when you want to load it, it's the same thing in reverse:
Code: Select all
loadVars...
strcpy(text, string);
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby regine » Mon Jun 04, 2007 6:18 am

It isnt functionally.
My project: Packs Adventure
Now finished: Packs Adventure Demo:http://game-editor.com/forum/viewtopic.php?f=4&t=3491
Demo features:
Level 1-3
Leveleditor
Full edition features:
50 Levels
Big Leveleditor
Bonus features
Fighting mode
...and more
regine
 
Posts: 109
Joined: Mon Aug 15, 2005 7:19 pm
Location: Germany
Score: 1 Give a positive score

Postby DilloDude » Mon Jun 04, 2007 6:42 am

What is it doing?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby regine » Mon Jun 04, 2007 8:54 am

It saves something, but it doesn't loads it.

Can you make a demo, please?
My project: Packs Adventure
Now finished: Packs Adventure Demo:http://game-editor.com/forum/viewtopic.php?f=4&t=3491
Demo features:
Level 1-3
Leveleditor
Full edition features:
50 Levels
Big Leveleditor
Bonus features
Fighting mode
...and more
regine
 
Posts: 109
Joined: Mon Aug 15, 2005 7:19 pm
Location: Germany
Score: 1 Give a positive score

Postby DilloDude » Mon Jun 04, 2007 11:57 pm

Here. It saves when you press enter. When inText is created, it loads, if there is saved data.
Attachments
StringSav.zip
Here it is
(174.81 KiB) Downloaded 124 times
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Joshua Worth » Tue Jun 05, 2007 11:52 am

Doing string manipulation will be much easier once GE goes C++ style(which could be a long time, nobody knows)
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron