Home   Help Search Login Register  

Author Topic: Undamaged to destroyed building transition?  (Read 651 times)

0 Members and 1 Guest are viewing this topic.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Undamaged to destroyed building transition?
« on: 21 May 2005, 03:25:06 »
I made a script that enables buildings on the map to be indestructable to any but a selected few bombs, and only if those bombs score a hit within a certain distance (Simulated hardened structures - good especially for the on map bunkers).

The problem is that if the building is destoyed by another means I have to put a delay before resetting the damage to 0.  If I do not put the delay the building continues the destroyed animation transition even though the damage has been reset to 0.  The result is that the building will look destoyed even though its damage level is 0.  It seems that once the damage animation sequence starts, it must be allowed to finish before it can be reversed!

I am thinking that there is some kind of animation involved in the transition from alive to dead, so maybe I can manipulate this using the animate and animationphase commands.  The only problem is I have no idea what is the name of the "destroyed transition" animation (if it is an animation of this type).  Does anyone know if and what the animation is that changes buildings from alive to dead?

I searched the forums and I searched the commented config.bin to try to find some clues, but to no avail.  Any suggestions/help is much appreciated.

Here is the script as it stands now.  It works, but it looks dumb when a building is destoyed then "pops" back to perfect after 1.5 seconds.  My goal is to set the damage instantly to 0 (or whatever it was prior to the last hit) then at the same time reverse the animation sequence so that it will not show the destroyed state (or show it for such a short time that it is less noticeable).  Once again, any help is appreciated.

#edited by bedges - introduced paragraphing to make it easier to read.
« Last Edit: 23 May 2005, 10:05:32 by bedges »

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Undamaged to destroyed building transition?
« Reply #1 on: 23 May 2005, 16:28:31 »

can you add a "hit" "or dammaged" eventhandler to the building, as this would be far less cpu intensive then your looping script

hit would be good, because you could then query the Shooter, return the vehicle etc

in addition, a fired eventhandler attached to the pilot of the aircraft could then be queried as to what munitions was used


i dunno if a hit eventhandler would work on a building, i have only ever used them on units
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Undamaged to destroyed building transition?
« Reply #2 on: 23 May 2005, 19:14:17 »
Quote
i dunno if a hit eventhandler would work on a building, i have only ever used them on units
Yes, it works...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Undamaged to destroyed building transition?
« Reply #3 on: 23 May 2005, 19:32:40 »
The hit event handler does not return the ammo, just the victim, the shooter and the scalar damage value.  Since ammo is destoyed when it hits, by the time the script is initiated by a hit event handler, it will be too late to determine the ammo type because it will be gone.  Thanks for the suggestion though.

What about the "destroyed animation"?  Any suggestion on that.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Undamaged to destroyed building transition?
« Reply #4 on: 23 May 2005, 19:48:40 »
I think you should read Terox's post again, he suggested you use the 'fired' EH to get the ammo.


Planck
I know a little about a lot, and a lot about a little.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Undamaged to destroyed building transition?
« Reply #5 on: 24 May 2005, 01:31:48 »
But that will not work for camcreated ammo.  It also will not work for "kamakazi" attacks.  The fired event handler would be fine for conventional attacks, but this script is meant to be more general than that.  For my application it must allow a vehicle class object to destoy the bunker (specifically a Tomahawk missile).  The Tomhawk is not an ammo type and it does not "fire" any weapon, rather it "kamakazies" the target.  There are other ways to make the script only start when it needs to, and end when it need not run.  At this point the script is a work in progress so I am not concerned yet with how I initiate it.  All the suggestions I am getting so far have nothing to do with my original post.  They are actaully off topic.  My original question was about the transition of the building model from healthy to dead and what animations squence, if any, is used for that transition.  Going into how I initiate the script deverges from my original question and topic.  I certainly appreciate the suggestions, but they do not answer my original question.  If someone has an answer to my orginal question and as an aside provides addtional information/suggestion, that is fine, but as it is I keep getting e-mails that someone as replied to my post, I get my hopes up that my question has been answered or that someone is pointing me in a direction that will help me find the answer, and instead it is other suggestions that really do not help me in this case.
« Last Edit: 24 May 2005, 01:35:44 by Raptorsaurus »

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Undamaged to destroyed building transition?
« Reply #6 on: 24 May 2005, 01:58:50 »
Ok Raptorsaurus, point taken.

As regards the destruction animation, my best guess is it is entirely handled by the game engine via the destrtype.

The destrType for the fortress for instance is "DestructBuilding"

There are many destrtypes, for instance DestructTree, which as you can probably tell from the name is the animation that a tree or similar object type goes through when it is destroyed.

All these are handled by the game engine AFAIK.

I hope this has been informative in some way, if not helpful, but it's the best I can come up with.


Planck
I know a little about a lot, and a lot about a little.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Undamaged to destroyed building transition?
« Reply #7 on: 24 May 2005, 02:40:56 »
So, in other words, I cannot use the animationphase command to monitor the phase of the animation, or the animate command to manipulate the animation phase. :-[

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Undamaged to destroyed building transition?
« Reply #8 on: 24 May 2005, 08:01:01 »
No, and even if it had an anim instead of destrType you still couldn't use animate or animationPhase on it since those are just for the O2 anims like opening door on a building or on a car, etc...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.