Here’s what I’m trying to do: Have a henchman join the PC, then assign them a task of speaking to every person in the area, in any order. Once this is done, the henchman will start a conversation with the PC to move the story along. This henchman conversation should only happen once.
I tried doing this by defining an integer that gets a +1 from each NPC upon conversing with them, and then adding a script to the henchman’s heartbeat, which checks for this integer to be the exact number of people the PC needs to speak with.
Unfortunately, nothing happens in the game, no matter how much I adjust the code (before the henchman would start the conversation multiple times, now they don’t start it at all). I tried including a DoOnce script but it didn’t help, and I tried all kinds of other things (Area & Module heartbeats even) but I’m at a complete loss.
Here’s part of the henchman heartbeat script:
object oTarget;
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
int nInt;
nInt = GetLocalInt(oPC, “folkcount”);if (GetLocalInt(oPC, “folkcount”)== 2)
{
if (GetLocalString(OBJECT_SELF, “Done”) == “TRUE”) return;
else
{
SetLocalString(OBJECT_SELF, “Done”, “TRUE”);
ActionStartConversation(oPC, “c_brianwolf”);
nInt += 1;
SetLocalInt(oPC, “folkcount”, nInt);
}
}
Edit: Quick notes, both the “Done” string and the +1 to the “folkcount” integer are my attempts at making this conversation happen once. The string is self-explanatory, and for the integer, I was hoping by making it +1 (so it’s 3 post the script), the heartbeat will check for 2, find it’s 3, and ignore the script. But like I said, absolutely nothing happens in game once folkcount reaches 2.