Post your modding questions here

User avatar
Gambit
Member
 
Posts: 452
Joined: Sat Oct 29, 2011 19:31

by Gambit » Wed Sep 11, 2013 21:55

How do I make grass cover more ground? The grass I'm talking about is the one that grows, not the grass_on_dirt kind. It's just the fields feel too flat and grass really helps make it look better but there is so little of them that spawns.
Current Projects: MineToon | PixelBOX
Gambit's Checkmate Server - 43.65.296.232 - port: 30001
 

User avatar
thefamilygrog66
Member
 
Posts: 169
Joined: Mon Jul 09, 2012 19:08

by thefamilygrog66 » Wed Sep 11, 2013 22:18

Gambit wrote:How do I make grass cover more ground? The grass I'm talking about is the one that grows, not the grass_on_dirt kind. It's just the fields feel too flat and grass really helps make it look better but there is so little of them that spawns.


Line 496 in mapgen.lua in games\minetest_game\mods\default\

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
-- Determine grass amount from perlin noise
local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 3 * 9)"


I'm not sure what to change exactly, but that's where you'd change it!
 

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

by Casimir » Thu Sep 12, 2013 16:44

thefamilygrog66 wrote:
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
-- Determine grass amount from perlin noise
local grass_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 3 * 9)"


I'm not sure what to change exactly, but that's where you'd change it!

If you want grass to be more common add +X. If you want more grass, when there is grass increase *9 to a higher value. If you want grass to be distributed more equally remove ^3.
Or, you could use the new register_decoration.

p.s. Could someone of the more experienced developers take a look at fairiestoys code?
Last edited by Casimir on Thu Sep 12, 2013 16:46, edited 1 time in total.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Fri Sep 13, 2013 00:24

does anyone know how to make a crafting table, but with different properties? I want to make an anvil to forge armor and crossbows in castles+

EDIT: When you place a chest-like item, can you make it so it already contains a set of steel tools.
Last edited by philipbenr on Fri Sep 13, 2013 00:27, edited 1 time in total.
"The Foot is down!"
 

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

by fairiestoy » Fri Sep 13, 2013 01:51

philipbenr wrote:does anyone know how to make a crafting table, but with different properties? I want to make an anvil to forge armor and crossbows in castles+

EDIT: When you place a chest-like item, can you make it so it already contains a set of steel tools.


Do you mean something like mentioned here:
The RealTest Game
( you have to scroll nearly to the end of the first post ). Maybe a look into the source of this could help you.

Edit:
To your second question. If you take the code from the default chest:
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
on_construct = function(pos)
        local meta = minetest.get_meta(pos)
        meta:set_string("formspec",default.chest_formspec)
        meta:set_string("infotext", "Chest")
        local inv = meta:get_inventory()
        inv:set_size("main", 8*4)
    end,


And insert something like inv:add_item( 'main', ItemStack ) (where ItemStack is your defined Itemstack respectively), it should work i think (untested)
Last edited by fairiestoy on Fri Sep 13, 2013 01:55, edited 1 time in total.
Interesting about new things is, to figure out how it works ...
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Fri Sep 13, 2013 02:51

fairiestoy wrote:
philipbenr wrote:does anyone know how to make a crafting table, but with different properties? I want to make an anvil to forge armor and crossbows in castles+

EDIT: When you place a chest-like item, can you make it so it already contains a set of steel tools.


Do you mean something like mentioned here:
The RealTest Game
( you have to scroll nearly to the end of the first post ). Maybe a look into the source of this could help you.

Edit:
To your second question. If you take the code from the default chest:
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
on_construct = function(pos)
        local meta = minetest.get_meta(pos)
        meta:set_string("formspec",default.chest_formspec)
        meta:set_string("infotext", "Chest")
        local inv = meta:get_inventory()
        inv:set_size("main", 8*4)
    end,


And insert something like inv:add_item( 'main', ItemStack ) (where ItemStack is your defined Itemstack respectively), it should work i think (untested)


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
19:46:34: ERROR[main]: ...opy\bin\..\games\minetest_game\mods\castle/town_item.lua:46: '=' expected near '::'
19:46:34: ERROR[main]: stack traceback:
19:46:34: ERROR[main]:     [C]: in function 'dofile'
19:46:34: ERROR[main]:     ...7 - Copy\bin\..\games\minetest_game\mods\castle\init.lua:6: in main chunk


the inv:add_item.... didn't work. That's the error I got.

------------------------------------------------------------------

The anvil, I want to have it like a crafting table except it only outputs armor, and shields, and not anything else. A hammer would be nice, but it isn't necessary.

That's the init.lua section.

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("castle:workbench",{
    description = "Workbench",
    tiles = {"castle_workbench_top.png", "default_wood.png", "castle_workbench_1.png", "castle_workbench_1.png", "castle_workbench_2.png", "castle_workbench_2.png"},
    paramtype2 = "facedir",
    paramtype = "light",
    groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2},
    drawtype = "normal",
    on_construct = function(pos)
        local meta = minetest.get_meta(pos)
        meta:set_string("formspec",
                "size[8,9]"..
                "list[current_name;main;0,1;8,4;]"..
                "list[current_player;main;0,5;8,4;]")
        meta:set_string("infotext", "Workbench")
        local inv = meta:get_inventory()
        inv:set_size("main", 8*3)
        inv::add_item( 'main', "default:steel_pickaxe" )
        inv::add_item( 'main', "default:steel_axe" )
        inv::add_item( 'main', "default:steel_shovel" )
        inv::add_item( 'main', "default:steel_sword" )
    end,
    can_dig = function(pos,player)
        local meta = minetest.get_meta(pos);
        local inv = meta:get_inventory()
        return inv:is_empty("main")
    end,
    on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
        minetest.log("action", player:get_player_name()..
                " moves stuff in workbench at "..minetest.pos_to_string(pos))
    end,
    on_metadata_inventory_put = function(pos, listname, index, stack, player)
        minetest.log("action", player:get_player_name()..
                " moves stuff to workbench at "..minetest.pos_to_string(pos))
    end,
    on_metadata_inventory_take = function(pos, listname, index, stack, player)
        minetest.log("action", player:get_player_name()..
                " takes stuff from workbench at "..minetest.pos_to_string(pos))
    end,
})

local function has_locked_chest_privilege(meta, player)
    if player:get_player_name() ~= meta:get_string("owner") then
        return false
    end
    return true
end
Last edited by philipbenr on Fri Sep 13, 2013 02:52, edited 1 time in total.
"The Foot is down!"
 

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

by fairiestoy » Fri Sep 13, 2013 12:56

You get this error, because you made a typo related mistake. You wrote
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
inv::add_item( 'main', "default:steel_sword" )
And it should be without the double ':' . And this error is not related to the modified chest code. If you take a closer look at the error 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
19:46:34: ERROR[main]: ...opy\bin\..\games\minetest_game\mods\castle/town_item.lua:46: '=' expected near '::'
) it nearly tells you what is wrong. This is how the code for the chest looks like.
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
on_construct = function(pos)
        local meta = minetest.get_meta(pos)
         meta:set_string("formspec",
                 "size[8,9]"..
                 "list[current_name;main;0,0;8,4;]"..
                 "list[current_player;main;0,5;8,4;]")
         meta:set_string("infotext", "Chest")
         local inv = meta:get_inventory()
         inv:set_size("main", 8*4)
        local IStack = ItemStack( 'default:pick_steel 1' )
        inv:add_item( 'main', IStack )
    end,


And if you didn't redefined the default tools, you should take a closer look at your itemstring. I suggest that you always keep a second file open with all default definitions you are using for quicker access. Could make development a bit easier ;).
Interesting about new things is, to figure out how it works ...
 

super_tnt
Member
 
Posts: 22
Joined: Mon Sep 02, 2013 17:56

by super_tnt » Tue Sep 17, 2013 16:57

What's a good programme for making animated entities? I looked at blender but it looks way too advanced, considering I only want to create basic objects (Made out of rectangles and lines) and also I have a limited knowledge of creating 3d objects.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Tue Sep 17, 2013 17:09

super_tnt wrote:What's a good programme for making animated entities? I looked at blender but it looks way too advanced, considering I only want to create basic objects (Made out of rectangles and lines) and also I have a limited knowledge of creating 3d objects.
It's either Blender or GTFO. There is no other option with entity mesh creation.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Tue Sep 17, 2013 17:14

super_tnt wrote:What's a good programme for making animated entities? I looked at blender but it looks way too advanced, considering I only want to create basic objects (Made out of rectangles and lines) and also I have a limited knowledge of creating 3d objects.

If you are looking for something free then I also suggest you stick with blender, there are plenty good tutorials on the net and it really is not that difficult to create simple blocky models for minetest.
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Wed Sep 18, 2013 19:51

i have a mod called worldedit and when i try to make a hollow sphere, it shuts down my server...i put "//hollowsphere 5 dirt" (minus the quotes)...am i doing anything wrong
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11

by Dan Duncombe » Wed Sep 18, 2013 20:31

Element wrote:i have a mod called worldedit and when i try to make a hollow sphere, it shuts down my server...i put "//hollowsphere 5 dirt" (minus the quotes)...am i doing anything wrong

Try:
1)
//pos1

2)
//hollowsphere 5 default:dirt
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Wed Sep 18, 2013 22:13

oh...ok thanks
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Wed Sep 18, 2013 22:31

i tried it and my server still shut it self down
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

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

by LionsDen » Thu Sep 19, 2013 01:36

There are two versions of WorldEdit. The version before 1.0 (I think it is 0.6 or so) is for Minetest versions 0.4.7 and before while version 1.0 or above is for the latest github or build of Minetest. Trying to use version 1.0 on an older version of Minetest can cause crashes I have heard. I hope this was your problem because if so it is an easy fix.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

by Wuzzy » Fri Sep 20, 2013 18:04

There is this thing called “checkbox” in the formspecs now.

However, every time I click the checkbox, the on_player_receive_fields() is called, which is not exactly what I want. I also think it’s incosistent, because if I type in text in a field, on_player_receive_fields() is not called.

What I want is to make a simple dialog with checkboxes and an “OK” button_exit. The value of the checkbox shall be read after the OK button has pressed. I don’t care about the event of the user clicking the checkbox, I just want to read the value of the checkbox after OK has been pressed. The problem is, both button_exit and checkbox send on_player_receive_fields() which messes things up for me. I can’t tell wheather the player clicked the checkbox or the button_exit.

Questions:
  • Why does on_player_receive_fields get called when the player clicks a checkbox?
  • Can I prevent Minetest from doing that?
  • Is there an alternative callback for button_exit?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

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

by fairiestoy » Fri Sep 20, 2013 18:59

Wuzzy, it is possible to determine if the button has been pressed or the checkbox. Within the fields table you also have the name of the button as index. If you now make a check like
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
if fields.exit_button then
    --ongoing code
end


Where exit_button is the name of the defined button respectively.

According to your points (afaik):
> Because its an event which could be used to change the interface. Usually its not wanted that the interface
changes on simple text input
> Not afaik, but you could use the workaround mentioned in this post

Edit:
Example use of the checkbox events is seen in the client menu. If you would check the checkbox for public serverlist but don't send a event, you would wait very long for any changes to kick in.
Last edited by fairiestoy on Fri Sep 20, 2013 19:06, edited 1 time in total.
Interesting about new things is, to figure out how it works ...
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

by Wuzzy » Sat Sep 21, 2013 21:09

Thanks this answers my question. :-)

Now for the next question:

There are methods for InvRef but I don’t get my head around the documentation. There is always this parameter called “listname” and the fact that it is written in double quotes in the wiki suggests that this must be a string.
Where does this strange “listname” come from? What name of which list? I have no idea what to put there. This is true for all InvRef methods.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sat Sep 21, 2013 23:35

Wuzzy wrote:Thanks this answers my question. :-)

Now for the next question:

There are methods for InvRef but I don’t get my head around the documentation. There is always this parameter called “listname” and the fact that it is written in double quotes in the wiki suggests that this must be a string.
Where does this strange “listname” come from? What name of which list? I have no idea what to put there. This is true for all InvRef methods.

Inventories consist of several lists, which consist of a number of slots.
Here are some exaples from the default minetest_game / engine that should explain it pretty good:

The default player has 3 lists:
"main": this is the main inventory, where the first 8 slots are displayed in the hotbar; the size is 8×4
"craft": the 3×3 crafting grid
"craftresult": the single slot for the craft result; has a special handling by the engine.

Chests only have one list, "main".

Furnaces have 3 lists:
"fuel": the single fuel slot
"src": the slot above the fuel (i.e. the item that will be cooked)
"dst": the result
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

by Wuzzy » Sun Sep 22, 2013 01:35

Thanks a lot! :)
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

kahrl
Member
 
Posts: 236
Joined: Fri Sep 02, 2011 07:51

by kahrl » Sun Sep 22, 2013 04:10

PilzAdam wrote:The default player has 3 lists:
"main": this is the main inventory, where the first 8 slots are displayed in the hotbar; the size is 8×4
"craft": the 3×3 crafting grid
"craftresult": the single slot for the craft result; has a special handling by the engine.

There is actually a fourth list, craftpreview. The special handling needs both it and craftresult.
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Sun Sep 22, 2013 18:57

is there a bed rock mod
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sun Sep 22, 2013 19:00

Element wrote:is there a bed rock mod
I'm not sure, but I could probably make one pretty easily. How far down should it be?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Topywo » Sun Sep 22, 2013 20:44

Evergreen wrote:
Element wrote:is there a bed rock mod
I'm not sure, but I could probably make one pretty easily. How far down should it be?


https://forum.minetest.net/viewtopic.php?pid=13841#p13841

It's a bit old.
 

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

by Casimir » Mon Sep 23, 2013 17:29

In the commits I read that it is possible to play a soundfile in the main menu. Is this possible per gamemode? Does it loop?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Sep 23, 2013 18:37

Casimir wrote:In the commits I read that it is possible to play a soundfile in the main menu. Is this possible per gamemode? Does it loop?

No and yes.
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Mon Sep 23, 2013 19:45

i somehow lost the mod called item_drop...does anyone know where it is
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

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

by Topywo » Mon Sep 23, 2013 21:54

Element wrote:i somehow lost the mod called item_drop...does anyone know where it is


https://forum.minetest.net/viewtopic.php?pid=35725#p35725
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Tue Sep 24, 2013 00:55

Is it possible to make a crafting table that only crafts on certain set of things. I want a castle:anvil to craft castle:armor_"item" but not like wood, because an anvil only makes metal items like armor, not trees into planks...
"The Foot is down!"
 

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

by fairiestoy » Tue Sep 24, 2013 19:51

Hey everybody,

a little question, since i couldn't find anything related to that. Is it possible to run Lua Code Ingame with the minetest namespace? Like opening a formspec, type in your code and execute it. It would increase the development of formspec design for example a bit ( at least for me ).

Greetings...
Interesting about new things is, to figure out how it works ...
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

cron