The Daily Click ::. Forums ::. Klik Coding Help ::. Best way to go about a grid map.
 

Post Reply  Post Oekaki 
 

Posted By Message

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
23rd June, 2007 at 08:49:30 -

Type the number before you complete the level - as soon as you destroy all the objects it looks for the value in the edit box, so it won't work if you type it in later. Like I said, it's not exactly polished - I wanted to keep it simple.

EDIT:

Found a bug. In frame 2, you need to make a change to line 3. The Y value should be:

( ( GroupItemValue( "Ini", Str$( value( "Counter" ) ), "y" ) - 1 ) * 60 ) + 2

The only difference is that the value 80 is replaced with 60. Otherwise a few of the cells won't work. That's because the grid cells are not squares but rectangles. I'm a bit embarassed that I missed that one actually...

The other thing I didn't mention, is that because all the data is stored in external files, just quitting the game won't clear it. If you want to start over with all the cells black again, you have to edit the files in notepad (or add an event or two).



Image Edited by the Author.

 
n/a

eyeangle



Registered
  12/06/2003
Points
  1683
23rd June, 2007 at 21:35:37 -

Sorry Sketchy, it's still not working.

I fixed up the bug, I type the level in first, I kill the baddies and press Map and there's nothing. I've tried this on every level.

 
theonecardgame.com

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
23rd June, 2007 at 22:29:10 -

Are you using MMF 1 or 2?
There appears to be a discrepancy between them, regarding the naming of the ini's. It's either in the way the ini object names files, or more likely in the way the Apppath$ function works (I haven't bothered to check it out).

The upshot is that if you're using MMF2 you need to rename the ini files to MapData.ini and SavedGame.ini (ie. just remove the "MapExample" bit at the beginning).

If you're using MMF1 I don't know why it isn't working. I'll look into it some more if renaming the ini's doesn't fix the problem for you.



Image Edited by the Author.

 
n/a

eyeangle



Registered
  12/06/2003
Points
  1683
23rd June, 2007 at 23:52:31 -

The ini files are already called MapData.ini and SavedGame.ini
There is no MapExample bit at the beginning of them. I'm using MMF2 so maybe it did that automatically already.

 
theonecardgame.com

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
24th June, 2007 at 08:51:45 -

I'm not talking about the MMF object names - I mean the actual windows file names - like in "my computer". The zip I posted had them with the wrong names, so they wouldn't work in MMF2 (actually, the savegame.ini would because it's created at runtime, but MMF can't load the info from MapData.ini which was preloaded in notepad).

Anyways, here's a (hopefully) MMF2 compatible example;

http://www.angelfire.com/mech/banshee/MapExample2.zip (copy&paste)

 
n/a

eyeangle



Registered
  12/06/2003
Points
  1683
24th June, 2007 at 21:00:53 -

Yep Sketchy, it worked! Thanks for all your time.

 
theonecardgame.com

eyeangle



Registered
  12/06/2003
Points
  1683
24th June, 2007 at 23:05:34 -

I just have to add one more condition that makes the overlay destroy when the map has been completed so we dont see the grid lines?

 
theonecardgame.com

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
25th June, 2007 at 09:31:22 -

What you need to do is create another counter in the second frame. In the same event that fills the grid cells in black, you add another action to add the value of "completed?" to the counter (it will add 1 if the level has been completed, or 0 if not). You then add one more event to check whether the counter is equal to the total number of levels, and if so, hide the overlay.

Example;
http://www.angelfire.com/mech/banshee/MapExample3.zip (copy&paste)

 
n/a
   

Post Reply



 



Advertisement

Worth A Click