How to stagger the player, like the NPCs get staggered?

Post » Wed Jun 20, 2012 11:05 pm

I could have sworn I read a papyrus command that let you do this, but I can't for the life of me remember it or find where I got it.

In any case, when a player gets staggered, they just get a screen shake. When an NPC gets staggered however, it is a full-body stagger and they actually recoil. I want that same effect to happen to the player.

Any ideas? I'm going to want to be able to call both types (i.e. a camera shake style, and a full body style) so hopefully there's nothing like a global variable I need to change to get this to work.
User avatar
Jose ordaz
 
Posts: 3552
Joined: Mon Aug 27, 2007 10:14 pm

Post » Thu Jun 21, 2012 12:41 am

yourRef.KnockAreaEffect(1, 1500)

That'll send out a shockwave that makes anything cringe. heheheh Check out the wiki for that command's specifics and how to tweak em.
User avatar
lauraa
 
Posts: 3362
Joined: Tue Aug 22, 2006 2:20 pm

Post » Thu Jun 21, 2012 12:16 pm

Well I'm looking to stagger just the player, and in the same way the NPC's get staggered (full body, not just a screen shake). Not do an AoE blast. Though thanks for that, it'll be useful later on for something I want to do.
User avatar
Sylvia Luciani
 
Posts: 3380
Joined: Sun Feb 11, 2007 2:31 am

Post » Thu Jun 21, 2012 5:11 am

Debug.SendAnimationEvent(Reference, "StaggerStart")
User avatar
James Wilson
 
Posts: 3457
Joined: Mon Nov 12, 2007 12:51 pm

Post » Thu Jun 21, 2012 1:38 am

Thank you! Is it possible to adjust the intensity of this, or can I only do that with the standard stagger spell (which only affects camera shake when applied to player)?
User avatar
Rhiannon Jones
 
Posts: 3423
Joined: Thu Sep 21, 2006 3:18 pm

Post » Wed Jun 20, 2012 10:07 pm

I.E. looking for a way to stop it so the stagger only plays for about 2 seconds or so, instead of the full 5-6 second one.
User avatar
Richard Dixon
 
Posts: 3461
Joined: Thu Jun 07, 2007 1:29 pm

Post » Thu Jun 21, 2012 7:15 am

I would do a BUNCH of testing once you get this to work. The wiki says that forcing idles with a sendAnimEvent could break an actor's data somehow. I use this command on mannequins, but doing it on Player seems like playing with fire. But to stop it, you'd probably have to call another sendAnimEvent for the defaultIdle or something like that... the question is will THAT pose get stuck.

That knockback command can be called on Player itself, and the radius limited to like 30 or just enough so only Player is affected; as well as the intensity lessened.
User avatar
AnDres MeZa
 
Posts: 3349
Joined: Thu Aug 16, 2007 1:39 pm

Post » Thu Jun 21, 2012 1:42 am

Can't you just make a spell with a stagger effect, target self, (effect archetype)

and then just do Staggerspell.Cast(Game.GetPlayer())

???
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Thu Jun 21, 2012 8:57 am

The problem with stagger spells is that for the player, they affect things differently (they only cause a screen shake, not an actual stagger).

The send animation event works fine, but there's no way to stop it (as far as I can tell) mid-antimation, so players have to experience the full 5-6 second stagger.

I guess an alternate idea I could do would be to just simulate a stagger by using a normal stagger effect, then somehow disabling player attacks (I'm pretty sure I can do this, seeing as they do it in vanilla skyrim).

There should be no odd issues, only certain animations are risky to use (i.e. ones that are out of place for an actor... like using bear animations on a human). Or antimations that have no endstate, such as loops or something. It's possible as a player to get out of those, they just have to requip things to "reset" their animation graph, at least in my experience. NPC's though, will just be forever confused form what I understand.

I'll experiment with the knockback though. Initial testing is somewhat buggy when used with the standard stagger effect in tandem. I.E. causing a screen shake stagger (the normal stagger), then a player action immediatly causing a full-body animated stagger. Both of these at the same time tended to reset the animation in progress for the player until it could complete... so scripting a screen-shake stagger to happen when the player swings, then having a full body stagger triggered at the same time, would cause the player to immediately follow up his weapon swings with another and a third one at random.
User avatar
Pat RiMsey
 
Posts: 3306
Joined: Fri Oct 19, 2007 1:22 am

Post » Thu Jun 21, 2012 1:56 am

If you first place the player in the vanilla faction named ''ForceFullBodyStagger'', any normal source of staggering will also work for the player just like it does for NPCs. You can make staggers shorter by doing the following:

player.Stagger()	 ;somehow staggering, don't care how :PUtility.Wait(0.5)	   ;this will make stagger last approximately 0.5 secondsDebug.SendAnimationEvent(player, "staggerStop")	 ;I'm not 100% sure on the name ''staggerStop'', but something like that is what you've gotta look for.
User avatar
Add Meeh
 
Posts: 3326
Joined: Sat Jan 06, 2007 8:09 am

Post » Thu Jun 21, 2012 7:16 am

Have you tried making your own custom stagger spell and just setting it to the level you want?

My custom spell works to stagger the player for real. That is how I stop the player from drawing his bow when they do not have enough stamina.


The problem with stagger spells is that for the player, they affect things differently (they only cause a screen shake, not an actual stagger).

The send animation event works fine, but there's no way to stop it (as far as I can tell) mid-antimation, so players have to experience the full 5-6 second stagger.

I guess an alternate idea I could do would be to just simulate a stagger by using a normal stagger effect, then somehow disabling player attacks (I'm pretty sure I can do this, seeing as they do it in vanilla skyrim).

There should be no odd issues, only certain animations are risky to use (i.e. ones that are out of place for an actor... like using bear animations on a human). Or antimations that have no endstate, such as loops or something. It's possible as a player to get out of those, they just have to requip things to "reset" their animation graph, at least in my experience. NPC's though, will just be forever confused form what I understand.

I'll experiment with the knockback though. Initial testing is somewhat buggy when used with the standard stagger effect in tandem. I.E. causing a screen shake stagger (the normal stagger), then a player action immediatly causing a full-body animated stagger. Both of these at the same time tended to reset the animation in progress for the player until it could complete... so scripting a screen-shake stagger to happen when the player swings, then having a full body stagger triggered at the same time, would cause the player to immediately follow up his weapon swings with another and a third one at random.
User avatar
Iain Lamb
 
Posts: 3453
Joined: Sat May 19, 2007 4:47 am

Post » Thu Jun 21, 2012 10:40 am

That's awesome you figured out there's a FACTION which does this (Borgut1337). I've known for a while that factions can be creatively used for such things, but it didn't occur to me when first reading this thread. If this does indeed work as stated... you could create a CUSTOM faction to do as you will; then script whatever actor to temporarily become a member of said faction. This is an interesting concept... I already have uses for this in my own mods, but testing has been precluded by my over-preoccupation of late with real-time sailing/flying (recently solved.. see the Gokstad mod).

The script-logistics of convincingly pulling it off would be secondary to getting it to actually work. Putting something in the onHit event for Player/NPCs may work (or a few other solutions), but I don't know enough about changing fundamental scripts without potentially damaging the game (eg:the actual Actor, ObjectReference, etc scripts). This isn't to say such potential damage goes without saying... quite the contrary, but if done incorrectly it COULD.
User avatar
Natalie Harvey
 
Posts: 3433
Joined: Fri Aug 18, 2006 12:15 pm

Post » Thu Jun 21, 2012 2:11 am

Yes!! The faction was what I was looking for. I KNEW it was something like that. Should be pretty easy to remove and add the player to that faction in scripts for when I want different style of effects to be used.

Going to have to test it to see if it works sometime later this week (when I'm not so busy :( )

@spooky

Yes, it's actually what I've been using this whole time. The problem is though by default the player staggers only via a screenshake instead of a full-body, so casting a stagger on the player will just shake his/her screen. Temporarily adding the player to the fullbody faction though should aleivate this ;)
User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Thu Jun 21, 2012 12:39 am

I.E. looking for a way to stop it so the stagger only plays for about 2 seconds or so, instead of the full 5-6 second one.

Debug.SendAnimationEvent(Reference, "StaggerStart")Utility.Wait(2.0) ;Your timeDebug.SendAnimationEvent(Reference, "StaggerStop")
User avatar
Add Me
 
Posts: 3486
Joined: Thu Jul 05, 2007 8:21 am

Post » Thu Jun 21, 2012 4:57 am

no, that is not right. I am getting a REAL stagger with my spell in my mod that stops the player from drawing the bow.

Or do you mean it will not push them back a few feet like in 3rd person?

Edit: ok I just tested this and it will not force you to take a step back in 1st nor in 3rd person. But the entire body DOES move (bend down and turn from one side to the other). But what ever, if you got something else that works for you then use it is what I always say...

But then I have a question, why put the player in and out of the full body stagger faction, why not just keep them in it all the time?

@spooky

Yes, it's actually what I've been using this whole time. The problem is though by default the player staggers only via a screenshake instead of a full-body, so casting a stagger on the player will just shake his/her screen. Temporarily adding the player to the fullbody faction though should aleivate this :wink:
User avatar
James Potter
 
Posts: 3418
Joined: Sat Jul 07, 2007 11:40 am

Post » Wed Jun 20, 2012 11:30 pm

Staggering for me, by default, doesn't actually interrupt player movement or attacks, it simply disorents the player and movement. I'm not sure why your stagger is causing different effects - wondering if you having been using full body faction the whole time?

And thats because I only want full body stagger for certain events, and the standard disorenting-stagger for other events. So being able to swtich between triggering a full body stagger (aka no player movment/attacks) and being able to trigger a standard stagger (where it just disorents your screen, but you still have full control over attacks and movement) is ideal.
User avatar
Red Sauce
 
Posts: 3431
Joined: Fri Aug 04, 2006 1:35 pm


Return to V - Skyrim