Trying to add a few lines that will make my NPC henchman vanish after a conversation. As well, I'm trying to add a conversation that will level him up to 1 level beneath the PC. I've been using Lilac's program for the latter and, for the vanishing NPC script, I pulled it off a Google search and it works for other NPCs but only if they aren't attached as a henchmen or, perhaps, don't have a henchman script set?
The two scripts in question (After-conversation action called from the conversation):#include "nw_i0_tool"
void main()
{
object oPC = GetPCSpeaker();
AddJournalQuestEntry("GrimCompanions", 2, oPC, TRUE, FALSE, TRUE);
RewardPartyXP(1000, oPC, FALSE);
object oTarget;
oTarget=GetHenchman(oPC);
RemoveHenchman(oPC, oTarget);
}
The above is working properly. This part, however, is not:ActionForceMoveToObject (GetObjectByTag ("APsychoticDruid"), TRUE, 0.2, 10.);
ActionDoCommand( DestroyObject( OBJECT_SELF ) );
SetCommandable( FALSE );
}
I have been testing this with the NPC in question alongside me as a copy, with the original located somewhere else in the module when this script line is called for...Don't think that's relevant though considering the other 3 actions are working properly.
The Level-Up Script (Also called from a conversation):void main()
{
object oPC = GetPCSpeaker();
object oTarget;
oTarget = GetHenchman(oPC);
int nInt;
if (GetIsObjectValid(oTarget))
{
nInt = GetHitDice(oPC) - GetHitDice(oTarget);
while (nInt>0)
{
LevelUpHenchman(oTarget);
nInt--;
}
}
}
Again, help is really appreciated. This is the first real module I'm creating so I'm a bit of a newbie at this stuff. I don't know anything about integer variables and the Lexicon as well as a Toolset Manual PDF haven't yielded anything useful.
Modifié par Werthers Chewbackas, 10 novembre 2010 - 11:47 .