davidx4 Posted October 3, 2010 Share Posted October 3, 2010 I want to spawn an NPC based on a condition, similar to how Lucien Lachance gets trigged when the PC kills an innocent and a text prompt reads, "Your killing has been observed by forces unknown..." Does anyone know how this might work? I've tried looking through the TES Construction Set and I found Lachance's opening dialog when he visits you during the night (Dark01Choice2A), but couldn't find the innocent killing trigger event that leads to it to study it. Link to comment Share on other sites More sharing options...
The_Vyper Posted October 3, 2010 Share Posted October 3, 2010 What you'll need is a quest script set up to enable an initially disabled NPC when the trigger action occurs. Your NPC will need an AI package to seek out the Player once he/she has been enabled by the quest script. Link to comment Share on other sites More sharing options...
davidx4 Posted October 3, 2010 Author Share Posted October 3, 2010 So I need to use scripting to make a script file to attach to the npc, or can I get away with only making an AI package? If I need to use scripting, what's tripping me up is figuring out the code to get my spawned NPC to greet the PC. I found (and studied) the part of the Lachance dialog that possibly controls greeting the PC and it looks like this: if greet == 0 if player.GetDistance LucienLachanceFarragutRef <= 200 LucienLachanceFarragutRef.StartConversation Player Greeting set greet to 1 endifendif I guess I'm a bit confused what the "LucienLachanceFarragutRef" part means. Does "LucienLachance" represent Lucien's NPC ID? Farragut represents the location, Farragut. I keep having issues where the TES Construction Set grips about how my script is not valid. There is something in the Oblivion script that makes it work, but something in mine that does not. Btw, this NPC isn't part of a quest. It's merely an npc that pops up, says a few lines, then departs. The condition to make him originally spawn is merely time specific. Can I get away with not making a quest since I'm not using the npc in a quest? I wish there was a simple mod out there with a spawning npc that greets the PC so I could study it or a script template for greeting npc's. Link to comment Share on other sites More sharing options...
The_Vyper Posted October 3, 2010 Share Posted October 3, 2010 So I need to use scripting to make a script file to attach to the npc, or can I get away with only making an AI package? If I need to use scripting, what's tripping me up is figuring out the code to get my spawned NPC to greet the PC. I found (and studied) the part of the Lachance dialog that possibly controls greeting the PC and it looks like this: if greet == 0 if player.GetDistance LucienLachanceFarragutRef <= 200 LucienLachanceFarragutRef.StartConversation Player Greeting set greet to 1 endifendif I guess I'm a bit confused what the "LucienLachanceFarragutRef" part means. Does "LucienLachance" represent Lucien's NPC ID? Farragut represents the location, Farragut. I keep having issues where the TES Construction Set grips about how my script is not valid. There is something in the Oblivion script that makes it work, but something in mine that does not. Btw, this NPC isn't part of a quest. It's merely an npc that pops up, says a few lines, then departs. The condition to make him originally spawn is merely time specific. Can I get away with not making a quest since I'm not using the npc in a quest? I wish there was a simple mod out there with a spawning npc that greets the PC so I could study it or a script template for greeting npc's.In that script, LucienLachanceFarragutRef refers to the Persistent RefID of a placed NPC (in this instance, one version Lucien LaChance). Load Fort Farragut in the Render Window, look through the Object List and you will probably find LucienLachanceFarragutRef. As for the CS not liking your script, there are a large number of reasons why that might be. If you post your script, we may be able to see where it's be going wrong. Also post the specific error message it gives you. As far as using a quest script goes, that's just one method of doing it. You could place your NPC somewhere, make it a persistent reference, and give the AI a condition to seek out the Player after the required time has passed. The only problem with that setup is that your NPC might have a hard time catching up to the Player (and could even die trying, unless he/she is essential). Using a quest script to first move your NPC near the Player, then enable him/her is a way to ensure that, no matter where in Tamriel the Player is, your NPC will get to the Player in a hurry. If you go that route, just make sure the Player is in the Tamriel worldspace (i.e., not indoors), otherwise your NPC might just fall into the void. Link to comment Share on other sites More sharing options...
Recommended Posts