Luanti logo

IRC log for #minetest, 2024-08-13

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

All times shown according to UTC.

Enable nick filtering
Time Nick Message
00:01 MTDiscord <exe_virus> But to do it without direct window focus... That's a bit harder...
22 more elements. Show/hide.
09:53 Furi0us_mat hi everyone, as you know i'm currently developing Mark Survival Ascended an ARK inspired game for minetest, i recently asked for help following the implementation of inventory to creatures and dinos, but I got a saving problem (when I unloaded the entity or left the game the entity lost all its inventory) I corrected this problem but another
09:53 Furi0us_mat problem occurred and I don't understand why, the entity saves its inventory now but completely forgets all these things: Its life points, the order given, whether it's tamed or not, its mood, its attacks, its gender (male/female), when an egg hatches the dino suddenly grows, all this happens when I disconnect from the game or unload the entity,
09:53 Furi0us_mat except what I don't understand is that normally there's the "paleotest" function. on_activate" which saves all this data but it seems that the entity loses this data because of the inventory, so I think that one of the lines must indirectly delete the "paleotest.on_activate" I confess I do not understand at all, and help is requested, moreover I
09:53 Furi0us_mat will create the topic on the forum in case of need, here is the code that poses big problem to the game (and yes on ark the inventory is an essential thing): https://paste.sqt.wtf/67fe6a@raw
2 more elements. Show/hide.
10:30 sfan5 well. mobkit or paleotest normally uses the staticdata on its own to store such things
10:30 sfan5 but you're overriding get_staticdata and on_activate so it just isn't happening anymore
10:31 sfan5 two unrelated things: 1) serializing the inventory with , as delimiter is not safe. since you're already using minetest.serialize better use just keep it a list
10:31 sfan5 2) you should indent and format your code consistently. it's hard to read and follow like this
10:33 Furi0us_mat okay, and how do you change the code so that the inventory is saved differently?
10:33 sfan5 to expand on the first point: you're calling mobkit.statfunc(self) which is a step in the right direction, but it returns a value and you're not doing anything with it
10:34 sfan5 you need to save it alongside your inventory and inside on_activate take it out of the structure and pass it to paleotest.on_activate
10:34 sfan5 want me to show you the required changes?
10:37 Furi0us_mat yes, because I'm a bit confused =L
10:38 PoochInquisitor joined #minetest
10:43 sfan5 https://dpaste.com/9E5WDEVK3 here
10:54 Furi0us_mat thank you, it worked well
10:58 sfan5 deserialize_inventory should have i = 1, ... btw
10:58 sfan5 tables start from 1 in lua
10:59 MacroFaxSax joined #minetest
11:17 Furi0us_mat indeed, I know, but if I don't set 0, the items are removed one by one for no reason
11:22 TheSilentLink joined #minetest
11:24 Furi0us_mat here is the inventory with 0 (when I go away or disconnect it stays like that) https://ibb.co/st0kxW2
11:24 Furi0us_mat here's the inventory with i = 1 (when I go far away or disconnect it changes) https://ibb.co/bF75prz
2 more elements. Show/hide.
12:59 sfan5 change the i - 0 to i - 1 then
13:27 alguien joined #minetest
13:29 alguien Does formspec's `listring[<inventory location>;<list name>]` not work (at least with a "nodemeta:<X>,<Y>,<Z>" inventory location)? I can't get the same functionality I get with `listring[]` (with no arguments)
24 more elements. Show/hide.
16:39 MinetestBot [git] kno10 -> minetest/minetest: Add `vector.random_direction()` (#14784) e6f77b9 https://github.com/minetest/minetest/commit/e6f77b95f3d419fecb2bc7ac9f5c6099660ac791 (2024-08-13T16:38:07Z)
16:39 MinetestBot [git] grorp -> minetest/minetest: Add setting to disable smooth scrolling 0fb67cc https://github.com/minetest/minetest/commit/0fb67ccb340fd223339810f6fc2f62799fbc6c6f (2024-08-13T16:38:34Z)
16:39 MinetestBot [git] AMDmi3 -> minetest/minetest: Include unistd.h for getpid() when _IRR_COMPILE_WITH_X11_ a677d33 https://github.com/minetest/minetest/commit/a677d33bdffa110fe611e49e346c0bd99dafb5ca (2024-08-13T16:38:59Z)
16:41 MinetestBot [git] Emojigit -> minetest/minetest: Add `table.keyof()` (#14910) dc7a7a0 https://github.com/minetest/minetest/commit/dc7a7a0ed98e10f80c7ca5ce071300ada7922eab (2024-08-13T16:39:50Z)
24 more elements. Show/hide.

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