darthriddick Posted April 2, 2007 Share Posted April 2, 2007 hi y'all, i need to add an NPC into the game, and just stand there until i'm ready to talk to him. i tryed using the add NPC script darth333 has in her add a npc in less than 10 steps tutorial, but this NPC is spawned during a fight, and that seems to mess up the script, as he will walk up to me but does not have any dialog options.... thanks! ~DR (the person that asks more questions than any other modder on the forums. XD) Link to comment Share on other sites More sharing options...
stoffe Posted April 2, 2007 Share Posted April 2, 2007 hi y'all, i need to add an NPC into the game, and just stand there until i'm ready to talk to him. i tryed using the add NPC script darth333 has in her add a npc in less than 10 steps tutorial, but this NPC is spawned during a fight, and that seems to mess up the script, as he will walk up to me but does not have any dialog options.... If you just want the NPC to stand there doing nothing in particular a simple script like this should work: void main() { vector vPos = Vector([color=Yellow]0.0, 0.0, 0.0[/color]); CreateObject(OBJECT_TYPE_CREATURE, "[color=PaleGreen]UTCFile[/color]", Location(vPos, 0.0)); } Change the part in yellow to the X, Y and Z coordinates where the NPC should be spawned. Change the part in green to the name of the UTC file (without the .utc extension) containing the template for the NPC to spawn. In the UTC template make sure you set the faction to Neutral (5) if you don't want the NPC to get involved in any nearby fights. Link to comment Share on other sites More sharing options...
darthriddick Posted April 2, 2007 Author Share Posted April 2, 2007 ok, thanks stoffe, that part works now, but i need to have the NPC attack if a certain dialog path is chosen, and i'm not sure how exactly to do that... anyway you (or someone else of course ^_^) could post a script for that as well? thanks again ~DR Link to comment Share on other sites More sharing options...
Pavlos Posted April 2, 2007 Share Posted April 2, 2007 ok, thanks stoffe, that part works now, but i need to have the NPC attack if a certain dialog path is chosen, and i'm not sure how exactly to do that... anyway you (or someone else of course ^_^) could post a script for that as well? thanks again ~DR You could create a script like this // a_playerattack.nss /* A script to cause NPC X to attack the player */ // 02/04/07 void main() { object oNPC = GetObjectByTag("MyNPCTag"); ChangeToStandardFaction(oNPC, STANDARD_FACTION_HOSTILE_1); } Or, if you are firing this from a dialogue node a_atkonend.nss (a generic script) can be used. Link to comment Share on other sites More sharing options...
stoffe Posted April 2, 2007 Share Posted April 2, 2007 Depending on what situation the script is used in you may need to kick start the NPC's combat AI to get them in combat mode, making them attack and not just stand there hostile waiting to be attacked, if their OnPerception script does not fire to register that there are enemies nearby. You could do that by adding this line to Pavlos' script: // a_playerattack.nss /* A script to cause NPC X to attack the player */ // 02/04/07 void main() { object oNPC = GetObjectByTag("MyNPCTag"); ChangeToStandardFaction(oNPC, STANDARD_FACTION_HOSTILE_1); [b]DelayCommand(0.5, ExecuteScript("k_ai_master", oNPC, 1003));[/b] } Link to comment Share on other sites More sharing options...
darthriddick Posted April 2, 2007 Author Share Posted April 2, 2007 YES! thanks guys! it works perfectly. Edit: Aww smeg. there IS ONE mor thing actually. (course with me there always is. ^_^) what i need now is after the npc hhas spawned, and after i have started talking to him, there will be a certain line that allows him to become a party member instead of dieing. or at least that's what i was hoping it would do... i tried using the add&replace NPC code used in darth333's tutorial, but i ran up against another problem.....(figures.) XD anyway, my problem is that the listings are not the same in TSL as they are in K1 (for instance t3m4 is not listed as faction ID (7) here is the code i was trying to use is this one here. void main() { RemoveAvailableNPC(7); AddAvailableNPCByTemplate(7, "p_nadd"); DelayCommand(1.5,ShowPartySelectionGUI()); } (and the list) BASTILA = 0 CANDEROUS= 1 CARTH = 2 HK_47 = 3 JOLEE= 4 JUHANI= 5 MISSION= 6 T3_M4 = 7 ZAALBAR = 8 I know i found the same list for TSL but i can't remember where, and i looked all over the forums, so if someone could post that, it'd be a great help. Link to comment Share on other sites More sharing options...
DarthStoney Posted April 2, 2007 Share Posted April 2, 2007 here is the list for k2. NPC numbers, as specified in NPC.2da 0 Atton 1 BaoDur 2 Mand 3 g0t0 4 Handmaiden 5 hk47 6 Kreia 7 Mira 8 T3m4 9 VisasMarr 10 Hanharr 11 Disciple Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.