• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Adding additional chests to ship models

Tingyun

Corsair
Storm Modder
In an unrelated thread: Planned Feature - Bring Exorcist book to library in Turks | PiratesAhoy!

We discussed possibly adding a couple of additional chests to the ship cabin models, that would work like the current cabin ship chest, and give the player additional permanent and automatically transferring place to store items.

The idea would be to provide a chance for the player to organize their stored items better, for those players who like to make a weapons collection, a collection of books, etc, to be able to separate them out.

I tried this past week to go through the adding locators in GM tutorial (@Jack Rackham 's great tutorial here Locators with the TOOL | PiratesAhoy! ), but had some initial trouble, and got sidetracked with other projects.

I might try again in several weeks when things with work settle down again, but if anyone else with more experience wanted to add 2 or so additional chests to the cabin models, I think (and it seemed others agree) that it would be a very welcome change that would help players organize their growing item collections.
 
Yes, the idea would be to add either 1 or 2 additional chests to each of the ship cabins, so players can have multiple boxes to organize their stored items. It would mean editing multiple locations, so somewhat time consuming, but if you did end up having time at any point @Jack Rackham I am sure many of us players who love making unique weapon and item collections and such would love it. :)

I would personally think to speed up the work the additional chests could be located right next to the original chest, perhaps representing additional "compartments" within the same box, so that a new place wouldn't have to be found in every scene, and the old box location could just be slightly altered when duplicated (if that is how it works...)
 
I think there should be something looking like a another chest or so when adding an additional box locator.
Could be a hatch in the wall maybe.
I'll take an overview to see how much work we're talking about.
 
Thanks @Jack Rackham , that is incredibly generous of you to even look into it! I hope it does end up being feasible, but I understand if it ends up too much work. Thank you! :)
 
I have started on this chest thing and added box locators to all cabins and visible chests
when needed.

When starting a new game (and visible locators on) I can see the randitem which should place a chest
in the cabin. There's no chest there however but a random randitem. Neither is the randitem locator radius small
so it feels like the file Ship.c not has been read. Where/how is the location initiated? For standard storyline for. ex.

The locatorfile is the right one as my two new locators box2 and randitem2 are in place.

Could it be (again) a question of in which order files are read?
 

Attachments

  • huh.jpg
    huh.jpg
    373.7 KB · Views: 142
@Pieter Boelen @Levis @Grey Roger do any of you know how to solve the question Jack Rackham has run into described above, in the initilization of the ship cabins?

Just making sure this thread doesn't get buried, when he has almost got the new chests working. :)
 
The randitem locator places a new visible chest in some cabins. Because there was no one free there.
I have used this method for some other cabins: Locations[n].models.always.l2 = "trunk";

I think I'm on the right path now:
Both methods have to be executed in StartStoryline.c not only in Ship.c
 

Attachments

  • cabin chest.jpg
    cabin chest.jpg
    371.2 KB · Views: 126
Looking good @Jack Rackham . I think it has to do with a reinit of locations during the start of a storyline some things might get mixed up...
 
@Jack Rackham wow, I am really excited about this! Thank you so much!

My only regret is I am starting a new game now, and I expect it won't be save compatible? Oh well, something to look forward to for the next playthrough, thank you so much! :)
 
So the random item ones are just to put a visible box there?
That makes sense, I suppose.

Still, if they're there, they should show up regardless of StartStoryline.c .
Maybe the Standard storyline tutorial is interfering?
There is indeed some messy random item code in there that probably doesn't help.
 
I have skipped the randitem method as it didn't always work. Instead using the
Locations[n].models.always.l2 = "cabinchest";

I have tested all storylines from start. Ok.
Buying a new ship. Ok.
Boarding not tested yet. An easy way to test boarding?

The cabin locatorfiles seems so far always to be the _ld ones. Are the other _l ones never used?

I think it has to do with a reinit of locations during the start of a storyline some things might get mixed up...
Yes, I had to fix things in StartStoryline for each story.
 
I have skipped the randitem method as it didn't always work. Instead using the
Locations[n].models.always.l2 = "cabinchest";

I have tested all storylines from start. Ok.
Buying a new ship. Ok.
Awesome! :cheers

Boarding not tested yet. An easy way to test boarding?
I know no other way than to go to sea and board something. "Instant Boarding" might speed things up.

Since this is mainly about storage space in your own cabin, I don't imagine the boarding scenes are the most important anyway.

The cabin locatorfiles seems so far always to be the _ld ones. Are the other _l ones never used?
Not sure. Maybe for quest locations...?

Yes, I had to fix things in StartStoryline for each story.
What did you have to do? Reason I'm asking is because I ran into some funky stuff when investigating this one:
Low Priority - Any Dinghy start creates a weird invisible item near the chest (not inside) | PiratesAhoy!
 
Reason I'm asking is because I ran into some funky stuff when investigating this one:
It's not uploaded yet so I think I'm innocent here.


I need help with some code here:
Its in LAi_deck.c about line 1371

To get my added chests become visible when buying a new ship I need to add something like this:
Code:
if(Locations[FindLocation("Tutorial_deck")].models.always.locators == "capsm_ld"
    || Locations[FindLocation("Tutorial_deck")].models.always.locators == "capmd_ld")
    {
        Locations[FindLocation("Tutorial_deck")].models.always.l2 = "cabinchest";
    }
    if(Locations[FindLocation("Tutorial_deck")].models.always.locators == "cabin02_ld"
    || Locations[FindLocation("Tutorial_deck")].models.always.locators == "cabin03_ld")
    {
        Locations[FindLocation("Tutorial_deck")].models.always.l2 = "trunk";
    }
(The syntax is completeky wrong.)

What I want to express is:
2 smaller cabins get the "cabinchest" (on the wall).
And 2 larger cabins get a chest (trunk) on the sofa in the corner.

This piece of code is what I'm using in StartStoryline.c and works good for starting cabins.

As a test in LAi_deck.c this works:
Code:
Locations[locID].models.always.l2 = "cabinchest";
but then all cabins get the "cabinchest".

My problem is I can't check for which locatorfiles the cabins have because they're all set to "tut_Deck_ld".

I have a terrible workaround in mind but hope to avoid it. ;)
 
It's not uploaded yet so I think I'm innocent here.
I know you're innocent! Don't worry, I was NOT AT ALL blaming you!!! :shock

It is just also related to random item stuff in cabins and thought it might be interesting to you.
Plus I was hoping perhaps what you had to change might suggest a fix for that one too.
Would be nice if it could be tackled as well, right? :cheeky

What I want to express is:
2 smaller cabins get the "cabinchest" (on the wall).
And 2 larger cabins get a chest (trunk) on the sofa in the corner.
Ah.... I understand the difficulty. I can't seem to think of a simple solution right now though.
For all the game knows, the player ship cabin IS the same location, even when it looks different. :facepalm
 
Back
Top