Home   Help Search Login Register  

Author Topic: cpp for a static target  (Read 922 times)

0 Members and 1 Guest are viewing this topic.

Bremmer

  • Guest
cpp for a static target
« on: 26 May 2003, 23:41:25 »
Hello

This is my first post in the addons section of the forums, and I'm a bit embarassed about the simplicity of the problem I'm having. Truth be told I know next to nothing about addon editing  :-[

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  ;) )

Code: [Select]
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. Also is there a definitive list of cpp commands? I found a couple of tutorials on cpps but the seemed a bit threadbare.

Cheers

Ian

asmodeus

  • Guest
Re:cpp for a static target
« Reply #1 on: 26 May 2003, 23:58:05 »
Hey there Ian!

I've never attempted to do what you're describing..  

However, I thought it might help to point out the "commented config.cpp" that can be found on the official O2 site.   ;)  Have you checked that out yet?

Also, LCD is our mods' .cpp expert..  I'll see if maybe he would know something to help ya.   ;)

Asmo

Bremmer

  • Guest
Re:cpp for a static target
« Reply #2 on: 27 May 2003, 10:02:09 »
Thanks Asmo.

I'll go and have a look for the commented config.cpp.

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:cpp for a static target
« Reply #3 on: 04 Jun 2003, 19:18:10 »
I found the original thread, where I also attached the first version.

check it out if its to any help (but the admins have prolly removed the attachments)  ::)