Unit & infantry auto-conversion on ammo change
- Units/infantry can now be converted into another unit/infantry by ammo count.
Ammo.AutoConvertMinimumAmountdetermines the minimal number of ammo at which a unit converts automatically.Ammo.AutoConvertMaximumAmountdetermines the maximum number of ammo at which a unit converts automatically.Ammo.AutoConvertTypespecify the new techno after the conversion. This unit must be of the same type of the original (vehicle -> vehicle or infantry -> infantry).- Setting a negative number will disable ammo count check.
In rulesmd.ini:
[SOMETECHNO] ; InfantryType or VehicleType
Ammo.AutoConvertMinimumAmount=-1 ; integer
Ammo.AutoConvertMaximumAmount=-1 ; integer
Ammo.AutoConvertType= ; InfantryType or VehicleType
- Tested in online games.
- This auto-conversion feature requires Ares.
- Based / Inspired in Frione's work for "vehicle auto-deploy / deploy block on ammo change".
Nightly build for this pull request:
- compiled-dll-d9ae7700a920a19299e50f7ce8218b11448ec936.zip These artifacts will expire in 90 days and will not be available for download after that time.
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.
Think it's still better to batch these conditional conversion and AutoDeath in a same condition group, so it has the following benefits:
- use same condition calculation logic, so more consistent
- more conditions can be naturally supported by this system
see https://github.com/Phobos-developers/Phobos/pull/1346
Two concerns:
- Why are the AircraftTypes excluded?
- The behavior of checking during the techno update does not match the description in the document (on ammo change). I think you should check it when the ammo changes or clarify the actual checking timing in the document.
Two concerns:
- Why are the AircraftTypes excluded?
- The behavior of checking during the techno update does not match the description in the document (on ammo change). I think you should check it when the ammo changes or clarify the actual checking timing in the document.
- [SOMETECHNO] ; InfantryType or VehicleType <--- do you mean this in the docs? I never tested what happens in AircraftTypes but since it uses the Ares conversion logic is the same case of any aircraft (again, I never tested it on this kind of unit), only infantry & vehicles that was the initial scope of the feature (the additional types are welcome if they are supported without additional code changes).
- Probably docs confussion but I don't see too much the difference. Modders shouldn't know that the check process is during an internal check done every frame in every techno and is more clear that it happens after the ammo changed the value. Do you have any better idea for changing this text for clarifying the possible confussion?
Think it's still better to batch these conditional conversion and AutoDeath in a same condition group, so it has the following benefits:
- use same condition calculation logic, so more consistent
- more conditions can be naturally supported by this system
see #1346
We can re-think the code after the merge into develop of #1346 but for now I need this feature for my mod and I share the current implementation :-D
Probably docs confussion but I don't see too much the difference. Modders shouldn't know that the check process is during an internal check done every frame in every techno and is more clear that it happens after the ammo changed the value. Do you have any better idea for changing this text for clarifying the possible confussion?
There is not much difference indeed. I think you just need to additionally explain the actual check process in the document.
[SOMETECHNO] ; InfantryType or VehicleType <--- do you mean this in the docs? I never tested what happens in AircraftTypes but since it uses the Ares conversion logic is the same case of any aircraft (again, I never tested it on this kind of unit), only infantry & vehicles that was the initial scope of the feature (the additional types are welcome if they are supported without additional code changes).
You don't need to worry about ConvertToType. If the conversion can not be processed, it will exit safely.