API of the armed entities. Guided weapons

Post Reply
User avatar
regedit2000
Inserter
Inserter
Posts: 20
Joined: Mon May 23, 2016 4:00 pm
Contact:

API of the armed entities. Guided weapons

Post by regedit2000 »

TL; DR
Propose to extend the API of the armed entities guided weapons

what ?
Now weapons control is possible only for characters through "selected_gun_index", but multiple weapons are also used in transport but there is no access to it (as an option, you can use access through the driver ). An example of a mod where this can be used is AAI Programmable Vehicles. In addition to the selection of weapons, you can turn it on/ off, change the response radius and the current cell with ammunition (for turrets)

why ?
More features for modding and game control

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: API of the armed entities. Guided weapons

Post by Rseding91 »

I'm not sure exactly what you're asking for?
If you want to get ahold of me I'm almost always on Discord.

User avatar
regedit2000
Inserter
Inserter
Posts: 20
Joined: Mon May 23, 2016 4:00 pm
Contact:

Re: API of the armed entities. Guided weapons

Post by regedit2000 »

I want through the API:
- manage weapons transport (choose from several active for the character).
- choose the ammo for the gun turrets.
- control the guns themselves (turn on/off, change the range and strength of the shot (for lasers)).

Application:
- scenarios
- mods mentioned above.

Why: single / universal management of similar entity capabilities.

Additionally:
- Passengers-number, control (roles: driver/shooter/cargo), access to weapons transport, the ability to use their own guns from the inside
Last edited by regedit2000 on Sat Jan 12, 2019 12:32 am, edited 1 time in total.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: API of the armed entities. Guided weapons

Post by Rseding91 »

regedit2000 wrote:- manage weapons transport (choose from several active for the character).
I still don't understand. There is no such thing as "weapons transport" in Factorio. Maybe there's a translation issue here.
regedit2000 wrote:- choose the ammo for the gun turrets.
You can already do that by just putting different ammo in the gun turrets.
regedit2000 wrote:- control the guns themselves (turn on/off, change the range and strength of the shot (for lasers)).
You can already do that by setting entity.active = true/false and adjusting the technology modifiers for the given lasers.

Turret/gun range can't be adjusted runtime and never will be. There's a massive amount of game logic which assumes it never changes and is built on it never changing once the game is loaded.
If you want to get ahold of me I'm almost always on Discord.

User avatar
regedit2000
Inserter
Inserter
Posts: 20
Joined: Mon May 23, 2016 4:00 pm
Contact:

Re: API of the armed entities. Guided weapons

Post by regedit2000 »

============================================================================
Rseding91 wrote:
Fri Jan 11, 2019 10:34 pm
I still don't understand. There is no such thing as "weapons transport" in Factorio. Maybe there's a translation issue here.
vehichle
weapon.png
weapon.png (521.54 KiB) Viewed 2839 times
============================================================================
Rseding91 wrote:
Fri Jan 11, 2019 10:34 pm
You can already do that by just putting different ammo in the gun turrets.
clip.png
clip.png (114.26 KiB) Viewed 2839 times
============================================================================
Rseding91 wrote:
Fri Jan 11, 2019 10:34 pm
You can already do that by setting entity.active = true/false and adjusting the technology modifiers for the given lasers.

Turret/gun range can't be adjusted runtime and never will be. There's a massive amount of game logic which assumes it never changes and is built on it never changing once the game is loaded.
OK. I understood

User avatar
regedit2000
Inserter
Inserter
Posts: 20
Joined: Mon May 23, 2016 4:00 pm
Contact:

Re: API of the armed entities. Guided weapons

Post by regedit2000 »

I'll try to be more precise.
The LuaEntity class provides the variable selected_gun_index for the type "Character" - I suggest the variable selected_gun_index to use for the type "Vehicle".
I also suggest using the new variable selected_ammo_index for the type "Turret"

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: API of the armed entities. Guided weapons

Post by Boodals »

I have implemented selected_gun_index for entities of type Car (which includes tanks) (I have source access). It will be in 0.17.46.
If you want selected_ammo_index for turrets, I suggest making a new topic. I didn't look at implementing it because I don't know how turrets behave when they have multiple ammo slots. It might not be possible, it might be easy.

User avatar
regedit2000
Inserter
Inserter
Posts: 20
Joined: Mon May 23, 2016 4:00 pm
Contact:

Re: API of the armed entities. Guided weapons

Post by regedit2000 »

Boodals wrote:
Thu Jun 06, 2019 12:06 pm
I have implemented selected_gun_index for entities of type Car (which includes tanks) (I have source access). It will be in 0.17.46.
If you want selected_ammo_index for turrets, I suggest making a new topic. I didn't look at implementing it because I don't know how turrets behave when they have multiple ammo slots. It might not be possible, it might be easy.
Thank you very much

Post Reply

Return to “Implemented mod requests”