Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error
Making a tile map but ran into a error Making a tile map but ran into a error
Making a tile map but ran into a error
Go Back  Xtreme Visual Basic Talk > > > Making a tile map but ran into a error


Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2007, 02:12 PM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default Making a tile map but ran into a error


Code:
Imports System.IO
Public Class clsMap
    Dim SR As StreamReader

    Public NumColumns As Integer
    Public NumRows As Integer
    Public Tiles(,) As Bitmap

    Dim NumOfTiles As Integer

    Public Sub ReadMap(ByVal MapFile As String)
        SR = New StreamReader(MapFile)
        Dim ln As String
        ln = SR.ReadLine()
        Dim str() As String
        str = ln.Split(CChar(","))
        NumColumns = CInt(CDbl(str(0)) - 1)
        NumRows = CInt(CDbl(str(1)) - 1)
        ReDim Tiles(NumColumns, NumRows)
        Dim CurrentRow As Integer
        Dim CurrentColumn As Integer
        Dim Line() As String

        For CurrentRow = 0 To NumRows
            ln = SR.ReadLine()
            Line = ln.Split(CChar(","))
            For CurrentColumn = 0 To NumColumns
                Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg")
            Next
        Next
        SR.Close()
    End Sub
End Class
Code:
Public Class Face
    Dim map As clsMap
    Dim PushedOtherKey As Boolean

Private Sub Face_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    map = New clsMap()
End Sub

Private Sub Face_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
    Dim x ,y As Integer
    For x = 0 To map.NumColumns
        For y = 0 To map.NumRows
            e.Graphics.DrawImage(map.Tiles(x, y), x * 35, y * 35)
        Next
    Next
End Sub
End Class
The error I get when trying to Debug this is "Object reference not set to an instance of an object." Which I have no idea what it means.
It is Pointing at the Line: 30
Code:
Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg")
Can someone please help me?
Reply With Quote
  #2  
Old 09-29-2007, 06:59 AM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

Well...that message sounds like something is null. Check the debugger to see if anything is. I'm too rusty in VB so my code isn't gonna help you much but try putting this and seeing what happens:

Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg", True)

But I doubt that'll do anything because something in all of that code is null and I'd need the program to see what is. The string could be nonexistant, the Tiles array could be nonexistant...

But the code isn't what I'd be worried about. The program is going to have to read in a bunch of file names which is extremely slow (the more you have the slower it'll be). I'd recommend you load images from resources, it's sooooo much quicker and you won't need folders when you package up your program.
Reply With Quote
  #3  
Old 09-29-2007, 08:11 AM
Iceplug's Avatar
IceplugMaking a tile map but ran into a error Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Can you confirm that any of the bitmap are loading correctly (right file name, can put in a picturebox)?
What values of CurrentColumn and CurrentRow does the error occur with?
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #4  
Old 09-29-2007, 10:21 AM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default

Thanks for your inputs!

First of all..
Code:
Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg", True)
Didn't change anything as you suspected.

Good idea about loading the images from .resx file. I will most likely do that later but I'm learning from a tutorial right now and this wasn't supposed to have any errors which is strange.

Quote:
What values of CurrentColumn and CurrentRow does the error occur with?
I'm not that great at debugging but I did go and just click "step into" though the whole debug until the error came. The error came at first attempt to do the loop so I'm guessing the Values must have been 0,0.

Also I don't get any pictures on the debug form.


I commented out
Code:
map.ReadMap(map.txt")
Then I just tried loading a one single picture(tile) with the paint event.
Code:
e.Graphics.DrawImage(New Bitmap("tiles\1.jpg"), 5, 5)
And The next debug had no errors and the picture loaded perfectly.

So I think the filenaming is not the problem.

EDIT:
This is what my map.txt files looks like:
Code:
25,15
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
I know it's silly making a tile map if I'm only loading 1 picture with it but I wanted to make sure it's working before I start mixing it up with other pictures aswell.

Last edited by Dekaras; 09-29-2007 at 10:27 AM. Reason: added some extra info
Reply With Quote
  #5  
Old 09-29-2007, 02:52 PM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

If 0,0 is the problem try starting at 1,1 maybe? I'd try 1,0 and 0,1 first but it may just be the program doesn't like starting at 0. I know arrays are 0-based but maybe something in your code is making the tiles actually start on 1's.
Reply With Quote
  #6  
Old 09-29-2007, 04:51 PM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default

There could be something about that..
In the tutorial these lines:
Code:
str = ln.Split(CChar(","))
NumColumns = CInt(CDbl(str(0)) - 1)
NumRows = CInt(CDbl(str(1)) - 1)
Line = ln.Split(CChar(","))
Didn't have any converters.

It was written like this in the tutorial:
Code:
str = ln.Split(",")
NumColumns = str(0) - 1
NumRows = str(1) -1
Line = ln.Split(",")
BTW, The " - 1" in:
Code:
NumColumns = CInt(CDbl(str(0)) - 1)
'and
NumRows = CInt(CDbl(str(1)) - 1)
Are supposed to make the array start at 0,0.

I was forced to add the converters into the code because of the "Option Strict" error.
I tried Disabling "Option Strict" in Tools > Options > Projects and Solutions > VB Defaults
But It still was forcing me to convert, Strange I couldn't disable it.

Could this be what is causing the error I am getting. "Object reference not set to an instance of an object." from the line?:
Code:
Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg")
If so is it possible to disable the option strict?
Reply With Quote
  #7  
Old 09-29-2007, 05:50 PM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

Option strict is there to catch compile-time errors, not run-time. Like putting CInt to convert whatever to int. That's a good thing to have on because it helps you understand a little bit more of what the compiler is actually doing. Having it do the conversions for you is easy mode programming. So for it to run and give you that error, it's not an option strict thing. It's basically telling you something is null and you need to figure out what it is. It's either the Tiles array with those numbers in it (0,0), CurrentColumn, CurrentRow, or the Bitmap string.

I'm pretty sure the string is fine, as is CurrentColum and CurrentRow because they would at least have 0's and not be null. The problem I'd think is in your Tiles array. You ReDim the Tiles array at one point but I'm unable to tell what numbers are going in it.

Run the program and when it halts at the error set your mouse over each variable in the line. A small box will come up telling you what values are inside. I'm going to need those values to help more I think, but I'm pretty sure one of those will come up as null. You can also check out the entire array size of the Tiles and see what the 0,0 says in it.
Reply With Quote
  #8  
Old 09-29-2007, 06:27 PM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default

I got the info you needed and I wrote it in comments below.
Code:
For CurrentRow = 0 To NumRows ' == 14
ln = SR.ReadLine()
Line = ln.Split(CChar(","))
For CurrentColumn = 0 To NumColumns ' == 24
Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg")
'tiles is "Tiles|Nothing".  CurrentColumn us 0 and so is CurrentRow
Next
Next
I'm slightly confused now because I'm not sure if I understand 100% what the "Line(CurrentColumn)" does.
What it should do is type the number "1" to the bitmap string and make the picture come on the Currentcolumn in the array like this:
(1,0)
(2,0)
etc etc
(24,0)
(0,1)
(1,0)
etc
(3,1)
etc etc
(24,1)
(0,2) and so onward.
until (24,14)
Reply With Quote
  #9  
Old 09-29-2007, 07:03 PM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

I'm still not seeing the problem

Check to see if this exists though: tiles\0.jpg

It's erroring with CurrentColumn at 0 so I'm thinking that file just doesn't exist.

What Line(CurrentColumn) is doing taking Line() which is a string variable and making a string with what's in the (), which in this case is CurrentColumn, which is set at 0. Thus the string output it gives is 0. That's why I'm thinking 0.jpg is just nonexistant, especially since Tiles(0,0) is coming out to equal the null value.
Reply With Quote
  #10  
Old 09-29-2007, 07:54 PM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default

Still not sure if I understand fully what and/or how Tiles(CurrentColumn) does/works.
It's supposed to read the numbers from my map.txt file. Since all my numbers in the text file is atm 1 (will make more variation of numbers later) it should be storing the number 1 in it.

If I wanted to have the number of CurrentColumn there I would just type CurrentColumn instead of tile(CurrentColumn) I think atleast.

I tried typing just Line and Line() but Then that becomes the error so I'm really confused.

I don't have a 0.jpg picture. Only 1.jpg.
I also tried renaming the pic to 0.jpg but It's the same error and same values.
Line() is supposed to read from the textfile what the name of the next pic will be.
Reply With Quote
  #11  
Old 09-29-2007, 10:44 PM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

Just try this code first to see if this works. It's not a solution, just a test. Comment out the loops and the lines with ln and line inside the loops. Then put this:


CurrentColumn = 1
CurrentRow = 1

Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg")

e.Graphics.DrawImage(Tiles(1,1), 5, 5)

Eh, to be honest I'm not even sure if this test is gonna work since my VB sucks, but you see what I'm trying to do. Put in values for the array without loops and try to draw that array and see if it works.
Reply With Quote
  #12  
Old 09-30-2007, 05:09 AM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default

I understand now how the Line() works after I had a good nice and looooong sleep

ln.split(",") reads the line in map.txt which is
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
Then it splits it to it becomes a array like this
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Not sure if that was a good demonstration but let's go on..
Now if i want to access the first "1" in that line I have to type Line(0)
Line(0) is the same thing as typing "1".
If I wanted the fifth "1" from that line I would type Line(4) which is also same thing as typing manually just "1" instead of Line()

So I understand now exacly why CurrentColumn is inside the Line().
CurrentColumn goes from 0 to 1 to 2 all the way to 24.
And there are 24 different numbers in Line() array.

So now that I understand how Line() works I'm 99.9% sure it's working perfectly so it must be something else that is wrong. But then again, Everything seems to be correct so I really don't have a clue what is wrong except something is null


About the test you wanted me to do..
I don't think you understand how Line() works. I think only ok. Maybe you do and I don't understand what you're doing then but.
In a earlier reply you said:
Quote:
What Line(CurrentColumn) is doing taking Line() which is a string variable and making a string with what's in the (), which in this case is CurrentColumn, which is set at 0. Thus the string output it gives is 0.
This is slightly false. What currentColumn is doing inside Line() is show what part of Line() array it should output. Line() is a string array. So if CurrentColumn has the value 0 which it has, it will be pointing at the first number which is 1 ( all numbers are 1 in the txt file ). and the output will be 1.
If I had a water picture and wanted it into my tilemap. I would name it for example... 4 just for demonstration. Then I wanted 3 grass tiles before the water tile and then more grass after that again. I would have to change the map.txt file like this then.
1,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
So when the loop has done 3 cycles and is doing it's fouth the value of currentcolumn will be 3 so it will be pointing at the number 4 and the output will be 4 then.
By changing the value of CurrentColumn manually to 1 instead of 0 Which is same thing as typing Line(1) all you're doing is taking the second number from the txt row (which is also 1, all are 1) but then I would have to increase the map.txt file by adding an additional 1 to every row or else there won't be enough numbers for the array since it skipped the first number.

The error says it could be either that something is null or something needs to be "new". Could it be new or are you positive its a null problem.

Also I'm not sure if this is news or help but,
The error is a runtime error.
I'm able to compile it without a error (it compiles a debug.exe before it debugs) I also have a small preform with buttons like "Exit" "Play" etc. When I click the "Play" button so the face form loads (my main form where the tile map is going to load) that's when the error appears before anything on that screen is loaded. Then It brings me back to VB express and tells me what went wrong.
Reply With Quote
  #13  
Old 09-30-2007, 05:38 AM
Cags's Avatar
CagsMaking a tile map but ran into a error Cags is offline
Contributor

* Expert *
 
Join Date: Jul 2003
Location: Leicestershire, England
Posts: 710
Default

Maybe my hangover is playing tricks on my mind but...
Code:
NumColumns = CInt(CDbl(str(0)) - 1) ' NumColumns is going to have a value of 24 NumRows = CInt(CDbl(str(1)) - 1) ' NumRows is going to have a value of 14 ReDim Tiles(NumColumns, NumRows) ' this is going to create an array that is 24 x 14
Now correct me if I'm wrong but your map is actually 25 x 15.

Now when your code arrives at the For loops...
Code:
For CurrentRow = 0 To NumRows ln = SR.ReadLine() Line = ln.Split(CChar(",")) For CurrentColumn = 0 To NumColumns Tiles(CurrentColumn, CurrentRow) = new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg") Next Next
At some point this is going to try and access Tiles(0,NumColumns), which doesn't exist since VB uses 0 based arrays, meaning that if you create an array of length NumColumns, the index of the last item is NumColumns -1. If I'm right then the fix would be to change the line of code where your Rediming the array to this...
Code:
ReDim Tiles(NumColumns + 1, NumRows + 1)

I hope that makes sense, I'm now going back to nursing my sore head.
__________________
I don't suffer from insanity, I enjoy every minute of it.
http://www.tib-studios.co.uk
Reply With Quote
  #14  
Old 09-30-2007, 07:37 AM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default

I think I understood most of what you said except the last part:
Quote:
At some point this is going to try and access Tiles(0,NumColumns), which doesn't exist since VB uses 0 based arrays, meaning that if you create an array of length NumColumns, the index of the last item is NumColumns -1. If I'm right then the fix would be to change the line of code where your Rediming the array to this...
Code:
ReDim Tiles(NumColumns + 1, NumRows + 1)
About your first points though..
In "human language" the array is 25x15. In "array language" the array is 24x14.
I got 25 numbers in one row in my map.txt file.
We read that as 1,2,3,4 -> 25
Computer read it as 0,1,2,3 -> 25
So for the computer that is 26 numbers. Which is 1 too many.
So that's why it's subtracted by 1 (-1) to make 24.
And the value 24 for the computer is actually 25 which is correct.
I'm sure you know that and you probably said that aswell.
Maybe I'm just repeating what you said only rephrased
In that case I'm sorry but I am not sure if I understood what you said. Maybe I did, maybe I didn't.

Could you point out exacly what code it is I'm reDiming that you wanted me to edit?
Reply With Quote
  #15  
Old 09-30-2007, 08:05 AM
Cags's Avatar
CagsMaking a tile map but ran into a error Cags is offline
Contributor

* Expert *
 
Join Date: Jul 2003
Location: Leicestershire, England
Posts: 710
Default

Quote:
Originally Posted by Dekaras View Post
About your first points though..
In "human language" the array is 25x15. In "array language" the array is 24x14.
In both human language and array language your map should be 25x15 not 24x14. Whilst you are right that these would be indexed 0,1,2...24 etc, this has nothing todo with the actual size of the array. Lets look at this from a more simple perspective. Take a 1 dimensional array that you want to store each letter of the alphabet in. There are 26 letters in the alphabet, therefore our array must have 26 'slots', with each slot number from 0 to 25.

You are reading in that the grid contains 25 columns, but the value you are storing in the variable NumColumns is 24 (making NumColumns an inaccurate name because it isn't actually the amount of columns). Your code is then using this value to resize the array. Therefore using the example map that you have, your code is basically doing this...
Code:
ReDim Tiles(24, 14)
This is telling the computer to create an array which is 24 x 14.
__________________
I don't suffer from insanity, I enjoy every minute of it.
http://www.tib-studios.co.uk
Reply With Quote
  #16  
Old 09-30-2007, 08:49 AM
Dekaras Dekaras is offline
Freshman
 
Join Date: Apr 2007
Posts: 28
Default

I tried a few different things which affects the size of the array. None of them seemed to make any difference. I still had same error.
  • I took away the -1 when giving NumColumns and NumRows there values.
  • I edited the first line in map.txt to 24,14
  • I did both of the above.
  • I took away the last row of 1,1,1 etc and took away ",1" from every row in the map.txt
  • I took away the -1 and made it to +1 instead when giving NumColumns and NumRows there values.
Is this the kind of things you ment and wanted me to test?
Reply With Quote
  #17  
Old 09-30-2007, 09:19 AM
Cags's Avatar
CagsMaking a tile map but ran into a error Cags is offline
Contributor

* Expert *
 
Join Date: Jul 2003
Location: Leicestershire, England
Posts: 710
Default

Quote:
I took away the -1 when giving NumColumns and NumRows there values.
You need to understand that changing a variable will have an impact in every area of your application that uses this variable. Removing the -1 would make the name of the variable more accurate but will effect what happens in the loops further down the method. Hence the fact it didn't solve your problem.
Quote:
I edited the first line in map.txt to 24,14
The only effect this would have is making the array even smaller, which isn't going to help at all.
Quote:
I took away the last row of 1,1,1 etc and took away ",1" from every row in the map.txt
Your map file is correct there is no point altering it. The map correctly stores the information that the grid is 25x15, aswell as contains the actual grid.
Quote:
I took away the -1 and made it to +1 instead when giving NumColumns and NumRows there values.
I refer you back to my first comment.

You don't seem to be grasping what I'm trying to tell you. You want to load a grid which is 25x15 into a 2 dimensional array. Reading through your code it is clear that you are creating an array that is 24x14. The reason you application is crashing is because your loop then attempts to create a Bitmap and place it in Tiles(24, 0), which doesn't exist because your grid is 24x14. I'm not sure theres anything else I can do to help you other than telling you exactly what to change (which I actually already did), and unless you understand what your code is doing your only going to run into more problems.
__________________
I don't suffer from insanity, I enjoy every minute of it.
http://www.tib-studios.co.uk
Reply With Quote
  #18  
Old 09-30-2007, 12:49 PM
Cags's Avatar
CagsMaking a tile map but ran into a error Cags is offline
Contributor

* Expert *
 
Join Date: Jul 2003
Location: Leicestershire, England
Posts: 710
Default

...and thats why somebody who's hungover, hasn't programmed in a year and who's main language isn't vb shouldn't answer questions S. Maybe I'll leave my suggestions untill I actually have Visual Studio back on.
__________________
I don't suffer from insanity, I enjoy every minute of it.
http://www.tib-studios.co.uk
Reply With Quote
  #19  
Old 09-30-2007, 02:04 PM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

Cags, I know C and Java work that way for arrays but I sorta thought VB didn't. When you put arr(10) it should read 11 things. One of many of VB's probs.

And ya I didn't understand what Line() was doing when I wrote that stuff way up at the top but I understood it down the line when I read over it. I really don't think the problem is in the array like Cags said. It's not erroring on 24,0 or 24, 14 or 25, 15 or anything like that, it's erroring on 0,0.

I'm hard-pressed to find the error and I'm almost to the point where I wanna make my own tile program to solve this but like Cags I don't even have VB installed.

And as for the code I wanted you to test, it's really not important what it's doing, the point of those tests are to take out some problem-causing variables and replace them with good solid working variables to get to the root of the problem. It's not a fun way to solve it or a good time-saving one, but it should solve the problem. Just mix it up, having only one variable each time you run it stay the way the program has you have it. The other variables should just be written in explicitly for test purposes. Then you'll find your problem variable probably.

Last edited by Targe; 09-30-2007 at 02:11 PM.
Reply With Quote
  #20  
Old 09-30-2007, 03:08 PM
Cags's Avatar
CagsMaking a tile map but ran into a error Cags is offline
Contributor

* Expert *
 
Join Date: Jul 2003
Location: Leicestershire, England
Posts: 710
Default

Right ok, ignore most of what I've said previously in this thread, wasn't aware VB had such strange rules with ReDim as I'm used to C#. Anywho. I managed to get at a PC which has Visual Studio installed to test your actual code. It compiled and ran without a single problem. I just copied and pasted your clsMap into a new project, I then amended
Code:
new Bitmap("tiles\" & Line(CurrentColumn) & ".jpg")
to be...
Code:
new Bitmap(Application.StartupPath & "\tiles\" & Line(CurrentColumn) & ".jpg")
I ensured there was an image called 1.jpg in that folder, then pasted your test map into a text document which I saved as test.txt. I then copied the code from the paint event into the paint event of a form. With everything ready I simply added the following to the load event.
Code:
Dim map As clsMap map.ReadMap(Application.StartupPath & "\test.txt")
Bish bash bosh, compiled and ran without incident.
__________________
I don't suffer from insanity, I enjoy every minute of it.
http://www.tib-studios.co.uk
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error Making a tile map but ran into a error
Making a tile map but ran into a error
Making a tile map but ran into a error
 
Making a tile map but ran into a error
Making a tile map but ran into a error
 
-->