Jump to content

Need help with a sound script.


Recommended Posts

Hi chaps, firstly, thanks so much for your help and wisdom with this. I really do appreciate it and I will of course credit all help provided.

 

Okay, so I've been doing a little testing with the above methods and also the scene method, and although they work (without sound marker in the cell) when the script or scene is called a 2nd time... I get CTD.

 

Just to expand a little more, my sound descriptor contains several sounds which I hoped would play randomly..

 

The problem with the script method is that I need to find a way of stopping any music already playing (sound descriptor) if the player opens up the same dialogue again that fires the script. Is there a way to do this?

 

I guess I could create lots of individual sound markers and disable them using aliases, but I'm planning upon having quite a fair amount of random music.

 

He is a walking jukebox after all.

Link to comment
Share on other sites

Actually you could have a cell with all the sound markers disabled, and upon asking him to play something a generic script fires to disable all markers except the one you wanted to play and instead move the new one to his location and onupdate 1 second move it to him, then unregister it for update with the generic script, the problem with that would be zoning to a new cell but realistically you could create a script to fix that.. it is just really beyond you atm if you had trouble with this one, not to sound bad about it lol, you could also just make them random idles in scenes

Use a scene to force a dialogue and he plays the music via the dialogue but then when you spoke to him it would turn it off

 

IDK if anyone has a easier idea on this one

Link to comment
Share on other sites

Sound.Play() has a return value of type Integer. This integer is the unique ID of the current playback, meaning you shouldn't require physical copies of the marker. Below is an example of how you could integrate this (with commented assumptions on quest structure, and one tiny potential bug concerning the global, which probably could be corrected by registering for a single update with the seconds of the current sounds you are playing calling an update event to reset the global, but I haven't tested it):

 

The Quest Script:

 

  Reveal hidden contents

 

 

The Dialogue Fragments:

 

  Reveal hidden contents

 

 

kmyQuest initialization:

 

  Reveal hidden contents

 

Edited by Arron Dominion
Link to comment
Share on other sites

As an update for the CTD issue if anyone is curious or runs into Sound Descriptor related CTD in the future, there is a limit on how big a sound file can be. Roughly 3 min 10 sec for the length. After talking to one of my programming friends, the thought is that this is most likely due to the console's memory limit, and the handling for sound on the console being carried over to the PC version.

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...