Post your modding questions here

User avatar
iangp
Member
 
Posts: 114
Joined: Sat May 31, 2014 19:26
Location: Brasil - ES
GitHub: 14NGiestas
IRC: iangp
In-game: iangp

Re: Post your modding questions here

by iangp » Wed Mar 23, 2016 14:31

Well,I finally bookmarked your modding book Sir Ruben Wardy XD, It's a very useful reference material.
So, at end the code seems like that:
Code: Select all
local sound = 'no'
minetest.register_tool("headphones:1headphones", {
   description = "Headphones Test Song",
   inventory_image = "testh.bmp",

   on_use = function()
        if sound == 'no' then
            sound = minetest.sound_play("test") --keep the "reference" of the sound
        else
            minestes.sound_stop(sound) --stop the sound
            sound = 'no'
       end
   end,
})
God's not dead, He's surely alive!
エル プサイ コングルー

My mods (WIP):
 

User avatar
MineYoshi
Member
 
Posts: 5373
Joined: Wed Jul 08, 2015 13:20

Re: Post your modding questions here

by MineYoshi » Wed Mar 23, 2016 21:02

I think i am a little dumb, or i don't know the "enough" yet!

Anyways THX!
Happy new Year 2020: let's all aim finally for a clear vision of what we want to make of Minetest!
 

User avatar
iangp
Member
 
Posts: 114
Joined: Sat May 31, 2014 19:26
Location: Brasil - ES
GitHub: 14NGiestas
IRC: iangp
In-game: iangp

Re: Post your modding questions here

by iangp » Wed Mar 23, 2016 22:15

MineYoshi wrote:I think i am a little dumb, or i don't know the "enough" yet!

Anyways THX!

Not really, you just need practice.
make little challenges to yourself:
exercises, big projects, read some good book/e-book (not only about Lua),
It comes along with time, so be patient.

And of course think out the box :D
creativity helps to find a nicer way to solve a problem.
God's not dead, He's surely alive!
エル プサイ コングルー

My mods (WIP):
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Mar 23, 2016 22:27

iangp wrote:
MineYoshi wrote:I think i am a little dumb, or i don't know the "enough" yet!

Anyways THX!

Not really, you just need practice.
make little challenges to yourself:
exercises, big projects, read some good book/e-book (not only about Lua),
It comes along with time, so be patient.

And of course think out the box :D
creativity helps to find a nicer way to solve a problem.

I agree! I have been slowly learning. I still have a lot more to learn. Every challenge I give myself makes me have a little more knowledge. Keep trying.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
MineYoshi
Member
 
Posts: 5373
Joined: Wed Jul 08, 2015 13:20

Re: Post your modding questions here

by MineYoshi » Wed Mar 23, 2016 23:27

Don wrote:
iangp wrote:
MineYoshi wrote:I think i am a little dumb, or i don't know the "enough" yet!

Anyways THX!

Not really, you just need practice.
make little challenges to yourself:
exercises, big projects, read some good book/e-book (not only about Lua),
It comes along with time, so be patient.

And of course think out the box :D
creativity helps to find a nicer way to solve a problem.

I agree! I have been slowly learning. I still have a lot more to learn. Every challenge I give myself makes me have a little more knowledge. Keep trying.


THX for motivation i will try to be better!

=D
Happy new Year 2020: let's all aim finally for a clear vision of what we want to make of Minetest!
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Mar 23, 2016 23:52

Remember that failing is much better than not trying at all. Some of the best things in life are the result of failures.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
MineYoshi
Member
 
Posts: 5373
Joined: Wed Jul 08, 2015 13:20

Re: Post your modding questions here

by MineYoshi » Wed Mar 23, 2016 23:54

Good advice...

Many people said that to me too...
Happy new Year 2020: let's all aim finally for a clear vision of what we want to make of Minetest!
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

work with String

by BrunoMine » Fri Mar 25, 2016 17:04

How can I check each letter in a string?
How can I check the amount of characters in a string?
I want to create a verification loop of characters in a string.
 

User avatar
rubenwardy
Moderator
 
Posts: 5965
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

User avatar
Foghrye4
Member
 
Posts: 24
Joined: Sun Mar 13, 2016 13:38
IRC: Foghrye4
In-game: Foghrye4

Re: Post your modding questions here

by Foghrye4 » Sat Mar 26, 2016 07:33

How i can hook up on existing player inventory functions like in detached inventory functions "on_put","on_take","on_move" and so on? I mean a one, that are returned by "player:get_inventory()".
 

User avatar
mahmutelmas06
Member
 
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: Post your modding questions here

by mahmutelmas06 » Sun Mar 27, 2016 13:08

i use formspecs to make a coffee machine but i need help
can i use itemgroup instead of an item ?

for exp instead of "flowers:tulip" i want to use group flowers

inv:contains_item("src", ItemStack("flowers:tulip"))
My Mods:

Beverage
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Sun Mar 27, 2016 19:54

mahmutelmas06 wrote:i use formspecs to make a coffee machine but i need help
can i use itemgroup instead of an item ?

for exp instead of "flowers:tulip" i want to use group flowers

inv:contains_item("src", ItemStack("flowers:tulip"))

You can see how to do groups in this mod
viewtopic.php?f=11&t=11780
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

Lucki
New member
 
Posts: 1
Joined: Wed Mar 30, 2016 13:55
In-game: Lucki

Re: Post your modding questions here

by Lucki » Wed Mar 30, 2016 14:34

How I can check, a player is death? If this happens I want to Drop an Item.
And sorry for my english because i´m from germany and 12 years old.
I want to make a "Capture the FlagMod"
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Wed Mar 30, 2016 14:40

Lucki wrote:How I can check, a player is death? If this happens I want to Drop an Item.
And sorry for my english because i´m from germany and 12 years old.
I want to make a "Capture the FlagMod"

Use this

http://dev.minetest.net/minetest.register_on_dieplayer
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
ynong123
Member
 
Posts: 20
Joined: Fri Mar 11, 2016 13:24
Location: Malaysia
GitHub: ynong123
IRC: ynong123
In-game: ynong123

Post A Topic

by ynong123 » Fri Apr 01, 2016 07:12

Question: How to post a topic?
Reason: I want to release a mod.
 

User avatar
kaeza
Moderator
 
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Fri Apr 01, 2016 07:26

rubenwardy wrote:For length: #str
For character: str.sub(i, 1)

Correction: `str:sub(i, i)`

Arguments are start and end pos, not start pos and length.
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
kaeza
Moderator
 
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: work with String

by kaeza » Fri Apr 01, 2016 07:31

BrunoMine wrote:[...]I want to create a verification loop of characters in a string.

Patterns are probably faster. For example, this code tells you if you have any non-alphanumeric chars:

Code: Select all
if str:find("[^A-Za-z0-9]") then
  error("please only use letters or digits")
end


Read more about patterns here.

Edit: If you need to know the position for whatever reason:
Code: Select all
local start, fin, what = str:find("[^A-Za-z0-9]")
if start then
  error("character "..what.." (at position "..start..") is not allowed")
end
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
jp
Member
 
Posts: 778
Joined: Wed Dec 18, 2013 09:03
Location: France
GitHub: kilbith

Re: Post your modding questions here

by jp » Fri Apr 01, 2016 09:31

This would be even simpler using :

Code: Select all
str:find("%W")
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post A Topic

by Don » Fri Apr 01, 2016 12:10

ynong123 wrote:Question: How to post a topic?
Reason: I want to release a mod.

You release a mod in the wip mods section.
When the mod is complete and the forum topic is set up following the guidelines then you request that your mod gets moved to releases.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
MineYoshi
Member
 
Posts: 5373
Joined: Wed Jul 08, 2015 13:20

Re: Post your modding questions here

by MineYoshi » Fri Apr 01, 2016 20:59

A question!

How make when i use an item send a message to the player who have it?

It's for a very big project, it's an easter egg!
Happy new Year 2020: let's all aim finally for a clear vision of what we want to make of Minetest!
 

User avatar
Hybrid Dog
Member
 
Posts: 2726
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Sat Apr 02, 2016 19:10

http://dev.minetest.net/minetest.register_node#on_use

minetest.chat_send_player(player:get_player_name(), "some text")

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪
 

User avatar
MineYoshi
Member
 
Posts: 5373
Joined: Wed Jul 08, 2015 13:20

Re: Post your modding questions here

by MineYoshi » Mon Apr 04, 2016 00:37

how to make, when i click a chest of one space(left click) with a craft_item, drop the item in the chest?
Happy new Year 2020: let's all aim finally for a clear vision of what we want to make of Minetest!
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Mon Apr 04, 2016 04:34

MineYoshi wrote:how to make, when i click a chest of one space(left click) with a craft_item, drop the item in the chest?

Use on_use.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: Post your modding questions here

by BrunoMine » Mon Apr 11, 2016 17:46

How can I place an item in a biome.
For example: I want to appear in a chest in a jungle forest.

I can not check the area next to jungle trees that have just been generated.
 

User avatar
Don
Member
 
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Mon Apr 11, 2016 19:11

BrunoMine wrote:How can I place an item in a biome.
For example: I want to appear in a chest in a jungle forest.

I can not check the area next to jungle trees that have just been generated.

Are you trying to do it when the map loads or could you use an abm or lbm to make it place?
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 3 guests