[Pilot, Wreck] exec "MovePilot.sqs";
This is the MovePilot.sqs Code
;;This Moves the declared Pilot to it's new location,
;; [this] exec "MovePilot.sqs"
;; Requires 30 objects to be placed on the island named (Crashsite1, Crashsite2...Crashsite7)
;; Original Script Written by Strango
;; Only execute on Server, requires gamelogic named server in mission
?!(local Server): exit
;; Variables
_vcl = _this select 1
_man = _this select 0
;; Distance wreck is moved from the Downed Pilot
_Distance = 25
;; Height of Wreck
_Height = 4
;; ***************************************************************************************************
;; Move Downed Pilot
;; ***************************************************************************************************
_randnum = Random 7
;; Hint format ["random is : %1",_randnum]
? (_randnum >= 0) AND (_randnum < 1): goto "R0"
? (_randnum >= 1) AND (_randnum < 2): goto "R1"
? (_randnum >= 2) AND (_randnum < 3): goto "R2"
? (_randnum >= 3) AND (_randnum < 4): goto "R3"
? (_randnum >= 4) AND (_randnum < 5): goto "R4"
? (_randnum >= 5) AND (_randnum < 6): goto "R5"
? (_randnum >= 6) AND (_randnum < 7): goto "R6"
#R0
_vcl SetPos (GetPos Crashsite1); _vcl setdir (Getdir Crashsite1); goto "end";
#R1
_vcl SetPos (GetPos Crashsite2); _vcl setdir (Getdir Crashsite2); goto "end";
#R2
_vcl SetPos (GetPos Crashsite3); _vcl setdir (Getdir Crashsite3); goto "end";
#R3
_vcl SetPos (GetPos Crashsite4); _vcl setdir (Getdir Crashsite4); goto "end";
#R4
_vcl SetPos (GetPos Crashsite5); _vcl setdir (Getdir Crashsite5); goto "end";
#R5
_vcl SetPos (GetPos Crashsite6); _vcl setdir (Getdir Crashsite6); goto "end";
#R6
_vcl SetPos (GetPos Crashsite7); _vcl setdir (Getdir Crashsite7); goto "end";
#end
;; ***************************************************************************************************
;; Move Wreckage
;; ***************************************************************************************************
#B1
;; Get Random Distances of Wreckage from Gamelogic
;; ***************************************************************************************************
;; Get Random Distance Horizontal
_RandX = Random _Distance
;; Get Random Distance Vertical
_RandY = Random _Distance
;; Calculate real distance based on 90 degree angle
_A = _RandX^2 + _RandY^2
_B = sqrt _A
;; If Distance is within 1 meter of Set Distance proceed, if not repeat
? (_B > (_Distance-1)) AND (_B <= _Distance): goto "Mid1"
goto "B1"
;; ***************************************************************************************************
#Mid1
;; Determine Random Bearing of Wreckage to Gamelogic (1 of 4 quadrants)
;; ***************************************************************************************************
_Select = Random 4
? (_Select >= 0) AND (_Select < 1): goto "B1A"
? (_Select >= 1) AND (_Select < 2): goto "B1B"
? (_Select >= 2) AND (_Select < 3): goto "B1C"
? (_Select >= 3) AND (_Select < 4): goto "B1D"
;; ***************************************************************************************************
;; North East Quadrant
#B1A
_vcl setpos[(getpos _vcl select 0)+_RandX,(getpos _vcl select 1)+_RandY,_Height]
goto "B2"
;; ***************************************************************************************************
;; South East Quadrant
#B1B
_vcl setpos[(getpos _vcl select 0)+_RandX,(getpos _vcl select 1)-_RandY,_Height]
goto "B2"
;; ***************************************************************************************************
;; North West Quadrant
#B1C
_vcl setpos[(getpos _vcl select 0)-_RandX,(getpos _vcl select 1)+_RandY,_Height]
goto "B2"
;; ***************************************************************************************************
;; South West Quadrant
#B1D
_vcl setpos[(getpos _vcl select 0)-_RandX,(getpos _vcl select 1)-_RandY,_Height]
goto "B2"
#B2
;;Move Marker Location of Wreck Site to new location
;;"WS" SetMarkerPos (GetPos _vcl)
;;WreckMoved=1; publicvariable "WreckMoved"
;;Remove crewman from present group and put him in Pilot seat, then kill him
[Crewman] join grpNull
Crewman MoveinDriver Wreck
Crewman SetDammage 1
;;Move Pilot into gunners seat
_man MoveInGunner Wreck
Wreck SetDammage .5
Wreck setfuel 0
exit
This is the move Wreck Script.
;; This moves the plane wreckage to the newly placed Pilot
;; This function is called at the end of MovePilot.sqs
;; in the format of [WreckName] exec "MoveWreck.sqs"
;; Orginally written by Strango
;; Only execute on Server, requires gamelogic named server in mission
?!(local Server): exit
;;Variables
;; Name of Downed Pilot
_vcl = Pilot;
;; Wreck's Name as read in from function param
_Wreck = _this select 0
;; Distance wreck is moved from the Downed Pilot
_Distance = 25
;; Height of Wreck
_Height = 4
;; ***************************************************************************************************
;; Move Wreckage
;; ***************************************************************************************************
#B1
;; Get Random Distances of Wreckage from Downed Pilot
;; ***************************************************************************************************
;; Get Random Distance Horizontal
_RandX = Random _Distance
;; Get Random Distance Vertical
_RandY = Random _Distance
;; Calculate real distance based on 90 degree angle
_A = _RandX^2 + _RandY^2
_B = sqrt _A
;; If Distance is within 1 meter of Set Distance proceed, if not repeat
? (_B > (_Distance-1)) AND (_B <= _Distance): goto "Mid1"
goto "B1"
;; ***************************************************************************************************
#Mid1
;; Determine Random Bearing of Wreckage to Downed Pilot (1 of 4 quadrants)
;; ***************************************************************************************************
_Select = Random 4
? (_Select >= 0) AND (_Select < 1): goto "B1A"
? (_Select >= 1) AND (_Select < 2): goto "B1B"
? (_Select >= 2) AND (_Select < 3): goto "B1C"
? (_Select >= 3) AND (_Select < 4): goto "B1D"
;; ***************************************************************************************************
;; North East Quadrant
#B1A
_Wreck setpos[(getpos _vcl select 0)+_RandX,(getpos _vcl select 1)+_RandY,_Height]
goto "B2"
;; ***************************************************************************************************
;; South East Quadrant
#B1B
_Wreck setpos[(getpos _vcl select 0)+_RandX,(getpos _vcl select 1)-_RandY,_Height]
goto "B2"
;; ***************************************************************************************************
;; North West Quadrant
#B1C
_Wreck setpos[(getpos _vcl select 0)-_RandX,(getpos _vcl select 1)+_RandY,_Height]
goto "B2"
;; ***************************************************************************************************
;; South West Quadrant
#B1D
_Wreck setpos[(getpos _vcl select 0)-_RandX,(getpos _vcl select 1)-_RandY,_Height]
goto "B2"
;; (getpos _vcl select 2)+_Height
#B2
;; Move Marker Location of Wreck Site to new location
"WS" SetMarkerPos (GetPos _Wreck)
WreckMoved=1; publicvariable "WreckMoved"
;;Function Call to give orders to Enemy Squad assigned to secure Wreck Site
[_Wreck] exec "MoveSquad-Wreck.sqs"
;;Function Call to give orders to Enemy Squad(s) assigned to patrol the wreck site
;;[E_PS1, _Wreck, 500] exec "PatrolSquad-Wreck.sqs"
;;[E_PS2, _Wreck, 1000] exec "PatrolSquad-Wreck.sqs"
[Crewman] join grpNull
Crewman MoveinDriver Wreck
crewman action ["Engine On",Wreck]
Wreck flyinheight 1
Pilot MoveInGunner Wreck
_Wreck setpos[(getpos _Wreck select 0),(getpos _Wreck select 1),(getpos _vcl select 2)-_Height]
@(GetDammage Wreck)>0
Crewman SetDammage 1
Wreck SetDammage .5
Wreck setfuel 0
exit
What did I do wrong? Did I overlook something simple, or is it all wrong? Why does it work for me, but not for someone else? I need to get it to work on a regular dedicated server, any suggestions? As always any assistance will be greatly appreciated.