Home   Help Search Login Register  

Author Topic: Artillery Cam Script  (Read 779 times)

0 Members and 1 Guest are viewing this topic.

armybikos

  • Guest
Artillery Cam Script
« on: 01 Jul 2003, 01:32:40 »
This script is made by a guy named KaRRiLLioN and I have been trying to get it to work so I can use it on individual pieces of artillery and mortars, but it is set up for vehicles that respawn, I was wondering if anyone could fix it for me....thanks for the help here is the script it is really cool




?(_this Select 0) in [10,20,30,40,50,60] : Goto "Rotate"
?(_this Select 0) in [70,80] : Goto "Zoom"

?(Count _this == 0) : Goto "MonitorInit"
?(Count _this > 3) : Goto "Init"

#SetAction
_shooter = _this Select 0
_activator = _this Select 1
_actionid = _this Select 2

?!((_activator) in [Driver _shooter,Gunner _shooter]) : Hint "You cannot activate this unless you are the driver or gunner"; Goto "AmmoCamOff"
?(AmmoCam) : Goto "AmmoCamOff"
 

#AmmoCamOn
?!(AmmoCam) : _shooter RemoveAction _actionid; AmmoCam = TRUE; _shooter addEventHandler ["fired",{_this exec "Karr-AmmoCam.sqs"}]; _shooter AddAction ["Turn Ammo Cam OFF","Karr-AmmoCam.sqs"]
@!((_activator) in [Driver _shooter,Gunner _shooter]) OR !(Alive _activator) OR !(AmmoCam)
?!((_activator) in [Driver _shooter,Gunner _shooter]) : _actionid = _actionid + 1
?((_activator) in [Driver _shooter,Gunner _shooter]) : Exit

#AmmoCamOff
_shooter RemoveAction _actionid
AmmoCam = FALSE
_shooter removeAllEventHandlers "fired"
_shooter AddAction ["Turn Ammo Cam ON","Karr-AmmoCam.sqs"]
Exit

#Init
_shooter = _this Select 0
?(Count _this) > 1 : _weapon = _this Select 1
?(Count _this) > 2 : _muzzle = _this Select 2
?(Count _this) > 3 : _mode = _this Select 3
?(Count _this) > 4 : _ammoType = _this Select 4

?(Count _this) > 3 : Goto "AmmoCam"

Exit

#AmmoCam
;;titletext[Format["Who: %1\nWeap: %2\nMuzzle: %3\nMode: %4\nAmmo: %5",_shooter,_weapon,_muzzle,_mode,_ammoType],"PLAIN"]

titletext[Format["Tracking %1",_ammoType],"PLAIN DOWN"]

_ammo = NearestObject [_shooter,_ammotype]

_camera = "camera" camCreate Getpos _ammo
_camera cameraEffect ["internal","back"]
_camera camSetTarget _ammo
_camera camSetFOV 1.4
ShowCinemaBorder FALSE
aX = 0
aY = -5
aZ = 0
CreateDialog "DlgAmmoCam"

#CamLoop
?!(Alive _ammo): Goto "EndLoop"
_pos = Getpos _ammo
?(Alive _ammo) : _camera camSetRelPos [aX,aY,aZ]
_camera camCommit 0
?!(CtrlVisible 700) : Goto "EndLoop"
?(Alive _ammo) : Goto "CamLoop"

#EndLoop
~1
player cameraEffect ["terminate","back"]
camDestroy _camera
CloseDialog 0

Exit

#MonitorInit

AmmoCam = FALSE

#Monitor
AmmoCamVcl = ObjNull

@!IsNull AmmoCamVcl

_vcl = AmmoCamVcl

_vcl AddAction ["Turn Ammo Cam ON","Karr-AmmoCam.sqs"]

Goto "Monitor"


#Rotate
?(aX < 0) : _val = aX * -1
?(aY < 0) : _val = aY * -1
?(aZ < 0) : _val = aZ * -1

?(aX > 0) : _val = aX * -1
?(aY > 0) : _val = aY * -1
?(aZ > 0) : _val = aZ * -1

;;titletext[Format["_val: %1\n_aX: %2\naY: %3\naZ: %4",_val,aX,aY,aZ],"PLAIN"]

?(_this Select 0) == 10 : aY = _val; aX = 0; aZ = 0
?(_this Select 0) == 20 : aY = _val; aX = 0; aZ = 0
?(_this Select 0) == 30 : aX = _val; aY = 0; aZ = 0
?(_this Select 0) == 40 : aX = _val; aY = 0; aZ = 0
?(_this Select 0) == 50 : aZ = _val; aY = 0; aX = 0
?(_this Select 0) == 60 : aZ = _val; aY = 0; aX = 0
Exit

#Zoom
?(_this Select 0) == 70 AND aX > 0: aX = aX + 5
?(_this Select 0) == 70 AND aY > 0: aY = aY + 5
?(_this Select 0) == 70 AND aZ > 0: aZ = aZ + 5

?(_this Select 0) == 80 AND aX > 5: aX = aX - 5
?(_this Select 0) == 80 AND aY > 5: aY = aY - 5
?(_this Select 0) == 80 AND aZ > 5: aZ = aZ - 5

?(_this Select 0) == 70 AND aX < 0: aX = aX - 5
?(_this Select 0) == 70 AND aY < 0: aY = aY - 5
?(_this Select 0) == 70 AND aZ < 0: aZ = aZ - 5

?(_this Select 0) == 80 AND aX < -5: aX = aX + 5
?(_this Select 0) == 80 AND aY < -5: aY = aY + 5
?(_this Select 0) == 80 AND aZ < -5: aZ = aZ + 5

Exit