Score system help part one: adding time and score to make a total score
I have gotten to the part of my game where I am working on the score system. I would like to add time(integer) plus the score(integer) to add up and give a total score(attribute) for each level.
( of course i would like that it saved in the table but one step at a time)
i have an actor that acts as a countdown timer it gets its time from my attribute table according to whatever level your on:
https://www.dropbox.com/s/0zxnczrric3bygd/Screenshot 2015-08-09 23.55.33.png?dl=0
the counter is turned on and off by a Boolean attribute:
https://www.dropbox.com/s/b2e1acyw36ghxkz/Screenshot 2015-08-10 00.02.12.png?dl=0
I tried this initially for the Score total:
change attribute: game.scoretot To: game.timer + game.score
but for some reason it will not pick up the value for the timer:
so i tried using the values in the table :
https://www.dropbox.com/s/kl1jhnaa5wn5wfi/Screenshot 2015-08-10 00.09.09.png?dl=0
It did add up the score total! However it took the value i placed in the original table for the timer to count down from. not the time left once the game is complete ,
So i thought maybe i could save the time left on the timer like so:
https://www.dropbox.com/s/ifj91acwmow8zuv/Screenshot 2015-08-10 00.11.31.png?dl=0
Then make the score total based off the time left table value plus the score:
https://www.dropbox.com/s/g7v12kkr6jgzwjc/Screenshot 2015-08-10 00.14.07.png?dl=0
still no dice...
I'm at a lost here if anybodies got suggestions or critiques on my code i will be happy to hear cause i am at a lost here.
Comments
The basic idea would be to change attribute game.timer (real) to game.Time when the level starts. Then, when the level ends, change attribute game.scoretot to game.timer+game.score. There shouldn't be any need to use tables to keep track of the time unless you're saving those times...?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang I've now have it set up to a real timer like so:
https://www.dropbox.com/s/43zeff1ock7r4ld/Screenshot 2015-08-12 11.06.37.png?dl=0
Countdown is the value the it counts down from.
Unfortunately when adding the game.score and game.timer it is still not adding up.
https://www.dropbox.com/s/frk1isby4vmsopw/Screenshot 2015-08-12 16.00.41.png?dl=0
Unless the score should also be real or index instead of an integer?
The rule you posted looks correct. game.score total and game.score should be integers unless you prefer otherwise. That expression should work whether they are real, index, or integer.
What exactly do you mean by "not adding up"? Have you checked the values of each individual attribute (the scores and timers) to make sure they are what you expect? Using Display Text and/or Log Debugging Statements can help with that. Which attribute values are/are not what you expect them to be?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang
For this equation i did place a display text https://www.dropbox.com/s/frk1isby4vmsopw/Screenshot 2015-08-12 16.00.41.png?dl=0
Well when i had an actor to display the text it is only showing the end time and not the added value of time plus the score. So i was initially thinking that it had to do with the attributes not being the same value,but if what you said is correct then perhaps if i erase and re-enter the rule it should work.
UPDATE:Well I'm finding out it has nothing to do with the timer attribute but the score attribute for some reason it is not agreeing with the rule. The attribute is not showing up in the displayed text"totalscore" once the level is completed.
I'm not sure you understood what I meant. I was asking you to isolate each attribute and determine if it was working properly. So you'd look at each timer attribute and each score attribute separately. For example, if you expected the game.timer to be 13 at one point and it was 13 and you expected game.score to be 450 at that point and it was 45, then you know the problem is with some rule related to game.score.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang oic so I would create an actor and put a display text like so:
https://www.dropbox.com/s/vx43rl7d5dnid84/Screenshot 2015-08-12 23.08.41.png?dl=0
And place actor onto the screen to see if the desired actor is working correctly like so:
https://www.dropbox.com/s/mlldv9e0jsa3sct/Screenshot 2015-08-12 23.10.39.png?dl=0
So the issue would be in the Score attribute even though it is showing that it is recording the score.
When ever it is time to use the expression to add the time and score together the expression is not reading the value for the score attribute. As tested :
https://www.dropbox.com/s/j5y6ni0gf34u6dl/Screenshot 2015-08-12 23.55.50.png?dl=0
https://www.dropbox.com/s/cqsoj25dabddycq/Screenshot 2015-08-12 23.56.15.png?dl=0
So do you think erasing the score attribute and expression would alleviate this issue then?
UPDATE: I tried erasing the expression and all the attributes and i'm still getting the same issue with the expression not adding the score attribute to the timer attribute.
@tatiang After a hiatus and some re-evaluation i found out that just adding whatever point to the score total actor attribute worked best with the equation you gave me thanks for challenging me and making me more self sufficient.
Thank you!
Best regards Megaemman