Raider5 Posted December 26, 2017 Share Posted December 26, 2017 (edited) I am looking for the best way to have an NPC use an idle while music plays. Set up a quest, radio? and use a fragment script to fire the idle use a dialogue quest, with the music as a conversation topic, attached to a package as a condition or script? or just a script that fires packages and the music at different markers. what I am looking to do is have a street husker, that moves from place to place in westside, playing music. thanks for any help Edited December 26, 2017 by Raider5 Link to comment Share on other sites More sharing options...
Mktavish Posted December 26, 2017 Share Posted December 26, 2017 (edited) I don't know if this is the best way ... but seems the most straight forward way ... at least with my geck understanding. Would be to turn your music file into a sound object ... with matching run time as the animation. Then with your npc using a Patrol package , set to a few idle markers that play the idle animation.And would want to give them ownership of just this npc. So on the Patrol Data tab of of the idle marker refs. In the result script put "PlaySound3D MyMusicSound" I think that may work for ya ... but if there is a timing problem or other. Could put a script on the NPC . And turn your sound into one that constantly loops. So after setting your sound ... first drop in references of your sound object at the idle marker locations.Naming them ... Mymusic01Ref , Mymusic02Ref, Mymusic03Ref etc ... for example.Flag them Persistent Reference and Initially Disabled.Then name your idle marker refs with corresponding numbers. And in a script on the NPC ... make a script block like this ...(the distance is what ever works for the idle anim if they are moving side to side a little bit ... 100 is a little shorter than an npc height) ~~~~~~~~~~ Begin GameMode If GetCurrentAIProcedure == 46 && GetDistance MyIdleMarker01Ref < 100 MyMusic01Ref.Enableelse MyMusic01Ref.Disable endif If GetCurrentAIProcedure == 46 && GetDistance MyIdleMarker02Ref < 100 MyMusic02Ref.Enableelse MyMusic02Ref.Disable endif If GetCurrentAIProcedure == 46 && GetDistance MyIdleMarker03Ref < 100 MyMusic03Ref.Enableelse MyMusic03Ref.Disable endifEnd~~~~~~~~~~~~~~~~~~ However I would imagine you can attach sound files to idle animations themselves ... just don't know how myself , or if that would even be a good thing to do for a long running music audio file ? Edited December 26, 2017 by Mktavish Link to comment Share on other sites More sharing options...
Raider5 Posted December 27, 2017 Author Share Posted December 27, 2017 I don't know if this is the best way ... but seems the most straight forward way ... at least with my geck understanding. Would be to turn your music file into a sound object ... with matching run time as the animation. Then with your npc using a Patrol package , set to a few idle markers that play the idle animation.And would want to give them ownership of just this npc. So on the Patrol Data tab of of the idle marker refs. In the result script put "PlaySound3D MyMusicSound" I think that may work for ya ... but if there is a timing problem or other. Could put a script on the NPC . And turn your sound into one that constantly loops. So after setting your sound ... first drop in references of your sound object at the idle marker locations.Naming them ... Mymusic01Ref , Mymusic02Ref, Mymusic03Ref etc ... for example.Flag them Persistent Reference and Initially Disabled.Then name your idle marker refs with corresponding numbers. And in a script on the NPC ... make a script block like this ...(the distance is what ever works for the idle anim if they are moving side to side a little bit ... 100 is a little shorter than an npc height) ~~~~~~~~~~ Begin GameMode If GetCurrentAIProcedure == 46 && GetDistance MyIdleMarker01Ref < 100 MyMusic01Ref.Enableelse MyMusic01Ref.Disable endif If GetCurrentAIProcedure == 46 && GetDistance MyIdleMarker02Ref < 100 MyMusic02Ref.Enableelse MyMusic02Ref.Disable endif If GetCurrentAIProcedure == 46 && GetDistance MyIdleMarker03Ref < 100 MyMusic03Ref.Enableelse MyMusic03Ref.Disable endifEnd~~~~~~~~~~~~~~~~~~ However I would imagine you can attach sound files to idle animations themselves ... just don't know how myself , or if that would even be a good thing to do for a long running music audio file ?thank you for the idea, I will give it a try tomorrow night. just the other day was looking at some info on attaching sound files to .NIFS, I might give that a shot at some point just to see how it works out in game. Link to comment Share on other sites More sharing options...
Recommended Posts