brwarner Posted September 7, 2005 Share Posted September 7, 2005 I have yet another question, In my sidequest I wan't to make I want the PC(player) to be removed from your party so you only have your party members. Similar to when your on Gotos ship you play with 3 party members because the PC has been kidnapped. If anyone knows how to make a script like that please tell me. Link to comment Share on other sites More sharing options...
Tupac Amaru Posted September 7, 2005 Share Posted September 7, 2005 You can change the player character this way: void SwitchToNPC(int nNPC); void main() { DelayCommand(1.0, SwitchToNPC(NPC_constant)); // Delay it or it crashes. } void SwitchToNPC(int nNPC) { SwitchPlayerCharacter(nNPC); } The npc_constants are listed in nwscript. If you want the Exile back use NPC_PLAYER. The command SwitchPlayerCharacter will also remove your current party members. You cannot use the party selection screen to add them, so you'll have to modify the script. This script will remove the Exile from the party and allows you to keep the current party members: #include "k_inc_glob_party" void SwitchToNPC(int nNewLeader, int nPartyMember); void main() { SetPartyLeader(NPC_PLAYER); int nPartyMember1 = GetNPCConstant(GetTag(GetPartyMemberByIndex(1))); int nPartyMember2 = GetNPCConstant(GetTag(GetPartyMemberByIndex(2))); ClearPlayerParty(); DelayCommand(1.0, SwitchToNPC(nPartyMember1, nPartyMember2)); } void SwitchToNPC(int nNewLeader, int nPartyMember) { if(nNewLeader >= -1 && nNewLeader <= 11) { SwitchPlayerCharacter(nNewLeader); } if(nPartyMember >= 0 && nPartyMember <= 11) { object oNewPartyMember = SpawnAvailableNPC(nPartyMember, GetLocation(GetPartyLeader())); AddPartyMember(nPartyMember, oNewPartyMember); } } I hope that what you wanted. Link to comment Share on other sites More sharing options...
Slipstreme Posted September 7, 2005 Share Posted September 7, 2005 Why do you want to do that? Link to comment Share on other sites More sharing options...
Commas Posted September 7, 2005 Share Posted September 7, 2005 brilliant! thanks for the info Tupac Amaru! i was also wondering how to do this Bookmark'd! @slipstreme: perhaps to make a custom sidequest similar to 1)Mira fighting Hanharr (Nar Shaddaa and Malachor) 2)Goto's Yacht 3)Dxun Tomb 4)Remote on Malachor. I know i am using it myself in a recruit mod. edit: i decided that could use some spoiler tags Link to comment Share on other sites More sharing options...
brwarner Posted September 7, 2005 Author Share Posted September 7, 2005 Yea thats just what i needed Thanks. Link to comment Share on other sites More sharing options...
Slipstreme Posted September 7, 2005 Share Posted September 7, 2005 Oh and don't forget Atton vs Twin Sun's Link to comment Share on other sites More sharing options...
Commas Posted September 7, 2005 Share Posted September 7, 2005 ^^^ i knew i had forgotten one! and that was even the first one my mind jumped too when i was typing that post Link to comment Share on other sites More sharing options...
Slipstreme Posted September 7, 2005 Share Posted September 7, 2005 The only other one I know of is T3 vs the HK-50's Link to comment Share on other sites More sharing options...
brwarner Posted October 19, 2005 Author Share Posted October 19, 2005 sorry to reply on an old thread but I recently used this script for kotor 1 and it did nothing. Is there something that must be changed, it compiles correctly. Link to comment Share on other sites More sharing options...
The_Maker Posted October 20, 2005 Share Posted October 20, 2005 Some scripts only work in TSL, so the odds are the script just doesn't exist in K1 because if I remember correctly you are always your PC. Try it in TSL, if not then something didn't work correctly Link to comment Share on other sites More sharing options...
Darth333 Posted October 20, 2005 Share Posted October 20, 2005 The above script can't work with kotor 1 but this should work: void main() { SwitchPlayerCharacter(NPC_CANDEROUS); } You can replace NPC_CANDEROUS by one of the following: NPC_BASTILA NPC_CANDEROUS int NPC_CARTH NPC_HK_47 NPC_JOLEE NPC_JUHANI NPC_MISSION NPC_T3_M4 NPC_ZAALBAR However, as explained by Tupac Amaru, this will also remove your other party members. If you want to add them, you'll need something more than this. I can't post it tonight as I have to check a few things and it's already 1:15 am so it'll have to wait unless someone else fills the blanks in the meantime Link to comment Share on other sites More sharing options...
brwarner Posted October 20, 2005 Author Share Posted October 20, 2005 Darth333 I tried your script but the game freezes. Also I only need this because you will only have 1 party member. Link to comment Share on other sites More sharing options...
Tupac Amaru Posted October 21, 2005 Share Posted October 21, 2005 The game will crash if you try to switch to an NPC that is currently in your party. If that wasn't the reason, it may be neccessary to delay the command or do a ClearAllActions() on the current PC. This should safely switch to, for example, Canderous in K1: #include "k_inc_utility" void SwitchToNPC(int nNPC); void main() { if(IsObjectPartyMember(GetObjectByTag("Cand"))) { RemovePartyMember(NPC_CANDEROUS); } DelayCommand(1.0, SwitchToNPC(NPC_CANDEROUS)); } void SwitchToNPC(int nNewPC) { SwitchPlayerCharacter(nNewPC); } If I understood you correctly you only have one party member want to switch to that one: #include "k_inc_utility" void SwitchToNPC(int nNPC); void main() { SetPartyLeader(NPC_PLAYER); int nPartyMemberOneCode = UT_GetNPCCode(GetPartyMemberByIndex(1)); UT_ClearAllPartyMembers(); DelayCommand(1.0, SwitchToNPC(nPartyMemberOneCode)); } void SwitchToNPC(int nNewPC) { SwitchPlayerCharacter(nNewPC); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.