PDA

View Full Version : Why ...


GeorgNihilus
03-21-2009, 07:45 PM
Hey there :) I have problems with this perception script, I used this perfectly for Kotor but it's doing nothing in TSL ... it is compiling clean anyway for TSL, but my NPC ignores completely the script when she should "see" my party.

Here's the script:

void main() {

int bRun;
float fRange;
float fTimeout;

// Get object reference to the NPC I just spotted.
object oSeen = GetLastPerceived();
object oNPC = GetObjectByTag("RVquan");
object oPC = GetFirstPC();

// If the character I see is the player character ... (or Kreia, Mira, Atton, the Hmaiden, Visas or HK47)
// AND I haven't already done this...
if (GetLastPerceptionSeen() && (oSeen == GetObjectByTag("hk47") || oSeen == GetObjectByTag("Handmaiden") || oSeen == GetFirstPC() || oSeen == GetObjectByTag("Mira") || oSeen == GetObjectByTag("Kreia") || oSeen == GetObjectByTag("Atton") || oSeen == GetObjectByTag("Visasmarr")) && !GetLocalBoolean(OBJECT_SELF, 50)) {

// Set that I've done this...
SetLocalBoolean(OBJECT_SELF, 50, TRUE);

// Stop doing anything I'm doing.
ClearAllActions();

// Start conversation in ff_qanisum.dlg with player.
DelayCommand(1.2, ActionStartConversation(oSeen, "ff_qanisum", FALSE, 0, TRUE));

// Move closer to the player so we don't have to shout across the area, running.
SetCommandable(TRUE);
ActionForceMoveToObject(oPC, bRun=TRUE, fRange=2.7f, fTimeout=30.0f);

}
// Not seeing the player, or this has already been done. Do standard AI instead.
else {
ExecuteScript("k_ai_master", OBJECT_SELF, 1002);
}
}

GetLastPerceived() and GetLastPerceptionSeen() act same way as in Kotor? should they? :confused:

thanks on advance :)

GeorgNihilus
03-22-2009, 06:07 PM
Hah! silly me :nut: ... I placed the script in the OnSpawn field instead of the OnNotice one damn ... so the script works fine after all.

thanks anyway people :D