Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Need help with a cfg

  1. #1
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//USCM APC by manticore aka nephilim

    #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 M577_A1
    {
    units&#91;&#93; = {M577_A1};
    weapons&#91;&#93; = {};
    requiredVersion = 1.75;
    };
    };


    class CfgModels
    {
    class Default
    {
    sections&#91;&#93; = {};
    sectionsInherit = &#34;&#34;;
    };
    class Land&#58; Default {};
    class LandVehicle&#58; Land {};
    class Car&#58; LandVehicle {};
    class Jeep&#58; Car{};
    class JeepMG&#58; Jeep{};
    class M577_A1&#58; JeepMG
    {
    sectionsInherit=&#34;Vehicle&#34;;
    sections&#91;&#93;={&#34;tur1&#34;,tur2&#34;};
    };
    };

    class CfgVehicles
    {
    class All {};
    class AllVehicles&#58; All {};
    class Land&#58; AllVehicles {};
    class LandVehicle&#58; Land {};
    class Car&#58; LandVehicle {};
    class Jeep&#58; Car{};
    class JeepMG&#58; Jeep{};
    class M577_A1&#58; JeepMG
    {
    scope=public;
    crew=Civilian2;
    driverIsCommander=true;
    transportSoldier = 10;
    driverCanSee=CanSeeAll;
    getInRadius=10;
    maxSpeed=150;
    hiddenselections&#91;&#93;={&#34;tur2&#34;};
    side=TWest;
    vehicleClass=&#34;USCM - Vehicles&#34;;
    displayName=M577 A1 APC;
    brakeDistance=3;
    class Reflectors
    {
    class Left
    {
    color&#91;&#93;={0.900000,0.800000,0.600000,1.0000 00};
    ambient&#91;&#93;={0.100000,0.100000,0.100000,1.00 0000};
    position=&#34;L svetlo&#34;;
    direction=&#34;konec L svetla&#34;;
    hitpoint=&#34;L svetlo&#34;;
    selection=&#34;L svetlo&#34;;
    size=0.500000;
    brightness=1.000000;
    };
    class Right
    {
    color&#91;&#93;={0.900000,0.800000,0.600000,1.0000 00};
    ambient&#91;&#93;={0.100000,0.100000,0.100000,1.00 0000};
    position=&#34;P svetlo&#34;;
    direction=&#34;konec P svetla&#34;;
    hitpoint=&#34;P svetlo&#34;;
    selection=&#34;P svetlo&#34;;
    size=0.500000;
    brightness=1.000000;
    };
    };


    sensitivity=0.600000;
    animated=1;

    class Animations
    {
    class driverdooranim
    {
    type=&#34;rotation&#34;;
    animPeriod=1;
    selection=&#34;driverdoor&#34;;
    axis=&#34;driverdoor_axis&#34;;
    angle0=0;
    angle1=-1.92;
    };

    class maindooranim
    {
    type=&#34;rotation&#34;;
    animPeriod=1;
    selection=&#34;maindoor&#34;;
    axis=&#34;maindoor_axis&#34;;
    angle0=0;
    angle1=0.016;
    };
    class mainturretanim1
    {
    type=&#34;rotation&#34;;
    animPeriod=5;
    selection=&#34;tur1&#34;;
    axis=&#34;back_turret_1_axis&#34;;
    angle0=0;
    angle1=rad 90;
    };
    class maiturretanim2
    {
    type=&#34;rotation&#34;;
    animPeriod=5;
    selection=&#34;tur2_anim&#34;;
    axis=&#34;back_turret_2_axis&#34;;
    angle0=0;
    angle1=rad 90;
    };
    };
    class UserActions
    {

    class open_maindoor
    {
    displayName=&#34;Open Maindoor&#34;;
    position=&#34;pos cargo&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;maindooranim&#34;&#34; &#60; 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;maindooranim&#34;&#34;, 1&#93;&#34;;
    };

    class close_maindoor
    {
    displayName=&#34;Close Maindoor&#34;;
    position=&#34;pos cargo&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;maindooranim&#34;&#34; &#62;= 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;maindooranim&#34;&#34;, 0&#93;&#34;;
    };
    class open_driverdoor
    {
    displayName=&#34;Open Driverdoor&#34;;
    position=&#34;pos driver&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;driverdooranim&#34;&#34; &#60; 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;driverdooranim&#34;&#34;, 1&#93;&#34;;
    };

    class close_driverdoor
    {
    displayName=&#34;Close Driverdoor&#34;;
    position=&#34;pos driver&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;driverdooranim&#34;&#34; &#62;= 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;driverdooranim&#34;&#34;, 0&#93;&#34;;
    };
    };
    armor=100;
    accuracy=0.80;
    fuelCapacity=100;
    model=&#34;&#92;uscm_m577&#92;M577_A1.p3d&#34;;
    type=VArmor;
    cost=100000;
    terrainCoef=0.200000;
    wheelCircumference=4.513;
    turnCoef=8.0;
    armorWheels=0.800000;
    weapons&#91;&#93;={SportCarHorn};
    magazines&#91;&#93;={};
    soundEnviron&#91;&#93;={Vehicles&#92;OldRolling_Tr eads1,db-10,0.7};
    soundEngine&#91;&#93;={Vehicles&#92;dieseltruckloo p2,db-20,1};
    soundCrash&#91;&#93;={Vehicles&#92;crash_small2,db-10,1};
    soundGear&#91;&#93;={Vehicles&#92;Gear_Trans1,db-40,1};
    soundDammage&#91;&#93;={Objects&#92;alarm_loop1,db-40,1};
    attendant = true;
    transportAmmo = 1;
    transportMaxMagazines = 100;
    transportMaxWeapons = 25;
    };
    };
    class All{};
    class AllVehicles&#58; All{};
    class Land&#58; AllVehicles{};
    class Man&#58; Land{};
    class Soldier&#58; Man{};
    class SoldierWB&#58; Soldier{};
    class vag_APCfake&#58; SoldierWB
    {
    displayName=&#34;APC&#34;;
    nameSound=&#34;apc&#34;;
    model=&#34;&#92;vag_apc&#92;apc_fake&#34;;
    vehicleClass=&#34;&#34;;
    scope=1;
    side=TWest;
    cost=100000
    sensitivity=1.25;
    accuracy=2.500000;
    armor=5;
    armorStructural=2.0;
    armorHead=0.7;
    armorBody=5.5;
    armorHands=0.5;
    armorLegs=0.5;
    weapons&#91;&#93;={};
    magazines&#91;&#93;={};
    animated=1;
    };
    };[/QUOTE]

    ive added a cfgmodel to it but when i did that the apc wasnt in the list any more...

    i´d be glad if someone coudl fix this

  2. #2
    Only had a quick scan atm, but shouldn&#39;t the cfgPatches be:

    class uscm_m577



    Planck

  3. #3
    try taking a }; away from the cfg models part
    so it should look like this
    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    class CfgModels
    {
    class Default
    {
    sections&#91;&#93; = {};
    sectionsInherit = &#34;&#34;;
    };
    class Land&#58; Default {};
    class LandVehicle&#58; Land {};
    class Car&#58; LandVehicle {};
    class Jeep&#58; Car{};
    class JeepMG&#58; Jeep{};
    class M577_A1&#58; JeepMG
    {
    sectionsInherit=&#34;Vehicle&#34;;
    sections&#91;&#93;={&#34;tur1&#34;,tur2&#34;};
    };
    [/QUOTE]

  4. #4
    ok thx i ll try that one
    but isnt the 2d }; actually supposed to close the cfg models?

    @ planck
    why uscm_m577??
    it the pbo name
    and as i wnat to use the setobejcttexture thingy the class names and the p3d names have to be the same right?

  5. #5
    ok when i leave away the last };
    i get this error message

    Quote Originally Posted by [b
    Quote[/b] ]
    uscm_m577&#92;config.cpp/CfgModels.Land : Member already defined...
    not wots wrong here.......

  6. #6
    Hello nephilim

    It was always my understanding that the cfgPatches section had the following structure:

    class CfgPatches
    {
    class NameOfYourPBO
    {
    units[] = {UnitClassName};
    weapons[] = {};
    requiredVersion = 1.75;
    };
    };

    Your PBO seems to be named uscm_m577, as I deduced from this line:

    model="&#92;uscm_m577&#92;M577_A1.p3d";

    Hence the reason I suggested you try changing it accordingly.

    This would make your cfgPatches like so:

    class CfgPatches
    {
    class uscm_m577
    {
    units[] = {M577_A1};
    weapons[] = {};
    requiredVersion = 1.75;
    };
    };

    Hope this helps


    Planck

  7. #7
    ah ok i got it
    it try that one

    nope didnt work still the same error
    as i mentioned above

    theres sth wrong with the cfg models.....




  8. #8
    look under:-

    1. Your first cfgVehicle class:-
    attendant = true;
    transportAmmo = 1;
    transportMaxMagazines = 100;
    transportMaxWeapons = 25;
    };
    }; <---------this is extra closing. ofp technically will stop reading but as there are extra text after this &#39;closing&#39; it confuses the whole cpp.

    2. In your first cfgVehicle u already defined:-
    *** *** *** class All{};
    *** *** *** class AllVehicles: All{};
    *** *** *** class Land: AllVehicles{};

    therefore u have no need to duplicate it for the 2nd vehicle(man) in the cpp

    Solution:-
    ----------
    1. leave out the array bracket

    2. leave out lines:-
    *** *** *** class All{};
    *** *** *** class AllVehicles: All{};
    *** *** *** class Land: AllVehicles{};
    for your second unit config in the cpp.

    Hope it helps

    PS:..there is a structured way to write the cfgModels section and its not the same manner like in the cfgVehicle style.

    class CfgModels
    {
    class Default
    {
    sections[] = {};
    sectionsInherit = "";
    };
    class Vehicle: Default{};
    class JeepMG: Vehicle
    {
    sectionsInherit="Vehicle";
    sections[]={"tur1",tur2"};
    };
    class M577_A1: JeepMG{};
    };




  9. #9
    ok well ive tried ur stuff and its ingame..
    but i still cant select it in hte mission editor......

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    //USCM APC by manticore
    #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 uscm_m577
    {
    units&#91;&#93; = {M577_A1};
    weapons&#91;&#93; = {};
    requiredVersion = 1.90;
    };
    };

    class CfgModels
    {
    class Default
    {
    sections&#91;&#93; = {};
    sectionsInherit = &#34;&#34;;
    };
    class Land&#58; Default {};
    class LandVehicle&#58; Land {};
    class Car&#58; LandVehicle {};
    class Jeep&#58; Car{};
    class JeepMG&#58; Jeep{};
    class M577_A1&#58; JeepMG
    {
    sectionsInherit=&#34;Vehicle&#34;;
    sections&#91;&#93;={&#34;tur1&#34;,tur2&#34;};
    };


    class CfgVehicles
    {
    class All {};
    class AllVehicles&#58; All {};
    class Land&#58; AllVehicles {};
    class LandVehicle&#58; Land {};
    class Car&#58; LandVehicle {};
    class Jeep&#58; Car{};
    class JeepMG&#58; Jeep{};
    class M577_A1&#58; JeepMG
    {
    scope=public;
    crew=Civilian2;
    driverIsCommander=true;
    transportSoldier = 10;
    driverCanSee=CanSeeAll;
    getInRadius=10;
    maxSpeed=150;
    side=TWest;
    vehicleClass=&#34;USCM - Vehicles&#34;;
    displayName=M577 A1 APC;
    brakeDistance=3;
    class Reflectors
    {
    class Left
    {
    color&#91;&#93;={0.900000,0.800000,0.600000,1.0000 00};
    ambient&#91;&#93;={0.100000,0.100000,0.100000,1.00 0000};
    position=&#34;L svetlo&#34;;
    direction=&#34;konec L svetla&#34;;
    hitpoint=&#34;L svetlo&#34;;
    selection=&#34;L svetlo&#34;;
    size=0.500000;
    brightness=1.000000;
    };
    class Right
    {
    color&#91;&#93;={0.900000,0.800000,0.600000,1.0000 00};
    ambient&#91;&#93;={0.100000,0.100000,0.100000,1.00 0000};
    position=&#34;P svetlo&#34;;
    direction=&#34;konec P svetla&#34;;
    hitpoint=&#34;P svetlo&#34;;
    selection=&#34;P svetlo&#34;;
    size=0.500000;
    brightness=1.000000;
    };
    };


    sensitivity=0.600000;
    hiddenselections&#91;&#93;={&#34;tur2&#34;};
    animated=1;

    class Animations
    {
    class driverdooranim
    {
    type=&#34;rotation&#34;;
    animPeriod=1;
    selection=&#34;driverdoor&#34;;
    axis=&#34;driverdoor_axis&#34;;
    angle0=0;
    angle1=-1.92;
    };

    class maindooranim
    {
    type=&#34;rotation&#34;;
    animPeriod=1;
    selection=&#34;maindoor&#34;;
    axis=&#34;maindoor_axis&#34;;
    angle0=0;
    angle1=0.016;
    };
    class mainturretanim1
    {
    type=&#34;rotation&#34;;
    animPeriod=5;
    selection=&#34;tur1&#34;;
    axis=&#34;back_turret_1_axis&#34;;
    angle0=0;
    angle1=rad 90;
    };
    class mainturretanim2
    {
    type=&#34;rotation&#34;;
    animPeriod=5;
    selection=&#34;tur2_anim&#34;;
    axis=&#34;back_turret_2_axis&#34;;
    angle0=0;
    angle1=rad 90;
    };
    };
    class UserActions
    {

    class open_maindoor
    {
    displayName=&#34;Open Maindoor&#34;;
    position=&#34;pos cargo&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;maindooranim&#34;&#34; &#60; 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;maindooranim&#34;&#34;, 1&#93;&#34;;
    };

    class close_maindoor
    {
    displayName=&#34;Close Maindoor&#34;;
    position=&#34;pos cargo&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;maindooranim&#34;&#34; &#62;= 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;maindooranim&#34;&#34;, 0&#93;&#34;;
    };
    class open_driverdoor
    {
    displayName=&#34;Open Driverdoor&#34;;
    position=&#34;pos driver&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;driverdooranim&#34;&#34; &#60; 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;driverdooranim&#34;&#34;, 1&#93;&#34;;
    };

    class close_driverdoor
    {
    displayName=&#34;Close Driverdoor&#34;;
    position=&#34;pos driver&#34;;
    radius=1.000000;
    condition=&#34;this animationPhase &#34;&#34;driverdooranim&#34;&#34; &#62;= 0.5&#34;;
    statement=&#34;this animate &#91;&#34;&#34;driverdooranim&#34;&#34;, 0&#93;&#34;;
    };
    };
    armor=100;
    accuracy=0.80;
    fuelCapacity=100;
    model=&#34;&#92;uscm_m577&#92;M577_A1&#34;;
    type=VArmor;
    cost=100000;
    terrainCoef=0.200000;
    wheelCircumference=4.513;
    turnCoef=8.0;
    armorWheels=0.800000;
    weapons&#91;&#93;={SportCarHorn};
    magazines&#91;&#93;={};
    soundEnviron&#91;&#93;={Vehicles&#92;OldRolling_Tr eads1,db-10,0.7};
    soundEngine&#91;&#93;={Vehicles&#92;dieseltruckloo p2,db-20,1};
    soundCrash&#91;&#93;={Vehicles&#92;crash_small2,db-10,1};
    soundGear&#91;&#93;={Vehicles&#92;Gear_Trans1,db-40,1};
    soundDammage&#91;&#93;={Objects&#92;alarm_loop1,db-40,1};
    attendant = true;
    transportAmmo = 1;
    transportMaxMagazines = 100;
    transportMaxWeapons = 25;
    };

    class Man&#58; Land{};
    class Soldier&#58; Man{};
    class SoldierWB&#58; Soldier{};
    class vag_APCfake&#58; SoldierWB
    {
    displayName=&#34;APC&#34;;
    nameSound=&#34;apc&#34;;
    model=&#34;&#92;uscm_m577&#92;apc_fake&#34;;
    vehicleClass=&#34;&#34;;
    scope=1;
    side=TWest;
    cost=100000
    sensitivity=1.25;
    accuracy=2.500000;
    armor=5;
    armorStructural=2.0;
    armorHead=0.7;
    armorBody=5.5;
    armorHands=0.5;
    armorLegs=0.5;
    weapons&#91;&#93;={};
    magazines&#91;&#93;={};
    animated=1;
    };
    };[/QUOTE]


    thats how it looks now....
    but still doesn work....

  10. #10
    Hello nephilim

    Looking at your latest version of this config, two things I notice.

    1./ The cfgModels section requires a final };

    thus:

    <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
    class CfgModels
    {
    class Default
    {
    sections&#91;&#93; = {};
    sectionsInherit = &#34;&#34;;
    };
    class Land&#58; Default {};
    class LandVehicle&#58; Land {};
    class Car&#58; LandVehicle {};
    class Jeep&#58; Car{};
    class JeepMG&#58; Jeep{};
    class M577_A1&#58; JeepMG
    {
    sectionsInherit=&#34;Vehicle&#34;;
    sections&#91;&#93;={&#34;tur1&#34;,tur2&#34;};
    };
    };
    [/QUOTE]


    2./ In cfgVehicles.....first model definition.....this line:

    displayName=M577 A1 APC;

    should maybe be like so:

    displayName="M577 A1 APC";



    I hope this helps just a little bit, I haven&#39;t found any other errors yet, but will keep looking as time permits.


    Planck

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •