Author Topic: Simple OnPerceived - and the woes of ActionSpeakString  (Read 335 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Simple OnPerceived - and the woes of ActionSpeakString
« on: April 03, 2014, 03:02:36 am »


               

Thoughts why I can't get NPCs to run the following code in OnPerceived?


 


 

//Goes OnPerceived of a creature

void main()

{

 

object oPC = GetLastPerceived();

 

if (!GetIsPC(oPC)) return;

 

if (!GetLastPerceptionSeen()) return;

ActionSpeakString("Something to say here!", TALKVOLUME_TALK);

 

}

 

 


I can't get it to work, but if I swap out ActionSpeakString with FloatingTextStringOnCreature("Make the PC talk", oPC);, it works fine. I've tried FloatingTextStringOnCreature("Make the PC talk", OBJECT_SELF) but that isn't making the bugger speak either.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Simple OnPerceived - and the woes of ActionSpeakString
« Reply #1 on: April 03, 2014, 03:10:51 am »


               

replace with SpeakString


 


the proble is in the action again, NPC probably initiates the combat which clears the action queve



               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Simple OnPerceived - and the woes of ActionSpeakString
« Reply #2 on: April 03, 2014, 03:19:43 am »


               

OH my gosh. Perfect. I can't praise you enough, thanks Shadooow.