Author Topic: Detecting tile model in game  (Read 1105 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Detecting tile model in game
« on: April 30, 2016, 05:39:23 am »


               

Is there any way to detect the tile model at a specific x,y location in game?


 


 



               
               

               
            

Legacy_Quevy

  • Jr. Member
  • **
  • Posts: 92
  • Karma: +0/-0
Detecting tile model in game
« Reply #1 on: April 30, 2016, 07:24:44 am »


               

If I remember correctly, you can view in f9 module test by pressing the x button. In the game I do not know.



               
               

               
            

Legacy_Zwerkules

  • Hero Member
  • *****
  • Posts: 1997
  • Karma: +0/-0
Detecting tile model in game
« Reply #2 on: April 30, 2016, 11:00:09 am »


               


Is there any way to detect the tile model at a specific x,y location in game?




Since you asked this in the custom content forum I guess you aren't looking for a function that will give you the name of a tile at a certain location. Are you looking for a specific tile in a specific area or just in any area? If you want to know the name of a tile in an area you can open the area in the toolset and move the mouse pointer over the tile. The file name of the tile the mouse is pointing at will be displayed in the status bar of the toolset window.


               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Detecting tile model in game
« Reply #3 on: April 30, 2016, 01:03:24 pm »


               

The other questions have to be, why do you need that information? What are you trying to achieve?


 


TR



               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Detecting tile model in game
« Reply #4 on: April 30, 2016, 05:03:13 pm »


               

Okay, here's what I've been working on.  A crypt tileset with a pillared roof.  It's still in a very unfinished state.


 


TEST_2016_Crypt_0000.jpg


 


I want to have the pillars as placables so that I can change their appearances with a variety of pillar type placables.  I'm trying to find a work around for having to place each pillar manually in the toolset.  If I could detect the tile model in game, and it's facing, it would be fairly easy to place the pillars the first time the area is entered.  Nearly all of the pillars fall on tile edges or corners.  An open floor tile has 9 pillars; 8 on the edges and 1 in the middle. 


 


To clarify my question, is if possible to detect what tile model is at a specific location in an area?  If that's not possible directly in game, is it possible embed a piece of data in a tile model that can be read in game?  I don't mean in the toolset, but in the actual game itself.


               
               

               
            

Legacy_kamal_

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Detecting tile model in game
« Reply #5 on: April 30, 2016, 05:44:25 pm »


               

Tile Magic?


 


http://www.nwnlexico...n_To_Tile_Magic



               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Detecting tile model in game
« Reply #6 on: April 30, 2016, 08:16:44 pm »


               

Though I've used it often, I'm not sure how tile magic applies here.



               
               

               
            

Legacy_MerricksDad

  • Hero Member
  • *****
  • Posts: 2105
  • Karma: +0/-0
Detecting tile model in game
« Reply #7 on: April 30, 2016, 09:30:14 pm »


               

If you are building the map yourself, you could use a single waypoint located exactly at the position of just one of the pillars. Then when you load up the game, a script will read the waypoint for the layout and orientation of pillars. For instance, if you have all square rooms, you can place the lower left corner pillar and put on it a xCount and yCount and an offset value. Then have the script create and build pillars to match the layout.


 


If instead you have an L or X shaped room, you could provide another option on the waypoint telling it type = [L|X|T|U|Rect] and then specify a number of variables to match that setup. As an example, for an L room, you could supply rows and cols like Col1=6 Col2=6 Col3=2 Col4=2 Col5=2.


 


Another way to use this method to make multiple shapes is to use multiple waypoints detected by the same script. To make a U shape, you could place the lower left rectangle builder and tell it do make a set 2x6, another waypoint located a few column spacings to the right could make a set 2x2, and then finish with another set to the right that makes another 2x6.


 


Depending on the size and shape of your room, this could be very handy if you make them into prefabs and just drop them on the map.


 


A more creative script and a more creative set of variables makes a better automatic function.


 


A really neat way of making a specific layout is to include a little mesh readout in the code. Simply give your waypoint two variables, with one variable being row length, and the other being the layout code. Knowing the spacing of your room pillars, make a grid of zeros and ones on graph paper or something, then remove the space and put it all on one line, either from top-left to bottom right, or from bottom-left to top-right, depending on how you write your builder script.


110011    110000      110011


001100    110000      110011


110011 X  111111 L   111111 U


convert to single line bottom to top left to right, using variable RowLength = 6


 


110011001100110011 = X or 111111110000110000 = L or 111111110011110011 = U



               
               

               
            

Legacy_kamal_

  • Sr. Member
  • ****
  • Posts: 347
  • Karma: +0/-0
Detecting tile model in game
« Reply #8 on: April 30, 2016, 10:06:42 pm »


               


Though I've used it often, I'm not sure how tile magic applies here.




I suggested it because tile magic inspired on the fly ingame tile swapping in nwn2, so I figured it could do the same in nwn1: http://forum.bioware...eriments/page-2


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Detecting tile model in game
« Reply #9 on: April 30, 2016, 11:43:43 pm »


               I imagine a moneo script could read the tile layout and generate the corresponding static placeables in batch.


Placeables generated in game (including tile magic) tend to fade at 40m.


Is there any reason why the pillars need to be dynamic?
               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Detecting tile model in game
« Reply #10 on: May 01, 2016, 04:59:36 am »


               


I imagine a moneo script could read the tile layout and generate the corresponding static placeables in batch.


Placeables generated in game (including tile magic) tend to fade at 40m.


Is there any reason why the pillars need to be dynamic?




 


Proleric - they don't need to be dynamic.  In the vein, somewhere I read that the range that dynamic object fade (including creatures) can be adjusted?  It that correct?


 


MD - Something like your idea occurred after I posted the above this morning.  A waypoint with a pair of variables indicating the tile and orientation would probably be easiest.  At least easier than dropping many hundreds of pillars in a large area.  And since my dungeon crawls are often crypts, I'd drive myself insane positioning thousands of pillars. 


 


I'd like people other than me and my slave driver...er...gentle goddess to have a chance to play with this "out of the box" so to speak and not have to worry about fiddly tile definitions waypoints and such.  I'll release a version of it with the pillars already in the models.  I've changed very little geometry (save for my added tile variants) in the set and it works as an override of the CEP crypt.  I'll probably make a stand alone override version as well.


 


For the future...re-texturing and minimally changing some model geometry for a temple like appearance. 


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Detecting tile model in game
« Reply #11 on: May 01, 2016, 09:27:43 am »


               

Proleric - they don't need to be dynamic.  In the vein, somewhere I read that the range that dynamic object fade (including creatures) can be adjusted?  It that correct?...

Dynamic object fade range for creatures can be adjusted in ranges.2da (with the annoying exception that they vanish briefly when attacked). AFAIK there's no similar fix for placeables.

Sounds like moneo could be the way to go in your case. The script could be written with the module name and area resref as variables which other builders could use without needing to understand how the script works.
               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Detecting tile model in game
« Reply #12 on: May 01, 2016, 10:07:33 am »


               Looking into the moneo idea a little...

The area .are file has fields Height and Width that tell you the area size in tiles. That allows you to examine the array of structures Tile_List, which has one structure for each tile.

Tile_List entries include Tile_ID (the number of the tile in the .set file) and Tile_Orientation (0-3).

You can open the area .git file concurrently, in order to add to the 'Placeable List'. You'd need to populate the fields of the placeable explicitly from the .utp template.

A somewhat complicated script, but, once written, highly reusable.
               
               

               
            

Legacy_KMdS!

  • Sr. Member
  • ****
  • Posts: 364
  • Karma: +0/-0
Detecting tile model in game
« Reply #13 on: May 01, 2016, 10:39:55 am »


               

Here is a thought, use NWNX LETO, it runs within the game and can perform the same as Moneo. It uses the NWNX interface and you can quearyand retrieve information as you would for a database. I use it from within the game for various purposes. Any information you can retrieve using the stand alone LETO can be queried by NWNX LETO package. There are two versions of the NWNX LETO packagge, the older uses the Phoenix syntax, the one I learned on, and the newer uses the Unicorn syntax which is what I believe moneo uses.



               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
Detecting tile model in game
« Reply #14 on: May 01, 2016, 05:19:14 pm »


               



A somewhat complicated script, but, once written, highly reusable.




 


That looks very promising.  Seeing as I'm not familiar with letoscript syntax though, if I decide to use moneo it will only be after the entire set is completed.  Right now, I'm just going to go with dropping a waypoint in each tile with variables for pillar layout--about 25-30 of those I suspect--and orientation.  With all the permutation saved into a pallet, defined the pillar layout should go fairly quickly. 


 


Thanks everyone that responded.