NPC to fight player

Post » Fri May 04, 2012 4:37 am

Hi again, Im afraid Ive got another rediculous question.

Have an NPC dwarf. and I want him to attack the player if player give a specific reply to one of his questions,

3 choices,
1) yes i'll help, makes him like you more and he gives you a couple of items,
2) Can't help right now he just says fair enough and stops talking to you,
3) Why would I help a no good dwarf (special for elves) he will shout and then attack.

Unfortunately I can't get him to attack with the third answer.

Can anyone tell me how to get him to.
User avatar
Victor Oropeza
 
Posts: 3362
Joined: Sun Aug 12, 2007 4:23 pm

Post » Thu May 03, 2012 5:19 pm

In the result field of option 3;

StartCombat, Player
SetDisposition 0
SetFight 100
Goodbye

Assuming you have the response properly tiered (1= bottom or closest to topic, 3= top or furthest from topic). Have you looked at http://tommyshideout.net/files/srikandi/DialogueTut/ yet? A very well written and helpful source.

[edit]

At times there may be a brief pause for the AI to process, and the actor may seem oblivious to the commands (2-4 seconds at most).

Also, you do realize that "dwarves" are elves as well? Dwarves is most likely an Imperial bastardization of Dwemer. Dwemer = Deep Elves.
User avatar
Killer McCracken
 
Posts: 3456
Joined: Wed Feb 14, 2007 9:57 pm

Post » Fri May 04, 2012 4:53 am

Excellent job,

Thanks for the help with that , works great.

The dwarves I know however come from norse mythology, AD&D, Warhammer and the rest of that lineage, not the dwemer from the game. I'm afraid I'm relatively new to RPG computer games and have spent too many years and all of my childhood (pre gaming computer) playing role play games and LARPing.
User avatar
Paul Rice
 
Posts: 3430
Joined: Thu Jun 14, 2007 11:51 am

Post » Thu May 03, 2012 8:36 pm

Sorry about this but ive got another stupid question.

Can I get my NPC to give player a key but only if he likes him enough, without using the journal.
User avatar
Juan Cerda
 
Posts: 3426
Joined: Thu Jul 12, 2007 8:49 pm

Post » Thu May 03, 2012 1:51 pm

First, you *can* use Journal if you want. If you make a Journal line with a number but without any text whatsoever, it will leave no trace in the actual journal and won't display a message when issued (at least, if you do it from Dialogue; if you use Journal from a regular script, the message is always shown).

Other than that, if you *really* don't want to use Journal, you can use a local variable. The NPC must have a script attached and there must be a line like this:
short KeyGiven

Now, make three lines of dialogue:
NPC == YourNPCDisposition == 70Local KeyGiven == 0Text: Here is the key, %PCNameAction: Set KeyGiven to 1Player->Additem "YourKey" 1
,
NPC == YourNPCLocal KeyGiven == 0Text: I won't give it to you.
and
NPC == YourNPCLocal KeyGiven == 1Text: I already gave it to you.
The line *with* Disposition condition should be above the one *without* it and not vice versa. The variable prevents the NPC from giving you keys again and again every time you click the topic.
User avatar
A Dardzz
 
Posts: 3370
Joined: Sat Jan 27, 2007 6:26 pm


Return to III - Morrowind