skinnytecboy Posted December 2, 2014 Share Posted December 2, 2014 Hi all, hope someone here can help, I've been banging my head against a wall over this.. I've tried by best, but my head is hurting. Is there a way to have a sound play from an NPC without sound markers or triggers? Quite literally, I need to make the sound come from the walking and talking NPC.. randomly and wherever in the world he happens to be. Let me clarify a little.. What I need is for my NPC to play music at the end of a piece of dialogue (he's basically a walking jukebox). I need the sound to come from him and to be triggered via dialogue options. Being me, I know there are simply ways without much scripting involved; using quest stages and scenes. But although this method works, it is not ideal because the music can be paused or interrupted. I know I can set scenes otherwise, but I believe a script that fires sound irrespective of combat or conversation would be better. Any help or suggestions here would be truly appreciated. Thanks in advance Link to comment Share on other sites More sharing options...
DDProductions83 Posted December 3, 2014 Share Posted December 3, 2014 YeslolGimmie a few Link to comment Share on other sites More sharing options...
DDProductions83 Posted December 3, 2014 Share Posted December 3, 2014 Or less http://www.creationkit.com/Play_-_Sound IE can do Soundproperty.play(akspeaker) At end of dialogue probably and it should continue to play until it is finished Link to comment Share on other sites More sharing options...
stormshallow Posted December 3, 2014 Share Posted December 3, 2014 I created a jukebox that plays sound and will not stop in my "TTOA: The Tombs of Anak" mod, if that type of file is what you are looking for, but it is not mobile. You might also try looking into one of the bard mods. Link to comment Share on other sites More sharing options...
ArronDominion Posted December 3, 2014 Share Posted December 3, 2014 To answer your original question of playing a sound WITHOUT sound markers or triggers, the answer is no. The Sound property requires a Sound marker to set as the Sound property. Thus as an example NPCTalk01SoundProperty must have a NPCTalk01Sound sound marker before you can use NPCTalk01SoundProperty.Play(akSpeaker). If you are running this in dialogue, what you could do is have your Quest script contain the function with the Sound property. Below is a fragment to explain what you need to add in the Quest script: Sound Property AJDSampleNPCSound01 Auto ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Inputs: Choice to tell the sound to play (allows for moddability), and NPC for the speaker ; ;This function is designed to play a sound from a NPC upon Function call ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function PlayNPCSound(Int Choice, Actor NPC) ;Choice logic ;1 = AJDSampleNPCSound01 if (Choice == 1) AJDSampleNPCSound01.Play(NPC) EndIf EndFunction In your Dialogue fragment block, you will want something like this: ;First sound (GetOwningQuest() as AJDSampleNPCQuestDialogueScript).PlayNPCSound(1, akSpeaker) Hope this helps you working around annoying DialogueFragment issues for the method you want to play the sound. Link to comment Share on other sites More sharing options...
skinnytecboy Posted December 3, 2014 Author Share Posted December 3, 2014 (edited) Thanks everyone for your responses. :blush: Mm, perhaps there's a workaround here.. well here's my crazy thought anyway..If sound markers are absolutely required to make play() function work, then I wonder if It's possible to attach a sound marker to an NPC?Or if there's a way to copy its properties on to an object that can be mobile and follow my npc using the placeatme method?As stated in my original question, I know that I can use the scene method or could perhaps create a spell with zero visible effect (gonna look into that one) .. but in the interests of continually pushing myself, I really want to get my head around the script method if I can.Scripts don't come naturally to me. P.s. This is all for this chap.. https://www.youtube.com/watch?v=f9eAuNT6_Js Edited December 3, 2014 by skinnytecboy Link to comment Share on other sites More sharing options...
DDProductions83 Posted December 3, 2014 Share Posted December 3, 2014 Well think of it this way, you NEED to create a sound marker no matter what, which means you need a sound descriptorStep by step Create the audio fileCreate a sound descriptor that points at the audio file in your data/sound folderCreate a sound marker that points at the Sound descriptor, we will name is 0_Mysound1Create a script on the dialogue option you wish to have start the audio file (This is easy just type "Utility.wait(0.1)" without the quotes into the script end or beginning and hit compile)Close the dialogue boxRe-open the dialogue box (This 'creates' the script or w/e just do it lol)Highlight the script on the right and hit the propertys tabAdd a property and for type pick SOUNDFor name pick whatever but for this example I will use "Sound1"Select sound one and hit the "Edit Value" box and select 0_mysound1, it will be conveniently at the topNow back out to the end papyrus fragmentAdd the line "Sound1.play(akspeaker)" , without the quotesHit compileTest Also if you havent watched my videos on scripting for dummies find them in youtube.com/ddproductions83 Also I have almost finished the 2 quest scripts for Doone in Discworld lol, will be sending them off for your edit at some point int he future :P Link to comment Share on other sites More sharing options...
skinnytecboy Posted December 3, 2014 Author Share Posted December 3, 2014 Thanks Darren. Just to confirm.. I have to still place a sound marker in the same cell right? P.s. Doon is ready and waiting. Also, will record the missus soon too. Link to comment Share on other sites More sharing options...
DDProductions83 Posted December 3, 2014 Share Posted December 3, 2014 no, no placing of the sound marker is needed, it will play that sound from him via script not the markers world locationIt just needs to exist in the sound descriptor and sound marker tabs in order to be called upon via the script and the game will basically turn the akspeaker IE the robot, into the sound marker for the duraton, for lack of a better way to explain it Link to comment Share on other sites More sharing options...
ArronDominion Posted December 3, 2014 Share Posted December 3, 2014 You do not need to place your SoundMarker in the cell. With the SoundMarker in the properties tab (although I have run into issues with the property not adding itself to the fragment, which is why I posted a Quest script method), it will automatically go to your speaking NPC when you call to play it from the speaking NPC. Link to comment Share on other sites More sharing options...
Recommended Posts