Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Load Array Command

Author
Message
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 29th Jul 2003 13:07 Edited at: 29th Jul 2003 13:09
I've made a simple map editor that holds tile numbers of a map in an array like so:

Map(X,Y)

So from the editor's perspective, the array values on the map would be:

(0,3)(1,3)(2,3)(3,3)
(0,2)(1,2)(2,2)(3,2)
(0,1)(1,1)(2,1)(3,1)
(0,0)(1,0)(2,0)(3,0)

Where Map(0,0) would access the tile in the bottom left corner. It all works well and I save the array with the line:
Save Array "File.map", Map()

However a strange thing happens when I load the map. I load it with:
Load Array "File.map", Map()

But it only loads the first set of indices, that is to say the only part that shows up is the left column on the map (anything where x = 0). The even stranger part is that if I click the load button again, it loads the rest of the map.

Anyone have any idea why this would happen and a way to fix it?

"Computers are useless they can only give you answers."
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 29th Jul 2003 13:41
Try using

Save Array "File.map", Map(0)
and
Load Array "File.map", Map(0)

Whatever I did I didn't do it!
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 29th Jul 2003 14:39
Already have, I've also tried Map(0,0) and it doesn't work either. At first I thought that was the problem also but the usage example that comes with DBP uses () as well.

"Computers are useless they can only give you answers."
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 29th Jul 2003 14:54
Don't worry, problem solved.
I thought you could still load a small array into a larger one but apparently you can't. Just had to Redim the array to the dynamic map size before loading it. Thanks anyway

"Computers are useless they can only give you answers."

Login to post a reply

Server time is: 2024-09-20 17:43:24
Your offset time is: 2024-09-20 17:43:24