any way to play a sound inside a function?

Post » Wed Jun 20, 2012 10:00 am

So I finally figured out that my play sound command was fine, it will work in the script outside of the function as intended.
But when I try to put it inside the functions it will give an error saying that the HITFLESH variable is undefined.

Bottom line, is there no way to play a sound inside of a functions?

Function DamOrKill(Float Damage, Actor Target, Actor Attacker) globalif Damage >= 1Sound Property HitFlesh  Auto ; I have tired to define this var both here and outside the function.HitFlesh.play(target)endifendFunction


This also will not work if I define the HitFlesh variable at the top of the script (outside of the function).
User avatar
WTW
 
Posts: 3313
Joined: Wed May 30, 2007 7:48 pm

Post » Wed Jun 20, 2012 8:17 am

How are you calling the function?
And the Property should be outside the function.
User avatar
Hot
 
Posts: 3433
Joined: Sat Dec 01, 2007 6:22 pm

Post » Wed Jun 20, 2012 3:32 pm

@spooky, read over that http://www.gamesas.com/topic/1360171-playerref-gamegetplayer-or-do-it-in-properties/page__view__findpost__p__20519862yesterday about Global functions having to work solely from their parameters.
So if you want to use a sound, then create another parameter for it. (or lose the global flag)
User avatar
Glu Glu
 
Posts: 3352
Joined: Sun Apr 01, 2007 5:39 am


Return to V - Skyrim