Posted By
|
Message
|
Lönnemyr
Registered 30/06/2008
Points 69
|
6th December, 2008 at 02:39:44 -
Again I have come across a problem I can`t find a solution to myself.. I`m probably just blind but heck, I feel like I`ve tried everything.
The problem is a really simple one though. I use a INI file to save some values, and there is only 6 of them. 3 of these values are stats, "attack", "defend" and "luck", and for some reason when I load them from the INI, "defend" don`t load properly. Instead it loads the "luck" value so the "defend" counter is set to whatever value the "luck" counter is. This makes no sence becuse the "luck" values loads after the "defend" value and I tried replace the counters and events and all.. there isn`t even that much events done yet so I have no idea what`s going wrong.
Anyway, thanks for reading. If you want to help you can download the file here (mmf2);
http://lonnemyr.googlepages.com/Dungeoncrawl.mfa
Edited by Lönnemyr
-
|
Del Duio Born in a Bowling Alley
Registered 29/07/2005
Points 1078
|
6th December, 2008 at 17:52:56 -
I can't check your file here now, but you should check the order of how you're loading back the ini in the event list.
For example, if you save to ini as:
Attack (val 10)
Defend (val 5)
Luck (val 3)
And load back as
Attack
Luck
Defend
By accident, your stats will be Attack 10, Defend 3, and Luck 5. It reads the position of what's written in the ini and gives the game variable that value, it doesn't just know that only the "Defend" stat should get what's written in the ini under "defend" regardless of position in the file.
Anyhow it's been awhile since I've used an ini but that's what it sounds like to me. Or maybe you've omitted a line to load a value from the ini by accident somewhere?
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
|
Jon Lambert Administrator
Vaporware Master
Registered 19/12/2004
Points 8235
|
6th December, 2008 at 18:28:07 -
I found the solution to your problem. If you look in the event list editor at the events in the INI EVENTS group, you have the actions in the wrong order for Load Counter = 2.
Load Counter = 2
INI: Set current item to "Luck"
Load Counter: Set counter to 3
Defend Counter: Set counter to value of "INI"
When it should look like this:
Load Counter = 2
Defend Counter: Set counter to value of "INI"
Load Counter: Set counter to 3
INI: Set current item to "Luck"
Yes. http://jonhlamb.googlepages.com/Dungeoncrawl.mfa
Sandwich Time!Whoo!
JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364
|
Lönnemyr
Registered 30/06/2008
Points 69
|
7th December, 2008 at 19:40:55 -
Aha! Thanks, I didn`t know it mattered in which order the events was set in the same line, I thought that it would finish all events set in one line before moving on to another. Well it`s fixed now anyway (I actually fixed it yesterday without knowing what or how I fixed it so thanks for pointing it out for me Lambert!).
A followup question is in order though..
My save event is in just one single line;
End of frame ---> set item ---> set value ---> set item ---> set value ---> set item ---> set value ---> set item ---> set value etc,,,,,
Is there any limitations on how much information I can save in this way... at the moment I save about ~40 values which is about ~80 "lines" (set item, then set value). Any chance this will be bad on some computers and/or will mmf crash on me. So far it seems to work fine though.
[EDIT; Now I have some problem with my permanent save/load function. I wan`t to find the INI file to see if everything get saved right, but I cant find it? I have a event which says; Start of frame: Set current file to: appdrive$ + appdir$ + myfile.ini ... I thought this would place the INI file in the same dictionary as the game is installed, but no.. it`s not there. In fact it`s not anywere to be found. So help me out with this too and I would be grateful. How can I track down this infidel?]
Edited by Lönnemyr
-
|
|
|