I have a companion that I want to be removed from the party if it dies. I wrote a simple script that should do the job, but it does not. I added some changes and the script does not seem to be firing. I put the script in the "on death" event of the NPC in the toolset. Does the game engine change the script set when an NPC becomes a companion?
**Note, based on the circumstances the NPC could be a henchman or companion, so I am covering both situations. So far I've only tested the companion part.
Here's the script:
void main()
{
object oPC = GetFirstPC();
object oSelf = OBJECT_SELF;
string sRosterName = GetRosterNameFromObject(oSelf);
if (sRosterName == "")
{
RemoveHenchman(GetMaster(oSelf));
}
else
{
RemoveRosterMemberFromParty(sRosterName,oPC);
}
}
Removing a companion from the party on death.
Débuté par
M. Rieder
, janv. 16 2011 08:59
#1
Posté 16 janvier 2011 - 08:59
#2
Posté 16 janvier 2011 - 11:10
My suspicions were correct. When I modified the script "gb_comp_death", then I started getting results. This suggests to me that when you add an NPC to your party, the scripts you have placed in their events get changed to the standard companion scripts.
#3
Posté 17 janvier 2011 - 12:38
M. Rieder wrote...
My suspicions were correct. When I modified the script "gb_comp_death", then I started getting results. This suggests to me that when you add an NPC to your party, the scripts you have placed in their events get changed to the standard companion scripts.
Hi Matt,
This is correct. The scripts *are* changed.
Look at the NWN_Scriptsets.2da and it will answer some of your questions. I use this 2da with my own line added to alter companions inm all sorts of ways.
Lance.
#4
Posté 17 janvier 2011 - 01:35
No the script aren't changed alone, but somme actions can not be performed on dead NPC with the default scripts.
#5
Posté 17 janvier 2011 - 07:54
@ Lance
So with a new line, you can add your own custom scripts instead of the default ones, eh? Clever.
@Shallina
What actions can be performed with the default scripts?
So with a new line, you can add your own custom scripts instead of the default ones, eh? Clever.
@Shallina
What actions can be performed with the default scripts?





Retour en haut






