How to make wrekage smoke disappear after wrekage destruction?

Discussion in 'Mod Discussions' started by Mirolog, September 27, 2015.

  1. Mirolog

    Mirolog Well-Known Member

    Messages:
    294
    Likes Received:
    405
    I can't figure out how it was made with titans.
    Where should I add smoke effects? And how to make it stop after wrekage is killed?
  2. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Looks like the animtrees trigger /pa/effects/titan_smoke_01.pfx, which lasts 10 seconds. I think permanent effects (like leftover fires from destroyed trees) are only an issue with looping effects.
  3. Mirolog

    Mirolog Well-Known Member

    Messages:
    294
    Likes Received:
    405
    Is there any info on animtree modding?

    EDIT:
    It looks like there isn't. Well ****, I need to think again.
    Last edited: September 27, 2015
  4. Mirolog

    Mirolog Well-Known Member

    Messages:
    294
    Likes Received:
    405
    Code:
    "dead": {
                           "type": "playback",                           
                           "events": [
                                    {
                                        "time": 3,
                                        "type": "effect",
                                        "parameters": {
                                            "bone": "bone_pivot02",
                                            "spec": "/pa/effects/specs/titan_smoke_01.pfx",
                                            "effect_scale": 1.2,
                                            "attached": true,
                                            "death_effect": true
                                        }
                                    },
                                    {
                                        "time": 3,
                                        "type": "effect",
                                        "parameters": {
                                            "bone": "bone_rightAmmo01",
                                            "spec": "/pa/effects/specs/titan_smoke_01.pfx",
                                            "effect_scale": 1.4,
                                            "attached": true,
                                            "death_effect": true
                                        }
                                    },
                                    {
                                        "time": 3,
                                        "type": "effect",
                                        "parameters": {
                                            "bone": "bone_leftWall",
                                            "spec": "/pa/effects/specs/titan_smoke_01.pfx",
                                            "effect_scale": 1.7,
                                            "attached": true,
                                            "death_effect": true
                                        }
                                    },
                                    {
                                        "time": 3,
                                        "type": "effect",
                                        "parameters": {
                                            "bone": "bone_buildSpray01",
                                            "spec": "/pa/effects/specs/titan_smoke_01.pfx",
                                            "effect_scale": 1,
                                            "attached": true,
                                            "death_effect": true
                                        }
                                    }                             
                                ]
                                                
                        },
    How many horrible mistakes I've made? Because this does not work.
  5. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    I've been fiddling with the animtree too and never got it working properly. Simply put. I got lazy and added the smoke wreckage effect to the default explosions with a small delay (or even none).

    I don't even think the smoke dissapears when a titan wreckage is gone?
  6. Mirolog

    Mirolog Well-Known Member

    Messages:
    294
    Likes Received:
    405
    It dissapears. And your "lazy" way of doing that is not suitable for some with long emmiter lifetime, because randomly smoking ground is not cool. And it seems that animtree is the only way of doing this.
  7. Alpha2546

    Alpha2546 Post Master General

    Messages:
    977
    Likes Received:
    1,561
    You're right with that it looks messy from time to time (+performance goes down the drain). However I also didn't like messing around with the animtree. Its a pretty integral part of pa + you need to edit a lot of animtrees to get the effect on each unit.

    I just had an idea and tested it. So basically the effect is hooked to a bone and if the bone dissapears then that means that the effect should dissapear too (You know with the killondeactivate function).

    So I altered the died event in the unit.json and linked it to the titans wreckage + attached that effect to the bone_root (every unit has a bone root). This is how it looks.

    This is how the original base_bot.json looks like

    Code:
        "events": {
            "build_complete": {
                "audio_cue": "/SE/Build_Complete/bot"
            },
            "fired": {
                "audio_cue": "/SE/Weapons/base/base_fire_laser",
                "effect_spec": "/pa/effects/specs/default_muzzle_flash.pfx socket_muzzle"
            },
            "died": {
                "audio_cue": "/SE/Death/Bot",
                "effect_spec": "/pa/effects/specs/default_explosion_bot.pfx",
                "effect_scale": 1.0
            }
        },
    Now I only wanted to change the dox explosion so I edited the assault_bot.json like this. basically i added the died event and linked the titan smoke wreckage effect + hooked it to the bone_root

    Code:
        "events": {
            "build_complete": {
                "audio_cue": "/SE/Build_Complete/bot"
            },
            "fired": {
                "audio_cue": "/SE/Weapons/bot/assault_fire",
                "effect_spec": "/pa/effects/specs/default_small_muzzle_flash.pfx socket_rightMuzzle /pa/effects/specs/default_small_muzzle_flash.pfx socket_leftMuzzle"
            },
            "died": {
                "audio_cue": "/SE/Death/Bot",
                "effect_spec": "/pa/effects/specs/titan_smoke_01.pfx bone_root",
                "effect_scale": 1.0
            }      
        },
    So basically this is what you want. Less work because you can edit the original explosion files and add the smoke wreckage to that .pfx file with a delay and you add the kill on deactivate function to these so that those effects disapear when the bone disapears.

    Another cool thing you could do is add multiple wreckage effects to a units bones. It would look something like this.

    Code:
            "died": {
                "audio_cue": "/SE/Death/Bot",
                "effect_spec": "/pa/effects/specs/titan_smoke_01.pfx bone_root /pa/effects/specs/titan_smoke_01.pfx bone_torso",
                "effect_scale": 1.0
            }      
        },
    You could also keep the original pfx file intact and just add another link to the wreckage effect. I haven't tested the last option but I'm pretty positive that it should work.

    Good luck! This should be the thing that you wanted. Btw don't use that last example I made up the bone_torso thingy
    cody8598 and Mirolog like this.

Share This Page