Jump to content

[LE] AttachAshPile


Elias555

Recommended Posts

Trying to make a spell that causes the dead actor to explode. I need to get rid of the actor and replace it with an ashpile. Here's the script:

Scriptname AcePlaceExplosionDeadActorScript extends activemagiceffect  

Explosion Property MyExplosion Auto
Float Property TimeDelay Auto
Activator Property AshPileObject1 Auto
EffectShader Property AshPileObject Auto


Event OnEffectStart(Actor akTarget, Actor akCaster)
    
    If AkTarget.IsDead() == 1

        akTarget.PlaceAtMe(MyExplosion)
        AshPileObject.Play(akTarget);this makes it invisible
        AkTarget.AttachAshPile(AshPileObject1)    
        ;Utility.Wait(TimeDelay)
        ;akTarget.Disable()
        ;akTarget.Delete()

    EndIf
    
EndEvent

The problem is the ashpiles only work as containers when the actor isn't disabled or deleted. Anyone know how to do it properly/a work around?

 

Also, to clean up the ash pile can I use OnCellDetach() or is there a cleaner/scriptless method?

 

Edit:Updated script. Looks like it works like this but the dead body is still there, just invisible and activatable.

Edited by Elias555
Link to comment
Share on other sites

Bethesda uses

victim.SetAlpha (0.0,True)

To hide the body. Take a look at magicAttachAshPileOnDeath.psc

 

As for removing the ash piles you'd probabaly want to do something like the dead body cleanup script they use for unique actors. The ash piles are designed to be persistent and not get cleaned up normally.

Edited by BigAndFlabby
Link to comment
Share on other sites

Bethesda uses

victim.SetAlpha (0.0,True)

To hide the body. Take a look at magicAttachAshPileOnDeath.psc

 

As for removing the ash piles you'd probabaly want to do something like the dead body cleanup script they use for unique actors. The ash piles are designed to be persistent and not get cleaned up normally.

I found that AshPileObject.Play(akTarget) makes the SetAlpha redundant. I did use it at first but when I removed it was still the same. Either way, when I do that I can still hover over the invisible actor and open their inventory. I need to block the inventory being openable if I want to go down that route. The body will still show up under detect dead so it's not an ideal solution but I'll go with it if I have to.

 

Edit: Can't believe I missed this. When reading the code I thought it was some variable for something else.

https://www.creationkit.com/index.php?title=SetCriticalStage_-_Actor

Edited by Elias555
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...