Action Que Question

I really don’t understand them. I’ve got a small series of actions that need to be carried out and then I want the script to repeat ad nauseum. As is, they are only being carried out just the once.

For OnHeartbeat:

 // Custom code.
    oActor = OBJECT_SELF;
    AssignCommand(oActor, ClearAllActions());
    AssignCommand(oActor, ActionMoveToObject(GetNearestObjectByTag("NW_INTERACTIVE_01")));
    AssignCommand(oActor, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 6.0));
    AssignCommand(oActor, ActionMoveToObject(GetNearestObjectByTag("NW_INTERACTIVE_02")));
    AssignCommand(oActor, ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 6.0));
    AssignCommand(oActor, ActionMoveToObject(GetNearestObjectByTag("NW_INTERACTIVE_03")));
    AssignCommand(oActor, ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 6.0));

AssignCommand is needless when the oActor is OBJECT_SELF, you can safely drop that.

The reason for your problem is most likely the fact that the first animation action takes 6 seconds which is exactly the time for another heartbeat to run and reset the actions over and over.

There are two solutions to this.

Either add these two lines under last playanimation line:

ActionDoCommand(SetCommandable(TRUE));
SetCommadable(FALSE);

Or, set variable before doing these actions and start the heartbeat script by “if the variable is true do nothing”.

How would I go about creating the sort of placeable interaction between the NPC and said placeable? How do I recreate how Bioware/Beamdog made their villages so lively?

That’s a much broader question than you started with :slight_smile:

There are lots of scripts around to do this in various ways, bar scripts, blacksmith scripts, a whole ambient system, NPC activities, advanced walkwaypoints etc.

One that has a lot of bang for the buck is Tseramed's NPC Puttering | The Neverwinter Vault If I recall this is a single script you can use for heartbeat so it’s easy to pull in and use.

There are also scripting and building tutorials/docs around somewhere which cover some of this.

Also, you can open the bioware modules and poke around there and see what they are doing if you have an example of something you want to try to replicate.

Thanks for the heads up. …and I guess I did expand the original premise., if a little bit.
Oh, thanks a lot! Now I have a menagerie of kobolds insisting on carrying out their little kobold menial tasks! Ha! :smile:

That would be my solution

  if (IsInConversation (OBJECT_SELF) || GetIsInCombat ())
    {
      SetLocalInt(OBJECT_SELF, "acting", 0)
      return;
    }
  if (GetLocalInt(OBJECT_SELF, "acting") == 1) return;
  SetLocalInt(OBJECT_SELF, "acting", 1);

  ClearAllActions();
  ActionMoveToObject(GetNearestObjectByTag("NW_INTERACTIVE_01"));
  ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 6.0);
  ActionMoveToObject(GetNearestObjectByTag("NW_INTERACTIVE_02"));
  ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 1.0, 6.0);
  ActionMoveToObject(GetNearestObjectByTag("NW_INTERACTIVE_03"));
  ActionPlayAnimation(ANIMATION_LOOPING_GET_LOW, 1.0, 6.0);

  ActionDoCommand (SetLocalInt(OBJECT_SELF, "acting", 0));