Post your modding questions here

User avatar
HeroOfTheWinds
Member
 
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero

Re: Post your modding questions here

by HeroOfTheWinds » Mon Mar 02, 2015 18:12

@Fox:

times refers to how long it takes to break a node of the given level for the given group, in seconds. A block with the group cracky=2 would take 2.0 seconds to dig with the tool posted above.

uses is the durability of the tool. It says how many nodes of the hardest strength can be dug with the tool. Lesser nodes detract less from uses. So, with that tool, you could break 20 level 1 nodes (although it somewhat can't, as 1 has no times value), since maxlevel = 1. You could also break 60 level 2 nodes, or 180 level 3 nodes. It's powers of three between values, if I remember correctly.

maxlevel is the "hardest" node you can break of the given group with the tool. This is an inverse relationship; 1 is highest, 3 is lowest. default:stone is level 3, but default:obsidian is level 1.

damage_groups are similar, but I think they actually are the reverse of above... 1 is weak, 10 is strong.

full_punch_interval is the time between swings at full power. This really only applies to weapons. If you just rapid click, your hits are weak and may not even do damage. But if you wait as long as full_punch_interval between clicks, you will do the most damage you can.

Hope this helps!
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

Re: Post your modding questions here

by Chinchow » Tue Mar 03, 2015 12:31

How would one go about removing a hud during gameplay?
EDIT: Never mind, it took me awhile, but I figured it out.
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

Re: Post your modding questions here

by Kilarin » Wed Mar 04, 2015 03:20

Greetings and Salutations!
I'm working on a game where I would like to have pvp work in one part of the world, but be disabled in another.
I could simply instantly heal characters whenever they are hurt in the non-pvp area, BUT, I'm not certain how to detect if the damage came from another player or not. If I heal ANY damage, then mobs, falling, lava, drowning, etc. now become pointless.

I found this thread: https://forum.minetest.net/viewtopic.php?id=8901
asking for something similar, but it did not get an answer to the problem.

So is it possible to disable pvp (but not ALL forms of damage) in one region of the world and not in another?

Thanks in advance for your help
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your modding questions here

by paramat » Wed Mar 04, 2015 04:35

TeTpaAka wrote:But you could copy the list of registered ores, clear the ores and then reregister the modified ores. It is a little complicated, but it could work.

Yes that works.
Write a mod that depends on (and therefore runs after) default.
First lines should be any combination of 'clear biomes / decorations / ores'.
Then define your own versions of the categories you just cleared.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your modding questions here

by paramat » Wed Mar 04, 2015 04:45

Krock wrote:
Kilarin wrote:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
             --local vi = area:index(x0, y, z) -- This accesses the node at a given position
             for x = x0, x1 do -- for each node do
                local vi = area:index(x, y, z) -- This accesses the node at a given position


Now works!!! thank you Hero and TeTpaAka!

It's supposed to be used as an array.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   local vi = area:index(x0, y, z) -- This accesses the node at a given position
   for x = x0, x1 do -- for each node do
      -- Codes..
      vi = vi + 1
   end


^ Correct, HOTWinds' first example was missing the vi = vi + 1.
Kilarin, this method works faster because you don't calculate the LVM index for every node, only for the first node in each x row, hence (x0, y, z). Then, the vi = vi + 1 increments the index along the x row of nodes.
This can be done only because a LVM index always increments by 1 in the positive x direction (the y and z directions are much more complex increments).
Calculating the index for every node works but is slower and unneccesary.
 

drkwv
Member
 
Posts: 67
Joined: Thu Jun 28, 2012 13:48

Re: Post your modding questions here

by drkwv » Wed Mar 04, 2015 13:52

Is it possible to make block "fall" like sand but in another direction for some time?
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Wed Mar 04, 2015 14:53

hmm, you could have it check if there is air in the direction that it would fall, and move the block to the side if there is, maybe look at the code for movestones. (in mesecons)
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Wed Mar 04, 2015 15:25

drkwv wrote:Is it possible to make block "fall" like sand but in another direction for some time?


Use the group falling = 1
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Wed Mar 04, 2015 16:43

rubenwardy wrote:
drkwv wrote:Is it possible to make block "fall" like sand but in another direction for some time?


Use the group falling = 1


will that work for falling in other directions though?
 

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

Re: Post your modding questions here

by Krock » Wed Mar 04, 2015 19:51

12Me21 wrote:will that work for falling in other directions though?

Nope, only downwards.
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
HeroOfTheWinds
Member
 
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero

Re: Post your modding questions here

by HeroOfTheWinds » Thu Mar 05, 2015 03:58

Check the code in falling.lua. Or better yet, look at the related file in my Caverealms mod. Just adjust a few of the velocity parameters, and you can change the direction of movement.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

Re: Post your modding questions here

by Chinchow » Thu Mar 05, 2015 04:08

Is it at all possible to change the max player hp?
 

TeTpaAka
Member
 
Posts: 131
Joined: Sat Dec 28, 2013 21:54

Re: Post your modding questions here

by TeTpaAka » Thu Mar 05, 2015 12:46

Chinchow wrote:Is it at all possible to change the max player hp?

Currently, sadly no. See this.
 

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

Re: Post your modding questions here

by Krock » Thu Mar 05, 2015 17:31

Chinchow wrote:Is it at all possible to change the max player hp?

Don't be sad. It already has been added to the 0.5.0 roadmap.
https://github.com/minetest/minetest/issues/2370
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>
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Thu Mar 05, 2015 19:05

but there's a mod that adds a heart staff with which you can increase the player hp
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Fri Mar 06, 2015 01:41

Is there a way to "un-define" a crafting recipe that is used in another mod? (without editing that mod's files)

For example, could I make a mod that when installed, didn't allow you to craft copper and iron into bronze?
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Fri Mar 06, 2015 16:20

12Me21 wrote:Is there a way to "un-define" a crafting recipe that is used in another mod? (without editing that mod's files)

For example, could I make a mod that when installed, didn't allow you to craft copper and iron into bronze?

you can block crafting
viewtopic.php?f=47&t=4668&p=170022#p170022
https://github.com/HybridDog/minetest-n ... g.lua#L164
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Fri Mar 06, 2015 21:51

How would I allow mesecons logic gates (and other stuff) to face in all 6 directions, not just 4?
 

Joz
Member
 
Posts: 40
Joined: Fri Oct 25, 2013 21:37

Re: Post your modding questions here

by Joz » Sun Mar 08, 2015 15:39

A world generator question:
How do I index the flat arrays returned by get3d_map_flat and get2d_map_flat?

I have recently tried to do the same as other lua map generators but what ive done is not perfectly working.

Can someone provide a minimal working example of using flat noise arrays?
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Sun Mar 08, 2015 17:14

Is it possible to change the crosshair's size/position/shape?
 

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

Re: Post your modding questions here

by Krock » Sun Mar 08, 2015 19:21

12Me21 wrote:Is it possible to change the crosshair's size/position/shape?

Yes, just create a crosshair.png image in your texture pack, subgame or mod.
You can use any size but you can't change the position in-game.

Joz wrote:Can someone provide a minimal working example of using flat noise arrays?

It's easy. You need a variable, increase it by 1 to get though the complete array.
Here's an example: https://github.com/SmallJoker/yappy/blo ... t.lua#L227
I hope it's useful to you.
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>
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: Post your modding questions here

by paramat » Sun Mar 08, 2015 23:47

For an array with all 3 sidelengths = sidelen, with minimum point x0, y0, z0

index =
(z - z0) * sidelen^2
+ (y - y0) * sidelen
+ (x - x0)
+ 1

Incrementing the index by 1 works along an x row eastwards (x direction), then works through each x row upwards (y direction), then works through each vertical slice northwards (z direction).
The flat array is in order [z[y[x]]].

2D works the same way as a subset of that. However perlinmap y is usually mapped to world z because we usually use 2D noise in the (world x, world z) horizontal plane.

index =
+ (y - y0) * sidelen
+ (x - x0)
+ 1
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Mar 11, 2015 15:40

Is there a way to make raillike walkable on slopes?
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

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

Re: Post your modding questions here

by Krock » Wed Mar 11, 2015 18:05

Don wrote:Is there a way to make raillike walkable on slopes?

Mesh is not raillike. If you add rails on the textures, they won't connect to regular rails.
With carts, it might work when you add the group rail = 1.
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
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Mar 11, 2015 18:36

Krock wrote:
Don wrote:Is there a way to make raillike walkable on slopes?

Mesh is not raillike. If you add rails on the textures, they won't connect to regular rails.
With carts, it might work when you add the group rail = 1.

I am working on a mod that uses rail like. I want the rails to be walkable. If you place raillike nodes on an incline you can not walk up it. The collision box for rail like nodes will not allow it.
I was wondering if there is a solution to this or not.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Wed Mar 11, 2015 18:46

Don wrote:
Krock wrote:
Don wrote:Is there a way to make raillike walkable on slopes?

Mesh is not raillike. If you add rails on the textures, they won't connect to regular rails.
With carts, it might work when you add the group rail = 1.

I am working on a mod that uses rail like. I want the rails to be walkable. If you place raillike nodes on an incline you can not walk up it. The collision box for rail like nodes will not allow it.
I was wondering if there is a solution to this or not.


You could make them connect without using raillike, like with mesecons, except with slopes instead of wires.
 

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

Re: Post your modding questions here

by Krock » Wed Mar 11, 2015 18:48

Don wrote:The collision box for rail like nodes will not allow it.

Have you tried to define the collision_box? If that doesn't work, I'm out of ideas.

12Me21 wrote:You could make them connect without using raillike, like with mesecons, except with slopes instead of wires.

Mesecons uses a complicated way to connect those wires, it has many, many different nodes for each situation.
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
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Mar 11, 2015 19:31

I will look into mesecons.
You can not redefine the collision box for raillike noeds to make it work. It changes all nodes even if they are flat.
Thanks for your help.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Fri Mar 13, 2015 12:45

Krock wrote:
Don wrote:The collision box for rail like nodes will not allow it.

Have you tried to define the collision_box? If that doesn't work, I'm out of ideas.

12Me21 wrote:You could make them connect without using raillike, like with mesecons, except with slopes instead of wires.

Mesecons uses a complicated way to connect those wires, it has many, many different nodes for each situation.


For raillike, you would just need... technically, 5 nodes:
straight
corner
T
crossing
slope
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

Re: Post your modding questions here

by 12Me21 » Fri Mar 13, 2015 23:22

How do you use default.generate_ore and minetest.register_ore?
specifically, how do you convert code for default.generate_ore to minetest.register_ore?
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron