darthtyren Posted July 9, 2011 Share Posted July 9, 2011 I want to give the PC a choice to let the NPC die without attacking him. The NPC would die after his dialogue has been spoken. How would I script the death of that NPC after that dialogue? Link to comment Share on other sites More sharing options...
Marius Fett Posted July 9, 2011 Share Posted July 9, 2011 Here you go: void main() { object oNPC = GetObjectByTag("NPC_TAG_HERE"); effect eDeath = EffectDeath(); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDeath, oNPC); } That should work. Just put the tag of your NPC where it says NPC_TAG_HERE. Link to comment Share on other sites More sharing options...
darthtyren Posted July 9, 2011 Author Share Posted July 9, 2011 That didn't quite work. Yes the dude died, but he died as he was speaking. Link to comment Share on other sites More sharing options...
Fastmaniac Posted July 9, 2011 Share Posted July 9, 2011 Just create a node after the line he's supposed to say and apply the script to that node... If - however - you want to do the same effect with scripting you'll want to use the following: void main() { ActionPauseConversation(); object oNPC = GetObjectByTag("NPC_TAG_HERE"); effect eDeath = EffectDeath(); DelayCommand(AMOUNT_OF_SECONDS, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDeath, oNPC)); ActionResumeConversation(); } You'll have to replace AMOUNT_OF_SECONDS with the length of the soundfile in seconds. Hope that helps Fastmaniac Link to comment Share on other sites More sharing options...
darthtyren Posted July 9, 2011 Author Share Posted July 9, 2011 Fantastic. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.