[0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Enhance Your Overall Game-Play.
Mod-Database, Calculators, Cheatsheets, Multiplayer, Scripts, Libs and Other Useful Stuff.

Re: [0.13-0.14] [Library]Factorio Standard Library Project 0.8.0

Postby Afforess » Thu Jan 12, 2017 4:04 am

The Factorio Standard Library 0.8.0 is released, with a number of additions and improvements:

Version 0.8.0 (No Breaking Changes)
  • Fixed loading error when train module was loaded before the game object existed
  • Fixed Trains.on_train_id_changed event not firing correctly
  • Deprecated Area.adjust, due to misleading name. (use Area.normalize instead)
  • Changed Surface.find_all_entities to support area search criteria
  • Changed Inventory.copy_inventory to support itemstacks with durability, health or ammo
  • Changed Trains.find_filtered to support the entity type in the search criteria. Defaults to 'locomotive'
  • Changed Entity.set_data/Entity.get_data to use a unit's unit_number as a key for data, enhancing performance for entities who have unit_numbers
  • Added Entity.set_industructible, toggles an entity so that it can not be damaged or mined by either the player or other forces
  • Added Entity.set_frozen, toggles an entity as inactive, making it inoperable and non-rotatable
  • Added Surface.get_surface_bounds, creates an area that represents the generated boundaries of a surface
  • Note: Thanks to Andy Hunt, Alex Aulbach, and Nexela for their contributions to 0.8.0!

Also note: The Factorio Standard Library 0.8.0 now requires Factorio 0.13.11+, 0.14.x or higher. Support for Factorio 0.12 has dropped. If for some reason, you need to support Factorio 0.12, stick with 0.7 or older releases. ;)
User avatar
Afforess
Filter Inserter
Filter Inserter
 
Posts: 421
Joined: Tue May 05, 2015 6:07 pm

Re: [0.13-0.14] [Library]Factorio Standard Library Project 0.8.0

Postby RalleYTN » Wed Feb 08, 2017 12:29 pm

Is this still up to date and maintained? If yes, do you mind if I use this as built in extra libraries, for the tool I'm making right now?
Link in my signature.
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: https://forums.factorio.com/viewtopic.php?f=137&t=40830.
User avatar
RalleYTN
Long Handed Inserter
Long Handed Inserter
 
Posts: 55
Joined: Wed Feb 01, 2017 7:14 am
Location: Germany

Re: [0.13-0.14] [Library]Factorio Standard Library Project 0.8.0

Postby Afforess » Sat Feb 11, 2017 5:25 am

RalleYTN wrote:Is this still up to date and maintained? If yes, do you mind if I use this as built in extra libraries, for the tool I'm making right now?
Link in my signature.

Yes it is. We encourage all mod developers to use stdlib in their projects wherever it is useful. Feel free to use it for tools and other libraries as well.

The project isn't terribly active because most of the features are complete and frequent releases aren't necessary. Factorio Stdlib is compatible with 0.13-0.14, and I plan on supporting 0.15 and later future versions as needed as well.
User avatar
Afforess
Filter Inserter
Filter Inserter
 
Posts: 421
Joined: Tue May 05, 2015 6:07 pm

Re: [0.13-0.14] [Library]Factorio Standard Library Project 0.8.0

Postby RalleYTN » Sat Feb 11, 2017 9:29 am

Afforess wrote:
RalleYTN wrote:Is this still up to date and maintained? If yes, do you mind if I use this as built in extra libraries, for the tool I'm making right now?
Link in my signature.

Yes it is. We encourage all mod developers to use stdlib in their projects wherever it is useful. Feel free to use it for tools and other libraries as well.

The project isn't terribly active because most of the features are complete and frequent releases aren't necessary. Factorio Stdlib is compatible with 0.13-0.14, and I plan on supporting 0.15 and later future versions as needed as well.


Is it too much if I would ask you to create a JSON file and include it in your project?
viewtopic.php?f=135&t=40830#p242179
with this format. it just so your library would have auto-completion(and error highlighting) in my tool.
:)
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: https://forums.factorio.com/viewtopic.php?f=137&t=40830.
User avatar
RalleYTN
Long Handed Inserter
Long Handed Inserter
 
Posts: 55
Joined: Wed Feb 01, 2017 7:14 am
Location: Germany

Re: [0.13-0.14] [Library]Factorio Standard Library Project 0.8.0

Postby Afforess » Wed Feb 15, 2017 2:15 pm

RalleYTN wrote:
Afforess wrote:
RalleYTN wrote:Is this still up to date and maintained? If yes, do you mind if I use this as built in extra libraries, for the tool I'm making right now?
Link in my signature.

Yes it is. We encourage all mod developers to use stdlib in their projects wherever it is useful. Feel free to use it for tools and other libraries as well.

The project isn't terribly active because most of the features are complete and frequent releases aren't necessary. Factorio Stdlib is compatible with 0.13-0.14, and I plan on supporting 0.15 and later future versions as needed as well.


Is it too much if I would ask you to create a JSON file and include it in your project?
viewtopic.php?f=135&t=40830#p242179
with this format. it just so your library would have auto-completion(and error highlighting) in my tool.
:)


Do you have a tool to auto-generate the json for autocompletion? I'd like to automate the process, rather than manually creating a file that describes the entire API.
User avatar
Afforess
Filter Inserter
Filter Inserter
 
Posts: 421
Joined: Tue May 05, 2015 6:07 pm

Re: [0.13-0.14] [Library]Factorio Standard Library Project 0.8.0

Postby RalleYTN » Wed Feb 15, 2017 3:22 pm

Afforess wrote:
RalleYTN wrote:
Afforess wrote:
RalleYTN wrote:Is this still up to date and maintained? If yes, do you mind if I use this as built in extra libraries, for the tool I'm making right now?
Link in my signature.

Yes it is. We encourage all mod developers to use stdlib in their projects wherever it is useful. Feel free to use it for tools and other libraries as well.

The project isn't terribly active because most of the features are complete and frequent releases aren't necessary. Factorio Stdlib is compatible with 0.13-0.14, and I plan on supporting 0.15 and later future versions as needed as well.


Is it too much if I would ask you to create a JSON file and include it in your project?
viewtopic.php?f=135&t=40830#p242179
with this format. it just so your library would have auto-completion(and error highlighting) in my tool.
:)


Do you have a tool to auto-generate the json for autocompletion? I'd like to automate the process, rather than manually creating a file that describes the entire API.

sadly no. but I can write one today and upload it here.

EDIT: but you would still have to type all the stuff manually.
I'm currently working on a tool that will allow everyone to create mods for Factorio without having to learn any of the complicated stuff.
Follow the development here: https://forums.factorio.com/viewtopic.php?f=137&t=40830.
User avatar
RalleYTN
Long Handed Inserter
Long Handed Inserter
 
Posts: 55
Joined: Wed Feb 01, 2017 7:14 am
Location: Germany

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby Afforess » Thu Apr 27, 2017 11:29 pm

As an FYI for concerned modders, early testing has not revealed any compatability issues with the current release of the standard library and Factorio 0.15. You should be able to continue to use the current release of 0.8.0 safely with Factorio 0.15.

Work on the next release with a number of bug fixes and improvements is proceeding.
User avatar
Afforess
Filter Inserter
Filter Inserter
 
Posts: 421
Joined: Tue May 05, 2015 6:07 pm

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby Nexela » Thu Apr 27, 2017 11:58 pm

Havn't reported it yet, but I believe stdlib/time is still using game.raise_event (should be using script.raise_event) other than that I have not come across any issues
Nexela
Smart Inserter
Smart Inserter
 
Posts: 1747
Joined: Wed May 25, 2016 11:09 am

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby Afforess » Fri Apr 28, 2017 12:05 am

Nexela wrote:Havn't reported it yet, but I believe stdlib/time is still using game.raise_event (should be using script.raise_event) other than that I have not come across any issues


Yeah I have already fixed that in the repository.
User avatar
Afforess
Filter Inserter
Filter Inserter
 
Posts: 421
Joined: Tue May 05, 2015 6:07 pm

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby golfmiketango » Tue Feb 13, 2018 2:11 am

Looks like they disabled _G.require in callbacks, breaking the console module. (And my heart, since I really wanted to do lazy loading :cry:)
golfmiketango
Filter Inserter
Filter Inserter
 
Posts: 497
Joined: Fri Jan 29, 2016 2:48 am

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby golfmiketango » Wed Feb 14, 2018 12:57 am

I have an stdlib question. If I wanted to hack on stdlib -- or just consume it in a fairly invasive way -- which branch of your git repo would you recommend I use as my upstream as of now (20180213)? For now I'm on top of data-library since I know whenever I call something "wip" in my own development it effectively means "broken." :)
golfmiketango
Filter Inserter
Filter Inserter
 
Posts: 497
Joined: Fri Jan 29, 2016 2:48 am

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby Nexela » Wed Feb 14, 2018 4:47 am

Data-library is the currently in development branch and is very much wip and data-library-wip is/was the OMG I am breaking things every time I type branch. (Actually I only did this branch because symlinks and I didn't want to update a bunch of mods until I was mostly done with it)

Most data-library branch changes will be backwards compatible with master (except for today where I said screw it and local'ed all the things. So with the exception of Event/Gui local whatever = require("stdlib.modname") is pretty much mandatory).

As for console stuff, that should be working just fine (the example usage was incorrect). Also nothing is loaded into globals by default but I did add a script you can run to add everything to all caps globals for use in console

local console = require("stdlib/utils/scripts/console")
require("stdlib/utils/scripts/load_globals")() --yes don't forget the ()
remote.add_interface("my-interface", {console = console})

in console,
local a = AREA(-1,-1,1,1):size();game.print(a)
Nexela
Smart Inserter
Smart Inserter
 
Posts: 1747
Joined: Wed May 25, 2016 11:09 am

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby golfmiketango » Wed Feb 14, 2018 5:10 am

Nexela wrote:Data-library is the currently in development branch and is very much wip and data-library-wip is/was the OMG I am breaking things every time I type branch. (Actually I only did this branch because symlinks and I didn't want to update a bunch of mods until I was mostly done with it)


ACK, comports with my assumptions, thanks :)

Nexela wrote:Most data-library branch changes will be backwards compatible with master (except for today where I said screw it and local'ed all the things. So with the exception of Event/Gui local whatever = require("stdlib.modname") is pretty much mandatory).

As for console stuff, that should be working just fine (the example usage was incorrect).


Aaah, now I get it... didn't figure that out from our github discussion on this.

Nexela wrote:require("stdlib/utils/scripts/load_globals")() --yes don't forget the ()


I see what you did there :). This is a great non-feature of the luas. I know you didn't ask but I approve.
golfmiketango
Filter Inserter
Filter Inserter
 
Posts: 497
Joined: Fri Jan 29, 2016 2:48 am

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby golfmiketango » Thu Feb 15, 2018 5:21 am

Nexela wrote:Most data-library branch changes will be backwards compatible with master (except for today where I said screw it and local'ed all the things. So with the exception of Event/Gui local whatever = require("stdlib.modname") is pretty much mandatory).

As for console stuff, that should be working just fine (the example usage was incorrect).


Hm... well I have been playing with this again but I'm still completely striking out (in the data-library branch).

A few things seem to be going on.

First, the console, event and gui modules appear to be in some kind of load-ordering gordian knot that I can't seem to unravel. I'm pretty sure the remaining Event.Gui reference in Gui.register is just a missed substitution from commit 536e9a77. So, OK, I change that. Even still things seem to be load-order sensitive. It's kind of like those modules are mad at me for using, i.e., local Gui = require('stdlib/event/gui') because it hides globals they wind up expecting to be floating around. This may have to do with the recent "local all the things" tip commit in the branch.

The end result is the same as before. I can bring up the console gui but the event code associated with the buttons does not fire when I press them.

To me it seems like Gui is doing it all wrong. It takes over the global handler for the events its interested in (but only if Event doesn't already consume them), and jams its own non-Event-registry-format entries into that the Event registry, relying on I'm-not-exactly-sure-what-but-probably-some-kind-of-subtle-side-effect to avoid breaking the primary Event dispatcher, meaning there is a 2x2 matrix of possible outcomes: events dispatched solely by Event or Gui in one dimension, and event-handler-registry entries in standard Event format or extended Gui format. All apparently must all be supported which seems pretty cray cray.

Why doesn't Gui just consume the conveniently multiplexable Event API like any other consumer, and handle them with it's own secondary dispatcher, using a private event_id={ pattern_spec = { <array of handlers> } } } registry to dispatch to tertiary listeners? Are we worried about the performance impact of hierarchical dispatch? That's the wrong place to get all optimiz-ey imo, it's just creating a muddle.

Maybe I'm missing some important reason for it to be this way?
golfmiketango
Filter Inserter
Filter Inserter
 
Posts: 497
Joined: Fri Jan 29, 2016 2:48 am

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby golfmiketango » Thu Feb 15, 2018 11:10 am

Squished that little fucker.

It was, to say the least, not a monster bug with tendrils deep in the bowels of stdlilb :roll:

https://github.com/Afforess/Factorio-Stdlib/pull/112
golfmiketango
Filter Inserter
Filter Inserter
 
Posts: 497
Joined: Fri Jan 29, 2016 2:48 am

Re: [0.13-0.15] [Library]Factorio Standard Library Project 0.8.0

Postby TRauMa » Wed May 02, 2018 3:29 pm

Hey, I see there's quite some active development on this, but no release for some time now. Right now the parts I'm interested in (table and string helpers) are of course usable, but still, I'd feel much better using a somewhat recent release instead of a git checkout. :)
TRauMa
Burner Inserter
Burner Inserter
 
Posts: 16
Joined: Fri Jan 15, 2016 3:48 pm

Previous

Return to Tools

Who is online

Users browsing this forum: No registered users and 2 guests