Playing Destructible Animations In Fog

Status
Not open for further replies.
Level 8
Joined
Jul 8, 2013
Messages
249
I'm using destructibles that look like peasants and so forth to create lootable corpses. At map initialization I play all of their death animations and everything works fine except for one problem:

For some reason I can sometimes hear their death sounds as my units approach (long after map initialization).

How can I prevent that from happening?
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
I remember this bug mostly from tropical tower wars.In that map there was no fog(in middle area) but you still see the death animation of a gate when you look at it first time.
 
Level 8
Joined
Jul 8, 2013
Messages
249
Try giving the player vision over the whole map first, kill your destructibles, after .5 sec or so, remove the vision again. Since it's on map init, I don't think player will hear death sounds at that time. I don't know if that would work though.

No, this doesn't seem to work. And for that matter, the player definitely hears death sounds at map initialization. I have a solution to that particular issue though; what I need at this point is to make the death animations of destructibles actually play all at once instead of waiting for the player to look at them. Does anyone know how to do that?


Edit: Ok, with much testing I've come up with a kludgy solution. A trigger like this will play all the destructible animations but hide them (and their sounds):

  • Hide Animations
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ---------------------------- --------
      • -------- Setting the volume channel MUST come after turning on cinematic mode! --------
      • -------- ---------------------------- --------
      • Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.50 game-time seconds
      • Sound - Set Animation and Spell Sounds to 0.00%
      • -------- ---------------------------- --------
      • -------- The screen will be black, but with a visibility modifier on, the player is counted as "seeing" anything the camera looks at anyway. That's essential. --------
      • -------- ---------------------------- --------
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across (Playable map area)
      • Set MapRevealVisionModifier = (Last created visibility modifier)
      • -------- ---------------------------- --------
      • -------- A wait is essential to make turning off the volume take effect --------
      • -------- ---------------------------- --------
      • Wait 2.00 game-time seconds
      • -------- ---------------------------- --------
      • -------- Now animate the death of the destructibles --------
      • -------- ---------------------------- --------
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Egg Sack
            • Then - Actions
              • Animation - Play (Picked destructible)'s death animation
            • Else - Actions
      • -------- ---------------------------- --------
      • -------- Set the camera field of view up to about 5000 or so. That lets you cover more ground at once, very important to making this work. If you don't do this, many destructibles will only half die --------
      • -------- ---------------------------- --------
      • Camera - Apply Initial Cam <gen> for Player 1 (Red) over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Distance to target to 4000.00 over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Far Z to 6000.00 over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Angle of attack to 90.00 over 0.00 seconds
      • -------- ---------------------------- --------
      • -------- Now pan the camera over every part of the map with one of these destructibles (a back and forth pattern should work) --------
      • -------- ---------------------------- --------
      • Set TempPoint = (Center of Camera Pan Point 1 <gen>)
      • Camera - Pan camera for Player 1 (Red) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 game-time seconds
      • Set TempPoint = (Center of Camera Pan Point 2 <gen>)
      • Camera - Pan camera for Player 1 (Red) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 game-time seconds
      • Set TempPoint = (Center of Camera Pan Point 3 <gen>)
      • Camera - Pan camera for Player 1 (Red) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 game-time seconds
      • Set TempPoint = (Center of Camera Pan Point 4 <gen>)
      • Camera - Pan camera for Player 1 (Red) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 game-time seconds
      • Set TempPoint = (Center of Camera Pan Point 5 <gen>)
      • Camera - Pan camera for Player 1 (Red) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 game-time seconds
      • Set TempPoint = (Center of Camera Pan Point 6 <gen>)
      • Camera - Pan camera for Player 1 (Red) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 1.00 game-time seconds
      • Set TempPoint = (Center of Camera Pan Point 1 <gen>)
      • Camera - Pan camera for Player 1 (Red) to TempPoint over 0.10 seconds
      • Custom script: call RemoveLocation (udg_TempPoint)
      • -------- ---------------------------- --------
      • -------- Now wait long enough for sounds to stop, then undo all the camera changes, and let the map begin --------
      • -------- ---------------------------- --------
      • Wait 3.00 game-time seconds
      • Visibility - Disable MapRevealVisionModifier
      • Camera - Apply Initial Cam <gen> for Player 1 (Red) over 0.00 seconds
      • Sound - Set Animation and Spell Sounds to 100.00%
      • Wait 0.50 game-time seconds
      • Cinematic - Turn cinematic mode Off for (All players)
      • Cinematic - Fade in over 0.50 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency

I've attached a test map to demonstrate. Enable the first trigger and disable the second to see this solution in action. Disable the first and enable the second to see the default situation.


If someone else can come up with a better solution, I'd be interested to see it. Otherwise, I think this is useful enough for anyone trying to make a map involving cinematics or anyone who wants to use dead destructibles for decorative purposes that it might belong in a resource section or something.
 

Attachments

  • Test Destructible Death Animation in Fog.w3x
    39.8 KB · Views: 25
Last edited:
Status
Not open for further replies.
Top