sounds interesting but,... well,.. i mainly focus on modelling and texturing and i've no clue about functions to be honest. could you give me some more info on that??
is it possible to code a burst-mode for the weapon and detect it firing with the fired- eventhandler, so the eventhandler is only activated once? the prob might be that it is an static weapon... (just an idea)
for a better understanding here's the relevant part of the config and the fired-eventhandler script. this is how it works like in the video. one shot counting as four, with a 4-step sequential effect script.
class cfgWeapons
{
class Default{};
class MGun: default{};
class MachineGun7_6: MGun{};
class MachineGun30: MachineGun7_6{};
class ZSUCannon: MachineGun30{};
class imuc_zpu4_Cannon: ZSUCannon
{
initSpeed=900;
flashSize=1.20;
reloadTime=0.10;
/// burst="4"; <--- making probs!!!
maxLeadSpeed=600;
soundcontinous=0;
canLock=2;
ammo="imuc_14mm_Bullet";
multiplier=4;
displayName="14mm Burst";
displayNameMagazine="14mm Shells";
shortNameMagazine="14mm";
dispersion=0.0300;
sound[]={\imuc_zpu4\zpu4_fire,1,1};
soundContinuous=0;
aiRateOfFire=0.300000;
aiRateOfFireDistance=2000
};
};
class CfgVehicles
{
class All{};
class AllVehicles : All{};
class tank: AllVehicles{};
class apc: tank{};
class m113: apc{};
class imuc_zpu4: m113
{
side=0;
hideProxyInCombat=0;
picture="\imuc_zpu4\izpu4.paa";
crew="imuc_green_officer";
hasDriver=0;
hasGunner=1;
hasCommander=0;
castGunnerShadow=1;
ejectDeadGunner=0;
unitInfoType="UnitInfoSoldier";
hideUnitInfo=1;
irScanRangeMin=0;
irScanRangeMax=1200;
irTarget=0;
maxSpeed=1;
fuelCapacity=0;
transportSolider=0;
weapons[]={"imuc_ZPU4_Cannon"};
magazines[]={"imuc_ZPU4_Cannon"};
gunnerAction="ManActZPU4_Gunner";
gunnerCanSee="31";
class TransportMagazines {};
cost=10000;
class Turret
{
soundServo[]={"Vehicles\gun_elevate",0.03,1.0};
minElev=-20;
maxElev=90;
minTurn=-360;
maxTurn=+360;
gunAxis="OsaHlavne";
turretAxis="OsaVeze";
gunBeg="usti hlavne";
gunEnd="konec hlavne";
body="OtocVez";
gun="OtocHlaven";
};
armor=50;
armorStructural=10.0;
type=0;
model="\imuc_zpu4\zpu4";
icon="antiAC.paa";
displayName="ZPU-4";
nameSound="weapon";
transportSoldier=0;
vehicleclass= "IMUC - Armor";
transportAmmo=0;
accuracy=0.30;
typicalCargo[]={};
transportMaxMagazines=0;
transportMaxWeapons=0;
hiddenselections[]= {"flash1", "flash2", "flash3", "flash4"};
class animations
{
class barrel1
{
type="rotation";
animPeriod=0.1;
selection="barrel1";
axis="axis_barrels";
angle0=0;
angle1=-0.001;
};
class barrel2
{
type="rotation";
animPeriod=0.1;
selection="barrel2";
axis="axis_barrels";
angle0=0;
angle1=-0.001;
};
class barrel3
{
type="rotation";
animPeriod=0.1;
selection="barrel3";
axis="axis_barrels";
angle0=0;
angle1=-0.001;
};
class barrel4
{
type="rotation";
animPeriod=0.1;
selection="barrel4";
axis="axis_barrels";
angle0=0;
angle1=-0.001;
};
};
class eventhandlers
{
fired = "[_this select 0] exec ""\imuc_zpu4\sc\zpu4_fired.sqs"";";
};
};
};
zpu4-fired.sqs:
_zpu = _this select 0
#start
;;barrel1 animation plus flash
_14mmbullet = nearestobject [_zpu,"imuc_14mm_bullet"]
[_14mmbullet, _zpu] exec "\imuc_zpu4\sc\smoke.sqs"
_zpu setobjecttexture [0,"\imuc_zpu4\flash.paa"]
_zpu animate ["barrel1",1]
~0.02
_zpu setobjecttexture [0,""]
_zpu animate ["barrel1",0]
; ----------------------
;;barrel2 animation plus flash
;_bullet = nearestobject [imuc_14mm_bullet,"_zpu"]
;[_bullet] exec "\imuc_zpu4\sc\smoke.sqs"
_zpu setobjecttexture [1,"\imuc_zpu4\flash.paa"]
_zpu animate ["barrel2",1]
~0.02
_zpu setobjecttexture [1,""]
_zpu animate ["barrel2",0]
;-----------------
;barrel3 animation plus flash
;_bullet = nearestobject [imuc_14mm_bullet,"_zpu"]
;[_bullet] exec "\imuc_zpu4\sc\smoke.sqs"
_zpu setobjecttexture [2,"\imuc_zpu4\flash.paa"]
_zpu animate ["barrel3",1]
~0.02
_zpu setobjecttexture [2,""]
_zpu animate ["barrel3",0]
;-----------------
;;barrel4 animation plus flash
;_bullet = nearestobject [imuc_14mm_bullet,"_zpu"]
;[_bullet] exec "\imuc_zpu4\sc\smoke.sqs"
_zpu setobjecttexture [3,"\imuc_zpu4\flash.paa"]
_zpu animate ["barrel4",1]
~0.02
_zpu setobjecttexture [3,""]
_zpu animate ["barrel4",0]
;-----------------
exit
[code/]