Jump to content

How to make a magic effect like paralyze, but target goes limp? (Maybe Script?)


WondraBox

Recommended Posts

I am trying to make a spell that when the target is hit by the spell, they fall over and go limp and stay on the ground, unable to move for a period of time (like they died but are actually still alive). I know that the paralyze feature works to stun a target, but the problem with paralyze is that the target freezes up in whatever position they were in when hit. This makes it look unnatural for what I am try to accomplish.

Way back in the day, when I was tinkering around with the creation kit for Oblivion, I was able to get this effect by making a custom spell in the Creation Kit that did an absurd amount of stamina damage (with duration). This made it so the target would have negative stamina and could not regenerate it. This would cause the target to go limp and fall to the ground (which is what i am trying to do in Skyrim SE). Unfortunately, that does not work with the Skyrim Creation Kit version.

I am thinking the only way that this can be done is with a script. Any help would greatly be appreciated!

Link to comment
Share on other sites

I am not sure that the push actor away method would work as I have used that in game when my character gets stuck in an animation. They get back up right after they are "pushed" over. However, the ragdoll function might work...

I am terribly sorry to ask but I am not a coder. I can do very very basic scripts through a lot of trial and error, but I dont know how to write this code. If its not to much trouble, and its a fairly simple code, could you please write it up for me so I can plug it into my mod and try it out?

Link to comment
Share on other sites

I did some digging, going off of the ragdoll idea and I found this:

https://www.reddit.com/r/skyrimmods/comments/355xyk/papyrus_script_make_character_permanently_stay_in/

PlayerRef.SetActorValue("Paralysis",1) to make character enter ragdoll state. Set to 0 to make character go back to normal.



Apparently: (paralyze in the papyrus script is ragdoll. the paralyze SPELL has an additional syntax called "paralyzefreeze" or something that makes the target go stiff)

apparently someone had a similar thing and solved it this way. The thing is, I dont really know how to set this up so that when the spell hits the target making them ragdoll and go limp, then once the spell effect has ended, removing the ragdoll effect. Like I said, I really dont know coding. I just need to put that information in to a working script. I may also need to disable the targets AI while the ragdoll effect is happening...

Link to comment
Share on other sites

So I did a quick test and akTarget.SetActorValue("Paralysis", 1) freezes the target, it doesn't ragdoll. So I did this in the script:

 

Scriptname TM_paralyzeLimpFXScript extends ActiveMagicEffect 

Event OnEffectStart(Actor akTarget, Actor akCaster) 
    akCaster.PushActorAway(akTarget, 1)
    Utility.Wait(0.5)
    akTarget.SetActorValue("Paralysis", 1)
Endevent 

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    akTarget.SetActorValue("Paralysis", 0)
    ;Debug.Notification("Effect End")
EndEvent 

The target will ragdoll, go limp then freeze. Name the script something unique to your mod and attach it to your spell's magic effect to see how it works.

Link to comment
Share on other sites

Ok, now i am trying to add to this a bit more. The idea is that it is a fire and forget aimed spell that knocks the target unconscious and allows you to pickpocket them while they are unconscious.

From what I have figured is that I need a line of code that allows the caster to open up the targets inventory while knocked out. The only way I could find out by doing this is by using the code

akTarget.OpenInventory(True)  

However, what that does is opens the target's inventory as if they where a follower... which is fine i guess, as I have not found another way to do this..... However, if I add that into the code given, it opens the targets inventory when the spell makes contact with them and I need it to be that you cannot "pickpocket" them caster actually goes to the target and "activates" them while they are unconscious on the ground.

Any ideas on how to do this?

Link to comment
Share on other sites

Okay, so if an actor is in combat with you, you can't active them. This is hard coded, but there is a way around this. You can make an invisible activator, and place it at the actor in the spell, and set the activator's name to that of the target. You can also set the activator's override text in the CK to Pickpocket or Mug or something else. So here's the modified script on the spell:

 

Scriptname TM_paralyzeLimpFXScript extends ActiveMagicEffect 

Activator Property TM_paralyzeActivator Auto
ObjectReference Property ActivatorRef Auto

Event OnEffectStart(Actor akTarget, Actor akCaster) 
    akCaster.PushActorAway(akTarget, 1)
    Utility.Wait(0.5)
    akTarget.SetActorValue("Paralysis", 1)
    Utility.Wait(0.5)
    ActivatorRef = akTarget.PlaceAtMe(TM_paralyzeActivator, 1, 0, 1)
    ActivatorRef.SetDisplayName(akTarget.GetDisplayName()) 
    ActivatorRef.Enable()
    (ActivatorRef as TM_paralyzeActivatorScript).ParalyzedActor = akTarget
Endevent 

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    akTarget.SetActorValue("Paralysis", 0)
    ActivatorRef.Disable()
    (ActivatorRef as TM_paralyzeActivatorScript).ParalyzedActor = None 
    ActivatorRef.Delete()
EndEvent 
Then put this script on your invisible activator:
Scriptname TM_paralyzeActivatorScript extends ObjectReference 

Actor Property ParalyzedActor Auto 

Event OnActivate(ObjectReference  akActionRef)
    If ParalyzedActor.GetActorValue("Paralysis") == 1 && (akActionRef as actor) == Game.GetPlayer()
        ParalyzedActor.OpenInventory(True)
    Else 
        ParalyzedActor = None 
        Self.Disable()
        Self.Delete()
    Endif
EndEvent

To make an invisible activator, you can duplicate a vanilla one, then edit the model, double click on all under 3d name and set the NullTextureSet for all of them. Note that this does require SKSE because of the GetDisplayName() and SetDisplayName() functions.

Link to comment
Share on other sites

Thank you so much for all of your help! I have been busy the last few days so I haven't been able to try these new scripts yet. Unfortunately I dont know when I will get around to it, hopefully after the holidays or even sooner.

None the less, thank you for all your help!!!!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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