Question: Turn an NPC Hostile to you during a quest

Post » Thu Jun 21, 2012 10:32 am

As the topic reads, I am trying to make an NPC hostile to me during a quest.
While writing the dialogue, I have two options, one of which I want to cause the NPC to break the conversation and attack the player.
I tried putting in this:
StartCombat(Game.GetPlayer())
I put it into the dialogue view under the END section (the same place you would progress the stages of a quest as a player talks to an NPC), but it comes back with an error saying that StartCombat is not a function or does not exist.

Any help would be appreciated. Thanks.
User avatar
kyle pinchen
 
Posts: 3475
Joined: Thu May 17, 2007 9:01 pm

Post » Thu Jun 21, 2012 10:29 am

you can't use a function just as is. You need to use it from an object. In this case you need to type:
akSpeaker.StartCombat(Game.Getplayer())

As akSpeaker is the actor talking with you in a topic. Sometimes you can avoid using the object name, but that is because it's implicit (as an example, if you are doing the same actor attack the player in it's own script then you could have use the function as you have done, as when you didn't add an object to the beggining of the function the compiler assumes you are using it with the object the script is attached to -in your example I suppose it's the quest-).
User avatar
Penny Flame
 
Posts: 3336
Joined: Sat Aug 12, 2006 1:53 am

Post » Thu Jun 21, 2012 7:48 pm

Ahh, thanks Amgepo.
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am


Return to V - Skyrim