I'll explain it the easy way. You can do this via triggers or making an ability+behaviours+effects+etc.. but it's too complicated.
If you simply what the infested visuals when you spawn/create the barracks, then this is the easiest way.
2 options, duplicate default barracks or the infestable infested barracks. Seems logical to choose the later but we will dupe the first because it has more features such as construction animations, lift-off capability and creep encroachment.
1. Make a new map with Swarm or Liberty Campaign as the dependency
2. Duplicate the normal barracks and its actor (should also be barracks icon).
3. Go into the duplicated actor's events tab/array and on the bottom you'll see something like:
Behaviour.colony infestation.on
Create infestation barracks
..which basically means when the behaviour (debuff/buff) called "colony infestation" is placed on this actor, it'll call another actor called "infestation barracks"
4. Make a new event in that array/tab with
UnitBirth.YourNewBarracksActor
Create infestationBarracks
Don't confuse the actors InfestedBarracks and InfeststionBarracks; two completely different things. Anyway this will basically spawn the infestation visuals when the unit is created. You will be able to see the effect in the editor as well.
4. (optional) now lets do the bunker. Similar reasons to barracks, duplicate the regular bunker (and its actor) instead of the infested bunker so you have access to things like the shrike turret and bunker plating from the campaign. Go into its new actor and add another Event like:
UnitBirth.Bunker2
Create InfestationBunker
..And that's the bunker done now too. If you place one in the editor, it'll automagically create the infestation model inside of it.
One caveat is that when you liftoff a building, the infested visual still has the infested footprint under the structure but that's something for another tutorial...
0
I'll explain it the easy way. You can do this via triggers or making an ability+behaviours+effects+etc.. but it's too complicated.
If you simply what the infested visuals when you spawn/create the barracks, then this is the easiest way.
2 options, duplicate default barracks or the infestable infested barracks. Seems logical to choose the later but we will dupe the first because it has more features such as construction animations, lift-off capability and creep encroachment.
1. Make a new map with Swarm or Liberty Campaign as the dependency
2. Duplicate the normal barracks and its actor (should also be barracks icon).
3. Go into the duplicated actor's events tab/array and on the bottom you'll see something like:
Behaviour.colony infestation.on
Create infestation barracks
..which basically means when the behaviour (debuff/buff) called "colony infestation" is placed on this actor, it'll call another actor called "infestation barracks"
4. Make a new event in that array/tab with UnitBirth.YourNewBarracksActor Create infestationBarracks
Don't confuse the actors InfestedBarracks and InfeststionBarracks; two completely different things. Anyway this will basically spawn the infestation visuals when the unit is created. You will be able to see the effect in the editor as well.
4. (optional) now lets do the bunker. Similar reasons to barracks, duplicate the regular bunker (and its actor) instead of the infested bunker so you have access to things like the shrike turret and bunker plating from the campaign. Go into its new actor and add another Event like:
UnitBirth.Bunker2
Create InfestationBunker
..And that's the bunker done now too. If you place one in the editor, it'll automagically create the infestation model inside of it.
One caveat is that when you liftoff a building, the infested visual still has the infested footprint under the structure but that's something for another tutorial...