Post your modding questions here

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: Post your modding questions here

by hajo » Fri Nov 11, 2016 19:24

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?

See Blender, and the wiki about Using blender.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

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

Re: Post your modding questions here

by pithy » Fri Nov 11, 2016 20:53

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: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Fri Nov 11, 2016 21:09

@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: 471
Joined: Tue Jun 16, 2015 16:23
GitHub: Amadin

Re: Post your modding questions here

by amadin » Sat Nov 12, 2016 09:14

Hi all. I have bottle similar bucket
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
minetest.override_item("vessels:glass_bottle", {
   on_use = function(itemstack, user, pointed_thing)

and i have cauldron to collect water in a bottle
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
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: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Sat Nov 12, 2016 15:01

@amadin: You could put everything in the on use of the glass bottle.
Use
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 pos = minetest.get_pointed_thing_position(pointed_thing, above)
to get the location of the node.
 

User avatar
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Sat Nov 12, 2016 15:47

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.
I am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Sat Nov 12, 2016 15:52

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: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Sat Nov 12, 2016 16:18

@ 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: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Sun Nov 13, 2016 01:29

@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
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Sun Nov 13, 2016 04:18

@ 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 181 times
I am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

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

Re: Post your modding questions here

by pithy » Sun Nov 13, 2016 04:38

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

User avatar
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Sun Nov 13, 2016 06:03

@pithy well then that's no help |:|
I am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

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

Re: Post your modding questions here

by RHR » Sun Nov 13, 2016 10:19

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
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Sun Nov 13, 2016 19:10

@GreenDimond: did you make the model or someone else?
uv map
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
GreenDimond
Member
 
Posts: 460
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: Post your modding questions here

by GreenDimond » Mon Nov 14, 2016 15:47

@RHR: OMG thats AMAZING! Ima try that!
@DS-minetest: I made that :D
I am Green. I tend to binge-post. "All of this over a 16x16 representation of a cartoon cat ?!?! what has this world come to..." -TenPlus1, 2017.
Diz mah mods! :D ↑ github.com/minetest/minetest_game/issues/1647#issuecomment-288134572 ↑
Sand Plus - Tac Nayn - Waffles - Coming Soon: Caverealms Plus
 

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

Re: Post your modding questions here

by ph8jPf9M » Thu Nov 17, 2016 19:18

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

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
minetest.register_on_joinplayer(function(player)
   minetest.chat_send_all("Welcome1.")
end)
 

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

Re: Post your modding questions here

by pithy » Thu Nov 17, 2016 19:40

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?

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
minetest.register_on_joinplayer(function(player)
   minetest.chat_send_all("Welcome1.")
end)

First you would make a table with the welcome messages.
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 messages = {
    "welcome1",
    "welcome2",
    "welcome3",
    "welcome4",
    "welcome5",
    "welcome6"
}

Then use...
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
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: 70
Joined: Sat Jul 16, 2016 10:29
GitHub: 22i

Re: Post your modding questions here

by ph8jPf9M » Thu Nov 17, 2016 20:01

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

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Fri Nov 18, 2016 17:06

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: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Fri Nov 18, 2016 23:36

@ph8jPf9M: Do you really want to send the message to all players.
You could just send it to the player that joins.
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
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)
 

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

by Hybrid Dog » Sun Nov 20, 2016 10:59

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

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

by lordfingle » Wed Nov 23, 2016 10:23

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 6911 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
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Wed Nov 23, 2016 14:56

look into nodes.lua, what leaves or glass use as group
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
pithy
Member
 
Posts: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Wed Nov 23, 2016 16:10

@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: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Wed Nov 23, 2016 20:48

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?

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
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: 252
Joined: Wed Apr 13, 2016 17:34
GitHub: pithydon

Re: Post your modding questions here

by pithy » Wed Nov 23, 2016 23:54

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

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Thu Nov 24, 2016 07:11

Instead of using g() you can just write
var = minetest.setting_get(value) or default
Much shorter than defining g().
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
firefox
Member
 
Posts: 1185
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox

Re: Post your modding questions here

by firefox » Thu Nov 24, 2016 13:10

license question:

if i use a mod or parts of a mod in my subgame,
but i edit/change the mod content, what do i write into the "license.txt"?
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Thu Nov 24, 2016 15:04

pithy wrote:@DS-minetest: Your signature uses the word too. I do not think it means what you think it means.

is it better now?
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
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Thu Nov 24, 2016 17:53

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

So settingtypes.txt isn’t for games only but mods can use it, too? But I guess with this I still have to make sure to use some kind of validation of the used configuration option actually exists in minetest.conf, right?

orwell wrote:Instead of using g() you can just write
var = minetest.setting_get(value) or default
Much shorter than defining g().

Currently it isn't for better flexibility but g() could be extended to automatically prefix the option. Writing local var = g('parameter', 'default') to me is much shorter than writing local var = minetest.setting_get('my_cool_mod_pefix_parameter') or 'default'

Of course it makes no sense to use a function when only requesting one or two parameters. But I use this function in my entire mod pack and all of the possible values are configurable through options.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron