Now that summer vacation is nearing, I'd like to go back to work on "The Hawaii Exorcist," my renpy game that I've put on hiatus. The main reason I stopped was the frustration I had with trying to debug my script, which kept crashing to to an error that I cannot seem to solve. I had other work commitments, and I could not spare the time to comb through for the error. It's about an "if" statement, and I ask your help.
In this game, the choices the character makes define their personality and how others react to him (her?). For example, one of the jokes in the game is whether the characters believe in "Bernard" the purple dinosaur, a kid's show. I start the game with:
$ bernard_affinity = 0
Then, as they do simple actions, I either add or subtract points to this value. During certain times in the game, if this score is high enough, a purple dinosaur will appear out of nowhere (perhaps the main character's imagination, as no one else can see it) and lecture/sing to the character. Here's a sample of the script:
Code: Select all
## First of all, set down the affinity the characters have for the player. How do Samantha and Clayton feel about the main character? Does the main character believe in Bernard the Dinosaur?
$ samantha_affinity = 0
$ alex_affinity = 0
$ bernard_affinity = 0
##[.... other parts of the script edited out for clarity]
##Here is scene that keeps giving me problems. The hero's friend, Samantha, has to study for a test and wants to go home. The hero, who is Samantha's boss, has to decide if he asks Samantha to stay or to go. Here, his choice is to let her go. The problem line in question seems to be " if bernard_affinity = 1: "
label samgo:
show samantha giggle
$ samantha_affinity += 1
if bernard_affinity = 1:
show bernardthedino
with dissolve
b "Remember kids, learn to be considerate! If your friend has to study, let her study."
b "(singing) Studying is so fun, studying is so fun."
b "Merrily merrily merrily merrily"
b "Studying is so fun!"
hide bernardthedino
with dissolve
m "I'd like for you to stay here, but I know you really want to ace that test."
s "Really? How nice of you! I have to study for this test because it's SOOOO hard."
s "Tell me how this turns out. Sorry I couldn't be of much help."
J