The Daily Click ::. Forums ::. Klik Coding Help ::. using ini object to carry values though frames (tgf)
 

Post Reply  Post Oekaki 
 

Posted By Message

tetsuya_shino



Registered
  12/08/2004
Points
  491
14th March, 2009 at 12:42:17 -

Greetings. Programing is going well for my game, but I had a thought. Currently I plan to use an ini to save the 60 values I need. Before you'd exit a level, the ini would be save the current values. When you go to the next frame it would be set to load them. It's kinda a pain in the ass but it works. Does anyone know of a easier way? Thanks.

 
n/a

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
14th March, 2009 at 12:51:49 -

I don't know if "at end of frame> save values to ini" would work given the long task it had to do.

Instead of just jumping to the next frame initiate a little sequence-

Player collides with door; start "Save" fastloop for 60 loops.

On "save" loop= set value item> LoopIndex(save) > Global Value( LoopIndex("save") )
LoopIndex(save)=60; next frame.



Then;

Only run event once; start "load" fastloop for 60 loops.

On "load" loop= set global value LoopIndex("load") to ItemValue( "Ini", LoopIndex("load"))



Edit: sorry, didn't see you weren't using Global values. So disregard all that. Just use global values though if you're using MMF2. Save values to them and they'll transfer over frames.

Edited by Dr. James MD

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

tetsuya_shino



Registered
  12/08/2004
Points
  491
14th March, 2009 at 13:24:02 -

I'm uh, using tgf... lol But you gave me an idea. I could create a timer when the player should be going to the next frame that will delay leaving the frame by a second or two. That will give the ini enough time to record all the values.

 
n/a

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
14th March, 2009 at 13:24:57 -

Good call, that'd work!

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
14th March, 2009 at 13:37:49 -

There is a shiny 1000 Global values extension for TGF1.

 

  		
  		

tetsuya_shino



Registered
  12/08/2004
Points
  491
14th March, 2009 at 13:57:16 -

Does that carry values though frames? I'm already using that and the ini.

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
14th March, 2009 at 14:13:37 -

O_o It should. They are "global values." It would also lessen the strain on the player's hard drive.

 

  		
  		

tetsuya_shino



Registered
  12/08/2004
Points
  491
14th March, 2009 at 14:26:25 -

I know what you're thinking, but i never got it to work for me before...

question; if i made an active object global would its alt values be global too?

Edited by tetsuya_shino

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
14th March, 2009 at 14:34:04 -

Don't think so.

 

  		
  		

tetsuya_shino



Registered
  12/08/2004
Points
  491
14th March, 2009 at 14:38:04 -

i swear. i'm this close to redesigning the whole game to work with just tgf's 16 built in globals... although i'd have to scrap a lot of the cool ideas i had.

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
14th March, 2009 at 14:40:44 -

That would be unfortunate. If nothing else, upgrade to MMF2. That's what I plan on doing when I get enough money. I'm sure there's a way in good ol' TGF1 though... >_O HMMMMMMM

 

  		
  		

tetsuya_shino



Registered
  12/08/2004
Points
  491
14th March, 2009 at 14:49:49 -

in tgf is 000 different from 0? also what is the highest number value you can have in a tgf counter? i have a good idea

edit: I realized a way to store many values within on normal global value. I know it sounds crazy, but I can make my game only using the 16 global values. Gameplay would only be changed a little.

Now here is a new question; how do I set up an ini so I have more then one save slot?

Edited by tetsuya_shino

 
n/a

RedEnchilada

formerly RedEchidna

Registered
  01/08/2008
Points
  301

VIP MemberWii OwnerThe Cake is a LiePicture Me This Round 24 Winner!
15th March, 2009 at 22:15:52 -

Are you already using groups? If not, just set the group to
"Save" + Str$(Value("Save Slot"))
and it should work.

And if you're using groups but not items, use items where you used groups before, and follow the steps above.

And if you're using both, set the file to
Appdir$ + "Save" + Str$(Value("Save Slot")) + ".ini"
. Both methods should work as typed if the slot you're using is in a counter called Save Slot and you use it before saving, but decrypt your INIs before and encrypt after saving to avoid tampering. There was a link posted here for an encryption object somewhere, I'll see if I can find it.


And if you're still curious, yes, Alt. Values of global objects are carried across frames.

 
http://www.youtube.com/watch?v=WYrSD35vHo4
woooooooooooooooooaah maaaaaaaaaaaaaaaaaaaaan

tetsuya_shino



Registered
  12/08/2004
Points
  491
16th March, 2009 at 10:55:48 -

Wow, that's very helpful. Thank you.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click