Vlatitude: Scripted Sentences Last edited 1 year ago2022-09-29 07:56:28 UTC

Download example

Okay, here I'm going to explain how to make your NPCs (non-player characters) say stuff when you want them to. For this, we will be using the scripted_sentence entity, which can be triggered by its name attribute.

Scripted sentences work much like scripted sequences, which I have described in a prior tutorial. The similarity is that both entities have an NPC that they target, plus an additional target field, which makes them very flexible.

In order to make scripted sentences, you need to know what the sentences are. To hear them, and to learn their names, you need to go into Half-Life's main PAK file. We will soon have a version of it online, but until then, there is a sentences.txt file in the \sound directory inside pak0.pak. In order to view PAK files, download Pak Explorer. Okay, in sentences.txt, there is a list of sounds. The very first word on a line is the name of the sentence which you'll be using in Worldcraft. Following the name is its location in the PAK file, so you can play it for yourself to hear what it sounds like. Soon, Brian will post a list of these with a description of what they say, so you can eliminate the middle-man of finding your sentence and playing it.

Okay, make a scripted_sentence entity. It really doesn't matter where you place it, but to keep track of them, I suggest you place them near their designated NPC. Go to its properties. The other attributes and the flags are self-explanatory.
This article was originally published on 69th Vlatitude.
The original URL of the article was http://www.vlatitude.com/tutorials.php?tutID=11.
The archived page is available here.
TWHL only publishes archived articles from defunct websites, or with permission. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.


You must log in to post a comment. You can login or register a new account.