GetTileID(set, name) ... how does this work?

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

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

GetTileID(set, name) ... how does this work?

Post by Merr »

Pip,

I'm trying to use this to work ... GetTileID(set, name) ... but to no avail.

Please throw an example out (in code form) to show me the right values, names, set, etc.

Thank you ... and yes, the gas and oil is in the right tank but I need to know which octane and grade of oil please :wink:
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Post by pipfromslitherine »

It's somewhat complex. The set is basically the folder name of the tile set, and the name is the tile name as per the TILES.TXT file. As an example, the following code gets the IDs of the water tiles for each of the 3 tile sets and stores them in some globals.

SetGlobal("water1", GetTileID("MoreTiles", "Tile25")) ;
SetGlobal("water2", GetTileID("deserttiles", "Tile33")) ;
SetGlobal("water3", GetTileID("bulge_tiles", "Tile26")) ;

Note that the IDs are transient, as they can move around based on other tilesets being loaded, etc.

1.4 contains an edging plugin which will illustrate the use of this stuff. It's pretty fiddly though.

Cheers

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

Post by Merr »

Ahhh, I see .... The problem was I didn't set them as a global. It never dawned on me to use globals.

Cool ... now back to the drawing board ... I'll explain what I'm doing if I get it to work properly.

Thanks again for answering the door!
Post Reply

Return to “Battle Academy : Modders Corner ”