Dev help: This is driving me insane, what on earth am I missing?
Dev help: This is driving me insane, what on earth am I missing?
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.
- Attachments
-
- empty-equipment_1.0.0.zip
- (7.51 KiB) Downloaded 10 times
Re: Dev help: This is driving me insane, what on earth am I missing?
placed_as_equipment_result should be place_as_equipment_result, without the D
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: Dev help: This is driving me insane, what on earth am I missing?
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.
Edit: Yep, it worked. Slap administered. Thank you.
Re: Dev help: This is driving me insane, what on earth am I missing?
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.
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.
- Attachments
-
- factorio-current.log
- (261.96 KiB) Downloaded 9 times
-
- wireless_equipment_charger_1.0.0.zip
- (44.84 KiB) Downloaded 7 times
Re: Dev help: This is driving me insane, what on earth am I missing?
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: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.
Code: Select all
log("15")
local pole = proximity.find_nearest_power_pole(player)
log("16")
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Dev help: This is driving me insane, what on earth am I missing?
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?
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?
Set https://lua-api.factorio.com/latest/typ ... power_icon (or https://lua-api.factorio.com/latest/typ ... twork_icon) to false
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.