Problem solved. Here, a copy of my answer from the twin thread over at the official forums:
Thx Killswitch, the error is gone but there is still nothing hapening with the visor/goggles.
Tested locally, i.e. in SP in the editor. Worked just fine. However, I might have an idea... this is for MP, right? Remember this:
- action and animate should only be executed where the affected unit is local
- setObjectTexture otoh, has to be done on all machines. (IIRC)
The script snippet above doesn't take that into consideration. This one does:
_chopper = _this select 0
_VISORDTEX = {\BAS_SOAR\cmn\visord.paa}
_VISORTEX = {\BAS_SOAR\cmn\visor.paa}
?(daytime > 19) || (daytime < 5): goto "NV"
#Visor
{ if (local _x) then {_x animate ["goggles", 1]}; _x setObjectTexture [0, _VISORDTEX]; _x setObjectTexture [2,_VISORTEX] } forEach crew _chopper
goto "end"
#NV
{if (local _x) then {_x animate ["ngoggles", 1]; _x action ["NVGoggles"] }} forEach crew _chopper
#end
exit
It would have to be run on all machines, possibly by a trigger.
*EDIT: Tested that script, activated by a trigger, in MP on a dedicated server with an AI helo (i.e its not local to my client machine). Works just fine.
PS. I'd better put in a "caveat emptor" here before some unexperienced mission maker uses this script in a way it wasn't intended for and blame me for sucky scripting: this is only tested with helos crewed by BAS SOAR pilots that have the animations and custom textures needed for the operations in the script.