By default a vehicle like Offroad for example will get randomised when spawned, i.e. driver door removed or not, cargo door removed or not + other random customisations (this includes military variant of offroad too). Civilians get random glasses hats etc added after unit spawn.
The way I see it there are 2 issues with this:
- If you add some code in unit init like
removeGoggles this
the unit might still have goggles because the randomiser script is executed after init and might well add goggles back.
- You might want default appearance of a vehicle i.e with all doors intact.
Proposed solution is very simple: Add
if (
!isNil "BIS_DO_NOT_RANDOMIZE" &&
{typeName BIS_DO_NOT_RANDOMIZE == typeName false} &&
{BIS_DO_NOT_RANDOMIZE}
) exitWith {};
to the top of every randomiser script. This will give mission designer an option to disable default randomisation behaviour by simply setting
BIS_DO_NOT_RANDOMIZE = true;
at the mission start or before spawning a unit or vehicle, then setting it back to
BIS_DO_NOT_RANDOMIZE = false;
if randomisation is once again required.