Jump to content
Sign in to follow this  
franze

Simple getdammage script

Recommended Posts

I have a simple damage script attached to my vehicle, but it doesn't seem to work. Either it doesn't execute right (a problem with event handlers) or theres a error in the script. The script:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_tank1 = _this select 0

?(getdammage _tank1 >.5):goto "playsound"

goto:"exit"

#playsound

_tank1 vehicleRadio "heavydamage"

_tank1 sidechat "Warning: Structural Integrity Low."

exit

The CfgVehicles section:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgVehicles

{

   class All {};

class AllVehicles: All {};

class Land: AllVehicles {};

class LandVehicle: Land {};

class Tank: LandVehicle

{

class TurretBase {};

};

class APC: Tank {};

class BMP: APC {};

class Jaguarhg: BMP

{

displayName="Jaguar";

picture=\jager\jgr_icn1.paa;

icon = \jager\jgr_icn2.paa;

vehicleClass="Heavy Gear - Gears"

armor=210;

cost=1000000;

side=0;

model=\jaguarhg\jaguarhg;

maxspeed=84;

hasCommander=0;

hasDriver=1;

hasGunner=0;

driverIsGunner=1;

soundEngine[]={"\jager\gr_engn.wav",3.162278,1};

namesound="Tank";

camouflage=8;

fuelCapacity=500;

nightVision=1;

irScanRange = 2000; // long range radar

irScanGround = 2000; // NO IR on ground targets

driverCanSee = CanSeeAll;

type=Armor;

CanFloat=false;

animated=1;

unitInfoType="UnitInfoAirplane";

class TransportMagazines {};

weapons[]={MACjag,APGLjag,LRP32jag};

magazines[]={MACjag,MACjag,MACjag,MACjag,MACjag,APGLjag,LRP32jag};

class Turret: TurretBase

{

gunAxis = "OsaHlavne";

turretAxis = "OsaVeze";

soundServo[]={,0.18,1};

gunBeg = "usti hlavne";

gunEnd = "konec hlavne";

minElev=-40; maxElev=+40;

minTurn=-90; maxTurn=90;

body = "OtocVez";

gun = "OtocHlaven";

};

//threat[] VSoft, VArmor, VAir

threat[]={1, 1, 0.5};

gunnerOpticsModel = "optika_zsu_gunner";

commanderOpticsModel = "optika_tanke_auxiliary";

driverAction = ManActUH60Pilot;

driverInAction = ManActUH60Pilot;

// outGunnerMayFire = true;

forceHideGunner = true;

viewGunnerInExternal = true;

transportSoldier = 0;

};

};

class eventhandlers

{

init = [_this select 0] exec "\jaguarhg\grdamage.sqs";

};

class CfgGroups

{

class North

{

name="Northern Forces";

class HGsquad

{

name="Heavy Gear Squads";

class Commandosquad

{

name="Commando Gear Squad";

class Unit0

{

side=0;

vehicle="Jaguarhg";

rank="Lieutnant";

position[]={0,5,0};

};

class Unit1

{

side=0;

vehicle="Jaguarhg";

rank="Sergeant";

position[]={-20,0,0};

};

class Unit2

{

side=0;

vehicle="Jaguarhg";

rank="Sergeant";

position[]={20,0,0};

};

class Unit3

{

side=0;

vehicle="Jaguarhg";

rank="Sergeant";

position[]={40,0,0};

};

class Unit4

{

side=0;

vehicle="Jaguarhg";

rank="Sergeant";

position[]={60,0,0};

};

};

};

};

So, anything wrong? They LOOK right, but something is wrong with either one of these.

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

driverAction = ManActUH60Pilot;

driverInAction = ManActUH60Pilot;

// outGunnerMayFire = true;

forceHideGunner = true;

viewGunnerInExternal = true;

transportSoldier = 0;

};

};

class eventhandlers

{

init = [_this select 0] exec "\jaguarhg\grdamage.sqs";

};

Move your eventhandler into the cfgvehicles section:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

driverAction = ManActUH60Pilot;

driverInAction = ManActUH60Pilot;

// outGunnerMayFire = true;

forceHideGunner = true;

viewGunnerInExternal = true;

transportSoldier = 0;

class eventhandlers

{

init = [_this select 0] exec "\jaguarhg\grdamage.sqs";

};

};

};

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×