Aller au contenu

Photo

Say no to light!


  • Veuillez vous connecter pour répondre
69 réponses à ce sujet

#26
Master Jax

Master Jax
  • Members
  • 352 messages
Aaaaand I have confirmed what Pearls said! The texture obscuring override does affect spells, so it is a no-no. Sigh... -__- And as I mentioned earlier, placeables don't have flare or aurora light values, so, either they use the same values with a different name, or work differently altogether.

#27
Tiberius_Morguhn

Tiberius_Morguhn
  • Members
  • 247 messages
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.

#28
henesua

henesua
  • Members
  • 3 863 messages

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. :)

#29
WoC_Builder

WoC_Builder
  • Members
  • 225 messages

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.


Thank you.  :)  While I will put your tile flare edit into our mod with a hak update, if you can figure out how to fix placeable flare that would be a huge thing for our world as well.  I have always found it annoying to turn of the placeable light but still have this annoying glow present. 

#30
Master Jax

Master Jax
  • Members
  • 352 messages
Sounds interesting Tiberius! I hope your efforts meet success! I concur with what most have said here, and such would be a breakthrough!

#31
WoC_Builder

WoC_Builder
  • Members
  • 225 messages

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. :)


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.

#32
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
 <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 Image
Edit: Posted the wrong image. That one was with alphamean ;-P

Posted Image
With light amped up

Posted Image
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 .


#33
henesua

henesua
  • Members
  • 3 863 messages

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. :)

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.

#34
Tiberius_Morguhn

Tiberius_Morguhn
  • Members
  • 247 messages
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 Image

Used by PC to turn on
Posted Image

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


#35
Tiberius_Morguhn

Tiberius_Morguhn
  • Members
  • 247 messages
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.

#36
Oseryn

Oseryn
  • Members
  • 48 messages
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 .


#37
Oseryn

Oseryn
  • Members
  • 48 messages
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..

#38
Rolo Kipp

Rolo Kipp
  • Members
  • 2 791 messages
<dreaading...>

Nicely done, O!

<...another flare-up>

#39
henesua

henesua
  • Members
  • 3 863 messages
That works for me too, Oseryn. Thanks.

#40
Tiberius_Morguhn

Tiberius_Morguhn
  • Members
  • 247 messages
So maybe there are easier ways .... lol. Thank you!

#41
Shadooow

Shadooow
  • Members
  • 4 470 messages

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 .


#42
henesua

henesua
  • Members
  • 3 863 messages
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.

#43
Shadooow

Shadooow
  • Members
  • 4 470 messages

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 .


#44
henesua

henesua
  • Members
  • 3 863 messages
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.

#45
DM_Vecna

DM_Vecna
  • Members
  • 280 messages
I would also be overjoyed at a possible download package.

#46
Shadooow

Shadooow
  • Members
  • 4 470 messages

henesua wrote...

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.

ok tested, modified fx_flame looks promising, the flare effect really does look weird on tileset light sources
I do agree this is serious improvement and adds immersion, so will include in CP then.

however i was unable to modify the fx_placeable.mdl, even decompiled default file crashes toolset and Oseryn's code is also unmodified model content. So how to remove the flare from placeables? Had anyone else succeded in this?

Modifié par ShaDoOoW, 26 janvier 2013 - 02:17 .


#47
Tiberius_Morguhn

Tiberius_Morguhn
  • Members
  • 247 messages
I did - here is the mdl file decompiled with flare removed (fx_placeable01.mdl) :

#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 0
  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

Note that this is working fine in my override and removes flare for all placeables that have them.

Modifié par Tiberius_Morguhn, 26 janvier 2013 - 09:21 .


#48
Shadooow

Shadooow
  • Members
  • 4 470 messages
thanks Tiberius_Morguhn, Ive tested it and it works however, I had right about the placeable light

henesua wrote...

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.

my tests indicated that the placeable settings adds only the flare, there is not any other light added with it, so using a "game engine" modification to get rid of something you can easily get rid off via 2da seems to overkill to me.

Ive placed flame, lamp post and candelabra into total dark area. With the modified fx_placeable.mdl this was removed as Oseryn promised, but while flame and candelabra still had some lights, the lamp post doesn't which is serious problem. Seems that lamp post is light source free and the only light makes the flare. The light setting in 2da adds only flare, any illumination it adds comes from flare, removing it results in lost of this illumination.

(Or maybe Tiberius modified the fx_placeable in wrong way, I don't know...)

Modifié par ShaDoOoW, 27 janvier 2013 - 02:11 .


#49
henesua

henesua
  • Members
  • 3 863 messages
ShaDoOoW, I believe you ae mistaken with regards to the flare and light. When the flare is removed, a light still remains.

Which placeables are talking you about?

I assume that the "Lamp Post" you are referring to is the vanilla placeable at index 73.
73 LampPost 5715 PLC_K01 6 0.003989 0.010826 3.87363 22 1 0 **** default 1

Place it.
Turn off static
Set State to Activated.

Copy it.
Set State to Deactivated.

Posted Image
Note that both have ambient light, but only one is animated as being turned on. Also no flares visible.

Modifié par henesua, 27 janvier 2013 - 03:51 .


#50
Shadooow

Shadooow
  • Members
  • 4 470 messages
You don't understand what I meant in the initial post

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?

this 2da setting only adds flare as I thought, there is no other light from this, I tested this on a placeable with no ambient light to be sure

And since there is no other light than the flare, whats the reason to remove flare via model modification? I mean - for a player use this is great, it will work anytime even when playing CEP module which don't allow overriding the placeable.2da via override folder.

But for general use, such as CP, this is not good, if a builder would make a placeable with no ambient light using flare, then with this modification, there wouldn't be any light. As seen with LampPost placeable set to static, assume there is a PW out there using static LampPosts. With this overide, these lamps wouldn't provide any light at all.

Modifié par ShaDoOoW, 27 janvier 2013 - 07:26 .