Stimpak Use Restriction

Post » Sun Dec 05, 2010 4:10 am

Hey guys, I'm stuck with this one. I've tried all sorts of stuff, but nothing seems to work.

I'm adding an animated stimpak injection to my Realism Tweaks' Med-Tec module and 90% of the time it works perfectly

The only problem is that my script disables the player controls while the animation is running (as a user key press will otherwise terminate the animation). And when the player's controls are disabled, any attacking enemies will immediately stop attacking until the player's controls are enabled again. My goal is to make the user vulnerable while using stimpaks, so this is not really working out.

I came up with two possible work-arounds, but have not been able to get either one to actually work.

A.) Prevent Stimpak use when player.isMoving (would allow me to use a brief disable/enable just to get the animation started) . . . which would only cause the enemy to stop attacking for the second or two that the player's controls are disabled (instead of for the entire 5 or 6 seconds that the animation/script runs). I can prevent the animation from running, if the player is moving, but the stimpak is still used.

B.) Prevent Stimpak use when an enemy is close (like within 3000 units). This would allow me to leave the player's controls disabled for the entire 5 or 6 seconds needed, without having nearby enemies cease their attacks (which really breaks combat immersion). I've tried using the walk-ref thing, but I cannot seem to get it to work at all (as I have no experience with walk-ref . . . so I don't really know what I'm doing).

Any help with this would be greatly appreciated! (I was up until 2am, trying to get this to work.)
User avatar
glot
 
Posts: 3297
Joined: Mon Jul 17, 2006 1:41 pm

Post » Sat Dec 04, 2010 9:18 pm

C.) Use NVSE to disable the player controls while the animation plays.
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm

Post » Sun Dec 05, 2010 3:03 am

Thanks sooo much b3w4r3!

I should have known that there was a solution C . . . which is MUCH easier to script than my two overly-complicated methods. :)
User avatar
Bloomer
 
Posts: 3435
Joined: Sun May 27, 2007 9:23 pm


Return to Fallout 3