Post your modding questions here

deivan
Member
 
Posts: 452
Joined: Fri Feb 15, 2013 10:16

by deivan » Thu Aug 01, 2013 21:11

I have a small problem. How I drop a quarter block over a fluid? In the horizontal. Have a short cut or hot key to it?
 

Exilyth
Member
 
Posts: 60
Joined: Sun Jul 28, 2013 18:46

by Exilyth » Fri Aug 02, 2013 07:45

I have a node with paramtype2 = "facedir" and an abm which gets called on that node.


Why does
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 direction = minetest:facedir_to_dir(minetest.env:get_node(pos).param2)
give me an error saying the method facedir_to_dir is a nil value?


Why does
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 direction = minetest.facedir_to_dir(minetest.env:get_node(pos).param2)
give me an error saying the field facedir_to_dir is a nil value?


How are you supposed to call facedir_to_dir then?
(I'm using 0.4.7 stable btw)
I'm running 0.4.13 stable with [technic][carts][farming_plus][biome_lib][unified_inventory] and a few other mods.
 

deivan
Member
 
Posts: 452
Joined: Fri Feb 15, 2013 10:16

by deivan » Fri Aug 02, 2013 09:40

Try remove the "local" word and test again. If I remember correctly the local cause some trouble some times.
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Fri Aug 02, 2013 17:31

Here's a question, is there a command or way to change the textures on a node that has been placed into the world? For instance I have a node and I place it in the world. I then punch the node and have some lua code run but I would like to change the texture on the node. I already replace the original node with a new one but I have 8 textures to run through and I would rather not create a new node for each texture and replace each one with the new one every time. A simple command to change the texture is what I would really like. I have done searches but haven't found anything.
 

miner
New member
 
Posts: 2
Joined: Tue May 28, 2013 17:41

by miner » Fri Aug 02, 2013 17:43

I've been trying to make a server how in the world do I?
ive already made one but its not working nobody gets on is it
working? anyway plz help.
 

deivan
Member
 
Posts: 452
Joined: Fri Feb 15, 2013 10:16

by deivan » Fri Aug 02, 2013 18:22

LionsDen, I need the same thing for one or two mods but don't is possible, well, I don't know in the new version of the API. Maybe soon. :D
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Fri Aug 02, 2013 18:29

@LionsDen: nope, sorry. that is the only way ATM

@miner: this is not the place to post such questions; there are a few topics about the subject (this is the most comprehensive one).
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

bhaskar1234
New member
 
Posts: 1
Joined: Fri Aug 02, 2013 19:10

by bhaskar1234 » Fri Aug 02, 2013 19:14

Topic: How to Install Mods on Linux Ubuntu
Reason: I want to install a mod that adds mobs into Minetest
More Info: I tried to do it the way its suggested on the website but it still didn't work
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Fri Aug 02, 2013 20:18

A little performance question. Im currently using this code:
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 set_remote( name, param )
    if param == "on" then
        RC = true
    else
        RC = false
    end
    minetest.register_globalstep( rc_check )
end

function rc_check( dtime )
    -- since we dont know a possible way of removing this function from minetest.globalstep,
    -- just ignore further process
    if RC == false then
        return
    elseif RC_TIMER < RC_INTERVAL then
        -- we also dont want to spam a io command. SO just do it every 20 ticks (has maybe to be tweaked)
        RC_TIMER = RC_TIMER + 1
        return
    end
    RC_TIMER = 0
    -- check a file for any commands in it
    local mod_path = minetest.get_modpath( "timer_shutdown" )
    local rc_file = io.open( mod_path..""..package.config:sub(1,1).."rc_com"..package.config:sub(1,1).."rc_file.txt", "r")
    -- parsing part
    local index = 1
    local rccom_request = {}
    for line in rc_file:lines() do
        if line == nil then
            break
        end
        for word in string.gmatch( line, "([^ ]+)" ) do
            rccom_request[index] = word
            index = index + 1
        end
    end
    -- Structure of rc files: name reason shutdown time
    local name = rccom_request[1]
    local reason = rccom_request[2]
    local time = tonumber( rccom_request[3] )
    minetest.chat_send_all("*** "..name.." requested Shutdown for "..reason.." in "..time.."s")
    RC = false
    minetest.log( "action", name.." has initialized a remote Shutdown because of "..reason )
    INTERVAL = time
    minetest.register_globalstep( queue_shutdown )
    -- cleanup
    io.close( rc_file )
    rc_file = io.open( mod_path..""..package.config:sub(1,1).."rc_com"..package.config:sub(1,1).."rc_file.txt", "w" )
    io.close( rc_file )
end

Is it way more efficient to use the minetest.after(time, func, ...) routine? Globalstep would call my method every 0.05s (default). But with this alternative routine, its only called once but it needs performance for timing. So what would be the more efficient solution?
Last edited by fairiestoy on Fri Aug 02, 2013 20:20, edited 1 time in total.
Interesting about new things is, to figure out how it works ...
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Fri Aug 02, 2013 22:12

Hybrid Dog wrote:@LionsDen: maybe it works with /luatransform


I want the mod I'm creating to do it, not the user in a chat command. I just had to use the inefficient method of creating a bunch of nodes that are only different in texture and place each one successively using the minetest.after command. It does the job, but is not very nice looking in code esthetics.
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Fri Aug 02, 2013 22:23

bhaskar1234 wrote:Topic: How to Install Mods on Linux Ubuntu
Reason: I want to install a mod that adds mobs into Minetest
More Info: I tried to do it the way its suggested on the website but it still didn't work


What version of minetest do you use? You'll need a higher version than 0.3.x. So a 0.4..x version. Most mods work best with the git (latest) version which is not too difficult to install and compile, following this readme.txt (scroll down till -- Compiling on GNU/Linux:):

https://github.com/minetest/minetest

If you experience troubles after that, read this post from Nore:

https://forum.minetest.net/viewtopic.php?id=6450
 

Exilyth
Member
 
Posts: 60
Joined: Sun Jul 28, 2013 18:46

by Exilyth » Fri Aug 02, 2013 23:05

deivan wrote:Try remove the "local" word and test again. If I remember correctly the local cause some trouble some times.


Did that, still doesn't work.

So, the question still stands... how do you properly call facedir_to_dir?
I'm running 0.4.13 stable with [technic][carts][farming_plus][biome_lib][unified_inventory] and a few other mods.
 

deivan
Member
 
Posts: 452
Joined: Fri Feb 15, 2013 10:16

by deivan » Fri Aug 02, 2013 23:48

I found this function inside the file item.lua inside the folder minetest/builtin. You have this one?
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sat Aug 03, 2013 06:34

LionsDen wrote:
Hybrid Dog wrote:@LionsDen: maybe it works with /luatransform


I want the mod I'm creating to do it, not the user in a chat command. I just had to use the inefficient method of creating a bunch of nodes that are only different in texture and place each one successively using the minetest.after command. It does the job, but is not very nice looking in code esthetics.

That depends if you just want an animated texture, or want the node to change when interacted with (punched/right-clicked). Homedecor has some example for these. The TV is animated, while the table lamp changes when you punch it.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Sat Aug 03, 2013 07:20

kaeza wrote:That depends if you just want an animated texture, or want the node to change when interacted with (punched/right-clicked). Homedecor has some example for these. The TV is animated, while the table lamp changes when you punch it.


What I wanted was when I punched the node, it activated it. In other words, a replacement node is put there and then a sort of animated countdown timer would go. After about 8 seconds with 1 frame per second shown it would finally do the action I have planned for it. I got the action down and I can play an animated texture on a node but the animation isn't reliable. It starts at seemingly random frames. The only way I could get the animation effect I wanted was to create 8 nodes and use the minetest.after command to place each one sequentially with the final action taking place afterwards. So I require the animation to always start at frame number 1, not somewhere else because it looks ridiculous. Unfortunately, the engine doesn't seem to be able to do that so I had to code an inelegant work around kludge. It works, it's just a lot more nodes registered and a bit more code to handle.
 

Exilyth
Member
 
Posts: 60
Joined: Sun Jul 28, 2013 18:46

by Exilyth » Sat Aug 03, 2013 17:03

deivan wrote:I found this function inside the file item.lua inside the folder minetest/builtin. You have this one?



Interesting... I've got minetest.dir_to_facedir(dir) in item.lua, but not facedir_to_dir.

Edit:
Copied over the dir_to_facedir and facedir_to_dir from latest git, it works.


Edit2:
'Nother question: if static_spawnpoint is not set in minetest.conf, how large is the spawn area?
Last edited by Exilyth on Sun Aug 04, 2013 11:21, edited 1 time in total.
I'm running 0.4.13 stable with [technic][carts][farming_plus][biome_lib][unified_inventory] and a few other mods.
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Sun Aug 04, 2013 15:00

I have a little problem. The following routine seems not to work:
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
vector.distance(p1, p2) -> number

from the API doc on Github.
i always get a nil reference to this function. Did it changed to some extend? Im using the stable 0.4.7 client for server testing.
Interesting about new things is, to figure out how it works ...
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sun Aug 04, 2013 15:08

You have both the same problem: your version is too old.
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Sun Aug 04, 2013 15:24

So this is only available in the 0.4.7-3 and up builds?
Thanks for the hint
Interesting about new things is, to figure out how it works ...
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Sun Aug 04, 2013 15:28

I don't know what build, but a build less than 12 days old.
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Sun Aug 04, 2013 23:16

fairiestoy wrote:A little performance question. Im currently using this code:
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 set_remote( name, param )
    if param == "on" then
        RC = true
    else
        RC = false
    end
    minetest.register_globalstep( rc_check )
end

function rc_check( dtime )
    -- since we dont know a possible way of removing this function from minetest.globalstep,
    -- just ignore further process
    if RC == false then
        return
    elseif RC_TIMER < RC_INTERVAL then
        -- we also dont want to spam a io command. SO just do it every 20 ticks (has maybe to be tweaked)
        RC_TIMER = RC_TIMER + 1
        return
    end
    RC_TIMER = 0
    -- check a file for any commands in it
    local mod_path = minetest.get_modpath( "timer_shutdown" )
    local rc_file = io.open( mod_path..""..package.config:sub(1,1).."rc_com"..package.config:sub(1,1).."rc_file.txt", "r")
    -- parsing part
    local index = 1
    local rccom_request = {}
    for line in rc_file:lines() do
        if line == nil then
            break
        end
        for word in string.gmatch( line, "([^ ]+)" ) do
            rccom_request[index] = word
            index = index + 1
        end
    end
    -- Structure of rc files: name reason shutdown time
    local name = rccom_request[1]
    local reason = rccom_request[2]
    local time = tonumber( rccom_request[3] )
    minetest.chat_send_all("*** "..name.." requested Shutdown for "..reason.." in "..time.."s")
    RC = false
    minetest.log( "action", name.." has initialized a remote Shutdown because of "..reason )
    INTERVAL = time
    minetest.register_globalstep( queue_shutdown )
    -- cleanup
    io.close( rc_file )
    rc_file = io.open( mod_path..""..package.config:sub(1,1).."rc_com"..package.config:sub(1,1).."rc_file.txt", "w" )
    io.close( rc_file )
end

Is it way more efficient to use the minetest.after(time, func, ...) routine? Globalstep would call my method every 0.05s (default). But with this alternative routine, its only called once but it needs performance for timing. So what would be the more efficient solution?

Would be nice if someone could answer, what way would be more efficient. :3
Interesting about new things is, to figure out how it works ...
 

User avatar
PenguinDad
Member
 
Posts: 122
Joined: Wed Apr 10, 2013 16:46
GitHub: PenguinDad
IRC: PenguinDad GhostDoge
In-game: PenguinDad

by PenguinDad » Mon Aug 05, 2013 16:11

Is it possible that a node can only digged with a specific tool e.g. : [spoiler]I want to have node that you can only dig with a mithril pick.[/spoiler]
<Cyndra> Programming properly in C++ feels like putting together a jigsaw puzzle
<Cyndra> where the peices don't fit and the picture doesn't matter.
 

celeron55
Member
 
Posts: 430
Joined: Tue Apr 19, 2011 10:10

by celeron55 » Mon Aug 05, 2013 17:21

PenguinDad wrote:Is it possible that a node can only digged with a specific tool e.g. : [spoiler]I want to have node that you can only dig with a mithril pick.[/spoiler]


You should be able to do this by using an item group for the node that isn't used in other nodes and set that group to be breakable in the tool's capabilities.

I'm not aware of a sane way of doing this when the tool's definition doesn't contain a suitable group. (you can always redefine tools though)
 

User avatar
PenguinDad
Member
 
Posts: 122
Joined: Wed Apr 10, 2013 16:46
GitHub: PenguinDad
IRC: PenguinDad GhostDoge
In-game: PenguinDad

by PenguinDad » Mon Aug 05, 2013 17:56

celeron55 wrote:
PenguinDad wrote:Is it possible that a node can only digged with a specific tool e.g. : [spoiler]I want to have node that you can only dig with a mithril pick.[/spoiler]


You should be able to do this by using an item group for the node that isn't used in other nodes and set that group to be breakable in the tool's capabilities.

I'm not aware of a sane way of doing this when the tool's definition doesn't contain a suitable group. (you can always redefine tools though)

Thanks.
<Cyndra> Programming properly in C++ feels like putting together a jigsaw puzzle
<Cyndra> where the peices don't fit and the picture doesn't matter.
 

lunisol
Member
 
Posts: 18
Joined: Wed Aug 07, 2013 04:45

by lunisol » Wed Aug 07, 2013 05:03

Topic: How do I get mods to work in game?

Reason: Because I want to install some mods

More Info: I install them into the correct folder but always get the same message:

"ModError: Failed to load and run
C:\Users\CC-JAR\Desktop\games\minetest\bin\..\mods\minetest\mesecons\init.lua"

even more info: Not sure if it matters but I'm running windows 7 64-bit.
Last edited by lunisol on Wed Aug 07, 2013 05:08, edited 1 time in total.
[CENTER]Image[/CENTER]
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Wed Aug 07, 2013 05:18

lunisol wrote:Topic: How do I get mods to work in game?

Reason: Because I want to install some mods

More Info: I install them into the correct folder but always get the same message:

"ModError: Failed to load and run
C:\Users\CC-JAR\Desktop\games\minetest\bin\..\mods\minetest\mesecons\init.lua"

even more info: Not sure if it matters but I'm running windows 7 64-bit.


You have it installed in minetest\mods\minetest\mesecons when it should be in minetest\mods\mesecons instead. The mod's directory needs to be in the directory name mods unless it's a modpack and then the modpack's directory needs to be in the mods directory. Hope this doesn't confuse you too much, just make note of the apostrophes.
 

lunisol
Member
 
Posts: 18
Joined: Wed Aug 07, 2013 04:45

by lunisol » Thu Aug 08, 2013 00:52

LionsDen wrote:
lunisol wrote:Topic: How do I get mods to work in game?

Reason: Because I want to install some mods

More Info: I install them into the correct folder but always get the same message:

"ModError: Failed to load and run
C:\Users\CC-JAR\Desktop\games\minetest\bin\..\mods\minetest\mesecons\init.lua"

even more info: Not sure if it matters but I'm running windows 7 64-bit.


You have it installed in minetest\mods\minetest\mesecons when it should be in minetest\mods\mesecons instead. The mod's directory needs to be in the directory name mods unless it's a modpack and then the modpack's directory needs to be in the mods directory. Hope this doesn't confuse you too much, just make note of the apostrophes.

Ok, thanks, It's not showing that error anymore and it's loading, but it's still not working in game. I have Jeija's Mesecon mod but I can't forge mesecons from mese. I tried going into configure but it says "there is nothing here"
[CENTER]Image[/CENTER]
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Thu Aug 08, 2013 02:40

lunisol wrote:Ok, thanks, It's not showing that error anymore and it's loading, but it's still not working in game. I have Jeija's Mesecon mod but I can't forge mesecons from mese. I tried going into configure but it says "there is nothing here"


Can you type out the path where you have the init.lua file, that file and the other files and folders are. All of that should be in the folder minetest\mods\mesecons\. If it isn't, it's not recognized by the game.
 

lunisol
Member
 
Posts: 18
Joined: Wed Aug 07, 2013 04:45

by lunisol » Thu Aug 08, 2013 21:05

LionsDen wrote:
lunisol wrote:Ok, thanks, It's not showing that error anymore and it's loading, but it's still not working in game. I have Jeija's Mesecon mod but I can't forge mesecons from mese. I tried going into configure but it says "there is nothing here"


Can you type out the path where you have the init.lua file, that file and the other files and folders are. All of that should be in the folder minetest\mods\mesecons\. If it isn't, it's not recognized by the game.

all files are in C:\Users\..\minetest\mods\mesecons.

its a big pack of mods so the init.lua files are in their seperate folders in the mesecon folder.
(ex:
Minetest
|>mods
|>mesecons
|>Mesecons
Mesecons_alias
Mesecons_blinkyplant
Mesecons_button
Mesecons_commandblock
etc.. )

with the appropriate init.lua files in each of their own folders.
Last edited by lunisol on Thu Aug 08, 2013 22:47, edited 1 time in total.
[CENTER]Image[/CENTER]
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Thu Aug 08, 2013 23:06

lunisol wrote:all files are in C:\Users\..\minetest\mods\mesecons.

its a big pack of mods so the init.lua files are in their seperate folders in the mesecon folder.
(ex:
Minetest
|>mods
|>mesecons
|>Mesecons
Mesecons_alias
Mesecons_blinkyplant
Mesecons_button
Mesecons_commandblock
etc.. )

with the appropriate init.lua files in each of their own folders.


That looks right to me. Are you using a recent version of minetest? I wonder if mesecons has changes to it that requires the latest git or something. I haven't used mesecons, pipeworks or technic for a while now because my system is just too slow for all of the abms and such.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 7 guests