Jump to content

Papyrus Scripting (OnAnimationEvent)


ModdedMeghan

Recommended Posts

Before getting into this I just wanna say I'm still pretty new to scripting so if I'm missing something incredibly obvious don't get mad

Anyway

I've been working at this for longer than I care to admit and after searching through the forums and creation kit wiki I haven't gotten very far.

So, this is the script I'm working with:

 

Scriptname AnimationTestScript extends ObjectReference

event OnInIt()
registerForAnimationEvent(game.GetPlayer(), "attackStart")
endEvent

event OnAnimationEvent(ObjectReference akSource, string asEventName)
if (akSource == game.GetPlayer()) && (asEventName == "attackStart")
debug.MessageBox("Weapon Fired")
endIf
endEvent

 

 

It's basically just the second script on this page of the creation wiki but with a different animation.

So before I tried it in Fallout I tested it out in Skyrim and it worked fine.

But in Fallout nothing happens.

I thought maybe it was this animation so I tried a few different ones but none of them worked either.

 

At this point I'm guessing either Fallout has a different way of dealing with this or I made a mistake (or several) somewhere.

 

Also if you're wondering where I'm getting 'attackStart' from it can be found here in the GECK:

 

 

 

Replacing 'attackStart' with "1stPFireSingle' did nothing if you're wondering. :sad:

 

If anyone has any ideas I'd be very happy to hear them.

Thanks!

Link to comment
Share on other sites

In skyrim there is a massive amount of animation events that don't fire, chances are the same happens with fallout 4. I'd recommend setting up a testing script that registers for all animation events you see in f4 ck that are related to attacking and have them trace asEventName, then check the log to see which of them fire and see what you can do with that.

And place a notification on the oninit block to be sure it's running the script.

Edited by FrankFamily
Link to comment
Share on other sites

  • 2 weeks later...

In skyrim there is a massive amount of animation events that don't fire, chances are the same happens with fallout 4. I'd recommend setting up a testing script that registers for all animation events you see in f4 ck that are related to attacking and have them trace asEventName, then check the log to see which of them fire and see what you can do with that.

And place a notification on the oninit block to be sure it's running the script.

 

I did just that and after a lot of testing I got to work for automatic weapons...but only the minigun and not any other automatic weapons for some reason unknown to me.

At any rate it seems I'll have to find a different way to get this working and it will most likely invovle F4SE.

Thank you for the input!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...