Home   Help Search Login Register  

Author Topic: East LaserDesignator  (Read 2575 times)

0 Members and 1 Guest are viewing this topic.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
East LaserDesignator
« on: 11 Jul 2006, 08:17:12 »
I created a Russian Aviation weapon pack including all Russian bombs, Air-to-surface missiles and A2A missiles.
But when test my KH29L Laser Homing missile and KAB500L LGB, i lack a laserdesignator. At first, I used "this addweapon "LaserDesignator"; this addMagazine "LaserDesignator"" to a east soldior. And the soldior designated the target. But the problem is the Laser dot isn't a red square on the radar so i can't lock with Tab key, I can only lock with mouse right click within visual range and it's too close to fire the LGB or KH29L missile.

So can anyone tell me how to make a Laser Designator for the east soldiors and make the laser dot a west object?
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: East LaserDesignator
« Reply #1 on: 11 Jul 2006, 13:13:47 »
If you unpack the main config in you will be able to examine the config for LaserTarget.



Code: [Select]
class LaserTarget:All
{
// Laser designator dot

reversed=0; // All vehicles are reversed -
        // except static
hasDriver=0;
icon="Unknown_object";
displayName="$STR_DN_LASER_TARGET";
nameSound="target";
accuracy=0.005;
model="laserTgt.p3d";
picture="ivojak";

/*
\patch 1.33 Date 11/29/2001 by Ondra
- Changed: Laser target priority increased.
*/

// Add weapons - make AI consider it "combat" enemy
// But not too dangerous, otherwise it will try to avoid it

weapons[]={"M16"};
magazines[]={"M16"};
type=1;

//threat[] VSoft, VArmor, VAir

threat[]={0.5,0.5,0.1};

maxSpeed=0; // Cannot move
simulation="laserTarget";
laserTarget=1;
irTarget=0;
destrType=destructno;
side=3;
cost=100000000; // Make AI attacking it with very
     // high priority
armor=500;     // Make AI selecting appropriate
     // (heavy) weapon
};


You could use that, susbtituting your own values in the appropriate places.

EDIT:  However, I see the side is marked as civilian.


Planck
« Last Edit: 11 Jul 2006, 13:16:39 by Planck »
I know a little about a lot, and a lot about a little.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: East LaserDesignator
« Reply #2 on: 11 Jul 2006, 14:00:28 »
That's just a base class for the targets, the real targets are defined in the config of Res\AddOns\LaserDesignator.pbo..
There are targets for all sides...

@Plane:
Have you tried so that you yourself lace the target and let the AI try to bomb it?
If that doesn't work then there's probably something wrong with your config...
« Last Edit: 11 Jul 2006, 14:02:08 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: East LaserDesignator
« Reply #3 on: 11 Jul 2006, 18:29:16 »
Quote
the real targets are defined in the config of Res\AddOns\LaserDesignator.pbo..


Strangely, I looked at that too, but in my haste discounted it........for shame.

Bad Planck :(


Planck
I know a little about a lot, and a lot about a little.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re: East LaserDesignator
« Reply #4 on: 12 Jul 2006, 09:27:36 »
AI won't attack the LaserTarget i designated, because it's a "Unknown" Object on radar.
Here are the LaserDesignator config:
Code: [Select]
class CfgAmmo
{
  class LaserDesignator:default
    {
    hit=500;
    indirectHit=150;
    indirectHitRange=2.5;
    minRange=50;
    minRangeProbab=0.3;
    midRange=150;
    midRangeProbab=0.95;
    maxRange=500;
    maxRangeProbab=0.1;
    model="LAW";
    simulation="laserDesignate";
    simulationStep=0.1;
    cost=5000;
    soundHit[]={"Explosions\explosion_at3",31.6227779,1};
    soundFly[]={"objects\noise",0.0001,4};
    maxSpeed=350;
    irLock=1;
    manualControl=1;
    maxControlRange=0;
    aiRateOfFire=0;
    aiRateOfFireDistance=500;
    initTime=0;
    maneuvrability=0;
    };
};

class CfgWeapons
  {
  class Default{};
  class LaserDesignatorBase:Default
    {
    ammo="LaserDesignator";
    displayName="$STR_DN_LASER_DESIGNATOR";
    displayNameMagazine="$STR_DN_LASER_DESIGNATOR";
    shortNameMagazine="$STR_DN_LASER_DESIGNATOR";
    count=1;
    magazineReloadTime=12;
    reloadTime=0.5;
    sound[]={"",0.01,1};
    reloadMagazineSound[]={"Weapons\at_load",0.0003162,1};
    initSpeed=30;
    canLock="LockCadet";
    aiRateOfFire=5.0;
    aiRateOfFireDistance=1000;
    optics=1;
    primary=0;
    opticsZoomMin=0.05;
    opticsZoomMax=0.25;
    distanceZoomMin=100;
    distanceZoomMax=100;
    };
  class LaserDesignator:LaserDesignatorBase
    {
    scopeWeapon=2;
    scopeMagazine=2;
    weaponType=16;
    magazineType="6 * 256";
    model="LLDR";
    modelOptics="optika_CarlGustav";
    picture="CarlGustavLauncher";
    };
};
I check these sections and found the LaserDesignator has nothing to do with the "LaserTargetWBase" or "LaserTargetEBase" in the cfgVehicles section.

Here's the config of my KH29L missile and Su25 aircraft:
Code: [Select]
class CfgAmmo
{
  class Default {};
  class AT3: Default{};
  class Hellfire: AT3{};
  class Maverick: Hellfire{};
  class KH29L: Maverick
  {
    hit=2000;indirectHit=1000;indirectHitRange=10;
    maneuvrability=20;
    thrust=500;
    thrusttime=12;
    initTime=0.1;
    maxspeed=850;
    irLock=false;
    laserLock=true;
    maxControlRange=10000;
    model="\bomb\KH29L.p3d";
    proxyShape="\bomb\KH29L.p3d";
  };
};
class CfgWeapons
{
  class Default {};
  class LAWLauncher: Default {};
  class CarlGustavLauncher : LAWLauncher {};
  class AT3Launcher: CarlGustavLauncher {};
  class HellfireLauncher: AT3Launcher {};
  class MaverickLauncher: HellfireLauncher {};
  class KH29Launcher: MaverickLauncher
  {
    displayname="KH-29 Kedge";
    displaynameMagazine="KH-29";
    shortNameMagazine="KH-29";
    reloadTime=0.5;
    initspeed=0;
    sound[]={"\bomb\sound\MissileLaunch.wav",1,1};
    magazines[]={KH29L,KH29T};
  };
  class KH29L: KH29Launcher
  {
    ammo=KH29L;
    displayname="KH-29L Kedge";
    displaynameMagazine="KH-29L";
    shortNameMagazine="KH-29L";
    count=6;
  };
  class KH29T: KH29Launcher
  {
    ammo=KH29T;
    displayname="KH-29T Kedge";
    displaynameMagazine="KH-29T";
    shortNameMagazine="KH-29T";
    count=6;
  };
};

class CfgVehicles
{
  class All {};
  class AllVehicles: All {};
  class Air: AllVehicles {};
  class Helicopter: Air {};
  class Plane: Air {};
  class Su25: Plane {};
  class Su25_KH29L: Su25
  {
    vehicleclass="Andy";
    armor=120;
    displayName="Su25 - KH-29L";
    magazines[]={KH29L, UB32x2, GSH30Cannon, R60Launcher};
    weapons[]={KH29Launcher, UB32Launcher, GSH30Cannon, R60Launcher};
    class eventhandlers
    {
      fired = "[_this Select 0, _this Select 1, _this Select 2, _this Select 3, _this Select 4] exec ""\Bomb\Fired.sqs""";
    };
  };
};

So can anyone find out the problem?
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: East LaserDesignator
« Reply #5 on: 12 Jul 2006, 10:22:46 »
Quote
I check these sections and found the LaserDesignator has nothing to do with the "LaserTargetWBase" or "LaserTargetEBase" in the cfgVehicles section.
Yes it does:
Code: [Select]
simulation="laserDesignate";
There are a lot of things that are hardcoded in the game engine, the values in the config.cpp are basicly only variables (very simply put..) the different simulations 'read', which is why for example missilelaunchers or cannons can't be used on an car class vehicle because simulation="car" is not coded to read them..
Ok, I'm no pro but that's how I have understood it.. :P

Majority of the laserdesignator functionality is hardcoded, and there is where all the targets and the designator itself play together..

And actually, there are also just classes that have hardcoded features in them, for example the engineers...
Only a unit inheriting from the class Miner (or whtever) is able to deactivate mines apparently..

So try this:
Code: [Select]
class CfgAmmo
{
  class Default {};
  class LaserGuidedBomb: Default {};

  class KH29L: LaserGuidedBomb
  {
    hit=2000;indirectHit=1000;indirectHitRange=10;
    maneuvrability=20;
    thrust=500;
    thrusttime=12;
    initTime=0.1;
    maxspeed=850;
    irLock=false;
    laserLock=true;
    maxControlRange=10000;
    model="\bomb\KH29L.p3d";
    proxyShape="\bomb\KH29L.p3d";
  };
};
class CfgWeapons
{
  class Default {};
  class LAWLauncher: Default {};
  class CarlGustavLauncher : LAWLauncher {};
  class AT3Launcher: CarlGustavLauncher {};
  class HellfireLauncher: AT3Launcher {};
  class LaserGuidedBombLauncher:HellfireLauncher {};

  class KH29Launcher: LaserGuidedBombLauncher
  {
    displayname="KH-29 Kedge";
    displaynameMagazine="KH-29";
    shortNameMagazine="KH-29";
    reloadTime=0.5;
    initspeed=0;
    sound[]={"\bomb\sound\MissileLaunch.wav",1,1};
    magazines[]={KH29L,KH29T};
  };
  class KH29L: KH29Launcher
  {
    ammo=KH29L;
    displayname="KH-29L Kedge";
    displaynameMagazine="KH-29L";
    shortNameMagazine="KH-29L";
    count=6;
  };
  class KH29T: KH29Launcher
  {
    ammo=KH29T;
    displayname="KH-29T Kedge";
    displaynameMagazine="KH-29T";
    shortNameMagazine="KH-29T";
    count=6;
  };
};
class CfgVehicles
{
  class All {};
  class AllVehicles: All {};
  class Air: AllVehicles {};
  class Helicopter: Air {};
  class Plane: Air {};
  class Su25: Plane {};
  class Su25_KH29L: Su25
  {
    vehicleclass="Andy";
    armor=120;
    displayName="Su25 - KH-29L";
    magazines[]={KH29L, UB32x2, GSH30Cannon, R60Launcher};
    weapons[]={KH29Launcher, UB32Launcher, GSH30Cannon, R60Launcher};
    class eventhandlers
    {
      fired = "[_this Select 0, _this Select 1, _this Select 2, _this Select 3, _this Select 4] exec ""\Bomb\Fired.sqs""";
    };
  };
};

I hope that helps..  :-\
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Plane

  • Members
  • *
  • You can call me my nickname "Plane"!
Re: East LaserDesignator
« Reply #6 on: 12 Jul 2006, 10:36:19 »
I've check the DSL_A10 addon's config, the trick is you need add the following into the cfgVehicles section:
Code: [Select]
laserScanner = 1;And I tested it, the laser dot became red on radar and it's lockable by using "Tab" key. ;)

The
Code: [Select]
simulation="laserDesignate"; has already hard coded the relation to "LaserTarget" into OFP Engine.
Thanks guys! :)
The propeller is just a big fan in front of the plane used to keep the pilot cool. When it stops, you can actually watch the pilot start sweating.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: East LaserDesignator
« Reply #7 on: 12 Jul 2006, 10:41:35 »
Quote
And I tested it, the laser dot became red on radar and it's lockable by using "Tab" key.
I thought it would be something as simple as that but I couldn't check it because apparently I don't have any planes with such munitions anywhere...
Didn't even find the BIS one... ???

EDIT:
Ah, but the A10 with LGBs is in the OFP\AddOns\LaserGuided.pbo, not in the Res\AddOns one... ::)
bah..
Not that it would have made any difference since it seems that value is already set in the dfault A10...
« Last Edit: 12 Jul 2006, 10:44:26 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Gnat

  • Addons Depot
  • Moderator
  • *****
  • I Bite!
    • Gnats
Re: East LaserDesignator
« Reply #8 on: 12 Jul 2006, 14:25:45 »
Code: [Select]
class LaserTarget: All
{
//-- laser designator dot
reversed=false; // all vehicles are reversed - except static

hasDriver=false;

icon="Unknown_object";

displayName = $STR_DN_LASER_TARGET;
nameSound="target";
accuracy=0.005;
model = "laserTgt.p3d";

picture="ivojak";
/*!
\patch 1.33 Date 11/29/2001 by Ondra
- Changed: Laser target priority increased.
*/
// add weapons - make AI consider it "combat" enemy
// but not too dangerous, otherwise it will try to avoid it
weapons[]={M16};
magazines[]={M16};

type=VArmor;
//threat[] VSoft, VArmor, VAir
threat[]={0.5, 0.5, 0.1};
maxSpeed=0; // cannot move

simulation="laserTarget";
laserTarget = true;
irTarget = false;

destrType=DestructNo;
side = TCivilian;

cost=100000000; // make AI attacking it with very high priority
armor=500; // make AI selecting appropriate (heavy) weapon

};

Side = Civilian !  :-\

Maybe try redefining your own west-sided version of above ..........

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: East LaserDesignator
« Reply #9 on: 12 Jul 2006, 14:38:51 »
Quote
Maybe try redefining your own west-sided version of above ..........
You sure you read the whole thread ;)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.