Jump to content

Trouble implementing fnis aa (script)


Supertin

Recommended Posts

Hey,

 

I finally had some time to learn how to use papyrus over the course of last week.

And now I'm trying to get some basic implementation of FNISaa working.

 

I thought I did everything correctly, but it doesn't work ingame. Even though the scripts compile and everything, I must have gone wrong somewhere.

 

If someone here has a bit more papyrus/fnis aa knowledge than what little I have, I'd appreciate it, if someone could take a look at it >.<

 

 

 

Scriptname FTCombatInitialize extends Form
 
;Player presses a button
;If value for combat stance is 1 it switches to value 2, if it is 2 it switches to 3 etc
;value for combat stance checks which alternate animation set and transition animation to use next (aa not working)
;also check which weapon type is already equipped to check which alternate animation set (not yet)
;and transition animation will be used
;then remove old magic effect and apply new one with different buffs/debuffs (not yet)
 
FTCombatQuest Property ftcMod Auto
;FTCombat_PlayerAlias Property FTCPlayerAlias Auto
 
Actor property PlayerRef auto
 
 
Int property CombatStance auto
 
;Idle property StanceSwitchAnim1 auto
 
Idle property FTCAnim1 auto
 
Event OnInit() ;on game start
    RegisterForKey(37) ;(59-68 F1-F10) ;(37 - K)
    CombatStance = 1
endEvent
 
 
 
Event OnPlayerLoadGame()
    int current_crc = FNIS_aa.GetInstallationCRC()
    if ( current_crc == 0 )
        ; Installation Error: no AA generated by FNIS
    elseif ( current_crc != ftcMod.ftcModCRC )
        ftcMod.ftcModID = FNIS_aa.GetAAModID("ftc", "FTCombatTest",true) ;true:testonly
        ftcMod.ftc_mtidle_base=FNIS_aa.GetGroupBaseValue(ftcMod.ftcModID,FNIS_aa._mtidle(),"FTCombatTest", true)
       ftcMod.ftcModCRC = current_crc
    endif
endEvent
 
 
 
Event OnKeyUp(Int keyCode, float holdTime)
    PlayerRef = Game.getPlayer()
    if keyCode ==  37
 
        if CombatStance > 3
            CombatStance = 1
        endif
 
        if CombatStance == 3
            ;Play stance switching animation, example : Zornhau to Mordhau
            Debug.SendAnimationEvent(PlayerRef, "FTCAnim1")
            Debug.MessageBox("You pressed K and CombatStance is "+CombatStance+" ,dude.")
            ;Insert Fnis AA here?
            FNIS_aa.SetAnimGroup(Game.GetPlayer(), "_mtidle", ftcMod.ftc_mtidle_base, 0, "FTCombatTest", true)
            CombatStance = CombatStance + 1
        endif
 
        if CombatStance == 2
           ;Play stance switching animation
           ;Debug.SendAnimationEvent(PlayerRef, "FTCAnim1")
           Debug.MessageBox("You pressed K and CombatStance is "+CombatStance+" ,dude.")
           CombatStance = CombatStance + 1
        endif
 
        if CombatStance == 1
           ;Play stance switching animation
           ;Debug.SendAnimationEvent(PlayerRef, "FTCAnim1")
           Debug.MessageBox("You pressed K and CombatStance is "+CombatStance+" ,dude.")
          CombatStance = CombatStance + 1
        endif
 
    endif
endEvent

 

 

 

 

 

 

Scriptname FTCombatQuest extends Quest Conditional 
 
int Property ftcModID Auto
int Property ftc_mtidle_base Auto
int Property ftcModCRC Auto
 
Event OnInit()
 
    ftcModCRC = FNIS_aa.GetInstallationCRC()
    if ( ftcModCRC == 0 )
        ; Installation Error: no AA generated by FNIS
    else
    ftcModID = FNIS_aa.GetAAModID("ftc", "FTCombatTest", true) ; true during test only
    ftc_mtidle_base=FNIS_aa.GetGroupBaseValue(ftcModID, FNIS_aa._mtidle(),"FTCombatTest",true)
    endif
 
EndEvent

 

 

 

Fnis list is just set up like this for fnis aa:

FNIS_FTCombatTest_List.txt

 

AAprefix ftc
 
AAset _mtidle 1
 
 

Also do I have to connect the FTCombatQuest to a quest in CK?

 

 

Any help is very much appreciated :3

Link to comment

I attached FTCombatQuest to an empty quest that should start automatically when the game is started. Though im not 100% on, if I did that correctly.

 

FTCombatInitialize isn't attached to anything (yet?). I set it to extends Form, because that way the registerforkey worked. It also works to play animations with Debug.SendAnimationEvent.

What do you attach form scripts to? Or is there a better way to do it than form script?

 

Link to comment

I never made scripts that just extended form and wasn't attached to anything but if it works that way....

The problem I see with this is that you can't fill the properties you linked like "FTCombatQuest Property ftcMod Auto

why don't you put all the code in your quest script this should be much easier to manage.

 

The auto start of quests is bugged just google a bit there are some solutions to this.

Link to comment

I think I figured it out...

 

I connected the ftcMod in CK in QuestAliases where I added the script. I just had to fill in the value for it with the actual quest.

 

Honestly, I'm still not 100% clear what and why, but hey it seems to work >.<

 

 

EDIT: False alarm, still doesn't work, fuck -.-

EDIT2: While it still doesn't work and set up the fnis aa set I want, it seems to reset whatever idle is set in PCEA2 back to vanilla. So it's doing something? :/

Also about this

"The auto start of quests is bugged just google a bit there are some solutions to this."

The only thing I found was generating a .seq file for the quest to start correctly. Is this what you meant?

 

 

 

 

 

 

 

 

I also have another question, if someone is willing to help.

 

I'm playing an animation through:

Debug.SendAnimationEvent

 

It's an acyclic animation, so the character automatically returns to a normal state when the animation is over. But when the character has their weapon out before this event, it causes them to have to draw their weapon again after the animation finishes. This obviously looks stupid (character draws weapon from sheathe again, even though character is already holding weapon in their hands) and also obstructs combat after the animation for a couple seconds.

 

Is there a way to avoid this? A way to keep the combat state of the character properly, so the character doesn't have to redraw their weapon after the animation finishes?

 

 

 

 

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use