It has been a long time since I have done a proper blog post. This one is the first part of a multi part series of importing Tiled maps to AGK. I use AGK in Tier 2 as a game framework using C++. This is the real draw to AGK for my use, as I have the simplicity of AGK with the power of C++. However, this tutorial is written using an AGK Tier 1 snippet as there is no need for any added complexity. I will eventually write a C++ variation that is more flexible, but none the less, let’s start part 1 of this tutorial. It is important to note that this does not only work with Tiled, it can be used to load any tileset/atlas image easily, but Tiled is my motivation for making it.
This is a code snippet that creates a file that can be used for tilesets, created in the AGK expected format for tilesets. I will write a full tutorial on how to use this code in a future post. See this post on use of the snippet.
//Change these values if your tiles are a different size in pixels tileWidth = 128 tileHeight = tileWidth numHorizontalTiles = 16 numVerticalTiles = 16 //Open a new file to write. I found no success writing to .txt. fileid = OpenToWrite ( "myfile" ) //Variables used in the loop. string$ = "" //This will be what gets written to the file. tileid=0 //Used to count up and assign each tile an ID //This is the same as saying for(int i=0;i<numHorizontalTiles;i++) with the i++ at the end of loop. i=0 //Start at 0 While i<numHorizontalTiles //Same as above, nested for loops. j=0 //Start at 0 after each loop. While j<numVerticalTiles //increment tileid each loop. In Tiled 0 is no tile, so we start with 1. tileid = tileid + 1 //Assign the line to be written to string$ string$ = Str(tileid) + ":" + Str(j*tileWidth) + ":" + Str(i*tileHeight) + ":" + Str(tileWidth) + ":" + Str(tileHeight) //Write string$ to file. WriteToLine saves it in ASCII readable format. WriteLine(fileid, string$) /* Remove to watch progress. Print(string$) Print(GetWritePath()) Sync() */ //Remove to watch progress. //j++ for the loop j = j + 1 EndWhile //i++ for the loop i = i + 1 EndWhile //Close the file CloseFile ( fileid )
This is just a quick update on the progress of my project, “The Lost Shipment”.
*Starter Town and events related
+Morticulus and events related
+”Castle Town” and events related
+Equips, skills, enemies, and combat balancing.
-Mountain dungeon and events related.
*Being all needed finished, + Being in progress and almost done, – Being has yet to be started.
Being that I just reached the half way mark of January, I am a little further behind than I would have hoped. I should catch up this weekend though! Stay tuned!
In this tutorial, we will be covering how to check direction checking. This first half will be covering pseudo methods and just theory, the second half will be implementing it into RPG Maker VX Ace.
This portion of the tutorial will be usable in any game making engine as it is all pseudo, and not limited to RPG Maker.
What we will be covering in this tutorial is how to make an event trigger only when facing a character, and rom a specific distance. Sound simple right? Well, let’s get started!
Now, let me show an image of what we are going to achieve.