Skip to content

Commit ca190e0

Browse files
authored
chore: FlexiblePathfinding migration follow-ups (#94)
1 parent 2f951cf commit ca190e0

File tree

3 files changed

+125
-124
lines changed

3 files changed

+125
-124
lines changed

assets/behaviors/lure.behavior

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
{
22
dynamic: [
3-
{
4-
guard: {
5-
componentPresent: "Behaviors:FindNearbyPlayers",
6-
values: ["N charactersWithinRange nonEmpty"],
7-
child: {
3+
{
4+
guard: {
5+
componentPresent: "Behaviors:FindNearbyPlayers",
6+
values: ["N charactersWithinRange nonEmpty"],
7+
child: {
88
sequence: [
9-
{ sleep: {time: 0.1f }},
9+
{ sleep: { time: 0.1f } },
1010
check_luring_item_in_use,
1111
followCharacter,
12-
{ lookup: {tree: "Behaviors:follow" }}
13-
]
14-
}
15-
}
16-
},
17-
{
18-
lookup: {
19-
tree: "Behaviors:stray"
12+
{ lookup: { tree: "Behaviors:follow" } }
13+
]
2014
}
2115
}
16+
},
17+
{ lookup: { tree: "Behaviors:stray" } }
2218
]
2319
}
2420

assets/prefabs/animals/deer.prefab

Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,26 @@
11
{
2-
"skeletalmesh" : {
3-
"mesh" : "deer",
4-
"heightOffset" : -0.8,
5-
"material" : "deerSkin",
6-
"animation" : "deer#Idle",
7-
"loop" : true
2+
// -- Properties ----------------------------------------
3+
"persisted": true,
4+
// -- Components ----------------------------------------
5+
"AliveCharacter": {},
6+
"BaseRegen": {
7+
"regenRate": 2,
8+
"waitBeforeRegen": 10
89
},
910
"Behavior": {
1011
"tree": "Behaviors:critter"
1112
},
12-
"FleeOnHit": {
13-
"minDistance": 5,
14-
"speedMultiplier": 1.2
15-
},
16-
"DropGrammar": {
17-
"blockDrops": [],
18-
"itemDrops": [
19-
"0.7|WildAnimals:meat",
20-
"0.3|WildAnimals:deerHide"
21-
]
22-
},
23-
"Stand": {
24-
"animationPool": [
25-
"deer#Idle",
26-
"deer#Idle",
27-
"deer#Idle",
28-
"deer#Bite_InPlace",
29-
"deer#Yes",
30-
"deer#No"
31-
]
32-
},
33-
"Walk" :{
34-
"animationPool": ["deer#Walk"]
35-
},
36-
"Die": {
37-
"animationPool": [
38-
"deer#Death"
13+
"BoxShape": {
14+
"extents": [
15+
1.5,
16+
1.5,
17+
1.5
3918
]
4019
},
41-
"persisted": true,
42-
"location": {},
4320
"Character": {},
44-
"AliveCharacter": {},
45-
"WildAnimal": {
46-
"name": "Deer",
47-
"icon": "WildAnimals:icons#Deer"
48-
},
49-
"NPCMovement": {},
50-
"CreatureNameGenerator": {
51-
"genderRatio": 0,
52-
"nobility": 0,
53-
"theme": "ANIMAL"
54-
},
55-
"CharacterMovement": {
21+
"CharacterMovement": {
5622
"speedMultiplier": 0.3,
57-
"distanceBetweenFootsteps": 0.2,
23+
"distanceBetweenFootsteps": 0.2,
5824
"height": 1.6,
5925
"radius": 0.3,
6026
"jumpSpeed": 12
@@ -69,34 +35,72 @@
6935
],
7036
"footstepVolume": 0.03
7137
},
38+
"CreatureNameGenerator": {
39+
"genderRatio": 0,
40+
"nobility": 0,
41+
"theme": "ANIMAL"
42+
},
7243
"DamageSound": {
7344
"sounds": [
7445
"DeerHit1",
7546
"DeerHit2"
7647
]
7748
},
78-
"Network": {},
79-
"MinionMove": {},
49+
"Die": {
50+
"animationPool": [
51+
"deer#Death"
52+
]
53+
},
54+
"DropGrammar": {
55+
"blockDrops": [],
56+
"itemDrops": [
57+
"0.7|WildAnimals:meat",
58+
"0.3|WildAnimals:deerHide"
59+
]
60+
},
61+
"FleeOnHit": {
62+
"minDistance": 5,
63+
"speedMultiplier": 1.2
64+
},
8065
"Health": {
8166
"destroyEntityOnNoHealth": true,
8267
"currentHealth": 50,
8368
"maxHealth": 50
8469
},
85-
"BaseRegen": {
86-
"regenRate": 2,
87-
"waitBeforeRegen": 10
70+
"Location": {},
71+
"MinionMove": {
72+
"movementTypes": ["walking", "leaping", "falling"]
8873
},
89-
"BoxShape": {
90-
"extents": [
91-
1.5,
92-
1.5,
93-
1.5
74+
"Network": {},
75+
"NPCMovement": {},
76+
"SkeletalMesh" : {
77+
"mesh" : "deer",
78+
"heightOffset" : -0.8,
79+
"material" : "deerSkin",
80+
"animation" : "deer#Idle",
81+
"loop" : true
82+
},
83+
"Stand": {
84+
"animationPool": [
85+
"deer#Idle",
86+
"deer#Idle",
87+
"deer#Idle",
88+
"deer#Bite_InPlace",
89+
"deer#Yes",
90+
"deer#No"
9491
]
9592
},
9693
"Trigger": {
9794
"detectGroups": [
9895
"engine:debris",
9996
"engine:sensor"
10097
]
98+
},
99+
"Walk" :{
100+
"animationPool": ["deer#Walk"]
101+
},
102+
"WildAnimal": {
103+
"name": "Deer",
104+
"icon": "WildAnimals:icons#Deer"
101105
}
102106
}
Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,26 @@
11
{
2-
"Behavior": {
3-
"tree": "Behaviors:critter"
4-
},
5-
"FleeOnHit": {
6-
"minDistance": 5,
7-
"speedMultiplier": 1.2
8-
},
9-
"Stand": {
10-
"animationPool": [
11-
"sheep#Idle",
12-
"sheep#Idle",
13-
"sheep#Idle",
14-
"sheep#Bite_InPlace",
15-
"sheep#Yes",
16-
"sheep#No"
17-
]
2+
// -- Properties ---
3+
"persisted": true,
4+
// -- Components ---
5+
"AliveCharacter": {},
6+
"BaseRegen": {
7+
"regenRate": 2,
8+
"waitBeforeRegen": 10
189
},
19-
"Walk": {
20-
"animationPool": [
21-
"sheep#Walk"
22-
]
10+
"Behavior": {
11+
"tree": "WildAnimals:lure"
2312
},
24-
"Die": {
25-
"animationPool": [
26-
"sheep#Death"
13+
"BoxShape": {
14+
"extents": [
15+
1.5,
16+
1.5,
17+
1.5
2718
]
2819
},
29-
"persisted": true,
30-
"location": {},
3120
"Character": {},
32-
"AliveCharacter": {},
33-
"WildAnimal": {
34-
"name": "Sheep",
35-
"icon": "WildAnimals:icons#Sheep"
36-
},
37-
"NPCMovement": {},
38-
"CreatureNameGenerator": {
39-
"genderRatio": 0,
40-
"nobility": 0,
41-
"theme": "ANIMAL"
42-
},
43-
"CharacterMovement": {
21+
"CharacterMovement": {
4422
"speedMultiplier": 0.3,
45-
"distanceBetweenFootsteps": 0.2,
23+
"distanceBetweenFootsteps": 0.2,
4624
"height": 1.6,
4725
"radius": 0.3,
4826
"jumpSpeed": 12
@@ -57,28 +35,48 @@
5735
],
5836
"footstepVolume": 0.03
5937
},
38+
"CreatureNameGenerator": {
39+
"genderRatio": 0,
40+
"nobility": 0,
41+
"theme": "ANIMAL"
42+
},
6043
"DamageSound": {
6144
"sounds": [
6245
"SheepHit1",
6346
"SheepHit2"
6447
]
6548
},
66-
"Network": {},
67-
"MinionMove": {},
49+
"Die": {
50+
"animationPool": [
51+
"sheep#Death"
52+
]
53+
},
54+
"FindNearbyPlayers": {
55+
"searchRadius": 12
56+
},
57+
"FleeOnHit": {
58+
"minDistance": 5,
59+
"speedMultiplier": 1.2
60+
},
6861
"Health": {
6962
"destroyEntityOnNoHealth": true,
7063
"currentHealth": 25,
7164
"maxHealth": 25
7265
},
73-
"BaseRegen": {
74-
"regenRate": 2,
75-
"waitBeforeRegen": 10
66+
"Location": {},
67+
"MinionMove": {
68+
"movementTypes": ["walking", "leaping", "falling"]
7669
},
77-
"BoxShape": {
78-
"extents": [
79-
1.5,
80-
1.5,
81-
1.5
70+
"Network": {},
71+
"NPCMovement": {},
72+
"Stand": {
73+
"animationPool": [
74+
"sheep#Idle",
75+
"sheep#Idle",
76+
"sheep#Idle",
77+
"sheep#Bite_InPlace",
78+
"sheep#Yes",
79+
"sheep#No"
8280
]
8381
},
8482
"Trigger": {
@@ -87,10 +85,13 @@
8785
"engine:sensor"
8886
]
8987
},
90-
"Behavior": {
91-
"tree": "WildAnimals:lure"
88+
"Walk": {
89+
"animationPool": [
90+
"sheep#Walk"
91+
]
9292
},
93-
"FindNearbyPlayers": {
94-
"searchRadius": 12
93+
"WildAnimal": {
94+
"name": "Sheep",
95+
"icon": "WildAnimals:icons#Sheep"
9596
}
9697
}

0 commit comments

Comments
 (0)