Hi, I’m Quin! I’m super glad to be here, I love playing COG games
So I tried out the editor and I was playing around with the code, and I keep getting this error message:
Java Script Error: Invalid title instruction, only allowed at the top of startup.txt
…but I can’t find the source of the error. If anyone could help I’d be much obliged! Here’s what I have for the mygame.js file: (If you’re confused about the content just ignore it, it’s all just random weirdness with no real method. Won’t resemble the game I have in mind.)
`
nav = new SceneNavigator([
“startup”
,“invasion”
]);
stats = {
leadership: 50
,strength: 50
};
`
Here’s what I have in the startup.txt file:
`
*title Random
Welcome to the game!
*choice
#Play good
Happy yet limited.
*finish
#Play evil
Cruel yet fun.
*goto_scene invasion
#Play neutral
Boring yet safe.
*goto theater
*label theater
You have a lot of fun visiting a theater. Your favorite piece was the
*choice
#Siren’s Song
A hot choice. The siren’s song seduces you. You die of a boiling fever.
*ending
#Maiden’s Lament
A pure choice. The lament grieves you. You live hopefully.
*goto_scene invasion
#Warrior’s Cry
A strong choice. The cry rallies your courage. You live bravely.
*finish
#Scholar’s Observations
A wise choice. The monotonous voice drones on and on, lulling you into unconsciousness. You die of boredom.
*goto theater
`
Here’s what I have in the invasion.txt file:
There is a terrible invasion. What do you do? *choice #Fight at the front lines. #Engage in tactical strategy. #Encourage the soldiers. #RUN FOR YOUR LIFE D:
So, the following issues arise in the online test of the game:
#1 – I can get from “Play Good” to “Happy…” but then the “Next Chapter” link just gives me the error message
#2 – “Play evil” instantly gives me the error message
#3 – I can “Play neutral” no problem, but then “Maiden’s Lament” shows me the error message
#4 – Under “Play neutral”, “Warrior’s Cry” works but the “Next Chapter” link shows me the error message again
Whatever I do, I can’t seem to get to the invasion.txt file. Theoretically I could structure a game using only "goto " rather than "goto_scene " as the “goto theater” part works fine, but I’m thinking of making a pretty bulky game and it would definitely be helpful to break up the scenes.
I noticed that someone else had this problem: http://www.choiceofgames.com/forum/discussion/2254/invalid-title-instruction-error?post#Form_Body
However, there was never a response applicable to me. I retried everything while removing the *title Random from the startup.txt file, and nothing was different. It tells me every time that Line 6 is the issue, but tampering with it doesn’t seem to change anything. I’m new to coding and I’m really lost as to what’s wrong here. I did triple-check and all the indenting is correct. Any help would be much appreciated! Thank you!
Quin