dcl-npc-toolkit 1.5.2-20251229114921.commit-4a0a155 → 1.6.1-20251229141234.commit-1da47d6
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 +4 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -77,21 +77,15 @@ export let ILoveCats: Dialog[] = [
|
|
|
77
77
|
npm i dcl-npc-toolkit
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
2.
|
|
80
|
+
2. Run `dcl start` or `dcl build` so the dependencies are correctly installed.
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
npm i @dcl-sdk/utils -B
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
3. Run `dcl start` or `dcl build` so the dependencies are correctly installed.
|
|
87
|
-
|
|
88
|
-
4. Import the library into the scene's script. Add this line at the start of your `index.ts` file, or any other TypeScript files that require it:
|
|
82
|
+
3. Import the library into the scene's script. Add this line at the start of your `index.ts` file, or any other TypeScript files that require it:
|
|
89
83
|
|
|
90
84
|
```ts
|
|
91
85
|
import * as npc from 'dcl-npc-toolkit'
|
|
92
86
|
```
|
|
93
87
|
|
|
94
|
-
|
|
88
|
+
4. In your TypeScript file, call the `create` function passing it a `TransformType` and a `NPCData` object. The `NPCData` object requires a minimum of a `NPCType` and a function to trigger when the NPC is activated:
|
|
95
89
|
|
|
96
90
|
```ts
|
|
97
91
|
export let myNPC = npc.create(
|
|
@@ -111,7 +105,7 @@ export let myNPC = npc.create(
|
|
|
111
105
|
)
|
|
112
106
|
```
|
|
113
107
|
|
|
114
|
-
|
|
108
|
+
5. Write a dialog script for your character, preferably on a separate file, making it of type `Dialog[]`.
|
|
115
109
|
|
|
116
110
|
```ts
|
|
117
111
|
import { Dialog } from 'dcl-npc-toolkit'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcl-npc-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1-20251229141234.commit-1da47d6",
|
|
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": "1da47d6c9b9ebf767fb451a0bdbc6cf7e6b23e8e"
|
|
40
40
|
}
|