SeraphimKensai Posted December 14, 2018 Share Posted December 14, 2018 Hello once again folks, I'm working on a script that is attempting to change an actors' voice and was confused about how to go about doing it. I'm aware under CreationKit.com the Race Script controls many of the flags associated with various actors such as what voice they use, but those particular pages in the CK wiki don't have a lot of information (essentially the pages are pretty much blank), and I wasn't able to readily find much information elsewhere. So given all that does anyone have any knowledge how to change voice type in papyrus? As usual, thanks for any help you can provide. Link to comment Share on other sites More sharing options...
Evangela Posted December 14, 2018 Share Posted December 14, 2018 There is a GetVoiceType, but there is no SetVoiceType. Link to comment Share on other sites More sharing options...
SeraphimKensai Posted December 14, 2018 Author Share Posted December 14, 2018 Have you used SetDefaultVoiceType though? Link to comment Share on other sites More sharing options...
Evangela Posted December 14, 2018 Share Posted December 14, 2018 I checked the Race Script just now as I had forgotten that it had one for it. No, I've never used it. Link to comment Share on other sites More sharing options...
SeraphimKensai Posted December 14, 2018 Author Share Posted December 14, 2018 Ah. Well I guess after I get off work, I'm going to stumble around some more and try and figure out how to parse and compile it, as I haven't figured out all the parameters to get it to work. Link to comment Share on other sites More sharing options...
Evangela Posted December 14, 2018 Share Posted December 14, 2018 (edited) Maybe the syntax is as follows: VoiceType property myVoiceProperty auto ; if just changing it to a new voice right away.. akActor.GetRace().SetDefaultVoiceType(myVoiceProperty) ;double check if it\s changed debug.trace("Actor Voice Type: " +akActor.GetRace().GetDefaultVoiceType()) ; if comparing.. if akActor.GetRace().GetDefaultVoiceType != myVoiceProperty) akActor.GetRace().SetDefaultVoiceType(myVoiceProperty) endif' I'm thinking this was likely requested to be made available in the past, so there might be a mod that uses these. Edited December 14, 2018 by Rasikko Link to comment Share on other sites More sharing options...
SeraphimKensai Posted December 14, 2018 Author Share Posted December 14, 2018 Thanks I'll let you know if it works. This looks promising, as I am trying to change an actors'voice as part of a spell effect. I won't know for sure until I'll get home from work in about 4 hours or so, but I'll give it the old college try. Thanks for your insight regarding this issue. Link to comment Share on other sites More sharing options...
SeraphimKensai Posted December 14, 2018 Author Share Posted December 14, 2018 Alright, so I got home from work and got to work so to speak on this issue and I have good tidings: A couple things, Defining a Voicetype Property and attempting to use "akActor.GetRace().SetDefaultVoiceType(VoiceType)" only compiles if you run a 0/1 bool in front of the property parameter, so it needs to look like akActor.GetRace().SetDefaultVoiceType(0, VoiceType) *For Male Actors* or akActor.GetRace().SetDefaultVoiceType(1, VoiceType) *For Female Actors*. That will compile, the issue then however in testing is it doesn't seem to really do anything. This was some cause for alarm and I grabbed a stout from my fridge and sat back down. I switched it up and tried "akActor.GetActorBase().SetVoiceType(VoiceType), and it worked. Mind you this is for SKSE only, and will not work without SKSE. So if you look to this code snippet: If PlayerRef.GetActorBase().GetSex() == 0 akActor.GetActorBase().SetVoiceType(MaleVoice) EndIf If PlayerRef.GetActorBase().GetSex() == 1 akActor.GetActorBase().SetVoiceType(FemaleVoice) EndIf Assuming you define PlayerRef, MaleVoice, Female Voice and akActor for that matter, you can use the preceding to change the voice type of an actor by using its actorbase to whatever you want, mind you in my example I have a condition that gets the Player's gender, and then makes the akActor change their voice to the defined MaleVoice voicetype, or FemaleVoice depending on player gender. There isn't exactly the most documentation for the usage of SetVoiceType or SetDefaultVoiceType for that matter as they are both SKSE functions, but this hopefully helps people interested understand it a bit more. Link to comment Share on other sites More sharing options...
Evangela Posted December 15, 2018 Share Posted December 15, 2018 (edited) I didn't know there was a SetVoiceType..for the ActorBase Script. Honestly when I thought of voice types, I thought only about the ObjectReference Script and nothing else. Many SKSE functions are not documented though. It's one of those things where the ones have documentation if they were used and the person decided to fill in the info ha. Edited December 15, 2018 by Rasikko Link to comment Share on other sites More sharing options...
SeraphimKensai Posted December 15, 2018 Author Share Posted December 15, 2018 That's what I'm noticing about some of the SKSE functions. I'm still new to scripting for SKSE functions so I'm learning quite a bit, but there's a lot of them that appear to be able to add some useful functionality. Link to comment Share on other sites More sharing options...
Recommended Posts