Post your modding questions here

Locked
User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

So never? or maybe in later builds we can?
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

ch98
Member
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Post

is it possible to have a modpack within a modpack?
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.

User avatar
Likwid H-Craft
Member
Posts: 1113
Joined: Sun Jan 06, 2013 14:20
Location: Lost in Crypt

by Likwid H-Craft » Post

I think so...

Btw I found out what Likwid Stands for!

Likwid: Like I know what I doing
My Domain's/others:
http://likwidtest.hj.cx/ (Not Done)

ch98
Member
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Post

PilzAdam wrote:
Likwid H-Craft wrote:Ok I am making somewhat a useful Mod but I don't know if possible do some stuff.

1.Is it possible make a item glow when holding it, like give off light?

2.How do change the light it give off something else? E.g. Blue Green...

Ok it a Official I tell you my mod I am making a Glow Stick It texture and most of it finish but the craft and such...
Neither of your questions is possible.
Is it also possible to make player glow? It might work that way.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.

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

by PilzAdam » Post

ch98 wrote:is it possible to have a modpack within a modpack?
No.
ch98 wrote:
PilzAdam wrote:
Likwid H-Craft wrote:Ok I am making somewhat a useful Mod but I don't know if possible do some stuff.

1.Is it possible make a item glow when holding it, like give off light?

2.How do change the light it give off something else? E.g. Blue Green...

Ok it a Official I tell you my mod I am making a Glow Stick It texture and most of it finish but the craft and such...
Neither of your questions is possible.
Is it also possible to make player glow? It might work that way.
No.

kpo
Member
Posts: 38
Joined: Sun Mar 31, 2013 19:01

by kpo » Post

Franz wrote:Can anyone make a treeassist mod?
describtion: when you chop down a woodblock from a tree it will kill the complete tree and you get his items.

is it possible? :D
It is indeed possible. Take a look at the technic mod and add my chainsaw modifications to it.
http://forum.minetest.net/viewtopic.php ... 747#p86747

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

by deivan » Post

Likwid H-Craft, The walking light mod have a code similar of this description, but cause some delay when is operating...
-*-
Franz, the timber mod is doing it, and now the technic to.
Last edited by deivan on Tue Apr 30, 2013 22:11, edited 1 time in total.

User avatar
ShadowNinja
Developer
Posts: 200
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

by ShadowNinja » Post

PilzAdam wrote:
ch98 wrote:is it possible to have a modpack within a modpack?
No.
Actualy it is possible, as long as they all have a modpack.txt(I use this feature for organization).

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

It is also possible to have a mod turn into a modpack. That is how my AutoUpdater mod works.

User avatar
pandaro
Member
Posts: 327
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

I tried to do something with minetest.register_on_joinplayer:
minetest.register_on_joinplayer(function(player)
print("hello")
minetest.env:place_node(player:getpos(),{name="default:stone"})

end)
is correctly printed "hello",but the node is not placed
What's wrong?
Last edited by pandaro on Thu May 02, 2013 17:11, edited 1 time in total.
sorry for bad english
Linux debian 7 wheezy 64
kde

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

pandaro wrote:I tried to do something with minetest.register_on_joinplayer:
minetest.register_on_joinplayer(function(player)
print("hello")
minetest.env:place_node(player:getpos(),{name="default:stone"})

end)
is correctly printed "hello",but the node is not placed
What's wrong?
For some reason, there are some things you can't do from this callback (at least when playing singleplayer).
A quick workaround would be:

Code: Select all

minetest.register_on_joinplayer(function(player)
  print("hello")
  minetest.after(0.1, function()
    minetest.env:place_node(player:getpos(),{name="default:stone"})
  end)
end)
Edit: I think it may be because the player has not "emerged" yet, but not sure. See what happens if you change print("hello") to print(dump(player:getpos()))
Last edited by kaeza on Thu May 02, 2013 18:28, edited 1 time in total.
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
pandaro
Member
Posts: 327
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

kaeza thanks for your interest, I tried to call "player: GetPos ()" and the output is correct;
I tried, like you said, to call "place_node" after a bit of time but it still does not work.
Does anyone else have any ideas?
sorry for bad english
Linux debian 7 wheezy 64
kde

User avatar
BlockMen
Developer
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen
Location: Germany

by BlockMen » Post

pandaro wrote:kaeza thanks for your interest, I tried to call "player: GetPos ()" and the output is correct;
I tried, like you said, to call "place_node" after a bit of time but it still does not work.
Does anyone else have any ideas?
I dont know why, but it works if you use "set_node()" instead of "place_node()"

Code: Select all

minetest.register_on_joinplayer(function(player)
  print("hello")
  minetest.after(0.1, function()
    minetest.env:set_node(player:getpos(),{name="default:stone"})
  end)
end)

1244
Member
Posts: 45
Joined: Fri Jul 13, 2012 16:40
Location: Poland

by 1244 » Post

Can I transfer metadata between nodes? For example I have got node "a" which have metadata "x" and I have node "b" which have metadata "x". Can I transfer "x" from node "a" to node "b"?
My mods:
Barrels, Chemistry

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

Use that:

Code: Select all

function copy_meta(pos1,pos2)
    local meta1 = minetest.env:get_meta(pos1)
    local meta = meta:to_table()
    local meta2 = minetest.env:get_meta(pos2)
    meta2:from_table(meta)
end

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

by Excalibur Zero » Post

Topic: How to create mob member at block?
Reason: I want to make a mod with a block that can be used to summon an enemy, and once it does so the block destroys its self.
More Info: I've tried to do it, but I couldn't figure it out.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

How would I make a tool do two functions using on_place
Coding;
1X coding
3X debugging
12X tweaking to be just right

User avatar
Traxie21
Member
Posts: 753
Joined: Mon Dec 31, 2012 10:48
Location: McKinney, Texas U.S.A.
Contact:

by Traxie21 » Post

jojoa1997 wrote:How would I make a tool do two functions using on_place

Code: Select all

on_place = function(ARGS)
function1()

function2()
end
@ExcaliburZero: I know how, but I'm on a kindle and don't remember exactly.
Also, nice of you to read the first post and use correct formatting :3

User avatar
Casimir
Member
Posts: 1206
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

by Casimir » Post

Casimir wrote:
12Me21 wrote:no I mean like only generating one mese block in the entire map
Look at the spawn of Minetest-Black.
That's what I came up with. The chanse to generate the node is very high, so it will be generated at the start of the world (that's what I want in this case).
There is the problem that the node can be removed by cavegen. I might have to use minetest.after, but that seems ugly to me.

Code: Select all

minetest.register_on_generated(function(minp, maxp, seed)
    local file = io.open(minetest.get_worldpath().."/wcc.txt", "r")
    if file then
        return
    end
    if maxp.y >= 2 and minp.y <= 0 then
    local pr = PseudoRandom(seed+1)
        local x = pr:next(minp.x, maxp.x)
        local z = pr:next(minp.z, maxp.z)
        -- Find ground level (0...15)
        local ground_y = nil
        for y=30,0,-1 do
            if minetest.env:get_node({x=x,y=y,z=z}).name ~= "air"
            and minetest.env:get_node({x=x,y=y,z=z}).name ~= "default:leaves" 
            and minetest.env:get_node({x=x,y=y,z=z}).name ~= "default:jungleleaves" then
                ground_y = y
                break
            end
        end
    
        if ground_y then
            local p = {x=x,y=ground_y+1,z=z}
            local nn = minetest.env:get_node(p).name
            local nn_ground = minetest.env:get_node({x=x,y=ground_y,z=z}).name
            -- Check if the node can be replaced
            if minetest.registered_nodes[nn] and
            minetest.registered_nodes[nn].buildable_to and
            minetest.registered_nodes[nn_ground].walkable and
            nn_ground ~= "ignore" then
                minetest.env:set_node(p,{name="wcc:wcc"})
                local file = io.open(minetest.get_worldpath().."/wcc.txt", "w")
                file:write(minetest.pos_to_string(p))
                file:close()
                print("[wcc] !")
            end
        end
    end
end)
Last edited by Casimir on Sat May 04, 2013 21:25, edited 1 time in total.

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

by Excalibur Zero » Post

Excalibur Zero wrote:Topic: How to create mob member at block?
Reason: I want to make a mod with a block that can be used to summon an enemy, and once it does so the block destroys its self.
More Info: I've tried to do it, but I couldn't figure it out.
I figured out how to do something like I wanted, where it creates an item which creates an enemy where it would be placed. I found the code in PilzAdam's mob mod. I'll add it here so that others can find it.

Code: Select all

minetest.register_craftitem("mobs:rat", {
    description = "Rat",
    inventory_image = "mobs_rat_inventory.png",
    
    on_place = function(itemstack, placer, pointed_thing)
        if pointed_thing.above then
            minetest.env:add_entity(pointed_thing.above, "mobs:rat")
            itemstack:take_item()
        end
        return itemstack
    end,
})

User avatar
12Me21
Member
Posts: 873
Joined: Tue Mar 05, 2013 00:36
GitHub: 12Me21
Location: (Ignore all of my posts before 2018)

by 12Me21 » Post

This seems like a stupid question with an obvious answer, but how do you make it so an abm will happen if a node is next to one type of node AND another type, like having an abm happen when a dirt block is next to a stone block AND a water source?
Shoutouts to Simpleflips

User avatar
ShadowNinja
Developer
Posts: 200
Joined: Tue Jan 22, 2013 22:35
GitHub: ShadowNinja
IRC: ShadowNinja
In-game: ShadowNinja

by ShadowNinja » Post

12Me21 wrote:This seems like a stupid question with an obvious answer, but how do you make it so an abm will happen if a node is next to one type of node AND another type, like having an abm happen when a dirt block is next to a stone block AND a water source?
Use find_nodes_in_area() and check the result.

User avatar
pandaro
Member
Posts: 327
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro
Location: behind

by pandaro » Post

some questions about armor_groups:
as always I have some difficulty ...
I try to fully understand the damage system.

I tried to give a armor_groups like this:

"player: set_armor_groups ({fleshy = 1})"

this does not return any errors, GOOD, but...
if I hit the player with any sword, the player receives no damage: for the sword of wood, stone, iron, diamond. NO damage.
Then try to return the player to a level of 0 armor:

"player: set_armor_groups ({fleshy = 0})"

trying to hit him with a sword sword of wood, stone, iron, diamond get NO damage.
So I try to figure out what the armor level through:

"print (dump (player: get_armor_groups ()))"

But Minetest crashes and returns:
attempt to call method 'get_armor_groups' (a nil value)

The main question is:
how to handle armor_groups?
secondary question:
you can create alternative groups of damage? for example: phisical damage or elemental damage?

Thanks to anyone who can answer me
sorry for bad english
Linux debian 7 wheezy 64
kde

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

by deivan » Post

Is the percentage of the damage received no? Like 0 = 0% and 50 = 50%, correct?

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

by PilzAdam » Post

deivan wrote:Is the percentage of the damage received no? Like 0 = 0% and 50 = 50%, correct?
Yep.

Locked

Who is online

Users browsing this forum: No registered users and 0 guests