I know they lose thier tag so I have done it by searching for the nearest light object, but it's not working. The script in bold is the bit that is supposed to be switching the light on.
I found the recomputelighting script, id this needed?
All help welome
void main()
{
object oPC = GetPCSpeaker();
object oItem;
oItem = GetItemPossessedBy(oPC, "dd_sune_key");
if (GetIsObjectValid(oItem))
DestroyObject(oItem);
object oTarget;
oTarget = GetObjectByTag("2010_dd_sune_gem_1");
effect eBeam1 = EffectNWN2SpecialEffectFile("fx_a_spirit_gorge_hit");
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam1, oTarget, 3.0f);
object oNearest = GetNearestObject(OBJECT_TYPE_LIGHT,oTarget);
SetPlaceableIllumination (oNearest, TRUE);
object oArea = GetArea(oTarget);
RecomputeStaticLighting(oArea);
oTarget = GetObjectByTag("2010_dd_sune_gem_2");
effect eBeam2 = EffectNWN2SpecialEffectFile("fx_death_god_light_blue");
DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eBeam2, oTarget, 3.0f));
}
PJ





Retour en haut







