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. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Can "VanderDeckens" cabin work just like a cabin on a ship, whit weapons locker
    and chest working?
     
  2. Jack Rackham

    Jack Rackham HoO Team Member Quest Writer Storm Modder

    Joined:
    Jul 5, 2004
    Messages:
    3,287
    Gender:
    Male
    Occupation:
    math teacher
    Location:
    Sund, Ramsjö, Sweden
    I have no idea - didn't know it could happen.
    A quick look in itemlogic.c under void Box_FillBox( )
    //fill box with new items

    could be something?
     
    Black Iron Oyster and ANSEL like 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,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    That does sound related.

    @ANSEL: Why would you want a weapons locker working there?
    You already have working ones on each of your ships.
    Though apart from Cursed Coins, there is nothing you can put in your companion weapon lockers that will actually do something....
     
  4. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    I want to have resources of sails and planks. Im playing as a smuggler now,
    my plan was to store contraband on the island, until I have enough to do some
    few big deals from time to time. Such a base could be good to have, some times
    I want to be the lonely" (Sea ) Wolfe".
     
  5. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    A weaponslocker doesn't work for that. Only ships and stores can store cargo goods.
    The weaponslocker is a "box" that can hold money and items. Just like any other chest.
     
  6. Black Iron Oyster

    Black Iron Oyster Sailor Apprentice

    Joined:
    Apr 15, 2016
    Messages:
    90
    Gender:
    Male
    Location:
    Fortaleza, CE, Brazil
    Just took a look at the file, after that fill box with new items, there is spawnItemsCount = OBJECTS_IN_BOX, and then the code proceeds to make a list of chests with the spawnItemsCount = 0, does the 0 means that when resetting occurs (SpawnTime), there will be NO items in the new spawn that were previously in the box, while changing it to 1 would mean there will be YES item previously in box' next SpawnTime and maybe a new item as well?
    I think it's worth taking a look at the SpawnTime thing, if it's possible to change SpawnTime = NEVER for a specific chest location then that would be the thing.

    The term SpawnItem first appears at:

    // ************** RANDOM ITEMS *****************
    void RandItems_OnLoadLocation(ref _location)
    {
    string locatorName;
    aref randItemLocator;
    for (int i=1; i<MAX_LOADED_RANDITEMS; i++)
    {
    string lastSpawnTimeString = "LastSpawnTime"+i;
    string randItemTypeString = "RandItemType"+i;
    locatorName = "randitem"+i;
    if (!FindLocator(_location.id, locatorName, &randItemLocator, true))
    break;



    there's also this, more to the end of the file that seems interesting:

    // LDH 30Apr09
    // make your ship's chests lootable only once per day.
    // unfortunately, this makes ALL your ships' crew cabin boxes, for example, lootable only once per day.
    int SpawnTime = SPAWN_TIME;
    if (ownDeckStarted())
    {
    SpawnTime = 20; // 20 hours, so you can loot your own ship once per day at the same time every day
    isAbordageBox = false;
     
    Pieter Boelen likes this.
  7. Black Iron Oyster

    Black Iron Oyster Sailor Apprentice

    Joined:
    Apr 15, 2016
    Messages:
    90
    Gender:
    Male
    Location:
    Fortaleza, CE, Brazil
    Also, just saw the Guide - Treasure Quests, and if it was possible to create a Hidden Safe Chest, that would be the Bury your own treasure feature, while the Treasure Hideout feature as I described in my post with the images would require the "fake store" with it's keeper and a non-hidden "safe chest".

    Pieter, will such feature be added in the future? Why it wasn't, generated too many bugs or something?

    If it becomes possible to add this feature later on, then that would become the gameplaywise point of having the "fake store" (Safe Store) to store your goods.

    Just saying, not demanding anything. :razz
     
    Last edited: Apr 28, 2016
  8. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    For chests, there are two options:
    1. Add a "box" locator to the Cozumel cabin location model, then use RandItems_OnLoadLocation to ensure it is "safe".
    2. There is a function that can create a "box" at specific x,y,z coordinates; this is used for the Treasure Quests.
    Might be possible to call this through officer dialog with the x,y,z coordinates of that officer.
    Relevant code can be found in PROGRAM\MAXIMUS_functions.c - search for "treasure".

    Both should be quite doable.

    As for the "fake store", I'm not sure if Cozumel (="Khael Roa") has a store already defined.
    If so, that one could be used with a store keeper in your personal hide-out.
    I have no clue how to prevent any goods from "spawning" there though. Somebody would need to figure that out...
     
    Black Iron Oyster likes this.
  9. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Of course it wont. It was early in the morning for me, before I had my essential coffee, sorry.
     
  10. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    If someone wants to bury treasure, try this...

    In PROGRAM\console.c find:
    Code:
        case 2:
           if (!bSeaActive) {
             float x,y,z,ay,xx,zz,xz,zx;
             GetCharacterPos(GetMainCharacter(), &x, &y, &z);
             GetCharacterAy(pchar, &ay);
             xx = -sin(ay - PId2);
             zz = xx;
             xz = -cos(ay - PId2);
             zx = -xz;
             Logit("Location id: "+pchar.location);
             Logit("Your Coords x: " + x+"  y: "+y+"  z: "+z );
             Logit("Viewangle ay: "+ay+"; xx= "+xx+" xz= "+xz+" zx= "+zx+" zz= "+zz);
             Logit("Curlocator: "+chrWaitReloadLocator);
           //   trace("rld,loc," +xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");
           //   trace("rld,aloc,"+xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");
           } else {
             Logit("Ship position: x="+pchar.ship.pos.x+", z="+pchar.ship.pos.z);
           }
           //Logit("Ship position: x="+worldMap.playerShipX+", z="+worldMap.playerShipZ);
         break;
    
    Replace with:
    Code:
        case 2:
           if (!bSeaActive) {
             float x,y,z,ay,xx,zz,xz,zx;
             GetCharacterPos(PChar, &x, &y, &z);
             WriteLocatorGlobal(PChar.location, "box", "buried_treasure", "", -1, x, y, z, false);
             Logit("Buried Treasure Box made in location: "+pchar.location);
             Logit("Your Coords x: " + x+"  y: "+y+"  z: "+z );
    /*         GetCharacterAy(pchar, &ay);
             xx = -sin(ay - PId2);
             zz = xx;
             xz = -cos(ay - PId2);
             zx = -xz;
             Logit("Location id: "+pchar.location);
             Logit("Your Coords x: " + x+"  y: "+y+"  z: "+z );
             Logit("Viewangle ay: "+ay+"; xx= "+xx+" xz= "+xz+" zx= "+zx+" zz= "+zz);
             Logit("Curlocator: "+chrWaitReloadLocator);
           //   trace("rld,loc," +xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");
           //   trace("rld,aloc,"+xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");
           } else {
             Logit("Ship position: x="+pchar.ship.pos.x+", z="+pchar.ship.pos.z);
           }*/
           //Logit("Ship position: x="+worldMap.playerShipX+", z="+worldMap.playerShipZ);
         break;
    
    Set switch(2) at the top, then press F12 to create a chest at the spot where you're standing.

    I haven't tried this myself, but I think it might just work.
     
    Black Iron Oyster likes this.
  11. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    I tried to execute this code with the console. The console wont execute it.
     
    Black Iron Oyster likes this.
  12. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Oops, I think this should work better:
    Code:
        case 2:
           if (!bSeaActive) {
             float x,y,z,ay,xx,zz,xz,zx;
             GetCharacterPos(GetMainCharacter(), &x, &y, &z);
             WriteLocatorGlobal(PChar.location, "box", "treasure_box", "", -1, x, y, z, false);
             Logit("Buried Treasure Box made in location: "+pchar.location);
             Logit("Your Coords x: " + x+"  y: "+y+"  z: "+z );
           /*   GetCharacterAy(pchar, &ay);
             xx = -sin(ay - PId2);
             zz = xx;
             xz = -cos(ay - PId2);
             zx = -xz;
             Logit("Location id: "+pchar.location);
             Logit("Your Coords x: " + x+"  y: "+y+"  z: "+z );
             Logit("Viewangle ay: "+ay+"; xx= "+xx+" xz= "+xz+" zx= "+zx+" zz= "+zz);
             Logit("Curlocator: "+chrWaitReloadLocator);
           //   trace("rld,loc," +xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");
           //   trace("rld,aloc,"+xx+",0,"+xz+",0,1,0,"+zx+",0,"+zz+","+x+","+y+","+z+",1,0,0,0,0,0,0,0,0,");*/
           } else {
             Logit("Ship position: x="+pchar.ship.pos.x+", z="+pchar.ship.pos.z);
           }
           //Logit("Ship position: x="+worldMap.playerShipX+", z="+worldMap.playerShipZ);
         break;
    
    Just tested it and it seems to work. Several issues though:
    - Requires console and is therefore not (yet) an ingame feature
    - Because it is named "treasure_box", it may interfere with treasure quest chests, so DON'T use it in a location that normally can have treasures hidden
    - By extension, you can have only ONE of them in a location at the same time
    - You may get hurt when trying to open it (I did)
    - When you open it, it disappears again
    - When you make it AGAIN in the same location, then you can find whatever items you put in it again

    In other words: Plenty magic involved! And not quite perfect.
    It would require some more code tweaking to make this a full game feature, but it IS possible through this method.

    If at all possible, I'd prefer somebody else to actually make this happen for real.
    Searching for "treasure_box" in the game code should lead you to all the relevant code.
    Probably what is needed is to create a new type of box (e.g. "hidden_box") that serves its purpose better than those treasure boxes.
     
    Black Iron Oyster and ANSEL like this.
  13. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Well! That is weird. The chest is invisible and you can open it anywhere you are.
    I think I have made a chest I always must carry around with.
     
  14. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Really? When I tried, I did notice some weird stuff, but all of that weirdness has an explanation.
    I definitely didn't get what you did.

    Attached file is the one I did my testing with.
     

    Attached Files:

  15. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    With the console you posted, its the same behavior us before: Invisible chest I can open everywhere.:eek:


    .
     
  16. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Also if you leave the location? And when you then come back?
    I have seen that happen occasionally, but not today while using that console file.
     
  17. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Its still the same, even if I go to worldmap and return later.
    But I have thise logs
     

    Attached Files:

  18. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Could it be this code and I have to chance the name to something different?
    {
    boxName = pch.boxname;
    boxType = strcut(boxName, 0, strlen(boxName)-3);
    curLoc = Locations[FindLocation(pch.location)].filespath.models;
    curLocId = Locations[FindLocation(pch.location)].id; //JRH bookshelf
    int powderCount;
    string whichInterface = "";
     
  19. Pieter Boelen

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

    Joined:
    Nov 11, 2004
    Messages:
    66,575
    Gender:
    Male
    Occupation:
    Maritime Research: Project Engineer (Analysis)
    Location:
    Wageningen, The Netherlands
    Can you start a new game on mod default settings, then try again with the console.c I posted?
     
  20. ANSEL

    ANSEL Corsair Storm Modder Hearts of Oak Donator

    Joined:
    Aug 18, 2013
    Messages:
    1,767
    Gender:
    Male
    Occupation:
    Artist,Painter
    Location:
    Viborg.Denmark
    Yes I will start it tonight.
     

Share This Page