iiYO Community

Full Version: bgm still playing after loading
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

I was testing out the save feature.

While in game, i load a save file. The current game bgm wasnt stopped and the new game bgm starts playing. In game, bgm runs concurrently.

Any easy way i can fix this?

Do i need to mess with the wse.js?

Interpreter.prototype.load = function (name)

Thank you for helping this noob  Big Grin
Hi rscarlet,

which version of the engine are you using? Which browsers did you test this with?

Why did you post that line of code? I don't see the connection to the sound issues you describe.



I could confirm this error in the recent version and wrote a fix. Please replace the WebStoryEngine.js file you're using with the new one here and tell me if it solves the issue for you as well: https://raw.githubusercontent.com/iiyo/W...yEngine.js
Hi jfhs,

Im using the latest version which i dled here:

As for browser: Chrome.

And the WebStoryEngine.js i'm using is the same as the link you provided.

I replace it though just in case it corrupted and try saving and loading, however the problem persist.

Thank you for your time, i really appreciate it.
Hi rscarlet,

no, the WebStoryEngine.js file is NOT the same as the one you already used, I added some lines. Please take a look in your index.html file which source files are actually linked. Maybe you replaced a file that isn't even used?
Hi jfhs,

Confused Could it be that im the only one facing this problem?

Hmm, im 100% sure im using the WebStoryEngine.js link that you provided above and linked it properly but the problem still persist.

To check, I tried Night at the Hospital by Team Snugglebunny and theres pretty much no issue with the bgm after loading. It stops the bgm and play the loaded bgm scene.

My guess would be somewhere in the game.xml, i didn't script correctly somewhere which cause this issue.

Anyway, again, thank you for your time. I will try and error with a very fresh game and update over the weekend.
Hello again,

I did a test on a totally new game.xml and index.html which i copied from the folder 'root/tests/audio'.
There's a total of 4 items in total so i copied all of them into the root folder.

1. i've uncommented the 3 script src line as they seems empty when i dl it.
2. i change the navigation for the css and webstoryengine.js to the correct directory
<!DOCTYPE html>
       <title>WebStory Engine</title>
       <meta charset="utf-8">
       <link rel="stylesheet" href="styles/default.css" type="text/css" />
           #tb {
               background: transparent;
               position: absolute;
               left: 0;
               bottom: 0;
               right: 0;
               text-align: left;
               z-index: 10000;
               border: 0;
               box-shadow: none;
               text-shadow: none;
               font-weight: bold;
               font-size: 1.2em;
               font-family: monospace;
               color: black;
       <!--<script src="libs/MO5/libs/using.js/using.js"></script>
       <script src="libs/howler/howler.js"></script>
       <script src="libs/MO5/js/MO5.js"></script>-->
       <script src="bin/WebStoryEngine.js"></script>
           using("WSE.Game").run(function (Game) {
               var game = new Game({
                   url: "game.xml",
                   host: typeof HOST === "undefined" ? false : HOST

1. i inserted trigger for save
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
       <stage width="900px" height="636px" id="Stage" create="yes" center="yes" />
           <trigger name="game_menu_key_trigger" event="keyup" key="ESCAPE" function="savegames" />
        <setting name="host.stage.resize" value="true" />
       <audio name="music" loop="true" fade="false" autopause="true">
           <track title="main_menu_music">
               <source href="chaos-circus.mp3" type="mp3" />
               <source href="chaos-circus.ogg" type="ogg" />
           <track title="badass">
               <source href="chaos-circus.mp3" type="mp3" />
               <source href="chaos-circus.ogg" type="ogg" />
       <scene id="start">
            <trigger name="game_menu_key_trigger" action="activate" />
           <set asset="music" track="main_menu_music" />
           <play asset="music" fadein="500"/>
           <stop asset="music" fade="true" fadeout="1000" />
           <wait />
           <set asset="music" track="badass" />
           <play asset="music" />

When i load a savegame file, the following is shown in the console:

MO5.Result is deprecated - use MO5.Promise instead!              WebStoryEngine.js:5687
LoadingScreen: new item loading...                                          WebStoryEngine.js:10159
Message: Entering scene 'start'.                                                WebStoryEngine.js:8320
Encountered in scene 'start', element 0.                                    WebStoryEngine.js:8770
LoadingScreen: item loaded.                                                     WebStoryEngine.js:10177
TypeError: this.tracks.forEach is not a function(…)                     WebStoryEngine.js:9420
Warning: Could not restore asset state for asset 'music'! null     WebStoryEngine.js:8334
Encountered in scene 'start', element 4.                                     WebStoryEngine.js:8770

I'm tried my laptop and desktop but still the bgm continue to play when loaded.. 
I will use an alternative 'load' where user pick from a <choice> and it will go to a scene at the start of the game if this load seems to affect only me..

Thank you and really appreciate your time for reading + assisting me.  Smile
Hi rscarlet,

thanks for posting the console output. The problem was that I carelessly used .forEach() to go through the elements in an object instead of using 'for (... in ...)'. Can you try again with the new file here? https://raw.githubusercontent.com/iiyo/W...yEngine.js
Hi jfhs,

Yup, it's fixed. perfect!
The bgm stops and replay a new bgm from the loaded state.

Thank you.!
Hi again..

I found another error with the load system..

Upon loading a save game state at a choice menu.. it cant load the choices option... Leaving the game hang there unable to go next..

Uncaught TypeError: Cannot read property 'choice' of undefined WebStoryEngine.js:9684
Hi rscarlet,

thanks for reporting that, I'll look into it. Smile


Okay, I get the same error and have hopefully fixed it now. Can you test again with the file here? https://raw.githubusercontent.com/iiyo/W...yEngine.js

Pages: 1 2