子弹时间视角:// Bullet Cam Script
// v1.2
// cam.sqf
// Big Dawg KS
// 2/14/11
//
// Call via Fired EH, ex:
// this addEventHandler ["fired",{_this call compile preprocessFileLineNumbers "cam.sqf"}]
//
// To exit the camera ingame (while in flight), press the key for ironsights/optics
//
// To add supported weapons, add MUZZLE classnames to _list (note: classnames are CASE SENSITIVE)
//
// To disable bullet cam, set BDKS_DisableBulletCam = true
//
// To disable blur effects, set BDKS_BulletCamNoBlur = true
//
// To disable particle effects, set BDKS_BulletCamNoParticleFX = true
//
// To change FOV (zoom), change the value of BDKS_BulletCamFOV (default 0.05). Ex:
// BDKS_BulletCamFOV = 0.3
//
// To change time acceleration, change the value of BDKS_BulletCamAccTime (default 0.5). Ex:
// BDKS_BulletCamAccTime = 0.2
// (Note: AccTime only works in Singleplayer)
//
// To make another unit's (other than local player) bullet cam show for the
// local player, set unit variable BDKS_ShowBulletCamToPlayer = true, ex:
// if(local Spotter)then{Sniper setVariable ["BDKS_ShowBulletCamToPlayer",true]}
//------------------------------------------------------------------------------------------------
_projectile = nearestObject [_this select 0,_this select 4];
if(count _this >= 7)then{
_projectile = _this select 6;
};
if(call {if(isNil "BDKS_DisableBulletCam")then{true}else{!BDKS_DisableBulletCam}})then{
if((_this select 0) == vehicle player || call {if(isNil {(_this select 0) getVariable "BDKS_ShowBulletCamToPlayer"})then{false}else{(_this select 0) getVariable "BDKS_ShowBulletCamToPlayer"}})then{
// Add more weapons here
_list = ["M40A3","m107","BAF_LRR_scoped","BAF_AS50_scoped","SVD","SVD_CAMO","ksvk","DMR","huntingrifle","SMAW","Javelin","SidewinderLaucher_F35","BombLauncherF35"];
_type = getText (configFile >> "CfgAmmo" >> (_this select 4) >> "simulation");
_relPos = [0,-13,0.05];
_fov = 0.05;
if(!isNil "BDKS_BulletCamFOV")then{_fov = BDKS_BulletCamFOV};
if(_type == "shotMissile" || _type == "shotRocket")then{_relPos = [0,-13,2.2]; _fov = 0.5};
_disablePP = false;
if(call {if(isNil "BDKS_BulletCamNoBlur")then{false}else{BDKS_DisableBulletCam}})then{_disablePP = true};
_accTime = 0.1;
if(!isNil "BDKS_BulletCamAccTime")then{_accTime = BDKS_BulletCamAccTime};
_enableParticles = true;
if(call {if(isNil "BDKS_BulletCamNoParticleFX")then{false}else{BDKS_BulletCamNoParticleFX}})then{_enableParticles = false};
if((_this select 2) in _list && !(isNull _projectile))then{
setAccTime _accTime;
_camera = "camera" camCreate (getPosATL _projectile);
_camera cameraEffect ["INTERNAL","BACK"];
showCinemaBorder false;
cutText ["","BLACK IN",0.2];
_pSource = objNull;
if(_enableParticles && _type == "ShotBullet")then{
_pShape = ["\ca\Data\ParticleEffects\Universal\Universal.p3d", 16, 13, 3, 0];
_pSize = [0.01,0.05];
_pColor = [[1,1,1,0.08],[1,1,1,0.16],[1,1,1,0.03],[1,1,1,0]];
_pSource = "#particlesource" createVehicleLocal (getPos _projectile);
_pSource attachTo [_projectile,[0,0,0]];
_pSource setParticleParams [_pShape,"","Billboard",1,0.3,[0,0,0],[0,0,0],0,1,0.79,0.18,_pSize,_pColor,[1000],100,0.01,"","",_projectile,360];
_pSource setDropInterval 0.001;
};
[_projectile,_camera,_relPos,_fov,_pSource,_disablePP] spawn {
_projectile = _this select 0;
_camera = _this select 1;
_relPos = _this select 2;
_fov = _this select 3;
_pSource = _this select 4;
_disablePP = _this select 5;
_cancel = false;
while{alive _projectile && alive _camera && !_cancel}do{
_camera camSetTarget _projectile;
_camera camSetRelPos _relPos;
_camera camSetFOV _fov;
_camera camSetFocus [600,2];
_camera camCommit 0;
"RadialBlur" ppEffectAdjust [0.02,0.02,0.1,0.1];
"RadialBlur" ppEffectCommit 0.01;
if(!_disablePP)then{"RadialBlur" ppEffectEnable true};
if(inputAction "optics" != 0)then{_cancel = true};
sleep 0.001;
};
if(alive _camera && !_cancel)then{
_camera camSetFocus [-(_relPos select 1),1];
_camera camSetFOV (_fov * 1.6);
_camera camCommit 1.5;
"RadialBlur" ppEffectAdjust [0,0,1,1];
"RadialBlur" ppEffectCommit 0.7;
sleep 1.39;
};
cutText ["","BLACK OUT",0.1];
sleep 0.11;
setAccTime 1;
"RadialBlur" ppEffectEnable false;
_camera cameraEffect ["TERMINATE","BACK"];
camDestroy _camera;
if(!isNull _pSource)then{deleteVehicle _pSource};
cutText ["","BLACK IN",0.6];
};
};
};
};
空袭脚本:
setfire=true;
titleText["Click on the map to set your firedirection","plain down"];
onMapSingleClick"ASTarget setPos _pos;setfire=false";
@!setfire;
"Firedirection"setMarkerPos getPos ASTarget;
onMapSingleClick"";
titleText ["","plain down"]
;==========DEFINE========
_dropPosition = getPos ASTarget;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX - 1500, _dropPosY - 1500, _dropPosZ + 500];
_pilotspawnpos = [_dropPosX - 1500, _dropPosY - 1500, _dropPosZ + 500];
_plane1spawnpos = [_dropPosX - 1509, _dropPosY - 1509, _dropPosZ + 500];
_pilot1spawnpos = [_dropPosX - 1509, _dropPosY - 1509, _dropPosZ + 500];
;=============CREATE===========
_PlaneG = createGroup WEST;
_plane = createVehicle ["AV8B",_planespawnpos,[],0,"FLY"];
_plane setpos [(getPos _plane select 0),(getPos _plane select 1),400];
_pilot = "USMC_Soldier_Pilot" createUnit [getMarkerPos "Firedirection", _PlaneG, "P1=this"];
_Plane setVelocity [50,50,0];
~0.4
P1 moveinDriver _Plane;
P1 SetDamage 0;
P1 action ["gear_up",vehicle P1];
_plane flyinHeight 100;
_plane setSpeedMode "No change";
_plane1G = createGroup WEST;
_plane1 = createVehicle ["AV8B",_plane1spawnpos,[],0,"FLY"];
_plane1 setpos [(getPos _plane1 select 0),(getPos _plane1 select 1),400];
_pilot1 = "USMC_Soldier_Pilot" createUnit [getMarkerPos "Firedirection", _plane1G, "P2=this"];
_plane1 setVelocity [50,50,0];
~0.4
P2 moveinDriver _plane1;
P2 SetDamage 0;
P2 action ["gear_up",vehicle P2];
_plane1 flyinHeight 100;
_plane1 setSpeedMode "No change";
#CHECK
P1 doMove getPos ASTarget;
P1 doTarget ASTarget;
P1 doWatch ASTarget;
? ( _plane distance ASTarget) <550: goto"DROP"
P2 doMove getPos ASTarget;
P2 doTarget ASTarget;
P2 doWatch ASTarget;
? ( _plane1 distance ASTarget) <550: goto"DROP"
goto "CHECK"
;===========FIRE=======
#DROP
_i= 0
_plane FlyInHeight 300;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),300];
_plane1 FlyInHeight 300;
_plane1 setPos [(getPos _plane1 select 0),(getPos _plane1 select 1),300];
~5
#FIRE
_i=_i+1
_plane fire "Bomblauncher";
_plane1 fire "Bomblauncher";
~0.1
?_i<=7:goto "FIRE"
;========FLY AWAY========
ASTarget setpos [0,0,0];
"Firedirection" setMarkerPos [0,0];
_plaine setSpeedMode"Full";
_plaine1 setSpeedMode"Full";
_plane1 flyInHeight 600;
_plane flyInHeight 600;
P1 doMove getPos ASTarget;
P2 doMove getPos ASTarget;
~5
#CHECK2
_plane setDamage 0;
P1 setDamage 0;
?(_plane distance Player) >1500:goto"END";
_plane1 setDamage 0;
P2 setDamage 0;
?(_plane1 distance Player) >1500:goto"END";
goto "CHECK2"
;========DELETE==========
#END
deletevehicle _plane;
deleteGroup _planeG;
deletevehicle P1;
deletevehicle _plane1;
deleteGroup _plane1G;
deletevehicle P2;
exit; |