Post your mod requests/ideas here

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

Re: Post your mod requests/ideas here

by kaeza » Post

Mathias wrote:I've searched the forums for awhile, but haven't found any relating to this one:

A mod request for a speedometer, or a HUD that shows the land speed of the player, preferably in meters per second. I believe this is very approachable, but I haven't got the skills (yet) to do this. It would be really useful for other developers to test how fast, a boat, car, train, plane, or their own character is moving. As a beginner in lua, I feel it is necessary if I need to see how how long it would take for my test car to achieve maximum velocity.
This is a quick implementation:

Code: Select all


-- Speedometer update interval, in seconds.
local INTERVAL = 1

local player_speedos = { }

local timer = 0

local function update_speedo(player)
	local plname = player:get_player_name()
	local speedo = player_speedos[plname]
	local oldpos, hud
	if speedo then
		oldpos, hud = unpack(speedo)
	else
		oldpos = player:getpos()
		hud = player:hud_add({
			name = "speedo:"..plname,
			hud_elem_type = "text",
			text = "", -- This is updated below by `hud_change`.
			number = 0xFFFF00, -- Color as 0xRRGGBB
			position = { x=0, y=1 },
			offset = { x=16, y=-16 }, -- In pixels
			alignment = { x=1, y=-1 }, -- Bottom-left
		})
		speedo = { oldpos, hud }
		player_speedos[plname] = speedo
	end
	local curpos = player:getpos()
	local speed = vector.distance(curpos, oldpos) / timer
	player:hud_change(hud, "text", "Speed: "..tostring(speed).." m/s")
	speedo[1] = curpos
end

local function update_speedos()
	for _, p in ipairs(minetest.get_connected_players()) do
		update_speedo(p)
	end
end

minetest.register_globalstep(function(dtime)
	-- Update speedometer every INTERVAL seconds.
	timer = timer + dtime
	if timer >= INTERVAL then
		update_speedos()
		-- If you want more precise timing, use `timer = timer - INTERVAL`.
		timer = 0
	end
end)

minetest.register_on_leaveplayer(function(player)
	-- Discard objects on player leave.
	player_speedos[player:get_player_name()] = nil
end)
It's not precise in any way, but gives an approximation of the player's speed. Feel free to take it as a base and modify to your liking.

To use it, just create a directory in your `mods` directory (it can be named any way, e.g. `speedo`), and paste that code in a file named `init.lua` inside that directory (so you have `mods/speedo/init.lua`.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Mathias
Member
Posts: 13
Joined: Thu Jun 04, 2015 21:06

Re: Post your mod requests/ideas here

by Mathias » Post

kaeza wrote:
Mathias wrote:I've searched the forums for awhile, but haven't found any relating to this one:

A mod request for a speedometer, or a HUD that shows the land speed of the player, preferably in meters per second. I believe this is very approachable, but I haven't got the skills (yet) to do this. It would be really useful for other developers to test how fast, a boat, car, train, plane, or their own character is moving. As a beginner in lua, I feel it is necessary if I need to see how how long it would take for my test car to achieve maximum velocity.
This is a quick implementation:

Code: Select all


-- Speedometer update interval, in seconds.
local INTERVAL = 1

local player_speedos = { }

local timer = 0

local function update_speedo(player)
	local plname = player:get_player_name()
	local speedo = player_speedos[plname]
	local oldpos, hud
	if speedo then
		oldpos, hud = unpack(speedo)
	else
		oldpos = player:getpos()
		hud = player:hud_add({
			name = "speedo:"..plname,
			hud_elem_type = "text",
			text = "", -- This is updated below by `hud_change`.
			number = 0xFFFF00, -- Color as 0xRRGGBB
			position = { x=0, y=1 },
			offset = { x=16, y=-16 }, -- In pixels
			alignment = { x=1, y=-1 }, -- Bottom-left
		})
		speedo = { oldpos, hud }
		player_speedos[plname] = speedo
	end
	local curpos = player:getpos()
	local speed = vector.distance(curpos, oldpos) / timer
	player:hud_change(hud, "text", "Speed: "..tostring(speed).." m/s")
	speedo[1] = curpos
end

local function update_speedos()
	for _, p in ipairs(minetest.get_connected_players()) do
		update_speedo(p)
	end
end

minetest.register_globalstep(function(dtime)
	-- Update speedometer every INTERVAL seconds.
	timer = timer + dtime
	if timer >= INTERVAL then
		update_speedos()
		-- If you want more precise timing, use `timer = timer - INTERVAL`.
		timer = 0
	end
end)

minetest.register_on_leaveplayer(function(player)
	-- Discard objects on player leave.
	player_speedos[player:get_player_name()] = nil
end)
It's not precise in any way, but gives an approximation of the player's speed. Feel free to take it as a base and modify to your liking.

To use it, just create a directory in your `mods` directory (it can be named any way, e.g. `speedo`), and paste that code in a file named `init.lua` inside that directory (so you have `mods/speedo/init.lua`.
Thanks, kaeza; if I plan to release a mod you would definitely be an influence for this one. I will implement this in my project.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: Post your mod requests/ideas here

by stu » Post

Is there an easy (efficient) way to check if particular node (or block) is loaded or is that purely client-side?
I would like to avoid the server errors generated when attempting add an entity in unloaded space. My only idea atm is to check for active players within a given radius, however, I was hoping there may be a cleaner way to achieve this.

User avatar
prestidigitator
Member
Posts: 640
Joined: Thu Feb 21, 2013 23:54

Re: Post your mod requests/ideas here

by prestidigitator » Post

stu wrote:Is there an easy (efficient) way to check if particular node (or block) is loaded or is that purely client-side?
I would like to avoid the server errors generated when attempting add an entity in unloaded space. My only idea atm is to check for active players within a given radius, however, I was hoping there may be a cleaner way to achieve this.
Do minetest.get_node() or minetest.get_node_or_nil() first. If they return a node n with n.name=="ignore" (for the former) or nil (for the latter), the block containing the position given as an argument isn't currently loaded.

DDroid
Member
Posts: 12
Joined: Thu May 28, 2015 21:13
GitHub: DDroid
In-game: DDroid
Location: Georgia, U.S.A.

Re: Post your mod requests/ideas here

by DDroid » Post

Hybrid Dog wrote: l tried it but lost interest.
It's okay. You could make it where the water level goes up/down 1 block at a time. If you've lost interest that's okay.
HP TouchSmart iQ505
CPU: Intel Core 2 Duo T5850 @ 2.16GHz
GPU: Intel GMA 960(?) @ 372MB
RAM: 4GB DDR2
OS : Windows Vista 64bit/Ubuntu Studio 16.04.1LTS 64bit
SSD: (VISTA PARTITION: 400GB; UBUNTU PARTITION: 64GB)
Res: 1650x1050x32 single touch

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: Post your mod requests/ideas here

by stu » Post

prestidigitator wrote:Do minetest.get_node() or minetest.get_node_or_nil() first. If they return a node n with n.name=="ignore" (for the former) or nil (for the latter), the block containing the position given as an argument isn't currently loaded.
That sounds like it might actually work (when you read it aloud) I will see how it goes, thanks for the reply.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Post your mod requests/ideas here

by ABJ » Post

Good idea :D
Test car? WOW I STILL haven't managed to make a car of my own :D

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

Re: Post your mod requests/ideas here

by Sokomine » Post

SAMIAMNOT wrote: 6) Automatically spawning villagers & villages (they may have this)
That's what my mg_villages mod aims at. I'm currently testing a modpack containing all relevant mods on a phone in order to see how far it's possible to use such features on low-end hardware. It seems to work to a degree, though it takes far more patience than on a desktop. When those tests are finished, I'm going to upload the modpack for easy download. The villages still contain errors, but it might be good enough for now.
A list of my mods can be found here.

User avatar
veikk0
New member
Posts: 7
Joined: Tue Feb 05, 2013 16:35

Re: Post your mod requests/ideas here

by veikk0 » Post

I have an idea for a mod. It's inspired by a simple but very entertaining feature found in Grand Theft Auto 5.

Flipping people off.

Image

The player selects an empty hotbar slot and holds down a button (the right mouse button would probably be good). While the button is held down, the player's hand is changed to a different model. For other players to be able to see it a new animation and an addition to the player model's hand would be required.

I have no knowledge of Minetest modding so I don't know if it's possible to do with a mod or if it would require changes to the engine.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Post your mod requests/ideas here

by ABJ » Post

Factions.

User avatar
rubenwardy
Moderator
Posts: 6278
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Post your mod requests/ideas here

by rubenwardy » Post

I'd be interested in a mod that added the range and variety of tools and weapons, like in Terraria. Terraria is incredibly well rich in items, and it all works well. I like how you can't craft all the weapons, and how valuable they are. Even when you can craft them, there are many levels of progression.

Unfortunately I don't have the artistic ability to draw them all.

User avatar
Hybrid Dog
Member
Posts: 2768
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Post your mod requests/ideas here

by Hybrid Dog » Post

rubenwardy wrote:I'd be interested in a mod that added the range and variety of tools and weapons, like in Terraria. Terraria is incredibly well rich in items, and it all works well. I like how you can't craft all the weapons, and how valuable they are. Even when you can craft them, there are many levels of progression.

Unfortunately I don't have the artistic ability to draw them all.
minetest already has a few weapons, e.g.
Image
Attachments
Unbenannt.png
(126.91 KiB) Not downloaded yet

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

User avatar
desvox
Member
Posts: 12
Joined: Sun May 03, 2015 13:34
GitHub: desvox
IRC: desvox
In-game: desvox

Re: Post your mod requests/ideas here

by desvox » Post

rubenwardy wrote:I'd be interested in a mod that added the range and variety of tools and weapons, like in Terraria. Terraria is incredibly well rich in items, and it all works well. I like how you can't craft all the weapons, and how valuable they are. Even when you can craft them, there are many levels of progression.

Unfortunately I don't have the artistic ability to draw them all.
I was honestly just thinking of that the other day. Terraria is many steps above Minetest/craft when it comes to it's items, weaponry, and combat.
I love your feedback and your suggestions!

Tox: E2602677725B4A2DA7B0395EFB9E03856CC5BBA948CFA9DB14ED6461EC39CC0F4859493BFD34

amadin
Member
Posts: 548
Joined: Tue Jun 16, 2015 16:23

Re: Post your mod requests/ideas here

by amadin » Post

deleted - wrong section

User avatar
Samson1
Member
Posts: 94
Joined: Wed Apr 01, 2015 19:41
IRC: Samson1
In-game: Samson1

Re: Post your mod requests/ideas here

by Samson1 » Post

I think a Tardis would be good:D

User avatar
Anonymous_moose
Member
Posts: 38
Joined: Tue Aug 27, 2013 20:25

Re: Post your mod requests/ideas here

by Anonymous_moose » Post

Samson1 wrote:I think a Tardis would be good:D
The travelnet mod is sort of like a tardis... If you were to retexture it, then voila! Tardis!

amadin
Member
Posts: 548
Joined: Tue Jun 16, 2015 16:23

Re: Post your mod requests/ideas here

by amadin » Post

Auto-jump mod, which auto jump via 1 block if player walk. This wil remove the need to often press the space bar when walking.

Ivà
Member
Posts: 115
Joined: Sun Feb 22, 2015 07:11
GitHub: melzua
IRC: melzua
In-game: melzua
Location: Catalonia

Re: Post your mod requests/ideas here

by Ivà » Post

amadin wrote:Auto-jump mod, which auto jump via 1 block if player walk. This wil remove the need to often press the space bar when walking.
It's called 'stepheight' but I think the value is hardcoded for players.

User avatar
cHyper
Member
Posts: 893
Joined: Fri May 06, 2011 08:49
GitHub: cHyper-0815OL
IRC: cHyper cHyper_de
In-game: cHyper cHyper_0815
Location: Austria
Contact:

Re: Post your mod requests/ideas here

by cHyper » Post

Hi!

Are there any mods with achivements or Statistics elements.

Thanks

User avatar
rubenwardy
Moderator
Posts: 6278
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Post your mod requests/ideas here

by rubenwardy » Post

amadin wrote:Auto-jump mod, which auto jump via 1 block if player walk. This wil remove the need to often press the space bar when walking.
I think there is a setting in minetest.conf for this. It was added when android support was added.

amadin
Member
Posts: 548
Joined: Tue Jun 16, 2015 16:23

Re: Post your mod requests/ideas here

by amadin » Post

Hi all. I need mod wich will push back the player if he dig protected blocks (wall fo examle). Now i use "Protector redo" mod. I'm think it need for all server owners who use protector mods. I hear about mod which deal damage to player if he try to dig protected block, so you may use code from this mod viewtopic.php?id=4799

User avatar
TenPlus1
Member
Posts: 2867
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: Post your mod requests/ideas here

by TenPlus1 » Post

amadin: if you really want players to be hurt when digging in a protected area then add these 2 lines to the init.lua file after line 161 in the latest Protector Redo mod:

Code: Select all

player = minetest.get_player_by_name(digger)
player:set_hp(player:get_hp()-2)

amadin
Member
Posts: 548
Joined: Tue Jun 16, 2015 16:23

Re: Post your mod requests/ideas here

by amadin » Post

TenPlus1 wrote:amadin: if you really want players to be hurt when digging in a protected area then add these 2 lines to the init.lua file after line 161 in the latest Protector Redo mod:

Code: Select all

player = minetest.get_player_by_name(digger)
player:set_hp(player:get_hp()-2)
Thank you, but it would be better then the player to be pushed back instead hurt.

Dragonop
Member
Posts: 1183
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: Post your mod requests/ideas here

by Dragonop » Post

Hybrid Dog wrote: minetest already has a few weapons, e.g. download/file.php?mode=view&id=2968
You forgot the mighty Air Sword

User avatar
Hybrid Dog
Member
Posts: 2768
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Post your mod requests/ideas here

by Hybrid Dog » Post

Dragonop wrote:
Hybrid Dog wrote: minetest already has a few weapons, e.g. download/file.php?mode=view&id=2968
You forgot the mighty Air Sword
l forgot many weapons, those were just a few examples

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest