Search found 251 matches

by justarandomgeek
Thu Jan 09, 2020 4:48 am
Forum: Modding discussion
Topic: Factorio, Lua and OO
Replies: 15
Views: 553

Re: Factorio, Lua and OO

Cool, I didn't know that. The more you know. :) I'm assuming the first one is more performant. I wonder I I can trick to the compiler into generating these SELF instructions, because I'm fairly sure that my approach is going the GETTABLE/MOVE route. Anyway, from a code standpoint, it doesn't really...
by justarandomgeek
Thu Jan 02, 2020 12:53 am
Forum: Modding discussion
Topic: Factorio, Lua and OO
Replies: 15
Views: 553

Re: Factorio, Lua and OO

Lua doesn't have a real concept of self. The only thing close to it is using ":" syntax to call a "method" instead of ".". Well, it kinda does. The ':' call syntax compiles to a different lua vm opcode, SELF which does the lookup operation and prepares the resulting function and the parent object i...
by justarandomgeek
Tue Nov 26, 2019 1:27 am
Forum: Resolved for the next release
Topic: [0.17.79] util.ismoduleavailable throws when the argument is not already loaded
Replies: 2
Views: 157

Re: [0.17.79] util.ismoduleavailable throws when the argument is not already loaded

Thanks for report. I deleted the function since it's no longer valid anyway. You can check if a mod exists by checking "if mods[name]" before doing the require. If you don't know if the file exists even if the mod exists I question why anyone would want to write that code. The `mods` table isn't av...
by justarandomgeek
Mon Nov 25, 2019 7:25 pm
Forum: Resolved for the next release
Topic: [0.17.79] util.ismoduleavailable throws when the argument is not already loaded
Replies: 2
Views: 157

[0.17.79] util.ismoduleavailable throws when the argument is not already loaded

It looks like this was intended in the past to solve the problem of "require these files if they are available", but fell out of use in favor of the is_demo flag, and then was unnoticed when `package` was stripped. It now throws a scripterror when it attempts to use `package.searchers or package.loa...
by justarandomgeek
Fri Nov 15, 2019 8:22 pm
Forum: Ideas and Suggestions
Topic: Headless server console `/timings` command to list Update timings
Replies: 0
Views: 77

Headless server console `/timings` command to list Update timings

It might be useful for comparing server vs client UPS issues to be able to print the timings (similar to the in-game Update tree) to a headless server's console with a command
by justarandomgeek
Thu Nov 14, 2019 9:14 pm
Forum: Modding discussion
Topic: Breaking change/fix: script.raise_event rework - opinions wanted
Replies: 88
Views: 3175

Re: Breaking change/fix: script.raise_event rework - opinions wanted

Sounds like we've got a few volunteers to write all the checks ;)
by justarandomgeek
Tue Nov 12, 2019 8:16 pm
Forum: Modding interface requests
Topic: control behaviour type of an entity prototype
Replies: 7
Views: 262

Re: control behaviour type of an entity prototype

Edit2: If your planned feature of adding an entity to a blueprint should rely on the same functions as the construction order, it would be in your interest to read the control behaviour type of an entity prototype, just like this topic initially suggested. I eventually arrived at this conclusion as...
by justarandomgeek
Tue Nov 12, 2019 7:57 pm
Forum: Modding discussion
Topic: Breaking change/fix: script.raise_event rework - opinions wanted
Replies: 88
Views: 3175

Re: Breaking change/fix: script.raise_event rework - opinions wanted

eradicator wrote:
Tue Nov 12, 2019 7:12 pm
100% of mods that have more than one event handler for the event can't meaningfully use it (this includes anything using stdlib).
Sounds like someone shoehorning multiple mods into a single package, rather than actually separating them properly!
by justarandomgeek
Mon Nov 11, 2019 7:50 pm
Forum: Modding interface requests
Topic: control behaviour type of an entity prototype
Replies: 7
Views: 262

Re: control behaviour type of an entity prototype

In version 0.17.2, if you place an entity over an existing entity of the same name, it just places a ghost entity at that position and does not overwrite the existing entity. Working as designed. Decon the original one first. snip This is my modified control of version 0.17.2. The core idea is repl...
by justarandomgeek
Mon Nov 11, 2019 7:24 pm
Forum: Modding interface requests
Topic: control behaviour type of an entity prototype
Replies: 7
Views: 262

Re: control behaviour type of an entity prototype

For one thing, you may want to use ConMan from github master, or wait another day or so for me to release that version, which handles all entities control behaviors correctly already. But also, what did you find not working, and why did you not report it on github, where i'll actually see it to fix ...
by justarandomgeek
Sun Nov 10, 2019 9:06 pm
Forum: Modding discussion
Topic: Breaking change/fix: script.raise_event rework - opinions wanted
Replies: 88
Views: 3175

Re: Breaking change/fix: script.raise_event rework - opinions wanted

Btw, here's another usecase for manually raising on_build: If i use create_entity{raise_build=true} then another mod could destroy the created entity before i even ever see it. Therefor function() create_entity{raise_build=false} --dostuff script.raise_event(defines.events.on_built,...) end means i...
by justarandomgeek
Sat Nov 09, 2019 6:01 pm
Forum: Modding discussion
Topic: Breaking change/fix: script.raise_event rework - opinions wanted
Replies: 88
Views: 3175

Re: Breaking change/fix: script.raise_event rework - opinions wanted

I don't like the create_entity, revive_entity, or destroy_entity because these events aren't fired by anything in the base game. The context of these events is nearly identical to on_entity_built and on_entity_died, but the likelihood of mods supporting these events is reduced and thus the chance o...
by justarandomgeek
Fri Nov 08, 2019 2:39 am
Forum: Modding discussion
Topic: Breaking change/fix: script.raise_event rework - opinions wanted
Replies: 88
Views: 3175

Re: Breaking change/fix: script.raise_event rework - opinions wanted

Makes me wish (again) for full-text search of all mods published on the portal, to find out who's actually doing raise_event and where/why!
by justarandomgeek
Thu Nov 07, 2019 12:17 am
Forum: Modding discussion
Topic: Breaking change/fix: script.raise_event rework - opinions wanted
Replies: 88
Views: 3175

Re: Breaking change/fix: script.raise_event rework - opinions wanted

eradicator wrote:
Wed Nov 06, 2019 6:53 pm
The main problem here is: If i fail at convincing you that my edge case is worth implementing an extra "raise_x" then my only option would be to not raise anything at all.
No, your option is to raise your own event.
by justarandomgeek
Tue Nov 05, 2019 4:51 pm
Forum: Modding discussion
Topic: Breaking change/fix: script.raise_event rework - opinions wanted
Replies: 88
Views: 3175

Re: Breaking change/fix: script.raise_event rework - opinions wanted

I generally like this change, and would propose one further one: if you're changing how custom events work anyway, it would be nice to register them as names so that you can provide an event without having to provide a remote.call to list your events (especially if you otherwise don't need the remot...
by justarandomgeek
Wed Sep 11, 2019 5:42 pm
Forum: Implemented mod requests
Topic: Include captured entity's unit_number in blueprint entity data
Replies: 30
Views: 1018

Re: Include captured entity's unit_number in blueprint entity data

The problem with unit number, is that it only really applies in that 1 save, Once the blueprint is made, it can be used in other saves, exported, imported, moved around, etc. And having it then always with that blueprint, might give people the wrong impresssion I guess i didn't make very clear in m...
by justarandomgeek
Wed Sep 11, 2019 1:58 pm
Forum: Implemented mod requests
Topic: Include captured entity's unit_number in blueprint entity data
Replies: 30
Views: 1018

Re: Include captured entity's unit_number in blueprint entity data

Was there a reason for not adding tags to live entities too? That would pretty much remove the correlation problem, as it would have already captured the entity's tags, and then we can adjust that in the blueprint if required. Runtime memory overhead and save file size. Would it really be so much w...
by justarandomgeek
Tue Sep 10, 2019 11:42 pm
Forum: Implemented mod requests
Topic: Include captured entity's unit_number in blueprint entity data
Replies: 30
Views: 1018

Re: Include captured entity's unit_number in blueprint entity data

Was there a reason for not adding tags to live entities too? That would pretty much remove the correlation problem, as it would have already captured the entity's tags, and then we can adjust that in the blueprint if required.
by justarandomgeek
Fri Sep 06, 2019 6:36 pm
Forum: Implemented mod requests
Topic: Include captured entity's unit_number in blueprint entity data
Replies: 30
Views: 1018

Include captured entity's unit_number in blueprint entity data

Since we can now store entity tags in blueprints, it would be useful to have a direct way to match them up (during on_player_configured_blueprint, for example) to the entities in the real world to copy the relevant config into tags. If the blueprint captured the original unit number, this could be u...
by justarandomgeek
Tue Sep 03, 2019 2:35 pm
Forum: Releases
Topic: Version 0.17.67
Replies: 28
Views: 9040

Re: Version 0.17.67

Yea. I saw that. But this is a huge leap in the right direction (Thanks btw to everyone who had a hand at this). And i wouldn't even know *how* to officially support better linking. Some kind of callback-capable on_blueprinted event? Does the engine even support returning values from event handlers...

Go to advanced search