Jump to content
Sign in to follow this  
Bremmer

Config for static objects

Recommended Posts

Hello. I'm a total beginner when it comes to cpp editing, so apologies if this is a simple problem that I should already know about ...

What I am trying to do is make the AI target inanimate objects. Tomb previously managed to get the AI to target the rifle range target, but unfortunately he has lost his work. He did give me a great start with his cpp file (below) that tricks west AI into thinking the target is a UAZ, and I have worked out that the east side will target a 5t refuel truck in the same way.

All good so far, but there a a couple of problems:

- Despite trying to make the AI call the object 'target' they still call it 'UAZ'. Why isn't namesound working. The target also shows up as 'UAZ' in the extended HUD. Is this fixable?

- LAW soldiers thinks its great fun to unleash their full payload into the target, but I would prefer if they engaged with guns only. How can I decide what weapons the AI will engage the target with?

Here's Tombs cpp file ( cheers mate   )

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

{

   class BRM_Target

   {

       units[]={BRM_Target};

       weapons[]={};

       requiredVersion=1.460000000;

   };

};

class CfgVehicles

{

   class All{};

   class AllVehicles: All{};

   class Land: AllVehicles{};

   class LandVehicle: Land{};

   class Car: LandVehicle{};

   class UAZ: Car{};

   class BRM_Target: UAZ

   {

       nameSound="Target";

       scope=2;

       hasDriver=0;

       side=1;

       displayName="Target (West)";

       simulation="House";    // same as below

       coefInside=2;  // fools the game engine to think that it really IS a d**n building!

       coefInsideHeur=4.300000;

       vehicleClass=Objects;

       model="\imb_target\target";

       picture="ivojak";

       icon="unknown_object";

       mapSize=0.4000;

       type=0;

       threat[]={0.00, 0.00, 0.00};

       destrType=DestructTree;

       canSmoke=0;

       accuracy=1000;

       transportSoldier=0;

       transportMaxMagazines=0;

       transportMaxWeapons=0;

       fuelCapacity=0;

       maxSpeed=0.000;

       cost=1000;

       armor=1000;

       soundEngine[]={"",0,1};

       soundEnviron[]={"",0,1};

   };

};

Any help would be much appreciated.

Cheers

Ian  

Share this post


Link to post
Share on other sites
Guest BratZ

I havent tested much with ai firing on buildings, but I believe the armor rating determines what weapon is used (among some other things)

But anything below 100 armor will get mgun fire,and mguns wont fire on anything over 100 I believe,from my work with planes anyways

I see yours is at 1000

Sorry I cant be much help

Share this post


Link to post
Share on other sites

Thanks Bratz, but I don't think the armour value affects how the soldiers engage the target. I tried lowering the value to 10 and rasing it to 100000, but the ai shot it using sidearms (which I want) and LAW rounds (which I don't) regardless.

Cheers anyway

Share this post


Link to post
Share on other sites
Guest BratZ

Ahh see ,from your testing you have helped me too.

I don't understand why it would law something with 10 armor

Somebody should be in to help you with your armor

Share this post


Link to post
Share on other sites
- Despite trying to make the AI call the object 'target' they still call it 'UAZ'. Why isn't namesound working. The target also shows up as 'UAZ' in the extended HUD. Is this fixable?

Because of the "accuracy = 1000" setting you have there, the soldiers will never detect your class and will only "see" the root class, which is the UAZ and call it by it's name. So change the accuracy to 0 or something and it should work.

Share this post


Link to post
Share on other sites
Guest
Ahh see ,from your testing you have helped me too.

I don't understand why it would law something with 10 armor

Somebody should be in to help you with your armor

Cost=1000

This is what determines the AI priority in whether to shoot something or not. Lower this this value (to 10) and they won't be interested in it. smile_o.gif

Share this post


Link to post
Share on other sites

Thanks Kegetys - accuracy was the problem with the name (so higher accuracy means the object is harder to identify, right?). You are truely an OFP genius.

Leone - I don't want the AI to ignore the target all together, I just want to be able to control how they engage the target (bullets = good, rocket propelled grenades = bad). Thanks anyway.

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  

×