Added Attack animation, Fix Edge case for path finding. Added footsteps. Level 2 merge #444

Merged
maverickdgg merged 7 commits from Navigation into main 2023-03-25 16:54:30 +08:00
7 changed files with 143 additions and 33 deletions
Showing only changes of commit 485d8cc38b - Show all commits

View File

@ -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

View File

@ -1,3 +1,3 @@
Name: Level2_NavData
ID: 267663500
ID: 260674210
Type: 15

View File

@ -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
@ -17061,3 +17130,29 @@
Acceleration: {x: 0, y: -0.100000001, z: 0}
IsActive: true
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

View File

@ -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()
{
Transform transform = GetComponent<Transform>();
Transform aiTransform = aiGO.GetComponent<Transform>();
if(transform)
{
transform.GlobalPosition = aiTransform.GlobalPosition;
}
}
protected override void onTriggerStay(CollisionInfo info)
{
PlayerController pc = info.GameObject.GetScript<PlayerController>();
HomeOwnerAI ai = GameObject.Parent.GetScript<HomeOwnerAI>();
if (pc && ai)
HomeOwnerAI ai = aiGO.GetScript<HomeOwnerAI>();
if (pc)
{
Debug.Log("HomeOwnerAttackHitbox: Player caught");
pc.GotCaught();
if(ai)
ai.Reset();
}
}

View File

@ -502,7 +502,7 @@ public class PlayerController : Script
}
}
private void GotCaught()
public void GotCaught()
{
if (currentState == RaccoonStates.CAUGHT && tranform && respawnPoint)
{

View File

@ -218,6 +218,7 @@ namespace SHADE
void SHNavigationSystem::GenerateNavigationGridData() noexcept
{
Clear();
GenerateNavigationGridData(origin_editor, size_editor, numRows_editor, numCols_editor);
}