Some code that can't be ported:
Code: Select all
style Hacking_button:
background None
style Hacking_button_text:
font "GUI/Fonts/DIGIRU.ttf"
size 30
kerning 1.0
#background "images/Minigames/HackMinigame/StaticMinigame2.png"
color "#00FA9AE6"
hover_color "#FF0000"
outlines [ (1, "#000000", 0, 0) ]
style Timer_button_text:
font "GUI/Fonts/DIGIRU.ttf"
size 30
kerning 1.0
#background "images/Minigames/HackMinigame/StaticMinigame2.png"
color "#00ADFF2F"
hover_color "#00BFFFFF"
outlines [ (1, "#000000", 0, 0) ]
transform roto_transform (roto_var):
# ATL transform that will rotate our displayables to "roto_var" degrees
rotate roto_var
rotate_pad False
##### The game screen
screen numbers_scr():
# It is better to operate this game with mouse only, so just disable cursor and enter keys
key "K_LEFT" action Hide("nonexistent_screen")
key "K_RIGHT" action Hide("nonexistent_screen")
key "K_UP" action Hide("nonexistent_screen")
key "K_DOWN" action Hide("nonexistent_screen")
key "K_RETURN" action Hide("nonexistent_screen")
key "K_KP_ENTER" action Hide("nonexistent_screen")
##### Timer
#
# It returns "smth" every second and "win" (if all buttons were clicked) or "lose" (if time was up)
if Minigames_Active == 0:
timer 1 action Return("win")
timer 1 action [Return("smth"), If( game_timer>1, If(numbers_buttons[-1]["b_to_show"] == False, Return("win"), SetVariable("game_timer", game_timer-1) ), Return("lose") ) ] repeat True
text "{color=#32CD32}[game_timer]" size 80 xpos 950 ypos 550 style "Timer_button_text"
for each_b in sorted(numbers_buttons, reverse=True):
if each_b["b_to_show"]:
$ text_var = each_b["b_value"]
$ i = each_b["b_number"] - 1
button:
# Will show image if "b_value" was set as file name or displayable.
#background None
#add each_b["b_value"]
# Also it is neccessary to comment out the next 4 lines.
#background "image.png" # Sets button's appearance
text '[text_var]{size=40}.{/size}' size 50 style "Hacking_button_text"
#text '[text_var]{size=40}.{/size}' size 50 align (0.5, 0.55) style "Hacking_button_text"
#xminimum 100 xmaximum 100
#yminimum 100 ymaximum 100
background Transform("images/Minigames/HackMinigame/StaticMinigame2.png",xalign=(0.5),yalign=(0.4))
xysize 100, 100
xpos each_b["b_x_pos"]
ypos each_b["b_y_pos"]
anchor (0.5, 0.5)
action If (i == -1, SetDict(numbers_buttons[each_b["b_number"] ], "b_to_show", False),
If (numbers_buttons[i]["b_to_show"] == False,
SetDict(numbers_buttons[each_b["b_number"] ], "b_to_show", False),
SetVariable("game_timer", game_timer-1) ) ) # Wrong click reduces the time left by 1 second
at roto_transform (renpy.random.randint (0, 10)*3)
# It might be usefull to show the order of buttons to click if it's not obvious.
#side "c b":
frame:
area (650, 850, 640, 70) # The size of hint's area
background None
#viewport id "vp":
#draggable True
hbox:
xalign 0.5
# The same buttons declaration, but they will be scaled down
for each_b in numbers_buttons:
$ text_var = each_b["b_value"]
button:
# Will show image if "b_value" was set as file name or displayable.
#background None
#add each_b["b_value"]
# Also it is neccessary to comment out the next 4 lines.
#background "image.png" # Sets button's appearance
background Transform("images/Minigames/HackMinigame/StaticMinigame2.png",xalign=(0.5),yalign=(0.4))
text '[text_var]{size=18}.{/size}' size 50 style "Hacking_button_text"
xminimum 100 xmaximum 100
yminimum 100 ymaximum 100
action If (each_b["b_to_show"], Hide("nonexistent_screen"), None)
at Transform(zoom=0.9) # Size
#bar:
# value time_start
# range game_timer
# xalign 0.5
# xmaximum 300
# if time_start < (game_timer * 0.75):
# left_bar "#f00"
#bar value XScrollValue("vp")
#init:
##### Images
#image img1 = "img1.png"
#image img2 = "img2.png"
label Hack_Numbers_Game:
call HideForScenes from _call_HideForScenes_12
#####
#
# At first, let's set the values for buttons
$ time_start = 0.7
$ numbers_buttons = []
$ buttons_values = [renpy.random.randint (1, 20)]
# This might be numbers,
# or letters,
# $ buttons_values = [u"а", u"б", u"в", u"г", u"д", u"е", u"ё", u"ж", u"з", u"и", u"й", u"к", u"л", u"м", u"н", u"о", u"п", u"р", u"с", u"т", u"у", u"ф", u"х", u"ц", u"ч", u"ш", u"щ", u"ъ", u"ы", u"ь", u"э", u"ю", u"я" ]
python:
for i in range (1, renpy.random.randint (5, 7) ):
buttons_values.append (str(i) )
show HalfGreen
with dissolve
show PhoneNoIcons:
yalign 0.5
xalign 0.5
show HackAnimImg:
yalign 0.5
xalign 0.5
xzoom 0.6
yzoom 0.7
with easeinleft
# or images,
#$ buttons_values = ["img1", "img2", "my_img.png"]
# This will make the description for all buttons (numbers, values and positions)
python:
for i in range (0, len(buttons_values)):
numbers_buttons.append ( {"b_number":i, "b_value":buttons_values[i], "b_x_pos":(renpy.random.randint (10, 70))*10, "b_y_pos":(renpy.random.randint (15, 50))*10, "b_to_show":True} )
#"To win the game - click all the buttons one after another (start from \"1\")."
# Before start the game, let's set the timer
$ game_timer = 20
# Shows the game screen
show screen numbers_scr
# The loop will exist untill game screen returns win or lose
label loop:
$ result = ui.interact()
$ game_timer = game_timer
if result == "smth":
jump loop
if result == "lose":
hide screen numbers_scr
$ renpy.pause (0.1, hard = True)
$ renpy.pause (0.1, hard = True)
$ renpy.pause (0.1, hard = True)
$ renpy.pause (0.1, hard = True)
show screen QTE_press_button_Bad
with hpunch
hide PhoneNoIcons
hide HackAnimImg
with easeoutleft
return
if result == "win":
hide screen numbers_scr
$ renpy.pause (0.1, hard = True)
$ renpy.pause (0.1, hard = True)
$ renpy.pause (0.1, hard = True)
$ renpy.pause (0.1, hard = True)
hide PhoneNoIcons
hide HackAnimImg
with easeoutleft
if Area == "Liz' Flat" and Liz_SearchFlatComputer_HACK == 1:
show screen Liz_FlatSearch_HackedMessage1
$ Liz_SearchFlatComputer_HACK = 2
if Area == "My Bedroom" and MCRoom_Search_FirstCode_HACK == 2 and MCRoom_Search_UFAttackPlan1_HACK == 0:
show screen Transmission1_UF_AttackPlan1
$ MCRoom_Search_UFAttackPlan1_HACK = 2
if Area == "My Bedroom" and MCRoom_Search_FirstCode_HACK == 0:
show screen MCRoom_FirstCode_HackedMessage1
$ MCRoom_Search_FirstCode_HACK = 2
if Area == "Staff Room" and StaffRoom_Search_GoldGatePlan1_HACK == 0:
show screen Transmission1_GoldGate_Plan1
$ StaffRoom_Search_GoldGatePlan1_HACK = 2
if Area == "College Classroom" and Classroom_Search_GoldGateArchitect1_HACK == 0:
show screen Transmission1_GoldGateFuture_Plan2
$ Classroom_Search_GoldGateArchitect1_HACK = 2
if Area == "Gym" and MCRoom_Search_UFWarStart1_HACK == 0:
show screen Transmission1_UF_War1
$ MCRoom_Search_UFWarStart1_HACK = 2
if Area == "Room" and Patreon_BrendaKateOF04_Hack == 0 and Kate_ExamBJEvent1 >= 1:
$ Patreon_BrendaRoughZIM_07_Hack = 1
jump SubstarComm1_0523_3someOF
if Area == "Living Room" and Patreon_BrendaKate4Some0623_Hack == 0 and Holiday_Events == 3:
$ Patreon_BrendaKate4Some0623_Hack = 1
jump SubstarComm2_0623_4some_intro
if Area == "Master Bedroom" and Patreon_BrendaRoughZIM_07_Hack == 0 and Brenda_Beach_Quest1 >= 1:
$ Patreon_BrendaRoughZIM_07_Hack = 1
jump Zim_Rough_Brenda_Commission_1
if Area == "Kitchen" and Patreon_BrendaJaneCoffeehZIM_08_Hack == 0 and Brenda_Beach_Quest1 >= 1:
$ Patreon_BrendaJaneCoffeehZIM_08_Hack = 1
jump ZIMCoffee_2022_08
if Area == "Upper Hall" and Patreon_BrendaJaneTrissDreamhZIM_10_Hack == 0 and Brenda_Beach_Quest1 >= 1:
$ Patreon_BrendaJaneTrissDreamhZIM_10_Hack = 1
jump BrendaJaneTrissDreamZIMM1022
return
This script produces this error when trying to run in game:
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "game/script.rpy", line 730, in script call
$ renpy.pause(hard=True)
File "game/Characters/Liz/CH_1/Liz_CH1_LizRoom.rpy", line 53, in script call
call race_game from _call_race_game
File "game/script.rpy", line 809, in script call
call Call_Story_Variables_Jumper from _call_Call_Story_Variables_Jumper_4
File "game/Interactables/MCRoom.rpy", line 81, in script call
call Call_Story_Variables_Jumper from _call_Call_Story_Variables_Jumper_2
File "game/script.rpy", line 730, in script call
$ renpy.pause(hard=True)
File "game/Minigames/F3Hacking.rpy", line 207, in script
$ result = ui.interact()
File "game/Minigames/F3Hacking.rpy", line 207, in <module>
$ result = ui.interact()
File "game/Minigames/F3Hacking.rpy", line 58, in execute
screen numbers_scr():
File "game/Minigames/F3Hacking.rpy", line 58, in execute
screen numbers_scr():
File "game/Minigames/F3Hacking.rpy", line 78, in execute
for each_b in sorted(numbers_buttons, reverse=True):
File "game/Minigames/F3Hacking.rpy", line 78, in <module>
for each_b in sorted(numbers_buttons, reverse=True):
TypeError: '<' not supported between instances of 'RevertableDict' and 'RevertableDict'
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "game/script.rpy", line 730, in script call
$ renpy.pause(hard=True)
File "game/Characters/Liz/CH_1/Liz_CH1_LizRoom.rpy", line 53, in script call
call race_game from _call_race_game
File "game/script.rpy", line 809, in script call
call Call_Story_Variables_Jumper from _call_Call_Story_Variables_Jumper_4
File "game/Interactables/MCRoom.rpy", line 81, in script call
call Call_Story_Variables_Jumper from _call_Call_Story_Variables_Jumper_2
File "game/script.rpy", line 730, in script call
$ renpy.pause(hard=True)
File "game/Minigames/F3Hacking.rpy", line 207, in script
$ result = ui.interact()
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\ast.py", line 823, in execute
renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\python.py", line 1178, in py_exec_bytecode
exec(bytecode, globals, locals)
File "game/Minigames/F3Hacking.rpy", line 207, in <module>
$ result = ui.interact()
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\ui.py", line 301, in interact
rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 2165, in interact
repeat, rv = self.interact_core(preloads=preloads, trans_pause=trans_pause, pause=pause, pause_start=pause_start, pause_modal=pause_modal, **kwargs) # type: ignore
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 2687, in interact_core
root_widget.visit_all(lambda d : d.per_interact())
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\displayable.py", line 431, in visit_all
d.visit_all(callback, seen)
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\displayable.py", line 431, in visit_all
d.visit_all(callback, seen)
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\displayable.py", line 431, in visit_all
d.visit_all(callback, seen)
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\screen.py", line 480, in visit_all
callback(self)
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\core.py", line 2687, in <lambda>
root_widget.visit_all(lambda d : d.per_interact())
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\screen.py", line 491, in per_interact
self.update()
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\display\screen.py", line 697, in update
self.screen.function(**self.scope)
File "game/Minigames/F3Hacking.rpy", line 58, in execute
screen numbers_scr():
File "game/Minigames/F3Hacking.rpy", line 58, in execute
screen numbers_scr():
File "game/Minigames/F3Hacking.rpy", line 78, in execute
for each_b in sorted(numbers_buttons, reverse=True):
File "game/Minigames/F3Hacking.rpy", line 78, in <module>
for each_b in sorted(numbers_buttons, reverse=True):
File "C:\Users\Robin\Documents\Renpy\renpy-7.3.5-sdk\renpy\revertable.py", line 277, in revertable_sorted
return RevertableList(sorted(*args, **kwargs))
TypeError: '<' not supported between instances of 'RevertableDict' and 'RevertableDict'
Windows-10-10.0.19045 AMD64
Ren'Py 8.2.1.24030407
0.2
Wed Apr 17 00:18:58 2024
I have issues with the other minigames as well. I may post them after this OP but don't want to overload the thread. Thanks for any help!