Jump to content

Home

TSL Recruit NPC Switching


rgdelta

Recommended Posts

Ok here is the issue I have a Custom NPC (right now it is Lena (yes lena is in Kotor 2 I did not port)). I have her recruit and replace Atton. I have edited some scripts, the ebon hawk (added a wp for lena) and some includes now I have it when I enter the ebon hawk Atton is still there and Lena spawns in her new wp. She has a custom tag and does not spawn doubles as I edited certain scripts. Long story on how I did that part and I plan on releasing a tutorial of exactly what I did after I am done.

 

My problem now is this when I am on the ebon hawk I can switch back to atton with the RebuildPartyTable() command which resets the party table to what was there originally. Since atton is still on the Ebon Hawk when I select him when leaving and he has all his equipment and skills and levels.

 

Here is the problem I cannot switch back to Lena while on the ebon hawk I do this

 

// Replace Atton with Lena

void main()
{
object oPC = GetFirstPC();
object oLena = GetObjectByTag("lena");
RemoveAvailableNPC(0);
AddAvailableNPCByObject(0, oLena);
SetGlobalBoolean("ATTON_AVAIL", 0);
SetGlobalBoolean("LENA_AVAIL", 1);
SendMessageToPC(oPC, "Replacing Atton with Lena");
}

 

Here is the problem AddAvailableNPCByObject does not seem to work on the Ebon Hawk (except for Disciple and Handmaiden but they have different numbers)

 

Ignore the GlobalBoolean's they are just checks I will explain in my tutorial I confimed that RemoveAvailableNPC will work on the ebon hawk but the AddAvailableNPCByObject does not seem to work.

 

I confirmed my tags are correct on the objects I can get lena to walk to me or I can destroy her same with atton.

 

Here is my issue I want to be able to switch between Atton and Lena without recreating from template.

 

Any Ideas.

 

Edit : I found kind of a walkthrough but it limits me to 2 possible switches which is not bad but I would rather not it involves assigning the NPC's in the Ebon you want to switch with the originals assigning them as a Pup then when you leave the ebon hawk and enter the next module it spawns the npc's somewhere in the module. Then does the Addavailable (removing the ones in your party that it is replacing first) destroying the copies in the world then it opens the party selection gui. Not sure if this is the only way of retaining everything or not.

Link to comment
Share on other sites

Ok problem with my workaround is that when I switch back the XP goes up and it continues to the more you do it. Not sure if there is a way to stop the XP from going up.

 

What I have found is if I destroy the copy of say atton from the ebon hawk the add works fine but if I store say atton in one of the free pups then respawn him after adding the new npc into his slot when I readd atton back into the available party table his xp has gone up and I did not get any xp. My only other option is to have atton be fully unequiped putting the items in the pc's inventory and destorying then recreating him after the switch from template which means you would have to relevel him back up.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...