Tested this out.
The first script compiles but I can't get it to work.
Here are the variations I've tried to get it working.
Spell cast is Improved Invisibility. Entire party is INVISIBLE when examining them.
Spell cast is Invisibility. Only the player is INVISIBLE.
Lines highlighted for script differences.Does not work - Invisibility/Improved invisibility or not
// FAILS : NPC does nothing
void main()
{
object oPC = GetEnteringObject();
object oNPC = GetNearestObjectByTag( "250B4_NPC02", oPC);
object oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1,
CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT,
SPELL_TRUE_SEEING);
effect eFreeze = EffectCutsceneImmobilize();
if( !GetIsPC( oPC)) return;
if(!GetIsObjectValid(oSeeMe))
{
oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION,
REPUTATION_TYPE_ENEMY,
OBJECT_SELF,
1,
CREATURE_TYPE_PERCEPTION,
PERCEPTION_SEEN,
CREATURE_TYPE_HAS_SPELL_EFFECT,
SPELL_SEE_INVISIBILITY);
} return;
AssignCommand( oNPC, SpeakString("DEBUG: I SEE YOU!"));
SetLocalInt(GetFirstPC(), "b250b4", 1);
AssignCommand( oPC, ClearAllActions( TRUE));
AssignCommand( oPC, ActionDoCommand( SetCommandable( TRUE, oPC)));
AssignCommand( oPC, ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFreeze, oPC, 15.0)));
AssignCommand( oNPC, ClearAllActions( TRUE ));
AssignCommand( oNPC, ActionForceMoveToObject( oPC, FALSE));
AssignCommand( oNPC, ActionStartConversation( oPC));
AssignCommand( oPC, SetCommandable( FALSE, oPC));
}
Does not work - Invisibility/Improved or not
// FAILS : NPC does nothing
void main()
{
object oPC = GetEnteringObject();
object oNPC = GetNearestObjectByTag( "250B4_NPC02", oPC);
object oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1,
CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN, CREATURE_TYPE_HAS_SPELL_EFFECT,
SPELL_TRUE_SEEING);
effect eFreeze = EffectCutsceneImmobilize();
if( !GetIsPC( oPC)) return;
if(GetIsObjectValid(oSeeMe))
{
oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION,
REPUTATION_TYPE_ENEMY,
OBJECT_SELF,
1,
CREATURE_TYPE_PERCEPTION,
PERCEPTION_SEEN,
CREATURE_TYPE_HAS_SPELL_EFFECT,
SPELL_SEE_INVISIBILITY);
} return;
AssignCommand( oNPC, SpeakString("DEBUG: I SEE YOU!"));
SetLocalInt(GetFirstPC(), "b250b4", 1);
AssignCommand( oPC, ClearAllActions( TRUE));
AssignCommand( oPC, ActionDoCommand( SetCommandable( TRUE, oPC)));
AssignCommand( oPC, ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFreeze, oPC, 15.0)));
AssignCommand( oNPC, ClearAllActions( TRUE ));
AssignCommand( oNPC, ActionForceMoveToObject( oPC, FALSE));
AssignCommand( oNPC, ActionStartConversation( oPC));
AssignCommand( oPC, SetCommandable( FALSE, oPC));
}
When I remove the following:
if(!GetIsObjectValid(oSeeMe))
{
oSeeMe = GetNearestCreature(CREATURE_TYPE_REPUTATION,
REPUTATION_TYPE_ENEMY,
OBJECT_SELF,
1,
CREATURE_TYPE_PERCEPTION,
PERCEPTION_SEEN,
CREATURE_TYPE_HAS_SPELL_EFFECT,
SPELL_SEE_INVISIBILITY);
} return;
The NPC fires the DEBUG line.
The second script does not compile.
- ERROR: FUNCTION IMPLEMENTATION AND DEFINTITION DIFFER
FP!
Modifié par Fester Pot, 12 novembre 2011 - 12:23 .