Page 1 of 1

Beacon with defined modules

Posted: Tue Sep 10, 2019 7:20 am
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.

Re: Beacon with defined modules

Posted: Tue Sep 10, 2019 8:34 am
by planetmaker
That seems like possible:

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

Re: Beacon with defined modules

Posted: Tue Sep 10, 2019 9:25 am
by darkfrei
Almost that, but on placing they are already here, by beacon removing they are gone.

Re: Beacon with defined modules

Posted: Sat Sep 14, 2019 5:18 am
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.

Re: Beacon with defined modules

Posted: Sat Sep 14, 2019 5:42 am
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.

Re: Beacon with defined modules

Posted: Wed Oct 09, 2019 11:36 pm
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.