Place Tile .... MASTER TILE LIST ?

Open beta forum

Moderators: Slitherine Core, BA Moderators

Post Reply
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Place Tile .... MASTER TILE LIST ?

Post by Merr »

Pip,

I noticed in the BATTLESSCRIPT (autodocs) after v 1.3.6 that you've got new scripts to play with (and works btw, thanks!)

Unfortunately, I'm drawing at straws when it comes to selecting a correct Tile #. I've got the winter tile numbers figured out easily (minus one tile # shown in overlays folder), and the desert tiles are kinda funny numbered (found # 178 to be a desert bank tile), but I'll have to sit there and guess what the french are.

Is there a master list sitting around your office that you can post?

I tried to create a tooltip in the HELPERS.bsf (so I can scroll over the tile and get an ID #), but I'm a noob so I'm script challenged .... I was able to get the PrintString(int) to work but that gave me a long winded number that makes no sense. If you can give me a tip about writing a tooltip to view the tile # it would help immensely, otherwise it would take me 300 years to go through ever tile :cry:

Thanks!
pipfromslitherine
Site Admin
Site Admin
Posts: 9872
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

The tiles actually have names - it's just that they were all named TILE<N>

The names of the tiles are listed in the TILES.TXT file in each folder.

Hope that helps

Cheers

Pip
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

pipfromslitherine wrote:The tiles actually have names - it's just that they were all named TILE<N>

The names of the tiles are listed in the TILES.TXT file in each folder.

Pip
Yes ... the TILES.TXT is what I'm using for reference .... however, this TXT resides in all the tile folders with TILE<N> beginning anew at TILE1, TILE2, etc.

I'm using the string .... PlaceTile(x, y, id, rotation) .... where the id = <N> .... the <N> works fine for winter tiles(albeit <N> - 1) but I'm guessing at the <N> when it comes to retrieving the correct TILE<N> for the other folders.

Perhaps I need to retrieve the (set,name) first .... GetTileID(set, name) ...
then use that value when placing the tile.

Replacing a parameter with a value is tough when I can't see(change) the body of the PlaceTile function.
:? ... seems easier if I go back to drawing at straws.

EDIT .... BTW, I'm using the GetTileID for my tooltip but my noobness leaves me blank when writing the code.
pipfromslitherine
Site Admin
Site Admin
Posts: 9872
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

Yes - you'll need to use the GetTileID function based on the name of the set and tile to get the correct ID. If you let me know what it is you want to achieve, perhaps I can be of more help.

Cheers

Pip
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

pipfromslitherine wrote:Yes - you'll need to use the GetTileID function based on the name of the set and tile to get the correct ID. If you let me know what it is you want to achieve, perhaps I can be of more help.

Cheers

Pip

Thanks! .... I've narrowed it down ....

In the Helpers.bsf , there is the function ... FUNCTION HELPER_TILE_TOOLTIP(terrain, tilex, tiley, side)
The "terrain" parameter tells me the name of the terrain (that's good), but I want to know the Tile<N> instead.

Thoughts on how I can have it show the ID # instead of the name?
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

Pip,

Disregard !!! I just figured it out and made my own Master List .... I guess I needed to be talked through it ... thanks.
Now I can reference this list for an ID to plug into the "id" parameter in the .. PlaceTile(x, y, id, rotation).

Ok, here's how it works ... I'm still testing my list but so far so good...

My list is compiled from the TEXT1 file from the main folder... Slitherine\Battlefield Academy\Data\Text.
The "PlaceTile" function reads the [tile#] from the TILES folder, starting in alphabetical order of the folders ... So, when you open the TILES folder you see ;

bulge_overlay
bulge_tiles
desert_overlay
deserttiles
moretiles
overlay

There are 267 tiles. So, I cut/paste the TEXT1 data (IDS_T_) in the order the folders are displayed, leaving no spaces.
Then, saving this text file I then opened it with Microsoft Works Spreadsheet and simple read the "line number" ... this concurs with the tile ID #.

Simple enough .... I should have thought of this before!

Does any of this make sense?

Thanks again!
pipfromslitherine
Site Admin
Site Admin
Posts: 9872
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

I'm not sure what you're trying to do, but the problem is that if we tweak or add any tiles then your list will (if I am understanding you correctly) end up incorrect. That's the reason all the map files etc use the set/name convention to store their tiles.

As I say, if I knew what you wanted to do, then perhaps I could help more.

Cheers

Pip
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

pipfromslitherine wrote:I'm not sure what you're trying to do, but the problem is that if we tweak or add any tiles then your list will (if I am understanding you correctly) end up incorrect. That's the reason all the map files etc use the set/name convention to store their tiles.
You are correct, the list will change. If I was to add new tiles to my scenario they would fall as ID 268, 269, 270, etc.
However, if you built an AutoDocs for the list it will always be up to date (reference the main tile folder, not user addons).
As I say, if I knew what you wanted to do, then perhaps I could help more.

Cheers
Pip
I'm simply using the function .... PlaceTile(x, y, id, rotation) inside the StartTurn function in my scenario BSF.
The "id" is the number of the tile ... which I know is from 1-267. Using my list as a reference I can place a specific tile on the map.

Now ... you might ask ... What am I using this for???

Random Minefields. :wink:

Heck, if all goes well I can code Engineer's to place minefields, obstacles, etc.
I've got an outline of what to do, and since I've jumped through the "placetile" hoop I can move along.

Time to put the kettle on!
pipfromslitherine
Site Admin
Site Admin
Posts: 9872
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

If you're only using a few tiles, then do what I do in my plugins (coming soon!) - just assign the ids to variables (or even globals if you use them a lot) and then you can just use the variables from then on.

Sounds exciting anyway! :)

Cheers

Pip
Merr
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 903
Joined: Mon Aug 16, 2010 2:00 pm

Post by Merr »

pipfromslitherine wrote:If you're only using a few tiles, then do what I do in my plugins (coming soon!) - just assign the ids to variables (or even globals if you use them a lot) and then you can just use the variables from then on.

Ok ... Now you made me curious :wink: ... Can you elaborate on your "plugins" or is it too early to let the cat outta the bag?
pipfromslitherine
Site Admin
Site Admin
Posts: 9872
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

They are part of a system to allow for helps in the editor. I'm using a water edger as my test case. But still work in progress :)

Cheers

Pip
Post Reply

Return to “Battle Academy : Open Beta”