Page 1 of 1

Follower Robot Lifetime Research Effect

Posted: Thu Mar 02, 2023 2:33 am
by SajuurCor
I'm seeking to make a mod which adds a Research Technology for Robot Follower Lifetime (combat robot lifetime - defender and destroyer capsules).

There is a Technology "Effect" called "follower-robot-lifetime" listed at: [https://lua-api.factorio.com/latest/Con ... gyModifier]

A mod introducing a Technology that uses this Effect can be defined as:

Code: Select all

{
type = "technology",
effects =
{
  {
	type = "follower-robot-lifetime",
	modifier = 1
  }
},
...
},
This works as expected with a modifier of 1 (or any larger integer.) Capsule items in inventory show the expected bonus, and spawned robots have the expected lifetime:

https://steamcommunity.com/sharedfiles/ ... 2940981130 (note 45+45 lifetime)
https://steamcommunity.com/sharedfiles/ ... 2940981402 (note 90 lifetime)

When using a modifier such as 0.2, the capsule's lifetime showed as expected, but the spawned robot does not:

https://steamcommunity.com/sharedfiles/ ... 2940983281 (note 45+9 lifetime)
https://steamcommunity.com/sharedfiles/ ... 2940983354 (note 45 lifetime)

To the best of my knowledge, this Effect is not used by the game but seems to have been made available for use by mods / future use. Is anyone familiar with it, or have experienced similar issues for other Effects? Guessing this is actually a problem when the actual robot is spawned based on the item - since the correct lifetime and research bonus is displayed with a decimal value.

As an alternative, I was considering hooking the on_research_finished event and attempting to change the robot lifetime. I'm not familiar enough with whether that is feasible yet though - planning to look into that further. Alternatively, maybe hook when a robot is spawned, and change its lifetime - but the performance implications of that are likely much heavier.

Appreciate any pointers. Thanks!

Re: Follower Robot Lifetime Research Effect

Posted: Mon Mar 17, 2025 12:05 am
by waremon
Hey ! :D

I used your post to submit a bug report.
Issue is fixed and will be live next update (2.0.42)

I know, it's been 2 year since you posted this but everything is fine now.

Have a nice day ! (if you ever this this)