The Daily Click ::. Forums ::. Klik Coding Help ::. Another fastloop problem
 

Post Reply  Post Oekaki 
 

Posted By Message

Robbert



Registered
  19/06/2003
Points
  420
27th January, 2006 at 19:04:43 -

Maybe you've read my previous topic. Maybe it was a little too difficult. This question is probably easier. It is still for my isometric engine. The player can decide of what size the map is. The map is always a square, so if you enter 200, it will be 200 x 200 tiles. To create the ojects (the ground tiles) I use a fastloop. Now I won't explain all of it, because most of you will not understand it, so I try to keep things simple.

On loop "mainloop":
* set alt val x to loopindex(mainloop)
* set alt val y to loopindex(mainloop)
* start loop "subloop" + Str$(loopindex(mainloop))

As you can see, at every step the mainloop takes, it will create a subloop. So when the map is 200x200 you'll have subloop0, subloop1, subloop2 and that goes on til subloop200. The problem is, how do I do the "on loop subloopN"-expression for 200 times? I do not want to repeat this event 200 times of course.

There should be an easy solution to this. Anyone?

 
Hey mates, I'm Iglo yeah =P!

Dark (DOE)



Registered
  25/04/2005
Points
  160
27th January, 2006 at 22:26:08 -

Simple, make a counter, always have it set to the loop you want to use, then when you go to do, "on loop subloopN" you use "on loop subloop+>GetValue"counter"< not sure if GetValue thats the proper expression, but you should get the idea" "number of times"

I didn't test that, but that should work, if it doesn't, perhaps someone else has an idea.

Image Edited by the Author.

 
Dark One Entertainment

Step Out Of The Light And Enter The Darkness
"Why do we need this?
Who was it that said,
Great things come to great men
Well that f**ker lied to us
There's nothing here but a wasteland."

Robbert



Registered
  19/06/2003
Points
  420
27th January, 2006 at 23:07:41 -

Thanks, in the meantime waiting for an answer I did think thoroughly myself of course and I also came up with this counter idea. But it does not work flawlessly. I have been trying to figure out what is wrong with this way, but I couldn't find out really.

Maybe I'll see it tomorrow.

 
Hey mates, I'm Iglo yeah =P!
   

Post Reply



 



Advertisement

Worth A Click