Post your mod requests/ideas here

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

Re: Post your mod requests/ideas here

by kaeza » Thu Jun 04, 2015 23:33

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: 10
Joined: Thu Jun 04, 2015 21:06

Re: Post your mod requests/ideas here

by Mathias » Fri Jun 05, 2015 00:26

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
Location: United Kingdom
GitHub: stujones11

Re: Post your mod requests/ideas here

by stu » Fri Jun 05, 2015 18:48

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.
 

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

Re: Post your mod requests/ideas here

by prestidigitator » Fri Jun 05, 2015 23:43

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
Location: Georgia, U.S.A.
GitHub: DDroid
In-game: DDroid

Re: Post your mod requests/ideas here

by DDroid » Fri Jun 05, 2015 23:59

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
Location: United Kingdom
GitHub: stujones11

Re: Post your mod requests/ideas here

by stu » Sat Jun 06, 2015 00:19

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
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ

Re: Post your mod requests/ideas here

by ABJ » Sat Jun 06, 2015 16:35

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

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

Re: Post your mod requests/ideas here

by Sokomine » Sat Jun 13, 2015 16:11

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 » Mon Jun 15, 2015 05:07

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
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ
 

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

Re: Post your mod requests/ideas here

by rubenwardy » Mon Jun 22, 2015 17:27

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: 2722
Joined: Thu Nov 01, 2012 12:46

Re: Post your mod requests/ideas here

by Hybrid Dog » Mon Jun 22, 2015 18:06

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 » Tue Jun 30, 2015 14:56

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
 

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

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

Re: Post your mod requests/ideas here

by Anonymous_moose » Fri Jul 17, 2015 01:38

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 » Thu Jul 23, 2015 05:09

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
Location: Catalonia
GitHub: melzua
IRC: melzua
In-game: melzua

Re: Post your mod requests/ideas here

by Ivà » Thu Jul 23, 2015 13:42

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: 842
Joined: Fri May 06, 2011 08:49
Location: Austria
GitHub: cHyper-0815OL
IRC: cHyper
In-game: cHyper cHyper_0815

Re: Post your mod requests/ideas here

by cHyper » Thu Jul 23, 2015 18:53

Hi!

Are there any mods with achivements or Statistics elements.

Thanks
 

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

Re: Post your mod requests/ideas here

by rubenwardy » Thu Jul 23, 2015 21:35

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 » Sun Jul 26, 2015 15:49

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: 2645
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: Post your mod requests/ideas here

by TenPlus1 » Sun Jul 26, 2015 16:56

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 » Sun Jul 26, 2015 18:13

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: 1178
Joined: Tue Oct 23, 2012 12:59
Location: Argentina
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop

Re: Post your mod requests/ideas here

by Dragonop » Mon Jul 27, 2015 05:21

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: 2722
Joined: Thu Nov 01, 2012 12:46

Re: Post your mod requests/ideas here

by Hybrid Dog » Mon Jul 27, 2015 12:33

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

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

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest