SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Back to NxLabs

NxLabs / Factorio

Personal Book

SBy SunBlade

Gives you a personal blueprint book which syncs across savegames and servers. Book can be easily accessed via hotkey and shortcut. [color=red]Important[/color]: automatic sync only works if you disable "Settings->Other->Use different mod settings per save".

Description

Features #

The Book ##

  • the hotkey and shortcut button allows access to your personal book no matter where it is.
  • the personal book and contained items keep their links to the hotbar and other mods.
  • your personal book waits in the void until your inventory has a free slot.
  • your personal book will be remade in the desired quality when opened via hotkey or shortcut.

Multiplayer ##

  • the mod is multiplayer safe.

Usage #

Syncing ##

based on your setting of "Settings->Other->Use different mod settings per save" this mod behaves differently. that setting is basically a NoSync option, which prevents automatic syncing between savegames/servers.

with NoSync on, your personal book behaves like the "game blueprint library" and is tied to your savegame/server. this is preferable if you have saves/servers with vastly different mods, since the personal book immediately deletes data from unavailable mods.

with NoSync off, your personal book behaves like the "my blueprint library" and tries to automatically sync across savegames/servers. this is preferable if you have saves/servers with the same mods or mods that do not introduce new stuff to be saved in blueprints.

Hotkey/Shortcut ##

the hotkey (by default: B) and shortcut button will open your personal book no matter where it is located. additionally your personal book will be moved to your main inventory if you have enough space.

Mod Setting ##

your personal book and ID mapping are saved as export strings in your mod settings. changing the export string of your personal book will trigger an update. if you change the export string of your personal book you should also clear the ID mapping.

Backups ##

before changing your personal book, a backup is created in "[{Factorio}][user_data_directory]/script-output/sbPersonalBook/backup###.txt". the amount of backups can be configured in the settings.

Command ##

the /personalbook [command][LuaCommandProcessor] defines the following functions:

  • copy {player}

sets your personal book to a copy of the specified players book.

  • set

sets your personal book to the book currently in your hand or the book you have currently opened, the book in your hand takes precedence.

Scripting ##

the sbPersonalBook [remote interface][LuaRemote] defines the following functions:

  • has_book( player:[uint][player_index] ): [LuaItem][]?

returns the personal book of the specified player, if they have one

  • get_book( player:[uint][player_index] ): [LuaItem][]

returns the personal book of the specified player, creating it if it does not exist

  • set_book( player:[uint][player_index], book:[LuaItem][]|[LuaItemStack][] ): [boolean][]

tries to set the personal book of the specified player to the specified item. returns true on success.

  • force_save( player:[uint][player_index] ): [nil][]

forcefully saves the personal book of the specified player. use this if you made any changes to the personal book.


Known limitations #

  • you need to disable "Settings->Other->Use different mod settings per save" for the mod to sync across savegames/servers.
  • description of items does not update.
  • unavailable data from other mods is immediately deleted from the personal book.
  • putting the personal book into the blueprint library will break all links to it and contained items, forcing the recreation of the personal book.
  • putting items into the blueprint library will break all links to them, forcing new IDs upon retrieval of said items.
  • quality of items is not stored in export strings, thus the mod mostly ignores quality.

[LuaCommandProcessor]: https://lua-api.factorio.com/latest/classes/LuaCommandProcessor.html [LuaItemStack]: https://lua-api.factorio.com/latest/classes/LuaItemStack.html [LuaItem]: https://lua-api.factorio.com/latest/classes/LuaItem.html [LuaPlayer]: https://lua-api.factorio.com/latest/classes/LuaPlayer.html [LuaRemote]: https://lua-api.factorio.com/latest/classes/LuaRemote.html [boolean]: https://lua-api.factorio.com/latest/types/boolean.html [nil]: https://www.lua.org/manual/5.2/manual.html#2.1 [player_index]: https://lua-api.factorio.com/latest/classes/LuaPlayer.html#index [user_data_directory]: https://wiki.factorio.com/User_data_directory

Ratings & reviews

No ratings yet

Sign in to leave a rating or comment.