sci2-ts 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/lib/996.sc +14 -11
- package/lib/997.sc +5 -3
- package/lib/998.sc +44 -4
- package/package.json +1 -1
- package/packages/content/room.schema.json +5 -0
- package/packages/content/src/room.d.ts +2 -0
- package/packages/content/src/room.js +18 -3
- package/packages/content/src/room.ts +18 -3
- package/packages/sci/src/script/compiler.js +21 -0
- package/packages/sci/src/script/compiler.ts +18 -0
- package/packages/sci/src/vm/kernels/audio.js +4 -0
- package/packages/sci/src/vm/kernels/audio.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ All notable changes to this project. Versions follow [Semantic Versioning](https
|
|
|
4
4
|
and the entries are generated from commit messages
|
|
5
5
|
([Conventional Commits](https://www.conventionalcommits.org/)) when a release is made.
|
|
6
6
|
|
|
7
|
+
## [0.8.1](https://github.com/rlueder/sci-ts/compare/v0.8.0...v0.8.1) (2026-10-02)
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
* timers past 32767 cycles, waits on missing sounds, methods hidden by properties ([#9](https://github.com/rlueder/sci-ts/issues/9)) ([7ec09d7](https://github.com/rlueder/sci-ts/commit/7ec09d765ab2818cf0171d5e96d9fa1b6744b576))
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
* AGENTS.md for people and agents working here ([#8](https://github.com/rlueder/sci-ts/issues/8)) ([42bec1f](https://github.com/rlueder/sci-ts/commit/42bec1fafbb2798b26539923608882fef0c5118d))
|
|
16
|
+
|
|
17
|
+
## [0.8.0](https://github.com/rlueder/sci-ts/compare/v0.7.0...v0.8.0) (2026-10-02)
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
* **content:** poses, idles and prop behaviours ([#7](https://github.com/rlueder/sci-ts/issues/7)) ([1413ca3](https://github.com/rlueder/sci-ts/commit/1413ca334a29255d9a67ca136f01607187e7bee6))
|
|
22
|
+
|
|
7
23
|
## [0.7.0](https://github.com/rlueder/sci-ts/compare/v0.6.1...v0.7.0) (2026-10-01)
|
|
8
24
|
|
|
9
25
|
### Added
|
package/lib/996.sc
CHANGED
|
@@ -100,7 +100,8 @@
|
|
|
100
100
|
(properties
|
|
101
101
|
caller 0
|
|
102
102
|
box 0
|
|
103
|
-
|
|
103
|
+
shownAt 0 ; the game time it went up
|
|
104
|
+
readFor 0 ; how long it stays (-1: until dismissed)
|
|
104
105
|
font -1 ; -1: the textStyle's
|
|
105
106
|
x -1 ; -1: centred
|
|
106
107
|
y 16
|
|
@@ -120,19 +121,21 @@
|
|
|
120
121
|
yourself:))
|
|
121
122
|
(box init:)
|
|
122
123
|
(= talking self)
|
|
123
|
-
(=
|
|
124
|
+
(= shownAt gameTime)
|
|
125
|
+
(= readFor (self readingTime: (String STRING_LENGTH txt))))
|
|
124
126
|
|
|
125
|
-
;;
|
|
126
|
-
;;
|
|
127
|
+
;; Cycles to read a line of n characters: normally two seconds, and more for longer lines;
|
|
128
|
+
;; -1 is until the player dismisses it.
|
|
127
129
|
(method (readingTime n)
|
|
128
130
|
(switch textSpeed
|
|
129
|
-
(TEXT_SLOW (return (+
|
|
130
|
-
(TEXT_FAST (return (+
|
|
131
|
+
(TEXT_SLOW (return (+ 180 (* 5 n))))
|
|
132
|
+
(TEXT_FAST (return (+ 70 (* 2 n))))
|
|
131
133
|
(TEXT_CLICK (return -1))
|
|
132
|
-
(else (return (+
|
|
134
|
+
(else (return (+ 120 (* 3 n))))))
|
|
133
135
|
|
|
136
|
+
;; Time is measured as cycles since, which stays right when gameTime wraps past 32767.
|
|
134
137
|
(method (doit)
|
|
135
|
-
(if (and box (!=
|
|
138
|
+
(if (and box (!= readFor -1) (>= (- gameTime shownAt) readFor)) (self done:)))
|
|
136
139
|
|
|
137
140
|
;; A click, Enter, Space or "." while a line is up dismisses it (and nothing else).
|
|
138
141
|
(method (handleEvent event)
|
|
@@ -174,7 +177,7 @@
|
|
|
174
177
|
(properties
|
|
175
178
|
mouth 0 bust 0 eyes 0 frame 0
|
|
176
179
|
priority 150
|
|
177
|
-
|
|
180
|
+
mouthFor 0) ; cycles the mouth moves for
|
|
178
181
|
|
|
179
182
|
(method (init theMouth theBust theEyes theFrame)
|
|
180
183
|
(= mouth theMouth)
|
|
@@ -198,10 +201,10 @@
|
|
|
198
201
|
(if mouth
|
|
199
202
|
(mouth setCycle: Forward)
|
|
200
203
|
;; About as long as it takes to say: half a second, and two cycles a letter.
|
|
201
|
-
(=
|
|
204
|
+
(= mouthFor (+ 30 (* 2 (String STRING_LENGTH txt))))))
|
|
202
205
|
|
|
203
206
|
(method (doit)
|
|
204
|
-
(if (and mouth (mouth cycler?) (>= gameTime
|
|
207
|
+
(if (and mouth (mouth cycler?) (>= (- gameTime shownAt) mouthFor))
|
|
205
208
|
(mouth setCycle: 0 setCel: 0))
|
|
206
209
|
(super doit:))
|
|
207
210
|
|
package/lib/997.sc
CHANGED
|
@@ -173,18 +173,20 @@
|
|
|
173
173
|
;; (shut) and back to 0.
|
|
174
174
|
(class Blink of Cycle
|
|
175
175
|
(properties
|
|
176
|
-
|
|
176
|
+
restSince 0
|
|
177
|
+
restFor 0)
|
|
177
178
|
|
|
178
179
|
(method (init who)
|
|
179
180
|
(super init: who)
|
|
180
181
|
(self rest:))
|
|
181
182
|
|
|
182
183
|
(method (rest)
|
|
183
|
-
(=
|
|
184
|
+
(= restSince gameTime)
|
|
185
|
+
(= restFor (+ 90 (Random 0 90))))
|
|
184
186
|
|
|
185
187
|
(method (doit &tmp c)
|
|
186
188
|
(if (== (client cel?) 0)
|
|
187
|
-
(if (and (>= gameTime
|
|
189
|
+
(if (and (>= (- gameTime restSince) restFor) (> (self lastCel:) 0))
|
|
188
190
|
(= cycleCnt gameTime)
|
|
189
191
|
(client cel: 1))
|
|
190
192
|
else
|
package/lib/998.sc
CHANGED
|
@@ -207,9 +207,11 @@
|
|
|
207
207
|
(if (not (and noun (messager say: noun verb 0 0 0 modNum)))
|
|
208
208
|
(curRoom doVerb: verb))))
|
|
209
209
|
|
|
210
|
-
;; A Feature drawn with a view: a screen item in the room's plane.
|
|
210
|
+
;; A Feature drawn with a view: a screen item in the room's plane. One that's only there to
|
|
211
|
+
;; look at (rain on a window, a sky) has clickable 0, and clicks go to what's behind it.
|
|
211
212
|
(class View of Feature
|
|
212
213
|
(properties
|
|
214
|
+
clickable 1
|
|
213
215
|
view -1 loop 0 cel 0
|
|
214
216
|
z 0
|
|
215
217
|
priority 0 fixPriority 0
|
|
@@ -230,7 +232,7 @@
|
|
|
230
232
|
(if (not (& signal SIG_HIDDEN)) (UpdateScreenItem self)))
|
|
231
233
|
|
|
232
234
|
(method (onMe theX theY)
|
|
233
|
-
(return (and (not (& signal SIG_HIDDEN)) (IsOnMe theX theY self))))
|
|
235
|
+
(return (and clickable (not (& signal SIG_HIDDEN)) (IsOnMe theX theY self))))
|
|
234
236
|
|
|
235
237
|
(method (hide)
|
|
236
238
|
(|= signal SIG_HIDDEN)
|
|
@@ -364,13 +366,51 @@
|
|
|
364
366
|
(if scaler (scaler dispose:) (= scaler 0))
|
|
365
367
|
(super dispose:)))
|
|
366
368
|
|
|
367
|
-
;; The hero: walks where the player clicks, and goes from room to room.
|
|
369
|
+
;; The hero: walks where the player clicks, and goes from room to room. Standing still
|
|
370
|
+
;; for idleAfter seconds while the player can act, he plays a loop of idleView once (a
|
|
371
|
+
;; puff on the pipe, a glance at a watch), chosen at random, then stands again.
|
|
368
372
|
(class Ego of Actor
|
|
369
|
-
|
|
373
|
+
(properties
|
|
374
|
+
normalView -1 ; the walking view (the first view he's normalized with)
|
|
375
|
+
idleView -1 ; -1: no idles
|
|
376
|
+
idleAfter 8
|
|
377
|
+
stillSince 0 ; the game time he was last busy
|
|
378
|
+
idling 0)
|
|
379
|
+
|
|
380
|
+
;; Back to walking: his walking view, cycling as he moves, turning as he goes, seen.
|
|
370
381
|
(method (normalize)
|
|
382
|
+
(if (== normalView -1) (= normalView view) else (= view normalView))
|
|
383
|
+
(= idling 0)
|
|
371
384
|
(self setLoop: -1 setCycle: Walk show:)
|
|
372
385
|
(return self))
|
|
373
386
|
|
|
387
|
+
(method (doit)
|
|
388
|
+
(super doit:)
|
|
389
|
+
(self checkIdle:))
|
|
390
|
+
|
|
391
|
+
(method (checkIdle)
|
|
392
|
+
(cond
|
|
393
|
+
((== idleView -1) 0)
|
|
394
|
+
;; Busy, or someone else is in charge: no idle, and one under way stops.
|
|
395
|
+
((or mover talking dialog (not (user canInput?)) (and (not idling) (!= view normalView)))
|
|
396
|
+
(if idling (self normalize:))
|
|
397
|
+
(= stillSince gameTime))
|
|
398
|
+
(idling 0)
|
|
399
|
+
((>= (- gameTime stillSince) (* idleAfter 60))
|
|
400
|
+
(= idling 1)
|
|
401
|
+
(= view idleView)
|
|
402
|
+
(self setLoop: (Random 0 (- (NumLoops self) 1)) setCel: 0 setCycle: End self))))
|
|
403
|
+
|
|
404
|
+
;; An idle has played through.
|
|
405
|
+
(method (cue)
|
|
406
|
+
(if idling
|
|
407
|
+
(self normalize:)
|
|
408
|
+
(= stillSince gameTime)))
|
|
409
|
+
|
|
410
|
+
(method (setMotion)
|
|
411
|
+
(if idling (self normalize:))
|
|
412
|
+
(super setMotion: &rest))
|
|
413
|
+
|
|
374
414
|
(method (roomDisposed)
|
|
375
415
|
(self setMotion: 0)
|
|
376
416
|
(DeleteScreenItem self)
|
package/package.json
CHANGED
|
@@ -222,6 +222,11 @@
|
|
|
222
222
|
"moves": {
|
|
223
223
|
"type": "boolean",
|
|
224
224
|
"description": "It walks or floats about in cutscenes (<<walk name x y>>): an Actor instead of a Prop"
|
|
225
|
+
},
|
|
226
|
+
"script": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
229
|
+
"description": "A Script class of the game's: an instance of it runs on the prop, e.g. an ambient behaviour"
|
|
225
230
|
}
|
|
226
231
|
}
|
|
227
232
|
}
|
|
@@ -82,6 +82,8 @@ interface PropSpec {
|
|
|
82
82
|
/** forward: loop the animation forever. */
|
|
83
83
|
cycle?: "forward";
|
|
84
84
|
sightAngle?: number;
|
|
85
|
+
/** A Script class of the game's: an instance of it runs on the prop (ambient behaviour). */
|
|
86
|
+
script?: string;
|
|
85
87
|
}
|
|
86
88
|
export interface CompiledRoom {
|
|
87
89
|
number: number;
|
|
@@ -83,7 +83,9 @@ class SpecChecker {
|
|
|
83
83
|
names.add(name);
|
|
84
84
|
const t = this.map(value, path);
|
|
85
85
|
if (group === "props") {
|
|
86
|
-
this.known(t, path, ["view", "at", "loop", "cel", "cycle", "sightAngle", "moves"]);
|
|
86
|
+
this.known(t, path, ["view", "at", "loop", "cel", "cycle", "sightAngle", "moves", "script"]);
|
|
87
|
+
if (t.script !== undefined && (typeof t.script !== "string" || !/^[A-Z][A-Za-z0-9]*$/.test(t.script)))
|
|
88
|
+
this.fail([...path, "script"], "expected a class name, e.g. Scurry");
|
|
87
89
|
if (t.moves !== undefined && typeof t.moves !== "boolean")
|
|
88
90
|
this.fail([...path, "moves"], "expected true or false");
|
|
89
91
|
this.int(t.view, [...path, "view"], 0, 65535);
|
|
@@ -522,6 +524,14 @@ class RoomCompiler {
|
|
|
522
524
|
return [{ op: "code", code: send(to, [["setCycle", [{ cls: this.target.forwardCycle }]]]) }];
|
|
523
525
|
return fail("expected once or forever");
|
|
524
526
|
}
|
|
527
|
+
case "view":
|
|
528
|
+
arity(2, "hero|<prop> view");
|
|
529
|
+
return [{ op: "code", code: send(who(args[0], false), [["view", [int(args[1], "view", 0, 65535)]], ["setCel", [0]]]) }];
|
|
530
|
+
case "normal":
|
|
531
|
+
arity(1, "hero");
|
|
532
|
+
if (args[0] !== "hero")
|
|
533
|
+
fail("only the hero goes back to normal (walking, turning as he goes)");
|
|
534
|
+
return [{ op: "code", code: send({ global: g.ego }, [["normalize", []]]) }];
|
|
525
535
|
case "stop":
|
|
526
536
|
arity(1, "<prop>");
|
|
527
537
|
return [{ op: "code", code: send(who(args[0], false), [["setCycle", [0]]]) }];
|
|
@@ -564,7 +574,7 @@ class RoomCompiler {
|
|
|
564
574
|
arity(1, "number");
|
|
565
575
|
return [{ op: "code", code: send({ global: g.curRoom }, [["newRoom", [int(args[0], "room", 0, 65535)]]]) }];
|
|
566
576
|
default:
|
|
567
|
-
return fail("unknown command (known: walk, face, wait, hide, show, loop, cel, animate, stop, music, sound, closeup, get, drop, room; and set, if)");
|
|
577
|
+
return fail("unknown command (known: walk, face, wait, hide, show, view, loop, cel, animate, normal, stop, music, sound, closeup, get, drop, room; and set, if)");
|
|
568
578
|
}
|
|
569
579
|
}
|
|
570
580
|
/** Loop music n, unless it's what's playing already. */
|
|
@@ -728,7 +738,12 @@ class RoomCompiler {
|
|
|
728
738
|
for (const name of [...Object.keys(spec.features ?? {}), ...Object.keys(spec.exits ?? {})])
|
|
729
739
|
c.push(...send({ obj: name }, [["init", []]]));
|
|
730
740
|
for (const [name, p] of Object.entries(spec.props ?? {})) {
|
|
731
|
-
c.push(...send({ obj: name }, [
|
|
741
|
+
c.push(...send({ obj: name }, [
|
|
742
|
+
["init", []],
|
|
743
|
+
...(p.cycle === "forward" ? [["setCycle", [{ cls: this.target.forwardCycle }]]] : []),
|
|
744
|
+
// A new instance of the game's Script class, running on the prop.
|
|
745
|
+
...(p.script ? [["setScript", [{ code: ["pushi #new", "push0", `class ${p.script}`, "send 4"] }]]] : []),
|
|
746
|
+
]));
|
|
732
747
|
}
|
|
733
748
|
const polygons = [
|
|
734
749
|
...(spec.walkable ? [[3, spec.walkable]] : []),
|
|
@@ -85,6 +85,8 @@ interface PropSpec {
|
|
|
85
85
|
/** forward: loop the animation forever. */
|
|
86
86
|
cycle?: "forward";
|
|
87
87
|
sightAngle?: number;
|
|
88
|
+
/** A Script class of the game's: an instance of it runs on the prop (ambient behaviour). */
|
|
89
|
+
script?: string;
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
export interface CompiledRoom {
|
|
@@ -186,7 +188,8 @@ class SpecChecker {
|
|
|
186
188
|
names.add(name);
|
|
187
189
|
const t = this.map(value, path);
|
|
188
190
|
if (group === "props") {
|
|
189
|
-
this.known(t, path, ["view", "at", "loop", "cel", "cycle", "sightAngle", "moves"]);
|
|
191
|
+
this.known(t, path, ["view", "at", "loop", "cel", "cycle", "sightAngle", "moves", "script"]);
|
|
192
|
+
if (t.script !== undefined && (typeof t.script !== "string" || !/^[A-Z][A-Za-z0-9]*$/.test(t.script))) this.fail([...path, "script"], "expected a class name, e.g. Scurry");
|
|
190
193
|
if (t.moves !== undefined && typeof t.moves !== "boolean") this.fail([...path, "moves"], "expected true or false");
|
|
191
194
|
this.int(t.view, [...path, "view"], 0, 65535);
|
|
192
195
|
this.point(t.at, [...path, "at"]);
|
|
@@ -622,6 +625,13 @@ class RoomCompiler {
|
|
|
622
625
|
if (args[1] === "forever") return [{ op: "code", code: send(to, [["setCycle", [{ cls: this.target.forwardCycle }]]]) }];
|
|
623
626
|
return fail("expected once or forever");
|
|
624
627
|
}
|
|
628
|
+
case "view":
|
|
629
|
+
arity(2, "hero|<prop> view");
|
|
630
|
+
return [{ op: "code", code: send(who(args[0], false), [["view", [int(args[1], "view", 0, 65535)]], ["setCel", [0]]]) }];
|
|
631
|
+
case "normal":
|
|
632
|
+
arity(1, "hero");
|
|
633
|
+
if (args[0] !== "hero") fail("only the hero goes back to normal (walking, turning as he goes)");
|
|
634
|
+
return [{ op: "code", code: send({ global: g.ego }, [["normalize", []]]) }];
|
|
625
635
|
case "stop":
|
|
626
636
|
arity(1, "<prop>");
|
|
627
637
|
return [{ op: "code", code: send(who(args[0], false), [["setCycle", [0]]]) }];
|
|
@@ -661,7 +671,7 @@ class RoomCompiler {
|
|
|
661
671
|
arity(1, "number");
|
|
662
672
|
return [{ op: "code", code: send({ global: g.curRoom }, [["newRoom", [int(args[0], "room", 0, 65535)]]]) }];
|
|
663
673
|
default:
|
|
664
|
-
return fail("unknown command (known: walk, face, wait, hide, show, loop, cel, animate, stop, music, sound, closeup, get, drop, room; and set, if)");
|
|
674
|
+
return fail("unknown command (known: walk, face, wait, hide, show, view, loop, cel, animate, normal, stop, music, sound, closeup, get, drop, room; and set, if)");
|
|
665
675
|
}
|
|
666
676
|
}
|
|
667
677
|
|
|
@@ -831,7 +841,12 @@ class RoomCompiler {
|
|
|
831
841
|
if (spec.music !== undefined) c.push(...this.playMusic(spec.music));
|
|
832
842
|
for (const name of [...Object.keys(spec.features ?? {}), ...Object.keys(spec.exits ?? {})]) c.push(...send({ obj: name }, [["init", []]]));
|
|
833
843
|
for (const [name, p] of Object.entries(spec.props ?? {})) {
|
|
834
|
-
c.push(...send({ obj: name }, [
|
|
844
|
+
c.push(...send({ obj: name }, [
|
|
845
|
+
["init", []],
|
|
846
|
+
...(p.cycle === "forward" ? [["setCycle", [{ cls: this.target.forwardCycle }]] as [string, Val[]]] : []),
|
|
847
|
+
// A new instance of the game's Script class, running on the prop.
|
|
848
|
+
...(p.script ? [["setScript", [{ code: ["pushi #new", "push0", `class ${p.script}`, "send 4"] }]] as [string, Val[]]] : []),
|
|
849
|
+
]));
|
|
835
850
|
}
|
|
836
851
|
const polygons: [number, [number, number][]][] = [
|
|
837
852
|
...(spec.walkable ? [[3, spec.walkable] as [number, [number, number][]]] : []),
|
|
@@ -95,6 +95,27 @@ export function compileScripts(sources, ctx) {
|
|
|
95
95
|
defined.add(m.name);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
+
// A method named like a property of its object: `x:` sets the property and the method
|
|
99
|
+
// never runs.
|
|
100
|
+
const propertiesOf = (name, seen = new Set()) => {
|
|
101
|
+
if (!name || seen.has(name))
|
|
102
|
+
return new Set(OBJECT_HEADER);
|
|
103
|
+
seen.add(name);
|
|
104
|
+
const c = classes.get(name);
|
|
105
|
+
if (c)
|
|
106
|
+
return new Set([...c.obj.props.map((p) => p.name), ...propertiesOf(c.obj.superName, seen)]);
|
|
107
|
+
return new Set([...OBJECT_HEADER, ...(ctx.externalClass?.(name)?.properties.map((p) => p.name) ?? [])]);
|
|
108
|
+
};
|
|
109
|
+
for (const u of units) {
|
|
110
|
+
for (const o of u.objects) {
|
|
111
|
+
const props = new Set([...o.props.map((p) => p.name), ...propertiesOf(o.superName)]);
|
|
112
|
+
for (const m of o.methods) {
|
|
113
|
+
if (!props.has(m.name))
|
|
114
|
+
continue;
|
|
115
|
+
ctx.onWarning({ message: `method ${m.name}: ${o.name} has a property called ${m.name}, so ${m.name}: sets it and this never runs`, file: u.file, line: m.line });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
98
119
|
const reported = new Set();
|
|
99
120
|
for (const s of project.sent) {
|
|
100
121
|
if (defined.has(s.name) || reported.has(s.name))
|
|
@@ -195,6 +195,24 @@ export function compileScripts(sources: readonly CompileSource[], ctx: CompileCo
|
|
|
195
195
|
for (const m of o.methods) defined.add(m.name);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
+
// A method named like a property of its object: `x:` sets the property and the method
|
|
199
|
+
// never runs.
|
|
200
|
+
const propertiesOf = (name: string | undefined, seen = new Set<string>()): Set<string> => {
|
|
201
|
+
if (!name || seen.has(name)) return new Set(OBJECT_HEADER);
|
|
202
|
+
seen.add(name);
|
|
203
|
+
const c = classes.get(name);
|
|
204
|
+
if (c) return new Set([...c.obj.props.map((p) => p.name), ...propertiesOf(c.obj.superName, seen)]);
|
|
205
|
+
return new Set([...OBJECT_HEADER, ...(ctx.externalClass?.(name)?.properties.map((p) => p.name) ?? [])]);
|
|
206
|
+
};
|
|
207
|
+
for (const u of units) {
|
|
208
|
+
for (const o of u.objects) {
|
|
209
|
+
const props = new Set([...o.props.map((p) => p.name), ...propertiesOf(o.superName)]);
|
|
210
|
+
for (const m of o.methods) {
|
|
211
|
+
if (!props.has(m.name)) continue;
|
|
212
|
+
ctx.onWarning({ message: `method ${m.name}: ${o.name} has a property called ${m.name}, so ${m.name}: sets it and this never runs`, file: u.file, line: m.line });
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
198
216
|
const reported = new Set<string>();
|
|
199
217
|
for (const s of project.sent) {
|
|
200
218
|
if (defined.has(s.name) || reported.has(s.name)) continue;
|
|
@@ -266,6 +266,10 @@ export const audioKernels = {
|
|
|
266
266
|
a.play(soundKey(obj), clip, loop, volume);
|
|
267
267
|
else
|
|
268
268
|
a.startSong(obj, number, loop, volume);
|
|
269
|
+
// Neither an effect nor a song by that number: it has ended already, so the next
|
|
270
|
+
// update reports it and whoever waits for it carries on.
|
|
271
|
+
if (!clip && !a.songs.has(obj))
|
|
272
|
+
vm.setProp(obj, "signal", NOT_PLAYING);
|
|
269
273
|
return 0;
|
|
270
274
|
}
|
|
271
275
|
case 9: // stop
|
|
@@ -274,6 +274,9 @@ export const audioKernels: Record<string, KernelFn> = {
|
|
|
274
274
|
const clip = a.index.effects.get(number);
|
|
275
275
|
if (clip) a.play(soundKey(obj), clip, loop, volume);
|
|
276
276
|
else a.startSong(obj, number, loop, volume);
|
|
277
|
+
// Neither an effect nor a song by that number: it has ended already, so the next
|
|
278
|
+
// update reports it and whoever waits for it carries on.
|
|
279
|
+
if (!clip && !a.songs.has(obj)) vm.setProp(obj, "signal", NOT_PLAYING);
|
|
277
280
|
return 0;
|
|
278
281
|
}
|
|
279
282
|
case 9: // stop
|