I see that the actor script has a way to force an actor to draw their weapon, but is there a way to make them lower it?
I see that the actor script has a way to force an actor to draw their weapon, but is there a way to make them lower it?
Use http://www.creationkit.com/DisablePlayerControls_-_Game to disable their combat controls (the 2nd flag) then when you want them to be able to fight again, http://www.creationkit.com/EnablePlayerControls_-_Game.
Thanks. If a do this--disable and then enable right away, will it lower their weapon even when enabled again?
The issue is that some idles flake out is you try to play them when the player has a weapon drawn.
Yes, disabling then instantly enabling will make them lower it. Just keep in mind there's nothing stopping them from then pulling their weapon/hands back out.
Okay, this was really helpful. I have one more question you might have insight into:
In order to get it to work, I had to use utility.wait(). If you try to play an idle on the line right after enableplayercontrols, it doesn't work. So here is my question: I had to use utility.wait(10.0) to get it to work, which seems like it should be a long time, but it was really only about 1 second. How much variation is there to how long this will be on various users' computers?
Uh, Utility.Wait()'s input is in seconds, so a value of 10.0 should make it wait 10 seconds, not 1. And the wait time should be almost identical on all computers. How much other stuff is going on and the computer's processing abilities will alter the time slightly, but it shouldn't ever be noticeable.
Are you sure you did 10.0? That should wait for 10 seconds, not 1.
Okay, it turns out that if you offload to a second script, you don't have to wait at all. I had been using a single test script, but if found that when I set up to interact with my main quest script, it worked really well.
1) tiny script added to magic effect:
If Game.GetPlayer().IsWeaponDrawn() == 1
Game.DisablePlayerControls()
Game.EnablePlayerControls()
EndIf
Int i = _LP_BardMenuPlayLute.Show()
If i == 0
_LP_BardQuest.Play(MUSBardLute01, 37, 3, 0)
etc, etc.
2) the main quest script, which calls the idle
No need to wait, and the idle now fires properly every time. Used to have lots of trouble if a player tried to fire it while they had their weapon drawn.
Thanks AV!