Author Topic: Shiny baubles. Need a custom light source for my placeables  (Read 460 times)

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« on: September 23, 2012, 03:49:23 pm »


               Here is a problem for the gurus of custom content.

In a project of mine I spawn on the ground little shining valuable objects. Imagine a pile of gold coins, counting -say- anything in the range from 10 to 500 coins. They are objects of type PLACEABLE (therefore not movable), and I want them to be catchy, in that they have to draw the player's attention, even from afar.

My script gives them both a glowing yellow aura and a yellow light source.
The aura gets the job done nicely during the day.
The light source, instead, makes the object visible during the night as well.

But the smallest light source is of 5 meters radius, and that is too much to give acceptable results. I gauge that a 2 meters radius light would look best. I tried to use a darker light color (orange instead of yellow) hoping it would blend to something less noticeable, but it is still too garish.

Looking into the 2da gave me the impression that the light sources are completely hardcoded. Maybe I am wrong. So I ask: is there a way to decrease these light radii?

If the lights can not be modified, do you know of another way to create the illusion of lighting? Even if it does not cast shadows is okay, so long it is visible in the night as a light would.

Thank you very much.


-fox
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #1 on: September 23, 2012, 05:55:25 pm »


               <getting into...>

One possibility would be to give the model itself some self-illumination. It wont be quite the effect of light reflecting off metal, but it will make the placeables stand out in gloom.

<...the nitty-gritty>
               
               

               
            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #2 on: September 23, 2012, 06:15:00 pm »


               you can try this: create a txi file to match the texture of the shinies and add this text:
decal 1
               
               

               
            

Legacy_NWN_baba yaga

  • Hero Member
  • *****
  • Posts: 1944
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #3 on: September 23, 2012, 06:49:55 pm »


               well the lighting... I messed with a recent modern tileset of my own and have used aura dlights above the ml1 and ml2 so they illuminate always lighting. The result was pretty cool and i wanted a special one for a lampspot above a painting you know. This aura dlight was set to 1.5m and works as intended. So it was just a very little light spot in the whole tile just for the painting.  The same works for "placeable" lightsources with a very little lightradius. Just the ml1 and ml2 tilelights are known to illuminate greater radius of lighting.

I can upload the mdl for you if you want to check out how to decrease the lightradius in a tile. 
               
               

               


                     Modifié par NWN_baba yaga, 23 septembre 2012 - 05:51 .
                     
                  


            

Legacy_NWN_baba yaga

  • Hero Member
  • *****
  • Posts: 1944
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #4 on: September 23, 2012, 07:01:37 pm »


               Also the "multiplier" in 3dsmax for lightsources only affects ingame dynamic objects like the PC, creatures or placeables set to "character" in the export option so they can cast dynamic shadows. How exactly this modifier works is beyond me but you can test it out with a placeable lightsource. Use the same light with a value of 0.3 - 1.0 and 3.0 and you will see how it lits differently dynamic things.

In general the best way to test out dynamic ligth sources is to create an empty tile with just a ground and 4 walls and a grey texture and set the area environment to "black only".

I test this with a NWN option set to

BitsPerPixels=16
               
               

               


                     Modifié par NWN_baba yaga, 23 septembre 2012 - 06:06 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #5 on: September 24, 2012, 05:12:11 am »


               

s e n wrote...

you can try this: create a txi file to match the texture of the shinies and add this text:
decal 1


Strangely, I needed the same recently with a number and letter hak I'm using from the vault. In dark areas, it was just too difficult to see the numbers or letters and not everyone may notice them on the floor. Being that it's for a puzzle, I too wanted them to be easily noticed.

I did as suggested and they do stand out now. But my question is, anyway to get them to flicker or pulsate by just making a change to a txi file? In particular, like the Rune Plate does when "activated".

Placeables -> Containers & Switches -> Rune Plate

Are there other variations of the decal number? Does 2 or 3 offer something else?

Otherwise, I'll go with this if my above question is too difficult - meaning I'd need some knowledge in creating custom content.

FP!
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #6 on: September 24, 2012, 05:06:07 pm »


               

Fester Pot wrote...
Are there other variations of the decal number? Does 2 or 3 offer something else?

I once saw a "decal 2".  I can't remember where, though.  It may have been in a NWN TXI, something in a KotoR file(they sort of embed their TXI file commands inside the model), or possibly something I saw in a debugger looking at NWMain.exe.  I do remember seeing it.  I don't know what it does.
               
               

               


                     Modifié par OldTimeRadio, 24 septembre 2012 - 04:07 .
                     
                  


            

Legacy_NWN_baba yaga

  • Hero Member
  • *****
  • Posts: 1944
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #7 on: September 24, 2012, 08:32:11 pm »


               I thought decal 1 only means something like decal = true! or so? and what does it anyway realy as tell the engine to draw the poly right ontop the surface beneath w/o intersecting it?
               
               

               


                     Modifié par NWN_baba yaga, 24 septembre 2012 - 07:32 .
                     
                  


            

Legacy_s e n

  • Hero Member
  • *****
  • Posts: 654
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #8 on: September 24, 2012, 09:15:00 pm »


               From what i got its just on off aye, im not aware what it does, but the output effect is to exclude lighting effects from the mesh, completely unaffected by ambient and other light sources
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #9 on: September 24, 2012, 09:39:28 pm »


               

NWN_baba yaga wrote...
I thought decal 1 only means something like decal = true! or so? and what does it anyway realy as tell the engine to draw the poly right ontop the surface beneath w/o intersecting it?

That's what I would have thought, too.  And that's probably a safe bet 99.99% of the time.  The only reason I remember that I'd seen a Decal 2 someplace is that it bothered me a bit when I did.  If it was something I saw in a KotoR model, it could have been specific to KotoR.  Most of the stuff in KotoR is similar to NWN but they did add some new TXI proceduretypes that aren't in NWN and also could have added a new setting to Decal.  Or, it could have simply been the model decompresser.  Sometimes the TXI information in the model gets corrupted when you're trying to view it.

The way NWMain.exe appears to parse lines in an ASCII model or TXI, every acceptable setting is explicitly stated in a subroutine of some sort.  So if it's a setting that accepts 1 or 0, TRUE or FALSE, there will be a little spot in the code which lists those four options, explicitly.  Or, if it's a string or numbers, how many characters/digits it will accept.  I can't view that information right now but if Virusman or someone is reading, they could probably quickly see whether the code in NWMain.exe lists the 1/0/TRUE/FALSE for the "decal" setting.  BTW, I recall that in at least one other place (can't remember, but was in the NWMain.exe), it looks for TRUE/FALSE or 1/0, but not all four.  Probably some setting in the TXIs or maybe emitters.  I've been very slowly trying to map out what settings NWN is expecting when processing an ASCII model/TXI, but it's terribly boring and almost everything is as you would expect it to be.

Pretty esoteric stuff, even for me. ':lol:'
               
               

               


                     Modifié par OldTimeRadio, 24 septembre 2012 - 08:44 .
                     
                  


            

Legacy_the.gray.fox

  • Full Member
  • ***
  • Posts: 214
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #10 on: September 25, 2012, 01:35:16 pm »


               I am back.

The suggestion to activate the decal property of the textures did the trick nicely. The end result is that of self-illumination (what Rolo Kipp suggested as well). And it turned out to be far more appropriate than I could hope for.
(Open...
I wonder if this could be reused to make some interesting clothing effect. Do the NPC clothes use multitexturing? I can imagine some magician jacket with a brilliant pattern of sort, standing out even in the dark. Should look cool.
... closed)


My script no longer needs to apply a garish light source to my placeables. Thanks a lot, s e n. Even if you will probably not read into my code (not yet released, and not yet releasable anyway), know that a comment is in there to give you credit as I leave a reminder on why I ditched the light source :-)

As for the actual modification I made, I activated the decal property for the plc_gold and the px2_gold textures. At a later date I will duplicate the placeable models and their texturesets so to confine this modification to my own placeables only (because right now it is affecting everything reusing said two gold textures, logically).

Thanks go to NWN_baba yaga as well. You went through the trouble of explanining to me something that sounds quite useful. But my knowledge on model files is limited. I am a script guy. When it comes to .mdl I can only make basic adjustments. I appreciate your input nonetheless.

Thank you all.


-fox
               
               

               
            

Legacy_Bannor Bloodfist

  • Hero Member
  • *****
  • Posts: 1578
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #11 on: September 25, 2012, 05:07:28 pm »


               

OldTimeRadio wrote...

NWN_baba yaga wrote...
I thought decal 1 only means something like decal = true! or so? and what does it anyway realy as tell the engine to draw the poly right ontop the surface beneath w/o intersecting it?

That's what I would have thought, too.  And that's probably a safe bet 99.99% of the time.  The only reason I remember that I'd seen a Decal 2 someplace is that it bothered me a bit when I did.  If it was something I saw in a KotoR model, it could have been specific to KotoR.  Most of the stuff in KotoR is similar to NWN but they did add some new TXI proceduretypes that aren't in NWN and also could have added a new setting to Decal.  Or, it could have simply been the model decompresser.  Sometimes the TXI information in the model gets corrupted when you're trying to view it.

The way NWMain.exe appears to parse lines in an ASCII model or TXI, every acceptable setting is explicitly stated in a subroutine of some sort.  So if it's a setting that accepts 1 or 0, TRUE or FALSE, there will be a little spot in the code which lists those four options, explicitly.  Or, if it's a string or numbers, how many characters/digits it will accept.  I can't view that information right now but if Virusman or someone is reading, they could probably quickly see whether the code in NWMain.exe lists the 1/0/TRUE/FALSE for the "decal" setting.  BTW, I recall that in at least one other place (can't remember, but was in the NWMain.exe), it looks for TRUE/FALSE or 1/0, but not all four.  Probably some setting in the TXIs or maybe emitters.  I've been very slowly trying to map out what settings NWN is expecting when processing an ASCII model/TXI, but it's terribly boring and almost everything is as you would expect it to be.

Pretty esoteric stuff, even for me. ':lol:'

Edit: Quoted entire post as there is some valuable data buried in there!

OTR;  Someone else, may actually have been you 'Image, was also working along the lines to figure out what was and was not implemented in nwn for the various txi settings.  It is possible you may find a link if you search these forums or your omnibus (thanks again for that by the way).  Too bad this all was not pulled into the various wiki's, however management and mgt/vs user issues blocked most of the folks from actually contributing to the various wiki's and most have disappeared over the years... likely due to hosting issues/expense/personalities/whatever.

There may be some txi discussions on the CTP forums as well, but you will likely have to dig a bit to find it.  Sorry about that, but I have always kept my mind/interest locked solely on tilesets, much to my disgrace now as I know txi data came more important with 1.69.  As such, I know I have missed some really cool stuff that would/might have improved some of the tilesets I have worked on in the past.

If you find anything useful, would you mind pulling it together as a pdf or at least a txt file and posting it to the vault please?  Some place that might not actually lose the data?  'Image

Edit 2:  Dang, I truly, really, absolutely, miss my desktop.  This laptop MIGHT be able to run NWN, but I can't cart/port all the other data over between the two machines.  Win7 won't discuss files with WinXP very well, every time I reset my network, one or the other starts blocking data again.  Besides, I have a 24inch monitor now at home, and a MUCH better mouse than this darn touchpad which keeps insisting that I want to change windows since my palm(s) rest on it when I am typing...  I have soooooooooooooo much friggin time sitting here in this hospital bed, with nothing to do, I could at least be whittling away at a new tileset or something.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Shiny baubles. Need a custom light source for my placeables
« Reply #12 on: September 25, 2012, 06:10:26 pm »


               <buffing...>

the.gray.fox wrote...

(Open...
I wonder if this could be reused to make some interesting clothing effect. Do the NPC clothes use multitexturing? I can imagine some magician jacket with a brilliant pattern of sort, standing out even in the dark. Should look cool.
... closed)

Adjusting the self-illumination of the particular model you want, say you have a coat model with the coat object *and* a seperate stars-and-galaxy design object linked to it, you could adjust the design object to self-illuminate (in whatever hue you wish) and only that part of the model would "glow". If the self-illum was low, it would be unnoticable in bright light, but very noticable in the dark...

You can also do things to the textures applied to the model *seperately*. As an example, on the dragonfly wings Cestus did for June CCC:
'Image
I made the object semi-transparent and then gave the texture a txi with the irridescent reflection map. I.e. I got an object that was transparent *and* reflective, which cannot be done directly with the 2DAs.

<...the gold braid on his court-dress robes>
               
               

               


                     Modifié par Rolo Kipp, 25 septembre 2012 - 10:16 .