[Mod] The Origin [1.3.1] [origin]

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

[Mod] The Origin [1.3.1] [origin]

by Wuzzy » Thu Feb 05, 2015 17:19

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
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 72 times
screenshot_1519793696.png
Sam standing on the Origin
screenshot_1519793696.png (12.24 KiB) Viewed 680 times
Last edited by Wuzzy on Fri Nov 18, 2016 23:24, edited 7 times in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

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

by Krock » Fri Feb 06, 2015 09:54

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?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

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

by Wuzzy » Fri Feb 06, 2015 23:55

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: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Release 1.1.1

by Wuzzy » Fri Feb 20, 2015 01:41

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: 2980
Joined: Sun Sep 09, 2012 17:31

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

by Sokomine » Sat Mar 07, 2015 17:58

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: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Release 1.2.0

by Wuzzy » Sat Jul 02, 2016 16:05

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).
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

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

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

by TheReaperKing » Sat Jul 02, 2016 18:48

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!
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: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

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

by Wuzzy » Sat Jul 23, 2016 11:27

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?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

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

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

by TheReaperKing » Sat Jul 23, 2016 12:12

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)
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: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.3.0

by Wuzzy » Mon Aug 08, 2016 04:01

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
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

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

Version 1.3.1 released!

by Wuzzy » Fri Nov 18, 2016 23:26

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)
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 


Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 15 guests

cron