Time |
Nick |
Message |
00:05 |
|
AristotIe joined #minetest |
00:07 |
|
proller joined #minetest |
00:11 |
|
AristotIe joined #minetest |
01:01 |
|
absurb joined #minetest |
01:48 |
|
AristotIe joined #minetest |
01:58 |
|
Hawk777 joined #minetest |
02:28 |
|
snowhawk1 joined #minetest |
02:28 |
|
queria^clone joined #minetest |
02:34 |
|
queria^clone joined #minetest |
03:27 |
|
AristotIe joined #minetest |
03:46 |
|
specing joined #minetest |
04:00 |
|
MTDiscord joined #minetest |
04:41 |
|
jadedctrl joined #minetest |
05:01 |
|
riff-IRC joined #minetest |
05:07 |
|
grouinos joined #minetest |
06:31 |
|
plainoldcheese joined #minetest |
06:47 |
|
AristotIe joined #minetest |
07:04 |
|
CWz joined #minetest |
07:51 |
|
MTDiscord joined #minetest |
08:00 |
|
GNUHacker joined #minetest |
08:10 |
|
hendursa1 joined #minetest |
08:22 |
|
IcyDragon joined #minetest |
08:50 |
|
IcyDragon joined #minetest |
08:51 |
|
hook54321 joined #minetest |
09:08 |
|
GNUHacker joined #minetest |
09:55 |
|
IcyDragon joined #minetest |
10:04 |
|
AristotIe joined #minetest |
10:06 |
|
absurb joined #minetest |
10:08 |
|
AristotIe joined #minetest |
10:41 |
|
olliy joined #minetest |
10:49 |
|
grouinos joined #minetest |
11:12 |
|
calcul0n_ joined #minetest |
11:26 |
|
JerryXiao joined #minetest |
11:29 |
|
grouinos joined #minetest |
11:42 |
|
grouinos joined #minetest |
12:01 |
|
CWz joined #minetest |
12:45 |
|
kamdard_ joined #minetest |
12:51 |
|
snowhawk joined #minetest |
12:51 |
|
snowhawk joined #minetest |
13:15 |
|
proller joined #minetest |
13:21 |
|
sagax joined #minetest |
13:53 |
|
grouinos joined #minetest |
13:55 |
|
calcul0n__ joined #minetest |
14:22 |
|
appguru joined #minetest |
14:28 |
|
Fixer joined #minetest |
14:36 |
Bombo |
hi, i need some help, i'm trying to make my own node/mod: i followed https://rubenwardy.com/minetest_modding_book/en/basics/getting_started.html i get an item now anc can place it |
14:37 |
Bombo |
i got a sound file in sounds/test_testi.ogg, so i want to play that when the node is placed: sounds = minetest.sound_play("testi"), but that gives me an error |
14:38 |
Bombo |
'table expected, got number' |
14:38 |
Bombo |
this is in minetest.register_node("test:testi", { ... |
14:43 |
|
JerryXiao joined #minetest |
14:43 |
sfan5 |
sound_play is for interactive use in callbacks, to define a node sound there is a different table format |
14:46 |
|
dabbill joined #minetest |
14:56 |
Bombo |
ok hm, now i tried sounds = {name = "testi", gain = 0.9, pitch = 1.1}, i get no errors, but no sound too |
14:57 |
sfan5 |
should be "test_testi" |
15:00 |
Bombo |
hm nothing |
15:00 |
Bombo |
sounds/test_testi.ogg: Ogg data, Vorbis audio, mono, 48000 Hz, ~96000 bps, created by: Xiph.Org libVorbis I |
15:01 |
Bombo |
maybe 44k1 instead of 48k? |
15:02 |
sfan5 |
which error do you get? |
15:03 |
Bombo |
none, just silence |
15:03 |
Bombo |
when placing the node |
15:03 |
sfan5 |
ah you missed another thing |
15:04 |
sfan5 |
sounds = { place = { .. } } |
15:05 |
Bombo |
oh now it works ;) |
15:05 |
Bombo |
thx |
15:07 |
Bombo |
what other options are there besides place? i don't see this in https://minetest.gitlab.io/minetest/sounds/ |
15:07 |
Bombo |
table format |
15:11 |
sfan5 |
https://minetest.gitlab.io/minetest/definition-tables/#node-definition |
15:11 |
sfan5 |
under sounds = |
15:12 |
Bombo |
found it at https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L7794 |
15:12 |
MTDiscord |
<Jonathon> There is a pr to increase the documentation on sound options |
15:12 |
Bombo |
heh |
15:12 |
MTDiscord |
<Jonathon> Not sure how accurate the pr is |
15:25 |
Bombo |
on_rightclick means 'when item is right clicked with nothing in the hands' |
15:26 |
Bombo |
right? |
15:27 |
Bombo |
must be right, it crashes when i do this: on_rightclick = minetest.sound_play("test_testi"), |
15:28 |
MTDiscord |
<Jonathon> depends if your talking about a entity, item, etc |
15:28 |
jonadab |
I think we're talking about a node in this context. |
15:28 |
MTDiscord |
<Jonathon> you need to wrap it in the function anyways |
15:28 |
Bombo |
just an item, i just made my first node ;) |
15:29 |
Bombo |
in what function? |
15:29 |
sfan5 |
the line you pasted means: call sound_play when the mod loads (before any player joins), then take the return value and stuff it into the 'on_rightclick' field |
15:29 |
sfan5 |
sounds wrong, doesn't it? |
15:31 |
Bombo |
well yes |
15:34 |
sfan5 |
what you want is this -> http://sprunge.us/LsWvTy?lua |
15:35 |
sfan5 |
the difference is that you say "declare this function and put it into the 'on_rightclick' field", it then gets called by the engine at some point later |
15:39 |
|
kamdard_ joined #minetest |
15:39 |
Bombo |
now that makes sense, thx for explaining :) |
15:43 |
Bombo |
just one question why ', true' |
15:45 |
|
specing_ joined #minetest |
15:46 |
sfan5 |
https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L5623-L5626 |
15:47 |
Bombo |
got it |
15:47 |
sfan5 |
it's not super important, in fact it'll work without |
15:47 |
sfan5 |
just good practice |
15:48 |
|
snowhawk1 joined #minetest |
15:49 |
Bombo |
i see |
15:49 |
Bombo |
i got too many tabs open |
15:50 |
|
definitely_a joined #minetest |
15:52 |
|
Extex joined #minetest |
15:53 |
|
hendursaga joined #minetest |
16:05 |
|
fluxionary joined #minetest |
16:13 |
|
garywhite joined #minetest |
16:13 |
|
garywhite joined #minetest |
16:14 |
Bombo |
shouldn't this play the sound if leftshift+rightclick at the same time? on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) if clicker:get_player_control().sneak == true then ... end end, |
16:22 |
definitely_a |
Ah I see the issue on github, I missed the bushes textures, oh well. If I find any more bugs I'll register. |
16:25 |
|
Extex joined #minetest |
16:26 |
sfan5 |
Bombo: I think sneak+rightclick is a special case because that is supposed to allow you to place things regardless of on_rightclick |
16:26 |
sfan5 |
(imagine placing a node against a chest which normally opens a form) |
16:28 |
|
Verticen_ joined #minetest |
16:53 |
Bombo |
sfan5: ok it worked with .zoom ;) |
17:00 |
|
Flabb joined #minetest |
17:09 |
|
dabbill joined #minetest |
17:17 |
|
Talkless joined #minetest |
17:58 |
|
Gustavo6046 joined #minetest |
18:05 |
|
fluxionary joined #minetest |
18:30 |
|
sys4 joined #minetest |
18:36 |
|
Boingo joined #minetest |
18:42 |
|
Boingo joined #minetest |
18:44 |
|
Boingo joined #minetest |
18:58 |
|
Boingo joined #minetest |
18:58 |
|
reumeth joined #minetest |
19:10 |
|
Gustavo6046 joined #minetest |
19:45 |
|
definitely_a left #minetest |
20:07 |
|
Extex joined #minetest |
20:25 |
|
Verticen_ joined #minetest |
20:46 |
|
Gustavo6046 joined #minetest |
20:52 |
|
grouinos joined #minetest |
21:05 |
|
Gustavo6046_ joined #minetest |
21:06 |
|
Gustavo6046 joined #minetest |
21:15 |
|
proller joined #minetest |
21:17 |
|
snowhawk joined #minetest |
21:17 |
|
snowhawk joined #minetest |
21:52 |
|
Gustavo6046 joined #minetest |
22:00 |
|
Sven_vB joined #minetest |
22:05 |
|
Gustavo6046 joined #minetest |
22:22 |
|
x_ joined #minetest |
22:29 |
|
x_ joined #minetest |
22:46 |
|
Sokomine joined #minetest |
22:49 |
|
erlehmann joined #minetest |
22:54 |
|
Verticen joined #minetest |
23:13 |
|
Alias2 joined #minetest |
23:21 |
|
hendursaga joined #minetest |
23:56 |
|
proller joined #minetest |
23:56 |
|
calcul0n__ joined #minetest |