For the imagemap, I set it up so that when day1_***_inspection = False, the HOVER image is "cleaning_site1_investigation". When it's TRUE, the image changes to "cleaning_site1_investigation2". The intention was to make it so that when a hotspot is clicked, it not only transitions to the respective investigation label but also changes the day1_***_inspection value to TRUE. This way, the next time the cursor hovers over that hotspot, the "cleaning_site1_investigation2" image appears. However, there's a problem.
The actions for IF day1_***_inspection: and the corresponding ELSE are working fine, but the imagemap does not update from "cleaning_site1_investigation" as it should—it remains unchanged. (I also recently noticed that only when all day1_***_inspection values are set to TRUE, then all the HOVER images switch to "cleaning_site1_investigation2".) I have tried changing the code's structure several times to solve this issue, but I haven't been able to resolve it with my current level of expertise. Please, I urgently need help.
Code: Select all
default day1_thick_pipe_ceiling_inspection = False
default day1_left_side_clutter_investigation = False
default day1_outside_investigation = False
# Function to count the number of times a site has been inspected
init python:
day1_cleaning_site_inspection = 0
def increment_inspection():
global day1_cleaning_site_inspection
day1_cleaning_site_inspection += 1
# Define functions to set each variable to True
init python:
def set_day1_thick_pipe_ceiling_inspection_true():
global day1_thick_pipe_ceiling_inspection
day1_thick_pipe_ceiling_inspection = True
def set_day1_left_side_clutter_investigation_true():
global day1_left_side_clutter_investigation
day1_left_side_clutter_investigation = True
def set_day1_outside_investigation_true():
global day1_outside_investigation
day1_outside_investigation = True
screen cleaning_site_investigation_1():
add "cleaning_site1"
if dialogue_active:
$ button_enabled = False
else:
$ button_enabled = True
# Add background image. It is important to place it above 'use clues_menu' so that the buttons work on the background.
if button_enabled and not zone_2:
imagemap:
ground "cleaning_site1"
# Thick pipe
if day1_thick_pipe_ceiling_inspection:
hover "cleaning_site1_investigation2"
hotspot (1129, 299, 621, 256) action NullAction()
else:
hover "cleaning_site1_investigation"
hotspot (1129, 299, 621, 256) action [Function(increment_inspection), Function(set_day1_thick_pipe_ceiling_inspection_true), Jump("day1_thick_pipe_ceiling_inspection")]
# Outside
if day1_outside_investigation:
hover "cleaning_site1_investigation2"
hotspot (1473, 586, 321, 194) action NullAction()
else:
hover "cleaning_site1_investigation"
hotspot (1473, 586, 321, 194) action [Function(increment_inspection), Function(set_day1_outside_investigation_true), Jump("day1_outside_investigation")]
# Clutter on the left side
if day1_left_side_clutter_investigation:
hover "cleaning_site1_investigation2"
hotspot (1009, 707, 438, 163) action NullAction()
else:
hover "cleaning_site1_investigation"
hotspot (1009, 707, 438, 163) action [Function(increment_inspection), Function(set_day1_left_side_clutter_investigation_true), Jump("day1_left_side_clutter_investigation")]