The Daily Click ::. Forums ::. Klik Coding Help ::. Help with saving position of multiple of the same object using the INI extension
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
16th July, 2011 at 20:47:15 -

So im new to ini's. ive got a pretty basic thing going right now. theres an active object called "pet" with 1 alterable value set as "Attack". I have a save button, and a load button. theres a command that when you press spacebar it randomly selects 1 square on the invisible grid, and creates a "crystal" upon pressing the up arrow key it adds to the alterable value A of the crystal. every 5 alterable values the crystal grows. there are 3 stages, at stage 3 you can left click the crystal and it adds 1 to the alterable value of the crystal counter. upon right clicking the pet, it adds 1 to the pets attack, and minus's 1 from the crystal counters alterable value A. ive got my ini file to save the numbers correctly (ex, the attack of the pet and the amount of crystals). it also saves the position of the pet correctly. now i have it set to save the position of the growing crystals the same way i have the pet set, but for some reason when i load the crystals dont appear. im using the same object for the crystals, and as i said, upon pressing spacebar it creates one in a random spot. so the question is... how do i save the crystals in the same spots they are in, using the same animation they are on? eventually i want the Up arrow key event to be an over time event, that way you can leave the breeder and come back and your crystals will continue to grow from where you left off, but alas, i have no idea how to do this. anyone care to help?

 
[Game design makes my brain feel like its gonna explode.]

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
16th July, 2011 at 21:03:11 -

You may want to read about Spread Values. I have a feeling this would be of GREAT help to you in this situation.

What this will do is set one Alterable Value of your choice to a unique number for copies of a single object, so that even if the objects are otherwise identical, they will still be able to be identified as unique whenever this Alterable Value is referenced.

Here's a widely-referenced article here on TDC regarding Spread Values:

http://www.create-games.com/article.asp?id=1798

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
17th July, 2011 at 19:27:33 -

although that article was extremely helpful im still not sure how to implement it into saving using an ini file. should i try and use array? i dont know anything about arrays either though

 
[Game design makes my brain feel like its gonna explode.]

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  1078

Candle
18th July, 2011 at 02:34:10 -

You'll have to do something about referencing the Alterable Values in the INI file. If you can't solve it and no one else solves it for you, then as I see it you have three options:
- keep hammering away at it until you figure it out for yourself;
- visit the clickteam forums and ask around and/or look for examples;
- find a work-around that doesn't use arrays but still works out and saves everything the way you need it in an INI file.

Good luck, man.

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
18th July, 2011 at 06:53:00 -

Ill probably just hammer away till i figure it out myself, i learn best that way. thanks for the help

 
[Game design makes my brain feel like its gonna explode.]

Jenswa

Possibly Insane

Registered
  26/08/2002
Points
  2722
18th July, 2011 at 18:52:43 -

Not that this will fix your problem, but

when you press SPACE or was it the UP key? Anyway when you create a crystal in a random spot, that's the event that should give the currently created crystal another value in its alternative value so it can be identified.

This means instead of spreading alternative values at the start of the frame, it's about numbering your copies of the crystal when they are created. So you probably should have a (global) value or score counter that keeps track of the number of crystals, the new crystal will then be created with a number one higher that the previous crystal.

It's like a basic numbering system with the numbers in alternative value A of the crystal object.

Hope this helps and happy coding

 
Image jenswa.neocities.org

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
18th July, 2011 at 22:54:58 -

yeah thats what i did for my zombies in celestia, cuz they spawn up out of the ground, and if they were number at the beggining it would get all messed up and the zombie would dissapear from certain detectors but the detector would stay etc. thanks for the info though

 
[Game design makes my brain feel like its gonna explode.]
   

Post Reply



 



Advertisement

Worth A Click