Added new HTN operations and preconditions (#27486)

* Added new HTN operations & preconditions

* Ok I forgot about partial

* Namespace pierce the skies

* Some fixes, debug and new operators

* Bruh git eat my files
This commit is contained in:
Tornado Tech
2024-05-08 19:18:03 +10:00
committed by GitHub
parent 29860a0cf7
commit 31491775e5
14 changed files with 401 additions and 8 deletions

View File

@@ -0,0 +1,53 @@
- type: entity
parent: MobHuman
id: MobDebugCounter
name: debug counter
description: He can count
suffix: AI, DEBUG
components:
- type: HTN
rootTask:
task: DebugCounterCompound
blackboard:
MinimumIdleTime: !type:Single
0.5
MaximumIdleTime: !type:Single
0.5
Count: !type:Single
0
- type: entity
parent: MobHuman
id: MobDebugRandomCounter
name: debug random counter
description: He can randomize
suffix: AI, DEBUG
components:
- type: HTN
rootTask:
task: DebugRandomCounterCompound
blackboard:
MinimumIdleTime: !type:Single
1
MaximumIdleTime: !type:Single
1
Count: !type:Single
0
- type: entity
parent: MobHuman
id: MobDebugRandomLess
name: debug random less
description: He can lessing
suffix: AI, DEBUG
components:
- type: HTN
rootTask:
task: DebugRandomLessCompound
blackboard:
MinimumIdleTime: !type:Single
1
MaximumIdleTime: !type:Single
1
Count: !type:Single
0

View File

@@ -0,0 +1,90 @@
- type: htnCompound
id: DebugCounterCompound
branches:
- tasks:
- !type:HTNPrimitiveTask
operator: !type:AddFloatOperator
targetKey: Count
amount: 1
- !type:HTNPrimitiveTask
operator: !type:SayKeyOperator
key: Count
- !type:HTNPrimitiveTask
operator: !type:RandomOperator
targetKey: IdleTime
minKey: MinimumIdleTime
maxKey: MaximumIdleTime
- !type:HTNPrimitiveTask
operator: !type:WaitOperator
key: IdleTime
preconditions:
- !type:KeyExistsPrecondition
key: IdleTime
- type: htnCompound
id: DebugRandomCounterCompound
branches:
- tasks:
- !type:HTNPrimitiveTask
operator: !type:SetRandomFloatOperator
targetKey: Count
minAmount: 0
maxAmount: 100
- !type:HTNPrimitiveTask
operator: !type:SayKeyOperator
key: Count
- !type:HTNPrimitiveTask
operator: !type:RandomOperator
targetKey: IdleTime
minKey: MinimumIdleTime
maxKey: MaximumIdleTime
- !type:HTNPrimitiveTask
operator: !type:WaitOperator
key: IdleTime
preconditions:
- !type:KeyExistsPrecondition
key: IdleTime
- type: htnCompound
id: DebugRandomLessCompound
branches:
- tasks:
- !type:HTNPrimitiveTask
operator: !type:SetRandomFloatOperator
targetKey: Count
minAmount: 0
maxAmount: 100
- !type:HTNPrimitiveTask
operator: !type:SayKeyOperator
key: Count
preconditions:
- !type:KeyFloatLessPrecondition
key: Count
value: 50
- !type:HTNPrimitiveTask
operator: !type:RandomOperator
targetKey: IdleTime
minKey: MinimumIdleTime
maxKey: MaximumIdleTime
- !type:HTNPrimitiveTask
operator: !type:WaitOperator
key: IdleTime
preconditions:
- !type:KeyExistsPrecondition
key: IdleTime
- tasks:
- !type:HTNPrimitiveTask
operator: !type:SpeakOperator
speech: "fuck!"