Page 1 of 1
Dev help: This is driving me insane, what on earth am I missing?
Posted: Mon Jul 28, 2025 8:43 pm
by Maoman
I'm working on a mod that creates new armor equipment, but the item that gets created cannot be inserted into the equipment grid no matter what I try. I even tried again with an ultra basic, bare-bones mod, and still couldn't do it, so clearly I am missing something here. Attached is my barebones mod--please look and tell me what I am doing wrong.
Re: Dev help: This is driving me insane, what on earth am I missing?
Posted: Mon Jul 28, 2025 8:45 pm
by Bilka
placed_as_equipment_result should be place_as_equipment_result, without the D
Re: Dev help: This is driving me insane, what on earth am I missing?
Posted: Mon Jul 28, 2025 8:49 pm
by Maoman
Aw for fuck's sake, is that really all? Alright lemme go test. Imma slap myself if this works.
Edit: Yep, it worked. Slap administered. Thank you.
Re: Dev help: This is driving me insane, what on earth am I missing?
Posted: Tue Jul 29, 2025 1:10 am
by Maoman
Can you help again please? I'm not sure but I don't think anyone but a dev would be able to help with this issue--hell I may have even discovered a bug. I am somehow getting an event firing multiple times per tick and hard locking up the game.
Go to line 1457 in the log I uploaded: the tick number on the left (that is what that is, right?) is identical for many lines. I have checked and rechecked and triple checked for any kind of infinite loop or recursion, and cannot find anything, and certainly nothing that can fire more than once per tick. I've attached the mod zip, the relevant files are /scripts/proximity.lua and /scripts/power_transfer.lua.
Please tell me what's going on here because I am utterly bewildered. I really hope it's not just some stupid one-line thing I'm missing again lol.
edit: Oh sorry, I should probably mention it locks up right when you put the item into your equipment grid.
Re: Dev help: This is driving me insane, what on earth am I missing?
Posted: Tue Jul 29, 2025 4:28 am
by Pi-C
Maoman wrote: Tue Jul 29, 2025 1:10 am
Go to line 1457 in the log I uploaded: the tick number on the left (that is what that is, right?) is identical for many lines. I have checked and rechecked and triple checked for any kind of infinite loop or recursion, and cannot find anything, and certainly nothing that can fire more than once per tick.
You have a recursion in function proximity.find_nearest_power_pole! As you can see in the log file, you never get to logging "16". This is because you call proximity.find_nearest_power_pole() again in line 46:
Code: Select all
log("15")
local pole = proximity.find_nearest_power_pole(player)
log("16")
Re: Dev help: This is driving me insane, what on earth am I missing?
Posted: Tue Jul 29, 2025 5:18 am
by Maoman
Oh for god's sake, how did I miss that. *sigh* Thank you lol. I'd been working on this mod all day I think my brain was just fried.
Re: Dev help: This is driving me insane, what on earth am I missing?
Posted: Tue Jul 29, 2025 9:20 am
by Maoman
Is there a way to make an electrical entity not show the "out of power" warning icon when it's out of power?
Re: Dev help: This is driving me insane, what on earth am I missing?
Posted: Tue Jul 29, 2025 9:21 am
by Bilka