Page 1 of 1

Have "following_robots" field on standard entities

Posted: Mon May 18, 2020 6:57 pm
by xlomkn
TL;DR
Make the field "following_robots" works for standard entities, not only for characters.
What ?
The LuaControl field "following_robots" needs to be called on an object that is a character, but from a script, I can create combat robots and by setting the source parameter, make them follow a standard entity (let's say a vehicle):

Code: Select all

surface.create_entity({
      name = "defender-capsule",
      force = source_entity.force,
      source = source_entity, -- my vehicle
      ...
When making combat robots follow a vehicle, I can create more than the "maximum_following_robot_count" limit.

My suggestions:
  • make the field "following_robots" works for standard entities, not only for characters - at least vehicles, but seems to me it could be used on other entities types.
  • and maybe respect the "maximum_following_robot_count" limit on a per entity basis. Not sure about this, as it would be easy to check table_size(following_robots) and letting this unlimited gives more modding possibilities.
Why ?
Because robots can follow a vehicle, I would like to be able to manage them as with a character.
As an example:
  • by now to respect the "maximum_following_robot_count" limit on a vehicle, I have to handle the following robots count myself.
  • when a robot dies, I don't know which vehicle it was following, to create a new one... or to override the dying animation to make it come back to the vehicle.

Re: Have "following_robots" field on standard entities

Posted: Tue May 26, 2020 9:17 pm
by Rseding91
This would require additional memory usage on every entity in the game when base game would never use it. Not going to happen.