G-Wreck OHRRPGCE Game Designer

Joined: 28 Feb 2010 Posts: 32 Location: Oklahoma
|
Posted: Thu Jun 03, 2010 3:35 pm Post subject: Score Keeper |
|
|
Alright, I'm at my wits end writing a script for the Fangame Contest. So far everything is working except for one thing: the score keeper. I just want it to read the value of a global variable and update that value when the player's score changes.
Are there any good example scripts/tutorials that I've missed that could help?
EDIT: My problem is not variable-related, I can handle that, but what I'm having trouble with is getting the score value to show-up/update on screen during gameplay.
EDIT2: Hmm, now that I look at this post with a clear, non-caffeinated head, I guess I should include a script as well.
Code: | plotscript, score, begin
global variable (1,score)
score := 0
show value (score)
if (this stuff happens)
then (increment (score,1))
if (this stuff happens)
then (decrement (score,1))
end |
I'm pretty sure that the variable itself is updating, but if it is, then the show value command isn't. _________________ Syzygy - .01% (Extremely Random Number)
Finishing the main story arcs and gameplay elements before I do anything else. |
|
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Jun 04, 2010 6:22 am Post subject: |
|
|
Correct. The "show value" command only shows the value of the variable at the instant when the "show value" is executed. It does not auto update. I suggest a script like this:
Code: |
if(this stuff happens)
then(increment(score, 1), show value(score))
|
|
|