I'm trying to make a powered floor mod, so I want my prototype to have both type = "electric-pole" and type = "tile" features. I assume there is no type ="electric-pole, tile" syntax. So I started with type = "electric-pole" and tried to add concrete-y bits to it, but I suspect I need to make my powered-floor based on something higher up the tree - like "item".
Is there lua code somewhere that I can copy that implements these two types (which I think of as base classes) ? Is there a reference for what the types themselves actually are? I see examples of types in the base code, but haven't seen any type definitions.
Apologies if this has been answered previously, my searching of the forum for this wasn't fruitful.
Also, if someone has already done this mod, let me know!
Two types - multiple inheritance?
-
- Inserter
- Posts: 46
- Joined: Fri Aug 19, 2016 2:48 pm
- Contact:
Re: Two types - multiple inheritance?
It isn't possible for a single entity to have behaviors of two types of entity,
However it is possible to use scripting to create seperate entities when a single one is created, so called 'compound entities',
Such as this mod:
https://mods.factorio.com/mods/Klonan/Concrete_Lamppost
However it is possible to use scripting to create seperate entities when a single one is created, so called 'compound entities',
Such as this mod:
https://mods.factorio.com/mods/Klonan/Concrete_Lamppost
-
- Inserter
- Posts: 46
- Joined: Fri Aug 19, 2016 2:48 pm
- Contact:
Re: Two types - multiple inheritance?
Thanks, I'll check that out!
-
- Inserter
- Posts: 46
- Joined: Fri Aug 19, 2016 2:48 pm
- Contact:
Re: Two types - multiple inheritance?
Those are sweet looking lampposts, by the way! Nice artwork!
Note - get rid of the spaces around the = signs in your locale.cfg.
Note - get rid of the spaces around the = signs in your locale.cfg.
Re: Two types - multiple inheritance?
Right... serves me right for updating the lazy wayTheanderblast wrote:Those are sweet looking lampposts, by the way! Nice artwork!
Note - get rid of the spaces around the = signs in your locale.cfg.