Im new to config, I have several 3d models but none of them I've finished, so I decided to finish at least one, the thing is that config is not easy to understand, so I downloaded a some sample models released by BI to understand config files. Now, its not been easy so I went to original config files of original addons I took what I thought was related. I took an M2 machine gun sample to work with. So what I have a carpet named "myweap", within there the files: config.cpp, MyWeapon_mg.p3d and MyWeapon_static.p3d; I just renamed original models (m2_mg.p3d and m2_static.p3d).
I think config works fine, it appears no error message but as you can see it has lot of information that probably just reduplicates information with no necessity.
The weapon appears in the library and can be accessed, can shoot and eve appears with the same texture as the orignal m2 (I didn't altered textures path) but can't mouve the barrel to different directions, it always points at the same place which is useless.
I post the config file it helps someone, problably the mistake is not in the config file but in finishing the 3d model, but I have no idea. If you can tell me what things of the config file are just repating, please tell, it's too long file! (My questions are in the config file...)
#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 CfgMovesBasic {
class DefaultDie; //Extended
class ManActions {
MyWeapon_Gunner = "MyWeapon_Gunner";
};
};
class CfgMovesMaleSdr : CfgMovesBasic {
class States {
class Static_Dead : DefaultDie {
actions = "DeadActions";
file = "\ca\Anims\characters\data\anim\sdr\Mov\Sit\stp\no n\non\AmovPsitMstpSnonWnonDnon_basic.rtm";
speed = 10000000000.000000;
terminal = 1;
soundEnabled = 0;
};
class Crew; //Extended
class M2_Gunner : Crew {
file = "\ca\weapons\Data\Anim\M2_Gunner.rtm";
connectTo[] = {"Static_Dead",1 };
};
};
};
class cfgRecoils {
machinegunBase[] = {0,0,0,0.080000,0.010000,0.040000,0.050000,-0.003000,-0.010000,0.200000,0,0 };
};
class CfgAmmo {
class Default; //Extended
class BulletCore; //Extended
class BulletBase : BulletCore {
hit = 8;
indirectHit = 0;
indirectHitRange = 0;
model = "\ca\Weapons\shell"; //do I have to put all these bullet base? I removed but "class B_127x99_Ball : BulletBase" ask for this
soundFly[] = {"\ca\Weapons\Data\Sound\bulletnoise1",0.112202,1. 200000 };
soundHit1[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_01",0.010 000,1 };
soundHit2[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_02",0.031 623,1 };
soundHit3[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_03",0.010 000,1 };
soundHit4[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_04",0.031 623,1 };
soundHit5[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_05",0.010 000,1 };
soundHit6[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_06",0.010 000,1 };
soundHit7[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_07",0.010 000,1 };
soundHit8[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_08",0.031 623,1 };
soundHit9[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_09",0.017 783,1 };
soundHit10[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_10",0.010 000,1 };
soundHit11[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_13",0.031 623,1 };
soundHit12[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_16",0.010 000,1 };
soundHitMan1[] = {"\ca\Weapons\Data\Sound\bullet_man_hit_01",0.3162 28,1 };
soundHitMan2[] = {"\ca\Weapons\Data\Sound\bullet_man_hit_02",0.3162 28,1 };
soundHitMan3[] = {"\ca\Weapons\Data\Sound\bullet_man_hit_03",0.3162 28,1 };
soundHitMan4[] = {"\ca\Weapons\Data\Sound\bullet_man_hit_04",0.3162 28,1 };
soundHitMan5[] = {"\ca\Weapons\Data\Sound\bullet_man_hit_05",0.3162 28,1 };
soundHitMan6[] = {"\ca\Weapons\Data\Sound\bullet_man_hit_06",0.3162 28,1 };
soundHitMan7[] = {"\ca\Weapons\Data\Sound\bullet_man_hit_07",0.3162 28,1 };
soundHitArmor1[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_01",0.10 0000,1 };
soundHitArmor2[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_02",0.10 0000,1 };
soundHitArmor3[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_03",0.10 0000,1 };
soundHitArmor4[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_04",0.10 0000,1 };
soundHitArmor5[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_05",0.10 0000,1 };
soundHitArmor6[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_06",0.10 0000,1 };
soundHitArmor7[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_07",0.10 0000,1 };
soundHitArmor8[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_08",0.10 0000,1 };
soundHitArmor9[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_09",0.10 0000,1 };
soundHitArmor10[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_10",0.10 0000,1 };
soundHitArmor11[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_11",0.10 0000,1 };
soundHitArmor12[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_12",0.10 0000,1 };
soundHitArmor13[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_13",0.10 0000,1 };
soundHitArmor14[] = {"\ca\Weapons\Data\Sound\bullet_armor_hit_14",0.10 0000,1 };
soundHitBuilding1[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_02",0.017 783,1 };
soundHitBuilding2[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_04",0.017 783,1 };
soundHitBuilding3[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_10",0.017 783,1 };
soundHitBuilding4[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_12",0.017 783,1 };
soundHitBuilding5[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_13",0.005 623,1 };
soundHitBuilding6[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_14",0.017 783,1 };
soundHitBuilding7[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_15",0.017 783,1 };
soundHitBuilding8[] = {"\ca\Weapons\Data\Sound\bullet_ricochet_16",0.017 783,1 };
supersonicCrackNear[] = {"\ca\Weapons\Data\Sound\supersonic_crack_close.ws s",1,1 };
supersonicCrackFar[] = {"\ca\Weapons\Data\Sound\supersonic_crack_50meters .wss",1,1 };
hitGround[] = {"soundHit1",0.083000,"soundHit2",0.083000,"soundH it3",0.083000,"soundHit4",0.083000,"soundHit5",0.0 83000,"soundHit6",0.083000,"soundHit7",0.083000,"s oundHit8",0.083000,"soundHit9",0.083000,"soundHit1 0",0.083000,"soundHit11",0.083000,"soundHit12",0.0 83000 };
hitMan[] = {"soundHitMan1",0.143000,"soundHitMan2",0.143000," soundHitMan3",0.143000,"soundHitMan4",0.143000,"so undHitMan5",0.143000,"soundHitMan6",0.143000,"soun dHitMan7",0.143000 };
hitArmor[] = {"soundHitArmor1",0.071000,"soundHitArmor2",0.0710 00,"soundHitArmor3",0.071000,"soundHitArmor4",0.07 1000,"soundHitArmor5",0.071000,"soundHitArmor6",0. 071000,"soundHitArmor7",0.071000,"soundHitArmor8", 0.071000,"soundHitArmor9",0.071000,"soundHitArmor1 0",0.071000,"soundHitArmor11",0.071000,"soundHitAr mor12",0.071000,"soundHitArmor13",0.071000,"soundH itArmor14",0.071000 };
hitBuilding[] = {"soundHitBuilding1",0.125000,"soundHitBuilding2", 0.125000,"soundHitBuilding3",0.125000,"soundHitBui lding4",0.125000,"soundHitBuilding5",0.125000,"sou ndHitBuilding6",0.125000,"soundHitBuilding7",0.125 000,"soundHitBuilding8",0.125000 };
cartridge = "FxCartridge";
cost = 0.700000;
deflecting = 10;
tracerColor[] = {0,0,0,0 };
tracerColorR[] = {0,0,0,0 };
};
class FlareCore; //Extended
class FlareBase : FlareCore {
};
class B_127x99_Ball : BulletBase {
hit = 26;
indirectHit = 3;
indirectHitRange = 0.010000;
visibleFire = 22;
audibleFire = 22;
visibleFireTime = 3;
cost = 20;
airLock = 1;
tracerColor[] = {0.800000,0.100000,0.100000,0.040000 };
tracerColorR[] = {0.800000,0.100000,0.100000,0.040000 };
};
};
class CfgVehicles {
class All; //Extended
class Strategic; //Extended
class Land; //Extended
class LandVehicle : Land {
class ViewPilot; //Extended
class NewTurret; //Extended
};
class StaticWeapon : LandVehicle {
vehicleClass = "Static";
driverOpticsModel = "\ca\weapons\optika_empty";
selectionClan = "clan";
selectionDashboard = "podsvit pristroju";
selectionShowDamage = "poskozeni";
selectionBackLights = "light_back";
bounding = "usti hlavne";
alphaTracks = 0.700000;
textureTrackWheel = 0;
selectionLeftOffset = "";
selectionRightOffset = "";
memoryPointTrack1L = "";
memoryPointTrack1R = "";
memoryPointTrack2L = "";
memoryPointTrack2R = "";
selectionFireAnim = "zasleh";
fireDustEffect = "FDustEffects";
class DestructionEffects {
};
memoryPointMissile[] = {"spice rakety","usti hlavne" };
memoryPointMissileDir[] = {"konec rakety","konec hlavne" };
memoryPointCargoLight = "cargo light";
gunnerCanSee = "2+8+32";
gunnerHasFlares = 0;
class Turrets {
class MainTurret : NewTurret {
memoryPointsGetInGunner = "pos_gunner";
memoryPointsGetInGunnerDir = "pos_gunner_dir";
memoryPointGunnerOptics = "gunnerview";
memoryPointGun = "usti hlavne";
outGunnerMayFire = 1;
gunnerOpticsModel = "\ca\Weapons\optika_empty";
minTurn = -180;
maxTurn = 180;
initTurn = 0;
minElev = -7;
maxElev = 70;
initElev = 0;
castGunnerShadow = 1;
ejectDeadGunner = 1;
class ViewOptics {
initAngleX = 0;
minAngleX = -30;
maxAngleX = 30;
initAngleY = 0;
minAngleY = -100;
maxAngleY = 100;
initFov = 0.420000;
minFov = 0.220000;
maxFov = 0.640000;
};
};
};
damperSize = 1.400000;
damperForce = 0.800000;
gearBox[] = {-1,0,1 };
soundEnviron[] = {"",1.000000,0.700000 };
soundEngine[] = {"",10.000000,1 };
soundCrash[] = {"",0.562341,1 };
soundGear[] = {"",0.000316,1 };
soundDammage[] = {"",0.010000,1 };
getInAction = "GetInMedium";
getOutAction = "GetOutMedium";
class Wounds {
tex[] = {};
mat[] = {};
};
icon = "iconTank";
mapSize = 5;
displayName = "$STR_DN_TANK";
nameSound = "tank";
accuracy = 0.120000;
getInRadius = 3.500000;
fuelCapacity = 0;
irScanRangeMin = 500;
irScanRangeMax = 4000;
irScanToEyeFactor = 1;
armor = 20;
armorStructural = 2.000000;
class HitEngine {
armor = 0.800000;
material = 60;
name = "motor";
passThrough = 1;
};
class HitHull {
armor = 1;
material = 50;
name = "telo";
passThrough = 1;
};
class HitTurret {
armor = 0.800000;
material = 51;
name = "vez";
passThrough = 1;
};
class HitGun {
armor = 0.600000;
material = 52;
name = "zbran";
passThrough = 1;
};
class HitLTrack {
armor = 0.600000;
material = 53;
name = "pas_L";
passThrough = 1;
};
class HitRTrack {
armor = 0.600000;
material = 54;
name = "pas_P";
passThrough = 1;
};
extCameraPosition[] = {0,1.500000,-9 };
class ViewPilot : ViewPilot {
initAngleX = 7;
minAngleX = -15;
maxAngleX = 25;
initAngleY = 0;
minAngleY = -90;
maxAngleY = 90;
};
cost = 1000000;
steerAheadSimul = 0.400000;
steerAheadPlan = 0.600000;
predictTurnSimul = 1.200000;
predictTurnPlan = 1.800000;
hasGunner = 1;
hasCommander = 0;
ejectDeadDriver = 1;
ejectDeadCargo = 1;
hasDriver = 0;
nightVision = 0;
driverAction = "ManActCargo";
driverInAction = "ManActCargo";
simulation = "tank";
occludeSoundsWhenIn = 1.000000;
obstructSoundsWhenIn = 1.000000;
formationX = 10;
formationZ = 10;
precision = 1;
brakeDistance = 0;
maxSpeed = 0;
canFloat = 0;
weapons[] = {"FakeWeapon" };
magazines[] = {"FakeWeapon" };
type = 1;
threat[] = {0.700000,1,0.300000 };
camouflage = 1;
audible = 1;
hideProxyInCombat = 0;
driverOpticsColor[] = {0,0,0,1 };
class CargoLight {
color[] = {0,0,0,0 };
ambient[] = {0.600000,0,0.150000,1 };
brightness = 0.007000;
};
transportMaxMagazines = 0;
transportMaxWeapons = 0;
class Reflectors {
};
secondaryExplosion = 0;
};
class MyWeaponStaticMG : StaticWeapon { //orginally was M2StaticWeapon, so I don't know if it is right
scope = 2;
side = 1;
crew = "SoldierWB";
model = "\myweap\myweapon_mg"; //this is where the model is located,
picture = "\ca\Weapons\data\ico\m2_mg_CA.paa"; //I didn't change this path so textures appear applied
icon = "\Ca\weapons\Data\map_ico\icomap_M2_CA.paa"; //same here, so same icon
mapSize = 4;
sound[] = {"\ca\Weapons\Data\Sound\MachineGuns_M2HB_SS_v5",1 00.000000,1 };
reloadMagazineSound[] = {"\ca\Weapons\Data\Sound\m2gun_inout",0.031623, 1 };
displayName = "$STR_DN_MyWeapon_MG";
nameSound = "mgun";
typicalCargo[] = {"SoldierWB" };
class Turrets : Turrets {
class MainTurret : MainTurret {
minElev = -10;
minTurn = -70;
maxTurn = 70;
initTurn = 0;
weapons[] = {"MyWeapon" }; //is this right?
magazines[] = {"100Rnd_127x99_M2","100Rnd_127x99_M2","100Rnd_127 x99_M2","100Rnd_127x99_M2" };
gunnerAction = "MyWeapon_Gunner"; //same doubt here? originally it was "M2_Gunner"
};
};
class AnimationSources {
class belt_rotation {
source = "reload";
weapon = "MyWeapon";
};
};
soundGetOut[] = {"\ca\Weapons\Data\Sound\m2gun_inout",0.001000, 1 };
soundGetIn[] = {"\ca\Weapons\Data\Sound\m2gun_inout",0.000316, 1 };
armorStructural = 10.000000;
class Library {
libTextDesc = "$STR_LIB_MyWeapon_MG";
};
};
};
class CfgNonAIVehicles {
class ProxyGunner; //Extended
class ProxyM2Gunner : ProxyGunner {
};
class ProxyWeapon {
};
class ProxySecWeapon {
};
class ProxyM2_Static : ProxyWeapon {
model = "\ca\Weapons\MyWeapon_Static";
simulation = "alwaysshow";
};
};
class CfgMagazines {
class Default; //Extended
class CA_Magazine : Default {
scope = 1;
value = 1;
displayName = "";
model = "\ca\weapons\mag_univ.p3d";
picture = "";
modelSpecial = "";
useAction = 0;
useActionTitle = "";
reloadAction = "ManActReloadMagazine";
ammo = "";
count = 30;
type = 256;
initSpeed = 900;
selectionFireAnim = "zasleh";
nameSound = "";
maxLeadSpeed = 23;
};
class VehicleMagazine : CA_Magazine {
type = 0;
reloadAction = "";
maxLeadSpeed = 100;
};
class 100Rnd_127x99_M2 : VehicleMagazine {
scope = 2;
displayName = "$STR_DN_MyWeapon_MG";
ammo = "B_127x99_Ball";
count = 100;
initSpeed = 930;
maxLeadSpeed = 200;
};
};
class CfgPatches {
class CAWeapons {
units[] = {};
weapons[] = {};
requiredVersion = 0.100000;
requiredAddons[] = {"CAData","CA_Anims_Char" };
};
};
class cfgWeapons {
class Default; //Extended
class MGunCore; //Extended
class MGun : MGunCore {
type = 65536;
cursor = "\ca\Weapons\Data\w_weapon_mg";
cursoraim = "\ca\Weapons\Data\w_weapon_mg";
displayName = "$STR_DN_MGUN";
nameSound = "mgun";
reloadTime = 0.250000;
autoFire = 1;
reloadAction = "ManActReloadMagazine";
sound[] = {"\ca\Weapons\Data\Sound\M60_SS",1.000000,1 };
soundContinuous = 0;
reloadSound[] = {"",1,1 };
initSpeed = 900;
flash = "gunfire";
flashSize = 0.500000;
optics = 0;
};
class MyWeapon : MGun {
scope = 1;
displayName = "$STR_DN_MyWeapon_MG"; //does it display weapon name in-game or in the editor?
autoFire = 1;
magazines[] = {"100Rnd_127x99_M2" };
sound[] = {"\ca\Weapons\Data\Sound\MachineGuns_M2HB_SS_v2",3 .162278,1 };
soundServo[] = {"",0.000100,1.000000 };
reloadTime = 0.110000;
magazineReloadTime = 10;
dispersion = 0.002000;
canLock = 0;
minRange = 1;
minRangeProbab = 0.100000;
midRange = 400;
midRangeProbab = 0.700000;
maxRange = 1200;
maxRangeProbab = 0.040000;
aiDispersionCoefY = 7.000000;
aiDispersionCoefX = 7.000000;
maxLeadSpeed = 600;
};
}; //ends config
I lighter problem is that the name of this addon appears as "*", I mean, no real name but Im not really worried about it.
So this is about three main questions:
1)how to make my turret point to different directions? is it the config?
2)how to simplify the config file?
3)how to display a proper name in-game?
HOME
Reply With Quote


