Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Score Keeper

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
G-Wreck
OHRRPGCE Game Designer




Joined: 28 Feb 2010
Posts: 32
Location: Oklahoma

PostPosted: Thu Jun 03, 2010 3:35 pm    Post subject: Score Keeper Reply with quote

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.
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Fri Jun 04, 2010 6:22 am    Post subject: Reply with quote

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))
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group