Post your modding questions here

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

by Evergreen » Wed Oct 16, 2013 11:45

general3214 wrote:
Evergreen wrote:
derpswa99 wrote:how do you use the range for tools thing

Just put this into the tool definition. (replace 10 with whatever range you want)
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
range = 10,

Do you know the normal value for the range?
I don't know what it is exactly, but it is probably either 4 or 5.

EDIT: I asked on IRC, and it's 4.0
Last edited by Evergreen on Wed Oct 16, 2013 11:48, 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
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25

by fairiestoy » Wed Oct 16, 2013 16:54

Chinchow wrote:I've encountered a new error, if I put 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
for c=1,2,3,4,5,6,7,8 do

I get "do expected near ,"

If I put 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
for c=1,8 do

I get "attempt to concatenate global 'c' a nil value"
Any fixes?


First error you should look at the implementation of the for [..] do statement in the lua docs:
Lua Docs wrote:stat ::= for Name `=´ exp `,´ exp [`,´ exp] do block end

Therefore only three control expressions are allowed. Your error code tries to tell you, that after the third value he found a ',' where the interpreter expected a do to be since thats how the syntax should look like.

Your second code should work since i quick tried exactly
that in an interactive lua session. Are you sure to not made any use of c anywhere else? Try naming it different maybe.
Interesting about new things is, to figure out how it works ...
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Wed Oct 16, 2013 19:05

Thanks for the assistance I was looking at lua today and realized the first error's problem
As for the second one I have used it in the group name : plants_wheat=..i
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Thu Oct 17, 2013 01:45

Is it possible to stop an abm after a certain amount of time?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

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

by fairiestoy » Fri Oct 18, 2013 16:05

Afaik thats not possible.
I don't know what you want to code, even though you mentioned something about plants. Anyway, is it necessary in your code to use an ABM? If not, and you need a timer that can be turned off whenever needed, try NodeTimers.
Last edited by fairiestoy on Fri Oct 18, 2013 16:07, edited 1 time in total.
Interesting about new things is, to figure out how it works ...
 

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

by Element » Fri Oct 18, 2013 22:06

are there any sonic mods
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 » Fri Oct 18, 2013 22:27

Element wrote:are there any sonic mods
None that I know of.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
general3214
Member
 
Posts: 118
Joined: Fri Oct 04, 2013 03:15

by general3214 » Sun Oct 20, 2013 00:17

Is it possible to remove a node/item? For example, I'm making a food mod that has bananas, but PilzAdam's farming_plus mod has them too. The only thing I could do was to redefine his bananas:
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(":farming_plus:banana", {
    description = "banana",
    groups = {not_in_creative_inventory=1}
})

And after that, I tried minetest.register_alias, but all I got with "/giveme farming_plus:banana" in Minetest was an unknown node. In my code, I registered the alias after redefining Adam's bananas:
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(":farming_plus:banana", {
    description = "banana",
    groups = {not_in_creative_inventory=1}
})

minetest.register_alias("farming_plus:banana", "fruits:banana")
Last edited by general3214 on Sun Oct 20, 2013 00:24, edited 1 time in total.
March 6, 2014, 8:37 PM PST: I will no longer continue my mods.
Mods | GitHub | MCF
Avatar made by Annahstas
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sun Oct 20, 2013 01:03

general3214 wrote:Is it possible to remove a node/item? For example, I'm making a food mod that has bananas, but PilzAdam's farming_plus mod has them too. The only thing I could do was to redefine his bananas:
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(":farming_plus:banana", {
    description = "banana",
    groups = {not_in_creative_inventory=1}
})

And after that, I tried minetest.register_alias, but all I got with "/giveme farming_plus:banana" in Minetest was an unknown node. In my code, I registered the alias after redefining Adam's bananas:
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(":farming_plus:banana", {
    description = "banana",
    groups = {not_in_creative_inventory=1}
})

minetest.register_alias("farming_plus:banana", "fruits:banana")

Redefining an item should not cause any problems with recipes, unless you use a different name for the item (in which case it would need support form all other mods that need bananas).

Do not register any alias for your item.

Also, it's better to "copy" the original node definition and modify it instead of creating it from scratch. See this thread for more info.

The homedecor mod also has some code that uses this approach to override fences to be able to attach signs to them.

Edit: typo.
Last edited by kaeza on Sun Oct 20, 2013 01:04, 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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

Gronx
Member
 
Posts: 10
Joined: Fri Oct 11, 2013 14:09

by Gronx » Mon Oct 21, 2013 12:12

Is it possible to have a node with a custom right-click gui. What I want is a user editable string with two buttons (save and cancel). Is there a mod with a working example of something similar?
 

User avatar
xyz
Member
 
Posts: 449
Joined: Thu Nov 10, 2011 14:25

by xyz » Mon Oct 21, 2013 18:15

Gronx wrote:Is it possible to have a node with a custom right-click gui. What I want is a user editable string with two buttons (save and cancel). Is there a mod with a working example of something similar?

Yes, you'll need formspec. This is how default signs are implemented. http://dev.minetest.net/formspec
 

Gronx
Member
 
Posts: 10
Joined: Fri Oct 11, 2013 14:09

by Gronx » Mon Oct 21, 2013 22:17

Exactly what I needed. Cheers :-)
 

wcwyes
Member
 
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Tue Oct 22, 2013 03:04

any idea how to make /spawn not kill you?
 

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

by Evergreen » Tue Oct 22, 2013 11:43

wcwyes wrote:any idea how to make /spawn not kill you?
Pfft, that's easy. Ever played on redcrab's server? /spawn just teleports you, no need for dying here.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

wcwyes
Member
 
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Wed Oct 23, 2013 00:36

didn't see it in public. Do you know if he has a downloadable copy or how to immatate it?, I haven't even been able to figure out where /spawn is referenced.
Evergreen wrote:
wcwyes wrote:any idea how to make /spawn not kill you?
Pfft, that's easy. Ever played on redcrab's server? /spawn just teleports you, no need for dying here.
 

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

by Evergreen » Wed Oct 23, 2013 00:52

wcwyes wrote:didn't see it in public. Do you know if he has a downloadable copy or how to immatate it?, I haven't even been able to figure out where /spawn is referenced.
Evergreen wrote:
wcwyes wrote:any idea how to make /spawn not kill you?
Pfft, that's easy. Ever played on redcrab's server? /spawn just teleports you, no need for dying here.
I don't think he does, but it shouldn't be too hard to make.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

wcwyes
Member
 
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Wed Oct 23, 2013 03:35

It would be easier if I knew where to find the register.chat_command for it, Any idea where I could find it
Evergreen wrote:
wcwyes wrote:didn't see it in public. Do you know if he has a downloadable copy or how to immatate it?, I haven't even been able to figure out where /spawn is referenced.
Evergreen wrote:Pfft, that's easy. Ever played on redcrab's server? /spawn just teleports you, no need for dying here.
I don't think he does, but it shouldn't be too hard to make.
Last edited by wcwyes on Wed Oct 23, 2013 17:47, edited 1 time in total.
 

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

by Element » Wed Oct 23, 2013 10:56

will anyone help me with the bedrock mod
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

leetelate
Member
 
Posts: 205
Joined: Thu Aug 29, 2013 18:07

by leetelate » Wed Oct 23, 2013 22:50

Element wrote:will anyone help me with the bedrock mod


um, what do you need help with?
MT IS MC'S SMARTER BROTHER
minetest 0.4.8 compiled from latest git on linux mint 15 with qjoypad and wired 360 controller
freeminer, pilztest, buildcraft and next are the idea factories
my minetest page is http://1337318.zymichost.com if zymic isn't down - meh, it is free...
 

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

by Element » Wed Oct 23, 2013 22:56

i have this bedrock mod and i cant build or destroy anything at or under the bedrock layer, there is a message that pops up saying, the area is protected
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

leetelate
Member
 
Posts: 205
Joined: Thu Aug 29, 2013 18:07

by leetelate » Wed Oct 23, 2013 23:03

is this running on a server? singleplayer, what? - standard tech support question: did it ever work? if so, what is the level at which it doesn't work now?
MT IS MC'S SMARTER BROTHER
minetest 0.4.8 compiled from latest git on linux mint 15 with qjoypad and wired 360 controller
freeminer, pilztest, buildcraft and next are the idea factories
my minetest page is http://1337318.zymichost.com if zymic isn't down - meh, it is free...
 

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

by Element » Wed Oct 23, 2013 23:12

its on a single player server and the layer is only -1000 nodes deep
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

leetelate
Member
 
Posts: 205
Joined: Thu Aug 29, 2013 18:07

by leetelate » Wed Oct 23, 2013 23:44

SOLVED in the mod post - simple hax would be to...unconfigure the mod, do your stuff, reconfigure the mod...you may have to wade throogh a bunch of 'unknown nodes', but it would (most probably) work.
Last edited by leetelate on Wed Oct 23, 2013 23:46, edited 1 time in total.
MT IS MC'S SMARTER BROTHER
minetest 0.4.8 compiled from latest git on linux mint 15 with qjoypad and wired 360 controller
freeminer, pilztest, buildcraft and next are the idea factories
my minetest page is http://1337318.zymichost.com if zymic isn't down - meh, it is free...
 

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

by Element » Wed Oct 23, 2013 23:47

as my post in the forum, my tnt can still blow up the bedrock
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

wcwyes
Member
 
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Thu Oct 24, 2013 00:40

where is the register chat command spawn?
 

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

by Topywo » Thu Oct 24, 2013 09:19

wcwyes wrote:where is the register chat command spawn?


Under:
minetest/builtin/chatcommands.lua

(search for spawn)

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_chatcommand("spawnentity", {
    params = "<entityname>",
    description = "spawn entity at your position",
    privs = {give=true, interact=true},
    func = function(name, param)
        local entityname = string.match(param, "(.+)$")
        if not entityname then
            minetest.chat_send_player(name, "entityname required")
            return
        end
        print('/spawnentity invoked, entityname="'..entityname..'"')
        local player = minetest.get_player_by_name(name)
        if player == nil then
            print("Unable to spawn entity, player is nil")
            return true -- Handled chat message
        end
        local p = player:getpos()
        p.y = p.y + 1
        minetest.add_entity(p, entityname)
        minetest.chat_send_player(name, '"'..entityname
                ..'" spawned.');
    end,
})
 

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

by Element » Thu Oct 24, 2013 20:22

how do i put a folder in a reply box
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

User avatar
Chinchow
Member
 
Posts: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Thu Oct 24, 2013 21:24

Does anyone know how to set up schematics?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

wcwyes
Member
 
Posts: 145
Joined: Wed Jul 31, 2013 22:42

by wcwyes » Fri Oct 25, 2013 03:26

It appears that chatcommands.lua only has /spawnentity, I'm looking for /spawn it should look 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
minetest.register_chatcommand("spawn"
Topywo wrote:
wcwyes wrote:where is the register chat command spawn?


Under:
minetest/builtin/chatcommands.lua

(search for spawn)

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_chatcommand("spawnentity", {
    params = "<entityname>",
    description = "spawn entity at your position",
    privs = {give=true, interact=true},
    func = function(name, param)
        local entityname = string.match(param, "(.+)$")
        if not entityname then
            minetest.chat_send_player(name, "entityname required")
            return
        end
        print('/spawnentity invoked, entityname="'..entityname..'"')
        local player = minetest.get_player_by_name(name)
        if player == nil then
            print("Unable to spawn entity, player is nil")
            return true -- Handled chat message
        end
        local p = player:getpos()
        p.y = p.y + 1
        minetest.add_entity(p, entityname)
        minetest.chat_send_player(name, '"'..entityname
                ..'" spawned.');
    end,
})
 

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

by fairiestoy » Fri Oct 25, 2013 16:17

Spawn is afaik a self-written mod. if you just start a singleplayer world, /spawn shouldn't be available ( at least on my 0.4.7+ versions ). If you want some spawn commands, search the forum by using the search tool respectively.
Here is an example i know from BrandonReese: Custom Spawn points. It works different, but should give you a good feeling. And next time:
Hell use the search tool in the top bar(!)
Last edited by fairiestoy on Fri Oct 25, 2013 16:45, edited 1 time in total.
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 8 guests

cron