Oh I'm browsing through, I'm noticing it doesn't talk about defining variables. I know how to do the basics, though variables have always been something I've struggled with
All the variables below I seem to be struggling to define.
Code: Select all
label battle:
menu:
"Fight":
jump bat_choices
label bat_choices:
if hp == 0:
jump gameover
elif ehp == 0:
jump victory
menu:
"Attack":
jump damage
"Defend":
jump reduced_damage
"First Aid":
jump firstaid
label damage:
n 'You recieve'
$ hp -= 1
n 'damage.'
n 'Rat recieves'
$ ehp -= 1
n 'damage.'
jump battle
label reduced_damage:
n 'You recieve'
$ hp -= 1
n 'damage.'
n 'Rat recieves'
$ ehp -= 1
n 'damage.'
jump battle
label firstaid:
"You healed for"
$ hp += 1
"life points."
jump battle
label gameover:
n "You lost the battle."
return
label victory:
n "You won the battle"
jump start
And this is the error I got.
Code: Select all
File "game/script.rpy", line 2: expected statement.
hp = 10
^
File "game/script.rpy", line 3: expected statement.
atk = 7
^
File "game/script.rpy", line 4: expected statement.
grd = 2
^
File "game/script.rpy", line 6: expected statement.
ehp = 8
^
File "game/script.rpy", line 7: expected statement.
eatk = 3
^
File "game/script.rpy", line 8: expected statement.
egrd = 2
^
File "game/script.rpy", line 11: expected statement.
eDice_hero = [1, 2, 3, 4, 5, 6]
^
File "game/script.rpy", line 12: expected statement.
eDice_hero_2 = [1, 2, 3, 4, 5, 6]
^
File "game/script.rpy", line 13: expected statement.
eDice_hero_3 = [1, 2, 3, 4, 5, 6]
^
File "game/script.rpy", line 14: expected statement.
eDice_hero_4 = [1, 2, 3, 4, 5, 6]
^
File "game/script.rpy", line 15: expected statement.
eDice_monster = [1, 2, 3, 4, 5, 6]
^
File "game/script.rpy", line 18: expected statement.
gold = 0
^
Side-Note: Also noticed an inventory function, Renpy continues to impress me. I'll keep looking through it.
I develop horror romance interactive comics. Currently working on my first.