Entities with the same name
Posted: Wed Jul 20, 2022 3:27 pm
I've always wondered what would happen if there were two entities of a different type, but with the same name. Now that there's a new mod that creates a spider-vehicle prototype for a given car prototype, this isn't just a theoretical question anymore:
As they are defined as data.raw.car.car and data.raw["spider-vehicle"].car, they are in separate name spaces, so creating the prototypes is not a problem. But what about the control stage? For example, LuaSurface.create_entity allows to specify the name of the entity to be created -- is there any rule to determine whether
will create the car or the spider-vehicle?
Code: Select all
surface.create_entity{ name = "car", position = {player.position.x - 1, player.position.y - 1} }