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:
@@ -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
|
||||
90
Resources/Prototypes/NPCs/debug.yml
Normal file
90
Resources/Prototypes/NPCs/debug.yml
Normal 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!"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user