04-29-2016, 07:10 PM
Among the new stuff in path 1.58 was a new function called setUnitTrait (and the associated getter). Among other things, it allows you to make units engineers or medics, but it also has a very interesting other usage: Stealth.
The parameter camouflageCoef allows you to set a units stealthiness. The interpretation of this parameter is a bit weird: The lower it is, the better the camouflage is.
By default, the value is 1 which means it uses the units natural camouflage. If you set it to zero, the unit is practically undetectable. It is worth noting however that this is a camouflage value; that means that if you move they will hear you. although they will not really be able to detect you. If you fire a weapon, they will instantly spot you if they have line of sight.
Similarly, audibleCoef is for how much noise you make.
With a bit of scripting magic, it should be easy to do things like
The parameter camouflageCoef allows you to set a units stealthiness. The interpretation of this parameter is a bit weird: The lower it is, the better the camouflage is.
By default, the value is 1 which means it uses the units natural camouflage. If you set it to zero, the unit is practically undetectable. It is worth noting however that this is a camouflage value; that means that if you move they will hear you. although they will not really be able to detect you. If you fire a weapon, they will instantly spot you if they have line of sight.
Similarly, audibleCoef is for how much noise you make.
With a bit of scripting magic, it should be easy to do things like
- Underwater insertions that really work by setting the camo coefficient lower the deeper you are
- Infiltration mission without setCaptive were getting out a gun will simply put the camo and audible coefficients back to normal.
- Stealth missions were you can simulate "alertness" levels by increased camouflage
I don't need luck, I have ammo.