antstubell Posted September 4, 2019 Share Posted September 4, 2019 This function looks fine to me and I get the 'Compile Succeeded' message. I also get -psc(11,7): type mismatch on parameter 1 (did you forget a cast?) It's a script within a quest which I 'kmyquest' on occasionally if that's any help. Scriptname My_QSTrandomCoinScript extends QuestGlobalVariable Property RndNum AutoSound Property MySND0 AutoFunction RandomNumber()Int iRand = Utility.RandomInt(0, 2)RndNum.SetValue(iRand as Int)If RndNum.GetValue() == 0MySND0.play(self)EndifEndFunction Link to comment Share on other sites More sharing options...
Evangela Posted September 4, 2019 Share Posted September 4, 2019 Looks like MySND0.play(self) needs casting. Link to comment Share on other sites More sharing options...
maxarturo Posted September 5, 2019 Share Posted September 5, 2019 (edited) As Rasikko said. MySND0.play(self)self = Where ? Should look something like this :Actor Property ActorREF auto MySND0.play(ActorREF) or MySND0.play(Game.GetPlayer())Or wherever you want the sound to play from. Edited September 5, 2019 by maxarturo Link to comment Share on other sites More sharing options...
antstubell Posted September 5, 2019 Author Share Posted September 5, 2019 Yep, stupid me. Didn't spot it. The 'compile succeeded' threw me.Thanks. Link to comment Share on other sites More sharing options...
maxarturo Posted September 5, 2019 Share Posted September 5, 2019 The " Self " is always targeting the Object - Actor the script is in ( living in ), " Self " can not be placed in scripts like Quest, here you need to specified the " Self " - " Target ". Link to comment Share on other sites More sharing options...
antstubell Posted September 6, 2019 Author Share Posted September 6, 2019 :thumbsup: Link to comment Share on other sites More sharing options...
Recommended Posts