I wrote the above from memory, and it looks like I got it a bit messed up. It's still more or less the same problem, but it's not in the Trial:init that's causing the problem. Trial:init calls a procedure from another script, that that's the one I'm seeing the problem in.
Trial:init
(method (init &tmp parseStr)
(Bset IN_SHAPEIR)
(= highHunk (if (>= (MemoryInfo TotalHunk) 17408) TRUE else FALSE))
(= systemWindow sfWin)
(= customWindow cWin)
(= ego egoObj)
(= gEgoBase egoBase)
(= version {x.yyy____})
(= waitCursor HAND_CURSOR)
(StatusLine code: (= dftStatusCode statLn))
; Make sure some important modules are loaded in.
;CI: NOTE: This bit here looks suspect... unlike any other SSCI code I've seen.
; ... shouldn't these be in brackets? or assigned to tmp variables or something?
Cycle
StopWalk
DCIcon
Window
TheMenuBar
HandsOffScript
TopWindow
TargActor
(LoadBaseScripts INTRFACE LOADMANY SAVE SIGHT SORTCOPY QG2_DIALOG QG2_EVENTS QG2_TALKER)
;EO: According to SCI16's KERNEL.SH, kernel function 122 is Lock, but it is not in VOCAB.999
;CI: see http://scicompanion.com/Documentation/Kernels/Lock.html?highlight=lock
(kernel_122 RES_TEXT MAIN TRUE)
(kernel_122 RES_TEXT QG2_COMMONTEXT TRUE)
(kernel_122 RES_TEXT MENU TRUE)
(super init:)
;init common handlers
((= keyDownHandler keyH) add:)
((= mouseDownHandler mouseH) add:)
((= directionHandler dirH) add:)
(= useSortedFeatures TRUE)
(= ftrInitializer ftrInitCode)
(= musicChannels (DoSound NumVoices)) ;CI: NOTE: this gets done in the SetGraphicsSoundInit function anyway.
(= doVerbCode HQVerbCode)
(= egoWalk egoW)
(= egoStopWalk egoSW)
(= egoGrooper egoGL)
(= errorLog errLog)
;set up spell casting code segments
(= codeCastSpells (= codeCastDefaultSpells defaultSpellCast))
(= codeCastAllSpells allSpellCast)
(= codeCastNoSpells noSpellCast)
;init common music samples
((= cSound cMusic) number: 10 owner: self init:)
(= cIcon deathIcon)
((= miscSound miscMusic) number: 10 owner: self init:)
((= spareSound spareMusic) number: 10 owner: self init:)
(SetGraphicsSoundInit) ;calls Script 2, procedure 0.
(= parseStr {*})
(StrAt parseStr 0 0)
(User
alterEgo: ego
prompt: parseStr
blocks: 0
y: 160
verbMessager: verbWords
)
(TheMenuBar init:)
(HandsOn 1)
(= possibleScore 100)
(Printf {possible Score1: %d} possibleScore)
(= startingRoom (SetGameInit)) ;calls Script 2, procedure 1.
(= possibleScore 10)
(Printf {possible Score2: %d} possibleScore)
(theGame newRoom: QG2_SPEEDCHECK)
;the first room we go to is room 98: the SpeedCheck Room.
)
Script 2, procedure 1
(procedure (SetGameInit &tmp nextRoom skill)
;turn on debug by default
;CI: NOTE: This is kinda weird. If I don't explicitly set the suckBlueFrog to FALSE right here, none of the following variables get set properly
;, and the game glitches out when the hero gets low on stamina shortly thereafter.
;(= suckBlueFrog FALSE)
(= deathMusic 10)
(= showStyle HWIPE)
(= possibleScore 500)
(Printf {possible Score(SetGameInit): %d} possibleScore)
(= userFont 300)
(= smallFont 999)
(= bigFont 300)
(= timerStamina 20)
(= timerHealth 15)
(= timerMana 5)
(Bset SAVE_ENABLED)
(= currentDay 1)
(SetGameTime 8)
(= sillyClowns clownsOff)
(= arcadeDifficultyLevel arcadeNormal)
(= gameTimeScale timeNormal)
(= nextRoom 0)
(if (and suckBlueFrog TRUE)
(= skill 0)
(while (< skill NUM_ATTRIBS)
(= [egoStats skill] 80)
(++ skill)
)
(= [egoStats EXPER] 1900)
(= [egoStats HEALTH] (GetMaxHealth))
(= [egoStats STAMINA] (GetMaxStamina))
(= [egoStats MANA] (GetMaxMana))
(= [invNum iGold] 100)
(= [invNum iRations] 10)
(= [invNum iWaterskin] 1)
(= currentWater 10)
(StrCpy @userName {Hero})
(Bset fInMainGame)
(= nextRoom (BlueFrogTP))
else
(Bclr fInMainGame)
)
(if (not nextRoom)
(if (GameIsRestarting)
(= nextRoom rOpeningScroll)
else
(= nextRoom rPiracyNotice)
)
)
(return nextRoom)
)
Script Dissassembly for Script 2, Procedure 1.
// EXPORTED procedure #1 (SetGameInit)
(procedure proc_0099
0099:3f 02 link 2 // (var $2)
009b:35 0a ldi a
009d:a0 009b sag deathMusic
00a0:35 00 ldi 0
00a2:a1 11 sag showStyle
00a4:34 01f4 ldi 1f4
00a7:a1 10 sag possibleScore
00a9:7a push2
00aa:74 109f lofss $114c // possible Score(SetGameInit): %d
00ad:89 10 lsg possibleScore
00af:46 00ff 0004 04 calle ff procedure_0004 4 // Printf
00b5:34 012c ldi 12c
00b8:a1 16 sag userFont
00ba:34 03e7 ldi 3e7
00bd:a1 17 sag smallFont
00bf:34 012c ldi 12c
00c2:a1 1a sag bigFont
00c4:35 14 ldi 14
00c6:a0 0081 sag timerStamina
00c9:35 0f ldi f
00cb:a0 0082 sag timerHealth
00ce:35 05 ldi 5
00d0:a0 009c sag timerMana
00d3:78 push1
00d4:78 push1
00d5:47 01 07 02 calle 1 procedure_0007 2 // Bset
00d9:35 01 ldi 1
00db:a1 6e sag currentDay
00dd:78 push1
00de:39 08 pushi 8 // $8 underBits
00e0:40 0809 02 call proc_08ed 2
00e4:35 00 ldi 0
00e6:a0 00b4 sag sillyClowns
00e9:35 02 ldi 2
00eb:a0 0129 sag arcadeDifficultyLevel
00ee:35 01 ldi 1
00f0:a0 00a5 sag gameTimeScale
00f3:35 00 ldi 0
00f5:a5 00 sat temp0
00f7:81 65 lag suckBlueFrog
00f9:31 65 bnt code_0160
00fb:35 01 ldi 1
00fd:31 61 bnt code_0160
00ff:35 00 ldi 0
0101:a5 01 sat temp1
code_0103
0103:8d 01 lst temp1
0105:35 1e ldi 1e
0107:22 lt?
0108:31 0b bnt code_0115
010a:39 50 pushi 50 // $50 title
010c:85 01 lat temp1
010e:b0 023b sagi egoStats
0111:c5 01 +at temp1
0113:33 ee jmp code_0103
code_0115
0115:34 076c ldi 76c
0118:a0 024a sag global586
011b:76 push0
011c:45 04 00 callb procedure_0004 0 // GetMaxHealth
011f:a0 024b sag gHealth_3
0122:76 push0
0123:45 02 00 callb procedure_0002 0 // GetMaxStamina
0126:a0 024c sag gStamina_2
0129:76 push0
012a:45 03 00 callb procedure_0003 0 // GetMaxMana
012d:a0 024d sag gMana
0130:35 64 ldi 64
0132:a0 0161 sag gTheInvNum_2
0135:35 0a ldi a
0137:a0 0153 sag global339
013a:35 01 ldi 1
013c:a0 0175 sag numWaterskins
013f:35 0a ldi a
0141:a0 0083 sag currentWater
0144:7a push2
0145:5a 0000 029f lea 0 29f
014a:36 push
014b:74 0f6d lofss $10bb // Hero
014e:43 47 04 callk StrCpy 4
0151:78 push1
0152:7a push2
0153:47 01 07 02 calle 1 procedure_0007 2 // Bset
0157:76 push0
0158:40 0ae3 00 call proc_0c3f 0
015c:a5 00 sat temp0
015e:33 06 jmp code_0166
code_0160
0160:78 push1
0161:7a push2
0162:47 01 08 02 calle 1 procedure_0008 2 // Bclr
code_0166
0166:85 00 lat temp0
0168:18 not
0169:31 12 bnt code_017d
016b:76 push0
016c:43 2c 00 callk GameIsRestarting 0
016f:31 07 bnt code_0178
0171:34 02fd ldi 2fd
0174:a5 00 sat temp0
0176:33 05 jmp code_017d
code_0178
0178:34 02fc ldi 2fc
017b:a5 00 sat temp0
code_017d
017d:85 00 lat temp0
017f:48 ret
)
And the outputs I see are:
possible Score1: 100
possible Score(SetGameInit): 100
possible Score2: 10