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 / making maps and editors?

Author
Message
darkbasic user
20
Years of Service
User Offline
Joined: 8th Nov 2004
Location:
Posted: 8th Nov 2004 09:52
ok i just started using darkbasic . i was changes from visual basic 6 and i find dark basic a lot better. but how do i make maps to sets the heights of each tile ? i kno in vb i would make a map editor and then save the tile pictures. Is there a way to make an editor and save the heights of that tile ? and then load that file to my project. i think i only really need the way to save and load it .
like i don't want to go in my code
set matrix height 1,0,0,100
and all through my map
thnx neways.
waffle
22
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 8th Nov 2004 23:29
the real answer to that Q varies from user to user....
The simple answer is to check out magik world. I'm using that as a basic editor for my game. It was coded in DBC and has a few glitches, but rapidly makes maps and is ok for placing objects.

How it works ....
When you make a matrix, and set the heights, MW creates an array
that stores all your map settings. Sure, you can do this easily yourself, but MW also has an interface. When MW saves your map,
it "simply " saves this data to a file, that you then load using
your own code. Actually, MW provides the code to load a level, but
you'll need to customize it a bit for you own tasks.

Example of my mod to MW:
MW default loader assumes static models without animation. Many of my models have multiple animations. So, in the loader, I need to detect animated models and ensure to load all animations and store
the start/stop frames for each one .... But, MW lets me place these
objects into the map easily.
darkbasic user
20
Years of Service
User Offline
Joined: 8th Nov 2004
Location:
Posted: 9th Nov 2004 06:38
i kinna want to do it the way i kno how rite now because it's kinna easier i think to do. like in visual basic i would have an array for the map say 25,25
the when i save i would loop through the array

i would also have a type for the icon but in this case i would use height
so i would have sumthing like this

open "file.txt" for input as #1
for xtile = 0 to 25
for ytile = 0 to 25
write #1,xtile,ytile,map(xtile,ytile).icon
next ytile
next xtile
close # 1

my question is can i do the same concept but change the array to matrix and change icon to height??


and oh ya can u not declare variables and types in dbc?? or if u can just give me one dim

like:
dim intage as integer
am i doing it wrong or sumthin?
darkbasic user
20
Years of Service
User Offline
Joined: 8th Nov 2004
Location:
Posted: 9th Nov 2004 09:49
ok never mind i found that program that you were talking about. but how do i load those maps i create into my project?
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 9th Nov 2004 13:42
try do your way that will be better for you

to save your map do something like this


`dim map(25,25)
`-----------save tile--------
if file exist(filename) the delete file filename
open to write 1,"filename"
for xtile = 0 to 25
for ytile = 0 to 25
write byte 1,map(xtile,ytile)
next ytile
next xtile
close file 1

`-----------load tile--------
if file exist(filename)

open to read 1,"filename"
for xtile = 0 to 25
for ytile = 0 to 25
read byte 1,map(xtile,ytile)
next ytile
next xtile
close file 1

endif

hope this help

You can do it if you try
darkbasic user
20
Years of Service
User Offline
Joined: 8th Nov 2004
Location:
Posted: 9th Nov 2004 20:45
is it hard to load the maps i create in magic world? or is it better for me to jsut get the matrix height of that tile and save them and then load them? i think i could do that.

and my other question how do i declare variables?
StOrM3
21
Years of Service
User Offline
Joined: 24th Sep 2003
Location: Cyberspace
Posted: 10th Nov 2004 11:01
You declare variables like this:

local variablename as integer
or

variablename as type
global variablename as float

or to do arrays:

dim arrayname(25,25) as integer

Note you only use dim for arrays
Which are by default global.

Hope this helps.

[PKE] Pain Killa Entertainment(tm) [PKE]
Pain Brings Reality...
[PKE] Pain Killa Entertainment(tm) [PKE]
darkbasic user
20
Years of Service
User Offline
Joined: 8th Nov 2004
Location:
Posted: 10th Nov 2004 11:06
does that only work in dpPro ? because that does not work in mine? i am using the demo rite now tho?
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 11th Nov 2004 01:47
thats only in DBP. You can make variables on the fly in DBC, its quite annoying and unstructured

Song of the whenever i feel like updating it....
Where dead bullies go, by Sugarplastic
darkbasic user
20
Years of Service
User Offline
Joined: 8th Nov 2004
Location:
Posted: 11th Nov 2004 06:51
ya i don't like not being able to declare variables it makes it so much harder especially when you can't use types. when i purchase it now i'm gonna get pro.

oh ya and by the way how can i save all the data for a map on one line i'll show u what i mean

like
matrix x,matrix y , map(matrix x , matrix y).height

the map is an array type i dunno if you can do that in db tho i kno you can in vb

would i do sumthin like this?

if file exist(filename) the delete file filename
open to write 1,"filename"
for matrix x= 0 to 25
for matrix y = 0 to 25
write byte 1,matrix x, matrix y , map(xtile,ytile)
next matrix x
next matrix y
close file 1

would that work so when it saved say the height was 100

it would look like this
0,0,100
and then next line would be for 0,1

you kno what i mean?
would that code work?
The Batsonator
20
Years of Service
User Offline
Joined: 15th Nov 2004
Location:
Posted: 15th Nov 2004 22:35
hey i was wondering whether its posible if i use the MAKE TERRAIN command and POSITION TERRAIN into 3D space, can I then load up the Col_Z object provided with the demos in DBP and have him walk up and down the hills on said terrain? Or is this easier to perform with the MAKE MATRIX set of commands?

3D Game Codelearner

Login to post a reply

Server time is: 2024-11-27 15:35:28
Your offset time is: 2024-11-27 15:35:28