[Scummvm-tracker] [ScummVM] #10775: QFG4: Resting indoors results in consecutive moonrises
Vhati
trac at scummvm.org
Tue Nov 13 03:30:40 CET 2018
#10775: QFG4: Resting indoors results in consecutive moonrises
--------------------------------+----------------------------
Reporter: Vhati | Owner: (none)
Type: defect | Status: new
Priority: low | Component: Engine: SCI
Resolution: | Keywords: SCI32 original
Game: Quest for Glory 4 |
--------------------------------+----------------------------
Comment (by Vhati):
* global120 - Granular time, for a 3600 unit day (1 hour is 150 units).
* global123 - Simplified time of day, the nth 3-hour span:
6,7,0,1,2,3,4,5. The 6th span is midnight aka "You are getting tired".
Starts do get dark partway through 4. Light again at 0.
* global122 - The nth day (1-based).
* local3 - Influences the sun/moon x pos.
* local4 - Influences the sun/moon y pos.
* local5 - 1 for night, 0 for day.
* timeIcons use View 938 for landscape, sky, sun/moon, with local5
indirectly offsetting their "loop" attribute.
\\
\\
script 7
{{{
(instance showTime of Code
(properties)
(method (init &tmp temp0 temp1 temp2)
# ??? - - - - -
(= temp0 global122)
(if (or (!= global123 6) (> global120 500))
(++ temp0)
)
# ??? - - - - -
(if (>= (= temp2 global120) 2780)
(= temp2 (- temp2 3600))
(= local5 1)
)
(if (<= temp2 820)
(= temp2 (+ temp2 1800))
(= local5 1)
)
(= local3 (/ (= temp2 (- temp2 1800)) 16))
(= local4 (Abs (/ temp2 48)))
(= local3 (+ local3 81))
(timePanel init: show: dispose:)
)
)
}}}
\\
\\
That first if block and temp0 are useless.
\\
\\
{{{
(instance timePanel of PuzzleBar
(properties
state $0000
)
(method (init &tmp temp0 temp1)
(super init: &rest)
(= temp1 0)
(if local5 (= temp1 3))
# Next come a bunch of timeIcons like this.
(self
add:
((timeIcon new:)
nsLeft: (+ local3 12)
x: (+ local3 12)
nsTop: (+ local4 6)
y: (+ local4 6)
cel: 0
loop: (+ 2 temp1)
setPri: 251
init: self
yourself:
)
)
}}}
\\
\\
showTime is exported, and showTime::init() is triggered by UI's hourglass
button (iconTime) in script 20.
Once it discovers night, there's nothing setting local5 to 0 to make it
day again. Except for room transitions. How those are involved is still
mysterious. I couldn't catch "showTime::dispose" with a breakpoint.
Anyway, the correction should be a simple matter of rewriting the useless
bit to reset local5.
--
Ticket URL: <https://bugs.scummvm.org/ticket/10775#comment:6>
ScummVM <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list