#LUA moonlogic 2
1 messages · Page 1 of 1 (latest)
trying to help this 2 year old project back to life i think i found a lot of issue solved just cant get the lua right
would help to post the issues you're having with the code
im working with this right now it will accept the building of megatile but wont start the build working on it now
Have you tried putting debug print statements around the logic that is failing to check the values? As I assume Factorio does not have a built-in step-by-step debugger for Lua.
this is the senerio as far as i can get it trying to update it all now all im stuck on is getting the bots and radar to survy a spot based off what the mega base need if anyone can figure out howto automate this and get back working would be amazing
this is the OG senerio 1.0 factorio if you wanna look at it alot wrong with it but was able to fix in the test.rar
There's a VS Code extension that lets you debug/step through factorio mods. I haven't used it since 1.x but it looks like it has 2.0 support. https://github.com/justarandomgeek/vscode-factoriomod-debug
it has to be a actual wireing issue if someone is a good wiring guy then it might be able to do something
the whole thing doesnt need lua in the first place and could all just be combinators 
It needs Lua for blueprint manipulation?
recursive blueprints doesnt
maybe this is doing more than i thought ?
You really sure recursive blueprints does not use Lua?
not sure
but from what i can see te LUA combinator is just used as a shortcut for all the logic
the actual outputs are converted back to normal signals and then given to recursive blueprints
That seems kind of redundant when Lua could place the blueprints directly. Hmmm.
Well that must be a bug with the Lua combinator then, since Factorio Lua can as it is my understanding that is how recursive blueprints is implemented.
@karmic star @kind spruce https://www.youtube.com/watch?v=PGiTkkMOfiw
[UPDATE 2025-03-17]: As of Factorio 2.0, it looks like the scenarios no longer work and many mods are no longer compatible. If the mods situation stabilizes and it looks like it wouldn’t be too hard to get this all running again I may try, but for now I just wanted to let y’all know that I’m aware these scenarios don’t currently run.
Ch...
this is the OG vid with the 1.0v of this maybe this will show more why you need the lua
I am not arguing that Lua is needed. Lua is the sensible way to make this since combinators are stupid in comparison.
ive tried time and time im just stuck where it wont survy the surronding tiles to build what it needs for tier one max and then go next
its like its stuck on blue print deployment witch the first one should be to cut trees
why does it even have solar if theres reactors...
1.0 thing. No quality, no fusion, big builds. So for UPS efficiency it has solar built in.
Solar is also more reliable than other power sources. No matter how much you mess up, power still comes back in the day.
If you have a save showing the issue, such as it being at the stage it is stalled, I could try looking into it later this week.
Ops, forgot that existed.
god speed @karmic star
The scenario in test.rar loads with missing entity/data errors, likely due to mods. There is no button to sync mods with a scenario it seems.
i thought its a save file
No. It seems to be a scenario as it is missing files to be a save.
At least when I put it in the save folder.
ah, right, that was probably why i didnt test it yet either
Helps if you read the documentation for the substitue mods you use...
BAD Chest uses completely different signal API from the 1.0 recursive blueprint chest.
yup
hold you got it working was i being a slow brain
if you do send a save file id love to see what i did wrong ❤️
It is still not perfect. Something is causing it to try and build over macroblock units.
For some reason you removed critical logic?!
Original (1.0)
-- If we're good on power, but light on oil products,
-- build an oil processing megatile
elseif lastSignal ~= 110 and
(red['petroleum-gas-barrel'] < 0 or red['light-oil-barrel'] < 0 or
red['heavy-oil-barrel'] < 0) then
game.print((currently_constructed_megatiles + 1) ..
'[img=item.oil-refinery] [img=fluid.petroleum-gas] [img=fluid.light-oil] [img=fluid.heavy-oil]')
newSignal = 110
var.tilesBuilt = var.tilesBuilt + 8 <- WHY DID YOU REMOVE THIS?!
Yours:
elseif lastSignal ~= 110 and
((red['petroleum-gas-barrel'] or 0) < 0 or
(red['light-oil-barrel'] or 0) < 0 or
(red['heavy-oil-barrel'] or 0) < 0) then
game.print((currently_constructed_megatiles+1) .. ' oil')
newSignal = 110
You also removed a lot of comments making it a lot less readable.
sorry that was me going crzy with the lua trying to pin point the main issue im self taught so im not to good right now
instead of a whole bunch of
if var.tilesBuilt == nil then var.tilesBuilt = 0 end
you might find
var.tilesBuilt = var.tilesBuilt or 0
interesting