Hello again, i'm here asking for some help once more. I have this custom wrecked bunker unit, that you can repair and morph it into a bunker, that's all fine and dandy. I want to make the normal everyday bunker, morph into this custom unit upon death. I tried doing Event: Unit Death - Bunker
L Create (actor)Wrecked Bunker But when the bunker gets destroyed, it just creates the model of the wrecked bunker but no collision nor function. I reckon its because the unit is dead hence the newly created actor has no health so the new created actor doesn't work. I presume id have to make some mumbo jumbo shenanigans to pull of healing it or something but honestly cant wrap my head around it. Is there any way to do this? i'm sure i'm not the only one who had this idea.
I explicitly wrote some off-putting phrases to keep words talking about the same thing.
To achieve your goal, choose the approach between :
A) We could create 2 separate units to manage differently the bunker when it's alive and when it's dead.
B) We could also prevent the death to preserve the unit and make it behaves differently.
A) 2 units :
- The everyday Bunker Unit.
- The wrecked Bunker Unit. This one has the ability to morph to simulate the repairing.
When the building is destroyed, create the wrecked unit.
You need a Behavior activated on death (see Behavior Flags). It will executes a "Create Unit" Effect.
Make the unit to disappear on death (via actor events) and play the death animation on the wrecked unit (via actor events).
You need a "Morph" Ability. Easy task, I skip details.
B) Prevent death :
When the bunker reaches 1 HP, it disables all abilities except the repair ability (can be initially hidden).
When the building reaches 1 HP, play the death animation and swap the model to the wrecked model.
You need a Behavior (Beh1) with a "Damage Response" which cancels any damage. Look for the field and change :
- Chance : 0 to 1 to make it happen on any damage.
- Fatal : Check the box to include damage that should kill the unit.
- Modify Fraction : Set to 0 to multiply the damage amount by this value. Math : Any number multiplies 0 equals 0.
- Handled : Execute an Effect. Set an "Apply Behavior" to apply Beh2.
Inconvenient : If the unit has a life regeneration, it will regenerate as expected.
You need another Behavior (Beh2) with modifications :
- Set regeneration fraction to -1 (= -100%) (Alternative : See side note).
- Disable abilities with Beh2.
- Enable ability you created to repair the bunker with Beh2 (Alternative : See bonus note).
Important note : The ability to repair the bunker must set the life and remove the behavior "Beh2".
Side note :
If you want to repair on time, you can set a high value for the regeneration with another behavior (Beh3) applied with the ability to repair the bunker.
Bonus note - Prerequisite :
Use the field "Use+" to lock/unlock or "Show+" to show/hide a restricted button of an ability. As follow :
> Greater Than
>> Count stacks of a behavior (Beh2)
>> Constant 0
I tried to detail the most things for both routes.
Do your choice, I think you can learn some from both.
Have a nice day !
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hello again, i'm here asking for some help once more.
I have this custom wrecked bunker unit, that you can repair and morph it into a bunker, that's all fine and dandy.
I want to make the normal everyday bunker, morph into this custom unit upon death. I tried doing
Event: Unit Death - Bunker
L Create (actor)Wrecked Bunker
But when the bunker gets destroyed, it just creates the model of the wrecked bunker but no collision nor function.
I reckon its because the unit is dead hence the newly created actor has no health so the new created actor doesn't work.
I presume id have to make some mumbo jumbo shenanigans to pull of healing it or something but honestly cant wrap my head around it.
Is there any way to do this? i'm sure i'm not the only one who had this idea.
I'd appreciate an answer. Thanks!
Hello,
Yeah, sorry, it's more complicated than that.
I explicitly wrote some off-putting phrases to keep words talking about the same thing.
To achieve your goal, choose the approach between :
A) We could create 2 separate units to manage differently the bunker when it's alive and when it's dead.
B) We could also prevent the death to preserve the unit and make it behaves differently.
A) 2 units :
- The everyday Bunker Unit.
- The wrecked Bunker Unit. This one has the ability to morph to simulate the repairing.
When the building is destroyed, create the wrecked unit.
You need a Behavior activated on death (see Behavior Flags). It will executes a "Create Unit" Effect.
Make the unit to disappear on death (via actor events) and play the death animation on the wrecked unit (via actor events).
You need a "Morph" Ability. Easy task, I skip details.
B) Prevent death :
When the bunker reaches 1 HP, it disables all abilities except the repair ability (can be initially hidden).
When the building reaches 1 HP, play the death animation and swap the model to the wrecked model.
You need a Behavior (Beh1) with a "Damage Response" which cancels any damage. Look for the field and change :
- Chance : 0 to 1 to make it happen on any damage.
- Fatal : Check the box to include damage that should kill the unit.
- Modify Fraction : Set to 0 to multiply the damage amount by this value. Math : Any number multiplies 0 equals 0.
- Handled : Execute an Effect. Set an "Apply Behavior" to apply Beh2.
Inconvenient : If the unit has a life regeneration, it will regenerate as expected.
You need another Behavior (Beh2) with modifications :
- Set regeneration fraction to -1 (= -100%) (Alternative : See side note).
- Disable abilities with Beh2.
- Enable ability you created to repair the bunker with Beh2 (Alternative : See bonus note).
Important note : The ability to repair the bunker must set the life and remove the behavior "Beh2".
Side note :
If you want to repair on time, you can set a high value for the regeneration with another behavior (Beh3) applied with the ability to repair the bunker.
Bonus note - Prerequisite :
Use the field "Use+" to lock/unlock or "Show+" to show/hide a restricted button of an ability. As follow :
> Greater Than
>> Count stacks of a behavior (Beh2)
>> Constant 0
I tried to detail the most things for both routes.
Do your choice, I think you can learn some from both.
Have a nice day !