Search found 1740 matches

by Pi-C
Sun Apr 13, 2025 11:23 pm
Forum: Mod portal Discussion
Topic: Request for new tag/category
Replies: 6
Views: 1334

Re: Request for new tag/category

vinzenz wrote: Fri Apr 11, 2025 1:04 pm Added "Planet" and "Character" tags
Thanks a lot for these additions! :-)
by Pi-C
Mon Jan 27, 2025 10:14 am
Forum: Modding help
Topic: "Noob" prototype "type checking" question
Replies: 13
Views: 926

Re: "Noob" prototype "type checking" question

You can define new prototypes in the data stage. They must be based on an existing type/class of things, where each type/class has certain properties that you can use (see here for a list of all prototype types).

There may be different prototypes of each prototype type/class. So the easiest way to ...
by Pi-C
Fri Dec 20, 2024 4:39 pm
Forum: Technical Help
Topic: No mods loaded. I
Replies: 2
Views: 262

Re: No mods loaded. I

Looks like this
by Pi-C
Thu Dec 19, 2024 3:38 pm
Forum: Modding help
Topic: Is it possible to get two resources when mining one?
Replies: 10
Views: 949

Re: Is it possible to get two resources when mining one?


It seems there is no solution. When I wrote the following directly in the game file
__base___/prototypes/entity/resources.lua:

minable =
{
…,
results = {"uranium-ore", "stone"},
…,
},

I got an error:

Failed to load mods: Error while loading entity prototype "uranium-ore" (resource ...
by Pi-C
Thu Dec 19, 2024 8:28 am
Forum: Modding help
Topic: How to access inventory of a disconnected/editor player?
Replies: 3
Views: 452

Re: How to access inventory of a disconnected/editor player?

Data wrote: Thu Dec 19, 2024 7:05 am How to access inventory of a disconnected/in editor mode player character in any given situation?
I'd say you can't, you have to work around it. The events on_pre_player_left_game/on_player_joined_game and on_pre_player_toggled_map_editor are your friends …
by Pi-C
Wed Dec 18, 2024 8:26 am
Forum: Modding help
Topic: Is it possible to get two resources when mining one?
Replies: 10
Views: 949

Re: Is it possible to get two resources when mining one?


I made a couple of edits:
table.insert(data.raw.resource["iron-ore"].minable.results, {type = "item", name = "stone", amount = 1})

But as a result, only the content of the error changed:

Failed to load mods: __My_add_pack_updated__/data-updates.lua:52: bad argument #1 of 3 to 'insert' (table ...
by Pi-C
Fri Dec 06, 2024 5:43 pm
Forum: Modding help
Topic: Detecting if player is standing on rails
Replies: 3
Views: 312

Re: Detecting if player is standing on rails


… I was wondering if there was a way to detect if the player was standing on top of rails. …



Idea2:
Check with surface filter around the player location every tick, but might be a bit resource intensive.


If you really only want to react to players standing on top of rails, it would be ...
by Pi-C
Tue Dec 03, 2024 12:13 am
Forum: Not a bug
Topic: Clicked GUIs are not brought to front
Replies: 2
Views: 322

Re: Clicked GUIs are not brought to front


Can you post a save file and steps to reproduce the issue as you're seeing it?


I started a new game without mods. Used SHIFT+CTRL+E to open the prototype browser, then clicked on the first visible link (which was to the prototype of the first custom-input, crash-site-skipped-cutscene; any other ...
by Pi-C
Sun Dec 01, 2024 2:38 pm
Forum: Modding help
Topic: [Fixed][Not an Issue][User Error] Updating
Replies: 4
Views: 473

Re: [2.0] Updating




Hi! When I try to add new features to my mod, nothing happens. I removed some logging and the logging still happens when I load the game up.




The save file was started with a zipped copy of the mod - but I removed that when I started developing. Yes, I restarted the game.

If you've ...
by Pi-C
Sun Dec 01, 2024 6:16 am
Forum: Modding help
Topic: [Fixed][Not an Issue][User Error] Updating
Replies: 4
Views: 473

Re: [2.0] Updating


Hi! When I try to add new features to my mod, nothing happens. I removed some logging and the logging still happens when I load the game up. I am using the correct version of the mod, I checked myself. The only thing that's different since I was last able to add mod features is that I installed ...
by Pi-C
Fri Nov 29, 2024 3:49 pm
Forum: Modding help
Topic: [boskid] How to get the ID of a custom-event?
Replies: 6
Views: 552

Re: [boskid] How to get the ID of a custom-event?


I can see some extremely niche uses for wanting to be able to dynamically generate events perhaps?



It is still useful for custom scenarios


Yes, makes sense. But that means we'd still have to keep two methods for registering custom events: the easy way by checking prototypes.custom_events ...
by Pi-C
Fri Nov 29, 2024 2:15 pm
Forum: Modding help
Topic: [boskid] How to get the ID of a custom-event?
Replies: 6
Views: 552

Re: [boskid] How to get the ID of a custom-event?

@boskid: Hi! As I've just noticed you've taken an interest in this, there is a related issue with LuaBootstrap::get_event_handler . Currently, passing on the name of a custom event will result in an error:

11413.654 Error MainLoop.cpp:1432: Exception at tick 286131: Error while running command ...
by Pi-C
Fri Nov 29, 2024 9:03 am
Forum: Modding help
Topic: [boskid] How to get the ID of a custom-event?
Replies: 6
Views: 552

Re: How to get the ID of a custom-event?


Can you post the relevant code?

Sure. I create the event prototype in data.lua:

data:extend({
{
type = "custom-event",
name = "minime_exchanged_characters",
}
})


In control, I raise the event like this:

local pass_on = {
player_index = player.index,
old_character = old_char,
new ...
by Pi-C
Thu Nov 28, 2024 6:36 pm
Forum: Not a bug
Topic: Clicked GUIs are not brought to front
Replies: 2
Views: 322

Clicked GUIs are not brought to front

If GUIs (modded or vanilla) are overlapping, clicking on a GUI in the background should bring it to the front. This used to work in Factorio 1.1 (just checked with version 1.1.110).
by Pi-C
Thu Nov 28, 2024 6:25 pm
Forum: Modding help
Topic: [boskid] How to get the ID of a custom-event?
Replies: 6
Views: 552

[boskid] How to get the ID of a custom-event?

We can now define custom events as CustomEventPrototype during the data stage. We can also use the name (string) of that prototype with script.raise_event and script.on_event. However, it seems that the name passed on with the event data is numeric:


12490.617 Script @__Pi-C_lib__/libs/debugging ...
by Pi-C
Thu Nov 28, 2024 5:56 pm
Forum: Documentation Improvement Requests
Topic: Description for LuaBootstrap.html::raise_event is incomplete
Replies: 0
Views: 188

Description for LuaBootstrap.html::raise_event is incomplete

The description for LuaBootstrap.html::raise_event states:

Raise an event. Only events generated with LuaBootstrap::generate_event_name and the following can be raised: …

However, we can also raise events that have been defined in the data stage as data.raw["custom-event"] by passing on the ...
by Pi-C
Tue Nov 26, 2024 3:51 pm
Forum: Resolved Problems and Bugs
Topic: [>=2.0.18] GuiElement "camera" broken
Replies: 3
Views: 909

Re: [>=2.0.18] GuiElement "camera" broken

Great, thank you very much! :-)
by Pi-C
Tue Nov 26, 2024 1:41 pm
Forum: Resolved Problems and Bugs
Topic: [>=2.0.18] GuiElement "camera" broken
Replies: 3
Views: 909

[>=2.0.18] GuiElement "camera" broken

My mod miniMAXIme allows players to change their appearance on the fly (depending on third-party character mods). The players get a GUI to preview and select characters:
Screenshot_previews_2-0-17.png

I've recently got a bug report because there were no previews. Apparently, this started with ...
by Pi-C
Fri Nov 22, 2024 5:37 pm
Forum: Frequently Suggested / Link Collections
Topic: Female Character
Replies: 23
Views: 22247

Re: Female Character

Nowadays, there are various mods providing new characters, among them New Gear Girl Character. You might want to check out the dependencies of miniMAXIme for a list of all the compatible character mods I've noticed so far.
by Pi-C
Sat Nov 16, 2024 11:19 am
Forum: Modding help
Topic: Change storage variable from game
Replies: 4
Views: 705

Re: Change storage variable from game


if someone will find it, i found only one solution: custom commands

use this event to run function that will change variable you need
https://lua-api.factorio.com/latest/classes/LuaGameScript.html#console_command_used


LuaGameScript::console_command_used is a read-only flag (Boolean value) that ...

Go to advanced search