Jump to content

Photo

Need help with script


  • Please log in to reply
3 replies to this topic

#1
xxxCYNICxxx

xxxCYNICxxx

    Newbie

  • Members
  • Pip
  • 10 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, 23 May 2020 - 01:42 AM.


#2
dylbill

dylbill

    Faithful poster

  • Supporter
  • PipPipPipPip
  • 1,314 posts

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


#3
xxxCYNICxxx

xxxCYNICxxx

    Newbie

  • Members
  • Pip
  • 10 posts

 

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. 



#4
xxxCYNICxxx

xxxCYNICxxx

    Newbie

  • Members
  • Pip
  • 10 posts

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:






Page loaded in: 0.959 seconds