diff --git a/Assets/Animation Clips/MD_HomeownerV2Anims.shanimcontainer.shmeta b/Assets/Animation Clips/MD_HomeownerV2Anims.shanimcontainer.shmeta index 3d33aab3..033bc975 100644 --- a/Assets/Animation Clips/MD_HomeownerV2Anims.shanimcontainer.shmeta +++ b/Assets/Animation Clips/MD_HomeownerV2Anims.shanimcontainer.shmeta @@ -14,13 +14,13 @@ Type: 13 Name: Walk ID: 229189609 Type: 13 -Name: Alerted by Racoon +Name: Alerted_by_Racoon ID: 227890696 Type: 13 -Name: Alerted Idle +Name: Alerted_Idle ID: 234046577 Type: 13 -Name: Alerted Run +Name: Alerted_Run ID: 230172366 Type: 13 Name: Interact @@ -47,21 +47,21 @@ Type: 13 Name: StunEndBack ID: 226668516 Type: 13 -Name: React to Broken Stuff +Name: React_to_Broken_Stuff ID: 228323560 Type: 13 -Name: Pickup Item +Name: Pickup_Item ID: 227002263 Type: 13 -Name: Return Item +Name: Return_Item ID: 222655168 Type: 13 -Name: Attack Windup +Name: Attack_Windup ID: 223078653 Type: 13 -Name: Attack Hold +Name: Attack_Hold ID: 228250554 Type: 13 -Name: Attack Sequence +Name: Attack_Sequence ID: 226129627 Type: 13 diff --git a/Assets/Navigation Data/Level2_NavData.shnav b/Assets/Navigation Data/Level2_NavData.shnav index 745c5688..440dbc2b 100644 Binary files a/Assets/Navigation Data/Level2_NavData.shnav and b/Assets/Navigation Data/Level2_NavData.shnav differ diff --git a/Assets/Navigation Data/Level2_NavData.shnav.shmeta b/Assets/Navigation Data/Level2_NavData.shnav.shmeta index 5b3e895a..56da1b1e 100644 --- a/Assets/Navigation Data/Level2_NavData.shnav.shmeta +++ b/Assets/Navigation Data/Level2_NavData.shnav.shmeta @@ -1,3 +1,3 @@ Name: Level2_NavData -ID: 267663500 +ID: 260674210 Type: 15 diff --git a/Assets/Scenes/Level2.shade b/Assets/Scenes/Level2.shade index f481e842..01a808ae 100644 --- a/Assets/Scenes/Level2.shade +++ b/Assets/Scenes/Level2.shade @@ -1,4 +1,4 @@ -- NavData: 0 +- NavData: 260674210 - EID: 20 Name: ===== Light ===== IsActive: true @@ -5542,19 +5542,61 @@ Position Offset: {x: 0, y: 0.899999976, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true + Navigation Component: + Target: {x: 0, y: 0, z: 0} + Forward: {x: 0, y: 0, z: 0} + Recalculate Path: true + Unreachable Target: false + Tolerance: 1 + Acceptance threshold: 0.100000001 + IsActive: true + Animator Component: + Rig: 76586906 + AnimationController: 0 + IsActive: true Scripts: - - Type: Homeowner1 + - Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.AILineOfSight Enabled: true - waypointsPool: 166 - startWaypoint: 162 - patrolSpeed: 0.75 - chaseSpeed: 2 - turningSpeed: 5 - sightDistance: 8 - eyeOffset: [0, 1.64999998, 0] - distanceToCapture: 0.800000012 - captureTime: 0.5 - footstepSFXIntervalMultiplier: 0.5 + player: 2 + range: 5 + angle: 30 + angleBetween: 0 + distance: 0 + heightLimit: 1 + rayOffset: [0, 0, 0] + withinRange: false + withinSight: false + lastFoundPos: [0, 0, 0] + lastFoundTimer: 0 + - Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.RotateToVelocity + Enabled: true + rotationPerSecond: 5 + active: true + rotateToPlayerLastKnown: false + lookAround: false + - Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.HomeOwnerAI + Enabled: true + idleDuration: 1 + timeoutDuration: 2 + patrolPointParent: 166 + patrolSpeed: 1 + chaseSpeed: 3 + alertCooldown: 0 + player: 2 + attackHitbox: 627 + walkingAnim: 229189609 + idleAnim: 224442713 + alertAnim: 227890696 + alertRunAnim: 230172366 + alertIdleAnim: 234046577 + timeoutAnim: 228323560 + atkWindupAnim: 223078653 + atkHoldAnim: 228250554 + atkSeqAnim: 226129627 + - Type: StateMachine + Enabled: true + currentStateName: "" + currentAnimName: "" - EID: 10 Name: Pause Canvas IsActive: false @@ -5606,7 +5648,7 @@ Components: Transform Component: Translate: {x: 0, y: -300, z: 0} - Rotate: {x: 0.5, y: 1.63842165, z: 0.5} + Rotate: {x: -1.48352981, y: 1.63842165, z: 0.5} Scale: {x: 400, y: 100, z: 500} IsActive: true Renderable Component: @@ -6165,7 +6207,7 @@ Collider Component: Colliders: - Is Trigger: false - Collision Tag: 7 + Collision Tag: 8 Type: Box Half Extents: {x: 10, y: 1, z: 18} Friction: 0.400000006 @@ -9263,6 +9305,15 @@ Density: 1 Position Offset: {x: 0.180000007, y: 0.5, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} + - Is Trigger: false + Collision Tag: 9 + Type: Box + Half Extents: {x: 2, y: 1, z: 0.5} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 0, z: -0.100000001} + Rotation Offset: {x: 0, y: 0.922214508, z: 0} IsActive: true Scripts: ~ - EID: 204 @@ -9299,6 +9350,15 @@ Density: 1 Position Offset: {x: 0.180000007, y: 0.5, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} + - Is Trigger: false + Collision Tag: 9 + Type: Box + Half Extents: {x: 1.5, y: 1, z: 0.5} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0.200000003, y: 0.5, z: 0.300000012} + Rotation Offset: {x: 0, y: 0.448165625, z: 0} IsActive: true Scripts: ~ - EID: 236 @@ -10204,6 +10264,15 @@ Density: 1 Position Offset: {x: -0.474999994, y: 0.600000024, z: 0} Rotation Offset: {x: 0, y: 0, z: 0} + - Is Trigger: false + Collision Tag: 9 + Type: Box + Half Extents: {x: 4.30000019, y: 1.20000005, z: 1.20000005} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 1.5, y: 0.600000024, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} IsActive: true Scripts: ~ - EID: 230 @@ -17060,4 +17129,30 @@ Color Tint: {x: 0.0187467411, y: 0.627120614, z: 0.709251106, w: 1} Acceleration: {x: 0, y: -0.100000001, z: 0} IsActive: true - Scripts: ~ \ No newline at end of file + Scripts: ~ +- EID: 627 + Name: AttackHitbox + IsActive: true + NumberOfChildren: 0 + Components: + Transform Component: + Translate: {x: 0, y: -0.10252738, z: -2.20271254} + Rotate: {x: 0, y: 0, z: 0} + Scale: {x: 1, y: 1, z: 1} + IsActive: true + Collider Component: + Colliders: + - Is Trigger: true + Collision Tag: 5 + Type: Box + Half Extents: {x: 0.600000024, y: 1.79999995, z: 1.5} + Friction: 0.400000006 + Bounciness: 0 + Density: 1 + Position Offset: {x: 0, y: 1, z: 0} + Rotation Offset: {x: 0, y: 0, z: 0} + IsActive: true + Scripts: + - Type: SHADE_Scripting.Gameplay.AIBehaviour.AIRework.HomeOwnerAttackHitbox + Enabled: true + aiGO: 158 \ No newline at end of file diff --git a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs index 3bf3d2d6..acf85953 100644 --- a/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs +++ b/Assets/Scripts/Gameplay/AIBehaviour/AIRework/HomeOwnerAttackHitbox.cs @@ -9,15 +9,29 @@ namespace SHADE_Scripting.Gameplay.AIBehaviour.AIRework { public class HomeOwnerAttackHitbox:Script { - - protected override void onCollisionEnter(CollisionInfo info) + public GameObject aiGO; + protected override void update() { - PlayerController pc = info.GameObject.GetScript(); - HomeOwnerAI ai = GameObject.Parent.GetScript(); - if (pc && ai) + Transform transform = GetComponent(); + Transform aiTransform = aiGO.GetComponent(); + + if(transform) { - Debug.Log("HomeOwnerAttackHitbox: Player caught"); - + transform.GlobalPosition = aiTransform.GlobalPosition; + } + } + + + protected override void onTriggerStay(CollisionInfo info) + { + + PlayerController pc = info.GameObject.GetScript(); + HomeOwnerAI ai = aiGO.GetScript(); + if (pc) + { + pc.GotCaught(); + if(ai) + ai.Reset(); } } diff --git a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs index 74c72239..d82c54ab 100644 --- a/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs +++ b/Assets/Scripts/Gameplay/Player/SC_PlayerController.cs @@ -502,7 +502,7 @@ public class PlayerController : Script } } - private void GotCaught() + public void GotCaught() { if (currentState == RaccoonStates.CAUGHT && tranform && respawnPoint) { diff --git a/SHADE_Engine/src/Navigation/SHNavigationSystem.cpp b/SHADE_Engine/src/Navigation/SHNavigationSystem.cpp index b38453ce..bf0feda0 100644 --- a/SHADE_Engine/src/Navigation/SHNavigationSystem.cpp +++ b/SHADE_Engine/src/Navigation/SHNavigationSystem.cpp @@ -218,6 +218,7 @@ namespace SHADE void SHNavigationSystem::GenerateNavigationGridData() noexcept { + Clear(); GenerateNavigationGridData(origin_editor, size_editor, numRows_editor, numCols_editor); }