Home   Help Search Login Register  

Author Topic: timeToLive in config.cpp  (Read 2063 times)

0 Members and 1 Guest are viewing this topic.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
timeToLive in config.cpp
« 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;
   };
};

Offline oyman

  • Members
  • *
  • king of pings
Re:timeToLive in config.cpp
« Reply #1 on: 09 May 2005, 19:02:41 »
I think that only works for empty shells :-\

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:timeToLive in config.cpp
« Reply #2 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.

DBR_ONIX

  • Guest
Re:timeToLive in config.cpp
« Reply #3 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

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:timeToLive in config.cpp
« Reply #4 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). :-[

Offline Jackal326

  • Former Staff
  • ****
  • SJB Addons
    • SJB Addons
Re:timeToLive in config.cpp
« Reply #5 on: 29 May 2005, 12:29:47 »
Can't you just give the SCUD missile more 'fuel' via the config.cpp?
"...if someone did that to me, I'd smash their head in, I'd stab them, shoot 'em and push 'em off a roof!" - Dutch Wagenbach