Hallo, this is my first post. I'm a beginner who just started making modding recently.
Is it possible to specify which target a biter should prioritize attacking?
For example, I would like to prioritize attacking nuclear power plants, or attacking players who have specific items.
Thank you very much.
Specifying the biter's attack target
Re: Specifying the biter's attack target
Code: Select all
/c entity = game.player.selected
entity.is_military_target = true
Re: Specifying the biter's attack target
Thanks for answering. I tried but it didn't work.
I get the following exception: "entity nuclear-reactor (reactor) does not allow to change is_military_target run-time"
I guess "entity.prototype.allow_run_time_change_of_is_military_target" needs to be true, but the value is false and cannot be changed.
Is there a way to change that value?
And is there a way to specify something like is_military_target for a player?
Thank you very much.
I get the following exception: "entity nuclear-reactor (reactor) does not allow to change is_military_target run-time"
I guess "entity.prototype.allow_run_time_change_of_is_military_target" needs to be true, but the value is false and cannot be changed.
Is there a way to change that value?
And is there a way to specify something like is_military_target for a player?
Thank you very much.
Re: Specifying the biter's attack target
You need to set that in data.lua.
Code: Select all
data.raw['entity']['nuclear-reactor'].allow_run_time_change_of_is_military_target = true
Re: Specifying the biter's attack target
Thank you for your answer.
I was able to change is_military_target by setting the following in data.lua.
Thank you very match.
I was able to change is_military_target by setting the following in data.lua.
Code: Select all
data.raw['reactor']['nuclear-reactor'].allow_run_time_change_of_is_military_target = true