Code: Select all
init python:
def get_achievement(ach_id, trans=achievement_transform):
ach = persistent.achievements_dict[ach_id]
achievement.grant(ach_id)
renpy.show_screen(_screen_name='scr_achievement_get', title=ach['title'],
a_text=ach['text'], icon=ach['icon'], trans=trans)
def update_achievement(ach_id, to_add=1, trans=achievement_transform):
persistent.achievements_dict[ach_id]["cur_prog"] += to_add
ach = persistent.achievements_dict[ach_id]
achievement.progress(ach_id, to_add)
if ach['cur_prog'] > ach['max_prog']:
persistent.achievements_dict[ach_id]["cur_prog"] = ach['max_prog']
ach = persistent.achievements_dict[ach_id]
renpy.show_screen(_screen_name='scr_achievement_update', title=ach['title'], a_text=ach['text'],
icon=ach['icon'], cur_prog=ach['cur_prog'], max_prog=ach['max_prog'], trans=trans)
# Define achievements here
if not persistent.achievements_dict:
persistent.achievements_dict = { #(All the one time achievements were here but I took them out to save space)
"Damsel": {"type": 1, # Progress achievement One
"title": "Damsel",
"text": "Got every possible rescue in week one.",
"icon": "achieve2small.jpg",
"cur_prog": 0, # current progress
"max_prog": 9# maximal progress
}
"EmoKid": {"type": 1, # Progress achievement Two
"title": "Emo Kid",
"text": "All the Bad Ends",
"icon": "achieve2small.jpg",
"cur_prog": 0, # current progress
"max_prog": 11# maximal progress
}
}
for i, a in persistent.achievements_dict.items():
if a['type'] == 0:
achievement.register(i, steam=a['title'])
if a['type'] == 1:
achievement.register(i, steam=a['title'], stat_max=a['max_prog'])
invalid syntax (for the line of code that begins the second extended achievement) "EmoKid" ->: {"type": 1,
I am pretty sure all the lines are the same other than the variables in names. So I'm confused as to how the syntax is invalid. I'd appreciate any help.