set_blueprint_entities question(s)

Place to get help with not working mods / modding interface.
Post Reply
DeadManWalking
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Mar 16, 2016 7:19 pm
Contact:

set_blueprint_entities question(s)

Post by DeadManWalking »

On yet another fantastic Factorio play through; Krashtorio2 (and the usual QOL's), but also with railloader (aka Bulk Rail Loader) and Railloader breaks the copy paste and blueprinting of other mod'ed entities (that use tags?). I *think* I corrected this behavior by moving the 'bp.set_blueprint_entities(entities)' command from executing on every 'on_blueprint(event)' to only those that trigger the position adjustment. Now at least cut&paste and blueprints of entitiy groups that don't include Bulk Loaders seems to work. Are there any unintended consequences I'm missing here?

Re - Move line #367 to immediately after line #362: https://github.com/mspielberg/factorio- ... ontrol.lua

I have tried the scripting and api doc's but there do not seem to be any code examples (or links to same) so I thought I'd ask if I'm just missing something simple, or if anybody can point me to a mod that works with blueprints extensively (with great comments) so I can figure it out. I'm happy to read the docs to get 'er done I just can't seem to find anything helpful. Specifically, I can't find current usage examples for the blueprint API. I've looked at one of the affected mods, the new DisplayPlates but the methodology is too different for me to decipher.


TLDNR;
The problem as I understand it in a nutshell: Bulk Rail Loaders uses on_blueprint in control.lua to assign direction to the railloader entities, based on the attached railroad entities. At the end of the on_blueprint function the script calls bp.set_blueprint_entities(entities) on every iteration. Various bug reports for mods this method affects seem to indicate that this method deletes tags of other entities. Through testing, I have found that moving the set_blueprint_entities command seems to at least move the problem in the right direction.

This 'bug' might be a work around for API issues so please show me the door if I'm beating a dead horse.

Peace!

Post Reply

Return to “Modding help”