ID:2026071
 
I've got two issues I've been trying to figure out involving two different libraries and I'm not sure how to see them.

First Problem
So, I've been hoping to use ShadowDrake's sd_Alert library to avoid using the ugly looking built in one and because his comes with a lot more functionality. Problem is however, any time I actually try to use it, the alert itself seems to crash - even in just simple tests. The library itself works completely fine in its demo and even works if I uninclude my own interface file, but otherwise it just appears as a window with a blank white screen where the text and options should be. I'm not exactly sure why it's doing this and not playing with my interface file, so any insight into that or workarounds would be helpful.

Second Problem
I'm using Foomer's Sound System library for the sake of both sound effects and background music in the game. The sound effects work fine, however the I can't get the background music to play no matter what. I've tried taking out the interface as well with this, in hopes I would be able to see if its a common issue but no luck. I've placed my sound files into the library and made some code in his "example" file to play the music precisely as I'm trying to in my game, and it works fine. In my project however, it still fails to work and this has left me at a complete lost.

Code:
mob/proc/BGMusic(var/Location)
var/Sound
switch(Location)
if("Wanton")
Sound = 'Forest Background Music.ogg'
else
Sound = 'City Background Music.ogg'
src.client.sound_system.AlterMusic(Sound)


As of when I initially posted this, I did so via my phone as my internet is currently having issues and I had to resort to using my phone's data to do this so I can hopefully resolve these issues (this was a last resort if I couldn't get it done on my own). So I apologize if something wasn't correctly explained or for typos (autocorrect) in advance.
It's been a few days and I've yet to get any responses so this is just a bump.
Do you get any runtime/ debug errors when you try to run is also I think you indention might be wrong, also this is my basic sound code.
    Toggle_Music()
set hidden = 1
src << sound(null)
if(Sound)
if("Wanton")
Sound = 'Forest Background Music.ogg'
else
Sound = 'City Background Music.ogg'
src << S
src.client.sound_system.AlterMusic(Sound)

hopefully the music is toggle-able I hate untoggle-able music :)
I don't properly understand your code as its using "if(Sound)" as if it's a switch-statement or something. Also, you've got some variables there (Sound and S) that I'm not sure where there are from.

As for my indentation, that's probably because I used my phone to do that initial post (and still am doing so for this reply as well), but if that was the problem, I'd have gotten a compilation error.

No. I don't get any debugging errors when I run the code either. I simply get nothing actually. Yet, if I use the library's demo and those files, it works completely fine.
In response to Yoren
(I dont define vars for you) but Sound = the sound file. If there is a sound file then go to the If("Wanton") etc... It isnt really neccesary but if you dont have a file and nothing is playing you know why(becuz the sound file isnt there) Anyways if there is a sound then run the If("Wanton") then continue. btw S = sound I was just lazy my fault. And Indention errors don't appear at all times. And if I may ask can you break this down and show me where else this code appears
src.client.sound_system.AlterMusic(Sound)
Yoren said:
First Problem
So, I've been hoping to use ShadowDrake's sd_Alert library to avoid using the ugly looking built in one and because his comes with a lot more functionality. Problem is however, any time I actually try to use it, the alert itself seems to crash - even in just simple tests. The library itself works completely fine in its demo and even works if I uninclude my own interface file, but otherwise it just appears as a window with a blank white screen where the text and options should be. I'm not exactly sure why it's doing this and not playing with my interface file, so any insight into that or workarounds would be helpful.

Are you including the necessary windows/controls required? Import what's in the library's interface (.dmf) file into yours, and make sure you don't have any conflicting control names.

Edit: Nevermind.

Second Problem
I'm using Foomer's Sound System library for the sake of both sound effects and background music in the game. The sound effects work fine, however the I can't get the background music to play no matter what. I've tried taking out the interface as well with this, in hopes I would be able to see if its a common issue but no luck. I've placed my sound files into the library and made some code in his "example" file to play the music precisely as I'm trying to in my game, and it works fine. In my project however, it still fails to work and this has left me at a complete lost.

mob/proc/BGMusic(var/Location)
var/Sound
switch(Location)
if("Wanton")
Sound = 'Forest Background Music.ogg'
else
Sound = 'City Background Music.ogg'
src.client.sound_system.AlterMusic(Sound)


Where is BGMusic() called? I'm thinking the proc could possibly never be called in your project (a difference in implementation; simple example vs. variable game source).

Also, what Dragonpearl123 means, is for you to use fexists() to make sure the file exists prior to trying to play it. His code example was not the greatest though.
In response to FKI
FKI wrote:
Yoren said:
First Problem
So, I've been hoping to use ShadowDrake's sd_Alert library to avoid using the ugly looking built in one and because his comes with a lot more functionality. Problem is however, any time I actually try to use it, the alert itself seems to crash - even in just simple tests. The library itself works completely fine in its demo and even works if I uninclude my own interface file, but otherwise it just appears as a window with a blank white screen where the text and options should be. I'm not exactly sure why it's doing this and not playing with my interface file, so any insight into that or workarounds would be helpful.

Are you including the necessary windows/controls required? Import what's in the library's interface (.dmf) file into yours, and make sure you don't have any conflicting control names.

Libraries don't use .dmf files, because that's not how they work. With a library you either include it wholesale or you don't; they don't come with .dmfs that you have to graft onto your own. Also, sd_Alert predates BYOND 4.0 by quite a lot.

The sd_Alert library is browser-based, so if a white screen is shown that means that the page created by the library did not appear correctly. Either something may be wrong with the browser control on your system, or something's wrong in the code for the page. The latter is more likely.

Dragonpearl, did you try just running the sd_Alert demo? If the demo works for you, then the problem is likely something that you did in the way you setup your alert. We'd have to see the call you made to the sd_Alert code to know more.
In response to Lummox JR
Thanks (for the correction and clarification). I had a different demo in mind.

Also, the demo works for me. (And how do you strikeout text on here?)
Well, I am calling the BGMusic() upon login after being placed on the map and passing Wanton through to the function myself. As for an issue concerning sound files - they're all there and I did a desk trace involving outputting to the screen to see the contents of the Sound variable as well as what "path" it was going through and it all goes as it should. The indentation issue occured here on the forum because I was typing it over on my phone, but in the actual code, that's not the case as I only use TAB anyway, and I've confirmed that.

Also, the "src.client.sound_system.AlterMusic()" is only called within that procedure, but I do make use of the "src.client.sound_system.PlaySound()" often and it works fine.

As for the sd_Alert issue - it calls fine in the demo, and I don't use any of the flags or customization parameters in the function when calling it, so I'm guessing it may be a problem with the browser on my system instead?
If it's a system problem, the sd_Alert demo won't work for you either. My guess is the problem comes in the way you called it, but you didn't show any of that code.
mob/verb/Test()
var/Choice = sd_Alert(usr, "Testing this library", "Test", list("Choice 1", "Choice 2"))
usr << output("Choice: [Choice]", "SystemOutput")


Like I said. Simple code. And it still just gives me an all white window.

Edit: screenshot of the actual issue: http://i.imgur.com/UljP2ol.jpg
Been a bit since I've had any input on either issue, so I'm just bumping the post to let others know my issues are still persisting.
Figured out my issue concerning the sd_Alert library after reading through Lummox's posts a few times. The issue was that basically, since the library generates the window and it's information via the browser, but my interface didn't make use of a browser control on the main (default) window, it could never display the information correctly. So I basically made a small browser control on my main (default) window and set it to invisible (so that it doesn't disrupt the full screen map view). Now the information displays correctly as intended.

Now the only thing left is the issue concerning Foomer's Sound System library and why it won't play music in my project versus the demo.