Not repeatable points...Any Ideas?
kelsobrooks
24 Oct 2013, 17:26Hello;
Just developed and used my first educational quest in the classroom.
Overall a great experience and enjoyable!
Wonder what is the best way to make actions that reward points non-repeatable...?
For example if my students "use key on lock" they get 1 point, but they can do it again and again!
Looking for suggestions and or best practices...
Thanks
Just developed and used my first educational quest in the classroom.
Overall a great experience and enjoyable!

Wonder what is the best way to make actions that reward points non-repeatable...?
For example if my students "use key on lock" they get 1 point, but they can do it again and again!
Looking for suggestions and or best practices...
Thanks
tbritton
24 Oct 2013, 17:37Either in the code section or someplace in the forum there's a library for game scoring.
You could also just use a flag. See the following example for taking an item.
You could also just use a flag. See the following example for taking an item.
if (not GetBoolean(black_bracelet, "score")) {
msg ("You take the bracelet.")
IncreaseScore (5)
SetObjectFlagOn (black_bracelet, "score")
AddToInventory (black_bracelet)
}
else {
msg ("You take the bracelet")
AddToInventory (black_bracelet)
}
HegemonKhan
24 Oct 2013, 18:11If you're using the gamebook mode or online version, I don't know how they work, but for the desktop version in Text Adventure mode, we've got the script:
http://quest5.net/wiki/Firsttime
http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
http://quest5.net/w/index.php?title=Cat ... h#mw-pages (page 2, range: S-Z)
firsttime {
-> // your scripts
} otherwise {
-> // your scripts
}
---------
another script option is to simply use a boolean ("flag"):
<game name="blah">
-> // blah scripts
-> <key_on_lock_completed type="boolean">false</key_on_lock_completed>
-> <score type="int">0</score>
-> // blah scripts
</game>
in the unlock script block, have this:
if (game.key_on_lock_completed = false) {
// these 4 script lines below, and there matching above, might not be correctly done (you'd need to see how they're done, what are the "terms~labels" used and etc)
-> lock.unlocked = true // or maybe it's: lock.locked = false
-> lock.isopen = true
-> game.score = game.score + 1 // or, I guess it's suppose to be: IncreaseScore (1)
-> game.key_on_lock_completed = true
} else if (game.key_on_lock_completed = true) {
-> msg ("You've already completed this task of unlocking the lock with the key")
http://quest5.net/wiki/Firsttime
http://quest5.net/wiki/Category:All_Fun ... t_Commands (page 1, range: A-S)
http://quest5.net/w/index.php?title=Cat ... h#mw-pages (page 2, range: S-Z)
firsttime {
-> // your scripts
} otherwise {
-> // your scripts
}
---------
another script option is to simply use a boolean ("flag"):
<game name="blah">
-> // blah scripts
-> <key_on_lock_completed type="boolean">false</key_on_lock_completed>
-> <score type="int">0</score>
-> // blah scripts
</game>
in the unlock script block, have this:
if (game.key_on_lock_completed = false) {
// these 4 script lines below, and there matching above, might not be correctly done (you'd need to see how they're done, what are the "terms~labels" used and etc)
-> lock.unlocked = true // or maybe it's: lock.locked = false
-> lock.isopen = true
-> game.score = game.score + 1 // or, I guess it's suppose to be: IncreaseScore (1)
-> game.key_on_lock_completed = true
} else if (game.key_on_lock_completed = true) {
-> msg ("You've already completed this task of unlocking the lock with the key")
Liam315
25 Oct 2013, 01:27The "First Time" script is easily the simplest way to achieve what you're after.