Wear and Tear

by withers

Adds wear and tear mechanics to the game, plus automated maintenance.

6 years ago
0.14 - 0.15
14

g error on Tick

6 years ago
(updated 6 years ago)

I got this error from nothing...
I was running UP while dragging the mouse with CTRL pressed to pickup copper plate from stone furnace.
But I did it a bunch of times, probably isn't that the cause.

Error while running event WearAndTear::on_tick (ID 0)
WearAndTear/control.lua:280: bad argument #1 to 'sub' (string expected, got nil)

6 years ago

Tracing down what could be happens, I put this line above the 280: game.print("loc_nam1: " .. old_name)

and get the Burner ore crusher from Angels, then I load up the game again and remove them before it happens and the game continues without crashing.

6 years ago
(updated 6 years ago)

so to keep playing without crash, I did this to get the name of the "things" that are going wrong. I don't know the factorio object structure to know what should be in entity.localised_name[N] but looks like it is returning nil.

the temporary fix:
before line 280

if (loc_name1 == nil) then
game.print("skipping aging for: " .. old_name)
return nil
end

after while I removed the print message, because it happens every 5 seconds so it is pretty annoying

6 years ago

I haven't been able to reproduce this bug. localised_name is an array that works with the files in your locale directory to determine what text is displayed. I define it in data-final-fixes. You can read about it here

http://lua-api.factorio.com/latest/Concepts.html#LocalisedString

When you hover over an entity that ages you should see an adjective prefix in the name, such as "New Burner Ore Crusher". Are you seeing this in your game?

Do you have any language translation mods?

Are other entities aging properly?

Are you getting a message that says ""Error: aging burner ore crusher does not exist. See readme.txt"?

6 years ago
(updated 6 years ago)

No, I don't have any translators, the basic mining drill (vanilla seems to age) but the error on the "Burner Ore Crusher" seems to happens exactly when you are trying to replace the current entity with a new one with "old" in the name, not sure about that, didn't look at all functions, never done a mod before, i just "try" to make the game don't crash.

I didn't got that text "Error: aging burner ore crusher does not exist. See readme.txt".

I don't think I see the world "new" in any entity.
This is a fresh game, started yesterday. With the mod.

6 years ago

I have removed the mod, play while, than downloaded it again and after loading the game, some entities got the "new settings" [Yuoki industries got "New", Electric furnaces got "New", Assembler Machines mk1 got "new"], but the Ore crushers don't, looks like all AAI stuff don't get it. Fuel Processor [AAI Industries], Burner Assembler machines, Burners Lab.
And the burning mining drills from vanilla stopped aging. They were aging before, losing health and changing name, but not anymore.

Anything that I can send to help? I'm waiting for the error to happen again, if it happens.

6 years ago

Can you post your mod list?

The burner ore crushers from angels should be working. (I use angels in my games). If you want to test things, you can speed up the aging process in startup mod settings. You can tell if an entity is aging by hovering the cursor on it and pressing CTRL-A, it should tell you the remaining minutes before it gets "old". Some of the AAI stuff is set up to not age because there are compatibility issues.

6 years ago
(updated 6 years ago)

Ok i have started a new map and create an test scenario. It happens. What can I do now?
ps: does the "startup mod settings" affect only new games or old games as well?

we can talk in the forum or skype or whatever you wants to

6 years ago
(updated 6 years ago)

i keep getting this message:
Error while running event WearAndTear::on_tick (ID 0)
WearAndTear/control-wt.lua:735: attempt to index a nil value

is this in anyway related?

6 years ago

Hi jackik. Is that on the latest version? (1.3.7)

6 years ago
(updated 6 years ago)

no was still 1.3.6
i just updated and will try again now.

6 years ago

i still got:

Error while running event WearAndTear::on_tick (ID 0)
WearAndTear/control-wt.lua:739: attempt to index a nil value

6 years ago

when ever i place a refurbishing machine and have an inserter pickup an old electric miner this happens. the item doesn't even get picked up either.

6 years ago

Got it. I needed to version number to be sure which line of code was causing the problem. Should be fixed in the next update I'll release today. In the meantime you should be able to avoid the error by using only storage chests (no belts) to feed the refurbishers.

6 years ago

The error should be fixed now. However I havent managed to get it reading anything on a belt. So refurbisher still has to be fed from a storage chest in order to detect old machines.

6 years ago
(updated 6 years ago)

thanks!
edit: sorry but still seems to fail for me:

Error while running event WearAndTear::on_tick (ID 0)
WearAndTear/control-wt.lua:739: attempt to index a nil value

2nd edit: my Factorio seems to have problems updating but it has now. seems to work okay working from chests now.

New response