[Mod] ships spawning at mapgen time [ships_on_mapgen]

Post Reply
Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

[Mod] ships spawning at mapgen time [ships_on_mapgen]

by Sokomine » Post

Image
This mod spawns ships on ocans and lakes.

The largest one is the big pirate ship built (so it is rumored) by AspireMint. If you find one, explore it! But take care of pirates! (In small print: Pirates not included!)
Image

The second larger sailship has been built by me. To the right is a small raft.
Image

In addition to the two capital ships, three types of rafts exist and may also show up on water. It is possible that rafts will lose the very tree trunks they mostly consist of; mapgen thinks they're trees. There is no good way to prevent that. Lucikly, most ships will survive intact and await explorers.

Download: https://github.com/Sokomine/ships_on_ma ... master.zip
Browse code: https://github.com/Sokomine/ships_on_mapgen
Version: 1.0
Licence: GPLv3
License of models: CC-BY-SA 3.0
Depends on: handle_schematics
Recommends: cottages, moreblocks
Attachments
ship_sokomine.jpg
ship_sokomine.jpg (79.74 KiB) Viewed 1405 times
ship_aspiremint.jpg
ship_aspiremint.jpg (124.06 KiB) Viewed 1405 times
ships_colored.jpg
ships_colored.jpg (101.6 KiB) Viewed 1405 times
A list of my mods can be found here.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Sokomine » Post

(second posting mostly for adding more images)

Right now, one ship (or raft) is placed in each mapchunk if possible:
Image

Rafts are a lot smaller than ships and come in three variants:
Image
Image

You can of course add your own ships. Just edit init.lua and an appropriate entry in ships_on_mapgen.schematics. If you use an .mts file saved by handle_schematics, the mod can automaticly determine from the filename how deep the ship proceeds under water. Else set e.g. yoff=-2 if your ship continues 2 nodes below water. Example:

Code: Select all

{scm="name_of_file_in_schems_folder_without_extension", typ="ship", is_ship=true, yoff=-1, orients={0}}
Other ships you might want to spawn with this mod are:
boat from Chiantos (diffrent style of ship)
and small galeon by Dan Duncombe (fits well into this mod).
The license of these schematics was unclear. You can still grab them from the forum, save them in the schems/ folder and add an entry for them in the init.lua file.
Attachments
ship_raft_1.jpg
ship_raft_1.jpg (81.29 KiB) Viewed 1405 times
ship_raft_3.jpg
ship_raft_3.jpg (78.71 KiB) Viewed 1405 times
ships_and_raft.jpg
ships_and_raft.jpg (101.8 KiB) Viewed 1405 times
A list of my mods can be found here.

Chiantos
Member
Posts: 377
Joined: Sun Jan 15, 2017 09:04

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Chiantos » Post

Deleted message
Last edited by Chiantos on Mon Sep 30, 2019 05:12, edited 1 time in total.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Sokomine » Post

Chiantos wrote: I think use this, because i have a problem actually for generate boats in mapgen.
Yes, I promised you this mod before (was working on it some time ago already). For your purpose, you'll have to edit init.lua so that it reads:

Code: Select all

ships_on_mapgen.schematics = {
        -- yoff: how deep is the ship burried in water?
      {scm="boat", typ="ship", is_ship=true, yoff=-1, orients={0}},
       }
and add your boat.mts file into the schems/ folder. If you change ships_on_magen.schematics as above, only your ship type will spawn (the others won't really fit into your game). I couldn't do that as the license you specified - "GPL" - is a bit too broad and does not really fit media data. It is fine for mods. Perhaps you can choose CC-BY-SA 3.0 as well? Or something similar.

Note: The Yellow Submarine would be far too large to spawn as a mapblock is only 80x80x80 blocks and thus no larger flat surface can be found with the method used here. The same applies for the U-Boot. Submarines are certainly possible. Just not that big.

The Big Galleon by Dan Duncombe might fit in. But it's really quite big and empty.
A list of my mods can be found here.

Chiantos
Member
Posts: 377
Joined: Sun Jan 15, 2017 09:04

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Chiantos » Post

Deleted message
Last edited by Chiantos on Mon Sep 30, 2019 05:12, edited 1 time in total.

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by paramat » Post

Good to finally see this done.

Chiantos
Member
Posts: 377
Joined: Sun Jan 15, 2017 09:04

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Chiantos » Post

Deleted message
Last edited by Chiantos on Mon Sep 30, 2019 05:11, edited 1 time in total.

User avatar
CBugDCoder
Member
Posts: 32
Joined: Tue Jul 31, 2018 12:13
GitHub: CBugDCoder
IRC: CBugDCoder
In-game: CalebDavis
Location: Home

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by CBugDCoder » Post

Looks Great Sokomine you could also add shipwrecks that would be cool.
My Mods: Mob AI Glider

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Sokomine » Post

Shipwrecks where planned from the beginning. AspireMint has built three nice models. Unfortionately they where a bit big and so place for them on the ground of the ocean was seldmon found. Shipwrecks now "sink" until they hit solid ground. They may often be found embedded in the ocean's floor.
Important: You need the newest version of handle_schmematics for the shipwrecks to spawn.

Ship investigating the fate of several wrecks:
Image

It is assumed that the water level was higher when this ship sailed here and eventually sank. The weather in MineTest does not seem to contain many storms; a surprisingly large amount of ship masts can still be seen standing and may give you hints where the wrecks rest.
Image

Some wrecks rest well below the ocean, where it is cold and dark. Watch out for them! The chests are often filled with rich treasures.
Image
Attachments
shipwreck3.jpg
shipwreck3.jpg (84.43 KiB) Viewed 1405 times
shipwreck2.jpg
shipwreck2.jpg (100.71 KiB) Viewed 1405 times
shipwreck1.jpg
shipwreck1.jpg (113.79 KiB) Viewed 1405 times
A list of my mods can be found here.

User avatar
CBugDCoder
Member
Posts: 32
Joined: Tue Jul 31, 2018 12:13
GitHub: CBugDCoder
IRC: CBugDCoder
In-game: CalebDavis
Location: Home

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by CBugDCoder » Post

Ok cool
My Mods: Mob AI Glider

User avatar
TK Ethan
Member
Posts: 28
Joined: Wed Aug 29, 2018 18:04
IRC: MangoNinja
In-game: MangoNinja
Location: Colorado,USA

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by TK Ethan » Post

Wow this awesome!
Jesus Loves You!
My in game name is MangoNinja.And i play the server of MustTest

User avatar
TK Ethan
Member
Posts: 28
Joined: Wed Aug 29, 2018 18:04
IRC: MangoNinja
In-game: MangoNinja
Location: Colorado,USA

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by TK Ethan » Post

Oops accidentally did a 2nd Ripley

User avatar
Glory!
Member
Posts: 92
Joined: Thu Apr 30, 2015 17:45
GitHub: Glory7000
In-game: Glory7000
Location: Kernel Debugging Land <3

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Glory! » Post

Amazing mod. Really adds to the adventure in a game. Cheers mate, looking to see it succeed in servers.
Behold the Razgriz, its wings of black sheath. :: My skin A competitor that unfortunately needs attention to stay afloat.

User avatar
Lord_Vlad
Member
Posts: 112
Joined: Thu Jul 20, 2017 07:58

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Lord_Vlad » Post

Weird question maybe but how can I actually add pirates to unsunk ships (I got sharks for the sunk ships already.

User avatar
DancingWombat
Member
Posts: 14
Joined: Tue Nov 14, 2017 12:53

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by DancingWombat » Post

This is awesome the ships look great they spawned no problem but there is a little too much treasure in them, it feels like cheating, I had explored just half of the pirate ship and collected this

Image

you'd never have to mine again when you were done, is there a way to tweak this?
Attachments
toomuch.PNG
toomuch.PNG (70.73 KiB) Viewed 1405 times

User avatar
Lord_Vlad
Member
Posts: 112
Joined: Thu Jul 20, 2017 07:58

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Lord_Vlad » Post

I agree. I made them super rare, but now it makes the mod a bit underwhelming... Maybe make the treasures depend on TSM ?

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Nordal » Post

Very cool mod @Sokomine! The ships look great!
CFS - still widely unknown

nonom
New member
Posts: 5
Joined: Fri Jun 19, 2020 15:36
GitHub: nonom
IRC: nonom
In-game: nonom

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by nonom » Post

That's cool for a Sid's fan like me =) awesome work

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by bzt » Post

Hi Sokomine,

I'd like to ask does this mod work with MCL2? Having a pirate ship is something that would made my younger boy crazy (in a good way) :-)

I've checked and the MTS files are for MTG (using nodes like "default:something"), however I've also noticed that this mod depends on handle_schematics, which has an MTG->MCL2 conversion function. So I thought it's the best to just simply ask if it works :-)

Cheers,
bzt

ps: If not MCL2 compatible, would you be kind to add the missing ship specific nodes to handle_schematics/replacements_mineclone2.lua, please? Or replace ship nodes with ones that are handled? That would be awesome if I could use this with MCL2!

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by Sokomine » Post

bzt wrote: ps: If not MCL2 compatible, would you be kind to add the missing ship specific nodes to handle_schematics/replacements_mineclone2.lua, please? Or replace ship nodes with ones that are handled? That would be awesome if I could use this with MCL2!
Please update handle_schematics as well. I had to add the mapgen mods from MCL2 there so that the ships spawn last and are not overwritten. handle_schematics already has replacement functions for most things, but not all wood types the ships used where covered. That ought to work now. Please try with latest versions!

There may be too many ships spawning. The mod could use some finetuning in that regard.
A list of my mods can be found here.

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by bzt » Post

Sokomine wrote:
Sat Oct 03, 2020 00:30
Please update handle_schematics as well. I had to add the mapgen mods from MCL2 there so that the ships spawn last and are not overwritten. handle_schematics already has replacement functions for most things, but not all wood types the ships used where covered. That ought to work now. Please try with latest versions!
Holy sh*t, that was an extremely quick response time! Thank you very very very much!
Sokomine wrote:
Sat Oct 03, 2020 00:30
There may be too many ships spawning. The mod could use some finetuning in that regard.
Yes, it works, and yes, there are a bit too many ships :-) But that's okay, I'll look into the code, I think I can add a config variable for probability on spawning. I'll let you know what I've figured out.

Cheers,
bzt

bzt
Member
Posts: 217
Joined: Tue Sep 24, 2019 14:26

Re: [Mod] ships spawning at mapgen time [ships_on_mapgen]

by bzt » Post

Oh, it's already there :-D

Code: Select all

-- if set to 100: place one ship in each mapchunk if possible;
-- if set to a lower value: percent chance of placing a ship
-- in a mapchunk
ships_on_mapgen.probability_per_mapchunk = 100;
Awesome!

Cheers,
bzt

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests