Here's both scripts
Script 1:
// -------------------------------------------------------
// Support function: Assign a puppet to a party member
// -------------------------------------------------------
void ST_GivePuppet(int nNPC, int nPUP, string sTemplate) {
string sTag = "";
switch (nNPC) {
case NPC_ATTON: sTag = "atton"; break;
case NPC_BAO_DUR: sTag = "baodur"; break;
case NPC_CANDEROUS: sTag = "mand"; break;
case NPC_G0T0: sTag = "g0t0"; break;
case NPC_HANDMAIDEN: sTag = "handmaiden"; break;
case NPC_HK_47: sTag = "hk47"; break;
case NPC_KREIA: sTag = "kreia"; break;
case NPC_MIRA: sTag = "mira"; break;
case NPC_T3_M4: sTag = "t3m4"; break;
case NPC_VISAS: sTag = "visasmarr"; break;
case NPC_HANHARR: sTag = "hanharr"; break;
case NPC_DISCIPLE: sTag = "disciple"; break;
}
object oOwner = GetObjectByTag(sTag);
if (GetIsObjectValid(oOwner) && IsObjectPartyMember(oOwner)) {
location lLoc = (GetPosition(oOwner) + AngleToVector(GetFacing(oOwner)) * 2.0, GetFacing(oOwner)-180.0);
AddAvailablePUPByTemplate(nPUP, sTemplate);
AssignPUP(nPUP, nNPC);
object oPUP = SpawnAvailablePUP(nPUP, lLoc);
AddPartyPuppet(nPUP, oPUP);
SetNPCAIStyle(oPUP, NPC_AISTYLE_PARTY_SUPPORT);
}
}
// -------------------------------------------------------
// Main function: Example, call above function to assign
// a puppet in st_puppet1.utc to Kreia.
// -------------------------------------------------------
void main() {
// Spawn the "st_puppet1" UTC as a puppet, assign it to Kreia
ST_GivePuppet(NPC_MIRA, PUP_OTHER1, "mira_puppet");
}
Script 2
// ST: st_ai_puppethb.nss
#include "k_inc_generic"
void main() {
object oEnemy = GetNearestCreature(
CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN,
OBJECT_SELF, 1,
CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY,
CREATURE_TYPE_IS_ALIVE, TRUE
);
if (!GN_GetSpawnInCondition(SW_FLAG_AI_OFF)) {
if (GetIsPuppet()
&& (GetIsObjectValid(GetPUPOwner())
&& (GetCurrentAction(OBJECT_SELF) != ACTION_MOVETOPOINT)
&& (GetCurrentAction(OBJECT_SELF) != ACTION_FOLLOWOWNER)
&& !GetIsConversationActive()
&& !GN_GetSpawnInCondition(SW_FLAG_SPECTATOR_STATE)
&& GetCommandable()
&& (GetDistanceBetween2D(OBJECT_SELF, GetPUPOwner()) > 3.0)
&& (!GetIsObjectValid(oEnemy) || (GetDistanceBetween(oEnemy, OBJECT_SELF) > 20.0))))
{
ClearAllActions();
ActionFollowOwner(2.0);
}
}
if (GN_GetSpawnInCondition( SW_FLAG_EVENT_ON_HEARTBEAT ))
SignalEvent(OBJECT_SELF, EventUserDefined(1001));
}
Neither compiles though they're source scripts straight from the modder themselves.