Jump to content
Sign in to follow this  
FischKopp

Config problem

Recommended Posts

Hi Guys,

I´m working at the moment on my first addon, a US Marine Corps AV-8B Harrier II. Now i´m try to get the congfig.cpp to work, but the Game crash if i try to start OFP. It would be very nice if somebody help me.

Screenshot from the AV-8B Harrier II:

screen01.jpeg

The config file:

#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 AV8BHarrier

{

units[] = {AV8BHarrierA};

weapons[] = {AIM_9x2,AGM_65x2,GAU8_25mm};

requiredVersion = 1.91;

};

};

class CfgModels

{

class Default {};

class vehicle: default {};

class cessna182: Vehicle{};

class AV8BHarrierA: vehicle

{

sectionsInherit="cessna182";

sections[]={"aim9a","aim9b","mavericka","maverickb"};

};

};

class CfgAmmo

{

class Default {};

class AT3: Default {};

class CarlGustav: AT3 {};

class Hellfire: AT3{};

class AA: CarlGustav {};

class AIM_9: AA

{

minRange=100;minRangeProbab=1;

midRange=6000;midRangeProbab=1;

maxRange=10000;maxRangeProbab=1;

manualControl=false;

simulationStep=0.00045;

maxControlRange=100000;

maneuvrability=72;

sideAirFriction=1.00;

simulation=shotMissile;

airLock=1;

irLock=0;

timetolive=80;

initTime=0.4;

maxleadspeed=4600;

thrust=800;

thrustTime=28.000;

maxSpeed=4400;

model = "\HHP_USMC\_Weapons\AIM9.p3d";

proxyShape= "\HHP_USMC\_Weapons\AIM9.p3d";

hit=500;indirectHit=300;indirectHitRange=14;

};

class AGM_65: Hellfire

{

minRange=1000;minRangeProbab=0.30;

midRange=4000;midRangeProbab=0.60;

maxRange=8000;maxRangeProbab=0.90;

irLock=1;

laserLock=0:

initTime=2.0;

ThrustTime=400;

thrust=1600;

maxspeed=8000;

maxleadspeed=8000;

hit=2000;indirectHit=1000;indirectHitRange=12;

model = "\HHP_USMC\_Weapons\AGM65.p3d";

proxyShape = "\HHP_USMC\_Weapons\AGM65.p3d";

manualControl=false;

maxControlRange=8000;

maneuvrability=40.0;

};

class BulletSingle: default {};

class ExplosiveBullet: BulletSingle {};

class Bullet30: ExplosiveBullet {};

class GAU_8: Bullet30

{

hit=30;

indirectHit=10;

indirectHitRange=2;

explosive=0;

airLock=1;

irLock=1;

};

};

class CfgWeapons

{

class Default {};

class LAWLauncher: Default {};

class CarlGustavLauncher : LAWLauncher {};

class AT3Launcher: CarlGustavLauncher {};

class HellfireLauncher: AT3Launcher {};

class MaverickLauncher: HellfireLauncher {};

class AIM_9x2 : MaverickLauncher

{

ammo=AIM_9;

displayName="AIM-9L Sidewnder";

displayNameMagazine="AIM-9L Sidewnder";

shortNameMagazine="AIM9";

count=2;

initspeed=600;

reloadTime=2.4;

model = "\HHP_USMC\_Weapons\AIM9.p3d";

canLock=2;

sound[]={Weapons\Missile,db+18,1};

aiRateOfFire=4;

aiRateOfFireDistance=100;

};

class AGM_65x2 : MaverickLauncher

{

ammo=AIM_65;

displayName="AGM-65 Maverick";

displayNameMagazine="AGM-65 Maverick";

shortNameMagazine="AGM65";

count=2;

initspeed=600;

reloadTime=2.4;

model = "\HHP_USMC\_Weapons\AGM65.p3d";

canLock=2;

sound[]={Weapons\Missile,db+18,1};

aiRateOfFire=4;

aiRateOfFireDistance=100;

};

class MGun: Default {};

class MachineGun7_6: MGun {};

class MachineGun30: MachineGun7_6 {};

class GAU8_25mm: MachineGun30

{

dispersion=0.00100;

displayName="GAU-8 25mm";

displayNameMagazine="GAU-8 25mm";

shortNameMagazine="GAU8";

ammo="GAU_8";

count=300;

initSpeed=1200;

sound[]={Weapons\automatic_cannon,3.162278,1};

reloadTime=0.075;

multiplier=1;

burst=3;

soundContinuous=1;

flashSize=0.000000;

maxLeadSpeed=1600;

optics=1;

};

};

class CfgVehicles

{

class All {};

class AllVehicles: All {};

class Air: AllVehicles {};

class Plane: Air {};

class AV8BHarrierA: Plane

{

displayName="AV-8B Harrier II";

weapons[]={AIM_9x2,AGM_65x2,GAU8_25mm};

magazines[]={AIM_9x2,AGM_65x2,GAU8_25mm};

model="\HHP_USMC\_Air\AV8B_HarrierA";

threat[]={0.6, 0.6, 1.0};

insideSoundCoef = 0.002;

precision=200;

brakeDistance=300;

hiddenselections[] ={"aim9a","aim9b","mavericka","maverickb"};

scope=public;

side=TWest;

accuracy=0.30;

gearRetracting = false;

nameSound="plane";

soundEngine[]={"Vehicles\plane",db-10,1};

soundEnviron[]={"Objects\noise",db-60,1.0};

soundServo[]={"Vehicles\gun_elevate",db-40,0.4};

maneuvrability=50.0;

maxSpeed=1085;

aileronSensitivity = .8;

elevatorSensitivity = .8;

noseDownCoef = .3;

landingAoa = 10*3.1415/180;

steerAheadSimul=1.0;

steerAheadPlan=2.0;

transportSoldier=0;

crew = "SoldierWPilot";

driverAction = ManActuh60Pilot;

fov=0.5;

type=VAir;

armor=95;

extCameraPosition[]={0,3,-15};

irTarget=true;

irScanRange = 2000;

irScanGround = true;

class Animations

{

class frontgear

{

type="rotation";

animperiod=2;

selection="frontgear";

axis="osa_fg";

angle0=0;

angle1=-1.815135;

};

class backgear

{

type ="rotation";

animperiod=2;

selection="backgear";

axis="osa_bg";

angle0=0;

angle1=1.780229;

};

class winggear

{

type="rotation";

animperiod=2;

selection="winggear";

axis="osa_wg";

angle0=0;

angle1=1.483524;

};

class fbay1

{

type="rotation";

animperiod=2;

selection="fbay1";

axis="osa_fbay1";

angle0=0;

angle1=-1.466071;

};

class fbay2

{

type="rotation";

animperiod=2;

selection="fbay2";

axis="osa_fbay2";

angle0=0;

angle1=-1.466071;

};

class fbay3

{

type="rotation";

animperiod=2;

selection="fbay3";

axis="osa_fbay3";

angle0=0;

angle1=-2.617984;

};

class fbay4

{

type="rotation";

animperiod=2;

selection="fbay4";

axis="osa_fbay4";

angle0=0;

angle1=-1.692963;

};

class wbay1

{

type="rotation";

animperiod=2.3;

selection="wbay1";

axis="osa_wbay1";

angle0=0;

angle1=-1.012287;

};

class wbay2

{

type="rotation";

animperiod=2;

selection="wbay2";

axis="osa_wbay2";

angle0=0;

angle1=1.012287;

};

class bbay1

{

type="rotation";

animperiod=2;

selection="bbay1";

axis="osa_bbay1";

angle0=0;

angle1=-2.914689;

};

class bbay2

{

type="rotation";

animperiod=2;

selection="bbay2";

axis="osa_bbay2";

angle0=0;

angle1=1.570790;

};

class bbay3

{

type="rotation";

animperiod=2;

selection="bbay3";

axis="osa_bbay3";

angle0=0;

angle1=-1.570790;

};

class airbrake

{

type="rotation";

animperiod=2;

selection="airbrake";

axis="osa_airbrake";

angle0=0;

angle1=-1.082100;

};

class canopy

{

type="rotation";

animperiod=2;

selection="canopy";

axis="osa_canopy";

angle0=0;

angle1=0.052360;

};

};

class UserActions

{

class LowerLandingGear

{

displayName="Fahrwerk ausfahren";

position="geararea";

radius=2

condition= "this animationPhase ""frontgear"" >= 0.5 and player in this && (getpos driver this select 2)<170;"

statement = "[this] exec ""\HHP_USMC\sqs\av8bgeardn.sqs""";

};

class RaiseLandingGear

{

displayName="Fahrwerk einfahren";

position="geararea";

radius=2

condition = "this animationPhase ""frontgear"" < 0.5 and player in this && (getpos driver this select 2)>70;"

statement = "[this] exec ""\HHP_USMC\sqs\av8bgearup.sqs""";

};

};

class EventHandlers

{

init = [_this select 0] exec "\HHP_USMC\sqs\av8bGearAuto.sqs",[_this select 0] exec "\HHP_USMC\sqs\canopy.sqs",[_this select 0] exec "\HHP_USMC\sqs\av8bGear.sqs",[_this select 0] exec "\HHP_USMC\sqs\av8bweaponA1.sqs",[_this select 0] exec "\HHP_USMC\sqs\av8bweaponA2.sqs";

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class ProxyAIM_9 : ProxyWeapon {model="\HHP_USMC\_Weapons\AIM9.p3d"; simulation = "maverickweapon";}

class ProxyAGM_65 : ProxyWeapon {model="\HHP_USMC\_Weapons\AGM65.p3d"; simulation = "maverickweapon";}

};

Share this post


Link to post
Share on other sites

It causes OFP to crash? Only thing I can see is I would add a few more }; to the end of it all....under the cfgnonaivehicles

Share this post


Link to post
Share on other sites

Well,After trying the config out.It started the game up.So are you haveing trouble when you start to preview the addon in the mission editor?or when you start the game from the .exe?

Share this post


Link to post
Share on other sites

It crashs when i sstart the ofp.exe. Can maybe some scripts cause the Problem?

Share this post


Link to post
Share on other sites

K, possible your conditions as I have never used it this way:

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

condition= "this animationPhase ""frontgear"" >= 0.5 and player in this && (getpos driver this select 2)<170;"

Being no DRIVER in the vehicle yet may cause null?

condition= "this animationPhase ""frontgear"" >= 0.5 and driver in this && (getpos this select 2)<170;"

should work fine

Share this post


Link to post
Share on other sites
It crashs when i sstart the ofp.exe. Can maybe some scripts cause the Problem?

Thats odd,It didnt crash when I started the OFP.exe,I git all the way to the mission editor and hit preview and since i dont have the scripts I couldnt go any further.

Share this post


Link to post
Share on other sites

The gear and canopy scripts worked fine. Here are the weapon scripts:

av8bweaponA1.sqs:

_plane = _this select 0

_player= player

#Start

_plane setobjecttexture [2,"\HHP_USMC\aim9.paa"]

_plane setobjecttexture [3,"\HHP_USMC\aim9.paa"]

#CheckPlay

?(not alive _plane): goto "Exit"

~0.001

goto "CheckWep"

#CheckWep

?(_plane hasWeapon "AIM_9x2"): _weapon2 = "AIM_9x2", goto "CountWep"

goto "CheckWep"

#CountWep

_count2 = _plane ammo _weapon2

0.0001

goto "CheckCount"

#CheckCount

?_count1 == 2 : goto "Start"

?_count1 == 1 : goto "Rem1"

?_count1 == 0 : goto "Rem2"

0.0001

goto "CheckCount"

#Rem1

_plane setobjecttexture [0,""]

_plane setobjecttexture [1,"\HHP_USMC\aim9.paa"]

~0.0001

goto "CheckPlay"

#Rem2

_plane setobjecttexture [0,""]

_plane setobjecttexture [1,""]

~0.0001

goto "CheckPlay"

#Exit

_plane setobjecttexture [0,""]

_plane setobjecttexture [1,""]

exit

av8bweaponA2.sqs:

_plane = _this select 0

_player= player

#Start

_plane setobjecttexture [2,"\HHP_USMC\agm65.paa"]

_plane setobjecttexture [3,"\HHP_USMC\agm65.paa"]

#CheckPlay

?(not alive _plane): goto "Exit"

~0.001

goto "CheckWep"

#CheckWep

?(_plane hasWeapon "AGM_65x2"): _weapon2 = "AGM_65x2", goto "CountWep"

goto "CheckWep"

#CountWep

_count2 = _plane ammo _weapon2

0.0001

goto "CheckCount"

#CheckCount

?_count1 == 2 : goto "Start"

?_count1 == 1 : goto "Rem1"

?_count1 == 0 : goto "Rem2"

0.0001

goto "CheckCount"

#Rem1

_plane setobjecttexture [0,""]

_plane setobjecttexture [1,"\HHP_USMC\agm65.paa"]

~0.0001

goto "CheckPlay"

#Rem2

_plane setobjecttexture [0,""]

_plane setobjecttexture [1,""]

~0.0001

goto "CheckPlay"

#Exit

_plane setobjecttexture [0,""]

_plane setobjecttexture [1,""]

exit

Share this post


Link to post
Share on other sites

Fisch

If you're doing the pseudo-proxies, then you can get rid of

all the CfgNonAIVehicles stuff - it's not needed. Are the

missiles in the model as 'full' models, rather than proxies?

You can use 'getpos this' rather than 'getpos driver this', and

it should give the same result (to within the height of the

driver, ie ~2m or so).

Try removing the weapons from the plane and seeing

if that works. If it doesn't, then there's an error in the p3d file

somewhere - GeoLOD, ViewPilot or Memory. I'd need to see

the mesh to go any further.

The setobjecttexture values in the Mav weapon sqs file are

wrong. Also, it's more usual to attach the code to the fired

EH, rather than having them running all the time.

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  

×