Search found 112 matches

by sdgmlj
Mon May 23, 2022 3:41 am
Forum: Modding help
Topic: How can I get the "index" of the current character in "script. On_init"
Replies: 4
Views: 234

Re: How can I get the "index" of the current character in "script. On_init"

The mod doesn't know whose computer it is running on--it runs on everyone's simultaneously. There is no "me", there is only player 1, player 2, etc. The mod can receive events every time any player does something like open a GUI or press a key, with a link to the player that did it. There...
by sdgmlj
Mon May 23, 2022 2:56 am
Forum: Modding help
Topic: How can I get the "index" of the current character in "script. On_init"
Replies: 4
Views: 234

Re: How can I get the "index" of the current character in "script. On_init"

Mod scripts run at the game level, and execute the same code on every player's machine. They can access every player's data all the time. To find every player's characters, use: for index, player in pairs(game.players) do local character = player.character if character ~= nil then -- Do stuff with ...
by sdgmlj
Mon May 23, 2022 1:13 am
Forum: Modding help
Topic: How can I get the "index" of the current character in "script. On_init"
Replies: 4
Views: 234

How can I get the "index" of the current character in "script. On_init"

This is included in multiplayer games. How can I get it? thank you
by sdgmlj
Sat May 21, 2022 4:34 am
Forum: Modding help
Topic: Is there any way to save the data of the table permanently
Replies: 6
Views: 240

Re: Is there any way to save the data of the table permanently

FuryoftheStars wrote:
Fri May 20, 2022 1:21 pm
Yes, but similar to a player trying to change the setting during a running game, (as far as I know) it will not persist between different games/saves.
Thank you. I see
by sdgmlj
Fri May 20, 2022 5:38 am
Forum: Modding help
Topic: Is there any way to save the data of the table permanently
Replies: 6
Views: 240

Re: Is there any way to save the data of the table permanently

The global table cannot be used between different save files. Any “settings” of that nature that you need to persist between different games, you’ll need to use actual settings for (https://wiki.factorio.com/Tutorial:Mod_settings). Note that the user will need to set these from the main menu in ord...
by sdgmlj
Fri May 20, 2022 5:18 am
Forum: Modding help
Topic: Is there any way to save the data of the table permanently
Replies: 6
Views: 240

Re: Is there any way to save the data of the table permanently

What table? There is the "global" table available to each mod that is saved and load from the save file. You can store things you need need to persist there. There are some limitations, though. There was a discussion about it not too long ago: https://forums.factorio.com/viewtopic.php?f=2...
by sdgmlj
Fri May 20, 2022 4:02 am
Forum: Modding help
Topic: Is there any way to save the data of the table permanently
Replies: 6
Views: 240

Is there any way to save the data of the table permanently

I mean, when I start a new game, I automatically read the data of the table
by sdgmlj
Thu May 19, 2022 11:54 am
Forum: Ideas and Requests For Mods
Topic: Mod to enable filter on chest slots
Replies: 16
Views: 763

Re: Can such module function be realized?

No, that's the problem with (ab)using different entity types for unintended purposes. Such tooltips are hardcoded into the game. Thank you. I don't know anything about this. Although this does not affect the use, it always feels imperfect. However, I found that some mods can add some "false in...
by sdgmlj
Thu May 19, 2022 8:54 am
Forum: Ideas and Requests For Mods
Topic: Mod to enable filter on chest slots
Replies: 16
Views: 763

Re: Can such module function be realized?

I did end up making a car-type container mod if you want to experiment with it. I think I left filtering enabled. It would be possible to make a 1x1 grid-snapped version, I suppose. https://mods.factorio.com/mod/shipping-containers Can I give you a suggestion? Can the following information be hidde...
by sdgmlj
Thu May 19, 2022 8:39 am
Forum: Modding help
Topic: How can I close a GUI without "name"?
Replies: 2
Views: 94

Re: How can I close a GUI without "name"?

I want to close the GUI of other mods in my mod and replace it with my GUI, but his GUI doesn't have "name", so how can I close it? He wrote: global.inserter_guis[player.index] = player.gui.relative.add{ type = "frame", caption = { "aaaaa" }, anchor = {...................
by sdgmlj
Thu May 19, 2022 3:16 am
Forum: Modding help
Topic: How can I close a GUI without "name"?
Replies: 2
Views: 94

How can I close a GUI without "name"?

I want to close the GUI of other mods in my mod and replace it with my GUI, but his GUI doesn't have "name", so how can I close it? He wrote: global.inserter_guis[player.index] = player.gui.relative.add{ type = "frame", caption = { "aaaaa" }, anchor = {................ ...
by sdgmlj
Thu May 19, 2022 3:03 am
Forum: Ideas and Requests For Mods
Topic: Mod to enable filter on chest slots
Replies: 16
Views: 763

Re: Can such module function be realized?

robot256 wrote:
Thu May 19, 2022 12:24 am
I did end up making a car-type container mod if you want to experiment with it. I think I left filtering enabled. It would be possible to make a 1x1 grid-snapped version, I suppose.

https://mods.factorio.com/mod/shipping-containers
OK, I fully support you
by sdgmlj
Wed May 18, 2022 11:22 pm
Forum: Outdated/Not implemented
Topic: Can the minerals in the starting area not be connected together
Replies: 6
Views: 228

Re: Can the minerals in the starting area not be connected together

Or can this setting be changed by modifying a parameter? Which friend can tell me that I can modify it myself. Thank you :D
by sdgmlj
Wed May 18, 2022 11:14 pm
Forum: Outdated/Not implemented
Topic: Can the minerals in the starting area not be connected together
Replies: 6
Views: 228

Re: Can the minerals in the starting area not be connected together

I know that the original intention of developers is to make the starting area have various minerals, but please let them have a certain distance. Of course, this is only my personal idea. Whether to adopt it or not depends on you, but I don't think this change will have a bad impact on the game
by sdgmlj
Wed May 18, 2022 11:09 pm
Forum: Outdated/Not implemented
Topic: Can the minerals in the starting area not be connected together
Replies: 6
Views: 228

Re: Can the minerals in the starting area not be connected together

Ooo, I like that logistical challenge. :twisted: That aside, do you happen to have any of the generation sliders for ores and starting area set to anything other than default? (Just checking! :D ) I have tested that modifying the size and quantity of minerals can not change whether the minerals in ...
by sdgmlj
Wed May 18, 2022 11:04 pm
Forum: Ideas and Requests For Mods
Topic: Mod to enable filter on chest slots
Replies: 16
Views: 763

Re: Can such module function be realized?

It's the same reason they give for not filtering LuaInventory objects, and for not connecting certain things to the circuit network. It's always a cost-benefit equation, based on the number of chests in a typical game, versus the number of players who will actually use the filtering feature, versus...
by sdgmlj
Wed May 18, 2022 8:35 am
Forum: Outdated/Not implemented
Topic: Can the minerals in the starting area not be connected together
Replies: 6
Views: 228

Can the minerals in the starting area not be connected together

In the initial area, there is a great chance that the minerals will be connected together, so we don't like it very much. It's best to have a certain distance between them
by sdgmlj
Fri Apr 29, 2022 3:14 pm
Forum: Modding help
Topic: Ask for a Lua syntax
Replies: 4
Views: 226

Re: Ask for a Lua syntax

action = { { type = "direct", action_delivery = { { type = "projectile", projectile = "anti-material-rifle-ammo-3", starting_speed = 3, direction_deviation = 0.02, range_deviation = 0.02, max_range = 50, source_effects = { { type = "create-explosion", entity_...
by sdgmlj
Fri Apr 29, 2022 2:50 pm
Forum: Modding help
Topic: Ask for a Lua syntax
Replies: 4
Views: 226

Re: Ask for a Lua syntax

a[1]["b"] or a[1].b both work. Thank you, but it still reported an error attempt to index field'?'(a nil value) The content of the original script is as follows: action = { { type = "direct", action_delivery = { { type = "projectile", projectile = "anti-material-r...
by sdgmlj
Fri Apr 29, 2022 2:12 pm
Forum: Modding help
Topic: Ask for a Lua syntax
Replies: 4
Views: 226

Ask for a Lua syntax

There are two layers of braces in a table. How can I get its value?
For example:
a = {
{
b = 5
},
}
a.b = 5 ?? That's wrong,How can I express it?

Go to advanced search