@lordirishdas
Glad it’s sorted
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
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!)
And I say that^ from experience, as @Vendetta can probably guess.
Best of luck!