Modifié par M. Rieder, 08 juin 2011 - 01:09 .
Removing roster member and keeping them from disappearing (resolved )
Débuté par
M. Rieder
, juin 08 2011 01:21
#1
Posté 08 juin 2011 - 01:21
I want to remove a companion, but keep them around. I'm using the script ga_roster_party_remove. Should I be using a different one, or are there other scripts that must be used in conjunction with this one?
#2
Posté 08 juin 2011 - 01:38
After I used ga_roster_party_remove, I used ga_roster_spawn and spawned the party member back to the same spot. It worked. I don't know if it is the best way, but it seems to work.
If anyone knows a cleaner way to do it, I'm interested.
If anyone knows a cleaner way to do it, I'm interested.
#3
Posté 08 juin 2011 - 07:59
AFAIK - RemoveRosterMemberFromParty() will simply leave the companion or henchman where they stand when executed.
#4
Posté 08 juin 2011 - 08:48
open the scripts that do almost what you want, and change what need to be changed, rename it differently, and use it.
ga_roster_party_remove has a despawn instruction, you need to remove it to have something clean if you don't want the NPC to deasapear.
here a generic script wich remove a party member
[nwscript]
//this script will remove the NPC with "tag" as tag from the party
//tag is the roster name of the Object
void main(string tag){
AssignCommand(GetObjectByTag(tag),ClearAllActions(TRUE));
RemoveRosterMemberFromParty(tag,GetFirstPC(TRUE),FALSE);
}
[/nwscript]
ga_roster_party_remove has a despawn instruction, you need to remove it to have something clean if you don't want the NPC to deasapear.
here a generic script wich remove a party member
[nwscript]
//this script will remove the NPC with "tag" as tag from the party
//tag is the roster name of the Object
void main(string tag){
AssignCommand(GetObjectByTag(tag),ClearAllActions(TRUE));
RemoveRosterMemberFromParty(tag,GetFirstPC(TRUE),FALSE);
}
[/nwscript]
Modifié par Shallina, 08 juin 2011 - 08:55 .
#5
Posté 08 juin 2011 - 01:08
Thanks for the info.
#6
Posté 08 juin 2011 - 09:17
I use this script:
// bb_roster_party_remove
// author: Dick Loraine
// date: April 16, 2007
// instigator: Brendan Bellina
// info: <http://nwn2forums.bi...9412&forum=114>
// Used to eject a companion from the party and respawn
// the companion in place. The respawn is needed to force
// the inventory of the character to be saved, otherwise
// when you add the person back into the party any
// unequipped items will be gone.
#include "ginc_param_const"
void main(string sRosterName, string sTarget)
{
object oTarget = GetTarget(sTarget, TARGET_PC);
object oCompanion = GetObjectFromRosterName(sRosterName);
location lTarget = GetLocation(oCompanion);
RemoveRosterMemberFromParty(sRosterName, oTarget);
SpawnRosterMember(sRosterName, lTarget);
}
// bb_roster_party_remove
// author: Dick Loraine
// date: April 16, 2007
// instigator: Brendan Bellina
// info: <http://nwn2forums.bi...9412&forum=114>
// Used to eject a companion from the party and respawn
// the companion in place. The respawn is needed to force
// the inventory of the character to be saved, otherwise
// when you add the person back into the party any
// unequipped items will be gone.
#include "ginc_param_const"
void main(string sRosterName, string sTarget)
{
object oTarget = GetTarget(sTarget, TARGET_PC);
object oCompanion = GetObjectFromRosterName(sRosterName);
location lTarget = GetLocation(oCompanion);
RemoveRosterMemberFromParty(sRosterName, oTarget);
SpawnRosterMember(sRosterName, lTarget);
}





Retour en haut






