Add is not defined. Need HELP!!!!

josepheckiv
I keep getting the following error:

Error running script: Error compiling expression 'game.homework total + q': ArithmeticElement: Operation 'Add' is not defined for types 'Object' and 'Int32'

I have looked through the forums for a while and don't know what to do. Please help.
The area that seems to be the error is here:
game.day = (game.day +1)
q = 0
if (game.day > 1) {
if (GetBoolean(player, "studied")) {
if (GetBoolean(player, "quiz")) {
msg ("You go through the quiz knowing most of the answers. You feel confident about the results.")
}
else if (GetBoolean(player, "exam")) {
msg ("You are at the end of the year, you studied and feel certain about the majority of answers. You are excited for the grade!")
}
else if (GetBoolean(player, "homework")) {
msg ("You went over your homework thoroughly and are pretty sure of your answers.")
}
else if (GetBoolean(player, "test")) {
msg ("The rare test has arrived, but you have studied and you are confident of the answers you gave as well as the results.")
}
else if (GetBoolean(player, "project")) {
msg ("You did your research over your project and do well. You go through and only get roasted by Nathaniel and Josephus once or twice.")
}
}
else {
if (GetBoolean(player, "quiz")) {
msg ("You didn't study and guess through most of the answers. You do not look forward to the results of the quiz.")
}
else if (GetBoolean(player, "exam")) {
msg ("The exam comes and for some unknowable reason you DIDN'T study. You do not want to read the results.")
}
else if (GetBoolean(player, "homework")) {
msg ("You did not go over your homework very well, and most of it is guesswork.")
}
else if (GetBoolean(player, "test")) {
msg ("The rare test has arrived, but you didn't studied and you are NOT confident of the answers you gave as well as the results.")
}
else if (GetBoolean(player, "project")) {
msg ("You lie your way through a project and get thoroughly hosed by Nathaniel and Josephus.")
}
}
if (GetBoolean(player, "studied")) {
if (RandomChance(10+(player.Study Skill*0.1))) {
q = (75+GetRandomInt(1,5))
}
else if (RandomChance(70+(player.Study Skill*0.2))) {
q = (80+GetRandomInt(1,10))
}
else if (RandomChance(20+(player.Study Skill*0.2))) {
q = (90+GetRandomInt(1,10))
}
}
else {
if (RandomChance((10+(player.Study Skill*0.1)))) {
q = (60+GetRandomInt(1,15))
}
else if (RandomChance((70+(player.Study Skill*0.2)))) {
q = (75+GetRandomInt(1,10))
}
else if (RandomChance((20+(player.Study Skill*0.2)))) {
q = (85+GetRandomInt(1,7))
}
}
if (GetBoolean(player, "quiz")) {
game.quiz total = game.quiz total + q
game.quiz amount = (game.quiz amount +1)
}
else if (GetBoolean(player, "test")) {
game.test total = game.test total + q
game.test amount = (game.test amount +1)
}
else if (GetBoolean(player, "exam")) {
game.exam total = game.exam total + q
}
else if (GetBoolean(player, "homework")) {
game.homework total = game.homework total + q
game.homework amount = (game.homework amount +1)
}
else if (GetBoolean(player, "project")) {
game.project total = game.project total + q
game.project amount = (game.project amount +1)
}
SetObjectFlagOff (player, "quiz")
SetObjectFlagOff (player, "test")
SetObjectFlagOff (player, "project")
SetObjectFlagOff (player, "exam")
SetObjectFlagOff (player, "homework")
if (RandomChance(50)) {
msg ("Allice Joanson asks Smoore for homework, in turn he assigns three flipping close reads.")
player.Stress = (player.Stress + (GetRandomInt(1,25)))
SetObjectFlagOn (player, "homework")
}
else if (RandomChance(30)) {
msg ("Another quiz is assigned for next class")
player.Stress = (player.Stress + (GetRandomInt(1,25)))
SetObjectFlagOn (player, "quiz")
}
else if (RandomChance(8)) {
msg ("Smoore assigns a group project due next class")
player.Stress = (player.Stress + (GetRandomInt(1,15)))
SetObjectFlagOn (player, "project")
}
else if (RandomChance(2)) {
msg ("Smoor assigns the rare test for next class.")
player.Stress = (player.Stress + (GetRandomInt(1,30)))
SetObjectFlagOn (player, "test")
}
else if (game.day = 19) {
msg ("Smoore reminds you of the upcoming exam next class")
player.Stress = (player.Stress + (GetRandomInt(1,50)))
SetObjectFlagOn (player, "exam")
}
else {
msg ("Miraclously no assignment is assigned for next class.")
player.Stress = (player.Stress - (GetRandomInt(1,20)))
}
ActionMenu = NewStringList()
list add (ActionMenu, "Play Clash Royale")
list add (ActionMenu, "Take Notes")
list add (ActionMenu, "Draw Pikachu")
ShowMenu ("What do you do?", ActionMenu, false) {
if (result = "Take Notes") {
msg ("You listen to Smoore lecture about some random thingy in something called a 'threshold'. You vigirously take notes as Smoore paces through them.")
player.Stress = (player.Stress + GetRandomInt(1,20))
player.Study Skill = (player.Study Skill + GetRandomInt(1,25))
}
else if (result = "Draw Pikachu") {
msg ("You lose yourself in the pages of your sketchbook, drawing Pikachu in full detail. Dreaming of the world of pokemon")
player.Study Skill = (player.Study Skill - GetRandomInt(1,20))
player.Stress = (player.Stress - GetRandomInt(1,25))
}
else if (result = "Play Clash Royale") {
if (RandomChance(45-(player.Sneakiness*0.2))) {
msg ("You are right in the middle of a big battle when you here someone say, \"Is that clash royale?!\"")
if (RandomChance(55-(player.Luck*0.2))) {
msg ("You are relieved when you see that everyone is looking at Allice Joanson, a VERY frequent clash royale player.")
msg ("Smoore asks for her card. Allice begins lying, very obviously.")
if (RandomChance(25+(player.Clash Royale Skill*0.2))) {
msg ("While everyone is distracted you manage a victory!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,20))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(30,60))
}
else if (RandomChance(50+(player.Clash Royale Skill*0.2))) {
msg ("While everyone is distracted you manage to pull a draw!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,20))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(10,20))
}
else if (RandomChance(25-(player.Clash Royale Skill*0.1))) {
msg ("Despite everyone being distracted you lose your battle.")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,15))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(1,20))
}
}
}
else {
if (RandomChance(25+(player.Clash Royale Skill*0.2))) {
msg ("You manage a victory!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,35))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(30,90))
}
else if (RandomChance(50+(player.Clash Royale Skill*0.2))) {
msg ("You manage to pull a draw!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,30))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(10,30))
}
else if (RandomChance(25-(player.Clash Royale Skill*0.1))) {
msg ("You lose your battle.")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,25))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(1,30))
}
}
}
MoveObject (player, Bedroom)
}
}




The entire game code is below:



<!--Saved by Quest 5.6.5783.24153-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="Can You Pass Big History?">
<gameid>6851fc1a-9b01-496d-9abd-220a40c80a32</gameid>
<version>1.0</version>
<firstpublished>2016</firstpublished>
<category>Educational</category>
<subtitle>A Game of Hardship and Despair</subtitle>
<author>Joseph Eck IV</author>
<cover>big-history-project.jpg</cover>
<description>This game brings to life some of the difficulty of passing the infamous class of Big History.</description>
<showscore type="boolean">false</showscore>
<feature_asktell />
<feature_pictureframe />
<showhealth type="boolean">false</showhealth>
<statusattributes type="stringdictionary">
<item>
<key>day</key>
<value>Day: !</value>
</item>
<item>
<key>grade</key>
<value>Current Grade: !</value>
</item>
<item>
<key>Clash Royale Trophies</key>
<value>Clash Royale Trophies: !</value>
</item>
</statusattributes>
<day type="int">0</day>
<attr name="Clash Royale Trophies" type="int">0</attr>
<attr name="quiz amount" type="int">0</attr>
<attr name="test amount" type="int">0</attr>
<attr name="project amount" type="int">0</attr>
<attr name="quiz total" type="int">0</attr>
<attr name="exam total" type="int">0</attr>
<attr name="project total" type="int">0</attr>
<attr name="test total" type="int">0</attr>
<attr name="homework amount" type="int">0</attr>
<grade type="int">0</grade>
<attr name="exam grade" type="int">0</attr>
<attr name="test grade" type="int">0</attr>
<attr name="project grade" type="int">0</attr>
<attr name="homework grade" type="int">0</attr>
<attr name="quiz score" type="script">
game.quiz grade = (game.quiz total/game.quiz amount)*0.15
</attr>
<attr name="homework score" type="script">
game.homework grade = (game.homework total/game.homework amount)*0.25
</attr>
<attr name="test score" type="script">
game.test grade = (game.test total/game.test amount)*0.25
</attr>
<attr name="project score" type="script">
game.project grade = (project total/project amount)*0.25
</attr>
<attr name="exam score" type="script">
game.exam grade = (exam total*0.1)
</attr>
<start type="script">
msg ("Before we begin your adventure into the deep unknown of Big History, we must define you.")
msg ("So what is your name?")
get input {
player.alias = result
ShowMenu ("What is your gender?", Split ("Male; Female", ";"), false) {
player.gender = result
msg ("Nice to meet you, " +player.alias+ "! Press a key to begin...")
wait {
ClearScreen
MoveObject (player, Big History Class)
}
}
}
</start>
<grade2 type="script">
game.grade = (game.quiz grade+game.exam grade+game.test grade+game.homework grade+game.project grade)
</grade2>
</game>
<object name="Big History Class">
<inherit name="editor_room" />
<alias>Big History</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<firstenter type="script"><![CDATA[
msg ("Welcome to Big History! The object of this game is to get the highest grade possible, while the object of the class is unknown.")
msg ("You walk into the class for your first day of Big History. You take a seat as the teacher trys to calm the class.")
msg ("The teacher introduces himself, \"Hello my name is Smoore, welcome to Big History! Just a note our first quiz is next class.\"")
msg ("\"A quiz already,\" You think, \"Why did I sign up for this class!\" <br/>The teacher lectures on about something about a \"threshold\".<br/>You continue to get bored.<br/>You can hardly take it anymore.")
ActionMenu = NewStringList()
list add (ActionMenu, "Play Clash Royale")
list add (ActionMenu, "Take Notes")
list add (ActionMenu, "Draw Pikachu")
ShowMenu ("What do you do?", ActionMenu, false) {
if (result = "Take Notes") {
msg ("You listen to Smoore lecture about some random thingy in something called a 'threshold'. You vigirously take notes as Smoore paces through them.")
player.Stress = (player.Stress + GetRandomInt(1,20))
player.Study Skill = (player.Study Skill + GetRandomInt(1,25))
}
else if (result = "Draw Pikachu") {
msg ("You lose yourself in the pages of your sketchbook, drawing Pikachu in full detail. Dreaming of the world of pokemon")
player.Study Skill = (player.Study Skill - GetRandomInt(1,20))
player.Stress = (player.Stress - GetRandomInt(1,25))
}
else if (result = "Play Clash Royale") {
if (RandomChance(45-(player.Sneakiness*0.2))) {
msg ("You are right in the middle of a big battle when you here someone say, \"Is that clash royale?!\"")
if (RandomChance(55-(player.Luck*0.2))) {
msg ("You are relieved when you see that everyone is looking at Allice Joanson, a VERY frequent clash royale player.")
msg ("Smoore asks for her card. Allice begins lying, very obviously.")
if (RandomChance(25+(player.Clash Royale Skill*0.2))) {
msg ("While everyone is distracted you manage a victory!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,20))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(30,60))
}
else if (RandomChance(50+(player.Clash Royale Skill*0.2))) {
msg ("While everyone is distracted you manage to pull a draw!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,20))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(10,20))
}
else if (RandomChance(25-(player.Clash Royale Skill*0.1))) {
msg ("Despite everyone being distracted you lose your battle.")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,15))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(1,20))
}
}
}
else {
if (RandomChance(25+(player.Clash Royale Skill*0.2))) {
msg ("You manage a victory!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,35))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(30,90))
}
else if (RandomChance(50+(player.Clash Royale Skill*0.2))) {
msg ("You manage to pull a draw!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,30))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(10,30))
}
else if (RandomChance(25-(player.Clash Royale Skill*0.1))) {
msg ("You lose your battle.")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,25))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(1,30))
}
}
}
MoveObject (player, Bedroom)
}
SetObjectFlagOn (player, "quiz")
]]></firstenter>
<enter type="script"><![CDATA[
game.day = (game.day +1)
q = 0
if (game.day > 1) {
if (GetBoolean(player, "studied")) {
if (GetBoolean(player, "quiz")) {
msg ("You go through the quiz knowing most of the answers. You feel confident about the results.")
}
else if (GetBoolean(player, "exam")) {
msg ("You are at the end of the year, you studied and feel certain about the majority of answers. You are excited for the grade!")
}
else if (GetBoolean(player, "homework")) {
msg ("You went over your homework thoroughly and are pretty sure of your answers.")
}
else if (GetBoolean(player, "test")) {
msg ("The rare test has arrived, but you have studied and you are confident of the answers you gave as well as the results.")
}
else if (GetBoolean(player, "project")) {
msg ("You did your research over your project and do well. You go through and only get roasted by Nathaniel and Josephus once or twice.")
}
}
else {
if (GetBoolean(player, "quiz")) {
msg ("You didn't study and guess through most of the answers. You do not look forward to the results of the quiz.")
}
else if (GetBoolean(player, "exam")) {
msg ("The exam comes and for some unknowable reason you DIDN'T study. You do not want to read the results.")
}
else if (GetBoolean(player, "homework")) {
msg ("You did not go over your homework very well, and most of it is guesswork.")
}
else if (GetBoolean(player, "test")) {
msg ("The rare test has arrived, but you didn't studied and you are NOT confident of the answers you gave as well as the results.")
}
else if (GetBoolean(player, "project")) {
msg ("You lie your way through a project and get thoroughly hosed by Nathaniel and Josephus.")
}
}
if (GetBoolean(player, "studied")) {
if (RandomChance(10+(player.Study Skill*0.1))) {
q = (75+GetRandomInt(1,5))
}
else if (RandomChance(70+(player.Study Skill*0.2))) {
q = (80+GetRandomInt(1,10))
}
else if (RandomChance(20+(player.Study Skill*0.2))) {
q = (90+GetRandomInt(1,10))
}
}
else {
if (RandomChance((10+(player.Study Skill*0.1)))) {
q = (60+GetRandomInt(1,15))
}
else if (RandomChance((70+(player.Study Skill*0.2)))) {
q = (75+GetRandomInt(1,10))
}
else if (RandomChance((20+(player.Study Skill*0.2)))) {
q = (85+GetRandomInt(1,7))
}
}
if (GetBoolean(player, "quiz")) {
game.quiz total = game.quiz total + q
game.quiz amount = (game.quiz amount +1)
}
else if (GetBoolean(player, "test")) {
game.test total = game.test total + q
game.test amount = (game.test amount +1)
}
else if (GetBoolean(player, "exam")) {
game.exam total = game.exam total + q
}
else if (GetBoolean(player, "homework")) {
game.homework total = game.homework total + q
game.homework amount = (game.homework amount +1)
}
else if (GetBoolean(player, "project")) {
game.project total = game.project total + q
game.project amount = (game.project amount +1)
}
SetObjectFlagOff (player, "quiz")
SetObjectFlagOff (player, "test")
SetObjectFlagOff (player, "project")
SetObjectFlagOff (player, "exam")
SetObjectFlagOff (player, "homework")
if (RandomChance(50)) {
msg ("Allice Joanson asks Smoore for homework, in turn he assigns three flipping close reads.")
player.Stress = (player.Stress + (GetRandomInt(1,25)))
SetObjectFlagOn (player, "homework")
}
else if (RandomChance(30)) {
msg ("Another quiz is assigned for next class")
player.Stress = (player.Stress + (GetRandomInt(1,25)))
SetObjectFlagOn (player, "quiz")
}
else if (RandomChance(8)) {
msg ("Smoore assigns a group project due next class")
player.Stress = (player.Stress + (GetRandomInt(1,15)))
SetObjectFlagOn (player, "project")
}
else if (RandomChance(2)) {
msg ("Smoor assigns the rare test for next class.")
player.Stress = (player.Stress + (GetRandomInt(1,30)))
SetObjectFlagOn (player, "test")
}
else if (game.day = 19) {
msg ("Smoore reminds you of the upcoming exam next class")
player.Stress = (player.Stress + (GetRandomInt(1,50)))
SetObjectFlagOn (player, "exam")
}
else {
msg ("Miraclously no assignment is assigned for next class.")
player.Stress = (player.Stress - (GetRandomInt(1,20)))
}
ActionMenu = NewStringList()
list add (ActionMenu, "Play Clash Royale")
list add (ActionMenu, "Take Notes")
list add (ActionMenu, "Draw Pikachu")
ShowMenu ("What do you do?", ActionMenu, false) {
if (result = "Take Notes") {
msg ("You listen to Smoore lecture about some random thingy in something called a 'threshold'. You vigirously take notes as Smoore paces through them.")
player.Stress = (player.Stress + GetRandomInt(1,20))
player.Study Skill = (player.Study Skill + GetRandomInt(1,25))
}
else if (result = "Draw Pikachu") {
msg ("You lose yourself in the pages of your sketchbook, drawing Pikachu in full detail. Dreaming of the world of pokemon")
player.Study Skill = (player.Study Skill - GetRandomInt(1,20))
player.Stress = (player.Stress - GetRandomInt(1,25))
}
else if (result = "Play Clash Royale") {
if (RandomChance(45-(player.Sneakiness*0.2))) {
msg ("You are right in the middle of a big battle when you here someone say, \"Is that clash royale?!\"")
if (RandomChance(55-(player.Luck*0.2))) {
msg ("You are relieved when you see that everyone is looking at Allice Joanson, a VERY frequent clash royale player.")
msg ("Smoore asks for her card. Allice begins lying, very obviously.")
if (RandomChance(25+(player.Clash Royale Skill*0.2))) {
msg ("While everyone is distracted you manage a victory!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,20))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(30,60))
}
else if (RandomChance(50+(player.Clash Royale Skill*0.2))) {
msg ("While everyone is distracted you manage to pull a draw!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,20))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(10,20))
}
else if (RandomChance(25-(player.Clash Royale Skill*0.1))) {
msg ("Despite everyone being distracted you lose your battle.")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,15))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(1,20))
}
}
}
else {
if (RandomChance(25+(player.Clash Royale Skill*0.2))) {
msg ("You manage a victory!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,35))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(30,90))
}
else if (RandomChance(50+(player.Clash Royale Skill*0.2))) {
msg ("You manage to pull a draw!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,30))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(10,30))
}
else if (RandomChance(25-(player.Clash Royale Skill*0.1))) {
msg ("You lose your battle.")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,25))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(1,30))
}
}
}
MoveObject (player, Bedroom)
}
}
]]></enter>
<object name="Smoore">
<inherit name="editor_object" />
<inherit name="namedmale" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<alias>Smoore</alias>
<anger type="int">0</anger>
<morph type="string"></morph>
</object>
</object>
<object name="Bedroom">
<inherit name="editor_room" />
<alias>Your Room</alias>
<usedefaultprefix type="boolean">false</usedefaultprefix>
<prefix type="string"></prefix>
<description type="script">
</description>
<firstenter type="script">
msg ("This is your room it is where you spend your time inbetween Big History classes. During this time you will be given the chance to do a multitude of things before the next class, however you may only do one of those things, so choose wisely.")
</firstenter>
<enter type="script"><![CDATA[
ActionMenu2 = NewStringList()
x = GetRandomInt(1,3)
if (x=1) {
list add (ActionMenu2, "Watch the blues in a big playoff game")
}
else if (x=2) {
list add (ActionMenu2, "Check Social Media")
}
else if (x=3) {
list add (ActionMenu2, "Play Some Clash Royale")
}
y = GetRandomInt(1,3)
if (y=1) {
list add (ActionMenu2, "Shoot Some Hoops")
}
else if (y=2) {
list add (ActionMenu2, "Draw More Pokemon")
}
else if (y=3) {
list add (ActionMenu2, "Get Some Rest")
}
list add (ActionMenu2, "Study")
if (RandomChance(40-(player.Luck*0.2))) {
z = GetRandomInt(1,3)
if (z=1) {
list add (ActionMenu2, "Study For Mr.Cellar's Test")
}
else if (z=2) {
list add (ActionMenu2, "Buy Granite Countertops")
}
else if (z=3) {
list add (ActionMenu2, "Doge")
}
}
ShowMenu ("What do you want to do?", ActionMenu2, false) {
if (result = "Watch the blues in a big playoff game") {
msg ("The game comes down to the wire, when in the final seconds of the game.....")
if (RandomChance(50+(GetRandomInt(1,15)))) {
msg ("The opponent drives up the ice, 5 seconds left....Shot on goal.....it's...")
if (RandomChance(50+(GetRandomInt(1,10)))) {
msg ("A SAVE BY ELLIOT. This game goes to OT")
if (RandomChance(50+(GetRandomInt(1,5)))) {
msg ("THE BLUES WIN IT WITH A GOAL WITH 10 SECONDS REMAINING!!!")
}
else {
msg ("THE BLUES CHOKE WITH SECONDS ON THE CLOCK!!! ")
}
}
else {
msg ("IT'S A GOAL, A HEARTBREAKING LOSS FOR BLUES FANS!!!!")
}
}
else {
msg ("The Blues drive up the ice, 5 seconds left....Shot on goal.....it's...")
if (RandomChance(50+(GetRandomInt(1,10)))) {
msg ("A SAVE BY THE OPPONENT. This game goes to OT")
if (RandomChance(50+(GetRandomInt(1,5)))) {
msg ("THE BLUES WIN IT WITH A GOAL WITH 10 SECONDS REMAINING!!!")
}
else {
msg ("THE BLUES CHOKE WITH SECONDS ON THE CLOCK!!! ")
}
}
else {
msg ("IT'S A GOAL, A WIN FOR THE BLUES!!!!")
}
}
}
else if (result = "Check Social Media") {
msg ("You get on your twitter account, @TheReal"+player.alias+GetRandomInt(1,1000))
if (RandomChance(50+(player.Study Skill*0.2))) {
msg ("You check a few things and then manage a little studying.")
player.Sneakiness = (player.Sneakiness + (GetRandomInt(1,18)))
player.Study Skill = (player.Study Skill + (GetRandomInt(4,30)))
}
else {
msg ("You get lost in the world of the internet and totally forget to study.")
player.Sneakiness = (player.Sneakiness + (GetRandomInt(1,18)))
player.Study Skill = (player.Study Skill - (GetRandomInt(4,30)))
}
}
else if (result = "Play Some Clash Royale") {
msg ("You open up clash royale for a session of high heat battles")
if (RandomChance(25+(player.Clash Royale Skill*0.2))) {
msg ("You win the majority of the battles!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,35))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(90,120))
}
else if (RandomChance(50+(player.Clash Royale Skill*0.2))) {
msg ("You draw in most of the battles!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,30))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(30,60))
}
else if (RandomChance(25-(player.Clash Royale Skill*0.1))) {
msg ("You lose the majority of the battles!")
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,25))
game.Clash Royale Trophies = (game.Clash Royale Trophies - GetRandomInt(1,40))
}
else {
player.Clash Royale Skill = (player.Clash Royale Skill + GetRandomInt(1,15))
game.Clash Royale Trophies = (game.Clash Royale Trophies + GetRandomInt(1,10))
}
}
else if (result = "Shoot Some Hoops") {
msg ("You take a breather from everything and go outside to shoot a few baskets.")
BV = GetRandomInt(1,20)
if (BV <= 10) {
msg ("You are quickly frustrated that you can't sink a single basket. You thow the ball against the backboard in anger. After your outburst you go back inside get a little studying done and get some rest.")
player.Stress = (player.Stress + (GetRandomInt(1,20)))
player.Study Skill = (player.Study Skill + (GetRandomInt(1,15)))
}
else {
msg ("You sink J's all day. One after another. 8...9...10..in a row. Anotha One. However, you lose yourself in the world of basketball stardom and lose the time to study.")
player.Stress = (player.Stress - (GetRandomInt(1,25)))
player.Study Skill = (player.Study Skill - (GetRandomInt(1,15)))
player.Luck = (player.Luck + (GetRandomInt(1,15)))
}
}
else if (result = "Draw More Pokemon") {
msg ("You imagine yourself in the world of Pokemon, as trainer "+player.alias+" champion of the Johto region. You imagine holding all 8 badges of the Johto. You lose yourself in the world of imaginary scribblings of the japanese.")
player.Stress = (player.Stress - (GetRandomInt(1,20)))
player.Study Skill = (player.Study Skill - (GetRandomInt(5,50)))
player.Luck = (player.Luck + (GetRandomInt(1,18)))
player.Sneakiness = (player.Sneakiness + (GetRandomInt(1,18)))
}
else if (result = "Get Some Rest") {
msg ("You turn in for the night, frustrated with the heaps of homework you have.")
player.Stress = (player.Stress - (GetRandomInt(5,40)))
player.Study Skill = (player.Study Skill + (GetRandomInt(1,15)))
}
else if (result = "Study For Mr.Cellar's Test") {
if () {
}
}
else if (result = "Buy Granite Countertops") {
msg ("Ahhh, Granite Countertops, the epitome of an A+ Student.")
player.Luck = (player.Luck + (GetRandomInt(1,20)))
player.Study Skill = (player.Study Skill + (GetRandomInt(1,25)))
}
else if (result = "Doge") {
msg ("Doge")
player.Sneakiness = (player.Sneakiness + (GetRandomInt(1,25)))
player.Study Skill = (player.Study Skill + (GetRandomInt(4,20)))
get input {
if (result = "doge doge") {
player.Luck = (player.Luck + (GetRandomInt(1,50)))
player.Study Skill = (player.Study Skill + (GetRandomInt(4,50)))
}
}
}
else if (result = "Study") {
msg ("You hit the books hard and study nonstop. This keeps refresed on the information, but really stresses you out")
player.Study Skill = (player.Study Skill + (GetRandomInt(10,35)))
player.Stress = (player.Stress + (GetRandomInt(15,45)))
player.Luck = (player.Luck - (GetRandomInt(5,30)))
player.Sneakiness = (player.Sneakiness - (GetRandomInt(5,20)))
SetObjectFlagOn (player, "studied")
}
ActionMenu2 = ("")
MoveObject (player, Big History Class)
}
]]></enter>
</object>
<object name="Character Creation Room">
<inherit name="editor_room" />
<usedefaultprefix type="boolean">false</usedefaultprefix>
<descprefix type="string"></descprefix>
<objectslistprefix type="string"></objectslistprefix>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<statusattributes type="stringdictionary">
<item>
<key>Clash Royale Skill</key>
<value>Clash Royale Skill: !</value>
</item>
<item>
<key>Study Skill</key>
<value>Study Skill: !</value>
</item>
<item>
<key>Sneakiness</key>
<value>Sneakiness: !</value>
</item>
<item>
<key>Stress</key>
<value>Stress: !</value>
</item>
<item>
<key>Luck</key>
<value>Luck: !</value>
</item>
</statusattributes>
<attr name="Study Skill" type="int">30</attr>
<attr name="Clash Royale Skill" type="int">50</attr>
<Sneakiness type="int">45</Sneakiness>
<Luck type="int">25</Luck>
<Stress type="int">30</Stress>
</object>
</object>
<function name="GetGrade" type="int">
if (GetBoolean(player, "studied")) {
if (RandomChance(10+(player.Study Skill*0.1))) {
grade = (75+GetRandomInt(1,5))
}
else if (RandomChance(70+(player.Study Skill*0.2))) {
grade = (80+GetRandomInt(1,10))
}
else if (RandomChance(20+(player.Study Skill*0.2))) {
grade = (90+GetRandomInt(1,10))
}
}
else {
if (RandomChance((10+(player.Study Skill*0.1)))) {
grade = (60+GetRandomInt(1,15))
}
else if (RandomChance((70+(player.Study Skill*0.2)))) {
grade = (75+GetRandomInt(1,10))
}
else if (RandomChance((20+(player.Study Skill*0.2)))) {
grade = (85+GetRandomInt(1,7))
}
if (GetBoolean(player, "quiz")) {
game.quiz total = (game.quiz score + grade)
game.quiz amount = (game.quiz amount +1)
}
else if (GetBoolean(player, "test")) {
game.test total = (game.test score + grade)
game.test amount = (game.test amount +1)
}
else if (GetBoolean(player, "exam")) {
game.exam total = (game.exam score + grade)
}
else if (GetBoolean(player, "homework")) {
game.homework total = (game.homework score + grade)
game.homework amount = (game.homework amount +1)
}
else if (GetBoolean(player, "project")) {
game.project total = (game.project score + grade)
game.project amount = (game.project amount +1)
}
SetObjectFlagOff (player, "quiz")
SetObjectFlagOff (player, "test")
SetObjectFlagOff (player, "project")
SetObjectFlagOff (player, "exam")
SetObjectFlagOff (player, "homework")
}
</function>
<function name="GetAssignment" type="string">
if (RandomChance(50)) {
msg ("Allice Joanson asks Smoore for homework, in turn he assigns three flipping close reads.")
player.Stress = (player.Stress + (GetRandomInt(1,25)))
SetObjectFlagOn (player, "homework")
}
if (RandomChance(30)) {
msg ("Another quiz is assigned for next class")
player.Stress = (player.Stress + (GetRandomInt(1,25)))
SetObjectFlagOn (player, "quiz")
}
if (RandomChance(8)) {
msg ("Smoore assigns a group project due next class")
player.Stress = (player.Stress + (GetRandomInt(1,15)))
SetObjectFlagOn (player, "project")
}
if (RandomChance(2)) {
msg ("Smoor assigns the rare test for next class.")
player.Stress = (player.Stress + (GetRandomInt(1,30)))
SetObjectFlagOn (player, "test")
}
else if (game.day = 19) {
msg ("Smoore reminds you of the upcoming exam next class")
player.Stress = (player.Stress + (GetRandomInt(1,50)))
SetObjectFlagOn (player, "exam")
}
else {
msg ("Miraclously no assignment is assigned for next class.")
player.Stress = (player.Stress - (GetRandomInt(1,20)))
}
</function>
<function name="GetAssignmentResult">
if (GetBoolean(player, "studied")) {
if (GetBoolean(player, "quiz")) {
msg ("You go through the quiz knowing most of the answers. You feel confident about the results.")
}
else if (GetBoolean(player, "exam")) {
msg ("You are at the end of the year, you studied and feel certain about the majority of answers. You are excited for the grade!")
}
else if (GetBoolean(player, "homework")) {
msg ("You went over your homework thoroughly and are pretty sure of your answers.")
}
else if (GetBoolean(player, "test")) {
msg ("The rare test has arrived, but you have studied and you are confident of the answers you gave as well as the results.")
}
else if (GetBoolean(, "project")) {
msg ("You did your research over your project and do well. You go through and only get roasted by Nathaniel and Josephus once or twice.")
}
}
else {
if (GetBoolean(player, "quiz")) {
msg ("You didn't study and guess through most of the answers. You do not look forward to the results of the quiz.")
}
else if (GetBoolean(player, "exam")) {
msg ("The exam comes and for some unknowable reason you DIDN'T study. You do not want to read the results.")
}
else if (GetBoolean(player, "homework")) {
msg ("You did not go over your homework very well, and most of it is guesswork.")
}
else if (GetBoolean(player, "test")) {
msg ("The rare test has arrived, but you didn't studied and you are NOT confident of the answers you gave as well as the results.")
}
else if (GetBoolean(player, "project")) {
msg ("You lie your way through a project and get thoroughly hosed by Nathaniel and Josephus.")
}
}
</function>
</asl>

XanMag
Do you get this at the very beginning of the game (upon start-up) or somewhere down the line?

HegemonKhan
try not to have spaces in your names (such as your Attributes' names), as it likely is causing errors due to the parser being unable to understand what you mean. (I personally like using underscores for my own labeling/naming convention)

--------

your 'q' Variable seems fine, maybe if you do looping/recursion, you may have an issue with it if it's not part of that loop/recursion

XanMag
I copied your code, added a wee bit, and things seem to be working fine (I got to something like day 35). I got to a point where I selected a new option and I got an unexpected line ending error, but I imagine that was from my copy paste job? I get no response when interacting with Smoore nor when selecting Doge as an option. Also on the first page 'trys' should be 'tries'. :wink:

If your game doesn't get this far because of your ADD error, let me know and I will tell you what I added. Too embarrassed to say publicly now! :lol:

EDIT: I copy-pasted your code again in a new game. I got your error message without my little add-in much sooner (day 7-8). Not sure if that addition just popped-up sooner than my first run through with edit or not.

josepheckiv
I rearranged a few things and they seem to be working, however I was wondering how to list a list of numbers it gives me this, 'game.day = (2,3,6,7,11,12)': SyntaxError: Unexpected token ","; expected one of ")"Line: 1, Column: 2

HegemonKhan
here's a link to help you with quest's syntax and design:

http://docs.textadventures.co.uk/quest/ ... lists.html
http://docs.textadventures.co.uk/quest/ ... aries.html

-----------------

lists/arrays are created (returned) via the built-in 'split' Function:

http://docs.textadventures.co.uk/quest/ ... split.html

player.my_list = split ("item1 SEPARATOR item2 SEPARATOR item3", "SEPARATOR")

usually, the semicolon is used as the SEPARATOR:

player.my_list = split ("red; blue; yellow", ";")

but you can use whatever (with probably some limitations and/or curious/interesting results) character/symbol you want as the SEPARATOR.

----

or you can build up your List too:

player.my_list = NewStringList()
list add (player.my_list, "red")
list add (player.my_list, "blue")
list add (player.my_list, "yellow")

-----

or you can create it "directly physically (before compile-time)" via the XML 'creation' tags (in your game code):

<object name="player">
<attr name="my_list" type="simplestringlist">red;blue;yellow</attr>
</object>

HegemonKhan
HK edit:

Credit goes to XanMag for spotting this code issue

I would never have realized/spotted this code issue, but XanMag did.

---------------

also, you seem to not have created the 'game.homework total' Attribute

you got/created these:

game.homework amount
game.homework grade
game.homework score

-----

so you probably forgotten or didn't realize you've got this mismatch with your Attribute(s)

josepheckiv
HegemonKhan wrote:also, you seem to not have created the 'game.homework total' Attribute

you got/created these:

game.homework amount
game.homework grade
game.homework score

-----

so you probably forgotten or didn't realize you've got this mismatch with your Attribute(s)



Thanks, I think I got the bugs all ironed out! Time for an A on my history project!!

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums