×
Меню
Индекс

TES CS Function/Variable Conditions

Dialogue Tutorial
Part 3: Function/Variable Conditions
 
<< Back to Greetings <<
The most powerful and flexible section of the Speaker Conditions area is the Function/Variable section. This lets you specify up to six different conditions in addition to race, sex class and so on. For now we'll just look at a couple of these that are especially useful for greetings; we'll look at a lot more later, when we get into quests.
First, though, an overview of what's in that area.
Function/Variable List Items
These items return a numerical value which can be compared to another number using standard numerical comparators. If the comparison is true, the condition succeeds; if it is false, it fails.
There are six entries in the Function/Variable list. Each one has the following structure:
List 1
List 2
Comparator
Numeric Value
Each of these except the last is a drop-down list. The contents of the List 2 depend on what you choose in List 1. I've included the complete list of possibilities in Appendix 1.
We'll be looking at many of these later on. Here are the ones we'll be looking at in this section:
NotRace: Race
This is true if the speaker is not of this race.
NotID: ID
This is true if the speaker is not this person.
Global: Random100
Picks a random number between 0 and 100.
Global: PCRace
A number corresponding to PC's race: 1 Argonian, 2 Breton, 3 Dark Elf, 4 High Elf, 5 Imperial, 6 Khajiit, 7 Nord, 8 Orc, 9 Redguard, 10 Woodelf
Function: Same Sex
This is 1 if the speaker and the player are of the same gender and 0 otherwise.
Function: Talked to PC
This is 1 if the speaker has ever talked to the player and 0 otherwise.
Talked to PC
All of the greetings we've added so far are "welcomes". These are appropriate the first time the player talks to an NPC, but should only be said once. Let's make sure that happens.
You have now added a condition which says "say this only if the NPC has never talked to the player before". So after the NPC has said this the first time, they should revert to their default Morrowind greetings. Start the game and test this.
Now we need some more custom greetings for after you've talked to them once...
Not Race, PC Race
We've established that Neverland is a Breton town, so let's give the local non-Bretons something to say about that. Of course, they'll only feel comfortable saying it to somebody who isn't a Breton.
Same Sex
How about a little innocent flirting? Here's something for characters of the opposite sex from the player.
Random greetings
Finally, let's pick a random greeting for everyone in Neverland who doesn't meet one of the conditions already accounted for. This will prevent Neverlanders from using any of the general Morrowind greetings. By randomizing, we can prevent things from getting too repetitive.
Since these will be the "catch-all" greetings, they should go below all the others you've added.
Still here? I'm surprised.
 
Don't fall in the canals -- that's where we dump our garbage.
 
Nothing ever changes here. Of course, in some ways that's a good thing: for instance, the bartender never runs out of flin.
Hey, have you heard the one about the %PCRace and the %Race? They go into a bar, and... whoops, you're %PCRace, aren't you? Never mind!
Hello there, %PCName. Enjoying your stay?
Conditions to use for random info/response items
If you want to pick a random greeting or response with equal probability among a number of different items, you need to use a different filter for each item. That's because the number of responses you're choosing among keeps decreasing as you go down the list. The value you compare the random number to should increase in steps of 100/n, where n is the number of responses you have.
Responses
Values
2
50, none
3
33, 67, none
4
25, 50, 75, none
... and so on.
Enough! Save and test.
If you like, you can experiment with rearranging the greetings you've got to see what effect that has; and you can add more greetings with different conditions.
>> On to Topics >>