Search found 1297 matches

by Pi-C
Wed Aug 17, 2022 5:38 am
Forum: Questions, reviews and ratings
Topic: Mod list sharing for the purpose of reporting issues with a mod
Replies: 10
Views: 223

Re: Mod list sharing for the purpose of reporting issues with a mod

I was confused at first because I kinda expected it to print something in the console too You can do that by using game.print() instead of log(). This will print just the mod names and versions, without prepending each line of output with the command. Then again, you can't copy/paste text from the ...
by Pi-C
Tue Aug 16, 2022 9:27 pm
Forum: Questions, reviews and ratings
Topic: Mod list sharing for the purpose of reporting issues with a mod
Replies: 10
Views: 223

Re: Mod list sharing for the purpose of reporting issues with a mod

Just need to loop over the mods variable - it is a dictionary with all the loaded mods in it. for name, version in pairs(mods) do log(name .. " version " .. version) end Awesome! Thank you very much for that code snippet! I'd put it to good use, if I can, next time the need arises. I'd as...
by Pi-C
Sat Aug 13, 2022 6:05 pm
Forum: Won't fix.
Topic: Player can still manipulate enemy entities after changing forces
Replies: 2
Views: 139

Re: Player can still manipulate enemy entities after changing forces

Thanks for the report however I don't consider this worth changing. If a mod changes the force of something it can eject the player; or change the players vehicle force as well. Thanks for the reply! Actually, I've already made a map setting for that: When players change forces, they will either be...
by Pi-C
Sat Aug 13, 2022 6:47 am
Forum: Won't fix.
Topic: Player can still manipulate enemy entities after changing forces
Replies: 2
Views: 139

Player can still manipulate enemy entities after changing forces

Usually, when you click on an entity that belongs to another force that is an enemy of your own force, you'll see a flying text "Cannot open enemy structure". Also, if you try to enter a vehicle belonging to an enemy force, you'll usually get "Cannot enter enemy vehicles". But th...
by Pi-C
Mon Aug 01, 2022 1:44 pm
Forum: Modding help
Topic: Selection tool shows no icon for selected entity
Replies: 2
Views: 112

Re: Selection tool shows no icon for selected entity

Am I correct in supposing that no icon is shown for the selection because there is no item that can place the entity? That is indeed exactly what that is checked. (And if there are items to place it, it only takes the first item for the icon.) Thanks for your answer! Currently, I use this workaroun...
by Pi-C
Mon Aug 01, 2022 1:29 pm
Forum: Modding interface requests
Topic: Selection tool: Fall back to icon of entity prototype if there is no item to place entity
Replies: 0
Views: 58

Selection tool: Fall back to icon of entity prototype if there is no item to place entity

If you select an entity with a selection tool and there is no item that has the entity prototype as place_result, the entity will be selected, but there is no visual indication of it (see here for screen shots). As recommended by Bilka, I request that the icon from the entity prototype (if it exists...
by Pi-C
Wed Jul 27, 2022 5:47 am
Forum: Mods
Topic: [MOD 0.14] Text Plates
Replies: 95
Views: 29542

Re: [MOD 0.14] Text Plates

jengo1 wrote:
Wed Jul 27, 2022 1:24 am
I upgraded from 0.6.6 and have this error during load of my map
Not the author, but unzipping the mod and replacing line 266 of control.lua with

Code: Select all

for character, symbol in pairs(added_mappings or {}) do
should at least fix the immediate crash. :-)
by Pi-C
Tue Jul 26, 2022 11:15 pm
Forum: Modding help
Topic: Select character on event on_player_changed_force
Replies: 6
Views: 170

Re: Select character on event on_player_changed_force

This is the test code I have. local Character = Player.get_associated_characters( ) Character = #Character > 0 and Character[ 1 ] and nil That looks wrong. Character will be "false" if the table is empty, or nil if it is not. The second "and" should be "or": Character ...
by Pi-C
Tue Jul 26, 2022 6:02 pm
Forum: Modding help
Topic: Select character on event on_player_changed_force
Replies: 6
Views: 170

Re: Select character on event on_player_changed_force

Thanks for your help. What you say is not confirmed in the code. When I try to get the player character in the on_player_changed_force event the value of Player.character does not exist and get_associated_characters() gives me the previous character. Items are added successfully, but to the old inv...
by Pi-C
Tue Jul 26, 2022 2:06 pm
Forum: Modding help
Topic: GUI and textfield focus
Replies: 3
Views: 311

Re: GUI and textfield focus

Hello, I hope you are well, Hi, hope you are well, too! :-) There is no event related to the focus, and making them by means of flag variables (variables that indicate that everything is going well) can become tedious, but I think it is one of the options you have. The other option that I envision ...
by Pi-C
Tue Jul 26, 2022 12:59 pm
Forum: Modding help
Topic: Select character on event on_player_changed_force
Replies: 6
Views: 170

Re: Select character on event on_player_changed_force

I want to add some items to a player's inventory, but I found that, when they change forces, I can't find the instance of the new character associated with the player to add the items. Are you sure you mean associated characters ? If you change forces, player.character will remain the same. You can...
by Pi-C
Mon Jul 25, 2022 6:52 pm
Forum: Modding interface requests
Topic: LuaPlayer.open_map(position, scale, surface)
Replies: 7
Views: 1247

Re: LuaPlayer.open_map(position, scale, surface)

I really could use that feature for GCKI! Players now can open a minimap for vehicles they have claimed or locked. Clicking on the minimap should open a big map view centered on their vehicle's position -- but that won't work if the vehicle is on another surface than the player (e.g. a Factorissimo ...
by Pi-C
Fri Jul 22, 2022 6:55 pm
Forum: Modding help
Topic: Selection tool shows no icon for selected entity
Replies: 2
Views: 112

Selection tool shows no icon for selected entity

If you use a selection tool, you usually see icons of the selected entities. I've found that a selection tool I made will select a certain entity, but will not display its icon: car.png Both entities look like the vanilla car (data.raw.car.car), but only the one on the left really is -- the other on...
by Pi-C
Wed Jul 20, 2022 3:59 pm
Forum: Modding help
Topic: Entities with the same name
Replies: 2
Views: 114

Re: Entities with the same name

The internal name of that entity isn't car. Only the localised name is. Oh, darn … I should have made that one more click! :-) Also, this: local test = table.deepcopy(data.raw["spider-vehicle"]["spidertron"]) test.name = "car" data:extend({test}) results in 3.501 Error...
by Pi-C
Wed Jul 20, 2022 3:27 pm
Forum: Modding help
Topic: Entities with the same name
Replies: 2
Views: 114

Entities with the same name

I've always wondered what would happen if there were two entities of a different type, but with the same name. Now that there's a new mod that creates a spider-vehicle prototype for a given car prototype, this isn't just a theoretical question anymore: same_name.png As they are defined as data.raw.c...
by Pi-C
Wed Jul 20, 2022 10:58 am
Forum: Not a bug
Topic: [1.1.61] Spitter Spawner Info
Replies: 3
Views: 142

Re: [1.1.61] Spitter Spawner Info

The Spitter spawner info says it contributes biters. info.png The wiki has a calculator for spawn chances depending on evolution factor . It seems that spitter spawners will only start spawning spitters when the evolution factor is >0.25, which is a tad more than the 0.23 shown in your picture. Bit...
by Pi-C
Sun Jul 17, 2022 6:21 am
Forum: Gameplay Help
Topic: Specific train stops / no stops per circuit
Replies: 6
Views: 295

Re: Specific train stops / no stops per circuit

To make the train leave early because it is a particular train at a particular time, you can set the Train Stop to "Read stopped train". This will provide the unique Train ID to the circuit network (and it equals zero when no train is present). This will always stay the same as long as yo...
by Pi-C
Fri Jul 15, 2022 7:20 pm
Forum: Modding help
Topic: How to get "owner" of an equipment grid?
Replies: 5
Views: 186

Re: How to get "owner" of an equipment grid?

Equipment grids […] could be in a chest on some armor, or on an item sitting in a player inventory, or maybe a spidertron where it actually does own the grid. Handling items certainly would be rather difficult, but spidertrons or other entities? It should be far easier to get the LuaEntity (if ther...
by Pi-C
Fri Jul 15, 2022 6:12 pm
Forum: Modding help
Topic: How to get "owner" of an equipment grid?
Replies: 5
Views: 186

Re: How to get "owner" of an equipment grid?

I've just noticed that it's even worse than just calling vehicle.grid.get_contents(). It seems the mod already handles the on_player_*_equipment events, but in a terribly inefficient way: local function recheck_grid_sensors(grid) for _, surface in pairs(game.surfaces) do local cars = surface.find_en...
by Pi-C
Fri Jul 15, 2022 5:50 pm
Forum: Modding help
Topic: How to get "owner" of an equipment grid?
Replies: 5
Views: 186

How to get "owner" of an equipment grid?

We've got some events for handling changes to equipment grids: on_ equipment _inserted on_equipment_removed on_player_placed_equipment on_player_removed_equipment The data of all these events contain the grid and the equipment that has been added to or removed from it. However, there seems to be no ...

Go to advanced search