[Mod] The Origin [1.3.1] [origin]

Post Reply
User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

[Mod] The Origin [1.3.1] [origin]

by Wuzzy » Post

NOTE: This mod is (somewhat) deprecated now. I recommend to use Spawn Builder instead.

This is a very simple map generating mod for the map generator “singlenode”. It places a single indestructible block, called “The Origin” directly below the spawn position. It also forces the map generator to be “singlenode” unless disabled via settings.
This prevents the player to fall immediately down on spawning.

Screenshot:
Image

By default, the block will spawn at (0,-1,0), but if the setting “static_spawnpoint” is present, it will spawn the block one node length below that position.

I am unsure if this mod is capable of handling a static_spawnpoint which is changed often. The intention is that the block only spawns once for the entire lifetime of the world and that's it. If you somehow noticed that a second origin block spawned, please report it here as bug.

I consider this mod to be finished.

Version: 1.3.1
Works in Minetest 0.4.16 or later.
License of everything: WTFPL
Mandatory dependencies: None!
Optional dependencies: intllib, doc_items
Download: In the attachment
Git project page (for developers): http://repo.or.cz/minetest_origin.git
Attachments
origin1.3.1.zip
(29.69 KiB) Downloaded 193 times
screenshot_1519793696.png
Sam standing on the Origin
(12.24 KiB) Not downloaded yet
Last edited by Wuzzy on Fri Dec 01, 2017 09:37, edited 9 times in total.

User avatar
Krock
Developer
Posts: 4572
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] The Origin [1.0.0] [origin]

by Krock » Post

Well, it's possible to create multiple origin nodes if static_spawn is changed to a not generated coordinate.
This mod can be helpful for people who want to create their own world.
Could you add some nodes around the origin, so it's not possible to fall off by a mistake?
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] The Origin [1.1.0] [origin]

by Wuzzy » Post

Thanks for the feedback. I made a small update to version 1.1.0.

This mod now writes a file “origin.mt” into the world folder when the Origin is first placed. If the file is present when the world is loaded later, the mod will not place the Origin again.
I hope this ensures the Origin will only be placed once in the world.

I also added a short readme file.

Hmm, I am not sure if I change the stuff that spawns around the spawn position. I don't want this initial block to get in the way too much. For now, if you fall down, you could teleport back with /teleport. Not the best solution …

Maybe I will extend this mod later to spawn more fancy structures at the spawnpoint, and make this mod more configurable. But for now I keep things just simple and stupid. :D

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Release 1.1.1

by Wuzzy » Post

Quick bugfix release 1.1.1!

The origin node could theoretically be removed by the cave generation of the map generator. Now this should not be possible anymore.

Sokomine
Member
Posts: 4170
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] The Origin [1.1.1] [origin]

by Sokomine » Post

Good idea. Falling through the map when mapgen is singlenode is always a bit annoying. It takes some time to type the /grant singleplayer all command. There are also some skyblock games which are pretty nice.
A list of my mods can be found here.

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Release 1.2.0

by Wuzzy » Post

I just released version 1.2.0. This is a minor update which adds mod.conf and tweaks the readme file a bit.
I also added a Git repository (see first post).
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] The Origin [1.2.0] [origin]

by TheReaperKing » Post

I'm sure you can add this easily yourself but I'd be more than happy to add the simple code but I made a modified version of your Mod that defaults to the singlenode mapgen. Just kinda makes sense :) Thanks for this mod!
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] The Origin [1.2.0] [origin]

by Wuzzy » Post

Since the singlenode mapgen is now deeply hidden in Minetest and hard to select, should I change this mod that it automatically forces the singlenode mapgen on loading?
Or is there maybe an usecase for an origin block in any of the other mapgens?
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
TheReaperKing
Member
Posts: 531
Joined: Sun Nov 22, 2015 21:36
Contact:

Re: [Mod] The Origin [1.2.0] [origin]

by TheReaperKing » Post

Maybe if you are worried about people wanting a choice you could make it called "The Origin + Singlenode Mod" Here is what I have. I did make the block destructible because in case I need to destroy it when building.

Edit - In case you were wondering why I changed your license to DWYWPL I work at a school :) Same license but actually offers you some protection from getting sued too.
--Enable Singlenode
minetest.set_mapgen_params({mgname = "singlenode"})


--Origin Mod thanks to Wuzzy and his code is licensed DWYWPL
origin = {}

do
local filepath = minetest.get_worldpath().."/origin.mt"
local file = io.open(filepath, "r")
if file then
io.close(file)
origin.exists = true
else
origin.exists = false
end
end

minetest.register_node("singlenode:origin",{
description = "The Origin",
is_ground_content = true,
groups = { not_in_creative_inventory = 1, immortal = 0 },
tiles = {"origin_origin.png"},
sounds = { footstep = "origin_origin_footstep" },
is_ground_content = false,
})

minetest.register_on_mapgen_init(function(mgparams)
origin.mgparams = mgparams
end)

minetest.register_on_generated(function(minp, maxp, seed)
local spawn = minetest.setting_get_pos("static_spawnpoint")
if origin.exists ~= true and origin.mgparams.mgname == "singlenode" then
local blockpos
if spawn ~= nil then
blockpos = { x=spawn.x, y=spawn.y-1, z=spawn.z }
else
blockpos = { x=0, y=-1, z=0 }
end
if(minp.x <= blockpos.x and maxp.x >= blockpos.x and minp.y <= blockpos.y and maxp.y >= blockpos.y and minp.z <= blockpos.z and maxp.z >= blockpos.z) then
minetest.set_node(blockpos, {name = "singlenode:origin"})
minetest.log("action", "[origin] The Origin has been set at "..minetest.pos_to_string(blockpos)..".")
origin.exists = true
local filepath = minetest.get_worldpath().."/origin.mt"
local file = io.open(filepath, "w")
if file then
file:write(minetest.pos_to_string(blockpos))
else
minetest.log("error", "[origin] Failed to write origin data into "..filepath..". The Origin may be placed again if you change static_spawnpoint.")
end
end
end
end)
Become A Real Life Superhero - http://SuperheroHill.com
Project Lead of the Doom 3 Mod Last Man Standing - http://Doom3Coop.com
Project Lead of Platinum Arts Sandbox Free 3D Game Maker - http://SandboxGameMaker.com
Youtube Channel - https://www.youtube.com/user/PlatinumArtsKids

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.3.0

by Wuzzy » Post

Version 1.3.0 released!

Changes:

- Force singlenode mapgen on loading
- Add setting (origin_force_singlenode) to disable aforementioned behaviour
- intllib support
- German translation
- Item Documentation support
- Minor bugfixes
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.3.1 released!

by Wuzzy » Post

Version 1.3.1 released! Changes:

- Fix mod not working if both intllib and mod security are enabled
- Use larger screenshot
- Minor refactoring
- Compability to version 0.7.0 of doc_items (Documentation System modpack)
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Wuzzy
Member
Posts: 4089
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

WARNING: Mod is deprecated now

by Wuzzy » Post

I consider this mod to be deprecated now. It is still perfectly usable, but I will no longer maintain this mod.

I have posted a new mod. I'm no longer happy with the concept of this Origin mod.

The new mod is called “Spawn Builder” and gets less angfy if you change static_spawnpoint, and it doesn't add any new nodes, and it works in all mapgens, and the starter platform can be destroyed, and the starter platform is much larger, and it doesn't matter if the static_spawnpoint is buried inside the underground.

viewtopic.php?f=9&t=18790&p=299343
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests