Minetest logo

IRC log for #minetest-dev, 2020-01-27

| Channels | #minetest-dev index | Today | | Google Search | Plaintext

All times shown according to UTC.

Time Nick Message
00:05 Taoki joined #minetest-dev
00:14 NoctisLabs joined #minetest-dev
00:34 Lone_Wolf https://github.com/minetest/minetest/issues/9344
00:41 ANAND joined #minetest-dev
02:26 ANAND joined #minetest-dev
04:02 Taoki joined #minetest-dev
05:26 ANAND joined #minetest-dev
05:39 fluxflux joined #minetest-dev
07:50 erlehmann joined #minetest-dev
08:34 erlehmann_ joined #minetest-dev
08:38 ShadowNinja joined #minetest-dev
09:05 vesper11 joined #minetest-dev
10:25 An0n3m0us joined #minetest-dev
10:34 df458 joined #minetest-dev
10:55 pmp-p joined #minetest-dev
10:58 proller joined #minetest-dev
11:03 ANAND joined #minetest-dev
11:07 Beton joined #minetest-dev
11:51 pmp-p joined #minetest-dev
11:59 Fixer joined #minetest-dev
12:10 proller joined #minetest-dev
12:27 tuedel joined #minetest-dev
12:32 tuedel joined #minetest-dev
13:23 proller joined #minetest-dev
13:55 proller joined #minetest-dev
13:57 absurb joined #minetest-dev
14:15 Fixer_ joined #minetest-dev
16:35 Lone_Wolf joined #minetest-dev
17:40 Krock joined #minetest-dev
18:21 sfan5 merging #9327 in 5 minutes
18:21 ShadowBot https://github.com/minetest/minetest/issues/9327 -- Collision temporary fix for issue #6886 by TheTermos
18:25 Lone_Wolf joined #minetest-dev
18:30 sfan5 merged
18:44 An0n3m0us joined #minetest-dev
18:46 An0n3m0us I'm having some trouble calling the knockback function; what have I done incorrectly?: https://pastebin.com/d5MhwT4Z
18:48 sfan5 well that's not how you call it, and also not what I meant
18:49 An0n3m0us So how shall I do it?
18:50 rubenwardy you need to override the function
18:50 rubenwardy not call it
18:50 rubenwardy like, reassign it
18:50 rubenwardy functions in Lua are variables
18:50 An0n3m0us Like so?: function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage)
18:51 rubenwardy yeah
18:51 An0n3m0us That's what I already have;
18:51 rubenwardy no, you're calling it
18:51 rubenwardy minetest.calculate_knockback(function(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage)
18:51 rubenwardy !=
18:51 rubenwardy function minetest.calculate_knockback(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage)
18:51 rubenwardy that ^
18:51 rubenwardy is syntatic sugar for
18:51 An0n3m0us Oh no; I meant in my own code; the pastebin code is the changed code.
18:51 An0n3m0us sfan5 said "you should call the existing function instead"
18:51 rubenwardy minetest.calculate_knockback = function(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage)
18:52 rubenwardy <sfan5> override minetest.calculate_knockback as the documentation says
18:52 An0n3m0us That worked! Thanks : )
18:52 sfan5 here's how it should actually look like https://pastebin.com/anPbHCab
18:53 rubenwardy cache is the wrong word, old_calculate_knockback would be better
18:53 rubenwardy also, is arg a lua keyword?
18:53 sfan5 dunno they use it here https://www.lua.org/pil/5.2.html
18:53 rubenwardy Shouldn't it be     old_calculate_knockback(player, ...)
18:54 rubenwardy ahh
18:54 rubenwardy I think arg will be ... in table form
18:54 sfan5 maybe (player, ...) also works then
18:54 An0n3m0us OK, I used that code and changed "cache" to "old" like rebunwardy said; is that OK?
18:54 sfan5 test and see if it works ;)
18:55 rubenwardy https://rwdy.uk/Hzpc6.png
18:55 Krock now again with 5.1
18:55 An0n3m0us Works fine.
18:55 rubenwardy cba
18:56 rubenwardy Krock: I've used this in many mods, I know it works in 5.1
19:00 An0n3m0us @sfan5 your code was giving a few errors; so I've ended up here: https://pastebin.com/1cZtf7KZ
19:00 sfan5 sure that works but the ... had a point
19:01 rubenwardy I also had problems with unpack(arg) in the terminal
19:01 rubenwardy An0n3m0us: try this https://gist.github.com/rubenwardy/723c07b28d964008c4d2c4ff3c28975c
19:09 An0n3m0us sfan5 oh it did? xD I though you put it there meaning, add the rest of the arguments.
19:11 An0n3m0us rubenwardy; yeah, that worked; thanks!
20:39 NoctisLa1 joined #minetest-dev
20:48 p_gimeno arg does not work in LuaJIT
20:52 proller joined #minetest-dev
20:53 NoctisLabs joined #minetest-dev
20:58 NoctisLa1 joined #minetest-dev
21:21 NoctisLa1 joined #minetest-dev
21:25 NoctisLabs joined #minetest-dev
21:26 df458 joined #minetest-dev
21:33 An0n3m0us joined #minetest-dev
21:34 An0n3m0us Does this issue still need to be open?: https://github.com/minetest/minetest_game/issues/2305
22:39 An0n3m0us joined #minetest-dev
22:40 An0n3m0us Is there a way to select individual sounds to play? Like; I would like to use default_cool_lava.1.ogg and it's second variant, but not the third.
22:40 An0n3m0us Here's the code: minetest.sound_play("default_cool_lava", {pos = pos, max_hear_distance = 16, gain = 0.1})
22:54 proller joined #minetest-dev
23:28 Miner_48er joined #minetest-dev

| Channels | #minetest-dev index | Today | | Google Search | Plaintext