Jump to content

[LE] Conditions on grabActor effect


troopi

Recommended Posts

Hello Modders.
I have a bit of a conundrum.
I created a spell that allows grabbing actors, much like the vampiric one.
BUT- it's supposed to only work on dead actors.
I tried setting up conditions with the GetDead and the GetActorValue Health <=0
They don't work and block the spell completely because both subject and target revert aparently to the caster. It seems this happens because it's a magic effect with concentration+self.
On my custom script, to get the grabbed actor, I have to do this:

xTargetObj = Game.GetPlayerGrabbedRef()
xTarget=xTargetObj as Actor

The code works. But having it work on living actors is a game breaker. Even if I interrupt the spell, the grabbed actor is knocked down.
How can I solve this?
Is there any condition that points out to the "GetPlayerGrabbedRef"?

Thanks for any reply, mates.

Link to comment
Share on other sites

Already tried that. It doesn't work, because, on a concetration+self spell, both subject and target are the same- the caster.
To get the grabbed target I must use:
xTargetObj = Game.GetPlayerGrabbedRef()
xTarget=xTargetObj as Actor

Edited by troopi
Link to comment
Share on other sites

Solved it. Or better, "cheated it"? XD
I'll post here the links to the images and steps, so anyone under the same issues can walk forth.
https://www.nexusmods.com/skyrim/images/793964

https://www.nexusmods.com/skyrim/images/793965

https://www.nexusmods.com/skyrim/images/793966

https://www.nexusmods.com/skyrim/images/793968

https://www.nexusmods.com/skyrim/images/793969

These images from my profile have a register of all the steps.
But as a resume, I used the "variable05" on the player actor values to store the state of a target BEFORE the grab.
Since "concentration+self" magic cannot get a target, I made a second script magic to cast a "fireandforget+targetactor" in the player's aim, and check if that target is dead or alive. This check changes the "variable05", and the grab magic will only work IF that variable05 is 1 (which will only happen if the target is dead)

Link to comment
Share on other sites

Edit. Was thinking dead actor might need telekinesis grab object type instead but nvm it worked with GrabActor for me. Mine has no conditions on the spell, and GetDead() == 1 for the effect. No other conditions I was just testing if this worked at all on bodies

Link to comment
Share on other sites

  • Recently Browsing   0 members

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