Jump to content
Sign in to follow this  
mechastalin

BRDM-2 AT3/MCar problem.

Recommended Posts

Hello! This is my first vehicle addon. It's a BRDM-2 with an AT3 missile rack. It's made by combining parts of Hawk's BRDM-1 with AT3's and the OFPL BRDM-2. The turret still needs retexturing and I need to model the area in the roof the turret lowers into.

brdm2at31jw.th.jpg

The problems I'm having though is that the missle seems to be invisible, fires like a mortar, and doesnt subtract ammo or missiles off the rack.

Share this post


Link to post
Share on other sites

Can you post your config.cpp and stringtable.csv files ?

Also, your vehicle may need a couple (maybe some more) scripts to add the 'eyecandy' features like missile disappearing from rack.

If you want, each missile can depart from its own position rather than from a fixed position like in standard OFP missiles.

EDIT>

Also, may be your vehicle needs a quick tweak on the p3d model so that the MCAR engine works the right way. That's may be the reason it fires like a mortar as you say.

Share this post


Link to post
Share on other sites
Can you post your config.cpp and stringtable.csv files ?

Also, your vehicle may need a couple (maybe some more) scripts to add the 'eyecandy' features like missile disappearing from rack.

If you want, each missile can depart from its own position rather than from a fixed position like in standard OFP missiles.

EDIT>

Also, may be your vehicle needs a quick tweak on the p3d model so that the MCAR engine works the right way. That's may be the reason it fires like a mortar as you say.

Heres the config.cpp. It's a bit of a mess since it still has all the default OFPL stuff in it still.

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

// by Offtime and Jack_410

// cpp and LOD models - AG_Smith

// 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 OFF_BRDM2

{

units[] = {"OFF_BRDM2"};

weapons[] = {"OFF_BRDM2PK_Mounted","OFF_BRDM2KPWT_Mounted"};

requiredVersion = 1.85;

requiredAddons[] = {"BRDM"};

};

};

class CfgModels

{

class Default {};

class Vehicle: Default {};

class Car: Vehicle {};

class OFF_brdm2: Car

{

sectionsInherit="Car";

sections[] = {"L0", "L1", "L2", "P0", "P1", "P2"};

};

};

class CfgAmmo

{

class Default {};

class BulletSingle: Default {};

class Bullet7_6: BulletSingle {};

class OFF_BRDM2KPWTBullet: Bullet7_6

{

hit = 25;indirectHit = 6;indirectHitRange = 0.05;

minRange = 4;minRangeProbab = 0.90;

midRange = 500;midRangeProbab = 0.50;

maxRange = 1000;maxRangeProbab = 0.30;

cost = 8;

cloudlet[]={"WeaponFireGun"}; //?

};

class AT3: Default {};

class HWK_AT3: AT3

{

hit=900;

indirectHit=250;

indirectHitRange=2.500000;

minRange=50;

minRangeProbab=0.500000;

midRange=600;

midRangeProbab=0.950000;

maxRange=2500;

maxRangeProbab=0.500000;

maxSpeed=130;

cost=20000

model="\HWK_BRDM\AT\hwk_at3.p3d";

airlock=0;

irLock=1;

laserLock=1;

manualControl=1;

maxControlRange=3000;

maneuvrability=20.000000;

initTime=0.050000;

thrustTime=26;

thrust=11;

};

};

class CfgWeapons

{

class Default {};

class MGun: Default {};

class MachineGun7_6: MGun {};

class OFF_BRDM2PKT_Mounted: MachineGun7_6

{

scopeWeapon = public;

scopeMagazine = public;

ammo = Bullet7_6E;

count = 2000;

magazineReloadTime = 4;

modelOptics = "optika_PK";

sound[]={"\OFF_BRDM2\snd\pkt.ogg",db0,1};

soundContinuous = false;

displayName = "PKT 7.62mm";

displayNameMagazine = "PKT 7.62mm";

shortNameMagazine = "PKT 7.62mm";

autoReload=true;

};

class MachineGun12_7: MachineGun7_6 {};

class Browning: MachineGun12_7 {};

class OFF_BRDM2KPWT_Mounted: Browning

{

ammo = OFF_BRDM2KPWTBullet;

displayName = "KPWT 14.5mm";

displayNameMagazine = "KPWT 14.5mm";

shortNameMagazine = "KPWT 14.5mm";

nameSound = "mgun";

count = 50;

sound[]={"\OFF_BRDM2\snd\Kpwt.ogg",db-5,1.1};

soundContinuous = false;

reloadTime = 0.1;

initSpeed = 1000;

flash = gunfire;

flashSize = 0.9;

// dispersion = 0.0075;

maxLeadSpeed = 900; // max estimated speed km/h

magazineReloadTime = 4;

// aiDispersionCoefX = 5; // dispersion used to simulate horizontal burst

ffMagnitude = 0.5;

ffFrequency = 11;

ffCount = 6;

recoil = mgunBurst3;

aiRateOfFire = 0.1; // delay between shots at given distance

aiRateOfFireDistance = 1000; // at shorter distance delay goes lineary to zero

autoFire = true;

autoReload=true;

optics = true;

};

class HWK_AT3_Launcher: MachineGun12_7

{

ammo="HWK_dummy_AT3";

nameSound="weapon";

displayName="AT-3";

magazine="AT-3";

displayNameMagazine="AT-3";

shortNameMagazine="AT-3";

count=6;

soundContinuous=0;

dispersion=0.00;

maxLeadSpeed=1250;

ffCount=1;

autoFire=0;

multiplier=1;

burst=0;

aiRateOfFire=37.5;

aiRateOfFireDistance=3750;

autoReload=1;

canlock =2;

initSpeed=80;

flash="gunfire";

flashSize=1.000000;

magazines[]={"HWK_AT3_Launcher"};

sound[]={Weapons\missile,db-50,1};

reloadSound[]={Weapons\missload,db-70,1};

reloadTime = 5;

};

class HWK_AT3_Inv: MachineGun12_7

{

ammo="HWK_inv_AT3";

displayName="";

magazine="";

displayNameMagazine="";

shortNameMagazine="";

count=1;

soundContinuous=0;

dispersion=0.00;

maxLeadSpeed=1250;

ffCount=1;

autoFire=0;

multiplier=1;

burst=0;

aiRateOfFire=37.5;

aiRateOfFireDistance=3750;

autoReload=1;

canlock =2;

initSpeed=1000;

flash="gunfire";

flashSize=1.000000;

magazines[]={"HWK_AT3_Inv"};

sound[]={Weapons\missile,db-50,1};

reloadSound[]={Weapons\missload,db-70,1};

reloadTime = 5;

};

};

class CfgVehicles

{

class All {};

class AllVehicles:All {};

class Land:AllVehicles {};

class LandVehicle: Land {};

class Car: LandVehicle {};

class Jeep: Car {};

class JeepMG: Jeep {};

class BRDM: LandVehicle {};

class OFF_BRDM2: BRDM

{

side = 0;

displayName = "BRDM-2 AT3";

icon="\OFF_BRDM2\ico\ico.paa";

picture="\OFF_BRDM2\ico\pic.paa";

accuracy = 0.3;

model = "\OFF_BRDM2\OFF_brdm2.p3d";

hiddenSelections[]={"L0", "L1", "L2", "P0", "P1", "P2","at3.01","at3.02","at3.03","at3.04","at3.05","at3.06"};

extCameraPosition[]={0,1,-10};

armor=120;

armorstructural=3;

armorBody=1.0;

armorFuel=4.4;

armorLights=0.01;

armorWheels=2;

armorGlass=0.7;

destrType = DestructEngine;

maxSpeed=95;

terrainCoef=2.5;

unitInfoType = UnitInfoSoldier;

hideUnitInfo = false;

weapons[] = {HWK_AT3_Launcher};

magazines[] = {HWK_AT3_Launcher};

hasGunner = true;

gunnerAction = ManActBMPGunner;

gunnerCanSee = CanSeeRadarC+CanSeeOptics+CanSeeEar;

irScanRangeMin = 50;

irScanRangeMax = 1000;

irScanToEyeFactor = 5;

irScanGround = true;

driverIsCommander = true;

driverCanSee = CanSeeRadarC+CanSeeEar;

gunnerhasoptics=1;

gunnerOpticsModel="optika_AT4_Spigot_B";

castGunnerShadow = false;

crew = SoldierECrew;

type = VArmor;

//threat[] VSoft, VArmor, VAir

threat[] = {0.8, 0.2, 0.6};

transportSoldier = 3;

class TransportMagazines

{

class AK74

{

magazine = AK74;

count = 30;

};

class PK

{

magazine = PK;

count = 5;

};

class SVDDragunov

{

magazine = SVDDragunov;

count = 10;

};

class HandGrenade

{

magazine = HandGrenade;

count = 10;

};

class GrenadeLauncher

{

magazine = GrenadeLauncher;

count = 3;

};

class RPGLauncher

{

magazine = RPGLauncher;

count = 3;

};

};

transportAmmo = 0;

transportMaxMagazines = 50;

transportMaxWeapons = 10;

driverAction = ManActV3SDriver;

cargoAction[] = {ManActCargo};

class WeaponCloudsGun {};

class WeaponCloudsMGun: WeaponCloudsGun {};

class MGunClouds: WeaponCloudsMGun

{

access = ReadOnlyVerified;

cloudletDuration = 0.2;

cloudletAnimPeriod = 0.4;

cloudletSize = 4.0;

cloudletAlpha = 0.3;

cloudletGrowUp = 0.05;

cloudletFadeIn = 0;

cloudletFadeOut = 0.1;

cloudletAccY = 0.4;

cloudletMinYSpeed = 0.2;

cloudletMaxYSpeed = 0.6;

cloudletShape = "missileSmoke";

cloudletColor[] = {0.6, 0.6, 0.6, 0.25};

interval = 0.02;

size = 1;

sourceSize = 0.5;

timeToLive = 0.1;

initT = 0;

deltaT = 0;

class Table

{

class T0 {maxT = 0; color[] = {1, 1, 1, 0};}

}

};

class TurretBase {};

class Turret: TurretBase

{

gunAxis = "OsaHlavne";

turretAxis = "OsaVeze";

soundServo[] = {};

gunBeg = "usti hlavne";

gunEnd = "konec hlavne";

minElev=-5;

maxElev="+12";

minTurn=-360;

maxTurn="+360";

body = "OtocVez";

gun = "OtocHlaven";

};

class ViewGunner

{

//initAngleX = 5; minAngleX = -30; maxAngleX = +30;

//initAngleY = 0; minAngleY = 0; maxAngleY = 0;

//initFov = 0.7; minFov = 0.42; maxFov = 0.85;

initAngleX=0;

minAngleX=-1;

maxAngleX=1;

initAngleY=0;

minAngleY=-1;

maxAngleY=1;

initFov=0.7;

minFov=0.42;

maxFov=0.85;

};

class ViewOpticsBase {};

class ViewOptics: ViewOpticsBase

{

/*

initFov = 0.3; minFov = 0.07; maxFov = 0.35;

initAngleX = 5; minAngleX = -30; maxAngleX = 80;

initAngleY = 0; minAngleY = -180; maxAngleY = 180;

*/

initAngleX=0;

minAngleX=-5;

maxAngleX=12;

initAngleY=0;

minAngleY=-5;

maxAngleY=12;

initFov=0.07;

minFov=0.03;

maxFov=0.07;

};

class EventHandlers

{

Init = "(_this select 0) exec ""\HWK_BRDM\scripts\HWK_BRDM_Init.sqs""";

};

}; // brdm2

};

Also whats the stringtable.csv?

Like I said, All the scripts are based off of the Hawk BRDM-1 which had missiles disspearing and such.

And I'm guessing I need 2 small selection which show the missile how to fly?

Share this post


Link to post
Share on other sites

The Hawk BRDM was built using the now obsolete MCAR betas: you'd better using MCAR engine because:

1) the engine is not contained in your files, but is a standalone addon and it's small (90 kb compressed pbo)

2) it works better

3) if the MCAR scripts are updated or a bug corrected you don't need to re-build your addon, as only the MCAr engine will be updated

4) your addon will continue to work even after new versions of the engine will be released

5) it's easier to tweak your missiles as you only need to edit the stringtable.csv file and not the MCAR scripts

In case you still want to use the scripts coming with Hawk's BRDM, then also those scripts need to be edited, and that can be a pain.

If you want to give a try to the MCAR engine, before resolving to use the old MCAR betas, there's some docs about it in the MCAR thread. If you don't want to read through it or you're in a hurry, we can help you: we need the whole pbo containing the vehicle and missile models and the scripts. Then you could gives up hints about the missile behaviour (like burn time, max speed, max range and so on) so that we can make it as close to reality as possible. Or if you wish to do it yourself we can give you hints how to build the stringtable.csv file (although there are docs explaining this).

About the stringtable.csv file: in the MCAR engine it's used to define missile properties, like you normally do in config.cpp for a standard OFP missile.

EDIT>

the 'selections' you mean are probably the cargo proxies. You need at least two for the missile direction and starting position: if you want that each of the five missiles starts from its right spot then you need other four or five of them. Don't worry as they're easy to set up. From your config file, assuming one cargo slot is occupied by a passenger, you have already two in place. Probably they only need a little tweaking. Also, the initspeed of the AT3 launcher is too low. Anyway, once you have decided if to use the MCAR engine or the MCAR files coming with Hawk's addon, we can help you setting up the missile. Frankly I would prefer if you use the MCAR engine cause it's easier to set up: anyway it's your choice.

Share this post


Link to post
Share on other sites

I would rather use the latest version of the Mcar engine. But I dont have much of an idea how as I have no experience with it.

Share this post


Link to post
Share on other sites

Don't worry. Assuming your p3d model is set up correctly, I could build you a stringtable.csv file rather quickly so you can test it in game. Eyecandy features will require some more work an probably their own scripts, but they come last.

So, first download the docs from this link:MCAR engine docs

Although incomplete, read the 'Building the models.pdf' file so that you can know if your p3d model is set up correctly. Once you know this for sure, post either here in this thread again or PM me. Please note it may take some time for me to answer.

I'll then post up a stringtable.csv file and an updated config.cpp file, plus some other file containing the p3d models of the missile.

I will use a tow, as I've it already ready, but you can substitute it with the correct AT3 model later. Now its purpose would be only for you to check it in game if it works the way you like.

Once you've tested it and you like the way it works, you or we can pass to the eye candy. As I said, this may require a little tweaking either of the scripts and model, but should be easy stuff. Also, I'd need to know the pbo name of your addon (I suppose it's neither OFF_BRDM2 or HWK_BRDM ).

Share this post


Link to post
Share on other sites

I setup the proxies for the first missile fire location, Should I take the time to set all 6 up?

Share this post


Link to post
Share on other sites

For eyecandy, yes: if you just want to test it quickly, not, even because for the rest of the eyecandy stuff you'll need additional scripts. So for the moment let's say not. After you tested the vehicle with the files I'll upload, and it works, you can pass to the eye candy, as it's easier and either the config.cpp file and stringtable.csv file only need to be slightly modified.

Give me some hours to set up the config.cpp and the stringtable.csv files. I'll then post up a link for you to download the whole needed stuff, with instructions.

EDIT>

I forgot: please tell me your addon base directory or pbo name as I need it to configure either the config.cpp file and the stringtable.csv one.

Share this post


Link to post
Share on other sites

The base directory is OFF_BRDM2 I havnt gotten around to changing it yet. Dont worry I'm sure I can change the code myself when I finally do change it.

Also I did go ahead and setup all 6 firing gamelogics plus the 2 gamelogics to control where to look.

The vehicle also has the ability to carry 2 passengers in the back.

Share this post


Link to post
Share on other sites

Try this:

stuff

unrar them in your OFF_BRDM2 directory to overwrite the old files (basicly only the config.cpp file, and it adds some other).

Note that eventual random numbers and other effects obtained via the init eventhandler will not be displayed as I needed to write my own init eH. You can eventually add them, because nothing is screwed up.

The missile (if it works...) will look and act like a tow cause I've no access atm at AT3 characteristics, so I left the acceleration, endurance and models untouched from the tow humvee. These can be modified easier later, a part the missile shape which need its own model.

Tell me if it works or not. I assumed you have 10 (ten) cargo proxies in your model: 2 for passengers and 8 for mcar gamelogics. If this is not the case the scripts won't work.

EDIT>

I forgot to tell you, but I'm sure you already know, that you must have MCAR_engine.pbo in your addons directory.

Share this post


Link to post
Share on other sites

Gunna give it a test now, One sec.

I get an error about there not being an entry .modelspecial

Share this post


Link to post
Share on other sites

This error is probably given by some weapon in the config.cpp file utilizing an undefined ammo. Give me some minutes to check the config out.

EDIT>

try this, that is a fix anyway:

in the 'magazines[]' parameter in the cfgVehicles part of the config regarding the BRDM2, substitute this line in place of the previous one:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> magazines[] = {HWK_AT3_Launcher,HWK_AT3_Inv};

then pbo it and test again. And let me know !

EDIT2>

Also, you can substitute this line in stringtable.csv file, to check for different launch positions:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">OFF_BRDM2A_P1,"[[call{if((_vs ammo ""HWK_AT3_Launcher"")+2==8)then{2}else{(_vs ammo ""HWK_AT3_Launcher"")+2}}],[0,1]]",gamelogics used to get starting missile location and direction

of course this will not make the missiles disappear from the rack as this require a custom script using setObjectTexture. But you can test if the missiles start from the right spot: a launch configuration can be this one:

| 3 |

| 1 |

| 5 |

| |

| 6 |

| 2 |

| 4 |

Hope its clear (anyway it's just a hint as I've no idea of the real missile launch sequence). The numbers refer to the gamelogics position, but since you have 10 cargo spaces, the number '1' refers to proxy.cargo.05, number '2" to proxy.cargo.06 and so on.

Share this post


Link to post
Share on other sites

It works, Thanks!

I guess theres an error with my cargo proxies as the missile shoots sideways out the right side of the turret.

Share this post


Link to post
Share on other sites

Hmm, I get some errors on the top left when using that script that checks for multiple launch posistions.

Share this post


Link to post
Share on other sites

Probably it's as you said.

assuming you have 2 cargo spaces reserved for passengers you should have:

cargo:proxy.01 (or proxy:uazxodriver.01 or whatever) as the first proxy for the first passenger

cargo:proxy.02 (or proxy:uazxodriver.02 or whatever) as the second proxy for the second passenger

cargo:proxy.03 as the 'konec hlavne' point of the fake weapon

cargo:proxy.04 as the 'usti hlavne' point of the fake weapon

the two previous proxies are used to find the direction the 'missile' was fired at, and they must be linked to the otochlavne selection (refers to the docs I've spoken about for more info)

cargo:proxy.05 to cargo:proxy.10 for the missiles' starting points

EDIT>

see if the proxies are named and placed correctly. If so, I may have to give a look at your p3d model, to ensure it's not the MCAR engine being bugged: multiple launch positions works well and are tested for AA vehicles, but I've never seen them used on AT vehicles, and that's may be the cause. I think it would be a quick fix though.

Share this post


Link to post
Share on other sites

I'm downloading it now: you can remove the link if you want no other to have a look. If so, I'll PM you the corrected p3d model (admitting it needs to be corrected): just give me some time.

Share this post


Link to post
Share on other sites

FOUND!

you have proxy:uazcodriver.01 besides proxy:Cargo.01 : this is the reason the missile is firing sideways. Rename all the proxy:cargo.xx starting from proxy:cargo.02 (so that proxy:cargo.01 becomes proxy:cargo.02, proxy:cargo.02 becomes proxy:cargo.03 and so on).

Then change this line in config.cpp:

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

to

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

and change this line in stringtable.csv:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">OFF_BRDM2_PRN,"10",'transportSoldier' value

to

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">OFF_BRDM2_PRN,"11",'transportSoldier' value

it should work now. At least I hope ...

Share this post


Link to post
Share on other sites

I tried myself, but doesn't work right cause there are some minor changes to make in the p3d model:some other minor fixes.

If you can wait 2 or 3 hours, or perhaps some more, I should be able to fix it and post a working link.

Share this post


Link to post
Share on other sites

Hmm, Well I'm not too good at mapping textures so I wouldnt want to risk losing that if that could happen.

Otherwise it's good.

The multiple firing posistions seem to work from what little smoke I could see though.

Share this post


Link to post
Share on other sites
The multiple firing posistions seem to work from what little smoke I could see though.

What did you mentioned? multiple firing positions? Did i understood right?  wow_o.gif

heh, nice AT BRDM-2  thumbs-up.gif

Share this post


Link to post
Share on other sites
The multiple firing posistions seem to work from what little smoke I could see though.

What did you mentioned? multiple firing positions? Did i understood right? wow_o.gif

heh, nice AT BRDM-2 thumbs-up.gif

Yeah, The missile shoots from where the missile being fired off the rack is.

Share this post


Link to post
Share on other sites

I'm glad to see somebody enhancing our base model. I wish more models were released out there as open source, like this one.

PS. Just a small remainder, make sure to change the OFF_ tag to your own one. smile_o.gif

Share this post


Link to post
Share on other sites

I got it almost working: almost because as I suspected the AT guidance codes of the MCAR engine weren't made for multiple launching positions. I've got to patch it up, then I'll send you back the whole thing when I'm sure it works right. Without multiple launching positions it should work right off the shelf. If you want to try just remove the cargo proxies used to set each missile position (there are six of them), rewrote that line I told you to change in stringtable.csv:

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

and modify the 'transportsoldier' value in config.cpp to 5 and the conresponding line in stringtable.csv (OFF_BRDM2_PRN) to

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

Anyway since I'm on it give me some time (maybe even a day or two) so I can update the MCAR engine too. I'll try to be quick, but I must re-test older addons to be sure they continue to work. Then you can re-use multiple launching positions.

EDIT>

you're right about texture mapping. The problem is that the .p3d model you sent me really needs to be modified (a quick work, anyway) because some cargo proxies are not linked to otocvez and otochlavne, the two cargo proxies used for getting the firing direction need to be placed at exactly the same height (Y value in O2) for aiming precision reasons and some part of the model in Cargo view lod needs to be removed for the optics to work. When I'll send you back the working model and config you could simply try to replicate the changes I made. Otherwise send me the whole pbo (please rar it, cause I'm only on ISDN).

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  

×