Search found 127 matches

by sdgmlj
Fri Mar 18, 2022 12:14 pm
Forum: Modding help
Topic: How can I get the zoom ratio of the current screen?
Replies: 3
Views: 1063

How can I get the zoom ratio of the current screen?

I want to add a screen zoom function, but it seems that "player. Zoom" only supports writing, but does not support reading. Is there a way to obtain the current zoom ratio? Because only in this way can smooth scaling be achieved I've tried to record with variables, but if the player adjust...
by sdgmlj
Thu Mar 17, 2022 5:24 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 3910

Re: Help, game error - no character

function character_init(event) local player = game.players[event.player_index] if player.character then player.character_running_speed_modifier = running_speed_modifier ......... end end Seems like you can keep it as simple as this: remote.add_interface("your_interface_name", { on_charact...
by sdgmlj
Thu Mar 17, 2022 3:16 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 3910

Re: Help, game error - no character

function character_init(event)
local player = game.players[event.player_index]

if player.character then
player.character_running_speed_modifier = running_speed_modifier
.........
end
end
by sdgmlj
Thu Mar 17, 2022 3:13 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 3910

Re: Help, game error - no character

When using "jetpack" of "Se", the bonus of some character attributes will disappear. What is the way to reload my configuration when using "jetpack" and what script should be added? Your bonuses will disappear because the character will disappear. Jetpack can't magical...
by sdgmlj
Thu Mar 17, 2022 1:52 pm
Forum: Modding help
Topic: Help, game error - no character
Replies: 23
Views: 3910

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: Expansion hype thread - Any updates on when/if there will be an expansion?
Replies: 129
Views: 28972

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: Expansion hype thread - Any updates on when/if there will be an expansion?
Replies: 129
Views: 28972

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: 15956

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: 15956

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: 3910

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: 3910

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: 3910

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: 3910

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: 1564

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: 1564

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: 1564

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: 1564

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: 965

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: 965

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: 965

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

Go to advanced search