1. Dismiss Notice
  2. GOG.com logo

    Thanks to YOUR votes, GOG.com now sells:
    - Sea Dogs - Sea Dogs: Caribbean Tales
    - Sea Dogs: City of Abandoned Ships

    Vote now to add Pirates of the Caribbean to the list!

    Dismiss Notice
  3. Under the Crossbones Podcast

    A Pirate Podcast with Interviews
    Music, Comedy and all things Pirate!

    - Episode Guide - About - Subscribe -
    - Twitter - Facebook - iTunes - Android -
    - Youtube - Fill the Coffers -

    Dismiss Notice
  4. New Horizons logo

    Quick links for PotC: New Horizons
    - Download latest version
    - Wiki - FAQ - Report bugs here
    - ModDB profile

  5. GOF logo

    Quick links for AoP2: Gentlemen of Fortune 2
    - Downloads and info
    - Historical Immersion Supermod
    - ModDB Profile

Dismiss Notice
New to the forum?
Please take a moment to read our Welcome Message and Forum Rules.

Fixed Eliz Shaw Sidequest: After being shot by Davy, HP set to 1/1

Discussion in 'Bug Archive' started by SirDuke, May 15, 2016.

  1. SirDuke

    SirDuke Landlubber

    Joined:
    May 15, 2016
    Messages:
    24
    Gender:
    Male
    Occupation:
    simple grafter
    Location:
    Germany
    Hello Everybody!
    I´ve just finished the Elizabeth Shaw quest.
    A few minutes later, I suddenly realized that my char is running aroung with only 1 HP?
    After going back two or three savegames I found my problem.
    It happens during the scene change into the Tavernroom.
    I checked my compile log, but nothing strange was found.
    Error logs were not created.
    I have no idea why this happend to me, or if it could hit someone else...
    But I found a way around it.
    I stroke out these lines in the quest code:


    case "davyhurtme":
    bSuppressResurrection = true;
    LAi_SetStayType(CharacterFromID("Davy Jones"));
    ===> //Lai_KillCharacter(pchar);
    LAi_QuestDelay("preroomcayman", 3.0);
    LAi_QuestDelay("goroomcayman", 6.0);
    break;

    case "preroomcayman":
    ChangeCharacterAddress(characterFromID("Davy Jones"), "none", "");
    break;

    case "goroomcayman":
    DoQuestReloadToLocation("Grand_Cayman_Tavern_upstairs", "goto", "goto4", "_");
    locations[FindLocation("Grand_Cayman_Tavern_upstairs")].reload.l1.disable = 1;
    LAi_SetPlayerType(pchar);
    ===> //LAi_SetHP(pchar, LAi_GetCharacterHP(pchar), LAi_GetCharacterHP(pchar));
    ChangeCharacterAddressGroup(CharacterFromID("Elizabeth Shaw"), "Grand_Cayman_Tavern_upstairs", "goto", "goto7");
    Characters[GetCharacterIndex("Elizabeth Shaw")].dialog.CurrentNode = "begin_4";
    LAi_SetActorType(characterfromID("Elizabeth Shaw"));
    LAi_ActorDialog(characterfromID("Elizabeth Shaw"), PChar, "", 0.5, 10);
    bSuppressResurrection = false;
    break;

    It loses some immersion, but that´s all.

    So theres no longer a problem for me,

    but if someone more experienced could check these lines?
    Maybe it could happen again to someone else.
    I have a savegame right before it, too.
    But sadly I can´t attach files here (don´t know why)

    Thanks and goodbye!
     
  2. Talisman

    Talisman Smuggler Storm Modder

    Joined:
    Apr 29, 2009
    Messages:
    2,825
    Gender:
    Male
    Location:
    Hiding From The Coastguard
    I think this is meant to happen :yes

    You were shot by Davy Jones - and nearly killed that is why you have only 1 Hp left - you can recover slowly or take a medicine. :read


    Save files can only be attached if they are archived/zipped - the forum will only accept them in these formats. :shrug


    :cheers
     
  3. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Does sleeping in a Tavern room not set your HP back to max?
    As long as your maximum HP isn't also set to 1, at least there's nothing badly wrong.
     
  4. SirDuke

    SirDuke Landlubber

    Joined:
    May 15, 2016
    Messages:
    24
    Gender:
    Male
    Occupation:
    simple grafter
    Location:
    Germany
    Yes, I mean 1/1 HP
    The new hardcore mode :woot

    Imgur: The most awesome images on the Internet

    stroking both lines helped

    //Lai_KillCharacter(pchar);
    //LAi_SetHP(pchar, LAi_GetCharacterHP(pchar), LAi_GetCharacterHP(pchar));

    More interesting is; why can´t I upload a file here?
    Forum board ALWAYS answers with "there was a problem" :modding

    ***EDIT***
    Yeah! Can now upload data files to the board!
    There is a checkbox in the profile "preferences" called: "Use the Flash-based uploader to upload attachments"
    Had to uncheck the box xD
     

    Attached Files:

    • 1HP.jpg
      1HP.jpg
      File size:
      1.3 MB
      Views:
      73
    Last edited: May 16, 2016
    Pieter Boelen likes this.
  5. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Do you have a savegame just prior to you being "killed"?

    Indeed 1/1 HP is pretty bad and definitely not meant to happen! :shock
     
  6. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    @SirDuke: For some reason, that LAi_SetHP function call takes your CURRENT HP and sets both your current AND your maximum value to that.
    But since you've just been "killed", you get set to "1/1".

    I don't think that is meant to happen at all!
    It was probably intended to heal you. Several ways of doing that instead:
    Code:
    ResetHP(pchar); // PB: was LAi_SetHP(pchar, LAi_GetCharacterHP(pchar), LAi_GetCharacterHP(pchar));
    
    Or:
    Code:
    LAi_SetHP(pchar, LAi_GetCharacterMaxHP(pchar), LAi_GetCharacterMaxHP(pchar));
    
    Or:
    Code:
    LAi_SetCurHP(pchar, LAi_GetCharacterMaxHP(pchar));
    
    I think I like that last one, because it doesn't do anything extra other than set your current HP to your maximum value.
     
  7. SirDuke

    SirDuke Landlubber

    Joined:
    May 15, 2016
    Messages:
    24
    Gender:
    Male
    Occupation:
    simple grafter
    Location:
    Germany
    A savegame?
    Here you are.
    I saved right AFTER the fight against Davy´s Crewmen.
    I just sent them all to hell!
    But be warned...
    If you reload the save, his cursed crew will be spawend again...
    ...and if you save and reload; they will be spawned again, and again... :shock
    Damn this cursed crewmen! :mad:
     

    Attached Files:

  8. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Thanks. If you can, please try the fix I propose above.
    If you can confirm it works, it saves me the trouble of double-checking. :cheeky
     
  9. SirDuke

    SirDuke Landlubber

    Joined:
    May 15, 2016
    Messages:
    24
    Gender:
    Male
    Occupation:
    simple grafter
    Location:
    Germany
    Yep!
    It worked.
    Got shot, fell down, faded and woke up with full HP.

    You should consider changing the code. for your next update.

    ***EDIT***
    For everyone having the same issue:
    Search your game files for "quests_side.c" You can open it with simple notepad.
    Search the file for "davyhurtme"
    And then replace the old
    LAi_SetHP(pchar, LAi_GetCharacterHP(pchar), LAi_GetCharacterHP(pchar));
    with the new
    LAi_SetCurHP(pchar, LAi_GetCharacterMaxHP(pchar));
     
    Last edited: May 16, 2016
  10. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Already done on my end. Just need to actually make the update.
    I was planning on doing that later today as it has been a month and there are a fair few good updates again.
     
  11. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  12. chri

    chri Sailor Apprentice

    Joined:
    Apr 14, 2016
    Messages:
    53
    Gender:
    Male
    Why did I suddenly defense to 1?
    I opened the menu by pressing F2 and next to the heart's written 1. If before it was written 114 as never dropped up to 1?
     
  13. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I'm not sure what you mean. Screenshot?
     
  14. chri

    chri Sailor Apprentice

    Joined:
    Apr 14, 2016
    Messages:
    53
    Gender:
    Male
    ok..
    1 no longer it moves.
    It is by so much that does not change at least up to 2
     

    Attached Files:

  15. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  16. woltagen

    woltagen Landlubber

    Joined:
    Aug 29, 2015
    Messages:
    2
    Hello.

    I'm playing Build 14 Beta 4.
    I was on ventures of doing this Side Quest, when a problem occured. I got to part, where I take daughter back to governor and I'm asked to deter puny forces of David Jones. All is splendid until the part he shoots me. I wake up in tavern room with 1/1 HP.

    This is the part of quest it happens at, taken from quests_side.c (my guess, not a programmer):
    Code:
    case "goroomcayman":
                DoQuestReloadToLocation("Grand_Cayman_Tavern_upstairs", "goto", "goto4", "_");
                locations[FindLocation("Grand_Cayman_Tavern_upstairs")].reload.l1.disable = 1;
                LAi_SetPlayerType(pchar);
                LAi_SetHP(pchar, LAi_GetCharacterHP(pchar), LAi_GetCharacterHP(pchar));
                ChangeCharacterAddressGroup(CharacterFromID("Elizabeth Shaw"), "Grand_Cayman_Tavern_upstairs", "goto", "goto7");
                Characters[GetCharacterIndex("Elizabeth Shaw")].dialog.CurrentNode = "begin_4";
                LAi_SetActorType(characterfromID("Elizabeth Shaw"));
                LAi_ActorDialog(characterfromID("Elizabeth Shaw"), PChar, "", 0.5, 10);
                bSuppressResurrection = false;
            break;
    Another part is from LAi_character.c for setting toon HP, but I'll skip it for the length of the post.
    I'm also attaching a save file, where you have to go out of townhall and reach port.
    If I'm missing something or you need additional information, please say so.

    Cheers.
     

    Attached Files:

  17. Pieter Boelen

    Pieter Boelen (Not So) Old Seadog Staff Member Administrator Storm Modder Hearts of Oak Donator

    Joined:
    Nov 11, 2004
    Messages:
    65,869
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
  18. woltagen

    woltagen Landlubber

    Joined:
    Aug 29, 2015
    Messages:
    2
    Thank you for a quick reply!
    I'm just trying to think back why I went through bugtracker posts to check for duplicate problem, when it was actually in archives, instead of using search.
    Nevertheless, thank you a lot. And most of all, keep the good work up! I've been lurking and enjoying your fruits of work since Build 13.

    Cheers.
     
    Pieter Boelen likes this.
  19. llewelyn ravencroft

    llewelyn ravencroft Sailor Apprentice

    Joined:
    May 16, 2015
    Messages:
    69
    Gender:
    Male
    upload_2016-5-27_17-55-30.png


    Could this be down to the quests code or is it to due with the fact I have the Aztec gold
     
  20. Grey Roger

    Grey Roger Sea Dog Staff Member Storm Modder

    Joined:
    Feb 12, 2007
    Messages:
    5,861
    Pieter Boelen likes this.

Share This Page