Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leviathan Hangar - Bastila's items are all gone from the inventory but the wielded weapon #419

Closed
Salk73 opened this issue Aug 2, 2020 · 6 comments
Labels
Module: Leviathan Issue occurs primarily on the Leviathan Type: Scripting This issue is related specifically to a scripting bug/error

Comments

@Salk73
Copy link

Salk73 commented Aug 2, 2020

As reported here.

I am not able at the moment to check what happens once Bastila rejoins but I guess all the removed items are back?

Anyway, there is an inconsistency here: either all items should be removed or none. Personally, I would remove them all.

Opinions?

@StellarExile
Copy link

I'm not sure if it was intentional or not, but I do agree. Either none or all. I think it's a common problem in the game. I do recall encountering that sometimes party members aren't lootable after their DS demise (Mission, for example).

@Salk73
Copy link
Author

Salk73 commented Nov 27, 2020

@JCarter426, @StellarExile and @DarthParametric,

I have modified the existing k_plev_destweap script so that all items worn by Bastila are returned to the Player's inventory although I'm not sure that is the best solution if it was possible to return them when/if Bastila ever rejoins the party. Would SaveNPCState() perhaps work towards that end?

And if that function won't save the items, would that at least save Bastila's stats so that they can be correctly restored when/if she joins the party again? See #443.

If SaveNPCState() won't do the job at all then here's the modified script. Tested and working.

void StripBastila() {

  object oPC = GetFirstPC();
  object oBastHead = GetItemInSlot(INVENTORY_SLOT_HEAD);
  object oBastBody = GetItemInSlot(INVENTORY_SLOT_BODY);
  object oBastHands = GetItemInSlot(INVENTORY_SLOT_HANDS);
  object oBastRArm = GetItemInSlot(INVENTORY_SLOT_RIGHTARM);
  object oBastLArm = GetItemInSlot(INVENTORY_SLOT_LEFTARM);
  object oBastBelt = GetItemInSlot(INVENTORY_SLOT_BELT);
  object oBastImplant = GetItemInSlot(INVENTORY_SLOT_IMPLANT);

  SetCommandable(1);
  ClearAllActions();

  if (GetIsObjectValid(oBastHead)) {
    ActionUnequipItem(oBastHead, TRUE);
    GiveItem(oBastHead, oPC);
  }
  if (GetIsObjectValid(oBastBody)) {
    ActionUnequipItem(oBastBody, TRUE);
    GiveItem(oBastBody, oPC);
  }
  if (GetIsObjectValid(oBastHands)) {
    ActionUnequipItem(oBastHands, TRUE);
    GiveItem(oBastHands, oPC);
  }
  if (GetIsObjectValid(oBastRArm)) {
    ActionUnequipItem(oBastRArm, TRUE);
    GiveItem(oBastRArm, oPC);
  }
  if (GetIsObjectValid(oBastLArm)) {
    ActionUnequipItem(oBastLArm, TRUE);
    GiveItem(oBastLArm, oPC);
  }
  if (GetIsObjectValid(oBastBelt)) {
    ActionUnequipItem(oBastBelt, TRUE);
    GiveItem(oBastBelt, oPC);
  }
  if (GetIsObjectValid(oBastImplant)) {
    ActionUnequipItem(oBastImplant, TRUE);
    GiveItem(oBastImplant, oPC);
  }
}

void main() {

  object oBastila = GetObjectByTag("Bastila");
  object oCarth = GetObjectByTag("Carth");

  string sTempSaber = "bast_temp_saber";
  string sTempGun = "carth_temp_gun";

  object oTempWeap = GetItemPossessedBy(oBastila, sTempSaber);
  object oRWeapItem = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oCarth);

  DelayCommand(0.5, AssignCommand(oBastila, StripBastila()));
  DelayCommand(1.0, DestroyObject(oTempWeap, 0.0, 0, 0.0));
  DelayCommand(4.0, DestroyObject(oTempWeap, 0.0, 0, 0.0));

  if (GetTag(oRWeapItem) == sTempGun) {
    DestroyObject(oRWeapItem, 0.0, 0, 0.0);
  }
}

@JCarter426 JCarter426 added Module: Leviathan Issue occurs primarily on the Leviathan Type: Scripting This issue is related specifically to a scripting bug/error labels Nov 27, 2020
@JCarter426
Copy link
Contributor

JCarter426 commented Nov 27, 2020

Yeah, this has been on my list of things to investigate for a while. I hadn't reported it as an issue because when I run into problems in the game that I'm not looking out for, I'm not sure if it was a one-off or repeatable problem. I also can never remember if we fixed Mission's loot, but I don't think we did.

I have modified the existing k_plev_destweap script so that all items worn by Bastila are returned to the Player's inventory although I'm not sure that is the best solution if it was possible to return them when/if Bastila ever rejoins the party.

I vote for adding all items immediately. It may not make much logical sense, but it's just as logical as stripping Bastila down before the scene to avoid the gameplay annoyance, which is an option. Plus, Bastila's equipment is likely to be outpaced by other items by the time you meet up with her again hours later.

This is also how later BioWare games handle it, as I recall.

Would SaveNPCState() perhaps work towards that end?

SaveNPCState() isn't called in any source script for either game that we have access to, so I don't know what it does. However, I don't think it would. You lose Bastila's items because she is removed from the party table and, as you have noticed, replaced with a different Bastila when she returns. The only other way to retain Bastila's items would be to keep the same Bastila in the party table until the encounter on the Temple Summit. That doesn't necessitate adding the same Bastila to the party when you get there, but she would have to remain in the party table until then so her equipment could be retained and given back to the player.

@Salk73
Copy link
Author

Salk73 commented Dec 1, 2020

JC,

I checked what happens with Mission's items if she is killed on Lehon. The script k_punk_misrem.ncs returns actually all her items to the party using a code very similar to the one I wrote above.

But perhaps that is not what you mean with "fixing Mission's loot"?

From what I can see, the items worn by Carth and Zaalbar are not retuned to the Player once Carth leaves the party and when Zaalbar is killed too. If confirmed, that's something that should be taken care of as well.

@DarthParametric
Copy link
Contributor

DarthParametric commented Nov 26, 2021

Mission, Zaalbar, and Carth's items being returned on Lehon in the DS ending has been addressed in #168. I've got a solution for Bastila on the Leviathan returning her gear which also allows her to keep her existing equipped weapon throughout the scene rather than equipping a stunt saber, if she already has a saber equipped (which is almost certain).

@DarthParametric DarthParametric changed the title [Leviathan Hangar] Bastila's items are all gone from the inventory but the wielded weapon Leviathan Hangar - Bastila's items are all gone from the inventory but the wielded weapon Nov 30, 2021
@DarthParametric
Copy link
Contributor

DarthParametric commented Nov 30, 2021

1.9.0 beta test observation:

  • Seems like you can hear Malak's saber deactivating while Carth is talking after Malak and Bastila are off-screen. Might need a revision of the edited scripts, since I added a CancelCombat in there. Could possibly just give him a forced saber override and turn it off instantly. Or maybe jump/destroy Malak. Edit: Seems it's actually Bastila's saber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Leviathan Issue occurs primarily on the Leviathan Type: Scripting This issue is related specifically to a scripting bug/error
Projects
None yet
Development

No branches or pull requests

4 participants