Game Development Community

Map Loading via Script

by Glenn Prince · in Torque Game Builder · 07/01/2006 (3:48 pm) · 2 replies

I've been away from T2D updates and I downloaded the new release just recently and I'm trying to move over to it, however I'm having some issues understanding what exactly has changed.

The problem at the minute is I am trying to load a Tile Map created in the tile editor like I would using previous releases. I am using the code as follows:

%tilemap = new t2dTileMap()
{
     scenegraph = t2dscene;
};
%tilemap.loadTileMap("~/data/tilemaps/level_01.map");

From this, all a get is "advanced script errors", which I seem to get anytime an error exists within a function btw. When I remove it from the function I get "Error, file is invalid", but the map editor can reopen and save the file. How do you load tile maps / tile layers from files now ? BTW I do not want the answer within the "builder" window. I don't use it and I don't over care if you think it's good, I find it annoying for what I want to do and how I work.

Cheers,

Glenn

Edit - Sorry, should of posted this in scripting.

#1
07/02/2006 (1:07 am)
The bit of script looks OK. Can you post the actual part of the console log that contains the error?

If you're removing the call to load the tile map, and you're still getting errors, I would suspect the problem lies elsewhere.
#2
07/02/2006 (3:08 am)
I finally got rid of it. Thanks for your help anyway Philip. I removed the tile map file and re-created it. I must of done something with the brushes or something as I am not getting the errors now.

Thanks again.