diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-10 20:09:42 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-10 20:09:42 -0500 |
commit | c25ab2537cb201dc46b7c1d375dd1c12411fe85c (patch) | |
tree | 1b96b9054585390abbc99277572a77a3248f2cde /res | |
parent | 05ee221cd31a782b699cc6d62e0d275364cfd7cc (diff) | |
download | tanetane-c25ab2537cb201dc46b7c1d375dd1c12411fe85c.tar.gz tanetane-c25ab2537cb201dc46b7c1d375dd1c12411fe85c.tar.bz2 tanetane-c25ab2537cb201dc46b7c1d375dd1c12411fe85c.zip |
Player movement/input is halted during cutscenes
Diffstat (limited to 'res')
-rw-r--r-- | res/scripts/common.lua | 11 | ||||
-rw-r--r-- | res/scripts/default.lua | 2 | ||||
-rw-r--r-- | res/scripts/script0001.lua | 1 | ||||
-rw-r--r-- | res/scripts/test_trigger.lua | 1 |
4 files changed, 14 insertions, 1 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 1841662..b540548 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
@@ -25,6 +25,13 @@ CharacterState = { | |||
25 | RUNNING = 3 | 25 | RUNNING = 3 |
26 | } | 26 | } |
27 | 27 | ||
28 | function StartCutscene() | ||
29 | local playerId = getPlayerSprite() | ||
30 | local playerSprite = getSprite(playerId) | ||
31 | playerSprite.controllable = false | ||
32 | character():halt(playerId) | ||
33 | end | ||
34 | |||
28 | function DisplayMessage(msg, name, type) | 35 | function DisplayMessage(msg, name, type) |
29 | message():displayMessage(msg, name, type) | 36 | message():displayMessage(msg, name, type) |
30 | end | 37 | end |
@@ -38,6 +45,10 @@ end | |||
38 | function HideCutsceneBars() | 45 | function HideCutsceneBars() |
39 | WaitForEndOfMessage() | 46 | WaitForEndOfMessage() |
40 | message():hideCutsceneBars() | 47 | message():hideCutsceneBars() |
48 | |||
49 | local playerId = getPlayerSprite() | ||
50 | local playerSprite = getSprite(playerId) | ||
51 | playerSprite.controllable = true | ||
41 | end | 52 | end |
42 | 53 | ||
43 | function SetAnimation(spriteName, animName) | 54 | function SetAnimation(spriteName, animName) |
diff --git a/res/scripts/default.lua b/res/scripts/default.lua index 6188c36..936a543 100644 --- a/res/scripts/default.lua +++ b/res/scripts/default.lua | |||
@@ -1,5 +1,5 @@ | |||
1 | function default() | 1 | function default() |
2 | StartCutscene() | ||
2 | DisplayMessage("No problem here.", "", SpeakerType.NONE) | 3 | DisplayMessage("No problem here.", "", SpeakerType.NONE) |
3 | WaitForEndOfMessage() | ||
4 | HideCutsceneBars() | 4 | HideCutsceneBars() |
5 | end | 5 | end |
diff --git a/res/scripts/script0001.lua b/res/scripts/script0001.lua index fcf7029..e5078f2 100644 --- a/res/scripts/script0001.lua +++ b/res/scripts/script0001.lua | |||
@@ -1,4 +1,5 @@ | |||
1 | function script0001() | 1 | function script0001() |
2 | StartCutscene() | ||
2 | SetAnimation("boney", "barking") | 3 | SetAnimation("boney", "barking") |
3 | local barkingNoise = LoopSound("barking_at_hallucination.wav") | 4 | local barkingNoise = LoopSound("barking_at_hallucination.wav") |
4 | 5 | ||
diff --git a/res/scripts/test_trigger.lua b/res/scripts/test_trigger.lua index cd64fb8..58325e5 100644 --- a/res/scripts/test_trigger.lua +++ b/res/scripts/test_trigger.lua | |||
@@ -1,4 +1,5 @@ | |||
1 | function test_trigger() | 1 | function test_trigger() |
2 | StartCutscene() | ||
2 | PlaySound("boney_growl.wav") | 3 | PlaySound("boney_growl.wav") |
3 | DisplayMessage("Hi! Welcome to the funky zone.", "", SpeakerType.NONE) | 4 | DisplayMessage("Hi! Welcome to the funky zone.", "", SpeakerType.NONE) |
4 | WaitForEndOfMessage() | 5 | WaitForEndOfMessage() |