Dev help: This is driving me insane, what on earth am I missing?

Place to get help with not working mods / modding interface.
User avatar
Maoman
Inserter
Inserter
Posts: 37
Joined: Sat Nov 12, 2016 10:55 am
Contact:

Dev help: This is driving me insane, what on earth am I missing?

Post 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.
Attachments
empty-equipment_1.0.0.zip
(7.51 KiB) Downloaded 11 times
Bilka
Factorio Staff
Factorio Staff
Posts: 3431
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Dev help: This is driving me insane, what on earth am I missing?

Post by Bilka »

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.
User avatar
Maoman
Inserter
Inserter
Posts: 37
Joined: Sat Nov 12, 2016 10:55 am
Contact:

Re: Dev help: This is driving me insane, what on earth am I missing?

Post 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.
User avatar
Maoman
Inserter
Inserter
Posts: 37
Joined: Sat Nov 12, 2016 10:55 am
Contact:

Re: Dev help: This is driving me insane, what on earth am I missing?

Post 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.
Attachments
factorio-current.log
(261.96 KiB) Downloaded 10 times
wireless_equipment_charger_1.0.0.zip
(44.84 KiB) Downloaded 8 times
Pi-C
Smart Inserter
Smart Inserter
Posts: 1759
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Dev help: This is driving me insane, what on earth am I missing?

Post 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")
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
User avatar
Maoman
Inserter
Inserter
Posts: 37
Joined: Sat Nov 12, 2016 10:55 am
Contact:

Re: Dev help: This is driving me insane, what on earth am I missing?

Post 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.
User avatar
Maoman
Inserter
Inserter
Posts: 37
Joined: Sat Nov 12, 2016 10:55 am
Contact:

Re: Dev help: This is driving me insane, what on earth am I missing?

Post 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?
Bilka
Factorio Staff
Factorio Staff
Posts: 3431
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Dev help: This is driving me insane, what on earth am I missing?

Post by Bilka »

I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Modding help”