LuaControl.shooting_state being allowed to be used for other entities than players

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
oof2win2
Long Handed Inserter
Long Handed Inserter
Posts: 56
Joined: Wed Nov 18, 2020 8:13 am
Contact:

LuaControl.shooting_state being allowed to be used for other entities than players

Post by oof2win2 »

LuaControl.shooting_state is described as current shooting state of the entity, which implies that it is for spidertrons, cars, tanks and such too, not just characters. When this is set for non-character entities, it throws an error Entity is not a character. I believe that it should be possible to do this for the said entities too, as it is not stated that this is not allowed. If this however is too hard to implement, personally I would be fine if the docs were updated to show that it works only on characters.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5267
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: LuaControl.shooting_state being allowed to be used for other entities than players

Post by Klonan »

oof2win2 wrote: Thu Nov 18, 2021 10:07 pm LuaControl.shooting_state is described as current shooting state of the entity, which implies that it is for spidertrons, cars, tanks and such too, not just characters. When this is set for non-character entities, it throws an error Entity is not a character. I believe that it should be possible to do this for the said entities too, as it is not stated that this is not allowed. If this however is too hard to implement, personally I would be fine if the docs were updated to show that it works only on characters.
The shooting state is only used for players and characters, the other entities don't use it at all, it is a case where this is a very specific thing for players and characters (just like walking state, mining state, repair state, etc.)

So the docs should be updated to say that these are only supported for players and characters
Post Reply

Return to “Modding interface requests”