Skip to content

Commit

Permalink
A bunch of scripting fixes and attempts at being able to interrupt ex…
Browse files Browse the repository at this point in the history
…isting vo when warping.
  • Loading branch information
rdtredinnick committed Dec 18, 2024
1 parent b8fb223 commit 82bf99c
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 119 deletions.
4 changes: 4 additions & 0 deletions Assets/Code/Tablet/Interact/TabletWarpPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ public enum ConnectionState {
[NonSerialized] public ConnectionState IsConnected;
[NonSerialized] public BitSet32 AllowedConnections = new BitSet32(Bits.AllU32);

[NonSerialized] public GameObject Visuals;

private void Awake() {
this.CacheComponent(ref Highlightable);
Highlightable.HighlightCollider.enabled = false;
Visuals = transform.GetChild(0).gameObject;
}

[LeafMember("SetWarpActive")]
Expand Down Expand Up @@ -95,6 +98,7 @@ public enum TabletWarpPointGroup {
static public class TabletWarpUtility {
static public void UpdateWarpActivation(TabletWarpPoint warpPoint) {
warpPoint.Highlightable.HighlightCollider.enabled = warpPoint.CanWarp && warpPoint.IsConnected == TabletWarpPoint.ConnectionState.Connected;
warpPoint.Visuals.SetActive(warpPoint.Highlightable.HighlightCollider.enabled);
}
}
}
136 changes: 134 additions & 2 deletions Assets/Scenes/ExteriorScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -12402,6 +12402,10 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 123300934966727580, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_CastShadows
value: 0
objectReference: {fileID: 0}
- target: {fileID: 572856652932118793, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 108.77301
Expand All @@ -12418,6 +12422,26 @@ PrefabInstance:
propertyPath: m_StaticShadowCaster
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2720031147261870511, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.y
value: 0.189
objectReference: {fileID: 0}
- target: {fileID: 2720031147261870511, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.z
value: -0.15899
objectReference: {fileID: 0}
- target: {fileID: 2720031147261870511, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9962857
objectReference: {fileID: 0}
- target: {fileID: 2720031147261870511, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalRotation.y
value: 0.086109705
objectReference: {fileID: 0}
- target: {fileID: 2720031147261870511, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 9.87968
objectReference: {fileID: 0}
- target: {fileID: 2979857795312976314, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.x
value: -0
Expand Down Expand Up @@ -12470,6 +12494,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.y
value: 180
objectReference: {fileID: 0}
- target: {fileID: 4949455848620837871, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_CastShadows
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5965893825517049101, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
Expand All @@ -12482,6 +12510,30 @@ PrefabInstance:
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6941728528763666768, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.x
value: -0.419
objectReference: {fileID: 0}
- target: {fileID: 6941728528763666768, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.y
value: 0.202
objectReference: {fileID: 0}
- target: {fileID: 6941728528763666768, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.z
value: -0.1609
objectReference: {fileID: 0}
- target: {fileID: 6941728528763666768, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalRotation.w
value: 0.99628574
objectReference: {fileID: 0}
- target: {fileID: 6941728528763666768, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalRotation.y
value: 0.08610896
objectReference: {fileID: 0}
- target: {fileID: 6941728528763666768, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 9.8796
objectReference: {fileID: 0}
- target: {fileID: 6978236146479966051, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: Radius
value: 0.7
Expand Down Expand Up @@ -12562,6 +12614,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.x
value: 107.14
objectReference: {fileID: 0}
- target: {fileID: 8209155609472952416, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_CastShadows
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8544159852637039925, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.y
value: 1.686
Expand All @@ -12578,6 +12634,30 @@ PrefabInstance:
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9221516506141850943, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.x
value: 0.4199
objectReference: {fileID: 0}
- target: {fileID: 9221516506141850943, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.y
value: 0.18999
objectReference: {fileID: 0}
- target: {fileID: 9221516506141850943, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalPosition.z
value: -0.1589
objectReference: {fileID: 0}
- target: {fileID: 9221516506141850943, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalRotation.w
value: 0.9962857
objectReference: {fileID: 0}
- target: {fileID: 9221516506141850943, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalRotation.y
value: 0.086109705
objectReference: {fileID: 0}
- target: {fileID: 9221516506141850943, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 9.87968
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 5163386019926680195, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
- {fileID: 3665020790509402093, guid: 5ea042e3b4ca1d44a9fc01c98b17dfdc, type: 3}
Expand Down Expand Up @@ -16424,6 +16504,10 @@ PrefabInstance:
propertyPath: Connections.Array.data[6]
value:
objectReference: {fileID: 1308555246}
- target: {fileID: 6242734612256736462, guid: 8845031c8df5d7741a16214bb425248d, type: 3}
propertyPath: Connections.Array.data[7]
value:
objectReference: {fileID: 1308555246}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
Expand Down Expand Up @@ -17170,7 +17254,7 @@ Light:
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 2150635519
m_Bits: 4096
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
Expand Down Expand Up @@ -22377,13 +22461,17 @@ PrefabInstance:
propertyPath: m_LocalPosition.z
value: -0.074
objectReference: {fileID: 0}
- target: {fileID: 596762855704421168, guid: 8845031c8df5d7741a16214bb425248d, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1686406579663379329, guid: 8845031c8df5d7741a16214bb425248d, type: 3}
propertyPath: m_Name
value: WarpTarget-Bluff-Back
objectReference: {fileID: 0}
- target: {fileID: 1686406579663379329, guid: 8845031c8df5d7741a16214bb425248d, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2634337146786843516, guid: 8845031c8df5d7741a16214bb425248d, type: 3}
propertyPath: m_LocalScale.y
Expand Down Expand Up @@ -24631,6 +24719,46 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 1533061434}
m_Modifications:
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalPosition.x
value: 0.006
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalPosition.y
value: 0.05
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalPosition.z
value: -0.001
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalRotation.w
value: -0.5178033
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalRotation.x
value: 0.04180197
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalRotation.y
value: -0.8511629
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalRotation.z
value: 0.0751941
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 4.8596
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 117.006
objectReference: {fileID: 0}
- target: {fileID: 3088678066043432964, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 351.398
objectReference: {fileID: 0}
- target: {fileID: 5068428990202231474, guid: 39adb779c10ec644c8b0d2c33bc515a8, type: 3}
propertyPath: m_LocalScale.x
value: 0.86565
Expand Down Expand Up @@ -39798,6 +39926,10 @@ PrefabInstance:
propertyPath: TabletCaseLocation
value:
objectReference: {fileID: 354119139}
- target: {fileID: 6242734612256736462, guid: 8845031c8df5d7741a16214bb425248d, type: 3}
propertyPath: Connections.Array.size
value: 7
objectReference: {fileID: 0}
- target: {fileID: 6242734612256736462, guid: 8845031c8df5d7741a16214bb425248d, type: 3}
propertyPath: Connections.Array.data[1]
value:
Expand Down
41 changes: 17 additions & 24 deletions Assets/_Assets/Data/Scripts/Day1/Day1.leaf
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
@function ScenePrepare
$call PlaceAndRotatePlayerAt(WarpDesk, true)
$call SetAllWarpsActive(false)
$call FadeIn(2.0)

:: StartGame
@trigger SceneReady
@who Player
@once

$set global:level = 1

$call Wait(2)

{@Player} Wow, I can't believe I'm finally here! $[Day1/Tent/Player_1]
$call SetWarpActive(WarpBluff, true)
$call CreateGoal("day1_outside", Warp outside)

{@Player} Wow, I can't believe I'm finally here! $[Day1/Tent/Player_1]
{@Player} Brr. Lola was right though... I should've packed an extra sweater. $[Day1/Tent/Player_2]
{@Player} Alright, time to get focused. Those penguins aren’t gonna research themselves. $[Day1/Tent/Player_3]
{@Player} Step one: Find research tent. Check. $[Day1/Tent/Player_4]
Expand Down Expand Up @@ -47,13 +48,12 @@ $set chapter:hasTalkedToMargo = true
{@Margo} Couldja peek out the front door with me? I can't wait to see who's here! $[Day1/Tent/Margo_12]
{@Margo} Let's skedaddle! Use "Warp" to find the waypoint outside! $[Day1/Tent/Margo_13]

$call CreateGoal("day1_outside", Warp outside)
$call SetWarpActive(WarpBluff, true)

:: WarpedOutsideTent
@trigger AtWarpPoint
@who Player
@when targetObject == "WarpTarget-Bluff"
@interrupt
@once

$call TentDoor->Close()
Expand Down Expand Up @@ -90,7 +90,6 @@ $call SetWarpGroupActive(Rookery, true)

$call CreateGoal("day1_rookery", Warp inside rookery)


:: WarpedToRookery
@trigger AtWarpPoint
@who Player
Expand Down Expand Up @@ -130,7 +129,16 @@ $call CreateGoal("band_purple", Scan penguin with purple band)
:: OnPenguinIdentified
@function TabletIdentified
@when objectType == "BandedPenguin"
@interrupt

$set chapter:identifiedCount + 1
$if chapter:identifiedCount >= 5
$set chapter:allIdentified = true
$call SetWarpActive(WarpBluffBack, true)
$set chapter:finishedObservations = true
$call ClearGoals()
$call CreateGoal("day1_return", Return to tent)
$endif

$if local:objectId == "RedAdelie"
$call CompleteGoal("band_red")
Expand Down Expand Up @@ -158,35 +166,19 @@ $elseif local:objectId == "PurpleAdelie"
$endif

$if chapter:identifiedCount >= 5
$set chapter:allIdentified = true
{@Margo} Great work kid! You've got your 5 penguins, $[Day1/Rookery/1rm20]
{@Player} Awesome. The Fantastic Five! $[Day1/Rookery/1rs10]
{@Player} Or . . . the Fintastic Five. Los Cinco Fintasticos? $[Day1/Rookery/1rs11]
{@Margo} Yikes. You are new, huh? Penguins have flippers, not fins. $[Day1/Rookery/1rm21]
{@Player} Let's head back. It's freezing out here! $[Day1/Rookery/1rs12]
$call TriggerResponse(ObjectiveCompleted)
$endif

:: ObjectiveCompleted
@trigger ObjectiveCompleted
@who Player
@once
@interrupt

$set chapter:finishedObservations = true
$call ClearGoals()

$call Wait(0.3)
$call WarpBluffBack->Activate()
$call SetWarpActive(WarpBluffBack, true)

$call CreateGoal("day1_return", Return to tent)

:: WarpedBackToTent
@trigger AtWarpPoint
@who Player
@when chapter:finishedObservations, targetObject == "WarpTarget-Bluff-Back"
@once
@interrupt

$call Wait(1)
$call TentDoor->Open()
Expand All @@ -202,6 +194,7 @@ $call CreateGoal("day1_upload", Dock Margo to upload data)
@when chapter:finishedObservations, targetObject == "WarpTarget-Desk"
@interrupt

$call TentDoor->Close()
$call CompleteGoal("day1_return")
$call Wait(1)
$call SetWarpActive(WarpDesk, true)
Expand Down Expand Up @@ -231,7 +224,7 @@ $call CompleteGoal("day1_upload")
{@Margo} Yep. Pro tip: invest in a good sleep mask. $[Day1/Tent/1tm26]
{@Margo} See ya tomorrow, kid! $[Day1/Tent/1tm27]

$call FadeOut(1.0)
//$call FadeOut(1.0)
$call Wait(2)

$call LoadNextDay()
Expand Down
Loading

0 comments on commit 82bf99c

Please sign in to comment.