I'm digging through seeing how the sword fight at the end of KQ6 is done, and it seems to be quite complicated. The room script number is 750, however it calls another script for the actual fight, script 755 (SwordArrayScript). I'm trying to find where the sounds are triggered. There are three local arrays that make up the battle: local0 (25 variables), local25 (505 variables), and local530 (52 variables). They seem to consist of View resource, cel, loop, Sound resource, and other numbers. These arrays are called by various instances in the same script.
To test this, I tried changing the numbers I thought were sounds to different sound numbers, but after compiling that did nothing in-game. These instances have a single method that calls the arrays with a single parameter. But the methods begin with (at param1). What does the "at" mean in this scenario? These methods pass View information to a public procedure that's used throughout the game called "proc958_0" from script 958. It's obviously manipulating the Views in some way, but I'm not sure how the local arrays fit into the equation and cause the battle to exist on screen timed to the sound effects. I would have just used changeState scripts, but this somehow must have been easier.
Here's SwordArrayScript:
;;; Sierra Script 1.0 - (do not remove this comment)
(script# 755)
(include sci.sh)
(use Main)
(use rm750)
(use ArrayScript)
(use n958)
(use Cycle)
(use Obj)
(public
startFight 0
noDagger 1
cassimaHasDagger 2
fightPart1 3
)
(local
[local0 25] = [7504 4 0 158 136 -4095 3 1 -3968 4000 1 0 -4064 2 -4095 8 1 -3968 750 1 0 -4064 2 -4094 -1]
[local25 505] = [751 4 0 136 144 -4095 2 1 -3968 4000 1 0 -4064 1 -4094 751 7 0 138 137 -3968 4000 1 0 -4064 1 -4095 5 1 -3968 4001 1 0 -4064 1 -4094 -3840 -1 6 23 15 3 -3840 -1 6 23 15 4 -3840 -1 6 23 15 5 7511 0 0 101 156 -4095 3 1 -16 128 751 -3968 4000 1 0 -4064 1 -4094 7511 2 0 106 147 -4095 1 1 -3968 4001 1 0 -4064 1 -4094 7511 1 0 93 151 -4095 3 1 -3968 4002 1 0 -4094 7512 2 0 100 165 -4094 7512 0 0 131 171 -4095 1 1 -3968 4002 1 0 -4094 7515 3 0 149 162 -4095 2 1 -3968 4001 1 0 -4064 1 -4095 6 1 -3968 4000 1 0 -4064 1 -4094 7515 0 0 157 170 -4095 1 1 -3968 4000 1 0 -4064 1 -4094 7515 1 0 152 171 -4095 3 1 -3968 4001 1 0 -4064 1 -4095 5 1 -3968 755 1 0 -4094 7515 2 0 152 174 -4095 3 1 -3968 755 1 0 -4095 8 1 -3968 755 1 0 -4094 7516 0 0 143 158 -4095 2 1 -3968 4002 1 0 -4094 7516 4 0 174 151 -4094 7516 1 0 179 152 -4095 3 1 -3968 4000 1 0 -4064 1 -4094 7517 1 0 171 131 -4095 2 1 -3968 4001 1 0 -4064 1 -4094 7517 0 0 170 139 -4095 3 1 -3968 4001 1 0 -4064 1 -4094 7511 0 0 170 158 -4095 3 1 -3968 4001 1 0 -4064 1 -4094 7511 1 0 162 143 -4095 3 1 -3968 4002 1 0 -4094 7512 0 0 169 156 -4095 1 1 -3968 4002 1 0 -4094 7515 0 0 167 156 -4095 1 1 -3968 4000 1 0 -4064 1 -4094 7515 1 0 161 158 -4095 3 1 -3968 4000 1 0 -4064 1 -4095 5 1 -3968 755 1 0 -4094 7515 2 0 159 159 -4095 3 1 -3968 755 1 0 -4095 8 1 -3968 755 1 0 -4094 7516 0 0 150 143 -4095 2 1 -3968 4002 1 0 -4094 7516 1 0 157 145 -4095 3 1 -3968 40001 1 0 -4064 1 -4094 7517 0 0 156 144 -4095 3 1 -3968 4000 1 0 -4064 1 -4094 7511 0 0 158 163 -4095 3 1 -3968 4001 1 0 -4064 1 -4094 -3840 -1 6 23 15 6 7511 1 0 152 148 -4095 3 1 -3968 4002 1 0 -4094 7512 0 0 159 162 -4095 1 1 -3968 4002 1 0 -4094 -3840 -1 6 23 15 7 -1 -3840 -1 6 23 16 1 7512 1 0 135 171 -4095 3 1 -3968 4001 1 0 -4064 1 -4094 -3840 -1 6 23 16 2 -3840 -1 6 23 16 3 7513 0 0 134 161 -4094 7513 1 0 134 161 -4094 -1]
[local530 52] = [7514 0 0 153 150 -4095 2 1 -3968 751 1 0 -4094 -1 -4092 -3840 -1 1 0 6 1 -3840 -1 1 0 6 2 7513 0 7 159 151 -4094 -3840 -1 1 0 6 3 7513 1 11 159 151 -4094 -3840 -1 1 0 6 4 -1]
)
(instance startFight of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(if (not register)
(gEgo
view: 751
loop: 6
cel: 0
posn: 178 132
setCycle: End self
)
else
(self cue:)
)
)
(1
((ScriptID 750 1)
add: -1 6 23 15 1
add: -1 6 23 15 2
init: self
)
)
(2
((ScriptID 750 3) dispose:)
(if register
(gKq6IconBar disable: 6)
(global2
setScript: (lampStartScr next: fightPart1 yourself:)
)
else
(= next fightPart1)
(self dispose:)
)
)
)
)
)
(instance cassimaHasDagger of Script
(properties)
(method (init)
(super init: &rest)
(gKq6MouseDownHandler add: self)
(gKq6KeyDownHandler add: self)
)
(method (dispose)
(gKq6MouseDownHandler delete: self)
(gKq6KeyDownHandler delete: self)
(super dispose:)
)
(method (changeState newState)
(switch (= state newState)
(0
(gKq6 handsOff:)
((ScriptID 750 6)
view: 753
setLoop: 2
setCycle: Walk
posn: 28 160
setStep: 5 2
setMotion: MoveTo 131 160 self
)
)
(1
(if (global2 script?) (-- state))
(= cycles 2)
)
(2
(gEgo
view: 753
loop: 0
cel: 0
posn: 159 149
setCycle: CT 2 1 self
)
)
(3
(gKq6Messager say: 6 23 15 8 self)
)
(4
((ScriptID 750 6)
view: 753
loop: 1
cel: 0
posn: 140 153
setCycle: CT 3 1 self
)
)
(5
(gGlobalSound2 number: 754 setLoop: 1 play:)
(gEgo cel: 3)
(= ticks 3)
)
(6
((ScriptID 750 1)
add: -1 6 23 15 9
add: -1 6 23 15 10
init: self
)
)
(7
(gEgo setCycle: End self)
((ScriptID 750 6) setCycle: End (ScriptID 750 6))
)
(8
(gKq6Messager say: 6 23 15 11 self)
)
(9)
(10 (= cycles 4))
(11
(proc750_5)
(if (or (not global87) (not (HaveMouse)))
(= seconds 15)
else
(= seconds 8)
)
)
(12 (proc750_5 1) (= cycles 1))
(13
(gKq6 handsOff:)
(gEgo setCycle: Beg self)
)
(14
(gKq6Messager say: 1 0 6 1 self)
)
(15
(gKq6Messager say: 1 0 6 2 self)
)
(16
(global2 setScript: noDagger 0 1)
(self dispose:)
)
(26
(proc750_5 1)
(gKq6 givePoints: 5)
(= cycles 1)
)
(27
(gKq6 handsOff:)
(gEgo
view: 7514
setLoop: 0
cel: 0
posn: 153 150
setCycle: CT 2 1 self
)
)
(28
(gGlobalSound number: 0 stop:)
(gGlobalSound2 number: 0 stop:)
(gGlobalSound2 number: 751 setLoop: 1 play:)
(= cycles 3)
)
(29
(gGlobalSound number: 752 setLoop: -1 play:)
(gEgo setCycle: End self)
)
(30
(gEgo setLoop: 1 cel: 0 setCycle: CT 7 1 self)
)
(31 (gEgo setCycle: End self))
(32
((ScriptID 750 3)
init:
view: 7514
setLoop: 2
posn: 153 150
ignoreActors: 1
addToPic:
)
((ScriptID 750 2) dispose:)
(gEgo
oldScaleSignal: 0
view: 900
loop: 9
cel: 2
setLoop: -1
setPri: -1
scaleSignal: 1
scaleX: 96
scaleY: 96
posn: 164 146
cycleSpeed: 6
moveSpeed: 6
ignoreActors: 1
normal: 1
setCycle: 0
)
(= cycles 2)
)
(33
(gEgo
setLoop: -1
setCycle: Walk
setMotion: MoveTo 120 143 self
)
)
(34
(gEgo
setLoop: 5
setMotion:
MoveTo
((ScriptID 750 6) x?)
(- ((ScriptID 750 6) y?) 2)
self
)
)
(35
(gEgo setLoop: 9 cel: 2)
(= ticks 30)
)
(36
(gEgo
view: 758
setLoop: 0
cel: 0
posn: ((ScriptID 750 6) x?) ((ScriptID 750 6) y?)
normal: 0
)
((ScriptID 750 6) hide:)
(= ticks 30)
)
(37
((ScriptID 750 1)
add: -1 6 23 10 4
add: -1 6 23 10 5
add: -1 6 23 10 6
add: -1 6 23 10 7
init: self
)
)
(38 (gEgo setCycle: End self))
(39
((ScriptID 750 1)
add: -1 6 23 10 8
add: -1 6 23 10 9
add: -1 6 23 10 10
add: -1 6 23 10 11
init: self
)
)
(40
(gEgo setMotion: 0 setCycle: 0)
(gKq6IconBar enable: 6)
(global2 newRoom: 180)
)
)
)
(method (handleEvent pEvent)
(if
(and
(== state 11)
(gUser canInput:)
(gEgo onMe: pEvent)
)
(pEvent claimed: 1)
(gKq6 handsOff:)
(self state: 25 seconds: 0 cycles: 2)
)
(pEvent claimed?)
)
)
(instance startEndingCartoon of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(gKq6 handsOff:)
(gKq6IconBar enable: 6)
(= cycles 2)
)
(1 (= cycles 2))
(2 (global2 newRoom: 740))
)
)
)
(class SwordArrayScript of ArrayScript
(properties
client 0
state $ffff
start 1
timer 0
cycles 0
seconds 0
lastSeconds 0
ticks 0
lastTicks 0
register 0
script 0
caller 0
next 0
value 0
)
(method (play param1 param2 param3)
(gGlobalSound3 number: 0 stop:)
(gGlobalSound3 number: param1 setLoop: param2 play:)
(if param3
(gGlobalSound3 client: param3)
else
(= cycles 1)
)
)
)
(instance lampStartScr of SwordArrayScript
(properties)
(method (at param1)
(return [local0 param1])
)
)
(instance fightPart1 of SwordArrayScript
(properties)
(method (dispose)
(gKq6IconBar enable: 6)
(super dispose: &rest)
)
(method (at param1)
(proc958_0 0 751 7511 7512 7515 7516 7517)
(return [local25 param1])
)
)
(instance knockOutVizier of SwordArrayScript
(properties)
(method (at param1)
(return [local530 param1])
)
)
(instance noDagger of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(proc750_5 1)
(gGlobalSound number: 0 stop:)
(gGlobalSound number: 705 setLoop: 1 play:)
(= cycles 1)
)
(1
(gKq6 handsOff:)
(if (not register)
(gKq6Messager say: 6 23 16 1 self)
else
(= cycles 2)
)
)
(2
(gEgo view: 755 posn: 151 154 setLoop: 0 cel: 6)
(= cycles 8)
)
(3 (gEgo cel: 5) (= cycles 8))
(4
(gEgo
posn: 165 163
view: 7504
setLoop: 6
cel: 0
setCycle: CT 2 1 self
)
)
(5
(gGlobalSound2 number: 0 stop:)
(gGlobalSound2 number: 4002 setLoop: 1 play:)
(gEgo setCycle: End self)
)
(6
(gGlobalSound2 number: 0 stop:)
(gGlobalSound2 number: 971 setLoop: 1 play: self)
)
(7
(if (not register)
((ScriptID 750 1)
add: -1 6 23 16 2
add: -1 6 23 16 3
init: self
)
else
(= cycles 2)
)
)
(8
(if register
(gKq6Messager say: 1 0 6 3 self)
else
(= cycles 2)
)
)
(9
(gEgo
view: 7513
posn: 161 150
setLoop: 0
cel: 0
setCycle: End self
)
(gGlobalSound2 number: 0 stop:)
(gGlobalSound2 number: 4002 setLoop: 1 play:)
)
(10
(gEgo setLoop: 1 cel: 0 setCycle: CT 6 1 self)
)
(11
(gGlobalSound2 number: 0 stop:)
(gGlobalSound2 number: 4006 setLoop: 1 play:)
(gEgo setCycle: End self)
)
(12
(if register
(gKq6Messager say: 1 0 6 4 self)
else
(= cycles 2)
)
)
(13
(if (== ((gInv at: 8) owner?) 870)
(proc0_1 41)
else
(proc0_1 40)
)
)
)
)
)
Here's script 958:
(script# 958)
(include sci.sh)
(public
proc958_0 0
)
(procedure (proc958_0 param1 param2 &tmp temp0 temp1)
(= argc (- argc 2))
(= temp0 0)
(while (<= temp0 argc)
(= temp1 [param2 temp0])
(if param1
(Load param1 temp1)
else
(DisposeScript temp1)
)
(++ temp0)
)
(DisposeScript 958)
)