FW200 0 Posted January 7, 2003 Hi, I searched but i couldnt find an answer.. When I put my unit down in the editor and try to preview it crashes with the error: no entry 'config.bin/CFGVehicles/EVI_P51D/Animations/eventhandlers.type' This is my cpp: // some basic defines #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 // type scope #define private 0 #define protected 1 #define public 2 #define WeaponNoSlot 0// dummy weapons #define WeaponSlotPrimary 1// primary weapons #define WeaponSlotSecondary 16// secondary weapons #define WeaponSlotItem 256// items #define WeaponSlotBinocular 4096// binocular #define WeaponHardMounted 65536 class CfgPatches { class EVI_P51D { units[]={EVI_P51D}; weapons[]={FW50cal}; requiredVersion=1.70; }; }; class CfgModels { class Default {}; class Vehicle: Default {}; class EVI_P51D { sectionsInherit="Vehicle"; sections[]={"zasleh"}; }; }; class cfgammo { class Default {}; class BulletSingle : Default {}; class Bullet7_6: BulletSingle {}; class ExplosiveBullet: BulletSingle {}; class Bullet30: ExplosiveBullet {}; class FW50cal : Bullet7_6 { hit=18;indirectHit=8;indirectHitRange=2.2; minRange=500; minRangeProbab=0.80; midRange=1000; midRangeProbab=0.95; maxRange=2000; maxRangeProbab=0.50; }; }; class CfgWeapons { class Default {}; class MGun: Default {}; class MachineGun7_6: MGun {}; class MachineGun30: MachineGun7_6 {}; class FW50cal: MachineGun30 { displayName="6 x Browning .50 cal"; displayNameMagazine="6 x Browning .50 cal"; shortNameMagazine="6 x Browning .50 cal"; ammo="FW50cal"; count=1800; reloadTime=0.002; initSpeed=2000; sound[]={"EVI_PLANES\mg.wav",3.162278,1}; soundContinuous=1; flashSize=0.000000; maxLeadSpeed=950; optics=1; }; }; class CfgVehicles { class All {}; class AllVehicles: All {}; class Air: AllVehicles {}; class Plane: Air {}; class A10: Plane {}; class EVI_P51D: A10 { displayName="P-51D Mustang"; model="\EVI_PLANES\EVI_P51D"; weapons[]={FW50cal}; magazines[]={FW50cal}; precision=200; brakeDistance=100; aileronSensitivity = 1.0; elevatorSensitivity = 1.0; noseDownCoef = 1.0; maxSpeed = 699; armor=25; scope=2; side=1; landingSpeed=120; landingAoa="3.5*3.1415/180"; flapsFrictionCoef=2; soundEngine[]={EVI_PLANES\P51.wav,db-10,1}; soundEnviron[]={Objects\noise,db-60,1.0}; soundServo[]={Vehicles\gun_elevate,db-40,0.4}; class Animations { class CanopyAnimation { type = "rotation"; animperiod = 3; selection ="Canopy"; axis = "osa_Canopy"; angle0 = 0; angle1= 0.787266; }; class eventhandlers { init = [_this select 0] exec "\EVI_PLANES\canopy.sqs"; }; }; }; PS (if you are wondering why it says EVI_PLANES.. im changing his P51 addon.. the classnames wil be changed later. Share this post Link to post Share on other sites
kegetys 2 Posted January 7, 2003 You have your eventhandlers in the animation class, move it to the vehicle's class. Share this post Link to post Share on other sites
FW200 0 Posted January 7, 2003 Thank you for your help.. but im a real n00b when it comes to cpping.. could you (or anyone else) remake that last part.. ? so I could use it?? I tried to change it myself but now OFP crashes without warning Share this post Link to post Share on other sites
kegetys 2 Posted January 7, 2003 Move one of the three }; from below the "class eventhandlers" line above it. Share this post Link to post Share on other sites
-~1ncognito~- 0 Posted January 8, 2003 init = [_this select 0] exec "\EVI_PLANES\canopy.sqs"; should be : init = "(_this select 0) exec ""\EVI_PLANES\canopy.sqs""; anytime you use an eventhandler in the .cpp, anything in the line with commas around it must have double commas. for example: mission initialization line: (_this select 0) exec "\EVI_PLANES\canopy.sqs"; cpp line: "(_this select 0) exec ""\EVI_PLANES\canopy.sqs""; I hope this helps Share this post Link to post Share on other sites
Guest BratZ Posted February 11, 2003 "(_this select 0) exec ""\EVI_PLANES\canopy.sqs"""; still needed another " Share this post Link to post Share on other sites
UnYx 0 Posted February 11, 2003 a remark about the form : in CfgVehicules there is a "};" missing : 5 "{" & only 4 "};" You should use identation like this: </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">Blabla : blabli { XXXX; YYYY; ZZ; { AAAA; }; }; <span id='postcolor'> this helps a lot in keeping clean & working code By the way, strange & non-sensed errors often come from missing "};" or even only ";" hope this helps Share this post Link to post Share on other sites