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 scriptvoid 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 scriptvoid 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 offUsed by PC to turn on
Modifié par Tiberius_Morguhn, 27 décembre 2012 - 08:56 .