Effectively implementing two pollution's on one surface

Place to get help with not working mods / modding interface.
Jamesamrundle
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Nov 01, 2024 3:24 pm
Contact:

Effectively implementing two pollution's on one surface

Post by Jamesamrundle »

Hi all, I really want biters and pentapods to be able to exist on the same surface and be affected by their respective pollution types.

My basic idea of implementing is copy the surface but only include biter spawners. Any pollution that would be added to the main surface chunk is instead added to the copied surface.

When the spawners on the copied surface would trigger an attack, that would instead trigger on the main surface.

Seems simple enough. Sure, it's not memory efficient, but space exploration has many surfaces, each with way more complexity.

I've dug in the modding API, and The thing is, I am not seeing a clean way to interact with spawners. There doesn't seem to be ways to manually add pollution to a spawner, and there doesn't seem to be a way to intercept the attack trigger command let alone manually trigger an attack from a spawner. I do see you can just command individual units to attack.

This would be my first foray into modding (though I am confident I can pick it up) so I have some questions...

Is what I am proposing possible?
Can you think of work around if not?
If the methods that do what I want don't exist on enemyspawner types, is that something I can add with modding?

I am quite fixated on this idea right now, but I think it would be really cool! It's a fun idea that I think could enable a lot more stuff for other modders, and there is enough complexity for me to feel interested enough to start modding!

Thanks for the insight everyone.
StrangePan
Factorio Staff
Factorio Staff
Posts: 212
Joined: Fri Dec 07, 2018 3:41 pm
Contact:

Re: Effectively implementing two pollution's on one surface

Post by StrangePan »

I'm not sure about simulating two different pollution types on the same surface, but another approach you might consider is modifying one or both enemy types other than react to one single pollution type. Either modifying biters to respond to spores, modifying pentapods to respond to pollution, or introducing some 3rd pollution type and modifying both creature types to respond to it while modifying player buildings to emit this 3rd pollution type. This would definitely be a more performant approach, but both enemy types would attack the same buildings.
Post Reply

Return to “Modding help”