Post your modding questions here

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Mon Feb 11, 2013 18:49

A texturable sun/moon would be nice, and has been discussed before. The result of that discussion was that it would be somewhat non-trivial to do, namely because of the color-shifting that would need to be applied to the two as they rise/set.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Mon Feb 11, 2013 20:43

I can understand the other functions but not this:

on_blast = func(pos, intensity),
^ intensity: 1.0 = mid range of regular TNT
^ If defined, called when an explosion touches the node, instead of
removing the node

--how to a block NOT explode?
-how to calibrate the power of a explosion
I use TNT PilzAdam, I would like:
-a block does not explode,
-one explode if the explosion occurs at a short distance (1)
-and another block if the distance is greater, however, explodes (2 blocks away)

when I call this function what it does exactly?
where it needs to be made for it to work properly?
sorry for bad english
Linux debian 7 wheezy 64
kde
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Thu Feb 14, 2013 15:27

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 print_hello=function()
  print("hello")
end
local dtime=10.0
minetest.register_globalstep(function(dtime)
  hello()
end)


Seeking a way to update a formspec.
I will not clog up the engine by calling a function every 0.5sec or less.
Is there a way to enlarge dtime? what I posted does not seem to run.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by Casimir » Thu Feb 14, 2013 15:40

Just a guess, there might be a better solution.
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_globalstep(function(dtime)
   ifnot time then time = dtime end
   if time >= 10 then
      hello()
      time = 0
   end
   time = time + dtime
end
Last edited by Casimir on Thu Feb 14, 2013 15:43, edited 1 time in total.
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Thu Feb 14, 2013 17:35

Casimir wrote:Just a guess, there might be a better solution.
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_globalstep(function(dtime)
   ifnot time then time = dtime end
   if time >= 10 then
      hello()
      time = 0
   end
   time = time + dtime
end


it works, thanks
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by Evergreen » Fri Feb 15, 2013 02:26

I have a question about stairs and slabs. I'm making a birch tree mod, and I need to make stairs and slabs from it. Here is the code I used to add stairs and slabs:
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
stairs.register_stair_and_slab("birch", "birch:wood",
        {cracky=3},
        {"birch_wood.png"},
        "Birch Wood stair",
        "Birch Wood slab")


But I get a run error. How do I fix?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
0gb.us
Member
 
Posts: 841
Joined: Sun Sep 16, 2012 01:55

by 0gb.us » Fri Feb 15, 2013 02:29

Evergreen wrote:I have a question about stairs and slabs. I'm making a birch tree mod, and I need to make stairs and slabs from it. Here is the code I used to add stairs and slabs:
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
stairs.register_stair_and_slab("birch", "birch:wood",
        {cracky=3},
        {"birch_wood.png"},
        "Birch Wood stair",
        "Birch Wood slab")


But I get a run error. How do I fix?


The error is caused by a bug in the stable version of stairs. Copy the code in stars and change the prefix "Stairs:" to the prefix for your plugin.
 

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

by Evergreen » Fri Feb 15, 2013 12:38

0gb.us wrote:
Evergreen wrote:I have a question about stairs and slabs. I'm making a birch tree mod, and I need to make stairs and slabs from it. Here is the code I used to add stairs and slabs:
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
stairs.register_stair_and_slab("birch", "birch:wood",
        {cracky=3},
        {"birch_wood.png"},
        "Birch Wood stair",
        "Birch Wood slab")


But I get a run error. How do I fix?


The error is caused by a bug in the stable version of stairs. Copy the code in stars and change the prefix "Stairs:" to the prefix for your plugin.


Thanks 0gb.us! :D
Last edited by Evergreen on Fri Feb 15, 2013 12:38, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Fri Feb 15, 2013 13:41

Still get a ModError.

I stuck this code inside the same init.lua
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
stairs = {}

function birch.register_stair(subname, recipeitem, groups, images, description)
    minetest.register_node("stairs:stair_" .. subname, {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        is_ground_content = true,
        groups = groups,
        node_box = {
            type = "fixed",
            fixed = {
                {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
                {-0.5, 0, 0, 0.5, 0.5, 0.5},
            },
        },
    })

    minetest.register_craft({
        output = 'stairs:stair_' .. subname .. ' 4',
        recipe = {
            {recipeitem, "", ""},
            {recipeitem, recipeitem, ""},
            {recipeitem, recipeitem, recipeitem},
        },
    })

    -- Flipped recipe for the silly minecrafters
    minetest.register_craft({
        output = 'stairs:stair_' .. subname .. ' 4',
        recipe = {
            {"", "", recipeitem},
            {"", recipeitem, recipeitem},
            {recipeitem, recipeitem, recipeitem},
        },
    })
end

-- Node will be called stairs:slab_<subname>
function birch.register_slab(subname, recipeitem, groups, images, description)
    minetest.register_node("stairs:slab_" .. subname, {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        is_ground_content = true,
        groups = groups,
        node_box = {
            type = "fixed",
            fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
        },
        selection_box = {
            type = "fixed",
            fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
        },
        on_place = function(itemstack, placer, pointed_thing)
            if pointed_thing.type ~= "node" then
                return itemstack
            end

            -- If it's being placed on an another similar one, replace it with
            -- a full block
            local slabpos = nil
            local slabnode = nil
            local p0 = pointed_thing.under
            local p1 = pointed_thing.above
            local n0 = minetest.env:get_node(p0)
            if n0.name == "stairs:slab_" .. subname and
                    p0.y+1 == p1.y then
                slabpos = p0
                slabnode = n0
            end
            if slabpos then
                -- Remove the slab at slabpos
                minetest.env:remove_node(slabpos)
                -- Make a fake stack of a single item and try to place it
                local fakestack = ItemStack(recipeitem)
                pointed_thing.above = slabpos
                fakestack = minetest.item_place(fakestack, placer, pointed_thing)
                -- If the item was taken from the fake stack, decrement original
                if not fakestack or fakestack:is_empty() then
                    itemstack:take_item(1)
                -- Else put old node back
                else
                    minetest.env:set_node(slabpos, slabnode)
                end
                return itemstack
            end
           
            -- Otherwise place regularly
            return minetest.item_place(itemstack, placer, pointed_thing)
        end,
    })

    minetest.register_craft({
        output = 'stairs:slab_' .. subname .. ' 3',
        recipe = {
            {recipeitem, recipeitem, recipeitem},
        },
    })
end

-- Nodes will be called stairs:{stair,slab}_<subname>
function birch.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
    birch.register_stair(subname, recipeitem, groups, images, desc_stair)
    birch.register_slab(subname, recipeitem, groups, images, desc_slab)
end

birch.register_stair_and_slab("birch", "birch:wood",
        {snappy=2,choppy=2,oddly_breakable_by_hand=2},
        {"birch_wood.png"},
        "Birch Wood stair",
        "Birch Wood slab")

What am I doing wrong?
Last edited by Evergreen on Fri Feb 15, 2013 13:53, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Fri Feb 15, 2013 20:48

there a way(automatic) to update (refresh) an opened formspec?(without pressing buttons)
Last edited by pandaro on Fri Feb 15, 2013 20:49, edited 1 time in total.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by stu » Fri Feb 15, 2013 21:06

Is there any way to catch when a player takes a hit, either from an entity or from another player?

Something like: entity.on_punch = function(self, puncher) ... but for players.
Last edited by stu on Fri Feb 15, 2013 21:09, edited 1 time in total.
 

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

by Evergreen » Fri Feb 15, 2013 21:42

Evergreen wrote:Still get a ModError.

I stuck this code inside the same init.lua
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
stairs = {}

function birch.register_stair(subname, recipeitem, groups, images, description)
    minetest.register_node("stairs:stair_" .. subname, {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        paramtype2 = "facedir",
        is_ground_content = true,
        groups = groups,
        node_box = {
            type = "fixed",
            fixed = {
                {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
                {-0.5, 0, 0, 0.5, 0.5, 0.5},
            },
        },
    })

    minetest.register_craft({
        output = 'stairs:stair_' .. subname .. ' 4',
        recipe = {
            {recipeitem, "", ""},
            {recipeitem, recipeitem, ""},
            {recipeitem, recipeitem, recipeitem},
        },
    })

    -- Flipped recipe for the silly minecrafters
    minetest.register_craft({
        output = 'stairs:stair_' .. subname .. ' 4',
        recipe = {
            {"", "", recipeitem},
            {"", recipeitem, recipeitem},
            {recipeitem, recipeitem, recipeitem},
        },
    })
end

-- Node will be called stairs:slab_<subname>
function birch.register_slab(subname, recipeitem, groups, images, description)
    minetest.register_node("stairs:slab_" .. subname, {
        description = description,
        drawtype = "nodebox",
        tiles = images,
        paramtype = "light",
        is_ground_content = true,
        groups = groups,
        node_box = {
            type = "fixed",
            fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
        },
        selection_box = {
            type = "fixed",
            fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
        },
        on_place = function(itemstack, placer, pointed_thing)
            if pointed_thing.type ~= "node" then
                return itemstack
            end

            -- If it's being placed on an another similar one, replace it with
            -- a full block
            local slabpos = nil
            local slabnode = nil
            local p0 = pointed_thing.under
            local p1 = pointed_thing.above
            local n0 = minetest.env:get_node(p0)
            if n0.name == "stairs:slab_" .. subname and
                    p0.y+1 == p1.y then
                slabpos = p0
                slabnode = n0
            end
            if slabpos then
                -- Remove the slab at slabpos
                minetest.env:remove_node(slabpos)
                -- Make a fake stack of a single item and try to place it
                local fakestack = ItemStack(recipeitem)
                pointed_thing.above = slabpos
                fakestack = minetest.item_place(fakestack, placer, pointed_thing)
                -- If the item was taken from the fake stack, decrement original
                if not fakestack or fakestack:is_empty() then
                    itemstack:take_item(1)
                -- Else put old node back
                else
                    minetest.env:set_node(slabpos, slabnode)
                end
                return itemstack
            end
           
            -- Otherwise place regularly
            return minetest.item_place(itemstack, placer, pointed_thing)
        end,
    })

    minetest.register_craft({
        output = 'stairs:slab_' .. subname .. ' 3',
        recipe = {
            {recipeitem, recipeitem, recipeitem},
        },
    })
end

-- Nodes will be called stairs:{stair,slab}_<subname>
function birch.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
    birch.register_stair(subname, recipeitem, groups, images, desc_stair)
    birch.register_slab(subname, recipeitem, groups, images, desc_slab)
end

birch.register_stair_and_slab("birch", "birch:wood",
        {snappy=2,choppy=2,oddly_breakable_by_hand=2},
        {"birch_wood.png"},
        "Birch Wood stair",
        "Birch Wood slab")

What am I doing wrong?

Nvm, I fixed it.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Sat Feb 16, 2013 11:36

Now I have another question. Is the function math.random part of minetest?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by PilzAdam » Sat Feb 16, 2013 11:43

Evergreen wrote:Now I have another question. Is the function math.random part of minetest?

No, its part of Lua.
 

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

by Evergreen » Sat Feb 16, 2013 12:15

PilzAdam wrote:
Evergreen wrote:Now I have another question. Is the function math.random part of minetest?

No, its part of Lua.

Thanks
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Sat Feb 16, 2013 12:18

I'm getting so close to finishing my birch tree mod. PilzAdam, I used your rubber.lua from your farming mod to generate the trees, make the sapling, leaves, and sapling growth.

Here is the tree growth that seems to cause a problem when I add it to the 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
llocal generate_birch_tree = function(pos)
    node = {name = ""}
    for dy=1,4 do
        pos.y = pos.y+dy
        if minetest.env:get_node(pos).name ~= "air" then
            return
        end
        pos.y = pos.y-dy
    end
    node.name = "birch:tree"
    for dy=0,4 do
        pos.y = pos.y+dy
        minetest.env:set_node(pos, node)
        pos.y = pos.y-dy
    end
   
    node.name = "birch:leaves"
    pos.y = pos.y+3
    for dx=-2,2 do
        for dz=-2,2 do
            for dy=0,3 do
                pos.x = pos.x+dx
                pos.y = pos.y+dy
                pos.z = pos.z+dz
               
                if dx == 0 and dz == 0 and dy==3 then
                    if minetest.env:get_node(pos).name == "air" and math.random(1, 5) <= 4 then
                        minetest.env:set_node(pos, node)
                    end
                elseif dx == 0 and dz == 0 and dy==4 then
                    if minetest.env:get_node(pos).name == "air" and math.random(1, 5) <= 4 then
                        minetest.env:set_node(pos, node)
                    end
                elseif math.abs(dx) ~= 2 and math.abs(dz) ~= 2 then
                    if minetest.env:get_node(pos).name == "air" then
                        minetest.env:set_node(pos, node)
                    end
                else
                    if math.abs(dx) ~= 2 or math.abs(dz) ~= 2 then
                        if minetest.env:get_node(pos).name == "air" and math.random(1, 5) <= 4 then
                            minetest.env:set_node(pos, node)
                        end
                    end
                end
               
                pos.x = pos.x-dx
                pos.y = pos.y-dy
                pos.z = pos.z-dz
            end
        end
    end
end


I get a ModError when I add this to the code. PS. The name of the mod is birch.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sat Feb 16, 2013 12:35

Evergreen wrote:Now I have another question. Is the function math.random part of minetest?


Minetest-related functions usually start with... "minetest". 8)
Last edited by Calinou on Sat Feb 16, 2013 12:37, edited 1 time in total.
 

User avatar
0gb.us
Member
 
Posts: 841
Joined: Sun Sep 16, 2012 01:55

by 0gb.us » Sat Feb 16, 2013 14:49

Evergreen wrote:I'm getting so close to finishing my birch tree mod. PilzAdam, I used your rubber.lua from your farming mod to generate the trees, make the sapling, leaves, and sapling growth.

Here is the tree growth that seems to cause a problem when I add it to the 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
...


I get a ModError when I add this to the code. PS. The name of the mod is birch.


"a ModError" isn't very specific. What is the error?
 

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

by Evergreen » Sat Feb 16, 2013 15:04

0gb.us wrote:
Evergreen wrote:I'm getting so close to finishing my birch tree mod. PilzAdam, I used your rubber.lua from your farming mod to generate the trees, make the sapling, leaves, and sapling growth.

Here is the tree growth that seems to cause a problem when I add it to the 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
...


I get a ModError when I add this to the code. PS. The name of the mod is birch.


"a ModError" isn't very specific. What is the error?

It says, "ModError: Failed to load and run /home/.minetest/mods/minetest/birch"
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
VanessaE
Member
 
Posts: 3894
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaEzekowitz

by VanessaE » Sat Feb 16, 2013 15:59

I might point out that More Trees already has birches.
You might like some of my stuff:
Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (16-512px)
Tips (BTC): 13LdcdUFcNCFAm7HfvAXh5GHTjCnnQj6KE
 

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

by Evergreen » Sat Feb 16, 2013 16:17

VanessaE wrote:I might point out that More Trees already has birches.

I know. Everyone and their brother has told me that already.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Sat Feb 16, 2013 16:20

Whoops, nevermind, that was a stupid mistake. "llocal" XD
Last edited by Evergreen on Sat Feb 16, 2013 16:20, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Sat Feb 16, 2013 16:23

The saplings officially work!
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Sat Feb 16, 2013 16:42

The treegen is working! Now to figure out how to make them less rare...
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Sat Feb 16, 2013 17:42

I need to ask this question to PilzAdam, because he is the one who coded the tree generation.
Here is the code for the generation of birch trees.
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_generated(function(minp, maxp, blockseed)
    if math.random(1, 100) ~= 1 then
        return
    end
    local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
    local pos = minetest.env:find_node_near(tmp, maxp.x-minp.x, {"default:dirt_with_grass"})
    if pos ~= nil then
        generate_birch_tree({x=pos.x, y=pos.y+1, z=pos.z})
    end
end)

Please tell me how to make them less rare.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Evergreen » Sat Feb 16, 2013 18:25

I tried changing the random, but that didn't seem to help.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Casimir » Sat Feb 16, 2013 21:48

So, how do I get the position of an entity?
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Sat Feb 16, 2013 22:31

! attention this is wrong!

type:
self:getpos()

! attention this is wrong!
Last edited by pandaro on Sat Feb 16, 2013 22:35, edited 1 time in total.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by PilzAdam » Sat Feb 16, 2013 22:32

pandaro wrote:type:
self:getpos()

Nope, its:
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
self.object:getpos()
 

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

by Topywo » Sat Feb 16, 2013 23:51

Evergreen wrote:I tried changing the random, but that didn't seem to help.


I think you must lower the 100. Just try changing it in 1 or 2 for a quick result.

Edit: teleport to an unloaded chunk or create a new world.
Last edited by Topywo on Sun Feb 17, 2013 00:01, edited 1 time in total.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 53 guests

cron