Post your modding questions here

Locked
deivan
Member
Posts: 452
Joined: Fri Feb 15, 2013 10:16
Location: Brazil. :D

by deivan » Post

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
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

@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

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

by bhaskar1234 » Post

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
Location: Germany

by fairiestoy » Post

A little performance question. Im currently using this code:

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: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Post

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:

viewtopic.php?id=6450

Exilyth
Member
Posts: 73
Joined: Sun Jul 28, 2013 18:46
Location: Earth

by Exilyth » Post

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
Location: Brazil. :D

by deivan » Post

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

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

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

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

by LionsDen » Post

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: 73
Joined: Sun Jul 28, 2013 18:46
Location: Earth

by Exilyth » Post

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
Location: Germany

by fairiestoy » Post

I have a little problem. The following routine seems not to work:

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
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

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

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

by fairiestoy » Post

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
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

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
Location: Germany

by fairiestoy » Post

fairiestoy wrote:A little performance question. Im currently using this code:

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

PenguinDad
Member
Posts: 122
Joined: Wed Apr 10, 2013 16:46

by PenguinDad » Post

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.

User avatar
celeron55
Administrator
Posts: 533
Joined: Tue Apr 19, 2011 10:10
GitHub: celeron55
IRC: celeron55

by celeron55 » Post

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

PenguinDad
Member
Posts: 122
Joined: Wed Apr 10, 2013 16:46

by PenguinDad » Post

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

lunisol
Member
Posts: 18
Joined: Wed Aug 07, 2013 04:45
Location: North Carolina, USA
Contact:

by lunisol » Post

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: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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
Location: North Carolina, USA
Contact:

by lunisol » Post

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: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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
Location: North Carolina, USA
Contact:

by lunisol » Post

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: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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.

Locked

Who is online

Users browsing this forum: No registered users and 9 guests