Jump to content
KaidenSmith

Object player destruct detection

Recommended Posts

So I am trying to make a script or add an event handler that detects if you destroyed an object.

This is for an object repair script. So if you destroy the object yourself, you will not be able to repair it.

Share this post


Link to post
Share on other sites

@KaidenSmith,
This gets complicated fast. Post as much information as possible.
A killed EH would do it (can detect collision, too)-- but to be thorough I think may want more than one EH.

For example: say the object is a truck. What if the player empties a magazine into the wheels but doesn't completely destroy the vehicle? Can they repair that?

Besides that the usual: how is the object created? how many objects can there be? Stuff like that.

Have fun!

Share this post


Link to post
Share on other sites
10 hours ago, pierremgi said:

Destroyed objects are not repairable.

That's what I thought before I posted but I tested it quick and if you _obj setdamage 0; on a destroyed object it repairs-- kind of. I tested a bit more and the object model is repaired but remains unusable (and is still primed for a secondary explosion). So yeah,

Quote

Play with EH handleDamage .

It ultimately confirms my first suspicion about this idea-- the vehicle can never be destroyed.
@KaidenSmith
Besides using handleDamage to determine if player damaged the vehicle, you may want to set a threshold for "disabled" and set vehicle "allow damage" to false at the same threshold. This will make the vehicle unusable after a certain damage level is reached but not allow it to be completely destroyed.
Let's try to answer this instead,

Quote

So I am trying to make a script or add an event handler that detects if player damaged an object. At a certain damage threshold the object will become disabled until repaired. If the player damaged the vehicle they are unable to perform the repair option on that vehicle.

Have fun!

Share this post


Link to post
Share on other sites
4 hours ago, wogz187 said:

That's what I thought before I posted but I tested it quick and if you _obj setdamage 0; on a destroyed object it repairs-- kind of. I tested a bit more and the object model is repaired but remains unusable (and is still primed for a secondary explosion). So yeah,

It ultimately confirms my first suspicion about this idea-- the vehicle can never be destroyed.
@KaidenSmith
Besides using handleDamage to determine if player damaged the vehicle, you may want to set a threshold for "disabled" and set vehicle "allow damage" to false at the same threshold. This will make the vehicle unusable after a certain damage level is reached but not allow it to be completely destroyed.
Let's try to answer this instead,

Have fun!

I might have been a bit unclear, but it is not supposed to determine the damage done to vehicles.
It is supposed to determine who did the damage to the object. Objects such as walls.

Share this post


Link to post
Share on other sites

So, first of all, what is on your mind?

A wall can be a part of a house or an object by itself, like "Land_WallCity_01_8m_grey_F".

Some of them are simple objects (no damage taken, no destruction) ex:"Land_Canal_Wall_10m_F"

or very hard to destroy. ex: "Land_Mil_ConcreteWall_F"

or very progressive: damaged even by bullets to destroyed by collision or explosion. ex: "Land_WallCity_01_8m_grey_F"

Same for whole houses.

These objects can be edited (placed by you), or already on map. In this last case, disregard EH handleDamage on them. You need to track some changes in damage by scripts but that can be resource demanding.

 

So damages to objects are various, sometimes weird or even non-existent.

 

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×