Brave New World

by canidae

RTS-like scenario for Factorio. Player character is removed, all work must be done by bots

Scenarios
2 years ago
0.16 - 1.1
8.12K

g Error

1 year, 1 month ago

The following happens when picking up an item in the editor extensions "testing lab".

Error MainLoop.cpp:1288: Exception at tick 401166: The scenario level caused a non-recoverable error.
Please report this error to the scenario author.

Error while running event level::on_player_cursor_stack_changed (ID 31)
...1.1.76 (bnw seablock)/temp/currently-playing/control.lua:123: attempt to index field '?' (a nil value)
stack traceback:
...1.1.76 (bnw seablock)/temp/currently-playing/control.lua:123: in function 'dropItems'
...1.1.76 (bnw seablock)/temp/currently-playing/control.lua:506: in function <...1.1.76 (bnw seablock)/temp/currently-playing/control.lua:496>

1 year, 1 month ago

Can you post the log file?
Are there any other mods loaded?
I'll take a look tomorrow, thank you.

1 year, 1 month ago

There were a number of other mods installed but I've just tested again with nothing but Editor Extensions and BNW installed and got the same result

https://pastebin.com/raw/SUCUqV8k

1 year, 1 month ago
(updated 1 year, 1 month ago)

Nm

1 year, 1 month ago
(updated 1 year, 1 month ago)

Sorry dude, wrong Mod.
All yours Canidae/Omni, I might take a peek too though.

1 year, 1 month ago
(updated 1 year, 1 month ago)

Omni - I found and fixed this in my integration of Brave New World and Oarc. It drove me nuts and usually occurred when a tank ran over stone, but could occur if you dropped a ghost onto stone or some item that caused a ghost to spill items - and would cause a crash. The fix:

In dropitems where the code checks validity of entity, I added a validation that the entity was not a ghost.
https://imgur.com/uToMI10

1 year, 1 month ago
(updated 1 year, 1 month ago)

The extra code is for debugging, you can consolidate. I spent a fair amount of time reproducing this and the fix will most definately help BNW.

1 year, 1 month ago
(updated 1 year, 1 month ago)

I just tried this fix and it doesn't seem to have resolved my issue, but it's entirely possible I made a mistake with it.

To be clear, my issue occurs when picking items up from inventory while in the editor extensions testing-lab environment.

1 year, 1 month ago

I have time to look at this, I love Brave New World so much I incorporated it into my mod Brave New Oarc. So I have a fair amount of time debugging issues, and have fixed a wide range of issues in both Oarc and BNW in my mod.

I may take a look at this editor, but from what I can see it modifies the character to have things in the inventory, in Data-Final that BNW specifically denies. Easiest test is to remove the editor and see if the crash continues. The fix I posted specifically impacts placing ghost images or driving in a vehicle and running over stone.

1 year, 1 month ago

Also if you try it in Brave New Oarc - and it fails the same way, then I have done nothing to address this issue and it's likely the editor is incompatible with BNW.

1 year, 1 month ago
(updated 1 year, 1 month ago)

@JustGoFly - If you make a pull request, that would be appreciated. https://github.com/Omnifarious/Braver_New_World

Additionally, if you want to show me code, please do not show me a picture of code. I absolutely despise screenshots. Taking all that good character data and turning into an incoherent mess of bits that requires a sophisticated perceptual system to process seems like a whole lot of senseless destruction.

Things like https://pastebin.com/ are really great ways to share snippets of code.

And, honestly, if you can do these things, I would really appreciate the help.

1 year, 1 month ago

I may take a look at this editor, but from what I can see it modifies the character to have things in the inventory, in Data-Final that BNW specifically denies. Easiest test is to remove the editor and see if the crash continues. The fix I posted specifically impacts placing ghost images or driving in a vehicle and running over stone.

I'd be shocked if the crashing continues without editor extensions, but then the testing environment wouldn't exist either so it's a rather useless fix to me. My thinking was to just remove any BNW restrictions when in editor mode.

1 year, 1 month ago

So I've just tried with only BNW installed and the error goes away but the behavior is different.

Type /editor into the console to enable editor mode, open your inventory and then shift click on a belt or whatever a few times to make a few stacks of them. They'll show up in your inventory. Pick one of them up from inventory to start laying it and the entire stack falls to the ground.

The difference with editor extensions installed would be instead of falling to the ground you get the error I pasted up above.

1 year, 1 month ago

@Omnifarious - will do on the pull. The screen shot was my second option since pasting it made it look like a jumbled mess even with formatting.
@ommand - looks like you're installing the editor and think it will rewrite the BNW mod, well BNW continuously monitors what is in your hand and if it is not an approved item, it drops it. Installing another mod will not change how the module is designed and obviously forces a crash. You'd be better modifying the mod to change the items you are allowed to hold, but that seems silly to install a mod that doesn't run as designed.

1 year, 1 month ago

In this case, like the case of the Seablock, it seems like there needs to be some amount of communication between the mods so they don't conflict with each other. BNW would have to treat the lab in a blueprint lab mod as being a special environment that it didn't touch. The idea of being able to hold things and place them and such is too fundamental to a blueprint lab, and kind of at odds with the "no direct method of affecting the world" nature of BNW.

1 year, 1 month ago

So I've discovered that if I strictly use the editor mode tools to do things I have no problem, it's specifically when I try to interact with anything from my inventory or the regular crafting interface that things go sideways. I suppose I can work around it but I'm sure I'll cause countless frustrating crashes trying to get used to this.

1 year, 1 month ago

Would it be possible for BNW to just stop doing anything while in editor mode?

1 year, 1 month ago

Are you talking about Factorio's editor mode, or a mod's creative blueprint editing space? Because for Factorio's editor mode, maybe. For a mod's creative blueprint editing space, that would probably require some sort of cooperation between the mod and BNW.

1 year, 1 month ago
(updated 1 year, 1 month ago)

The regular editor mode. Editor Extensions just hijacks it and adds extra tools to it.

I guess I've "solved" all of my issues by just running a second editor game client alongside my main game. I can't imagine I'll be the only person to run across this issue though.

New response