Jump to content

[LE] Need help with script


Recommended Posts

Hello. I have made custom spell to trigger paired animation (pa_Huga). So I wrote simple script which should trigger this animation when player cast spell on target. It seems like script is working as intented, but I have small issue I want to get rid off. After animation is played my character cannot use spells untill i reequip weapon\spell. I've checked wiki page and there is note that this is expected behaivour and should be fixed, but I am noob at scripting and can't wrap my head how to fix this.

So can someone explain to the noob what should I do in my script or in CK to fix my problem. Here is my script:

Scriptname _PairedHug extends ActiveMagicEffect  

Idle Property pa_HUGa Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
  akTarget.PlayIdleWithTarget(pa_HUGa, akCaster)
  Game.GetPlayer().DrawWeapon()

Endevent

Thanks in advance.

Edited by xxxCYNICxxx
Link to comment
Share on other sites

I would put a wait between the PlayIdleWithTarget and the DrawWeapon function. Make the wait however many seconds the Idle lasts.

 

Scriptname _PairedHug extends ActiveMagicEffect  

Idle Property pa_HUGa Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
  akTarget.PlayIdleWithTarget(pa_HUGa, akCaster)
  Utility.Wait(3)
  Game.GetPlayer().DrawWeapon()

Endevent
Link to comment
Share on other sites

 

I would put a wait between the PlayIdleWithTarget and the DrawWeapon function. Make the wait however many seconds the Idle lasts.

 

Scriptname _PairedHug extends ActiveMagicEffect  

Idle Property pa_HUGa Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
  akTarget.PlayIdleWithTarget(pa_HUGa, akCaster)
  Utility.Wait(3)
  Game.GetPlayer().DrawWeapon()

Endevent

 

Thank you very much for help. I will try it today.

Link to comment
Share on other sites

Guys i have one more question. What should I add to my script to make animation fire only when NPC is turned back to the player? I think it's something about "getangle" command. But how exactly should look this piece of code? Sorry for noobish questions. This is my very first script in papyrus. :mellow:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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