Custom behaviour for drones

Place to get help with not working mods / modding interface.
Diamonde123
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jan 22, 2020 1:42 pm
Contact:

Custom behaviour for drones

Post by Diamonde123 »

Hello! I am making a mod and want to create custom ai for battle drones (they will fly to the target and explode themselves). Can somebody explain me how does factorio ai works (or give some tutorials or some mods with comments in their's code). Also I could not find the file responsible for the ai in the folder lualib
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Custom behaviour for drones

Post by Deadlock989 »

If by "drones" you mean flying combat robots, the "AI" is not exposed to Lua and modders can't change it.

The "unit" AI, i.e. things on the ground like biters, has exposure but requires runtime scripting and a performance overhead to do anything useful with - see here and also the related events. See Earendel's programmable vehicles mod or Klonan's construction robots mod for examples.

"Flies to the target and explodes" sounds like a grenade or a rocket to me, you may as well make it a grenade or a rocket.
Diamonde123
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jan 22, 2020 1:42 pm
Contact:

Re: Custom behaviour for drones

Post by Diamonde123 »

Thanks
Post Reply

Return to “Modding help”