Thanks for detailed answer. But above script didn't work. I managed to get him say Hello(post #9). And with a second approach, "How are you!"(post #9: adding thiefdial2 and using it instead in result and condition in dialog number 2).
Now I have 1 question.
DoOnce:
You said we set it for a reason, to make it only happen once. But we aren't checking it in rest of the code. So is it some kind of global function?(edit: Is it a good idea to update doonce in dialog #1's result, if not?)
And one assumption:
I added thiefdial2 because I thought when I'm near, thiefdial1 will get 1 and it will retrigger dialog #1 again and again. Adding thiefdial2, (which should't fix it logically-but a hunch), did second line spoken but not the third. Maybe those variables doesn't get updated across one dialog. (I will try it with thiefdial2,3,4 and use them in each dialog result respectively, maybe that can fix it.) Also note that I want this dialogs(voices) to be spoken back to back not with re-approaches.
What I want to achieve is, aggressive AI 101(for myself),
I approach fargoth, with his ring equipped,
Fargoth first greets me:
Hello, how are you!
(2 voice dialog spoken back to back, thiefdial1 is set to 1 in script, dialog condition reads it and triggers first dialog, in first dialog's result I have thiefdial1or2 set to 2, which triggers second dialog "howareyou!", which has in result box: set thiefdial1 to 3)
third dialog:
What's this? Thief!
result: set thiefdial2 to 4
final dialog #4
Over here!
Again condition is triggered by previous dialog's(voice) result box.
This one has a couple of stuff in its result box:
Player->ModCurrentHealth -10;Fargoth bites PC's finger with the key attached, this is the hit point from it :PPlayer->Removeitem, "ring_keley", 1Additem, "ring_keley", 1;Now Fargoth has the ringModAlarm 100;this should call the guards I guess, but don't know how much guards will charge Pcset thiefdial2 to 5;well this will stop the dialogs but probably unnecessary, a better thing could be a stopscript altogether command
Since this is my first script, I'm starting with easy stuff. After managing this I will try to make this for global scale and fully automatic. NPCs will recognize their armor/cloth/weapon and call the guards. And they will acquire their stuff directly.(I don't know if in vanilla stolen items returns to their owners, but this mod will do it.)
Then I will do it for healers, healers with aggressive AI will offer potions, cast heal spells directly to PC, if they have high disposition and some certain other conditions, triggered by relevant voice greetings...
I will also provide small tweaks to regular quests, watch this, at 9:39:
http://www.youtube.com/watch?v=yPPgYKK_-lA&feature=related
Player talks to Mehra Milo, she says "follow me it is not safe here." Player follows and waits because, player thinks Mehra will decide if it is safe or not, by logic. Watch the disappointment player feels when he had to make the assumption: "Is that good enough?" and nothing happens. This could be fixed with a basic forcegreet. This will be manual, I guess.
Quest givers from same faction will forcegreet you(with high chance), automatically. So quests will call you. You don't have to search them(or let's say searching and finding will be easier.). When you return from a mission, quest giver will forcegreet you with very high chance. Random quest givers will forcegreet you with a low chance. With added relevant voice greets.
I even want to make guards AI sensitive to criminal
intent.
There are many topics I want to add aggression. (like combat!)
I will fully exploit voice greetings for this. Greetings happen all the time and can be triggered by conditions. Binding everything in voice dialog is possible. The world will be constantly changing. Every greeting will change something ingame, trigger stuff. Even between NPCs. Just randomly, but it will create, in the end, what I call as:
A.I.
And above little project is the start that can lead to wonderful things.