trying to make a workable engine

Place to get help with not working mods / modding interface.
Post Reply
Felioun
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri May 17, 2024 4:39 pm
Contact:

trying to make a workable engine

Post by Felioun »

i had an idea to make a heat based engine that consumes heat and outputs electric i had small success when i used a heat interface. Do i have to create a new item with a sub directory? see file
entity.lua
(2.72 KiB) Downloaded 15 times
need help with this what am i missing

Natha
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: trying to make a workable engine

Post by Natha »

No, otherwise the game would complain before starting

Felioun
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri May 17, 2024 4:39 pm
Contact:

Re: trying to make a workable engine

Post by Felioun »

The new mod set having an issue with a nil value
on line 33 in the definitions any advice
Attachments
Heat-Engine.zip
what am doing wrong here
(1.43 MiB) Downloaded 13 times

Pi-C
Smart Inserter
Smart Inserter
Posts: 1659
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: trying to make a workable engine

Post by Pi-C »

Felioun wrote:
Wed May 29, 2024 6:20 pm
The new mod set having an issue with a nil value
on line 33 in the definitions any advice
The new mod is having even more issues! You can fix the crash at line 33 by using

Code: Select all

data:extend({
instead of

Code: Select all

extend({
But then you will get the following error:

Code: Select all

Mods to disable:Failed to load mods: __heat-engine__/data.lua:10: attempt to index global 'script' (a nil value)
During the data stage, you have access to 'mods', 'settings', and 'data'. Anything related to 'game' and 'script' is available in the control stage only. Also, while you could use a table named 'global' during the data stage, it isn't the same thing as the 'global' table from the control stage (in control stage, anything saved in a mod's 'global' table will belong to the game state, which means it will be included in saved games).

So the solution would be to remove event handlers and everything else that belongs to the control stage from data.lua.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Felioun
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri May 17, 2024 4:39 pm
Contact:

Re: trying to make a workable engine

Post by Felioun »

thanks i have revamped the mod since but i am still having an issue that i am unsure how to resolve the entity heat engine has a heat buffer and we have a hidden energy interface the control call for a nth tick function at 60 but then i get an error where the heat buffer is not found i will again post a copy of the mod but will continue working on it i can now get the item to spawn in game on the map editor but when trying to save and play for testing purposes the game crashes and line 40 i belive on the control say there is no heat buffer
Heat-Engine.zip
new script(revamped from the floor up kinda
(1.44 MiB) Downloaded 10 times

Post Reply

Return to “Modding help”