I'm writing a mod and want to automatically determine what is not an alien unit or spawner, but I'm running into some issues:
There's no game.entity_prototypes for me to check the subgroup
I can check the force of anything new that's created, and if it has no players and it is not a friend, it is an enemy unit, and assume it is alien. Wouldn't work right in multiplayer for things placed at spawn like alternate faction bases, unless they started as friends. Lots of assumptions with this method, and has to run any time a unit is created.
Simple name matching, which would work for things with biter and spitter in the name, but not anything else.
Suggestions?
Determine if something is an "alien" enemy entity?
Determine if something is an "alien" enemy entity?
I have mods! I guess!
Link
Link
Re: Determine if something is an "alien" enemy entity?
I made a mistake, for the second method, I don't have to run it every time a unit is created, I can do it for on_entity_spawned, which would give me the spawner and a spawnable entity. This would only work in games where this event is raised, which would probably cover 99% of the cases?
I have mods! I guess!
Link
Link
Re: Determine if something is an "alien" enemy entity?
Whelp. Entity.prototype returns the enemies prototype table. Expected it to be as bad as how items are. Nevermind, problem solved.
I have mods! I guess!
Link
Link