Page 1 of 1

Wrecks

Posted: Tue Mar 26, 2013 1:03 am
by Al Pal
Hello,

I want wrecks and bodies to stay on the field for longer than a few seconds. I have been searching all over this site for how to do this and I keep hitting the following problems.

When I open RFA files in the editor I can find only one single mention of the following code in Objects.rfa under "objects/Soldiers/Common/CommonSoldierData.inc"

ObjectTemplate.timeToLiveAfterDeath

Nowhere else in anything relating to soldiers or wrecks.

That's it...whenever I try to change anything in there it never does anything in the game. I have tried looking through almost every rfa file including the maps, looking for anything related to this but there is no mention of most the lines of code in any of the cons, including things like:

ObjectTemplate.Active USMarineSoldier
ObjectTemplate.timeToLiveAfterDeath

It's driving me a little insane. Surely "ObjectTemplate.timeToLiveAfterDeath" must exist with "10" after it as I see mentioned dozens of times when I search here, or my game wouldn't function I would think.

If anyone has a good explanation - or maybe I've completely missed the obvious please throw me some hints.

Re: Wrecks

Posted: Tue Mar 26, 2013 2:27 am
by freddy
Hi. It is a default value of 10 and it seems to be defined (hardcoded) in the .exe

It is easy to change tho, you can either do it in a map like the code you posted

Code: Select all

ObjectTemplate.Active Corsair
ObjectTemplate.timeToLiveAfterDeath 50
or you can change it once and for all in the objects.con in the objects files

example for what i use in Objects.con for the Corsair

Code: Select all

rem *** Corsair ***
ObjectTemplate.create PlayerControlObject Corsair
ObjectTemplate.setNetworkableInfo Corsair_body_info
ObjectTemplate.saveInSeparateFile 1
objectTemplate.cullRadiusScale 5
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.drag 0.0652
ObjectTemplate.mass 2500
rem ObjectTemplate.inertiaModifier 1.05/0.850/0.94
ObjectTemplate.inertiaModifier 0.92/0.74/0.82
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.hasResponsePhysics 1
ObjectTemplate.explosionRadius 8
ObjectTemplate.explosionDamage 5
ObjectTemplate.hasArmor 1
ObjectTemplate.angleMod 1
ObjectTemplate.speedMod 1
ObjectTemplate.hitpoints 100
ObjectTemplate.maxhitpoints 100
ObjectTemplate.material 60
ObjectTemplate.criticalDamage 20
ObjectTemplate.hpLostWhileCriticalDamage 1.5
ObjectTemplate.explosionForceMod 15
ObjectTemplate.hpLostWhileUpSideDown 10
ObjectTemplate.hpLostWhileDamageFromWater 10
ObjectTemplate.addArmorEffect 65 em_CorsairDamage 0/0.103/2.11
ObjectTemplate.addArmorEffect 65 em_PlaneDamage 0/0.103/2.61
ObjectTemplate.addArmorEffect 20 e_CorsairFire 0/1/3
ObjectTemplate.addArmorEffect 0 e_ExplGas 0/0/0
ObjectTemplate.addArmorEffect 0 e_ScrapMetal_Corsair 0/0/0
ObjectTemplate.addArmorEffect -1 WaterWaterExplosion 0/0/0
ObjectTemplate.damageFromWater 1
ObjectTemplate.timeToLiveAfterDeath 1      <----------------------------------
ObjectTemplate.aiTemplate Corsair
rem -------------------------------------
ObjectTemplate.addTemplate lodCorsair

Re: Wrecks

Posted: Tue Mar 26, 2013 2:41 am
by Swaffy
Have you tried adding the normal timeToLive line to the vehicle's wreck LOD object?

Or you can try:
ObjectTemplate.sinkInToLandAfterDeathSpeed 0.1 and just change the "0.1" to some other number.