Hi,
I'd like to write a mod that introduces a new type of enemy. It should be like a boss with lots of HP, spawn at random position, constantly moving in random directions, slowing down when attacked and destroying anything in its path. It's supposed to be the only enemy unit (biters turned off completely) and force the player/s to flee, leaving his main base and rebuild somewhere else.
I have a lot of coding and some factorio modding experience.
I don't know how to create a new type of enemy, if it's even possible or if there any mods out there i can take a look at.
Any help is appreciated, perhaps somebody has seen a mod that creates new types of enemies or knows of a work-around
Adding a Boss/custom Enemy
-
- Burner Inserter
- Posts: 6
- Joined: Sat Feb 25, 2017 8:06 pm
- Contact:
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Adding a Boss/custom Enemy
Just search for "warfare" or "enemies" on the mod portal. There should be a number of mods that introduce new enemies (mostly recolored/rescaled biters). Hopefully you have a good 3D model for your new boss 

Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Burner Inserter
- Posts: 6
- Joined: Sat Feb 25, 2017 8:06 pm
- Contact:
Re: Adding a Boss/custom Enemy
I did that and it turns out ppl are just modifying the biter parameters. I need to make changes to their behaviour and damage handler, that's where i'm stuck.
Maybe it just isn't possible..
Maybe it just isn't possible..
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Adding a Boss/custom Enemy
Going purely by the description i remember that https://mods.factorio.com/mods/Veden/Rampant supposedly introduces some new behavior. But you'll probably require heavy scripting for that (if it's really only just one enemy that shouldn't be a performance problem though).
Not sure what you mean with "damage handler".
Not sure what you mean with "damage handler".
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Burner Inserter
- Posts: 6
- Joined: Sat Feb 25, 2017 8:06 pm
- Contact:
Re: Adding a Boss/custom Enemy
Lol, Rampant was one mod i was looking for but forgot the name. Thanks!
I had success modifying a biter in lua and then use the set_command() function on the entity to make it go to a position i specify even ignoring any damage sources. Hope to release the mod in the near future.
I had success modifying a biter in lua and then use the set_command() function on the entity to make it go to a position i specify even ignoring any damage sources. Hope to release the mod in the near future.
-
- Burner Inserter
- Posts: 6
- Joined: Sat Feb 25, 2017 8:06 pm
- Contact:
Re: Adding a Boss/custom Enemy
Is there any way to slow down an enemy via lua on run-time? I want my boss to slow down while he takes damage..
Re: Adding a Boss/custom Enemy
Fast replace with another prototype. Factorio-style!Factorimon wrote:Is there any way to slow down an enemy via lua on run-time? I want my boss to slow down while he takes damage..
But here is no events.on_damage and you must check in by yourself.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Adding a Boss/custom Enemy
Some "damage" types, like i.e the Slowdown capsule have the effect of...slowing down(!) the enemy
. So as you'll already have to be hooked into on_tick anyway, just spawn some invisible slowdown capsules onto the boss.

Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
-
- Burner Inserter
- Posts: 6
- Joined: Sat Feb 25, 2017 8:06 pm
- Contact:
Re: Adding a Boss/custom Enemy
Both excellent ideas. Unfortunately, i need the movement speed to decrease linear with the boss' HP.
Slowdown capsule effects don't stack, and i would need at LEAST 10 prototypes with different movement_speed to get the desired behaviour. Still, if there's no other way the latter seems to be the best option so far.
Is it possible to change the prototype on a unit or do i have to respawn the unit with a new prototype at the former position?
EDIT: is it possible to equip my boss-unit wih a power armor and exoskeletons? ^^
Slowdown capsule effects don't stack, and i would need at LEAST 10 prototypes with different movement_speed to get the desired behaviour. Still, if there's no other way the latter seems to be the best option so far.
Is it possible to change the prototype on a unit or do i have to respawn the unit with a new prototype at the former position?
EDIT: is it possible to equip my boss-unit wih a power armor and exoskeletons? ^^
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Adding a Boss/custom Enemy
Adding some prototypes isn't really a problem. You'd have to respawn the boss with current position/rotation/orientation/health etc, yes. And the respawning would interrupt the current animation obviously. I'm not sure if the slowdown effect strength can be defined on capsules (it probably can) in which case you could still use 10 different types of invisible slowdown capsules if the animation interruption looks too ugly.
I'm not sure if there's any prototype that has both an armor inventory/grid and a behavior. https://mods.factorio.com/mods/kyranzor/robotarmy has some things that look like vehicles, you might want to check what prototype they are internally.
I'm not sure if there's any prototype that has both an armor inventory/grid and a behavior. https://mods.factorio.com/mods/kyranzor/robotarmy has some things that look like vehicles, you might want to check what prototype they are internally.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.