View Single Post
Old 10-01-2012, 12:09 AM   PM User | #1
Saphr0ne
New to the CF scene

 
Join Date: Sep 2012
Location: Wisconsin
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Saphr0ne is an unknown quantity at this point
Visual Basic Help

So I'm making a console ASCII sandbox game in VB, and I've come to a problem. I want there to be a randomly generated world when you start the game, and the worlds are made like this:

Code:
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,6,6,6,6,6,6,6,6,6,6,6,6,6
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,6,6,6,6,6,6,6,6,6,6,6,6
7,7,7,7,1,1,1,1,1,1,1,1,1,1,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,6,6,6,6,6,6,6,6,6
7,7,7,7,1,0,0,0,0,0,0,0,0,1,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,6,6,6,6,6,6,6,6
7,7,7,7,1,0,0,0,0,0,0,0,0,1,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6
7,7,7,7,1,0,0,0,0,0,0,0,0,1,7,7,7,7,7,7,7,7,7,7,7,7,5,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6,6,6,6,6,6,6
7,7,7,7,1,0,0,0,0,0,0,0,0,1,7,7,7,7,7,7,7,7,7,7,7,7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,7,7,7,7,7,7,7,7,5,5,7,7,7,7,7,7,7,7,7,7,7,7,5,5,5,5,5,9,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,6,6
7,7,7,7,7,7,7,7,7,5,5,5,9,5,9,5,5,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5,5,5,9,5,5,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
7,7,7,7,7,7,7,7,7,7,5,5,5,5,5,9,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5,5,5,5,5,5,5,5,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5,5,5,9,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,5,5,5,5,5,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
And I've added this bit of code to my main.vb to generate a random conglomeration of the numbers above in the same 64x22 pattern.

Code:
Dim rnd As New Random

        For x = 0 To 64
            For y = 0 To 20
                Dim RndNo As Integer = rnd.Next(0, 8)
                cCon.WriteToBuffer(RndNo)
            Next
        Next
But currently it just writes all those numbers to the console before the game starts up, and I have no idea how to make it write to a file that needs to be called "world.map", because after that bit of code, the MapParser reads world.map to start the game.

Not only that, but I also need it to add the commas. Can anyone help?

Here's a download link if you want to look into the files yourself because my explanations are awful: http://www.sendspace.com/file/ob36ah

Thanks
Saphr0ne is offline   Reply With Quote