Function ivyListens() if p_ivy_listens.GetValueInt() == 0 && p_ivy_chats.GetValueInt() == 1 int listenMessage = 0 pIvyIsRecruited = True p_ivy_listens.SetValue(1) Ivy = pIVYCOMP.GetActorRef() Actor pPlayerRef = Game.GetPlayer() ;wait 15 seconds before initialising chat routines. Utility.Wait(4) ;debug message if p_ivy_debug_enabled.GetValueInt() == 1 Debug.Notification("Ivy Thought Loop started") endif While pIvyIsRecruited ;wait a bit... 4 seconds seems like a short time. But it picks a random topic, every time, and many topics don't apply at any one time. (e.g. location or quest related) ;so eventually nothing is said, even though the topic is called. Utility.Wait(4) ;added conditionals so Ivy doesn't interrupt her own hacking scenes and other important quest scenes, or player dialogue ;the other QUEST & LOCATION specific topic conditionals are in the scene IvySpontChatter TOPIC (under MISC tab) NPCChatCounter += 1 ScanCounter += 1 if pPlayerRef.IsInIronSights() == False && Ivy.IsInScene() == False && pPlayerRef.IsTalking() == False && Ivy.IsDoingFavor() == False && Ivy.IsTalking() == False Ivy.Say(p_IvySpontChatter, Ivy, False, pPlayerRef) endif if ScanCounter > p_ivy_scan_frequency.GetValueInt() && pPlayerRef.IsInIronSights() == False && Ivy.IsInScene() == False && pPlayerRef.IsTalking() == False && Ivy.IsDoingFavor() == False && Ivy.IsTalking() == False ScanCounter = 0 if Utility.RandomInt() < 15 int TST = Utility.RandomInt(0,100) if TST <= 40 p_ivy_situational_awareness_scan_items.Reset() p_ivy_situational_awareness_scan_items.Start() endif if TST > 40 p_ivy_situational_awareness_dialogue.Reset() p_ivy_situational_awareness_dialogue.Start() endif endif endif if NPCChatCounter > p_ivy_NPC_ChatterFrequency.GetValueInt() && pPlayerRef.IsInIronSights() == False && Ivy.IsInScene() == False && pPlayerRef.IsTalking() == False && Ivy.IsDoingFavor() == False && Ivy.IsTalking() == False ;always reset NPCChatCounter NPCChatCounter = 0 if Utility.RandomInt() < 15 p_ivy_SpeaksWithNPC.Reset() p_ivy_SpeaksWithNPC.Start() endif endif EndWhile endif EndFunction