Search found 3688 matches

by DaveMcW
Tue Oct 10, 2023 1:40 am
Forum: Modding help
Topic: Understand data.raw entity pictures
Replies: 11
Views: 581

Re: Understand data.raw entity pictures

Isn't there a common method that's used for blueprints? There's no animations in blueprints for example and a default non-animated graphic is used. Blueprints don't have a complete renderer, they use the surface renderer with minor changes. The C++ surface renderer uses the same process Deadlock de...
by DaveMcW
Tue Oct 03, 2023 1:10 am
Forum: Wiki Talk
Topic: Suggestions for the Wiki regarding Factorio Expansion Add-ons
Replies: 12
Views: 1358

Re: Suggestions for the Wiki regarding Factorio Expansion Add-ons

Do you have an example that you could link? I'm curious about the size and readability of an icon. Rimworld has very distinct icons, I think looking good on the wiki was part of their design document. https://rimworldwiki.com/wiki/Apparel#Common_combinations Europa Universalis 4 uses icons AND the ...
by DaveMcW
Mon Oct 02, 2023 3:41 am
Forum: Wiki Talk
Topic: Suggestions for the Wiki regarding Factorio Expansion Add-ons
Replies: 12
Views: 1358

Re: Suggestions for the Wiki regarding Factorio Expansion Add-ons

It's pretty standard in wikis for other games to use the expansion icon next to expansion features.
by DaveMcW
Sat Sep 09, 2023 5:18 am
Forum: News
Topic: Friday Facts #375 - Quality
Replies: 793
Views: 91786

Re: Friday Facts #375 - Quality

pichutarius wrote:
Sat Sep 09, 2023 12:09 am
Now i wan assembly machine to have high mood so they got creativity inspiration.
And if you don't feed them, they go berserk.
by DaveMcW
Wed Jun 28, 2023 2:23 am
Forum: Modding help
Topic: Loot Question [Solved]
Replies: 12
Views: 1145

Re: Loot Question

Maybe the item-on-ground is generated after on_entity_died triggers?

In that case you would need to add the parameters to a temporary table and run it the next tick.
by DaveMcW
Tue Jun 27, 2023 1:59 am
Forum: Modding help
Topic: Loot Question [Solved]
Replies: 12
Views: 1145

Re: Loot Question

Unfortunately there is no event for loot entities spawning on the ground. But we have 3 big hints: event.loot[i].name -- the name of the loot item event.entity.position -- the center of the dead entity event.entity.surface -- the surface the loot is on Using those hints, we can run surface.find_enti...
by DaveMcW
Sat Jun 24, 2023 6:10 pm
Forum: Modding help
Topic: Loot Question [Solved]
Replies: 12
Views: 1145

Re: Loot Question

Code: Select all

local function On_Death(event)
  if event.loot and event.loot.valid then
    for i = 1, #event.loot do
      if event.loot[i].valid_for_read and event.loot[i].name == "small-alien-artifact" then
        -- add to item table    
      end
    end     
  end   
end
by DaveMcW
Sat Jun 24, 2023 2:21 am
Forum: Modding help
Topic: Loot Question [Solved]
Replies: 12
Views: 1145

Re: Loot Question

small-alien-artifact is not a vanilla item.

Please describe EXACTLY what a small-alien-artifact is. Preferably with the data.lua entries.
by DaveMcW
Fri May 26, 2023 3:27 am
Forum: Modding help
Topic: entity.minable.results = random?
Replies: 8
Views: 788

Re: entity.minable.results = random?

entity.minable.results does not support this.

You could use the control.lua event on_player_mined_entity to do whatever you want when a fish is mined.
by DaveMcW
Mon May 22, 2023 7:21 pm
Forum: Modding help
Topic: How to replace entities on tiles in a migration
Replies: 20
Views: 1797

Re: How to replace entities on tiles in a migration

AlmightyCrumpet wrote:
Mon May 22, 2023 3:42 pm
I'm confused, why would I migrate in the control.lua?
I only want this to run once, when updating to this version, so surely utilizing the migration functionality is ideal?
You can use migrations.lua, you don't need control.lua.

The reason to use lua is it offers more functionality than json.
by DaveMcW
Sun May 21, 2023 9:46 pm
Forum: Modding help
Topic: How to replace entities on tiles in a migration
Replies: 20
Views: 1797

Re: How to replace entities on tiles in a migration

You can use script.on_configuration_changed to migrate in control.lua. You need to keep your old data.lua entity names so they aren't deleted.
by DaveMcW
Sat May 13, 2023 1:57 am
Forum: Modding help
Topic: Control tanks/character/cars without player
Replies: 4
Views: 495

Re: Control tanks/character/cars without player

This works for characters, including characters in a car/tank. /c character = game.player.character target = game.player.selected script.on_event(defines.events.on_tick, function() if character and character.valid and target and target.valid then character.shooting_state = {state=defines.shooting.sh...
by DaveMcW
Sun Apr 30, 2023 2:11 am
Forum: Modding help
Topic: Place entity on the water edge
Replies: 10
Views: 962

Re: Place entity on the water edge

The game will only read the data.lua fields that match the entity type. You can't add a recipe to an offshore pump. And you can't add water detection to an assembling machine.
by DaveMcW
Thu Apr 27, 2023 1:42 am
Forum: Modding help
Topic: Place entity on the water edge
Replies: 10
Views: 962

Re: Place entity on the water edge

The offshore pump water detection feature is not exposed to modders. What you can do is make two entities. Entity 1 is an offshore pump, entity 2 is an assembling machine. Use the item to place entity 1. Then use control.lua scripting to swap to entity 2 in the on_built_entity and on_robot_built_ent...
by DaveMcW
Mon Apr 17, 2023 1:49 am
Forum: Gameplay Help
Topic: Circuit chest
Replies: 3
Views: 641

Re: Circuit chest

0eNrFVttuozAQ/ZVqnp2qkBAStPsX+7aqkAOTdrRgI2OizUb8+47xtiUpISHbqi9RfJnjM+fMYB9gUzRYGVIWkgNQplUNyc8D1PSkZOHm7L5CSIAsliBAydKNcswoRzPLdLkhJa020AogleNvSIJWXASorcx+zbZUWEYhVaPhPz2MsH0UgMqSJfSMusE+VU254Z1J8ArlOFupbJ+MgErXHKuVY+DwVveRgD0k8fw+4mNyMpj59YVwENboIt3gs9wRx3OQ53ZGjR0Z2/DMWz7djtkPl0KmGydn0BPksZtWyp...
by DaveMcW
Thu Mar 16, 2023 1:05 am
Forum: Modding help
Topic: Event for entity configuration changes
Replies: 2
Views: 445

Re: Event for entity configuration changes

This is the same issue as constant combinators. viewtopic.php?f=25&t=102702
by DaveMcW
Mon Mar 06, 2023 1:53 am
Forum: Ideas and Requests For Mods
Topic: "Demands"
Replies: 13
Views: 1592

Re: "Demands"

This is already in the game as the "Supply challenge" scenario.
by DaveMcW
Sun Feb 26, 2023 5:04 am
Forum: Modding help
Topic: Getting list of all generated chunks
Replies: 2
Views: 517

Re: Getting list of all generated chunks

Yes, the iterator can be stored. The stored iterator contains the current chunks, even if they were generated after it was created. It might not catch some newly created chunks, if they are inserted before the current position. When the iterator reaches the end of the list it stops iterating, even i...
by DaveMcW
Thu Feb 09, 2023 5:56 am
Forum: Modding help
Topic: A spider mod. The equipment is immediately inserted into the grid.
Replies: 7
Views: 1064

Re: A spider mod. The equipment is immediately inserted into the grid.

Yes, the grid is always created empty. It is hard to catch items when they are created because there is no event for it. You could watch the player's inventory though. function set_spider_inventory(grid) grid.put{name="battery-mk2-equipment", position={1,1}} end script.on_event(defines.eve...

Go to advanced search