Spaces:
Running
on
Zero
Running
on
Zero
kwabs22
commited on
Commit
·
2c9eb60
1
Parent(s):
fea8c78
Passing variables in workflow
Browse files
app.py
CHANGED
@@ -242,10 +242,12 @@ def generate_story_and_timeline(no_story_timeline_points=10, no_ui_timeline_poin
|
|
242 |
# Pick 10 random UI items
|
243 |
random_ui_items = pick_random_items(player_engagement_items, no_ui_timeline_points)
|
244 |
random_story_items = pick_random_items(story_events, no_story_timeline_points)
|
|
|
245 |
|
246 |
# Generate UI and story timelines
|
247 |
ui_timeline = generate_timeline(random_ui_items, "UI")
|
248 |
story_timeline = generate_timeline(random_story_items, "Story")
|
|
|
249 |
|
250 |
# Initialize merged timeline with UI and story timelines
|
251 |
merged_timeline = ui_timeline + story_timeline
|
@@ -268,6 +270,7 @@ def generate_story_and_timeline(no_story_timeline_points=10, no_ui_timeline_poin
|
|
268 |
|
269 |
# Create the story
|
270 |
story = create_story(merged_timeline)
|
|
|
271 |
|
272 |
# Format the timeline for display
|
273 |
formatted_timeline = "\n".join([f"{entry[0]}: {entry[1]} - {entry[2]}" for entry in merged_timeline])
|
@@ -276,6 +279,8 @@ def generate_story_and_timeline(no_story_timeline_points=10, no_ui_timeline_poin
|
|
276 |
# game_structure_with_media = generate_game_structures(formatted_timeline) #, game_structure_without_media = generate_game_structures(formatted_timeline, no_media_formatted_timeline)
|
277 |
game_structure_with_media = convert_timeline_to_game_structure(formatted_timeline)
|
278 |
|
|
|
|
|
279 |
suggestions, selected_list_names = timeline_get_random_suggestions(num_lists, items_per_list, include_existing_games, include_multiplayer)
|
280 |
|
281 |
return formatted_timeline, story, json.dumps(game_structure_with_media, indent=2), suggestions, selected_list_names #no_media_formatted_timeline, json.dumps(game_structure_without_media, indent=2) #, game_structure_with_media
|
@@ -1172,7 +1177,7 @@ Creating more diverse paths through the game""")
|
|
1172 |
inputs=[ewpwacustom_config, ewpwamediabool],
|
1173 |
outputs=[ewpwaerror_box, ewpwagame_log, ewpwadescription, ewpwachoices, ewpwacustom_config, ewpwagame_session, ewpwamedia]
|
1174 |
)
|
1175 |
-
|
1176 |
with gr.Accordion("Generate a new config", open=False):
|
1177 |
with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
|
1178 |
gr.Markdown("# Story and Timeline Generator")
|
|
|
242 |
# Pick 10 random UI items
|
243 |
random_ui_items = pick_random_items(player_engagement_items, no_ui_timeline_points)
|
244 |
random_story_items = pick_random_items(story_events, no_story_timeline_points)
|
245 |
+
print("simulplay debug - good to here")
|
246 |
|
247 |
# Generate UI and story timelines
|
248 |
ui_timeline = generate_timeline(random_ui_items, "UI")
|
249 |
story_timeline = generate_timeline(random_story_items, "Story")
|
250 |
+
print("simulplay debug - good to here 2")
|
251 |
|
252 |
# Initialize merged timeline with UI and story timelines
|
253 |
merged_timeline = ui_timeline + story_timeline
|
|
|
270 |
|
271 |
# Create the story
|
272 |
story = create_story(merged_timeline)
|
273 |
+
print("simulplay debug - good to here 3")
|
274 |
|
275 |
# Format the timeline for display
|
276 |
formatted_timeline = "\n".join([f"{entry[0]}: {entry[1]} - {entry[2]}" for entry in merged_timeline])
|
|
|
279 |
# game_structure_with_media = generate_game_structures(formatted_timeline) #, game_structure_without_media = generate_game_structures(formatted_timeline, no_media_formatted_timeline)
|
280 |
game_structure_with_media = convert_timeline_to_game_structure(formatted_timeline)
|
281 |
|
282 |
+
print("simulplay debug - good to here 4")
|
283 |
+
|
284 |
suggestions, selected_list_names = timeline_get_random_suggestions(num_lists, items_per_list, include_existing_games, include_multiplayer)
|
285 |
|
286 |
return formatted_timeline, story, json.dumps(game_structure_with_media, indent=2), suggestions, selected_list_names #no_media_formatted_timeline, json.dumps(game_structure_without_media, indent=2) #, game_structure_with_media
|
|
|
1177 |
inputs=[ewpwacustom_config, ewpwamediabool],
|
1178 |
outputs=[ewpwaerror_box, ewpwagame_log, ewpwadescription, ewpwachoices, ewpwacustom_config, ewpwagame_session, ewpwamedia]
|
1179 |
)
|
1180 |
+
with gr.Column(scale=1):
|
1181 |
with gr.Accordion("Generate a new config", open=False):
|
1182 |
with gr.Accordion("Can copy in the Test Example State Machine tab - only linear path for now", open=False):
|
1183 |
gr.Markdown("# Story and Timeline Generator")
|