Jump to content
Sign in to follow this  
Student Pilot

Addon Causes Crash

Recommended Posts

I am currently working on a project with Grendel on the OFPEC Forums. It involves tank turrets popping off of the hulls when they are killed. I have a working config for the tank parts. I have defined them as static objects. The best part is, they work ingame. Ok, you ask what my problem is? Well, I don't want to have to make destroyed textures for every model for two reasons: The file size will be too large, and I can't do it. icon_rolleyes.gif So, I am attempting to config the parts as tanks, so as to take advantage of OFP's dammage model. However, when I attempt to use the parts ingame, the game crashes with no error messages. Here is the config I am currently using:

#define TEast 0

#define TWest 1

#define TGuerrila 2

#define TCivilian 3

#define TSideUnknown 4

#define TEnemy 5

#define TFriendly 6

#define TLogic 7

#define true 1

#define false 0

#define private 0

#define protected 1

#define public 2

class CfgPatches

{

class TankParts

{

units[] = {T80_Hull, T80_Turret, T72_Hull, T72_Turret, T55_Hull, T55_Turret, Shilka_Hull, Shilka_Turret, BMP_Hull, BMP_Turret, BMP2_Hull, BMP2_Turret, M60_Hull, M60_Turret, M1_Abrams_Hull, M1_Abrams_Turret, M2A2_Hull, M2A2_Turret};

weapons[] = {};

requiredVersion = 1.9;

};

};

class CfgModels

{

class Default {};

class Vehicle: Default {};

class Tank: Vehicle {};

class T80_Hull: Tank

{

sectionsInherit="";

sections[]={};

};

class T80_Turret: Tank

{

sectionsInherit="";

sections[]={};

};

class T72_Hull: T80_Hull{};

class T72_Turret: T80_Turret{};

class T55_Hull: T80_Hull {};

class T55_Turret: T80_Turret {};

class Shilka_Hull: T80_Hull {};

class Shilka_Turret: T80_Turret {};

class BMP_Hull: T80_Hull {};

class BMP_Turret: T80_Turret {};

class BMP2_Hull: T80_Hull {};

class BMP2_Turret: T80_Turret {};

class M60_Hull: T80_Hull {};

class M60_Turret: T80_Turret {};

class M1_Abrams_Hull: T80_Hull {};

class M1_Abrams_Turret: T80_Turret {};

class M2A2_Hull: T80_Hull {};

class M2A2_Turret: T80_Turret {};

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

class Land: AllVehicles {};

class LandVehicles : Land {};

class Tank : LandVehicles {};

class T80_Turret : Tank

{

scope=2;

vehicleclass="Tank Parts";

icon="tank";

displayname="T80 Turret";

nameSound="";

accuracy=0;

getInRadius = 0;

fuelCapacity=0;

irScanRangeMin=0;

irScanRangeMax=0;

irScanToEyeFactor=0;

armor=200;

armorStructural=2.0;

class HitTurret {armor=0.8;material=51;name=turet;passThrough=1;};

armorTurret=0.8;

cost=0;

steerAheadSimul=0;

steerAheadPlan=0;

predictTurnSimul=0;

predictTurnPlan=0;

hasGunner=false;

hasCommander=false;

hasDriver=false;

nightVision=false;

simulation=tank;

formationX=0;

formationZ=0;

precision=0;

brakeDistance=0;

maxSpeed=0;

side=4;

model="\TankParts\T80_Turret.p3d";

canFloat=false;

weapons[]={};

magazines[]={};

type=VArmor;

threat[]={0, 0, 0};

camouflage = 8; // tank are very easy to spot

audible = 0;

hideProxyInCombat = true;

class TurretBase

{

gunAxis = "";

turretAxis = "";

soundServo[]={};

gunBeg = "";

gunEnd = "";

minElev=0; maxElev=0;

minTurn=0; maxTurn=0;

body = "";

gun = "";

};

class Turret: TurretBase {}

class ComTurret

{

turretAxis = "";

gunAxis = "";

soundServo[]={};

gunBeg = "";

gunEnd = "";

minElev=0; maxElev=0;

minTurn=0; maxTurn=0;

body = "";

gun = "";

};

class Wheels {};

transportMaxMagazines = 0;

transportMaxWeapons = 0;

};

class T80_Hull : Tank

{

scope=2;

vehicleclass="Tank Parts";

icon="tank";

displayname="T80 Hull";

nameSound="";

accuracy=0;

getInRadius = 0;

fuelCapacity=0;

irScanRangeMin=0;

irScanRangeMax=0;

irScanToEyeFactor=0;

armor=200;

armorStructural=2.0;

class HitHull {armor=1;material=50;name=hull;passThrough=1;};

armorHull=1;

cost=0;

steerAheadSimul=0;

steerAheadPlan=0;

predictTurnSimul=0;

predictTurnPlan=0;

hasGunner=false;

hasCommander=false;

hasDriver=false;

nightVision=false;

simulation=tank;

formationX=0;

formationZ=0;

precision=0;

brakeDistance=0;

maxSpeed=0;

side=4;

model="\TankParts\T80_Hull.p3d";

canFloat=false;

weapons[]={};

magazines[]={};

type=VArmor;

threat[]={0, 0, 0};

camouflage = 8; // tank are very easy to spot

audible = 0;

hideProxyInCombat = true;

class TurretBase

{

gunAxis = "";

turretAxis = "";

soundServo[]={};

gunBeg = "";

gunEnd = "";

minElev=0; maxElev=0;

minTurn=0; maxTurn=0;

body = "";

gun = "";

};

class Turret: TurretBase {}

class ComTurret

{

turretAxis = "";

gunAxis = "";

soundServo[]={};

gunBeg = "";

gunEnd = "";

minElev=0; maxElev=0;

minTurn=0; maxTurn=0;

body = "";

gun = "";

};

class Wheels {};

transportMaxMagazines = 0;

transportMaxWeapons = 0;

};

class T72_Hull : T80_Hull

{

displayname="T72 Hull";

model="\TankParts\T72_Hull.p3d";

};

class T72_Turret : T80_Turret

{

displayname="T72 Turret";

model="\TankParts\T72_Turret.p3d";

};

class T55_Hull : T80_Hull

{

displayname="T55 Hull";

model="\TankParts\T55_Hull.p3d";

};

class T55_Turret : T80_Turret

{

displayname="T55 Turret";

model="\TankParts\T55_Turret.p3d";

};

class Shilka_Hull : T80_Hull

{

displayname="Shilka Hull";

model="\TankParts\Shilka_Hull.p3d";

};

class Shilka_Turret : T80_Turret

{

displayname="Shilka Turret";

model="\TankParts\Shilka_Turret.p3d";

};

class BMP_Hull : T80_Hull

{

displayname="BMP Hull";

model="\TankParts\BMP_Hull.p3d";

};

class BMP_Turret : T80_Turret

{

displayname="BMP Turret";

model="\TankParts\BMP_Turret.p3d";

};

class BMP2_Hull : T80_Hull

{

displayname="BMP2 Hull";

model="\TankParts\BMP2_Hull.p3d";

};

class BMP2_Turret : T80_Turret

{

displayname="BMP2 Turret";

model="\TankParts\BMP2_Turret.p3d";

};

class M60_Hull : T80_Hull

{

displayname="M60 Hull";

model="\TankParts\M60_Hull.p3d";

};

class M60_Turret : T80_Turret

{

displayname="M60 Turret";

model="\TankParts\M60_Turret.p3d";

};

class M1_abrams_Hull : T80_Hull

{

displayname="M1 Hull";

model="\TankParts\M1_abrams_Hull.p3d";

};

class M1_abrams_Turret : T80_Turret

{

displayname="M1 Turret";

model="\TankParts\M1_abrams_Turret.p3d";

};

class M2A2_Hull : T80_Hull

{

displayname="M2A2 Hull";

model="\TankParts\M2A2_Hull.p3d";

};

class M2A2_Turret : T80_Turret

{

displayname="M2A2 Turret";

model="\TankParts\M2A2_Turret.p3d";

};

};

As a side note, I am not sure if the problem is in the config or the model. The only selections I have in the models are the ones neccessary for the dammage overlays, namely "turet" in the turrets and "hull" in the hulls.

-Student Pilot

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">minElev=0; maxElev=0;

minTurn=0; maxTurn=0;

Can you have min and max Elev set to that? I tried a similar thing with infantry and got a CTD.

Why not define just one vehicle at a time, and use the default turret classes. As an initial test?

Share this post


Link to post
Share on other sites

Thanks for the reply!

I changed the values to the default values as defined in the commented config. Unfortunately, the game still crashes.

-Student Pilot

Share this post


Link to post
Share on other sites

Did you create a config that just defines, say the T80 hull? If that crashes then post that config, will be easier to work out whats going wrong with a simpler example.

If it does not crash, try adding the T80 turret as well...and so on. Trial and error is the only way I managed to track down these problems.

Share this post


Link to post
Share on other sites

Yes, I did. However, it still didn't work. Unfortunately, I have lost access to the computer that has OFP installed and can not work on my projects for the time being. I won't be able to continue fixing this. sad_o.gif

Sorry, and thanks for your help!

-Student Pilot

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  

×