control.lua: attempt to index global

Place to get help with not working mods / modding interface.
hidingfox
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Oct 27, 2024 3:19 pm

control.lua: attempt to index global

Post by hidingfox »

Look, I have no idea how to mod. I just wanted to make a mod work, that was working in 1.1. The original creator haven't updated it in 6 months. I went through the changelog and fixed stuff in entity.lua and item.lua. But don't really understand what's wrong with control.lua

The file is attached if someone can take a look?

Image

Thanks
Attachments
control.lua
(5.93 KiB) Downloaded 4 times
User avatar
Silari
Filter Inserter
Filter Inserter
Posts: 530
Joined: Sat Jan 27, 2018 10:04 pm
Contact:

Re: control.lua: attempt to index global

Post by Silari »

'global' was renamed to 'storage' in 2.0. You need to find anywhere that tries to access global and update the name.
hidingfox
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Oct 27, 2024 3:19 pm

Re: control.lua: attempt to index global

Post by hidingfox »

Silari wrote: Sun Oct 27, 2024 5:39 pm 'global' was renamed to 'storage' in 2.0. You need to find anywhere that tries to access global and update the name.
thanks!

I tried a few things and it still doesn't work as intended. Real shame
Pi-C
Smart Inserter
Smart Inserter
Posts: 1725
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: control.lua: attempt to index global

Post by Pi-C »

hidingfox wrote: Thu Oct 31, 2024 8:43 am I tried a few things and it still doesn't work as intended. Real shame
The update to Factorio 2.0 came with some drastic changes: 'global' was renamed, things like 'game.prototypes' have been moved to 'prototypes' etc.

Here is the preview of the changes posted in preparation for 2.0. If you read through it, you may find the things that don't work for you. If you're in luck, you may find that just renaming a few things may fix your bug. Of course, some more changes (e.g. in regard to logistic networks) are not quite as easy to fix. Post some more details when you see such problems!

You may also want to check out the Factorio API Docs.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Post Reply

Return to “Modding help”