OFPEC Forum

Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Raptorsaurus on 09 May 2005, 05:24:35

Title: timeToLive in config.cpp
Post by: Raptorsaurus on 09 May 2005, 05:24:35
I am trying to make a scud missile that has a longer timeTolive.  I tried to put timeToLive = 9999; in the config.cpp file, but it does not seem to have any effect.  After 2 minutes the scud explodes.  Is the max timeToLive for ammo classes 120?  Here is my config file.

Code: [Select]
#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

class CfgPatches
{
   class RPT_Scud
   {
      units[] = {};
      weapons[] = {"RPT_Scud" ; "RPT_Scud_Thrusting"};
      requiredVersion = 1.85;
   };
};
class CfgAmmo
{
   class Default {};
   class LaserGuidedBomb: Default {};
   class RPT_Scud: LaserGuidedBomb
   {
      hit = 10000;
      indirectHit = 5000;
      indirectHitRange = 15;
      timeToLive = 9999;
      model=\data3d\scud_strela_proxy;
      proxyShape=\data3d\scud_strela_proxy;
   };
   class RPT_Scud_Thrusting: RPT_Scud
   {
      model=\data3d\scud_strela_ohen;
      proxyShape=\data3d\scud_strela_ohen;
   };
};
Title: Re:timeToLive in config.cpp
Post by: oyman on 09 May 2005, 19:02:41
I think that only works for empty shells :-\
Title: Re:timeToLive in config.cpp
Post by: Raptorsaurus on 10 May 2005, 04:05:20
So timeToLive only applies to the shells ejected from a rifle or machine gun?  So how can I make ammo "exist" longer?  Is there any way, or maybe I just have to class it as a plane, the problem with that is then it will not respond properly to the setVelocity command.  The laserguided bomb ammo class pitches and yaws very nicely in the direction of its velocity, aircraft does not.
Title: Re:timeToLive in config.cpp
Post by: DBR_ONIX on 10 May 2005, 21:34:51
You could make a script that deletes the bullet in flight after x seconds, and makes a new one with same speed/velcoty
- Ben
Title: Re:timeToLive in config.cpp
Post by: Raptorsaurus on 10 May 2005, 23:07:52
Yes, that is what I am currently doing, I just thought I could simplifiy things by configuring it so I would not have to do the object swap thing.  Currently, 10 seconds before the missile reaches its life limit I create a temp missile 2000 m above the "real" one and set its velocity to the same as the actual missile (this makes the new missile tilt to the correct pitch). Then just before the real missile blows up (because is blows up at its life end), I deletvehicle it and put the temp missile in its place.  This all is working fine, but I was just hopeing to make things more simple.

I also thought of reclassing it as an plane, but then it will not properly pitch with velocity changes.  AI controlled Planes will never point straight up even with 100% vertical velocity (even if their p3d geometry is exactly the same as the missile). :-[
Title: Re:timeToLive in config.cpp
Post by: Jackal326 on 29 May 2005, 12:29:47
Can't you just give the SCUD missile more 'fuel' via the config.cpp?