Function equivalent to IsAnimPlaying for special idles?

Post » Fri May 13, 2011 8:52 pm

I'm looking for a way to determine if an actor is playing a specific special idle or not, similar to http://geck.gamesas.com/index.php/IsAnimPlaying (used for AnimGroups). Incidentally, I also tried:

if Player.IsAnimPlaying SpecialIdle

...since "SpecialIdle" is listed as an http://geck.gamesas.com/index.php/AnimGroups, hoping this would at least allow me to know if the Player was playing any special idle, but that didn't seem to work either.

Anyone know if I might be doing something wrong, or if there's another method to accomplish this?
User avatar
JUDY FIGHTS
 
Posts: 3420
Joined: Fri Jun 23, 2006 4:25 am

Post » Fri May 13, 2011 9:16 am

I'm looking for a way to determine if an actor is playing a specific special idle or not, similar to http://geck.gamesas.com/index.php/IsAnimPlaying (used for AnimGroups). Incidentally, I also tried:

if Player.IsAnimPlaying SpecialIdle

...since "SpecialIdle" is listed as an http://geck.gamesas.com/index.php/AnimGroups, hoping this would at least allow me to know if the Player was playing any special idle, but that didn't seem to work either.

Anyone know if I might be doing something wrong, or if there's another method to accomplish this?


I just did this the other day with an NPC - using

if (npcRef.IsAnimPlaying SpecialIdle)

as a check for the code block to exit - so it does work, as long as the conditions in the idle manager are met, and the 'Animation Group Section' has 'Special Idle' in the window when you select your idle. I haven't tried it on the player.
User avatar
leigh stewart
 
Posts: 3415
Joined: Mon Oct 23, 2006 8:59 am

Post » Fri May 13, 2011 4:38 pm

Can I ask exactly what special idle the actor was playing at the time? In my current situation, I'm trying to do the check while the Player is playing a new custom special idle, and the Animation Group Section is set to "Special Idle". I suppose it could be either an issue with it being the Player, or that it's a new idle. I hadn't tested while using a standard vanilla idle though - I will try that and see what happens...

EDIT:
Ok, it all actually does work. The problem I had was that the special idle animation was not starting right away like I thought, so I was running the check before it had even begun. What I want is to do something as soon as the special idle ends, so if I set up some stages to first wait for the animation to start, and then wait for it to end, it should work like I want it to. We'll see what happens...

EDIT:
Beautiful! Now I don't have to rely on timers. Thanks RickerHK for making me double-check my assumptions B)
User avatar
yermom
 
Posts: 3323
Joined: Mon Oct 15, 2007 12:56 pm

Post » Fri May 13, 2011 4:58 am

Can I ask exactly what special idle the actor was playing at the time? In my current situation, I'm trying to do the check while the Player is playing a new custom special idle, and the Animation Group Section is set to "Special Idle". I suppose it could be either an issue with it being the Player, or that it's a new idle. I hadn't tested while using a standard vanilla idle though - I will try that and see what happens...

EDIT:
Ok, it all actually does work. The problem I had was that the special idle animation was not starting right away like I thought, so I was running the check before it had even begun. What I want is to do something as soon as the special idle ends, so if I set up some stages to first wait for the animation to start, and then wait for it to end, it should work like I want it to. We'll see what happens...

EDIT:
Beautiful! Now I don't have to rely on timers. Thanks RickerHK for making me double-check my assumptions B)


I forgot to mention that there was about four seconds delay in my script before I started checking ;)
User avatar
Emma-Jane Merrin
 
Posts: 3477
Joined: Fri Aug 08, 2008 1:52 am

Post » Fri May 13, 2011 11:13 am

Well here is the basic structure I set up, maybe you'd find it useful as well, since timers can't always be reliable:

	; some event that triggers a special idle has happened before now	if iAnimStage == 0		if Player.IsAnimPlaying SpecialIdle			set iAnimStage to 1		endif		Return	elseif iAnimStage == 1		if Player.IsAnimPlaying SpecialIdle			Return		else			set iAnimStage to 2		endif	endif		; animation is complete, do what you want now

The meanings of the iAnimStage values:
0 = Before animation has started
1 = Animation is playing
2 = After animation is complete
User avatar
Ann Church
 
Posts: 3450
Joined: Sat Jul 29, 2006 7:41 pm


Return to Fallout 3