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.

Feature Request Bury Your Own Treasure

Discussion in 'Build 15 Brainstorming' started by Black Iron Oyster, Apr 22, 2016.

  1. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    I think all that should be needed are the locator file and that line of code you found of mine applied to this situation.
    Everything else should be superfluous. I think...
     
  2. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,288
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    And I think it was bad with traps here and stuff already in the chest from start and better with this chest
    to appear only in the Roa_cabin. So I put in a little extra effort for higher quality.
     
    Pieter Boelen likes this.
  3. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Oh wait, you did that to avoid the traps!
    Good thinking! :onya
    Now I get it. :facepalm

    I think there might be another way to do that.
    Will have to check that later.
     
  4. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Looks like there isn't. Yet. But we can add one here:
    Code:
        // PB: Rewritten -->
         int lock;
         bool OpenLock = false;
    
         if (ownDeckStarted()) OpenLock = true; // KK
         // If you are on your own ship, all locks are open
    
         if(REMEMBER_OPEN && CheckAttribute(Locations[locidx],"openboxes."+atrName)) OpenLock = true;
         // If the lock has already been opened, it will stay open
    
         if(CheckAttribute(Locations[locidx],"jammed."+atrName))
         // If the lock is jammed, it will not open
         {
           Log_SetStringToLog(TranslateString("","This lock will not open. There seems to be a lockpick stuck in it."));
           return;
         }
    
         if(!OpenLock)
    
    Using the "openboxes" attribute is almost good enough, but that gets removed when you leave the location.
    We need a locator-specific attribute so that you can set per box if it should be open or not.
    But since it is past midnight now, I'll suggest a simple version for starters:
    Code:
         // If you are on your own ship, all locks are open
         
         if(_location.id=="Roa_Cabin") OpenLock = true; // PB
         // It's your own box
    
         if(REMEMBER_OPEN && CheckAttribute(Locations[locidx],"openboxes."+atrName)) OpenLock = true;
    
     
  5. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,288
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    My avoid traps things works very well thank you. I have used it many times. Otherwise I should
    not have suggested it here.
     
  6. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Now that I realise your reason for that code, I am certainly convinced that it does work.

    That being said, I am equally as convinced that there is a simpler and cleaner solution. Your current method requires a lot of copied coding.
    That can be simple to do and functional, but it can also be very risky from a development and support point of view.

    On my real life job, I spent literally more than half a year cleaning up other people's doubled code. It was a nightmare.
    Thankfully your work is far better than that particular example.
     
  7. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    @Jack Rackham: To clarify, my idea would be to be able to set an attribute to mark a chest as "permanently open".
    This could then be set either in the location init files (if it is permanent) or in the quest code (if it should open at a certain point in the story).
    If there is support for such a generic attribute, then you can enable/disable that functionality with a single line of code.

    Does that sound like something that might be helpful? If not, then I'll put your version back in.
    It might be doubled up code, but if it works, then so be it. :shrug
     
  8. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,288
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    Of course everything can be solved in many ways. I wouldn't spend a second on something
    that is already working though. There are so many more important things to do.

    In this case I can't say I would use another method as mine is used so many many times
    (by me) often in combination with other things to happen when opening a certain box.
    sound effects, references to quest_reaction for what to happen next etc etc.
     
  9. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Fine. I'll keep your solution then. At least now I know again why you did it that way.
    I completely missed the point yesterday. Actually, I had already compiled the EXE and implemented your updated very hastily. :oops:
     
  10. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,288
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    If you take a quick glance in WoodesRogers SL_utils.c at the top, you'll see what I mean.
     
    Pieter Boelen likes this.
  11. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,770
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    I cant get it to work. There is no chest in the cabin. Maybe I have done it wrong?
    I dont think I could make it wrong, but maybe I haveo_O
     
  12. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Did you start a new game? Because of the alternate locator file, that is required.
    Though I could also give you a console command that updates it for you.
     
  13. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,770
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    No, I havent started a new game. I was thinking about to have a look of Jack Rackhams
    file before doing the new update. I think there was different opinions between you and
    Jack Rackham about the way to do it.
     
  14. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    @Jack Rackham: I replaced the EXE now with your functionality restored.

    I am excluding this line though:
    Code:
    if(_location.id=="Roa_cabin")spawnItemsCount = 0;
    
    Since needRespawn = false, it never gets executed.

    That explains it. In that case, execute this through console:
    Code:
    locations[FindLocation("Roa_cabin")].models.always.locators = "ShipyardPirates_locators_KR";
    
    That should save you the trouble of starting a new game. :doff
     
  15. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,770
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Thanks! Now its working allright. But I think I will have to do the new update anyway, just to be a jour.
     
  16. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,627
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Unless I badly messed up, the 17 May 2016 version should be quite safe to install.
    I tried very hard to include only fixes (and attempted fixes) without potentially unstable new stuff.
     
  17. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,770
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Yes. I will go on with it tonight then.:)
     
  18. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,288
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    Aha and thanks.
     
    Pieter Boelen likes this.

Share This Page