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.

2D All the way! / making a data map something else???

Author
Message
Armeggadon
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 30th Apr 2003 04:23
is ti possible to make a data map (aka.
data 1,5,1,1,1,1,1,1,5,4,9
data 2,5,1,1,1,1,1,1,6,8,6
data 2,5,1,1,1,1,1,1,2,5,9
etc.

anyway is it possible to maybe write that in a .txt file instead of filling up a ton of space at the bottom of my code. and if so then how would i have it so that it reads that as the map data. if you dont understand what im asking ill try to see if i can reword it.
Current Status: learning MORE about dbpro
I consider myself: newb
Steven Craft
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 30th Apr 2003 05:30
Yes this is all very possible, the game I have been working on for a uni project reads in lots of information from external files, the main information read in is:
1. map parameters (map size, tile size, etc.)
2. map data (what sprites go where on the map
3. collision map (works out what needs to have collision)

I don't by any means claim to be an expert with darkbasic, I am very new to the language in general, but from what I could find there isn't a command to read INT's from an external text file, instead I used someone else's routine, which I modified to get the INT's. I then stored them appropiately, for the MapData and Collision Map it was logical to store the data in a two dimensional array.

The main areas you might want to check (the help file..) is file commands (reading/writing) and Array (using 'Dim').

If you can't find any information at all I could paste some modules from my code which demonstrates some of these idea's, let me know,

Steve

Armeggadon
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 30th Apr 2003 06:55
thx i'll look into those. the most i ever did was a simple password entry that saved to a .txt file and then loaded the saved array but i still had to write out the array of names and passwords into the code itself and have a seperate .txt file with the same info. i'll look into the help files(i haven't actually REALLY looked at those yet. i skimmed them but that was about it) oh well ill do it tomorrow its time for me to got to bed. if anyone else has advice feel free to post. ( i think this may be the first ppost that i haven't acually edited)

Current Status: learning MORE about dbpro
I consider myself: newb
Jonny_S
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 30th Apr 2003 23:41
I think you could also make a separate source file, add the DATA commands and then if your using DBC use the include# command (something like that) or if your using DBpro the taskbar to the side has a section where you can just add files. Also obviously make sure the source is in the same directory as your project

CURRENT PROJECT - FIGHT OF THE CENTURY VIST
http://www.freewebz.com/supermonkeysmansion
Armeggadon
21
Years of Service
User Offline
Joined: 10th Apr 2003
Location: United States
Posted: 2nd May 2003 01:36
ok sry i haven't responded yet i've been real busy(school takes priority over programming) but i've decided to do the source. it will be eassy to make big maps and just save them as a level source but one question. how do i tell my main source file(all my controls and loops) to read the other source files for that certain level or map(ex. in mine i have an above ground and underground level. they are saved a ground.dba and underground1.dba) my level starts on the ground level but how would i make a point where if you hit that point then it jumps to next to that spot on the underground map and vice-versa so that if you move back into the spot where the hole is that it will teleport you next to the hole on ground.dba thx if you can help i tried to be descriptive in asking so i hope you know whaqt i am asking. thx

Current Status: learning MORE about dbpro
I consider myself: newb
Jonny_S
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 3rd May 2003 02:33
So are you using pro or DBC Ill try and do an example within the next few days, Im the same as you, school is priority.

CURRENT PROJECT - FIGHT OF THE CENTURY VIST
http://www.freewebz.com/supermonkeysmansion
Steven Craft
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location:
Posted: 3rd May 2003 15:42
For my game, I have a few seperate levels, I have a vairable called 'MapName$', and I set this to the name of the level, I have all the level data in a subfolder, for example, in my games working directory there are folders:
-Level1
-Level2
-Level3

Then in each folder are the level data, for example, in Level1
\Level1
Level1.bmp
Level1.col
Level1.ini
Level1.dat

So, when you get to end end of level 1, variables need to be reset, then MapName$ is set to = "Level2", etc.

This is obviously just a rough guide, but I normally find you learn the most when you try and work out as much as possible yourself.

If however you still can't work out how to implement the method I have suggested, or any other ones, leave another message and I'll try and write a short example program for you.

-Steve

Login to post a reply

Server time is: 2024-04-25 04:42:18
Your offset time is: 2024-04-25 04:42:18