Author Topic: Say no to light!  (Read 1275 times)

Legacy_WoC_Builder

  • Sr. Member
  • ****
  • Posts: 425
  • Karma: +0/-0
Say no to light!
« Reply #30 on: December 23, 2012, 06:26:40 pm »


               

henesua wrote...

Tiberius_Morguhn wrote...

I'm going to dig into this - as noted earlier and confirmed by others, the change to placeables.2da does fix the flare but removes the light generation.  I'll try to add in a light node without the flare similar to the tileset node to produce a 'hybrid' model so to speak.  I think the engine takes the placeables.2da value and slaps a light node on internally since no flare/light node references are made in any particular placeables mdl file.  Stay tuned.


Sound great, Tiberius.

Also, if it doesn't work. You can always change the model type to tile. '<img'>


I've never having done any modeling before (and so having no idea how it truly works),  but I have had luck in cutting out a piece of tile and converting it to a placeable.  Are you speaking of the reverse?  Taking a single placeable, and converting it into a  tile?  If that is possible, and would have an invisible floor (not overwriting the ground upon which it sits), it would then be very usable with tilemagic, though you would hten never be able to "use" the tile and turn it on and off at will.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Say no to light!
« Reply #31 on: December 23, 2012, 07:04:24 pm »


                <shining a light...>

I can confirm/refute a couple things.

Making the treasure models for the hoard, I wanted to make use of the light shining on the Bioware medium treasure (plc_c08). It *does* have a flare attached, which I did *not* want.

Ripped the light from plc_c08 and edited the mdl to remove the flare. It works a treat. the gold is subtly lit without a flare showing through the chest.

'Posted
Edit: Posted the wrong image. That one was with alphamean ;-P

'Posted
With light amped up

'Posted
You can see the loom of the light inside the chest. Compare to flare+light effect on standard model.

Note: The placeable is not static and is type "character"

<...just so he can make shadow-puppets>
               
               

               


                     Modifié par Rolo Kipp, 23 décembre 2012 - 07:26 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Say no to light!
« Reply #32 on: December 23, 2012, 10:53:21 pm »


               

WoC_Builder wrote...

henesua wrote...

Tiberius_Morguhn wrote...

I'm going to dig into this - as noted earlier and confirmed by others, the change to placeables.2da does fix the flare but removes the light generation.  I'll try to add in a light node without the flare similar to the tileset node to produce a 'hybrid' model so to speak.  I think the engine takes the placeables.2da value and slaps a light node on internally since no flare/light node references are made in any particular placeables mdl file.  Stay tuned.


Sound great, Tiberius.

Also, if it doesn't work. You can always change the model type to tile. '<img'>

I've never having done any modeling before (and so having no idea how it truly works),  but I have had luck in cutting out a piece of tile and converting it to a placeable.  Are you speaking of the reverse?


Not necessarily. Just talking about creating a MDL with a Tile classification and adding it to the placeables.2da so that it can be used as a placeable.

But as Rolo seems to have shown, the character classifcation which is typical of placeables is sufficient.

Speaking of Tile Magic I have been looking into how Placeables with a Tile classification and an aabb node can work with Tile Magic, and keeping a thread on the subject.
               
               

               
            

Legacy_Tiberius_Morguhn

  • Sr. Member
  • ****
  • Posts: 396
  • Karma: +0/-0
Say no to light!
« Reply #33 on: December 27, 2012, 08:54:56 am »


               Okay.  So there are easier ways to work around this with placeables.  I *was* able to bind a light node to a placeable brazier and make it work as a dynamic light.  However, that is seemingly way overkill for what I think is being asked.  All that is really needed is a placeables.2da entry for the placeable that originally has a flare effect (ie. the brazier for instance) and either change or duplicate that entry such that the LightColor/Offset columns have the values replaced with ****.  Many of the Bioware placeables already have a duplicate entry for light source type placeables that they call "NoAmbient" as such:

264        CandelabraNoAmbient     75902    PLC_I09             ****         ****           ****           ****           17             1            0         ****      ****
265        FreeTorchNoAmbient      75903    PLC_J03             ****         ****           ****           ****           17             1            0         ****      ****
266        Painting2               75904    PLC_X0_PT2          ****         ****           ****           ****           17             1            0         ****      ****
267        SoulJar                 75905    PLC_X0_JAR          19           0.003984       0.010825       0.35           17             1            0         ****      ****
268        Mythallar               75906    PLC_X0_MYT          ****         ****           ****           ****           26             1            0         ****      ****
269        BrazierNoAmbient        75907    PLC_I05             ****         ****           ****           ****           21             1            0         ****      ****
270        CampfrNoAmbient         75908    PLC_I06             ****         ****           ****           ****           17             1            0         ****      ****
271        CampfrWPotNoAmbient     75909    PLC_I07             ****         ****           ****           ****           17             1            0         ****      ****
272        CampfrWSpitNoAmbient    75910    PLC_I08             ****         ****           ****           ****           21             1            0         ****      ****
273        LampPostNoAmbient       75911    PLC_K01             ****         ****           ****           ****           22             1            0         ****      ****
274        Pillar1NoAmbient        75912    PLC_K06             ****         ****           ****           ****           26             1            0         ****      ****

From there it is simply a matter of using the "NoAmbient" placeable along with a simple bit of scripting.  The "NoAmbient" placeables produce no flare effect, yet have not dynamic lighting as mentioned.  With a single variable on the placeable and two scripts, you can have dynamically lit placeables (with sound) without having to have modified models.

Take the brazier for instance.  Place a standard brazier model into the toolset.  Modify the brazier properties such that it uses the "NoAmbient" variation of the model.  Modify the brazier properties such that it's intial state is DEACTIVATED (this is important in that the script/variable combination determine the brazier's true state!!!).  Modify the brazier variables with a single entry:
PLC_LIGHT_INIT
that is of type int and it's value is set to 0 or 1 (0 for off, 1 for on).  This is the brazier's initialization variable and is handled by OnHeartbeat - and it is handled only a single time.  From there on out, the state is handled by whether or not the PC uses the brazier via the OnUsed event script.  Place a single sound object called "Torch Fire Medium" from the sound palette on top the brazier.  Modify the sound object to uncheck the "Active" property (again, the scripts handle the state of whether the sound is playing or not).

OnHeartbeat script
void main()
  {
  // Initialize placeable object lighting?
  //   TRUE = 1 : FALSE = 0 : SKIP = 2
  if (GetLocalInt(OBJECT_SELF,"PLC_LIGHT_INIT") == 1)
    {
    object oSelf = OBJECT_SELF;
    object oSound = GetNearestObjectByTag("TorchFireMedium", OBJECT_SELF, 1);
    PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    SetLocalInt(OBJECT_SELF, "PLC_LIGHT_INIT", 2);
    SetLocalInt(OBJECT_SELF, "PLC_LIGHT_AMION", 1);
    effect eLight = EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_20);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, oSelf);
    SoundObjectPlay(oSound);
    }
  if (GetLocalInt(OBJECT_SELF,"PLC_LIGHT_INIT") == 0)
    {
    object oSelf = OBJECT_SELF;
    object oSound = GetNearestObjectByTag("TorchFireMedium", OBJECT_SELF, 1);
    SetLocalInt(OBJECT_SELF, "PLC_LIGHT_INIT", 2);
    SetLocalInt(OBJECT_SELF, "PLC_L_AMION", 0);
    SoundObjectStop(oSound);
    }
  }


OnUsed script
void main()
  {
  if (GetLocalInt(OBJECT_SELF,"PLC_LIGHT_AMION") == 0)
    {
    object oSelf = OBJECT_SELF;
    object oSound = GetNearestObjectByTag("TorchFireMedium", OBJECT_SELF, 1);
    PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE);
    SetLocalInt(OBJECT_SELF,"PLC_LIGHT_AMION",1);
    effect eLight = EffectVisualEffect(VFX_DUR_LIGHT_YELLOW_20);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLight, oSelf);
    SoundObjectPlay(oSound);
    }
  else
    {
    object oSelf = OBJECT_SELF;
    object oSound = GetNearestObjectByTag("TorchFireMedium", OBJECT_SELF, 1);
    PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE);
    SetLocalInt(OBJECT_SELF,"PLC_LIGHT_AMION",0);
    effect eEffect = GetFirstEffect(oSelf);
    while (GetIsEffectValid(eEffect) == TRUE)
      {
      if (GetEffectType(eEffect) == EFFECT_TYPE_VISUALEFFECT)
        {
        RemoveEffect(oSelf, eEffect);
        }
      eEffect = GetNextEffect(oSelf);
      }
    SoundObjectStop(oSound);
    }
  }

The EffectVisualEffect function turns the placeable into a dynamic light source and the modified 2da ("NoAmbient") removes the flare.  This can be replicated for other placeable light source where you want to remove the flare effect.

Initial state off
'Posted

Used by PC to turn on
'Posted
               
               

               


                     Modifié par Tiberius_Morguhn, 27 décembre 2012 - 08:56 .
                     
                  


            

Legacy_Tiberius_Morguhn

  • Sr. Member
  • ****
  • Posts: 396
  • Karma: +0/-0
Say no to light!
« Reply #34 on: December 27, 2012, 08:58:03 am »


               Also, if you want the sound object to be generically passed into the script then set/get a string on the placeable object that tells which sound object to use.
               
               

               
            

Legacy_Oseryn

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Say no to light!
« Reply #35 on: December 27, 2012, 08:49:59 pm »


               One thought - and I haven't tested this, but there is a model in models_01.bif called fx_placeable01.mdl. This might be the flare node added to the lighted placeables by the engine, and by removing the flare references from this model, the placeable flare would be gone, while leaving the spells-flare unaffected. I'll have to try this in my module this week.

Here's the model:
#MAXMODEL ASCII
# model: FX_PLACEABLE01
filedependancy FX_PLACEABLE01.max
newmodel FX_PLACEABLE01
setsupermodel FX_PLACEABLE01 NULL
classification EFFECT
setanimationscale 1
#MAXGEOM  ASCII
beginmodelgeom FX_PLACEABLE01
node dummy FX_PLACEABLE01
 parent NULL
endnode
node light AuroraLight01
 parent FX_PLACEABLE01
 ambientonly 0
 shadow 1
 isdynamic 0
 affectdynamic 1
 lightpriority 4
 fadingLight 1
 flareradius 30
 texturenames zd
   fxpa_flare
 flaresizes zd
   3
 flarepositions zd
   1
 flarecolorshifts zd
      0.0000000    0.0000000    0.0000000
 position 0 0 0
 orientation 0 0 0 0
 radius 10
 color 0 0 0
 shadowradius 15
 verticaldisplacement 3
endnode
endmodelgeom FX_PLACEABLE01
donemodel FX_PLACEABLE01

If this is the case, the placeables.2da, the individual models and the flare texture could be left as is, and only the flame model for tiles and this model for placeables would be altered.

EDIT -----------------------------------------------------------------------------------

Sadly - changing this file didn't remove the placeable flare. Tried the altered file in a hak and in a modified models_01bif. Darn, that seemed so promising too. I wonder what this file does then.
               
               

               


                     Modifié par Oseryn, 28 décembre 2012 - 01:39 .
                     
                  


            

Legacy_Oseryn

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Say no to light!
« Reply #36 on: December 28, 2012, 03:13:31 pm »


               As it turns out - this file does exactly what I thought. The mod I was testing in had a modified placeable brazier and a modified placeable lamp - both had flares in an aurora light node in their placeable model.

Testing in a basic module, with no haks, and just placing modified (no flare) files fx_placeable01.mdl and fx_flame01.mdl in the override folder, removed the terrain and placeable flare that shines through area model geometry, while maintaining all other functionality and not affecting spells..
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
Say no to light!
« Reply #37 on: December 28, 2012, 05:30:38 pm »


               <dreaading...>

Nicely done, O!

<...another flare-up>
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Say no to light!
« Reply #38 on: December 28, 2012, 06:21:29 pm »


               That works for me too, Oseryn. Thanks.
               
               

               
            

Legacy_Tiberius_Morguhn

  • Sr. Member
  • ****
  • Posts: 396
  • Karma: +0/-0
Say no to light!
« Reply #39 on: December 28, 2012, 09:18:32 pm »


               So maybe there are easier ways .... lol.  Thank you!
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Say no to light!
« Reply #40 on: January 24, 2013, 04:56:35 pm »


               

Just a ghost wrote...

It may be nice to make a download with those models. It's a bit of a waste of time to let everybody trace down those resources and fix them while the deed has already been done. Think of the nice new thingies you can make in the time gained!

i am thinking about adding this into the community patch, though im still not sure this fits there

is this a really fix? i mean, is the default light from the fxpa_flare broken? I can't see any difference on screenshots as there is no before/after and I havent tested in game yet. If not - is this at least "a must" improvement, something that generic player would like? doesn't it break other places where fxpa_flate is used, such as spells? I would like to add it, but iI couldnt find answers to my questions in this thread and would like to be sure about that.
               
               

               


                     Modifié par ShaDoOoW, 24 janvier 2013 - 04:57 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Say no to light!
« Reply #41 on: January 24, 2013, 06:04:58 pm »


               I don't consider this a fix in the sense that the flare was causing crashes or buggy or any other thing.

I do however like these changes to fx_placeable01.mdl and fx_flame01.mdl

In my opinion light sources look much better with these changes.

With this change the placeable candelabra for example no longer has that odd ball of light floating between the candles.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Say no to light!
« Reply #42 on: January 24, 2013, 06:23:07 pm »


               

henesua wrote...

I don't consider this a fix in the sense that the flare was causing crashes or buggy or any other thing.

I do however like these changes to fx_placeable01.mdl and fx_flame01.mdl

In my opinion light sources look much better with these changes.

it doesn't have to be bugged really, if its serious improvement I can take it too, as long as it doesnt cause other issues elsewhere, I just seen a word of fix being used here a lot so was curious

With this change the placeable candelabra for example no longer has that odd ball of light floating between the candles.

but the placeable light/illumunation is driven by the 2da (LightColor   LightOffsetX   LightOffsetY   LightOffsetZ) so i see no reason to disable it entirely which might maybe look good with candelabra but what about placeable fire?
               
               

               


                     Modifié par ShaDoOoW, 24 janvier 2013 - 06:23 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Say no to light!
« Reply #43 on: January 24, 2013, 06:35:36 pm »


               The visible ball of light is the flare. Removing the flare does not affect the illumination. You should try this out. I think you'll understand better what the improvement is.

To sum it all up most simply: the flare is removed while the illumination remains.
               
               

               
            

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
Say no to light!
« Reply #44 on: January 25, 2013, 01:55:47 am »


               I would also be overjoyed at a possible download package.