Search found 1270 matches

by Pi-C
Sat Jun 04, 2022 10:05 am
Forum: Modding help
Topic: Problems with my first szenario
Replies: 6
Views: 504

Re: Problems with my first szenario

...Data/Roaming/Factorio/temp/currently-playing/control.lua:32: attempt to index global 'Event' (a nil value) You've never defined Event. I'd guess the scenario you've copied your code from uses an external mod (possibly Factorio Standard Library ) to manage the event handlers. If you want to do th...
by Pi-C
Thu Jun 02, 2022 7:10 pm
Forum: Won't implement
Topic: Make possibility to send a table from data.lua to control.lua
Replies: 19
Views: 1105

Re: Make possibility to send a table from data.lua to control.lua

Without being able to pass something up from data to control, I don't have any guaranteed ways (that I'm aware of) of detecting my mod's collision mask, which means I have to assume any entity prototype could be affected, which in turn means looping through every entity on every surface of the exis...
by Pi-C
Wed Jun 01, 2022 9:23 pm
Forum: Modding help
Topic: [Solved] Artillery Projectile Created Event
Replies: 5
Views: 264

Re: Artillery Projectile Created Event

Sadly no, my listener got no events. See here : on_trigger_fired_artillery Called when an entity with a trigger prototype (such as capsules) fire an artillery projectile AND that trigger prototype defined trigger_fired_artillery="true". I know I should probably add trigger_fired_artillery...
by Pi-C
Thu May 26, 2022 11:57 pm
Forum: Not a bug
Topic: [1.1.59] on_player_driving_changed_state no longer fired when vehicle destroyed
Replies: 3
Views: 233

Re: [1.1.59] on_player_driving_changed_state not fired when vehicle destroyed

Get into a vehicle (tested with car and spidertron), and see the event fire. Wait a second, and then destroy the vechicle without killing the player (no nukes :P). Easiest, select the vehicle and paste the following command: /c game.player.character.vehicle.die() This also applies to /c game.player...
by Pi-C
Wed May 25, 2022 5:35 am
Forum: Modding help
Topic: What events does my mod listen to?
Replies: 2
Views: 242

Re: What events does my mod listen to?

You can run https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.get_event_handler on every event ID. Thanks, forgot about that one! It's a bit cumbersome, but should do. Not sure how to know what range to use given custom events. That wouldn't be a problem. I already have a reverse l...
by Pi-C
Tue May 24, 2022 6:49 pm
Forum: Modding help
Topic: What events does my mod listen to?
Replies: 2
Views: 242

What events does my mod listen to?

Is there a way to find out what events my mod is listening to at any given time? It could be useful for debugging, especially when event handlers are added in response to other events.
by Pi-C
Sun May 22, 2022 6:54 pm
Forum: Modding help
Topic: Identify game mode
Replies: 2
Views: 232

Re: Identify game mode

That info is available from script.level. That's what it looks like in a new game with the vanilla scenario:
gvv.png
gvv.png (342.3 KiB) Viewed 211 times
by Pi-C
Fri May 20, 2022 5:33 pm
Forum: Ideas and Suggestions
Topic: Mod portal "favorit" feature
Replies: 6
Views: 264

Re: Mod portal "favorit" feature

FuryoftheStars wrote:
Fri May 20, 2022 1:39 pm
(does the mod portal filter out repeat downloads?).
Screenshot at 2022-05-20 19-30-23.png
Screenshot at 2022-05-20 19-30-23.png (148.62 KiB) Viewed 234 times
by Pi-C
Thu May 19, 2022 6:17 am
Forum: Modding help
Topic: How can I close a GUI without "name"?
Replies: 2
Views: 130

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 Pi-C
Fri May 13, 2022 8:27 am
Forum: Ideas and Suggestions
Topic: [0.15.1] Improvements to the mod options
Replies: 15
Views: 1338

Re: [0.15.1] Improvements to the mod options

To me your choice of green and orange seems a bit strange as I don't associate orange with "Off". Red is the obvious signal color for "off" or "stop", so naturally I tried that. However, I found that very hard to read (at least in normal text, bold text may be differen...
by Pi-C
Fri May 13, 2022 7:37 am
Forum: Ideas and Suggestions
Topic: [0.15.1] Improvements to the mod options
Replies: 15
Views: 1338

Re: [0.15.1] Improvements to the mod options

Agreed that I don't think most mod setting names should be coloured. It is very useful for setting descriptions (tooltips) though. My reasoning for using colors in the setting names was that players can see at a glance what the setting's default value, without having to move the cursor to show the ...
by Pi-C
Thu May 12, 2022 7:43 pm
Forum: Ideas and Suggestions
Topic: [0.15.1] Improvements to the mod options
Replies: 15
Views: 1338

Re: [0.15.1] Improvements to the mod options

Oh, that's cool! What does that look like in the locale file? Specifically, what do you need to do to the line to get it to do that? [mod-setting-name] GCKI-flying_text=[color=orange]Display messages as flying text[/color] GCKI-show_hints=[color=green]Show all hints[/color] This description of rich...
by Pi-C
Thu May 12, 2022 5:58 pm
Forum: Ideas and Suggestions
Topic: [0.15.1] Improvements to the mod options
Replies: 15
Views: 1338

Re: [0.15.1] Improvements to the mod options

I've never tried adding colors to mod setting names & descriptions, and can't say I've seen it, so I don't know if this is possible already or not. If not, it would be nice to have. I don't know about descriptions, but it definitely works for the setting names! I use colors to mark the default ...
by Pi-C
Wed May 11, 2022 5:44 pm
Forum: Technical Help
Topic: Unexpected error occurred
Replies: 6
Views: 210

Re: Unexpected error occurred

please fix this problem because I'm really like this game and played here a lot If there hadn't been a response after a week I'd understand that you push your thread -- but you followed up your first post after just 23 minutes, complaining that there is no fix yet! You definitely should be more pat...
by Pi-C
Wed May 11, 2022 5:09 pm
Forum: Modding help
Topic: How to get the translation?
Replies: 19
Views: 610

Re: How to get the translation?

Is on_player_joined_game fired when loading a single player map? IIRC, the event fires only once in single player, after on_player_created. So the safe way to handle both single- and multiplayer games is to store player data in the global table when on_player_joined_game fires, and to reinitialize ...
by Pi-C
Wed May 11, 2022 10:33 am
Forum: Modding help
Topic: Arachnids, would you like to know more...? Data.raw function replacement help!
Replies: 8
Views: 359

Re: Arachnids, would you like to know more...? Data.raw function replacement help!

Now i need to do the same with the bloodtint particle local function arachnids_bloodtint() return {r = 50, g = 204, b = 50} end data.raw["particles"].bloodtint = arachnids_bloodtint but this return me a nill value You're making data.raw["particles"].bloodtint a reference to the ...
by Pi-C
Tue May 10, 2022 1:28 pm
Forum: Modding help
Topic: How to get the translation?
Replies: 19
Views: 610

Re: How to get the translation?

The event will be triggered only if the string could be translated, i.e. if the return value of LuaPlayer::request_translation(localised_string) is true. I don't understand you, because the function always returns true Here it says: request_translation(localised_string) → boolean Requests a transla...
by Pi-C
Mon May 09, 2022 3:15 am
Forum: Modding help
Topic: How to get the translation?
Replies: 19
Views: 610

Re: How to get the translation?

The event will be triggered only if the string could be translated, i.e. if the return value of LuaPlayer::request_translation(localised_string) is true.
by Pi-C
Sat May 07, 2022 10:05 am
Forum: Mods
Topic: on_player_died not working with other mods
Replies: 2
Views: 154

Re: on_player_died not working with other mods

I have a small mod that write some evens to a file so that I can use it to post it to Discord (https://mods.factorio.com/mod/FactoriGOChatBot-companion) One of the things is player death messages: script.on_event( defines.events.on_player_died, function(event) local player_index = event.player_inde...
by Pi-C
Thu May 05, 2022 5:23 am
Forum: Modding help
Topic: Change registered function for event handler
Replies: 6
Views: 154

Re: Change registered function for event handler

Is it ok to change which function is registered for a particular event based on a setting? Yes, you can assign another function (or nil to stop listening to an event). However, you must do this when the game is loading (this can be before on_load) or within an event. Also, something like this is po...

Go to advanced search