Custom animation when key pressed

Post » Sat May 28, 2011 7:08 pm

I am trying to make it so that when I press the V key whilst holding a custom weapon, it plays an animation.
The thing is my script doesn't work. Please help!

My script is:
scn PointyStickAnimBegin Gamemodeif (player.getequipped AESWeapPointyStick == 1) ;checks to see if player has weapon equipped        PrintToConsole "PS_Is_equipped"        if (OnKeyDown 47 == 1) ; if yes sees if he is pressing the V key            player.additem AESpointystickanimationtoken 1 ;adds the animation token            PrintToConsole "PSAT_Has_Been_Added"            player.pickidle ; picks an idle (hopefully the PS Animation)            PrintToConsole "Idle_picked"            player.removeitem AESpointystickanimationtoken 1 ;Removes the anim token        endifendifend


Thanks in advance,

Alex
User avatar
Kelly John
 
Posts: 3413
Joined: Tue Jun 13, 2006 6:40 am

Post » Sat May 28, 2011 3:57 pm

What kind of script is this? (quest, object, what object is it on)
Does PS_is_equipped print to the console when you have the weapon equipped?
Is the idle you're trying to play one that requires the weapon to already be out?
User avatar
Hannah Whitlock
 
Posts: 3485
Joined: Sat Oct 07, 2006 12:21 am

Post » Sat May 28, 2011 8:19 am

What kind of script is this? (quest, object, what object is it on)
Does PS_is_equipped print to the console when you have the weapon equipped?
Is the idle you're trying to play one that requires the weapon to already be out?


It is an object script on a custom weapon I have made.
I am using OBSE by the way.
PS_is_equipped does print to the console.
And I haven't worked out a way to check if its out so no.
User avatar
Madison Poo
 
Posts: 3414
Joined: Wed Oct 24, 2007 9:09 pm

Post » Sat May 28, 2011 4:32 pm

If its just the animation not playing then check the animation file, it may not have a proper animation name.

aka...if you open it up in nifskope the 'name' value for the .kf file should be SpecialIdle ... if its not then thats why its not playing.
User avatar
KiiSsez jdgaf Benzler
 
Posts: 3546
Joined: Fri Mar 16, 2007 7:10 am

Post » Sat May 28, 2011 7:15 pm

If its just the animation not playing then check the animation file, it may not have a proper animation name.

aka...if you open it up in nifskope the 'name' value for the .kf file should be SpecialIdle ... if its not then thats why its not playing.

I can't get to the computer right now but I think that might be it, I will look into it later

Thanks!
User avatar
Noraima Vega
 
Posts: 3467
Joined: Wed Jun 06, 2007 7:28 am

Post » Sat May 28, 2011 8:07 pm

player.additem AESpointystickanimationtoken 1

Should be:

if player.getitemcount AESpointystickanimationtoken == 0
player.additem AESpointystickanimationtoken 1
endif


player.pickidle ; picks an idle (hopefully the PS Animation)

should be:

player.pickidle 1


player.removeitem AESpointystickanimationtoken 1

If the Idle animation is conditions look for the token on the player you cannot remove it untill after the idle has started (maybe even ended).
User avatar
Jonathan Montero
 
Posts: 3487
Joined: Tue Aug 14, 2007 3:22 am

Post » Sat May 28, 2011 2:26 pm

player.additem AESpointystickanimationtoken 1

Should be:

if player.getitemcount AESpointystickanimationtoken == 0
player.additem AESpointystickanimationtoken 1
endif


player.pickidle ; picks an idle (hopefully the PS Animation)

should be:

player.pickidle 1


player.removeitem AESpointystickanimationtoken 1

If the Idle animation is conditions look for the token on the player you cannot remove it untill after the idle has started (maybe even ended).


So is there anything I can do about that?
User avatar
Rudy Paint fingers
 
Posts: 3416
Joined: Sun Nov 11, 2007 1:52 am

Post » Sat May 28, 2011 12:40 pm

You need to be more specific.

So is there anything I can do about that?

User avatar
ezra
 
Posts: 3510
Joined: Sun Aug 12, 2007 6:40 pm

Post » Sat May 28, 2011 11:50 am

You need to be more specific.

Oh it doesn't matter now because it works! thanks guys!
User avatar
RObert loVes MOmmy
 
Posts: 3432
Joined: Fri Dec 08, 2006 10:12 am


Return to IV - Oblivion