Post your modding questions here

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Post your modding questions here

by Sergey » Post

rubenwardy wrote:
Sergey wrote:Why minetest.register_on_dignode is not recommended?
Are you going to remove that method in future?
As for me, I find it quite useful.
it runs on every single node dig, so you should use the node's dig callback if possible instead
What if I want to set specific action on dig of every stone-like node?
Do I have to set my handler for stone, cobble, mossycobble, desert stone, ... and rest of many stone-like nodes? Are you serious?

User avatar
Desour
Member
Posts: 1472
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: Post your modding questions here

by Desour » Post

Sergey wrote:Why minetest.register_on_dignode is not recommended?
Are you going to remove that method in future?
As for me, I find it quite useful.
lua_api.txt wrote:use `on_destruct` or `after_dig_node` in node definition
whenever possible
The registered functions are always executed when eg. a node is digged, no matter what node. If you want to do something especially for one node, `on_destruct` or `after_dig_node` is much more efficient.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Post your modding questions here

by Sergey » Post

Using minetest.override_item method I don't have to redefine all properties of an item (node/tool) but only those properties that differ.

Unlike minetest.register_tool where I have to set all necessary properties again if I want to redefine only few of them.

BUT what if property I would like to change is not simple value but is table instead (e.g. tool_capabilities of a tool)?
Do I have to set tool_capabilities as small table containing only changes or do I have to copy/paste (from Lua API file that may be changed in time) all contents of that table and make slight changes inside? I suppose it is the second case. Because, unfortunately, in the first case it overrides the whole table and makes it incomplete.

John_Constructor
Member
Posts: 76
Joined: Thu Jun 01, 2017 20:06
GitHub: John-Constructor
In-game: Nooberton
Location: On Minetest 24/7

Re: Post your modding questions here

by John_Constructor » Post

Title: How do I create an entity, apply a mesh/texture (This one always keeps me thinking.) to it, apply animations on key detection, apply velocities (Angular and Linear) on key detection, apply DIGGING on key (Or mouse!) detection, apply bones aiming towards mouse, and enable the ability to pilot it? Oh... And what format do I need the file to be in to apply it to the entity? Geometry scale would be useful as well, since I will be using Blender for the creation of the mesh and do not know the scale of a Blender unit to a Minetest Meter. (OPTIONAL area of question: I would also like to keep it standalone, or at least, mostly standalone.)

Reason: I want to create a special mod that adds a vehicle usable for mining.
Constructing mechs and wingless aircraft since 2016.

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: Post your modding questions here

by hajo » Post

John_Constructor wrote:mod that adds a vehicle usable for mining.
See digtron (in my sig).

John_Constructor
Member
Posts: 76
Joined: Thu Jun 01, 2017 20:06
GitHub: John-Constructor
In-game: Nooberton
Location: On Minetest 24/7

Re: Post your modding questions here

by John_Constructor » Post

hajo wrote:
John_Constructor wrote:mod that adds a vehicle usable for mining.
See digtron (in my sig).
My idea was an entity that is... Let's say... A bit of a mech with two excavator cylinders on arms, I intend to make it more mobile while still in a small space, and if there's no room for the mech, for it to be capable of digging its way out, honestly the digtron mod may be better than my concept, but eh, I wanted to give it a try and see if I can manage so much content into one mod.
Constructing mechs and wingless aircraft since 2016.

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

how do we use "plantlike_rooted" drawtype?

by Napiophelios » Post

So how do we use "plantlike_rooted" drawtype?
The provided doc only mentions it as a drawtype,
but no examples of how to use it.
Image
screenshot_20170909_121609.png
screenshot_20170909_121609.png (131.51 KiB) Viewed 716 times

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

^looks problematic

N edit: Maybe it needs to have a special_tiles defined like water.
Last edited by azekill_DIABLO on Sat Sep 09, 2017 16:47, edited 1 time in total.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: Post your modding questions here

by Napiophelios » Post

azekill_DIABLO wrote:^looks problematic
Technique #3 - 'TOPIC DILUTION'

Topic dilution is not only effective in forum sliding it is also very useful in keeping the forum readers on unrelated and non-productive issues. This is a critical and useful technique to cause a 'RESOURCE BURN.' By implementing continual and non-related postings that distract and disrupt (trolling ) the forum readers they are more effectively stopped from anything of any real productivity.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

Edited to something necessary. I didn't know you were a fervent defender of c55's disk space.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: Post your modding questions here

by Napiophelios » Post

azekill_DIABLO wrote:Edited to something necessary. I didn't know you were a fervent defender of c55's disk space.
Questions are less likely to be answered if they are buried in nonsense.

Are far as "disk space" is concerned,
why waste resources if you don't have too?
To waste resources on purpose , my dear bitwaster, is just ignorant.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

Napiophelios wrote: To waste resources on purpose , my dear bitwaster, is just ignorant.
and you know i ain't. It's just here to "tickle" people :D
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: Post your modding questions here

by Napiophelios » Post

azekill_DIABLO wrote:Edited to something necessary. I didn't know you were a fervent defender of c55's disk space.
Thank you for the edit. It solved my problem :)
Napiophelios wrote:
TenPlus1 wrote:Napio: when making tiles you gotta assign the first 6 textures to default_sand.png for the bottom block and the next texture for the coral plant :)
AzekillDiablo, was right. You have to specify a special tile

Code: Select all

	
tiles = {
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png",
"default_sand.png"
},
special_tiles = {"fishing_coral4.png"},
Image
screenshot_20170909_140130.png

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

cool! i'm happy it helped! however, it looks... painfully less shadowed than other blocks :| coral is nice!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: Post your modding questions here

by Napiophelios » Post

azekill_DIABLO wrote:cool! i'm happy it helped! however, it looks... painfully less shadowed than other blocks :| coral is nice!
That's not from the drawtype, I altered the mapgen for very deep oceans;
so I had them emit light so I could find them in the blackness...just for testing :)

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Post your modding questions here

by azekill_DIABLO » Post

okay cool! i really like your mod, need to see it working!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Baryhobal
Member
Posts: 17
Joined: Tue Nov 01, 2016 15:33
In-game: Baryhobal

Re: Post your modding questions here

by Baryhobal » Post

Can someone help me ? I try to do this:

Code: Select all

placer:set_attribute("wood", "1")
in a on_place callback in minetest.register_craftitem and it tell me:

Code: Select all

attempt to call method 'set_attribute' (a nil value)
Do you know what's the problem ?
Sorry if my english isn't good.
I love making mesecon mechanisms. If you want a system, just tell it to me and I will try to make it.

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

Re: Post your modding questions here

by rubenwardy » Post

Baryhobal wrote:Can someone help me ? I try to do this:

Code: Select all

placer:set_attribute("wood", "1")
in a on_place callback in minetest.register_craftitem and it tell me:

Code: Select all

attempt to call method 'set_attribute' (a nil value)
Do you know what's the problem ?
You need to update to the latest version of Minetest. 0.4.16
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Baryhobal
Member
Posts: 17
Joined: Tue Nov 01, 2016 15:33
In-game: Baryhobal

Re: Post your modding questions here

by Baryhobal » Post

Thanks
Sorry if my english isn't good.
I love making mesecon mechanisms. If you want a system, just tell it to me and I will try to make it.

User avatar
Baryhobal
Member
Posts: 17
Joined: Tue Nov 01, 2016 15:33
In-game: Baryhobal

Re: Post your modding questions here

by Baryhobal » Post

Byakuren wrote:
Baryhobal wrote:Title: How to create a function that unlock a craft and only for one person ?
Reason: I want to make a research mod like in the minecraft mod Ancient Warfare 2
More info: I have already do the interface but I don't know how to do this.
First of all, you will need to keep track of what recipes the player has access to. I would recommend representing this as a "set" (a table where the keys are the values in the set, and the values are all true) of the names of the recipe output items. You can store it as a player attribute using the set_attribute and get_attribute methods of players (https://github.com/minetest/minetest/bl ... .txt#L3279) to store the table after turning it into a string with minetest.write_json (https://github.com/minetest/minetest/bl ... .txt#L2979).

After you have done all that you can write a function that unlocks a craft for a player, by getting the attribute that stores the unlock table, deserializing it (with minetest.parse_json), adding the item name, then serializing it and storing it back again to the attribute.
I don't understand how to stock it in a "table".
Sorry if my english isn't good.
I love making mesecon mechanisms. If you want a system, just tell it to me and I will try to make it.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: Post your modding questions here

by christoferlevich » Post

Does anyone know of a mod (or simple technic) to create a timer for a 'course' in my map? The idea is to time (and maybe track) the times performing in an obstacle course. I've been looking but I must not be using the right key words.
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: Post your modding questions here

by hajo » Post

christoferlevich wrote:Does anyone know of a mod (or simple technic)
to create a timer for a 'course' in my map?
Well, I keep telling that robots can do almost everything,
but it looks like nobody understands or tries them...

basic_robots do one operation per second,
so a simple counter gives a timer with 1-second-precision.
For more precision, there is os.clock and os.difftime.

As a display, robots can place blocks with big numbers.

How do you want to start/stop the timing ?
Buttonpress, placing/digging blocks/plants, opening/closing door/trapdoor/chest ?

robots can detect players within a range of 8 blocks,
but only with precision of one block & one second.

Ideas for timer without any mods:
* start a water/lavaflow, that will block the course after some time
* dito, use gunpowder as a fuse
* place saplings on the course, so that growing trees will block it after some time
* combine that to make a track of 'falling dominoes'
Last edited by hajo on Tue Sep 12, 2017 13:09, edited 1 time in total.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: Post your modding questions here

by christoferlevich » Post

I can try it but it doesn't sound like the thing I need. I want a timer to start when a player enters an area/room, whether by switch, floor plate, or detector - and I want it to count time until the player exits through another room...
everything can be a learning experience...

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: Post your modding questions here

by hajo » Post

christoferlevich wrote:I want a timer to start when a player enters an area/room, ..
and I want it to count time until the player exits through another room...
What should happen if player comes back / makes another lap ?
Keep separate timers for each player ?
Can several players be in the area at the same time ?
(or does the entry-door get blocked until the player leaves?)

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: Post your modding questions here

by christoferlevich » Post

The goal is a new timer for each player (multi players in course). Could even time from an item player carries for self. It's linear so going back or for multi laps won't be an issue.
everything can be a learning experience...

Locked

Who is online

Users browsing this forum: No registered users and 2 guests