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 » Thu Sep 07, 2017 00:00

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
DS-minetest
Member
 
Posts: 1109
Joined: Thu Jun 19, 2014 19:49
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Thu Sep 07, 2017 10:59

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.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

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

Re: Post your modding questions here

by Sergey » Thu Sep 07, 2017 20:28

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
Location: On Minetest 24/7
GitHub: John-Constructor
In-game: Nooberton

Re: Post your modding questions here

by John_Constructor » Thu Sep 07, 2017 21:45

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: 596
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: Post your modding questions here

by hajo » Fri Sep 08, 2017 12:21

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
Location: On Minetest 24/7
GitHub: John-Constructor
In-game: Nooberton

Re: Post your modding questions here

by John_Constructor » Fri Sep 08, 2017 19:35

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: 981
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

how do we use "plantlike_rooted" drawtype?

by Napiophelios » Sat Sep 09, 2017 16:18

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
(131.51 KiB) Not downloaded yet
 

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

Re: Post your modding questions here

by azekill_DIABLO » Sat Sep 09, 2017 16:22

^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.
 

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

Re: Post your modding questions here

by Napiophelios » Sat Sep 09, 2017 16:30

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: 7489
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Post your modding questions here

by azekill_DIABLO » Sat Sep 09, 2017 16:46

Edited to something necessary. I didn't know you were a fervent defender of c55's disk space.
 

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

Re: Post your modding questions here

by Napiophelios » Sat Sep 09, 2017 16:52

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: 7489
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Post your modding questions here

by azekill_DIABLO » Sat Sep 09, 2017 17:32

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
 

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

Re: Post your modding questions here

by Napiophelios » Sat Sep 09, 2017 18:05

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: 7489
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Post your modding questions here

by azekill_DIABLO » Sat Sep 09, 2017 18:36

cool! i'm happy it helped! however, it looks... painfully less shadowed than other blocks :| coral is nice!
 

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

Re: Post your modding questions here

by Napiophelios » Sat Sep 09, 2017 19:23

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: 7489
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

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

Re: Post your modding questions here

by Baryhobal » Sun Sep 10, 2017 16:35

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: 5802
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Sun Sep 10, 2017 17:05

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
 

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

Re: Post your modding questions here

by Baryhobal » Sun Sep 10, 2017 18:11

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 » Mon Sep 11, 2017 18:42

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: 323
Joined: Thu Dec 01, 2016 23:44
Location: Athol, Massachusetts
GitHub: ChristoferL

Re: Post your modding questions here

by christoferlevich » Tue Sep 12, 2017 10:14

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: 596
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: Post your modding questions here

by hajo » Tue Sep 12, 2017 12:46

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: 323
Joined: Thu Dec 01, 2016 23:44
Location: Athol, Massachusetts
GitHub: ChristoferL

Re: Post your modding questions here

by christoferlevich » Tue Sep 12, 2017 13:05

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: 596
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: Post your modding questions here

by hajo » Tue Sep 12, 2017 13:20

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: 323
Joined: Thu Dec 01, 2016 23:44
Location: Athol, Massachusetts
GitHub: ChristoferL

Re: Post your modding questions here

by christoferlevich » Tue Sep 12, 2017 13:31

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...
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 2 guests