finding TILES on MAPS

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

finding TILES on MAPS

Post by KhrougH »

sorry guys i checked in this forum but i couldn't find an exhaustive answer.
here is my problem:
I need to find the tile (tileset) on a map . I tried with getAutomapTile but it gives only the number of the icon of the map in the game. i need to find the tiles on the real map.
any suggestion?
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: finding TILES on MAPS

Post by Isaac »

KhrougH wrote: Sat Oct 13, 2018 4:07 am I tried with getAutomapTile but it gives only the number of the icon of the map in the game. i need to find the tiles on the real map.
any suggestion?
That is the only way that I know of to do it; to check the automap icon. Tiles in the game are defined as a set of objects and an associated sound effect. AFAIK, there is no built in way to detect a tile—other than to know what objects to look for, and that's just making an educated guess at which it could be.

Why do you need to know the tile name?
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: finding TILES on MAPS

Post by KhrougH »

Why do you need to know the tile name?
well, if i use "getAutomapTile" i have me a number witch identify an icon on the map in the game . it means that i have a number for a "dungeon_wall" (for exemple) and a number for every kind of ground. i would like to identify the kind of tile_floor for adding a condition : if tile == 3 then ... if tile == 4 then ...
i'm using an asset with wooden tiles but positioning is random. so i would like to "spawn" on it the same object with a specified facing. so, when you enter into a building all wooden stripes are in the same direction.
opening the "dungeon.lua" file you can see the 32x32 dungeon with the dungeon name and a table with different number that identifies the tiles used in that dungeon. that's what i need to connect to. do you call it "hook"?
by the way... i wish my explanation has been satisfied :D i'm sorry i don't know many terms.
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: finding TILES on MAPS

Post by Zo Kath Ra »

KhrougH wrote: Sat Oct 13, 2018 4:07 am sorry guys i checked in this forum but i couldn't find an exhaustive answer.
Did you find this?
viewtopic.php?f=22&t=9692&p=93590
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: finding TILES on MAPS

Post by Isaac »

There is no tile object—it's a collection; a list of objects to spawn.
...so, when you enter into a building all wooden stripes are in the same direction.
This is an option in the tile definition.

Code: Select all

randomFloorFacing = false,
You can add this to the definition for the tile that you are using, and it should no longer randomize the direction of the floor objects.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: finding TILES on MAPS

Post by KhrougH »

sure, it works. and is way easier than my idea :)
thank you , sir.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: finding TILES on MAPS

Post by KhrougH »

Zo Kath Ra wrote: Sat Oct 13, 2018 6:20 pm
KhrougH wrote: Sat Oct 13, 2018 4:07 am sorry guys i checked in this forum but i couldn't find an exhaustive answer.
Did you find this?
viewtopic.php?f=22&t=9692&p=93590
what I need doesn't concern the party position. i just needed to calculate at first what tile the dungeon are using in a specified position (every position). Isaac gave me the best solution but i'm still curious if there is a way to do it in an entity_script. or maybe in a [text].lua somewhere in the mod_asset.
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: finding TILES on MAPS

Post by KhrougH »

... but if i could have a difference between floors i could spawn monsters randomly on the streets but not in the houses.
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: finding TILES on MAPS

Post by Isaac »

KhrougH wrote: Sun Oct 14, 2018 3:27 pm ... but if i could have a difference between floors i could spawn monsters randomly on the streets but not in the houses.
If you manually place a floor decoration that is set (in the definition) to replace the existing floor models, then you will have a different floor in that tile.
kelly1111
Posts: 349
Joined: Sun Jan 20, 2013 6:28 pm

Re: finding TILES on MAPS

Post by kelly1111 »

KhrougH wrote: Sun Oct 14, 2018 3:27 pm ... but if i could have a difference between floors i could spawn monsters randomly on the streets but not in the houses.
I remember having a modified monster spawner object in one if my mod assets (cant seem to find the code atm) .. I got it from someone on the forum. It checks wheter there are monsters around in a certain area around the spawner and has a timer that spawns new ones (the amount you want) if there are none around any more.

Perhaps this can help you ? ... it doesnt check for elevations, tiles. but perhaps you can tweak the spawn radius?

now if only I knew where I put the damn thing in all my folders... and stuff
Post Reply