dcl-npc-toolkit 1.6.1-20251229141234.commit-1da47d6 → 1.6.1-20251229153910.commit-ff2787f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -118,7 +118,28 @@ export let ILoveCats: Dialog[] = [
|
|
|
118
118
|
]
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
6. Use that dialog when the NPC gets activated
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
export let myNPC = npc.create(
|
|
125
|
+
{
|
|
126
|
+
position: Vector3.create(8, 0, 8),
|
|
127
|
+
rotation: Quaternion.Zero(),
|
|
128
|
+
scale: Vector3.create(1, 1, 1),
|
|
129
|
+
},
|
|
130
|
+
//NPC Data Object
|
|
131
|
+
{
|
|
132
|
+
type: npc.NPCType.CUSTOM,
|
|
133
|
+
model: 'models/npc.glb',
|
|
134
|
+
onActivate: () => {
|
|
135
|
+
npc.talk(myNPC, ILoveCats, 0)
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
# NPC Default Behavior
|
|
122
143
|
|
|
123
144
|
NPCs at the very least must have:
|
|
124
145
|
|
|
@@ -191,9 +212,14 @@ createFromEntity(npcEntity, {
|
|
|
191
212
|
onActivate: () => {
|
|
192
213
|
// ...
|
|
193
214
|
},
|
|
194
|
-
|
|
195
|
-
|
|
215
|
+
volume: {
|
|
216
|
+
radius: 4,
|
|
217
|
+
shape: 'sphere'
|
|
218
|
+
}
|
|
196
219
|
})
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
197
223
|
```
|
|
198
224
|
|
|
199
225
|
## SDK7 UI
|
|
@@ -222,17 +248,6 @@ export function setupUi() {
|
|
|
222
248
|
}
|
|
223
249
|
```
|
|
224
250
|
|
|
225
|
-
Note: The UI drawn by this library library requires fetching images from an external URL. For the scene to allow you to do this, you must include the `ALLOW_MEDIA_HOSTNAMES` scene permission and add `decentraland.org` to the list of allowed domains in your `scene.json` file. Learn more about [image permissions](https://docs.decentraland.org/creator/development-guide/sdk7/materials/#textures-from-an-external-url).
|
|
226
|
-
|
|
227
|
-
```json
|
|
228
|
-
"requiredPermissions": [
|
|
229
|
-
"ALLOW_MEDIA_HOSTNAMES"
|
|
230
|
-
],
|
|
231
|
-
"allowedMediaHostnames": [
|
|
232
|
-
"decentraland.org"
|
|
233
|
-
],
|
|
234
|
-
```
|
|
235
|
-
|
|
236
251
|
## NPC Additional Properties
|
|
237
252
|
|
|
238
253
|
To configure other properties of an NPC, add a fourth argument as an `NPCData` object. This object can have the following optional properties:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcl-npc-toolkit",
|
|
3
|
-
"version": "1.6.1-
|
|
3
|
+
"version": "1.6.1-20251229153910.commit-ff2787f",
|
|
4
4
|
"description": "A collection of tools for creating Non-Player-Characters (NPCs). These are capable of having conversations with the player, and play different animations.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@dcl/js-runtime": "latest"
|
|
38
38
|
},
|
|
39
|
-
"commit": "
|
|
39
|
+
"commit": "ff2787f177a251301cd487fd2acebbd0714f4487"
|
|
40
40
|
}
|