Post your modding questions here

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

GreenDimond wrote:
DS-minetest wrote:
GreenDimond wrote:How do I apply textures to an OBJ model?
with an uv map in the model?!
Ehm....wha?
I'm going to guess that you got an obj from someone and you want to apply a texture to it in minetest.
Minetest does not read obj textures instead it uses the texture data from the node def or entity def.
If you have added the texture data properly to the node def or entity def and there is still no texture then there is probably no uv map in the obj.
You could ask someone to add a uv map to the obj or learn Blender.

User avatar
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

by orwell » Post

@GreenDimond: Which software are you using for modeling?
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

amadin
Member
Posts: 549
Joined: Tue Jun 16, 2015 16:23

Re: Post your modding questions here

by amadin » Post

Hi all. I have bottle similar bucket

Code: Select all

minetest.override_item("vessels:glass_bottle", {
	on_use = function(itemstack, user, pointed_thing)
and i have cauldron to collect water in a bottle

Code: Select all

minetest.register_node("lottpotion:cauldron_full",{
        on_punch = function(pos, node, player)
        local player_inv = player:get_inventory()
        local itemstack = player:get_wielded_item()
        if itemstack:get_name() == "vessels:glass_bottle" then
But on_punch for cauldron not work until i not remove on_use for bottle, but i need to draw water into the bottle left mouse button as the bucket. Is any way force to draw water from sea in the bottle and to draw water from cauldron in the bottle with the left mouse button?

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

@amadin: You could put everything in the on use of the glass bottle.
Use

Code: Select all

 local pos = minetest.get_pointed_thing_position(pointed_thing, above) 
to get the location of the node.

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: Post your modding questions here

by GreenXenith » Post

I am using VoxelShop, but I also have Blender...I just don't want to use blender. VoxelShop is a heck of a lot easier to use. VoxelShop includes a texture.png for each model, but idk if that is any help...
This is the VoxelShop Minetest Forum post
I know that Minetest DOES use .obj models, because .x is for meshes for entities, and almost every mod that has custom models uses .obj.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
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

by orwell » Post

I use b3d models...
I don't know how voxelshop works, maybe you ask there how to unwrap the model, if that's even needed.
Ask in the voxelshop thread.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
RHR
Member
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Post

@ GreenDimond you need an UV map to be able to add textures on your 3D model.
https://en.wikipedia.org/wiki/UV_mapping

I don't know how you create an UV map in Voxelshop or if this program even allows to create one, but you could export your model as an obj there, then import it into blender and create the UV map there.

EDIT: btw could you upload this obj and texture file you created in voxelshop? It would make it easier for us to find the problem. :)

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

@GreenDimond: Nodeboxes can do almost everything a voxel editor can do and you don't have to bother with uv maps.
To make a node box you can use any text editor or the graphical Node Box Editor.
I prefer the text editor method. Standard us keyboard is enough buttons for me.

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: Post your modding questions here

by GreenXenith » Post

@ pithy: I was hopping that I could apply a texture easily without having to type out how the texture is supposed to form...I don't even know how to do that :P
@ RHR: Zip file with model and texture is attached. When importing to Blender, yes the model shows up, but idk how to apply the texture from voxelshop and create a UV map with it and apply that UV map to the model. I am not that great a modder yet btw.
Attachments
model.zip
(4.87 KiB) Downloaded 62 times
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

@GreenDimond: That model already has a usable uv map. The strangest uv map I have ever seen :P

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: Post your modding questions here

by GreenXenith » Post

@pithy well then that's no help |:|
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
RHR
Member
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Post

I created a little tutorial how you can attach the texture to your model in blender. I also attached a small mod with it. :)

Image

User avatar
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

by Desour » Post

@GreenDimond: did you make the model or someone else?
uv map
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: Post your modding questions here

by GreenXenith » Post

@RHR: OMG thats AMAZING! Ima try that!
@DS-minetest: I made that :D
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

ph8jPf9M
Member
Posts: 77
Joined: Sat Jul 16, 2016 10:29
GitHub: 22i

Re: Post your modding questions here

by ph8jPf9M » Post

i want to make it so that each time you join the game you get a random welcome message. How can this be done?

Code: Select all

minetest.register_on_joinplayer(function(player)
	minetest.chat_send_all("Welcome1.")
end)

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

ph8jPf9M wrote:i want to make it so that each time you join the game you get a random welcome message. How can this be done?

Code: Select all

minetest.register_on_joinplayer(function(player)
	minetest.chat_send_all("Welcome1.")
end)
First you would make a table with the welcome messages.

Code: Select all

local messages = {
    "welcome1",
    "welcome2",
    "welcome3",
    "welcome4",
    "welcome5",
    "welcome6"
}
Then use...

Code: Select all

minetest.register_on_joinplayer(function(player)
    local num = math.random(6) -- set number to number of messages.
    minetest.chat_send_all(messages[num])
end)

ph8jPf9M
Member
Posts: 77
Joined: Sat Jul 16, 2016 10:29
GitHub: 22i

Re: Post your modding questions here

by ph8jPf9M » Post

it works! is it posible to change the text color, boldness and such?

User avatar
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

by orwell » Post

Text color: minetest.colorize() (see lua_api.txt)
Bold: currently impossible.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

@ph8jPf9M: Do you really want to send the message to all players.
You could just send it to the player that joins.

Code: Select all

minetest.register_on_joinplayer(function(player)
    local num = math.random(6) -- set number to number of messages.
    minetest.chat_send_player(player:get_player_name(), messages[num])
end)

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

You can also set background colour l think.

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

User avatar
lordfingle
Member
Posts: 65
Joined: Sat Apr 04, 2015 09:21
GitHub: eidy
IRC: lordfingle
In-game: lordfingle
Location: Australia
Contact:

How do I create a see-through block that isn't glass?

by lordfingle » Post

Image

Topic: How to I make a block see-through without seeing through the world?
Reason: I want to make a 3d printer in world....
More Info: I've tried a few drawtypes but I'm not getting anywhere.
Attachments
screenshot_20161123_181925.png
screenshot_20161123_181925.png (287.78 KiB) Viewed 1013 times
----------------------------------------------------------------------------------------------
Team Lead on "eidy- Love learning"
I like reading, walks on the beach and building edutech experiences in lua (Find out more in this post)
"Coming together is a beginning; keeping together is progress; working together is success." - Henry Ford

User avatar
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

by Desour » Post

look into nodes.lua, what leaves or glass use as group
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

@lordfingle: I would use drawtype allfaces for that.
@DS-minetest: Your signature uses the word too. I do not think it means what you think it means.

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Post your modding questions here

by Linuxdirk » Post

With the nice “new” configuration UI with the human-readable and technical namens and the categories and the descriptions … is it possible for mods to add their own categories, human-readable namens and descriptions? If yes: can anyone link me a source? If no: why not and (when) will it be implemented?

And a second question. When I created the following helper function what the function does was not possible. Is there a built-in function that achieves the exact same thing as this function?

Code: Select all

function g(value, default)
    local v = minetest.setting_get(value)
    return (v == nil and default or v)
end
I leave it unexplained so only people who are able to understand the code can answer on this (because I want technical answers on this *g*) :)

User avatar
pithy
Member
Posts: 251
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Post

@Linuxdirk: To add a setting to the configuration UI see settingtypes.txt in lua_api.txt.

Here is an example settingtypes.txt.

In your mod you would not read what the default setting is, instead you would hardcode null to equal the default setting.

Locked

Who is online

Users browsing this forum: No registered users and 12 guests