OnAnimationEvent doesn't trigger even after successful Regis

Post » Mon Jun 18, 2012 4:37 pm

I have a function

function init()   assignSuccess = RegisterForAnimationEvent(aPlayer.GetReference(), "WeapEquip")   Debug.Notification("Done Ini!" + assignSuccess)endFunction

where 'assignSuccess' is a Bool, and the Debug print out 'TRUE' when I called that init() function

But when I attemp to catch that event I just registered, nothing happens

Event OnAnimationEvent(ObjectReference akSource, string asEventName)   Debug.Notification("Event received!")   if (akSource == aPlayer.GetReference()) && (asEventName == "WeapEquip")     Debug.Notification("Player draws Weapon")   endIfendEvent

The console 'DPU' didn't list this as a 'listening Event' either. I don't know if dpu supposes to do that or not.

Does any1 have any success with OnAnimationEvent yet?
:(
User avatar
Kate Murrell
 
Posts: 3537
Joined: Mon Oct 16, 2006 4:02 am

Post » Mon Jun 18, 2012 8:24 pm

   if (akSource == aPlayer.GetReference()) && (asEventName == "WeapEquip")

Shouldn't that be

   if (akSource == Player.GetReference()) && (asEventName == "WeapEquip")
User avatar
Robert Garcia
 
Posts: 3323
Joined: Thu Oct 11, 2007 5:26 pm

Post » Tue Jun 19, 2012 3:52 am

Generally, the correct way to get the player's reference is to use http://www.creationkit.com/GetPlayer_-_Game. If there's a http://www.creationkit.com/ReferenceAlias_Script called set up correctly, though, http://www.creationkit.com/GetReference_-_ReferenceAlias should work.

Perhaps try adding a debugging function just in the event - outside of your conditional statement? I see you have one of those already

Cipscis
User avatar
Steph
 
Posts: 3469
Joined: Sun Nov 19, 2006 7:44 am

Post » Mon Jun 18, 2012 3:00 pm

aPlayer is the ReferenceAlias, and all the Properties have been set.

Technically, the GetReference() works. I check the Papyrus log and the Alias aPlayer is 'binded' properly. It just the OnAnimationEvent didnot kick in :(
User avatar
Mr. Allen
 
Posts: 3327
Joined: Fri Oct 05, 2007 8:36 am

Post » Tue Jun 19, 2012 3:21 am

Oh! I misread "function init" as "event oninit". You need to use the http://www.creationkit.com/OnInit event instead of a custom function for that code. OnInit is a native event that is called by the game when the scripted object is set up, and whenever it is reset. Without something like that, your code will have no entry point.

At the moment, it doesn't get registered properly because your custom "init" function is never called.

Cipscis
User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Mon Jun 18, 2012 7:18 pm

Actually, I did call that init() function from that same quest's fragment script (at the startup stage)
I can see the line "Done ini! TRUE" being printed out correctly. 'assignSuccess' is the bool type btw
But the OnAnimationEvent just won't fire even after the successful Event Registration

function init()   assignSuccess = RegisterForAnimationEvent(aPlayer.GetReference(), "WeapEquip")   Debug.Notification("Done Ini!" + assignSuccess)endFunction
User avatar
Dragonz Dancer
 
Posts: 3441
Joined: Sat Jun 24, 2006 11:01 am

Post » Tue Jun 19, 2012 12:33 am

Clorf pointed out http://www.gamesas.com/topic/1348540-starting-a-script-that-always-runs-from-a-quest/page__view__findpost__p__20319867 that this seems to work correctly in "AltarofMolagBalScript".

Perhaps the problem is in the types of animation that are being looked for? Can anyone else get it working with "IdleChairSitting", which is what is used in that script?

Cipscis
User avatar
jeremey wisor
 
Posts: 3458
Joined: Mon Oct 22, 2007 5:30 pm

Post » Mon Jun 18, 2012 5:18 pm

I just tried and was able to get the event to trigger with "idleChairSitting". So the question becomes, what separates "IdleChairSitting" from "attackStart" or "weapEquip" and can whatever it is be changed?
User avatar
Suzie Dalziel
 
Posts: 3443
Joined: Thu Jun 15, 2006 8:19 pm

Post » Mon Jun 18, 2012 3:39 pm

Ok, finally, I have a great news, and a bad news (sort of :P)

Great news is that my Code works as above (:P), or the OnAnimationEvent works. I am able to 'catch' the registered animations and printout the debug nicely
The bad news is, well, we can't use them for just any animation under Idle Animations box :( (have to wait for skse to address this issue)

The OnAnimationEvent apparently suppose to register Quest's animation like ones player uses when transforming to werewolf, or chopping wood. Action based animation seems not to be registered.

Thanks everyone for your help :P If you found anything more useful, please update here :)
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Mon Jun 18, 2012 11:07 pm

I've only jumped in here at the end, so I wouldn't be the best person to do this, but if one of you would add what's been learned here to the wiki's documentation, I'd be grateful :)

Cipscis
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Tue Jun 19, 2012 3:45 am

Sure, np, the only thing is I dunno how to use the Wiki, so........ any help? :P
User avatar
Lindsay Dunn
 
Posts: 3247
Joined: Sun Sep 10, 2006 9:34 am

Post » Tue Jun 19, 2012 1:34 am

Thanks! First, go to http://www.creationkit.com/, and click on the "Log in / create account" link in the top right to create an account.

Once you've created an account and are logged in, navigate to the page you wish to edit and click on the "Edit" link at the top of the page.

This opens up the edit page. From here, you can make changes to the page's content. Once you've finished, write a brief summary in the "Summary" box and click "Save page" (you'll probably want to preview it before saving).

Then you'll need to fill in a reCAPTCHA, and once you've done that your changes will have been made to the page and logged in its history.

Cipscis

EDIT:

Take a look http://www.mediawiki.org/wiki/Help:Formatting for formatting help and http://www.mediawiki.org/wiki/Help:Links for help on inserting links.

Cipscis
User avatar
Ice Fire
 
Posts: 3394
Joined: Fri Nov 16, 2007 3:27 am

Post » Mon Jun 18, 2012 2:49 pm

As you may have gathered from my thread, I don't really know what I'm doing, so I'm probably not qualified to add anything to the wiki. I can, however, tell you that you probably just have to http://www.creationkit.com/index.php?title=Special:UserLogin&type=signup&returnto=OnAnimationEvent+-+Form and log in, and an edit button will most likely appear at the top of every article.
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Mon Jun 18, 2012 12:31 pm

Sure, Im off updating the wiki now. Might take awhile cuz I'm new, but I will try my best :)

@Clorf: So far, what Animation Events did you try, and works? Would you mind adding them here, so I can update the wiki as well :)
User avatar
Chica Cheve
 
Posts: 3411
Joined: Sun Aug 27, 2006 10:42 pm

Post » Mon Jun 18, 2012 4:50 pm

The wiki updated, under Note

http://www.creationkit.com/RegisterForAnimationEvent_-_Form#Notes
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm

Post » Mon Jun 18, 2012 5:58 pm

The only ones I tried were "attackPowerStartInPlace" and "attackStart" which didn't work, and "idleChairSitting", which did. Am I correct in reading your edit to the wiki page in that whether an animation will work is not related to any property of the animation itself, and is instead based on whether or not Bethesda used that specific animation in a quest?
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Mon Jun 18, 2012 4:02 pm

Yep, you read correct. Maybe I should rephrase the sentence :( There is nothing wrong with the properties of animation itself. Bethesda only registered few animation 'listeners' for the convenience of Quest designers
User avatar
Queen Bitch
 
Posts: 3312
Joined: Fri Dec 15, 2006 2:43 pm


Return to V - Skyrim