Multiple Stat Screens & The Latest Version of Choicescript

Well commenting that out will effectively leave you stuck in the stats screen for all eternity, so maybe :smiley:

Scratch that, I forgot about the next buttons - You should be fine!

I’m guessing it’s a problem if, when you start your index, it’s loading infinitely? My guess: I did something wrong. It also says, before I allow it, that internet explorer has restricted this page from running scripts or ActiveX controls. Then…yeah, infinity loading. Oh, and where you had ‘choicescript_stats 2’ I have ‘choicescript_stats King Relations’ because of the name I gave the file. Also, when we edited FootPrinter (don’t know what to call it), I was on line 165, not 168.

So, any thoughts on the problem at hand (and, preferably, how to fix it)?

There’s quite a lot you *could* be doing wrong, looking at the top of IE and allowing scripts and ActiveX to run would be a good start!

Copy and paste your code between `


` tags, and I’ll take a look.

@CJW Alright, thanks. Also, what is IE? I’ve already allowed scripts and ActiveX to run.

<p><button id="statsButton" class="spacedLink" onclick="showStats('choicescript_stats')">Show Stats</button> <button id="statsButton" class="spacedLink" onclick="showStats('choicescript_stats King Relations')">Show Stats 2</button>  <button id="restartButton" onclick="restartGame('prompt')">Restart</button></p>

All of that is line 79.

function showStats(scene) {
    if (window.stats.sceneName == "choicescript_stats") {
     if (window.stats.sceneName == scene) { //Is the button pressed the current scene's button?
      window.stats.scene = window.stats.scene.originalScene; //If it is, return to game.
	  clear Screen (loadAndRestoreGame) ;
      return;
	   }
    }
	//Else, in any other case: Load selected stat screen.
    var currentScene = window.stats.scene;
    var scene = new Scene(scene, window.stats, this.nav);
    scene.originalScene = currentScene;
    main.innerHTML = "<div id='text'></div>";
    scene.execute();
}

Lines 54 to 68.

function printFooter() {
  // var footer = document.getElementById('footer');
  // We could put anything we want in the footer here, but perhaps we should avoid it.
 /* var statsButton = document.getElementById("statsButton");
  if (statsButton) {
    if (window.stats.sceneName == "choicescript_stats") {
      statsButton.innerHTML = "Return to the Game";
    } else {
      statsButton.innerHTML = "Show Stats";
    }
  } */
  setTimeout(function() {callIos("curl");}, 0);
}

Lines 176 to 188

// *finish
// halt the scene
Scene.prototype.finish = function finish(buttonName) {
    this.paragraph();
    this.finished = true;
    var self = this;
    if (this.name == "choicescript_stats" && this.originalScene) || "choicescript_stats King Relations" && this.originalScene) {
      printButton(buttonName || "Next", main, false,
        function() {
          window.stats.scene = self.originalScene;
          clearScreen(loadAndRestoreGame);
        }

Lines 526 to 537

Thanks again!

(Note: the first code is in index.html, but apparently it’s all good…

In the prototype.finish function:

if (this.name == "choicescript_stats" && this.originalScene) || "choicescript_stats King Relations" && this.originalScene) {

^There’s a closing parenthesis (bracket) before the first OR (||) - Remove that.

@CJW Still a no. Any other problems you’re seeing (and would this accursed Windows 8 count as a problem)?

From looking at the code I can’t see anything else wrong, but since there’s no error message - I don’t have a lot to go on.
It may not even be a problem with this, you may have mistyped a variable in mygame.js or something.

Is the game online? If it is PM me a link and I can take a closer look.

@CJW I don’t use mygame.js. And no, it’s still in my folder. Could it be because I don’t use mygame.js?

No, it won’t be because you don’t use mygame.js - Do you know how to use javascript debugging consoles on any of the browsers?

@CJW Alas, I’m not the tech-know type. I know how to write. I have half the game down. (In short, no)

I’m using the demo/template and I’m getting an error message telling me that “title” is non-existant command. That makes sense, but I’m not sure how to fix it.

@initdoby5 @adjppm1227
There’s only so much I can guess at when provided with limited information, unless you can get me an actual error message or (better) give me a copy of your game, I can only guess at what’s wrong - which would leave us here for days.

As for your “title” thing, that’s not an error with this mod, that’s something to do with raw choicescript - *title is a new command, maybe you have an old version of CS?

There’s an article on IE’s script debugger here: http://msdn.microsoft.com/en-us/library/dd565625(v=vs.85).aspx

If you use the debugger it *should* tell you what the problem is, once it does that, if you come back and tell me, I’ll be able to help you.

@CJW I used the debugger and two errors came up.

One: HTML1412: Malformed comment. Comments should start with "<!-- ".
dd565625, line 742 character 3

Two: SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
dd565625

Also, these came up.

013-05-01 17:41:0:997 : Loading comments…
2013-05-01 17:41:01:138 : Comment web service returned 10 comment(s)…

@adjppm1227 Check your index.html file, look for that malformed comment - and any other possible mistakes.

@CJW Alright, I’ll try that…

…and it doesn’t make sense. It says that the mistake is one line 742, but my index only goes to 105.

So I tried playing my game again, and, for some reason, it says, “This is an example game. This game requires JavaScript; please enable JavaScript and refresh the page.”

So thus, I have a question. How do you enable JavaScript?

That would depend on the browser, but it should be enabled by default? http://www.activatejavascript.org/en/instructions/ie

@CJW My thoughts exactly, but it never hurts to check.

Ugh. It’s enabled, but it says it’s not enabled.

…Strange - Have you tried another browser? Firefox maybe?

@CJW Google Chrome gives me the same infinite loading as Internet Explorer, and I have no Firefox.