View unanswered posts | View active topics It is currently Fri Dec 27, 2024 7:00 am



Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
 No damage from terrain collision. 
Author Message
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post No damage from terrain collision.
How would I go about doing that for a craft?


Thu Jul 09, 2009 4:21 am
Profile WWW

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post 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.


Thu Jul 09, 2009 2:48 pm
Profile
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post 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.


Thu Jul 09, 2009 3:13 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post 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.


Last edited by CrazyMLC on Thu Jul 09, 2009 9:49 pm, edited 1 time in total.



Thu Jul 09, 2009 9:43 pm
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: No damage from terrain collision.
It won't take damage from kinetic weapons. Except for gibbing.


Thu Jul 09, 2009 9:44 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: No damage from terrain collision.
I'm slamming this craft into the ground... on *cough*purpose*cough*.


Thu Jul 09, 2009 9:50 pm
Profile WWW
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post 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.


Thu Jul 09, 2009 10:25 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post 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.


Thu Jul 09, 2009 10:52 pm
Profile WWW
User avatar

Joined: Wed Nov 22, 2006 3:19 pm
Posts: 2073
Reply with quote
Post 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.


Thu Jul 09, 2009 11:05 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post 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?


Thu Jul 09, 2009 11:08 pm
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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


Thu Jul 09, 2009 11:15 pm
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post 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.


Last edited by CrazyMLC on Fri Jul 10, 2009 12:41 am, edited 1 time in total.



Fri Jul 10, 2009 12:01 am
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: No damage from terrain collision.
Close, but missing an end statement.


Fri Jul 10, 2009 12:20 am
Profile
User avatar

Joined: Fri Dec 22, 2006 4:20 am
Posts: 4772
Location: Good news everyone!
Reply with quote
Post Re: No damage from terrain collision.
Doesn't work.
Not at least for collision damage.


Fri Jul 10, 2009 12:42 am
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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


Fri Jul 10, 2009 12:57 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.040s | 14 Queries | GZIP : Off ]