DC Raven's Loft

@lordirishdas Just had a quick look with IE (Firefox runs it fine) and it’s throwing up all sorts of errors which seem to be related to mygame.js. On closer inspection, I think there’s a possibility that your first six stats in mygame.js have a tab in front of them rather than spaces, so they seem right at a glance if your tab property is set to that exact number (4) of spaces . . . However, when mygame.js is loaded into a text editor with a different tab property setting (e.g. 8 spaces), those first six lines are shown as double-indented. HTH.

@whocares916 The game doesn’t hate you, but your browser does! :wink:

Thanks @Vendetta I have a new laptop but have not loaded all the software I am use to. Should have run it in IE. I will fix next update.

Javascript doesn’t ‘care’ about indentation, tabbed or otherwise.

@CJW No, but the way ChoiceScript handles (& reports) “errors” does vary from one browser to the next, which is why this game is running perfectly fine in (e.g.) Firefox but on loading immediately has a mygame.js-related problem in IE8.

In all honesty, the sooner Microsoft’s clunky offering disappears for ever (fewer than 1 in 6 net users still use IE, and it’s falling constantly) the better for everyone!

Try changing the meta declaration at the top of index.html file, for some reason COG has it to declare IE7 standards, which causes a lot of problems with IE9.
After changing that, IE actually seems to work flawlessly with my game (it was previously completely unplayable).

@CJW It might be worth an email to support@ to make CoG aware of this issue, just in case it’s unintentional? It may have been left at IE7 standards to support older versions of IE, but if that’s just screwing things up for IE9 users (the most popular version for those still using IE) the thinking behind that seems a little skewed to me.

Good thinking, I’ll do that.

@lordirishdash The JavaScript comment by @CJW got me wondering so I did some checking. Turns out he is 100% correct on the indentation thing where mygame.js is concerned, so it had to be something else specific to ChoiceScript’s mygame.js-related error messages for IE . . . It’s actually the following variable:


,return: false

Don’t ask me why, but ChoiceScript in IE8 really doesn’t seem to like that particular word used as a variable, although it’s fine when part of a longer name e.g. return_to_scene. :confused:

return is a javascript command/key word, much like class and prototype. You can’t (shouldn’t?) use it as a variable name.

Avoid any names that turn blue in notepad++

Things like rreturn or return_to will work, as you say Vendetta.

@Vendetta
to be expected from chrome
but it beats the risk of those viruses from fire fox :slight_smile:

@CJW Ah, that explains it. It is however ironic that I looked more closely at those six variables only because they had been tabbed, not spaced, so were likely the most recent additions . . . (‘return’ was the second of those). I doubt I would’ve found the culprit otherwise! :smiley:

@whocares916 Ain’t that the truth. Unfortunately, Chrome hates ChoiceScript devs – it’s the one browser we can’t easily use for offline / local testing. :frowning:

@lordirishdas @Vendetta Might be worth me mentioning that I don’t get any errors in IE9 unless I turn it to IE7 or IE8 browser mode (via F12 Dev Tools). In which case it’s something to do with expecting a string/identifier and StatsSettingClone(?)

What versions and modes are you guys using?

@CJW Yep, it only affects IE versions earlier than IE9. Putting two and two together, it seems to be related to how those older versions handle JavaScript (or at least, the names of JS commands like ‘return’ being used as ChoiceScript variables).

Ok made a few quick changes and uploaded, still need to fix the email but falling asleep as I write. Will fix tomorrow. Thanks @CJW and @Vendetta for spotting the problem. Ran it on IE as soon as I uploaded and looks fine now. Hopefully have some down time tomorrow to work on the second page and some of the icons. Good night all.

@lordirishdas

Glad it’s sorted :slight_smile:
Let me just say this though: I had a quick look at your code, and it looks like you’re really making it hard on yourself.

When you’re writing functions don’t call them update36, update37 etc etc, make sure they’re something memorable (so you know exactly what it does by name). You should also group all your functions into a much, much smaller number of js files (or single file), don’t have one for each. The less HTTP requests the better!

A web developer would probably have a heart attack if he saw how many you were making :slight_smile:

You could also probably combine a lot of your functions if you were clever with loops and parameters, it’ll save you a lot of space and copy and pasting time.

For example you could probably store the names of the element to update in an array so it’d be like:


updateEle[0] = "health_div"
updateEle[1] = "mana_div"
updateEle[2] = "gold_div"

And then have a function:

updateDisplay(Id)

Where Id would be a number you pass to it in choicescript:
*script updateDisplay(0) *script updateDisplay(1) etc

Inside the function you’d have something like


if(updateDisplay[Id]) {
statElem = document.getElementById(updateEle[Id])
 statElem.innerHTML = stats[updateEle[Id]];
}

Or something SIMILAR… It’s not really the right time of the day to be thinking about code. But something similar would make, what, 20-30 functions into 1? It might just be worth a try!

I just get the feeling you’re spending too much time trying to get things to “work” and not enough time actually writing your game/story (which is what we all really want to play!) :wink:

And I say that^ from experience, as @Vendetta can probably guess.

Best of luck!

@CJW Thanks for the feedback. One, I am not a programmer, lol so yes I do spend a lot of time figuring out how to make it work. Two, calling the update 36, and so forth is easy for me to remember plus I have a working list to make it easy for me to call them from. If I was good at JS I probably could group them, but since I pull my hair out trying to understand JS this works for me. Plus this gives me the freedom to call the functions independently as I need them. Not to say I am not getting better and still learning. But its a trade off of spending time writing and studding trying to learn what I need to do. At the on set I did try to write them as one but could never get the code to work the way I needed it to.

I am also laying this out in a way that I have not seen on the boards yet so there are no examples for me to follow, so having to be creative with my approach, learning what works and does not work. So yes progress is slowed. You and several others on the board have been very helpful, but I do not wish to tie you up all the time as you have other things going on, and do not wish to pester you all to death. :slight_smile:

However, the design is falling into place and I understand my system much better so not having to stop and try to figure out what I was trying to do as much. Mostly impart to your lastScene idea, thanks. Also creating the races from scratch, making it harder to write the story as I have only vague ideas of what they look like at this point.

So once the races are in place, I have the maps done, there are a lot of them, and finish the icons and how I want them to work, progress should pickup. This is going to be epic in size so going to take a bit of time to complete. And of course I will still pester ya all from time to time on help, but I think I have stretched the program far enough and as long as I don’t get a wild hair, really do not plan on adding more features.

Small update for today. Page two is complete, and fixed the email. Still need to fix the code for the twins. Page three will give you the choice of a name.

http://www.lordirish.com/Norif/web/mygame/index.html

I could use some help here. I am working on the naming section but need a fairly large list of names one might choose from. So if you would be so kind as to list names you have called your pc’s in the past that would be great. Of course it will be impossible to cover all names, but I can build a reaction table to the most common ones. And the ones not named I have a way to deal with, thanks.

Bob. You MUST add Bob.

and Fred and Homer!