Search found 151 matches

by yagaodirac
Tue Apr 20, 2021 1:53 pm
Forum: Modding help
Topic: [1.1.32]Reference counting in lua memory managing doesn't function properly.
Replies: 7
Views: 525

[1.1.32]Reference counting in lua memory managing doesn't function properly.

I also post this to bug report. Also, I would ask, if this is correct according to the memory mechanism in lua. I remember the referencing mechanism is something called reference counting. If variable a stores a table, then b = a, after this assignment, a still store the pointer to the table. But in...
by yagaodirac
Tue Apr 20, 2021 7:17 am
Forum: Not a bug
Topic: [1.1.32]Metatable doesn't work in multiplayer.
Replies: 3
Views: 335

[1.1.32]Metatable doesn't work in multiplayer.

It seems that metatable feature doesn't function in multiplayer. global = global or {} global.mt = global.mt or {} global.mt.array_simple = {} global.mt.array_simple.__newindex = function()end global.mt.array_simple.__index = global.mt.array_simple function global.mt.array_simple:add(element) self.l...
by yagaodirac
Tue Apr 20, 2021 1:07 am
Forum: Modding help
Topic: Desync from my scenario.
Replies: 4
Views: 322

Re: Desync from my scenario.

OK, thanks a lot. Now I know why the very famous scenario( such as Mnt fortress) stores most of the data in a "global" variable. You should write more info about this desync error in the document. I saw the doc-html/Global.html but didn't guess that deeply. Now I know, If all the mutable ...
by yagaodirac
Sun Apr 18, 2021 7:25 am
Forum: Modding help
Topic: Desync from my scenario.
Replies: 4
Views: 322

Re: Desync from my scenario.

The upload feature doesn't work at all. So you don't see anything. https://mods.factorio.com/mod/OreBeach Literally, host it in a server, link to it, and you are gonna see what I encountered. I guess your suggestion is using the global variable to store data because all the data inside that table i...
by yagaodirac
Sat Apr 17, 2021 4:05 am
Forum: Modding help
Topic: Desync from my scenario.
Replies: 4
Views: 322

Desync from my scenario.

I made a scenario. The script in this scenario modifies the amount of ore entities every 5 seconds. I works perfect on my own pc when I debug. But when I deploy it on a server and link to it from my Factorio started from Steam, the desync occurs. Besides, when it's server and clients, none of us has...
by yagaodirac
Sun Mar 14, 2021 2:43 am
Forum: Modding help
Topic: some biter entity.set_command seems to be super slow?
Replies: 4
Views: 366

Re: some biter entity.set_command seems to be super slow?

I made a scenario with only control.lua file. I tried to set command both via a lua table(directly set to every biter) or a unit group. The direct way doesn't work in crowded situation. And if the distraction set to by_enemy, the biters disappear after 10ish seconds. The indirect way( via a unit gr...
by yagaodirac
Sun Mar 14, 2021 2:36 am
Forum: Modding help
Topic: some biter entity.set_command seems to be super slow?
Replies: 4
Views: 366

Re: some biter entity.set_command seems to be super slow?

orzelek wrote:
Sat Mar 13, 2021 2:52 pm
Yes, it must be very reliable.
by yagaodirac
Sat Mar 13, 2021 2:07 pm
Forum: Pending
Topic: set_command for biters sometimes doesn't work.
Replies: 1
Views: 210

set_command for biters sometimes doesn't work.

distraction = defines.distraction.by_none doesn't guarantee the biters not be distracted. Biters sometimes follow the command for 1 or 2 seconds and then get distracted. With some biter.set_command{type = defines.command.go_to_location, destination = somewhere, radius = 20 to 30, distraction = defin...
by yagaodirac
Sat Mar 13, 2021 2:02 pm
Forum: Modding help
Topic: some biter entity.set_command seems to be super slow?
Replies: 4
Views: 366

some biter entity.set_command seems to be super slow?

For some reason, I have to call this function every 100 ticks or even more frequently. Every time I have to call this on 10k biters. The tick I call this, the game lag for a third second. Any suggestions?
by yagaodirac
Thu Mar 11, 2021 8:38 am
Forum: Ideas and Suggestions
Topic: Fully customizable recipe in locked assembly machine WITHOUT MOD.
Replies: 9
Views: 680

Re: Fully customizable recipe in locked assembly machine WITHOUT MOD.

I solved this problem with a very unintuitive way. I manage combinations of "filtered-inserter" and "wooden-chest". The filter sluts of filtered inserter are set to the ingredients and then items are changed in chest. Inserter gets rotated to grab items out. Now everything is und...
by yagaodirac
Thu Mar 11, 2021 8:34 am
Forum: Ideas and Suggestions
Topic: Fully customizable recipe in locked assembly machine WITHOUT MOD.
Replies: 9
Views: 680

Re: Fully customizable recipe in locked assembly machine WITHOUT MOD.

AmericanPatriot wrote:
Tue Mar 09, 2021 12:59 am
It sounds to me like he wants to create a scenario with random recipe machines spread around the map.
The recipes won’t be set by the payer, but by a script.
Yeah. That's it.
by yagaodirac
Wed Mar 10, 2021 1:51 am
Forum: Ideas and Suggestions
Topic: Add a field on each entity in game.
Replies: 6
Views: 424

Re: Add a field on each entity in game.

Xorimuth wrote:
Tue Mar 09, 2021 2:41 pm
Oh, really? This is very good. But it's not direct enough. I still have to maintain a container, or a dictionary to store all the index which is somehow similar to the code I post upon.
by yagaodirac
Tue Mar 09, 2021 2:09 pm
Forum: Ideas and Suggestions
Topic: Add a field on each entity in game.
Replies: 6
Views: 424

Re: Add a field on each entity in game.

For now, my container looks something like this: A folder named FObject. Inside it are 2 files. --FObject.lua: -------------- INCLUDE ---------------- require "coord-to-FObject-index" --------------MEMBER FUNCTION---------------- --------------MEMBER FUNCTION---------------- -------------...
by yagaodirac
Tue Mar 09, 2021 2:05 pm
Forum: Ideas and Suggestions
Topic: Add a field on each entity in game.
Replies: 6
Views: 424

Re: Add a field on each entity in game.

bormand wrote:
Tue Mar 09, 2021 1:45 pm
Most entities have unique unit_number, as far as I remember. Would it be enough in this case?
I doesn't seem very enough. In the official docs downloaded with game, "The unit number or nil if the entity doesn't have one.". It doesn't guarantee.
I'm about to post my code.
by yagaodirac
Tue Mar 09, 2021 1:40 pm
Forum: Ideas and Suggestions
Topic: Add a field on each entity in game.
Replies: 6
Views: 424

Add a field on each entity in game.

TL;DR Now I need something to link the in game entity and the lua data in backend from my scenario in BOTH direction. What ? It's very easy to assign an entity to a variable in lua: local entities = surface.find_entities_filtered(...) (some directive to find out the entity I want, then) some_lua_ta...
by yagaodirac
Mon Mar 08, 2021 8:01 am
Forum: Ideas and Suggestions
Topic: Fully customizable recipe in locked assembly machine WITHOUT MOD.
Replies: 9
Views: 680

Re: Fully customizable recipe in locked assembly machine WITHOUT MOD.

ickputzdirwech wrote:
Sun Mar 07, 2021 9:35 am
Silari wrote:
Sun Mar 07, 2021 11:11 pm
Hi, I replied in 4th layer. I Hope it helps.
by yagaodirac
Mon Mar 08, 2021 7:58 am
Forum: Ideas and Suggestions
Topic: Fully customizable recipe in locked assembly machine WITHOUT MOD.
Replies: 9
Views: 680

Re: Fully customizable recipe in locked assembly machine WITHOUT MOD.

To both of the friends replied in this page. Actually, only the ingredients list is NOT modifiable with out a mod. The production is possible to change(first, get the inventory, then change the content). The energy is possible to change(surface -> find entity -> entity.energy+=100000000). The crafti...
by yagaodirac
Sun Mar 07, 2021 2:43 am
Forum: Ideas and Suggestions
Topic: Keep the internet game list for a while.
Replies: 3
Views: 355

Keep the internet game list for a while.

TL;DR
For some place, the internet doesn't perform very well. Download the internet game list is always very slow, like 5 to 10 minutes. Minutes, not seconds.
What ?
If the linking to a game fails, the list has to be downloaded again, which could be another 5 minutes. I mean, 5 minutes.
by yagaodirac
Sun Mar 07, 2021 2:39 am
Forum: Ideas and Suggestions
Topic: Soft game restart for mods without image change.
Replies: 1
Views: 213

Soft game restart for mods without image change.

TL;DR Compiling is fast. Only image processing is slow. What ? When I make mod, every time the game restarts, 2/9 seconds for compiling, 7/9 seconds for image processing. If the game is set to high graphics quality, the compiling time doesn't increase very much, shouldn't be longer than 5 seconds. ...
by yagaodirac
Sun Mar 07, 2021 2:33 am
Forum: Ideas and Suggestions
Topic: Fully customizable recipe in locked assembly machine WITHOUT MOD.
Replies: 9
Views: 680

Fully customizable recipe in locked assembly machine WITHOUT MOD.

TL;DR Once the assembly machine is set to recipe_lock, the recipe inside should be totally customizable, the ingredients, productions, energy consumption, duration. I mean, everything. What ? Sometimes, we want to provide some automatic item conversion for players. The shop doesn't do the job autom...

Go to advanced search