Search found 1822 matches

by Nexela
Wed Nov 07, 2018 12:49 am
Forum: Resolved Problems and Bugs
Topic: 0.16.51 - Multiple entities on same position not found by API call
Replies: 5
Views: 1859

Re: 0.16.51 - Multiple entities on same position not found by API call

Entities are created on a grid unless the off-grid flag is set The pole is being created at {x.4245234, y.32423} then being grid moved to x.5 and y.5 The hidden entity has the off-grid flag so it is not being moved to be on the grid. hence you won't find the hidden entity at the lights position Or m...
by Nexela
Sat Oct 20, 2018 1:06 am
Forum: Modding help
Topic: entity.destroy() makes new item-on-the-ground
Replies: 2
Views: 372

Re: entity.destroy() makes new item-on-the-ground

entity.destroy() is not making a new item, fast_replace = true is It simulates fast_replacing an entity, if there is no player associated to the create_entity event then the item from mining is spilled to the ground. so you need to add spill=false I think this next bit applies to later versions of ....
by Nexela
Thu Oct 18, 2018 1:38 am
Forum: Won't fix.
Topic: data:extend({nil}) does not error, but causes the NEXT prototype to fail to register
Replies: 4
Views: 878

Re: data:extend({nil}) does not error, but causes the NEXT prototype to fail to register

function data.extend(self, otherdata) if type(otherdata) ~= table_string or #otherdata == 0 then error("Invalid prototype array " .. serpent.block(otherdata, {maxlevel= 1})) end for _, e in ipairs(otherdata) do Not a bug in the sense that it is doing what ipairs does by stopping iteration...
by Nexela
Fri Oct 05, 2018 11:54 pm
Forum: Modding help
Topic: Create a function that will work for 10 ticks when it is called.
Replies: 5
Views: 704

Re: Create a function that will work for 10 ticks when it is called.

With a quick glance, none of the proposed soultions are multiplayer safe If you ALREADY have a tick handler I use something like this local function print_in_10(msg) global.future[game.tick] = msg end script.on_init(function() global.future = {} end) script.on_tick(function() -- stuff if global.futu...
by Nexela
Fri Oct 05, 2018 11:41 pm
Forum: Mods
Topic: [MOD 0.12.26] Picker: Easily select items from inventory
Replies: 125
Views: 40111

Re: [MOD 0.12.26] Picker: Easily select items from inventory

It doesn't "just" use up memory. It does stuff with it. It is just doing too much stuff on a big map (mostly find_entities migration fixes). For .17 I have removed some of the migration files as they shouldn't be needed anymore.
by Nexela
Tue Oct 02, 2018 1:55 am
Forum: Modding discussion
Topic: Mod event handlers
Replies: 17
Views: 2158

Re: Add the ability to influence item loot in lua

Yes it adds more overhead, but so do most libraries. is it perfect no, but it does a nice job and catches most of the issues.
by Nexela
Tue Oct 02, 2018 12:06 am
Forum: Modding discussion
Topic: Mod event handlers
Replies: 17
Views: 2158

Re: Add the ability to influence item loot in lua

If the entity becomes invalid no further events for that entity will be raised. So all you need to worry is what you do in your own event after destroying the entity. OP is using a library that doesn't handle this correctly ( ahem stdlib ahem ), so the event subscribers still get called. Ahem lies,...
by Nexela
Sat Sep 29, 2018 9:28 pm
Forum: Modding discussion
Topic: 0.17 Mod/Script changelog as of February 25 2019
Replies: 20
Views: 8611

Re: 0.17 Mod/Script changelog as of September 24 2018

Checking the list after some time...oh, nice more delicious cookies =). Added highlight-box entity that can be passed a "bounding_box" or "source" entity parameter to display a highlight box around an area or entity. Added LuaPlayer::create_local_flying_text(). Can i assume that...
by Nexela
Sat Sep 29, 2018 3:24 pm
Forum: Modding discussion
Topic: Friday Facts 262 Lua script access
Replies: 4
Views: 866

Re: Friday Facts 262 Lua script access

eradicator wrote:
Sat Sep 29, 2018 10:14 am
Also can you confirm that the require __mod__/file.lua actually works limitless? I.e. things like factorio-stdlib now finally don't need to be copied for every single mod anymore? (because the example explicitly mentions scenarios requiring mods, not mods requiring mods.)
Confirmed
by Nexela
Mon Sep 10, 2018 12:18 am
Forum: Mods
Topic: [MOD 0.14] Text Plates
Replies: 91
Views: 22639

Re: [MOD 0.14] Text Plates

It goes back to that Nexela guy using on_built_entity for this. I will change it for .17 version to use on_robot_built_entity. Chances are I won't have the time to do anything with the .16 version though In the meantime you could probably do an if event.mod_name == "Nanobots" do robot buil...
by Nexela
Wed Aug 29, 2018 3:44 am
Forum: Modding help
Topic: Cant access technologies in control.lua[Solved]
Replies: 7
Views: 977

Re: Cant access technologies in control.lua

Why are you using a library to do logging when you can just do: log("your contents here") ? Thanks! The problem was actually the logger, which for some reason only printed one line. The only reason i used it was to get all of the log into a separate file, but im not sure if that is possib...
by Nexela
Tue Aug 28, 2018 11:37 pm
Forum: Modding interface requests
Topic: "Evaluation" functions for surface.find_entities_filtered
Replies: 13
Views: 1567

Re: "Evaluation" functions for surface.find_entities_filtered

find_entities_filtered should return nil if the table is empty Why? All that would do is add more lua code bloat :) for _ in pairs(s.find_entities_filtered{}) do vs hacks which add an extra step like for _ in pairs(s.find_entities_filtered{} or {}) do local ents = s.find_entities_filtered{} if s th...
by Nexela
Sun Aug 26, 2018 9:18 pm
Forum: Mod portal Discussion
Topic: Description and Category improvments
Replies: 0
Views: 478

Description and Category improvments

If a mod has a 'readme.md' file in the root and the description in the portal edit box is blank it should use the readme as the description. Category could be read from the info.json as a string (or array depending on how it is set up), And if the category string doesn't match a valid category (typo...
by Nexela
Sat Aug 25, 2018 7:40 pm
Forum: Mods
Topic: [MOD 0.12.26] Picker: Easily select items from inventory
Replies: 125
Views: 40111

Re: [MOD 0.12.26] Picker: Easily select items from inventory

When loading my map: Error while applying migration: Picker Extended Version: migration_0.6.2.lua LuaEntity API call when LuaEntity was invalid. stack traceback: __PickerExtended__/migrations/migration_0.6.2.lua:4: in main chunk You should be able to safely delete the file for Single player at leas...
by Nexela
Sat Aug 25, 2018 7:23 pm
Forum: Mods
Topic: [MOD 0.12.26] Picker: Easily select items from inventory
Replies: 125
Views: 40111

Re: [MOD 0.12.26] Picker: Easily select items from inventory

Error is being generated when PickerExtended tries to automatically sort the equipment grid on armors. Turning off "Automatically sort chests" prevents the error. For now the solution is to turn auto sorting off. I doubt I will get time for another .16 release but it should be fixed for .17
by Nexela
Fri Aug 24, 2018 12:26 am
Forum: Mods
Topic: [MOD 1.1] Squeak Through 1.8.2
Replies: 113
Views: 81073

Re: [MOD 0.16] Squeak Through 1.2.2

It is a great suggestion. And a simple one too :)
by Nexela
Thu Aug 23, 2018 2:05 am
Forum: Mods
Topic: [MOD 1.1] Squeak Through 1.8.2
Replies: 113
Views: 81073

Re: [MOD 0.16] Squeak Through 1.2.2

ownlyme wrote:wasnt sure if you will get my message in the mod discussion so im posting it here too:

maybe you could check for a prototype flag like "ignore_squeak_through = true," so you don't need to provide support for every individual mod
thx
This wins the internet!
by Nexela
Sat Aug 18, 2018 12:37 am
Forum: Modding help
Topic: [0.16.51] [Solved] Desync with random generator
Replies: 25
Views: 2573

Re: [0.16.51] Desync with entity property operations.

Note, although the global table has not been setup if a mod does populate the table with some data it will be overwritten by any loaded data. So...that bit should behave pretty much the same as setting default values via "global.key = global.key or value" in on_init. And as such it might ...
by Nexela
Sat Aug 11, 2018 4:00 am
Forum: Modding help
Topic: Format for prototype files within subfolders
Replies: 10
Views: 1023

Re: Format for prototype files within subfolders

@Nexela: to read a variable from some module right after it has been required is something only someone who already knows the "second require gets the same thing" quirk would try. That is example enough because this has bit me :P re: typos and short examples I am on a laptop typing sidewa...
by Nexela
Thu Aug 09, 2018 11:35 pm
Forum: Modding help
Topic: Format for prototype files within subfolders
Replies: 10
Views: 1023

Re: Format for prototype files within subfolders

I suggest using the same "a/b" format that Factorio uses. As long as it's consistent within a mod i don't see any difference. Also the whole "requiring the same thing again doesn't actually load it a second time" feature of lua is probably something that 99% of modders don't eve...

Go to advanced search