Data Realms Fan Forums
http://45.55.195.193/

No damage from terrain collision.
http://45.55.195.193/viewtopic.php?f=73&t=15773
Page 1 of 2

Author:  CrazyMLC [ Thu Jul 09, 2009 4:21 am ]
Post subject:  No damage from terrain collision.

How would I go about doing that for a craft?

Author:  numgun [ Thu Jul 09, 2009 2:48 pm ]
Post subject:  Re: No damage from terrain collision.

ImpulseDamageThreshold = 900000000000000

Well, okay, that is usually ment to do the job, but for crafts it doesnt seem to work, I've reported that to Data so he should know about it. All I could say is make the craft's death occur only through gibbing and let Lua code do this to prevent collision damage and premature death:

self.Health = 100;

This keeps the health at 100 at all times.

Author:  MaximDude [ Thu Jul 09, 2009 3:13 pm ]
Post subject:  Re: No damage from terrain collision.

numgun wrote:
ImpulseDamageThreshold = 900000000000000

Well, okay, that is usually ment to do the job, but for crafts it doesnt seem to work, I've reported that to Data so he should know about it. All I could say is make the craft's death occur only through gibbing and let Lua code do this to prevent collision damage and premature death:

self.Health = 100;

This keeps the health at 100 at all times.


Wut?
It was originally MADE to work on crafts...
It works perfectly, unless you set an extremely high value that ♥♥♥♥ CC's brains out.

Don't go over 1 million on anything, and 250000~ should be enough for a 3 ton dropship hitting concrete at 100px/ms not to lose health.

Author:  CrazyMLC [ Thu Jul 09, 2009 9:43 pm ]
Post subject:  Re: No damage from terrain collision.

From 999999999999999999 to 250000 it is.
(I still want it to take damage from bullets, Numgun.)

edit: That Idea, or maybe that number, doesn't work.

Author:  mail2345 [ Thu Jul 09, 2009 9:44 pm ]
Post subject:  Re: No damage from terrain collision.

It won't take damage from kinetic weapons. Except for gibbing.

Author:  CrazyMLC [ Thu Jul 09, 2009 9:50 pm ]
Post subject:  Re: No damage from terrain collision.

I'm slamming this craft into the ground... on *cough*purpose*cough*.

Author:  MaximDude [ Thu Jul 09, 2009 10:25 pm ]
Post subject:  Re: No damage from terrain collision.

CrazyMLC wrote:
From 999999999999999999 to 250000 it is.
(I still want it to take damage from bullets, Numgun.)

edit: That Idea, or maybe that number, doesn't work.


I just tested it myself, and it really doesn't seem to work...
Low values do make a difference, but high ones don't... :???:

Guess you're out of luck.

Author:  CrazyMLC [ Thu Jul 09, 2009 10:52 pm ]
Post subject:  Re: No damage from terrain collision.

self.Health = 100 is is. -_-

But wait, is there a way to divide the damage you take?
Currently I have it with greater than 100 health, which makes some bugs, as you know.

Or maybe a way to divide the money you get from the craft returning.

Author:  MaximDude [ Thu Jul 09, 2009 11:05 pm ]
Post subject:  Re: No damage from terrain collision.

I dunno...

And try removing ImpulseDamageThreshold from the code and see how that works out.
Or try setting it to -1...

And you can just set the health to something higher then 100 with lua.

Author:  CrazyMLC [ Thu Jul 09, 2009 11:08 pm ]
Post subject:  Re: No damage from terrain collision.

Lol, I tested that earlier.
-1 means it takes damage from all the impulses.
All the time.

There is no escaping the infinitely dead craft! Bwuaha..ha...ha?

Author:  mail2345 [ Thu Jul 09, 2009 11:15 pm ]
Post subject:  Re: No damage from terrain collision.

Try this to divide the damage:
Code:
if self.Health ~= self.hptrack then
self.Health = (self.Health +( self.hptrack * (self.damdiv - 1) ))/self.damdiv
self.hptrack = self.Health
end

And in create:
Code:
self.hptrack = self.Health
self.damdiv = 2

Author:  CrazyMLC [ Fri Jul 10, 2009 12:01 am ]
Post subject:  Re: No damage from terrain collision.

Code:
function Create()
self.hptrack = self.Health
self.damdiv = 2
end

function Update()
if self.Health ~= self.hptrack then
self.Health = (self.Health +( self.hptrack * (self.damdiv - 1) ))/self.damdiv
self.hptrack = self.Health
end
end

Doesn't work.

Author:  mail2345 [ Fri Jul 10, 2009 12:20 am ]
Post subject:  Re: No damage from terrain collision.

Close, but missing an end statement.

Author:  CrazyMLC [ Fri Jul 10, 2009 12:42 am ]
Post subject:  Re: No damage from terrain collision.

Doesn't work.
Not at least for collision damage.

Author:  mail2345 [ Fri Jul 10, 2009 12:57 am ]
Post subject:  Re: No damage from terrain collision.

Wait, you forgot self inside the parentheses. Also, I just added in some code to fix up the rounding error CC has with health:
Code:
function Create(self)
self.hptrack = self.Health
self.damdiv = 2
end

function Update(self)
if self.Health ~= self.hptrack then
self.Health = math.ceil((self.Health +( self.hptrack * (self.damdiv - 1) ))/self.damdiv)
self.hptrack = self.Health
end
end

Page 1 of 2 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/