I have a script that is misbehaving on a dedicated server. On the mission intro, a helicopter carrying the players, named IntroHeli, passes over a trigger that sets its damage to 0.97, which causes it to crash. A trigger based on IntroHeli's height launches a script. The script sets up the beginning of the game, calls TJ's famous fire.sqs to set IntroHeli alight, kills the pilot and gunner, starts my Helicas system(see editors depot scripts) on the server, and finishes by blowing a tall dark column of smoke to help players find the wreckage.
The smoke code is a simple looped drop command. 4000 times an average random pause of 0.325 seconds is 1300 seconds of smoke. That is over 20 minutes. The ~ command will run at slightly different speeds on all machines. I was trying to keep smoke time to a minimum to prevent unnecessary cpu drain on low-end machines, and used a loop count of 2000 or so. I increased it to 4000 for the release version when playtesters on a dedicated server complained the smoke did not last long enough.
In fact playtesters say that sometimes the smoke is there and sometimes it is not. Even when it is there it seems to last less than a minute, not long enough. Sometimes the fire effects of TJ's fire.sqs are not visible either.
I am so desperate... Here is the code for the trigger:
position[]={5745.482910,83.205139,4124.036621};
a=900.000000;
b=900.000000;
rectangular=1;
age="UNKNOWN";
text="Helicopter crashed";
expCond="((GetPos IntroHeli) Select 2) < 5";
expActiv="[] Exec ""helicrashed.sqs""";
calls script helicrashed.sqs
If (CadetMode) Then {Exit}
; move triggers and markers associated with helicopter crash to crash site vacinity
;
_pos = Position IntroHeli
_xp = _pos Select 0
_yp = _pos Select 1
_pos2D = [ _xp , _yp ]
triggerEastCrash SetPos _pos2D
triggerWestCrash SetPos _pos2D
"MarkerCrashSite" SetMarkerPos _pos2D
"MarkerCrashSite" SetMarkerType "FLAG"
"MarkerV" SetMarkerType "EMPTY"
"MarkerLZ" SetMarkerType "EMPTY"
"MarkerRecon" SetMarkerType "EMPTY"
"0" ObjStatus "HIDDEN"
"1" ObjStatus "HIDDEN"
"2" ObjStatus "HIDDEN"
"3" ObjStatus "ACTIVE"
~1
Hint "Objectives and Map Updated"
;
y2 = -99
If (Local Server) Then {x1 = 20 - Random 40 ; x2 = 20 - Random 40 ; y1 = 20 - Random 40 ; y2 = 20 - Random 40 ; {PublicVariable _x} ForEach ["x1","x2","y1","y2"]}
@(y2 != -99)
[gwj1, 2] SetWPPos [ _xp + x1 , _yp + y1 ]
[gwj2, 2] SetWPPos [ _xp + x2 , _yp + y2 ]
[gwj1, 3] SetWPPos [ _xp + x1 , _yp + y1 ]
[gwj2, 3] SetWPPos [ _xp + x2 , _yp + y2 ]
{_x LockWP FALSE} ForEach [gwj1,gwj2]
~1
;East ammo cans and mash cabinet
y3 = -99
If (Local Server) Then {x1 = 10 - Random 20 ; x1 = x1 + 5*([x1] Call Sign) ; x2 = 10 - Random 20 ; x2 = x2 + 5*([x2] Call Sign) ; x3 = 10 - Random 20 ; x3 = x3 + 5*([x3] Call Sign) ; y1 = 10 - Random 20 ; y1 = y1 + 5*([y1] Call Sign) ; y2 = 10 - Random 20 ; y2 = y2 + 5*([y2] Call Sign) ; y3 = 10 - Random 20 ; y3 = y3 + 5*([y3] Call Sign) ;{PublicVariable _x} ForEach ["x1","x2","x3","y1","y2","y3"]}
@(y3 != -99)
ammoEast1 SetPos [ _xp + x1 , _yp + y1 ]
Mash1 SetPos [ _xp + x3 , _yp + y3 ]
If (("Alive _x" Count Units ZuluR) > 6 ) Then {ammoEast2 SetPos [ _xp + x2 , _yp + y2 ]}
x1 = NIL ; x2 = NIL ; x3 = NIL ; y1 = NIL ; y2 = NIL ; y3 = NIL
[IntroHeli] Exec "fire.sqs"
;Kill ai
IntroPilot Say (hitsounds Call RandomSelect)
IntroGunner Say (hitsounds Call RandomSelect)
~2
IntroPilot SetDamage 1
IntroGunner SetDamage 1
;
~10
;
;start cas on server only
If Not (Local Server) Then {Goto "client"}
[[H1,H2,H3,H4,H5,H6,H13,H14,ExtractHeli],30,5.0,0.5,0.05] Exec "helicas.sqs"
;
#client
;smoke
_i = 0
#loop
_vel= -1.0 + (random 2.0)
drop ["cl_basic", "", "Billboard", 1, 50+(random 25), [0,0,0.3], [ _vel, _vel, 1 + random 3], 1, 0.6, 1,1, [random 3 , 50 + random 15], [[0,0,0,0.80],[0,0,0,0.1 - Random 0.1]], [0,1], 0.2, 1.0, "", "",IntroHeli]
~0.4 - random 0.15
_i = _i + 1
If (_i < 4000) Then {Goto "loop"}
;
1 FadeMusic 1
~5
;
Exit