Search found 123 matches

by sdgmlj
Thu Mar 17, 2022 1:52 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 1262

Re: Help, game error - no character

Thank you. My problem has been solved. The friends in this forum are very enthusiastic and have helped me solve many problems. I'm really happy! You're welcome! Glad I could help. I wish you a happy life! friend :D :D :D Thanks, same to you! By the way, if your mod is ready, post a link to it, plea...
by sdgmlj
Wed Mar 16, 2022 1:08 pm
Forum: General discussion
Topic: When will the new DLC be released?
Replies: 9
Views: 1802

Re: When will the new DLC be released?

Because I like this game, but I'm afraid my youth won't allow it What does your youth not allow? Like you said, whether you play or not, you will buy... Exact dates are still a bit early I fear. Those are the current official news: https://factorio.com/blog/post/fff-365 https://factorio.com/blog/po...
by sdgmlj
Wed Mar 16, 2022 12:01 pm
Forum: General discussion
Topic: When will the new DLC be released?
Replies: 9
Views: 1802

When will the new DLC be released?

I can wait, but I'm afraid my youth won't allow it! The official version made me from 30 to nearly 40, How much youth do I have? If the new DLC is released, the following things I must do: 1. I will buy it no matter how much it is 2. Whether it's fun or not, I'll buy it. Even if I don't play, I'll b...
by sdgmlj
Wed Mar 16, 2022 11:40 am
Forum: Ideas and Suggestions
Topic: Rocket Silo should connect to circuit network
Replies: 50
Views: 7200

Re: Why doesn't the rocket silo support signal connection?

Although some modules can solve this problem Not sure if you mean modules (=small items that can be plugged into some devices to enhance their capabilities) or mods (=modifications, extensions to the core game). the government :D The devs might like to be called like so. 8-) Why is my post here? I ...
by sdgmlj
Tue Mar 15, 2022 11:50 pm
Forum: Ideas and Suggestions
Topic: Rocket Silo should connect to circuit network
Replies: 50
Views: 7200

Why doesn't the rocket silo support signal connection?

Is that hard?
Although some modules can solve this problem, I don't want to add a module for a small function, and there are some useless functions. I still hope the government can support it, which will be much more convenient
by sdgmlj
Sun Mar 13, 2022 6:21 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 1262

Re: Help, game error - no character

script.on_event(defines.events.on_cutscene_cancelled, function(event) character_init(event) end) --This one is correct, but the following one will report an error script.on_configuration_changed(function(event) character_init(event) end) How should I change it? The arguments passed on to the functi...
by sdgmlj
Sun Mar 13, 2022 5:58 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 1262

Re: Help, game error - no character

bad argument #3 of 3 to '__index' (string expected, got nil)
by sdgmlj
Sun Mar 13, 2022 5:34 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 1262

Re: Help, game error - no character

You can have a player that is not connected to a character, for example in god or editor mode. Since Factorio 1.0 the first player created won't be attached to a character until the cutscene has finished. There's also an event for it, on_cutscene_cancelled. While the cutscene is running, player.cha...
by sdgmlj
Sun Mar 13, 2022 3:35 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 1262

Help, game error - no character

I wrote a script to adjust character attributes. but an error will be reported when starting a new game. "No character" I can't understand the rest script.on_event(defines.events.on_player_created, function(event) local player = game.players[event.player_index] player.character_running_spe...
by sdgmlj
Wed Mar 09, 2022 4:24 pm
Forum: Modding help
Topic: Ask about the syntax of lua
Replies: 6
Views: 519

Re: Ask about the syntax of lua

No, global variable names in your code are looked up in that table, and one of the global variable names is `_G`, whose value is self-referentially that table. So after `_G['howd'..'y']='hoo'..'hah!'` you can `print(howdy)`. By the way, this is your opportunity to produce really horrible code. Do i...
by sdgmlj
Wed Mar 09, 2022 4:05 pm
Forum: Modding help
Topic: Ask about the syntax of lua
Replies: 6
Views: 519

Re: Ask about the syntax of lua

If you *really* want the suffixes pasted on the end like that, global variables are in a table named `_G`. for x = 1,100 do _G['setting'..x]='setting'..x end Is that what it says? for x = 1,100 do _ G['s'..x]='setting'.. x end Do I need quotation marks when I use this variable in the future? *****=...
by sdgmlj
Wed Mar 09, 2022 3:10 pm
Forum: Modding help
Topic: Ask about the syntax of lua
Replies: 6
Views: 519

Re: Ask about the syntax of lua

Stringweasel wrote:
Wed Mar 09, 2022 12:36 pm
I would do something like this :)

Code: Select all

local prefix = "setting"
local settings = {}

for i=1,5 do
	settings[i] = prefix..i	
	print(settings[i])
end

Which will print:

Code: Select all

setting1
setting2
setting3
setting4
setting5
Thank you, my friend. I think I understand. Thank you very much
by sdgmlj
Wed Mar 09, 2022 12:26 pm
Forum: Modding help
Topic: Ask about the syntax of lua
Replies: 6
Views: 519

Ask about the syntax of lua

The results I want to achieve are as follows:
s1="setting1"
s2="setting2"
s3="setting3"
...
s100="setting100"

That's what I wrote:
for i=1,100 do
.......="setting"..tostring(i) end

How do you write in front of the equal sign?
by sdgmlj
Fri Mar 04, 2022 3:48 pm
Forum: Modding help
Topic: Find a grammar
Replies: 4
Views: 354

Re: Find a grammar

Pi-C wrote:
Fri Mar 04, 2022 2:44 pm
You'll need to check player.controller_type.
Thank you, friend. You have done me a great favor. Thank you very much
by sdgmlj
Fri Mar 04, 2022 1:28 pm
Forum: Modding help
Topic: Find a grammar
Replies: 4
Views: 354

Re: Find a grammar

I may not express it clearly enough. I mean how to detect whether it is in "map editor modes" or "normal game"? I don't know how to write this detection command
by sdgmlj
Fri Mar 04, 2022 12:50 pm
Forum: Modding help
Topic: Find a grammar
Replies: 4
Views: 354

Find a grammar

How to detect whether it is in the scene editing mode or in the official game?

I made a module, but there will be bugs in the scene editing mode, so I want to add a detection script. How can I add it? Thank you
by sdgmlj
Fri Mar 04, 2022 9:07 am
Forum: Modding help
Topic: How do I adjust the value of DATA in "control.lua"?
Replies: 4
Views: 446

Re: How do I adjust the value of DATA in "control.lua"?

Although I don't quite understand it, I know my idea can't be realized I suppose you want to change certain properties of entities in response to some event or player action. While you can't modify prototype definitions in the control stage, you could define different versions of your main prototyp...
by sdgmlj
Thu Mar 03, 2022 11:16 am
Forum: Modding help
Topic: How do I adjust the value of DATA in "control.lua"?
Replies: 4
Views: 446

Re: How do I adjust the value of DATA in "control.lua"?

You cannot. This is one of the principles of working with prototypes. Prototypes are defined at data stage and after that they are immutable. If they would be mutable they would need to be saved in a save file which we are not doing, when changing mods there would be a need for a mechianism to choo...
by sdgmlj
Thu Mar 03, 2022 10:39 am
Forum: Modding help
Topic: How do I adjust the value of DATA in "control.lua"?
Replies: 4
Views: 446

How do I adjust the value of DATA in "control.lua"?

How do I adjust the value of DATA in "control.lua"?
Using "data. Raw [******]" is invalid. Is there any other method?
thank you
by sdgmlj
Mon Feb 28, 2022 11:20 pm
Forum: Modding help
Topic: Why not use "if mods" in "control. Lua"?
Replies: 2
Views: 312

Re: Why not use "if mods" in "control. Lua"?

Check out game.active_mods and script.active_mods ! Both can be used in control.lua (and, of course, files required there) to get the list of active mods. The difference is that script.active_mods can already be used when script.on_load() is running while the global table 'game' (and with it, game....

Go to advanced search