Beacon with defined modules

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Beacon with defined modules

Post by darkfrei »

Hi devs!

Is it possible to make a beacon with "hardcoded" modules inside? The player cannot change them, remove them or install another type or amount.

User avatar
planetmaker
Fast Inserter
Fast Inserter
Posts: 180
Joined: Mon Jan 21, 2019 9:30 am
Contact:

Re: Beacon with defined modules

Post by planetmaker »

That seems like possible:

https://wiki.factorio.com/Prototype/Beacon lists as one property
allowed_effects :: EffectTypeLimitation (optional)

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Beacon with defined modules

Post by darkfrei »

Almost that, but on placing they are already here, by beacon removing they are gone.

CaveGrinder
Inserter
Inserter
Posts: 35
Joined: Fri Aug 24, 2018 7:42 pm
Contact:

Re: Beacon with defined modules

Post by CaveGrinder »

i would also like to see that. preferably split into three fields:
a proposed array like module_specification.module_slot_specification = {
{locked=true,fixed_module="speed-module-1",mining_yields_result=false},
{locked=true,fixed_module="productivity-module-1",mining_yields_result=false},
{} --defaults: locked=false,fixed_module=nil,mining_yields_result=true
}
if module_specification.module_slot_specification is present, module_specification.module_slots is ignored.
locked defines the players ability to change the slot content.
fixed_module defines the slot content
mining_yields_result defines if mining the entity adds the slots content to the mining result

in my tests i worked around limitations by having an additional invisible, non-selectable beacon spawned behind whatever entity/area i wanted to apply effects to, which i would control only from within scripts. It guess it worked fine but doubles the amount of entities if used extensively.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2916
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Beacon with defined modules

Post by Optera »

You can get that behavior with composite entities.

Have a representation entity without module slots and power consumption.
Then create a hidden beacon underneath it, set operable = false and insert whatever modules you want.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Beacon with defined modules

Post by Honktown »

This could be handled differently. It would be preferable to instead permit giving the building itself the transmission effects of each category, versus requiring items to be virtually installed. If there were a function to get the values from modules you could use that instead of hard-coding them so they match other mod changes, but technically, having the entity own certain transmission effects would be the "right" way to do it. Like a "transmission_specification = " table, which can take the same categories modules use.
I have mods! I guess!
Link

Post Reply

Return to “Modding interface requests”