Jump to content

need help applying play sound to magic effect


3aq

Recommended Posts

for the longest time, I've been trying to use the play - sound script onto magic effect.

the goal is to play choice sfx on special weapons like dawnguard's rune hammer.

I used the below's link as reference with no success, so I am wonder if anyone would the proper way to getting this to work?

feedback is greatly appreciated =)

https://www.creationkit.com/index.php?title=Talk:Play_-_Sound

for the record, dawnguard's rune hammer when it casts rune does not emit sounds, the goal is to make the action of placing down rune play a sound, for testing purposes I used the MAGFirebolt03FireSD sound (sound descriptor).

script

Scriptname DLC1testPhilRuneHammerAbilitySCRIPT extends ActiveMagicEffect  

SPELL PROPERTY runeSpell AUTO
SOUND PROPERTY runeSFX AUTO ;altered

EVENT OnEffectStart(Actor target, Actor caster)	
	
	if(caster == game.getPlayer())
		if(RegisterForAnimationEvent(game.getPlayer(), "bashExit") == true)
; 			debug.trace("bashExit registered")
		endif
	
	endif

ENDEVENT

EVENT OnAnimationEvent(ObjectReference akSource, string asEventName)
  
  	if(asEventName == "bashExit")
;   		Debug.trace("the RUNE of me... get it?")

  		; //cast the rune and remove the stamina
		runeSFX.Play(game.GetPlayer()) ;altered
  		runeSpell.cast(game.getPlayer())
  		game.getPlayer().damageAv("stamina", 25)

	endIf

ENDEVENT

EVENT OnUnload()
	UnregisterForAnimationEvent(game.getPlayer(), "bashExit")
	
ENDEVENT

esp setup
unknown.png?width=969&height=585

Edited by 3aq
Link to comment
Share on other sites

I don't think you need the unload event. Animation events automatically unregistered for magic effects that end.

 

I don't know why the sound isn't playing, but I think the 6 calls to Game.GetPlayer is slowing your script down(in addition to the other functions), so maybe taking care of that will help some. You can assign GetPlayer to a local variable outside of the events and use that variable throughout, reducing the number of calls from 6 to 1. Secondly, is any of your debugs firing? Most importantly the one in your OnEffectStart event.

Edited by Rasikko
Link to comment
Share on other sites

unsure, the script I am using is the vanilla dawnguard runehammer script, the same exact one that's attached to this https://elderscrolls.fandom.com/wiki/Dawnguard_Rune_Hammer

the only lines I altered were the 2 lines with the ;altered in it.

 

as for debug firing, admittedly I am unsure how to do that (the furthest I do is debug notification at key points), but again, as the script is vanilla it should more or less be okay.

Edited by 3aq
Link to comment
Share on other sites

an update:

 

I figured what was wrong; I erroneously linked it to sound descriptor, what I ought to have done was instead hook it to a sound marker (that itself is linked to sound descriptor).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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