Post your modding questions here
Re: Post your modding questions here
Making better anti-cheat system ?
Yeah i know there are good anti-cheats, but they can be easy broken with remoding MT client to ignore them. Is possible to make anti-cheat which can't be broken that easy. Something which would not allow MT remodded client to join server ?
Yeah i know there are good anti-cheats, but they can be easy broken with remoding MT client to ignore them. Is possible to make anti-cheat which can't be broken that easy. Something which would not allow MT remodded client to join server ?
Who's Soulja boy?
Yuuuuuu
Yuuuuuu
Re: Post your modding questions here
https://github.com/minetest/minetest/bl ... i.txt#L150hajo wrote:With entries in depends.txt it is possible for a mod to check if other needed mods are installed.
You should use minetest.get_modnames(). https://github.com/minetest/minetest/bl ... .txt#L2163
You can use minetest.get_version(). https://github.com/minetest/minetest/bl ... .txt#L2222hajo wrote: Is it possible to check for a minimum version of the minetest-engine (e.g."needs 0.4.16-dev") ?
Can your read this?
Re: Post your modding questions here
Topic: How to handle a block being right clicked(or more generally how to handle any interactions with a block)
Reason: Part of my mod involves performing a series of actions when a specified block is right clicked with a shovel
More Info(optional): I'm quite new to minetest development(thought not developmenet in general) I didn't see an event for block breaking, clicking, etc in the API, to handle this do I need to change all shovels? I'm assuming there is a more direct route that other mods have taken.
Reason: Part of my mod involves performing a series of actions when a specified block is right clicked with a shovel
More Info(optional): I'm quite new to minetest development(thought not developmenet in general) I didn't see an event for block breaking, clicking, etc in the API, to handle this do I need to change all shovels? I'm assuming there is a more direct route that other mods have taken.
Re: Post your modding questions here
in ..\minetest-0.4.14\doc\lua_api.txtwrcwpk wrote:Topic: How to handle a block being right clicked
May be ### Node definition (`register_node`)
on_rightclick = func(pos, node, clicker, itemstack, pointed_thing)
for quick scope use something like
Spoiler
I am a noob. still yet. Not so noob ) [vml] WIP and a little proof for fun PlantedTorch )))
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )
Re: Post your modding questions here
Deleted
Last edited by wrcwpk on Sat Aug 26, 2017 19:30, edited 1 time in total.
Re: Post your modding questions here
How can I get the formatted item name? when using itemstack:get_name()?
Right now it prints table: 0x<Some hex code> where what I want is "default:dirt"
Right now it prints table: 0x<Some hex code> where what I want is "default:dirt"
Re: Post your modding questions here
"itemstack:get_name()" should give you the name of the itemstack. https://github.com/minetest/minetest/bl ... .txt#L3536wrcwpk wrote:How can I get the formatted item name? when using itemstack:get_name()?
Right now it prints table: 0x<Some hex code> where what I want is "default:dirt"
Probably your userdata isn't an itemstack.
Maybe it is an inventory, in this case you can use "inv:get_stack(listname, i)".
Please give us more informations about your code.
By the way you can also try "itemstack:to_table().name".
Can your read this?
-
- 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
Title: Is there a way to mass-override crafts as well as create the ability to use two of the same item to somewhat carve them into things such as AxeHeads?
Reason: I want to make a Crafting Realism mod that rather than allowing to start off with wood, needing to start off with collecting stones to create tools, or at the least, the heads for the tools.
Reason: I want to make a Crafting Realism mod that rather than allowing to start off with wood, needing to start off with collecting stones to create tools, or at the least, the heads for the tools.
Constructing mechs and wingless aircraft since 2016.
Re: Post your modding questions here
Yeah minetest.clear_craft(recipe).John_Constructor wrote:Title: Is there a way to mass-override crafts as well as create the ability to use two of the same item to somewhat carve them into things such as AxeHeads?
Reason: I want to make a Crafting Realism mod that rather than allowing to start off with wood, needing to start off with collecting stones to create tools, or at the least, the heads for the tools.
https://github.com/minetest/minetest/bl ... .txt#L2339
Do you want to do something like the realtest game?
viewtopic.php?t=13624
Can your read this?
-
- 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
Potentially so, I'll need to look into that.cx384 wrote:Yeah minetest.clear_craft(recipe).John_Constructor wrote:Title: Is there a way to mass-override crafts as well as create the ability to use two of the same item to somewhat carve them into things such as AxeHeads?
Reason: I want to make a Crafting Realism mod that rather than allowing to start off with wood, needing to start off with collecting stones to create tools, or at the least, the heads for the tools.
https://github.com/minetest/minetest/bl ... .txt#L2339
Do you want to do something like the realtest game?
viewtopic.php?t=13624
Constructing mechs and wingless aircraft since 2016.
- christoferlevich
- Member
- Posts: 325
- Joined: Thu Dec 01, 2016 23:44
- GitHub: ChristoferL
- Location: Athol, Massachusetts
Re: Post your modding questions here
Couldn't you put in the same idea into effect by making nodes unbreakable against hands - and maybe the elimination of wonderful items like wooden sword and ax (these always leave me laughing).John_Constructor wrote:Potentially so, I'll need to look into that.cx384 wrote:Yeah minetest.clear_craft(recipe).John_Constructor wrote:Title: Is there a way to mass-override crafts as well as create the ability to use two of the same item to somewhat carve them into things such as AxeHeads?
Reason: I want to make a Crafting Realism mod that rather than allowing to start off with wood, needing to start off with collecting stones to create tools, or at the least, the heads for the tools.
https://github.com/minetest/minetest/bl ... .txt#L2339
Do you want to do something like the realtest game?
viewtopic.php?t=13624
everything can be a learning experience...
-
- 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
I looked into Realtest's description... Exactly my idea for the early game, yet rather than breaking the dirt below the trees- the player needs to start by collecting stones/rocks to make the head of the tool, honestly it would complicate it a little yet it's for the sake of realism; you can't really cut logs apart using your bare hands after digging the soil under it, you need- at the least- some kind of axe head or a saw, the concept came about quite a while before I published my first mod.
Constructing mechs and wingless aircraft since 2016.
- Desour
- Member
- Posts: 1473
- 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
It is already like this. The digging dirt below tree thing was just because of something else.John_Constructor wrote:I looked into Realtest's description... Exactly my idea for the early game, yet rather than breaking the dirt below the trees- the player needs to start by collecting stones/rocks to make the head of the tool, honestly it would complicate it a little yet it's for the sake of realism; you can't really cut logs apart using your bare hands after digging the soil under it, you need- at the least- some kind of axe head or a saw, the concept came about quite a while before I published my first mod.
Last edited by Desour on Sat Sep 02, 2017 16:53, edited 1 time in total.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
- AspireMint
- Member
- Posts: 415
- Joined: Mon Jul 09, 2012 12:59
- GitHub: AspireMint
- IRC: AspireMint
- In-game: AspireMint
- Location: Stuck at spawn
Re: Post your modding questions here
so i tried minetest.register_alias(str1, str2) and minetest.register_alias_force(str1, str2) with no success.
Anyone knows how to use it? (where to put new init.lua file with this function)
EDIT: nvm, forgot to put depends.txt :-/ , so my "mod" is loaded after mod with str1 and str2 blocks
Solved.
Anyone knows how to use it? (where to put new init.lua file with this function)
EDIT: nvm, forgot to put depends.txt :-/ , so my "mod" is loaded after mod with str1 and str2 blocks
Solved.
-
- 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
Title: How do I create a setting that toggles the existence of certain nodes?
Reason: I want to give one of my mods the ability to have certain materials of nodes disabled to the user's liking,
Extensive information: I decided I wanted to try this when converting it to a modpack wouldn't function correctly (I.E.: only the crafting area of the mod would be enabled when the rest was enabled and in that modpack; in-game result was nodes not being registered compared to crafts.).
Reason: I want to give one of my mods the ability to have certain materials of nodes disabled to the user's liking,
Extensive information: I decided I wanted to try this when converting it to a modpack wouldn't function correctly (I.E.: only the crafting area of the mod would be enabled when the rest was enabled and in that modpack; in-game result was nodes not being registered compared to crafts.).
Constructing mechs and wingless aircraft since 2016.
Re: Post your modding questions here
Voxel Editor Questions
I ran into some interesting programs that are called Voxel Editors.
Most were geared towards Minecraft though.
My question is there any possible use for them in Minetest?
I was thinking of experimenting with them to do new furniture and plant/tree textures.
I have lot of hand drawn textures I have made but not whole lot of skills with blender or how to put them in Voxel related worlds.
I thought(maybe wrongly) that maybe I could find a easy to use one to work.
I really like to use my tulip tree texture somewhere and some of my silk textures on lounge chairs and chaises.
I ran into some interesting programs that are called Voxel Editors.
Most were geared towards Minecraft though.
My question is there any possible use for them in Minetest?
I was thinking of experimenting with them to do new furniture and plant/tree textures.
I have lot of hand drawn textures I have made but not whole lot of skills with blender or how to put them in Voxel related worlds.
I thought(maybe wrongly) that maybe I could find a easy to use one to work.
I really like to use my tulip tree texture somewhere and some of my silk textures on lounge chairs and chaises.
Re: Post your modding questions here
Here is what is unclear yet for me?
1. How to know what tool was used inside node's on_* methods?
2. How to manipulate durability/wear bar of this tool correctly (e.g. pickaxe)?
3. How wear range 0–65535 of tools related to info in /usr/share/minetest/games/minetest/mods/default/tools.lua
For example, this is info about diamond pickaxe:
I don't know what all these parameters mean. I wish I know but I can't get details in official documentation. But from here (and from real experience) I know that I can use diamond pickaxe 810 times to break stone (stone pickaxe — 60 times respectively). So I don't see such info in tools.lua.
4. (from above) How I can manually increase wear state of some tool by 10 (for example) uses?
5. Is there event like register_on_toolwearout that run when active tool completely wear out?
P.S. Previous part of my questions about modding: How to…
1. How to know what tool was used inside node's on_* methods?
2. How to manipulate durability/wear bar of this tool correctly (e.g. pickaxe)?
3. How wear range 0–65535 of tools related to info in /usr/share/minetest/games/minetest/mods/default/tools.lua
For example, this is info about diamond pickaxe:
Code: Select all
minetest.register_tool("default:pick_diamond", {
description = "Diamond Pickaxe",
inventory_image = "default_tool_diamondpick.png",
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
groupcaps={
cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=5},
},
sound = {breaks = "default_tool_breaks"},
})
4. (from above) How I can manually increase wear state of some tool by 10 (for example) uses?
5. Is there event like register_on_toolwearout that run when active tool completely wear out?
P.S. Previous part of my questions about modding: How to…
Re: Post your modding questions here
OK, Let's answer this questions.
Then define your setting inside this file.
how it works
example
Now you can check the setting in your lua file.
First of all you have to create a "settingtypes.txt" file in your mod folder.John_Constructor wrote:Title: How do I create a setting that toggles the existence of certain nodes?
<snip>
Then define your setting inside this file.
how it works
Code: Select all
#<more_info>
<setting_name>(<description>) <type> <default>
Code: Select all
# example_setting
mymod_disable_node_mynode(disables mynode) bool true
Code: Select all
if not minetest.settings:get_bool("mymod_disable_node_mynode") then
minetest.register_node("mymod:mynode", <node definition>)
end
Can your read this?
Re: Post your modding questions here
I think you are searching for meshes or node boxes which you can define in your node definition when you are registering a node.DagonX wrote:Voxel Editor Questions
I ran into some interesting programs that are called Voxel Editors.
Most were geared towards Minecraft though.
My question is there any possible use for them in Minetest?
I was thinking of experimenting with them to do new furniture and plant/tree textures.
I have lot of hand drawn textures I have made but not whole lot of skills with blender or how to put them in Voxel related worlds.
I thought(maybe wrongly) that maybe I could find a easy to use one to work.
I really like to use my tulip tree texture somewhere and some of my silk textures on lounge chairs and chaises.
You can also use the nodebox editor.
Can your read this?
Re: Post your modding questions here
You can use "player:get_wielded_item()"Sergey wrote:Here is what is unclear yet for me?
1. How to know what tool was used inside node's on_* methods?
You can use "itemstack:get_wear()", "itemstack:set_wear(wear)" or "itemstack:add_wear(amount)"Sergey wrote: 2. How to manipulate durability/wear bar of this tool correctly (e.g. pickaxe)?
It is well explained there.Sergey wrote: 3. How wear range 0–65535 of tools related to info in /usr/share/minetest/games/minetest/mods/default
See 2.Sergey wrote: 4. (from above) How I can manually increase wear state of some tool by 10 (for example) uses?
No, you have to work around with "on_use".Sergey wrote: 5. Is there event like register_on_toolwearout that run when active tool completely wear out?
Can your read this?
- orwell
- Member
- Posts: 958
- Joined: Wed Jun 24, 2015 18:45
- GitHub: orwell96
- IRC: orwell96_mt
- In-game: orwell
- Location: Raxacoricofallapatorius
Re: Post your modding questions here
This depends on the voxel editor program you use and what it can exportDagonX wrote:Voxel Editor Questions
I ran into some interesting programs that are called Voxel Editors.
Most were geared towards Minecraft though.
My question is there any possible use for them in Minetest?
I was thinking of experimenting with them to do new furniture and plant/tree textures.
I have lot of hand drawn textures I have made but not whole lot of skills with blender or how to put them in Voxel related worlds.
I thought(maybe wrongly) that maybe I could find a easy to use one to work.
I really like to use my tulip tree texture somewhere and some of my silk textures on lounge chairs and chaises.
can you name such a program?
Re: Post your modding questions here
Thank you very muchcx384 wrote: ... [Answers to Sergey] ...
Re: Post your modding questions here
Is there any Lua debugger I can use to debug my mod step by step, line by line, looking at what data I have after each line of execution?
Please do not advice to cram my code with print or minetest.debug statements with later scrolling down huge debug.txt file hunting for necessary messages among MT stuff.
Please do not advice to cram my code with print or minetest.debug statements with later scrolling down huge debug.txt file hunting for necessary messages among MT stuff.
Re: Post your modding questions here
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.
Are you going to remove that method in future?
As for me, I find it quite useful.
- rubenwardy
- Moderator
- Posts: 6978
- 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
it runs on every single node dig, so you should use the node's dig callback if possible insteadSergey 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.
Who is online
Users browsing this forum: No registered users and 11 guests