A text to map converter /!\ OLD version

General talk about the map making process.
Post Reply
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

A text to map converter /!\ OLD version

Post by lddw »

This is the second version fo my converter.
It convets a text file to a map.
I've don a pacman map with that.

Here is the source:
PRINT "text to map converter by LDDW"
PRINT
PRINT "In a text file you can have:"
PRINT "a # for a box"
PRINT "a X for a flag zone"
PRINT "a 0 for nothing"
PRINT

PRINT "size of each box"
PRINT "conseilled is 10"
INPUT s
IF s = 0 THEN s = 10
PRINT
PRINT "height of each box"
PRINT "conseilled is 15"
INPUT height
IF height = 0 THEN height = 15


PRINT "text input:"
PRINT "conseilled is C:\test.txt"
PRINT "if the text file is C:\pic.txt you enter c:\pic.txt"
INPUT "What text file do you want to use ", tex$
IF tex$ = "" THEN tex$ = "C:\test.txt"

PRINT "map output:"
PRINT "conseilled is C:\map\map.bzw"
PRINT "if the map file is C:\map.bzw you enter c:\map.bzw"
INPUT "What text file do you want to use ", map$
IF map$ = "" THEN map$ = "C:\map\map.bzw"

p = 0
's = 10
OPEN "i", #1, tex$'"c:\test.txt"
WHILE NOT EOF(1)
LINE INPUT #1, a$
q = q + 1
IF LEN(a$) > p THEN p = LEN(a$)
WEND
'p = 800 / p
'q = 800 / q
CLOSE
p = p * s
q = q * s
OPEN "i", #1, tex$ '"c:\test.txt"
OPEN "o", #2, map$ '"c:\map\output.bzw"
CLS
x = p - s
y = -q + s

PRINT #2, " world"
PRINT #2, " name Simple World"
PRINT #2, " size "; p; " "; q
PRINT #2, " END"



WHILE NOT EOF(1)
INPUT #1, a$

FOR e = 1 TO LEN(a$)
aa$ = MID$(a$, e, 1)
IF a$ = "#" THEN a = 1
IF aa$ = "M" THEN
PRINT #2, "box"
PRINT #2, "name Box"
PRINT #2, " position "; x; " "; y; "0"
PRINT #2, " rotation 0"
PRINT #2, " size "; s; " "; s; " "; height; ""
PRINT #2, "end"
PRINT #2,
er = er + 1
END IF

IF aa$ = "X" THEN
PRINT #2, "zone"
PRINT #2, " position "; x; " "; y; "0"
PRINT #2, " rotation 0"
PRINT #2, " size 0.01 0.01 0.01"
PRINT #2, " flag good"
PRINT #2, " flag bad"
PRINT #2, "end"
PRINT #2,
er = er + 1
END IF



x = x - 2 * s
NEXT e
y = y + 2 * s
x = p - s
WEND
CLOSE
PRINT "Conversion finie"
PRINT "conversion finished"
PRINT "your map is on "; map$
PRINT "X", "Y", "XxY", "boxes"
PRINT p, q, p * q, er
SLEEP
Attachments
CONV40.zip
The exe file
(33.25 KiB) Downloaded 244 times
Last edited by lddw on Mon Jun 19, 2006 6:14 pm, edited 1 time in total.
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
JPT
Private First Class
Private First Class
Posts: 260
Joined: Tue Nov 29, 2005 1:21 pm
Location: Germany

Post by JPT »

Is your programm really working ?
I entered correct paths and i only got this:

Code: Select all

        world
        name Simple World
        size  75   55 
        END
I used this pattern:

Code: Select all

000000000000000
0#############0
0#############0
0000000#0000#00
0000000#000#000
0000000####0000
0000000#0000000
000#000#0000000
000#000#0000000
0000###00000000
000000000000000
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

What you've done is right, i've done an error

Here is the finished version
Attachments
convert2.zip
The final version
(33.25 KiB) Downloaded 246 times
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
User avatar
sid6.7
Private First Class
Private First Class
Posts: 614
Joined: Mon Oct 06, 2003 9:58 pm
Location: West USA
Contact:

Post by sid6.7 »

cool another qbasic(basic) follower....thats what i made bzrand
with...nice...how long you been doing qbasic?
JPT
Private First Class
Private First Class
Posts: 260
Joined: Tue Nov 29, 2005 1:21 pm
Location: Germany

Post by JPT »

You just need 1-2 weeks of experience and you can do mostly everything ;)
I did QB 1 year ago...i should refresh my knowledge about that...


EDIT: Cool, your programm is really working now !

Functions you can add:

- set a special height for the boxes
- a random height / size function (with setable limits)
- a symbol to convert to pyramids ;)
- and a symbol for flipped pyramids ... if possible

I think your programms are supporting the small map builders to realize their ideas. Keep it up !
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

Well, i'm 15 and i tried Qbasic 3 years ago.
I've done a lot of programs.

I'm happy it can be useful for some of you. I'm not at home, but i'll try to do the updates.

What do you mean by set a special height for the boxes ?
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
JPT
Private First Class
Private First Class
Posts: 260
Joined: Tue Nov 29, 2005 1:21 pm
Location: Germany

Post by JPT »

in normal case, you've the following box:

Code: Select all

box
name box
position X Y 0
size X Y Z
rotation 0
end
with special height, for example 15, i mean this:

Code: Select all

box
name box
position X Y 15  <--
size X Y Z
rotation 0
end
It would be a simple INPUT and PRINT #x,... thing.
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

Done. It becomes longer and longer.
I've not tested it.
PRINT "text to map converter by LDDW"
PRINT
PRINT "In a text file you can have:"
PRINT "a B for a box"
PRINT "a P for a pyramid"
'PRINT "a Q for a flipped pyramid" i'll do it later.
PRINT "a F for a flag zone"
PRINT "a 0 for nothing"
PRINT

PRINT "X and Y size of each box"
PRINT "conseilled is 10"
INPUT s
IF s = 0 THEN s = 10
PRINT
PRINT "Z size of each box"
PRINT "conseilled is 15"
INPUT height
IF height = 0 THEN height = 15

PRINT
PRINT "Z position of each box"
PRINT "conseilled is 0"
INPUT poss
PRINT
INPUT "do you want a random size? (Y/N)", deff$
IF deff$ = "Y" OR deff$ = "y" THEN
INPUT "smallest height", sma
INPUT "highest height", hig
cdf$ = "1"
END IF



PRINT "text input:"
PRINT "conseilled is C:\test.txt"
PRINT "if the text file is C:\pic.txt you enter c:\pic.txt"
INPUT "What text file do you want to use ", tex$
IF tex$ = "" THEN tex$ = "C:\test.txt"

PRINT "map output:"
PRINT "conseilled is C:\map\map.bzw"
PRINT "if the map file is C:\map.bzw you enter c:\map.bzw"
INPUT "What text file do you want to use ", map$
IF map$ = "" THEN map$ = "C:\map\map.bzw"

p = 0
's = 10
OPEN "i", #1, tex$'"c:\test.txt"
WHILE NOT EOF(1)
LINE INPUT #1, a$
q = q + 1
IF LEN(a$) > p THEN p = LEN(a$)
WEND
'p = 800 / p
'q = 800 / q
CLOSE
p = p * s
q = q * s
OPEN "i", #1, tex$ '"c:\test.txt"
OPEN "o", #2, map$ '"c:\map\output.bzw"
CLS
x = p - s
y = -q + s

PRINT #2, " world"
PRINT #2, " name Simple World"
PRINT #2, " size "; p; " "; q
PRINT #2, " END"



WHILE NOT EOF(1)
INPUT #1, a$

FOR e = 1 TO LEN(a$)
IF cdf$ = "1" THEN height = INT(RND * (hig - sma) + sma)
aa$ = MID$(a$, e, 1)
IF a$ = "B" THEN a = 1
IF aa$ = "B" THEN
PRINT #2, "box"
PRINT #2, "name Box"
PRINT #2, " position "; x; " "; y; poss
PRINT #2, " rotation 0"
PRINT #2, " size "; s; " "; s; " "; height; ""
PRINT #2, "end"
PRINT #2,
er = er + 1
END IF


IF aa$ = "X" THEN
PRINT #2, "zone"
PRINT #2, " position "; x; " "; y; "0"
PRINT #2, " rotation 0"
PRINT #2, " size 0.01 0.01 0.01"
PRINT #2, " flag good"
PRINT #2, " flag bad"
PRINT #2, "end"
PRINT #2,
er = er + 1
END IF

IF aa$ = "P" THEN
PRINT #2, "pyramid"
PRINT #2, "name Pyr"
PRINT #2, " position "; x; " "; y; poss
PRINT #2, " rotation 0"
PRINT #2, " size "; s; " "; s; " "; height; ""
PRINT #2, "end"
PRINT #2,
er = er + 1
END IF



x = x - 2 * s
NEXT e
y = y + 2 * s
x = p - s
WEND
CLOSE
PRINT "Conversion finie"
PRINT "conversion finished"
PRINT "your map is on "; map$
PRINT "X", "Y", "XxY", "boxes"
PRINT p, q, p * q, er
SLEEP
Attachments
Conv40.txt
The exe application.
IT ISN'T AAN TEXT FILE!
Pease change .txt to .exe
I can't post .exe files.
(46.49 KiB) Downloaded 256 times
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
User avatar
Tanner
Private First Class
Private First Class
Posts: 575
Joined: Sat Sep 17, 2005 3:46 am
Location: Atl, GA
Contact:

Post by Tanner »

Last version won't start - crashes.

-Tanner
Tanner - Segway HT i180 Red Owner - Random Map Creator - BZStocks - TS Software

Image
dango
Private First Class
Private First Class
Posts: 1400
Joined: Sun Feb 06, 2005 5:40 pm
Location: Somewhere over there.

Post by dango »

after i complete everything it says something in.. french? i don't know. well it says that then crashes, doesn't make any bzw or nothing.

tried 2nd version:

Code: Select all

Path not found in line No line number in module CONV40   at address 055E:02A7

Hit any key to return to system
Image
User avatar
sid6.7
Private First Class
Private First Class
Posts: 614
Joined: Mon Oct 06, 2003 9:58 pm
Location: West USA
Contact:

Post by sid6.7 »

hmm it sounds like it doesnt like
c:\map or if you dont have a c:\map
it wouldnt like it either...


just zip up the file like you did before
for putting a file here...making it a txt
file may have screwed it up...


in qbasic i think you can do a compare?
compare the previous version to the new
version file...it will show you what changed?
JPT
Private First Class
Private First Class
Posts: 260
Joined: Tue Nov 29, 2005 1:21 pm
Location: Germany

Post by JPT »

It's not easy to share exe files...

The easiest thing to do would be:

1) get Qbasic... (1.1 would be enough, to build exe files use 4.5)
2) copy the source he posted to a text file and save it.
3) open command or cmd and open qb in it.
4) Load the file
5) Go to the Run menu. There you'll find an option like "create exe file"
6) enjoy it.
User avatar
sid6.7
Private First Class
Private First Class
Posts: 614
Joined: Mon Oct 06, 2003 9:58 pm
Location: West USA
Contact:

Post by sid6.7 »

lddw

when you have time... :)
now lets add "T" for teleporter


when ever it finds a "T" it assigns it a number X
adds tele to the map file

then it goes thru a routine and randomly
connects all the links using X thru LAST X
then adds link to map
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

OK
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

I´m working on it.
The new version will be ready in few days. :)
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

This program is finished:

It decrase the number of boxes.
Last edited by lddw on Mon Jun 19, 2006 6:01 pm, edited 1 time in total.
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

I´ll do soon a new program to make it easier to do some map.
It will include a text ediror...



No one tested my programm?
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
User avatar
Tanner
Private First Class
Private First Class
Posts: 575
Joined: Sat Sep 17, 2005 3:46 am
Location: Atl, GA
Contact:

Post by Tanner »

Hiya lddw!

I can't get it to work. Maybe something is lost in the .txt to .exe conversion? Try zipping it up if possible.

Cheers
-Tanner
Tanner - Segway HT i180 Red Owner - Random Map Creator - BZStocks - TS Software

Image
User avatar
lddw
Private First Class
Private First Class
Posts: 239
Joined: Mon Jun 27, 2005 3:39 pm
Location: France

Post by lddw »

Hi Tanner,
i´ll zip it the next time.

This program create the folder "c:\map", maybe it bugs...
OWNER at lddw's servers
Citrus.admin
Cruel.admin
WinXP.admin
Spazzy.cops
Metec.mapper
Heart.trusted
Post Reply