Post your modding questions here

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Sun Feb 16, 2014 22:43

[spoiler]
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
special_tiles = {
        {
            image="anyimage.png",
            backface_culling=false,
            animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
        },
        {
            image="anyimage.png",
            backface_culling=true,
            animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
        },
    },
[/spoiler] is this right
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Mon Feb 17, 2014 12:53

my previous post was right.
new question: how do you set a "player controlled value"?
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
Novacain
Member
 
Posts: 285
Joined: Sat Aug 31, 2013 01:03

by Novacain » Mon Feb 17, 2014 19:58

So, I know it's possible, cause I've seen it done before, how can I have a .lua file load if another mod is installed? I want to add stairsplus support to one of my mods.
EXTERMINATE!!!
My Tronrealm modpack
My tronblocks mod
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Mon Feb 17, 2014 23:05

animation={type="vertical_frames", aspect_w=638, aspect_h=638, length=?
is the last one for fps or what?
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Wed Feb 19, 2014 12:17

Topic: special nodes
Question: How do I use the Sproxel *.sxl files as nodes? Which codes are in the node definition needed?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Thu Feb 20, 2014 16:07

PING?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

by LionsDen » Thu Feb 20, 2014 18:39

I don't know anything about entities. You might want to look up information about them or look at some of the mob mods.
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

by twoelk » Thu Feb 20, 2014 19:09

Krock wrote:Topic: special nodes
Question: How do I use the Sproxel *.sxl files as nodes? Which codes are in the node definition needed?


you cannot use the *.sxl file directly.

you have to use this export script. With that you get a snippet of lua code describing a nodeboxe for each single voxel. You will have to built your init.lua around that.

You may also want to study this thread with some examples.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Fri Feb 21, 2014 13:10

twoelk wrote:
Krock wrote:Topic: special nodes
Question: How do I use the Sproxel *.sxl files as nodes? Which codes are in the node definition needed?


you cannot use the *.sxl file directly.

you have to use this export script. With that you get a snippet of lua code describing a nodeboxe for each single voxel. You will have to built your init.lua around that.

You may also want to study this thread with some examples.


Thanks, I solved my problem :)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Fri Feb 21, 2014 14:07

how do you:
#make a teleporting node?
#number controlled by chat command?
#a file with block coordinates?
#a secondary lua file?
#detect node type?
#act on the outcome?
#and use the force load feature?
Last edited by DeepGaze on Fri Feb 21, 2014 14:57, edited 1 time in total.
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Fri Feb 21, 2014 21:26

#how to make a node when stepped on teleports you to the other node
#:(
# what?
#thank you
#define if the node is an air or water or other
#:(
#:(
sorry for the confusion. the only reason I am hounding this topic is:, the tutorial for modding is great but lacks depth and only shows how to make a simple wood node. not trying to be offensive
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Fri Feb 21, 2014 22:36

So minetest.forceload_block(pos) does not generate the mapbock?

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
somefunction(pos)
    print ("[loadmap] loading position ("..pos.x.." "..pos.y.." "..pos.z..")")
    minetest.forceload_block(pos)
end

minetest.register_on_generated(function(minp, maxp, seed)
    print ("[loadmap] chunk minp ("..minp.x.." "..minp.y.." "..minp.z..")")
end)

Only the first message gets printed.

(Ups, was in wrong thread.)
 

User avatar
Excalibur Zero
Member
 
Posts: 142
Joined: Tue Apr 02, 2013 19:45
GitHub: ExcaliburZero

by Excalibur Zero » Fri Feb 21, 2014 23:04

DeepGaze wrote:how do you:
#make a teleporting node?
#number controlled by chat command?
#a file with block coordinates?
#a secondary lua file?
#detect node type?
#act on the outcome?
#and use the force load feature?

For your first question you could look at this mod which has nodes that teleport you by you clicking on them. (https://github.com/rocketslime11/waveroad)
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Sat Feb 22, 2014 11:24

thank you for the resource, but i fear it has swept over my head like a proverbial albatross. I am going to return to the project idea at a later date, but if anyone wants it:
you step onto this node and it moves the player forward until the player hits an air-like node
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Sun Feb 23, 2014 04:42

Topic: Do not fully understand how to use a built-in method/function

Reason: From the name, it seems to be the method/function I require for what I am trying to do in a mod I am working on.

More Info: The method/function is "minetest.register_on_craft". However I cannot find any good information on how it is used. What I am trying to accomplish using this method/function is allow a crafting item to be used multiple times, but also have a chance of it "breaking".

Also I'm the type of person that requires an example to learn, I need to see it being used to fully understand it.

Please note that this isn't a finished product, and is still a work-in-progress and I have not tested the code.

But like I said, I couldn't find any good information on it's usage. PilzAdam gave me a small example of it being used, however it didn't use the main variable I'm looking to use, which is the "old_craft_grid".

How I currently have the code written is below in the spoiler.

[spoiler]
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_craft(function(itemstack, player, old_craft_grid, craft_inv)
    local seed = os.time()
    local recipe = minetest.get_craft_recipe(item)
    local inv = minetest.get_inventory({type="player", name=player})
    local rh = true
    if old_craft_grid = recipe('PoweredMachines:Copper_Plate') then
        math.randomseed( seed ),
        if math.random( 1, 100) < 15 then
            itemstack = 'PoweredMachines:BrokenHammer',
            inv:add_item("main", ItemStack('PoweredMachines:Copper_Plate'),
            rh = false
            return itemstack,
        end
        if rh then
            inv:add_item("main", ItemStack('PoweredMachines:Hammer'),
        end
    elseif old_craft_grid = recipe('PoweredMachines:Steal_Plate') then
        math.randomseed( seed ),
            if math.random( 1, 100) < 15 then
                itemstack = 'PoweredMachines:BrokenHammer',
                inv:add_item("main", ItemStack('PoweredMachines:Steal_Plate'),
                rh = false
                return itemstack,
            end
        if rh then
            inv:add_item("main", ItemStack('PoweredMachines:Hammer'),
        end
    end
end
end)
[/spoiler]
 

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

by Nore » Sun Feb 23, 2014 06:57

You can't do "if old_craft_grid = ", it will never work. What you need to do is to test each of the items in the craft grid to check it has the correct name. See an example about how to use it here: https://gist.github.com/Novatux/7179966
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Sun Feb 23, 2014 14:12

Somehow I get doubled nodes, but I try to modify the clone of the 1st node:
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("extranodes:unlocked_sign", minetest.registered_nodes["default:sign_wall"])
minetest.registered_nodes["extranodes:unlocked_sign"].description = "Unlocked sign"
minetest.registered_nodes["extranodes:unlocked_sign"].drop = "extranodes:unlocked_sign"

minetest.register_craft({
    output = 'extranodes:unlocked_sign 4',
    recipe = {
        {'default:wood','default:wood','default:wood'},
        {'default:wood','default:wood','default:stick'},
        {'','default:stick',''}
    }
})
...
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Sun Feb 23, 2014 17:51

Nore wrote:You can't do "if old_craft_grid = ", it will never work. What you need to do is to test each of the items in the craft grid to check it has the correct name. See an example about how to use it here: https://gist.github.com/Novatux/7179966


Ah, okays. Thanks :D that helps a lot.
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Wed Feb 26, 2014 01:48

(sorry for re-asking)
a value controlled by a chat command?
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
LandMine
Member
 
Posts: 310
Joined: Tue May 01, 2012 16:44

by LandMine » Wed Feb 26, 2014 02:18

Is there an easy way to do the following......a mod that would allow a list to be displayed with the name of the players and the time they have been ALIVE? ............... for example a player spawns and the timer begins, then after lets say 10 min player dies, the timer goes back to 0:00 but the rest of the players timers remain normal, and the time SHOULD NOT reset when a player logs out that is if "BOB" has been 0:30 min alive and logs out, and comes back in his timer remains at 0:30 and continues.....

Also a kill counter, for example "BOB" kills "JOE" so on the list bob has a Kill: 1, which will continue to increase if bob kills more players and will go back to 0 if someone kills bob

So just to have an idea it would something like this:

NAME TIME ALIVE KILLS
Bob 01:30 5
James 00:23 1
Joe 00:02 0
Etc 00:01 0

So it would be from highest to lowest depending on ALIVE TIME. Please advice me on a way thanks in advanced
List Of My Creative Servers - http://planetminetest.com
The Walls - PvP Map - http://minetest.net/forum/viewtopic.php?id=2906
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Wed Feb 26, 2014 05:16

LandMine wrote:Is there an easy way to do the following......a mod that would allow a list to be displayed with the name of the players and the time they have been ALIVE?

The stats mod may either do that already or be adjustable.

Finding out who/what killed a player is currently impossible to my knowledge. That would be great to have for logging (=to know which players to get rid off) and for better messages.
A list of my mods can be found here.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Wed Feb 26, 2014 12:18

DeepGaze wrote:(sorry for re-asking)
a value controlled by a chat command?


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
myPublicCon_trolled_Value = ""
minetest.register_chatcommand("setval", {
    params = "<variable_value>",
    description = "Con-trolls a value",
    privs = {interact=true},
    func = function(name, param)
        myPublicCon_trolled_Value = param
        minetest.chat_send_all(name.." sets the value to "..param)
    end,
})


EDIT: added BB-code code tags
Last edited by Krock on Wed Feb 26, 2014 12:18, edited 1 time in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

by DeepGaze » Wed Feb 26, 2014 14:34

thank you
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
LandMine
Member
 
Posts: 310
Joined: Tue May 01, 2012 16:44

by LandMine » Wed Feb 26, 2014 15:05

Sokomine wrote:
LandMine wrote:Is there an easy way to do the following......a mod that would allow a list to be displayed with the name of the players and the time they have been ALIVE?

The stats mod may either do that already or be adjustable.

Finding out who/what killed a player is currently impossible to my knowledge. That would be great to have for logging (=to know which players to get rid off) and for better messages.


thank you sokomine i will look at the code and see what can be done, and i dont want to know who killed who, just how many people they have killed which would be great, thanks sokomine
List Of My Creative Servers - http://planetminetest.com
The Walls - PvP Map - http://minetest.net/forum/viewtopic.php?id=2906
 

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

by RHR » Wed Feb 26, 2014 16:35

How can I replace the inventory formspec with an image file?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Wed Feb 26, 2014 19:49

RHR wrote:How can I replace the inventory formspec with an image file?

player:set_inventory_formspec("image goes here")


*BUMP for https://forum.minetest.net/viewtopic.php?pid=130675#p130675*
Last edited by Krock on Wed Feb 26, 2014 19:49, edited 1 time in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

cypher-neo
Member
 
Posts: 46
Joined: Wed Oct 17, 2012 12:15

by cypher-neo » Thu Feb 27, 2014 16:04

Quick question.
I made a modpack a while ago, but it no longer works with the current game. After doing some investigation on the problem, I realized that modpacks need to have a modpack.txt in the folder somewhere (based on https://forum.minetest.net/viewtopic.php?id=6450 )
I've tried downloading some modpacks to get examples of what info needs to go in modpack.txt, but none of the modpacks I download have this (and no modpacks I've downloaded work!)

Can someone explain to me make a modpack, how to create a modpack.txt, and give an example of the content that needs to go in that file?

Edit: Forgot to include my specs.
Using Minetest 0.4.9
Last edited by cypher-neo on Thu Feb 27, 2014 16:10, edited 1 time in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Thu Feb 27, 2014 16:30

@post abrove:
step by step:
create folder "[modpack_name_goes_here]" in the mods folder
open the folder
create an empty "modpack.txt" file
:loopstart
create folder "[mod_name_goes_here]" into your modpack folder
open the folder
make a mod into that folder
leave the folder
goto loopstart
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33

by hoodedice » Fri Feb 28, 2014 11:33

I'm expressing this as a general programming problem, but it is very related to minetest modding. I'm writing the program in some sort of pseudocode:

function:on_call(dtime)
local timer = 0
minetest.register_globalstep(function(dtime)
timer = dtime+timer
if timer < 0.10 then
run code
timer = 0
end
end
---------------------------------------------------------------------------

What happens is - Since the dtime function is nested within another dtime, it gets called every dtime. I need a part of the 'run code' to stop running after timer > 0.10
I cannot move the 'run code' anywhere else. It needs to stay within that on_call function
Last edited by hoodedice on Fri Feb 28, 2014 11:39, edited 1 time in total.
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Fri Feb 28, 2014 11:46

hoodedice wrote:I need a part of the 'run code' to stop running after timer > 0.10
I cannot move the 'run code' anywhere else. It needs to stay within that on_call function

How about this?
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 ttime = 0
local called_ttime = false
function:on_call(ntime)
      called_ttime = true
      ttime = ntime
end

minetest.register_globalstep(function(dtime)
      ttime = dtime+ttime
      if(ttime > 0.10) then --every 0.1 second, IF SERVER IS ENOUGH FAST
            ttime = 0
            if(called_ttime) then
                  called_ttime = false
                  run code
            end
      end
end
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron