Page 1 of 1
Custom behaviour for drones
Posted: Tue Feb 18, 2020 9:33 am
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
Re: Custom behaviour for drones
Posted: Tue Feb 18, 2020 9:43 am
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.
Re: Custom behaviour for drones
Posted: Tue Feb 18, 2020 2:22 pm
by Diamonde123
Thanks