Questions about npc speech

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
Ghostwolf
UOX3 Novice
Posts: 73
Joined: Mon Feb 11, 2008 9:41 am
Location: Hanging Around
Has thanked: 0
Been thanked: 0
Contact:

Questions about npc speech

Post by Ghostwolf »

1) Is it possible create npc specific speech?

2) If so do I create a speech_002 then 3 and so on?

3) Also would the entry npc.dfn require a tag such as SPEECH 2?

Any help is appreciated.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

1) Yes, it's possible to create NPC-specific speech.

2 & 3)
-Create a new JS file for your NPC-specific stuff then assign the new script to the NPC through the SCRIPT=# (I think? maybe SCRIPTTRIGGER= instead. Unsure, don't have the files handy to check =) DFN tag, or
-Include it in the original speech-script and assign that script to your NPC, or
-Add it to your existing custom script for the NPC if one exists (Any NPC/Item can only have a single script assigned)
-= Ho Eyo He Hum =-
Ghostwolf
UOX3 Novice
Posts: 73
Joined: Mon Feb 11, 2008 9:41 am
Location: Hanging Around
Has thanked: 0
Been thanked: 0
Contact:

Post by Ghostwolf »

With the exception of a few individual npc's it will mostly effect custom groups such as region specific guards, towncriers and tavernkeepers. I don't really want to do it in game as there will be too many to manipulate.

So a tag like SCRIPT=SPEECH_002 would work?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Ah, no. If you look inside UOX3/JS/jse_fileassociations.scp, you'll find the following entry:
3000=npc/speech/speech_001.js
3000 is the "scriptID" for that script, and is what you'll need to use in the DFN-tag or with the ingame command. Examples:
SCRIPT=3000
'SETSCPTRIG 3000

So if you're making a custom .js file, say... speech_002.js, then you need to add a new entry to the jse_fileassociations.scp file and assign the file a unique scriptID, like this:
3001=npc/speech/speech_002.js
Both speech_002 and speech_001 are bad names, btw, they don't really give any indication what they're for. In the end you'll end up with files like speech_471.js, and it will be impossible to find anything :)
-= Ho Eyo He Hum =-
Ghostwolf
UOX3 Novice
Posts: 73
Joined: Mon Feb 11, 2008 9:41 am
Location: Hanging Around
Has thanked: 0
Been thanked: 0
Contact:

Post by Ghostwolf »

Thanks Xuri

I just have 1 more question regarding the jse_fileassocations text. If I need more than 100 entries would creating a second entry using free numbers cause problems or bugs. My LW shard had 100+ speech entries and most were custom, I'm trying to recreate it as much as possible.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Ah, don't worry too much about the ID-ranges specified in the file, they are mostly there as "guidelines".

What you might want to worry about though, is setting up your custom scripts in a way that they'll never get "overwritten" by any updates to UOX3. Find a custom-range of IDs, like 10000+ for instance, and use those for all your custom scripts. That way you won't have to re-order script IDs and stuff if there's ever an update that adds scripts in the ranges that already exist.

Likewise with file/folder-structure, make it a habit to have all your custom scripts and additions in a "custom"-folder or similar, for easier merging with any future UOX3 updates.
-= Ho Eyo He Hum =-
Post Reply