charAt Error with String Variables


#1

Sometimes when I call certain variables I get a charAt error. This doesn’t happen with every string variables, just a few. All of my variables, temp and persistent, use different names. To add, I have a bunch of other variables that are defined and called the same way with no errors. I am confused.

Thanks for the help!

Excerpt from mygame.js:
stats = {
// STRINGS
modname: “Cool name”
,castle: “Gereric Castle”
,village: “Generic Village”
,king: “Herald”
};

This works:
This is a test, $!{castle}.

This works:
This is a test, !{castle}.

This does not work:
This is a test, $!{village}.

This does not work:
This is a test, ${village}.

Full error message:
{“message”:“value.charAt is not a function”,“fileName”:“file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js”,“lineNumber”:137,“stack”:"("!{village}\",\"!\",\"village\",95,\"Here the player can either actively embark on a sidequest, visit !{king} at !{castle}, visit !{village}, or do nothing.")@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js:137
(“Here the player can either actively embark on a sidequest, visit !{king} at !{castle}, visit !{village}, or do nothing.\")@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js:134 printLine(\"Here the player can either actively embark on a sidequest, visit !{king} at !{castle}, visit !{village}, or do nothing.”)@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js:125
printLoop()@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js:105
execute()@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js:271
()@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js:212
safeCall([object Object],(function () {doneLoading();self.execute();}))@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/util.js:35
([object Event])@file:///C:/Users/Daemonion/Dropbox/ChoiceScript/web/scene.js:210
",“name”:“TypeError”}


#2

Bah, I fixed it. I had a second “village” variable in the stats menu. Changing that fixed my issue.

Wahoo!