Darth_Tratious Posted May 26, 2005 Share Posted May 26, 2005 i'm a complete noob and am just starting to learn C++ i need help on how to edit this to make a human spawn. //note this code allows for re-entry as-is, // you should only attach it to a dialog // that you know will only fire once. // To prevent re-entry in a more general sense, see tk102's notes in the next post void main() { float x=0.00f; //Here is where you add the 'whereami' cheat coordinate 1. float y=0.00f; //Here is where you add the 'whereami' cheat coordinate 2. float z=0.00f; //Here is where you add the 'whereami' cheat coordinate 3. float r=0.0f; // This is where you set the orientation of the placeable, set in degrees. vector MyVec = Vector(x,y,z); //line 1 location MyLoc = Location(MyVec, r); //line 2 object oLocker=CreateObject( OBJECT_TYPE_PLACEABLE, "footlker099", MyLoc); //line3 CreateItemOnObject("g_w_lghtsbr05", oLocker); CreateItemOnObject("g_a_mstrrobe01", oLocker); CreateItemOnObject("g_w_sbrcrstl04", oLocker, 2); } Link to comment Share on other sites More sharing options...
mrdefender Posted May 26, 2005 Share Posted May 26, 2005 I found this when I was looking thru nss scripts... perhaps this is what you're looking for? void main() { CreateObject( OBJECT_TYPE_CREATURE, "p_atton", GetLocation(GetFirstPC())); } ? Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 Originally posted by mrdefender I found this when I was looking thru nss scripts... perhaps this is what you're looking for? void main() { CreateObject( OBJECT_TYPE_CREATURE, "p_atton", GetLocation(GetFirstPC())); } ? yes that helps thank you. Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 i also figured out how to do it by reading source code from one Of RedHawke's mods Link to comment Share on other sites More sharing options...
RedHawke Posted May 27, 2005 Share Posted May 27, 2005 Originally posted by Darth_Tratious i also figured out how to do it by reading source code from one Of RedHawke's mods That's why we modders include the source code to our mods scripts... to spread the evil... er'... wealth! Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 this script is gonna be used for a dark side so your right RedHawke spread the evil. Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 am i missing something here the NPC is not spawning void main() { float x=94.91f; float y=93.87f; float z=0.00f; float r=1.0f; vector vecNPC=Vector(x,y,z); location locNPC=Location(vecNPC, r); object oNPC=CreateObject(OBJECT_TYPE_CREATURE,"g_Darth_Vader",locNPC); object oPC=GetFirstPC(); AssignCommand(oNPC,ActionStartConversation(oPC,"g_Darth_Vader")); } Link to comment Share on other sites More sharing options...
Darth333 Posted May 27, 2005 Share Posted May 27, 2005 Double check the .utc file: make sure that what appears in the template resref is the same as your file name (also make sure it's not more than 16 characters). Also check the location where you attached the script to make sure it fires correctly. I am merging this thread with the previous one on the same topic (and for the future, it might help if you use descriptive titles such as "trouble spawning npcs" ). Edit: I also recommend you modify the last line of the script for: //this line will make your npc walk towards your PC AssignCommand((GetObjectByTag("g_Darth_Vader")),ActionMoveToObject(oPC)); //and initiate conversation AssignCommand((GetObjectByTag("g_Darth_Vader")), ActionDoCommand(ActionStartConversation(oPC))); Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 Originally posted by Darth333 Double check the .utc file: make sure that what appears in the template resref is the same as your file name (also make sure it's not more than 16 characters). Also check the location where you attached the script to make sure it fires correctly. I am merging this thread with the previous one on the same topic (and for the future, it might help if you use descriptive titles such as "trouble spawning npcs" ). Edit: I also recommend you modify the last line of the script for: //this line will make your npc walk towards your PC AssignCommand((GetObjectByTag("g_Darth_Vader")),ActionMoveToObject(oPC)); //and initiate conversation AssignCommand((GetObjectByTag("g_Darth_Vader")), ActionDoCommand(ActionStartConversation(oPC))); thanks Darth333 i'll try that i also have never been good with naming topics.this is my first NPC Mod Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 oh yeah almost forgot does it have be like g_Darth_Vader.utc or just g_Darth_Vader Link to comment Share on other sites More sharing options...
Darth333 Posted May 27, 2005 Share Posted May 27, 2005 Name your file g_darth_vader.utc Then put g_darth_vader in both the tag and template resref fields of the utc file (there is no reason to put different entries in those two fields unless you are planning to affect all the npcs having the same tag at the same time). Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 is it not spawning because i am missing a certain file i have the charecter .utc the Dialouge file and the spawn code am i missing anything that could not make it spawn. Link to comment Share on other sites More sharing options...
Darth333 Posted May 27, 2005 Share Posted May 27, 2005 Did you attached your script to the .dlg file? Did you compiled your script? Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 i've compiled my script how do i attach it to my script to my .dlg file Link to comment Share on other sites More sharing options...
Darth333 Posted May 27, 2005 Share Posted May 27, 2005 Originally posted by Darth_Tratious i've compiled my script how do i attach it to my script to my .dlg file You have to fire your script from somewhere, not necessarily from a .dlg but if you want to attach it to a .dlg, just type the name of your script in the script field (without the extension) of the dialogue branch you want. If this mod is for TSL, make sure you are using tk102's dlgeditor (available on our website: http://www.starwarsknights.com/tools.php ) and not Kotor tool's editor. More or less like this: http://img.photobucket.com/albums/v608/D333/dlgeditor.jpg (That screenshot was taken a while ago with one of the early versions of the editor. The editor has changed a lot since then but the principle is the same. Can't take a better screenie right now because I'm at the wrong PC). Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 Originally posted by Darth333 You have to fire your script from somewhere, not necessarily from a .dlg but if you want to attach it to a .dlg, just type the name of your script in the script field (without the extension) of the dialogue branch you want. If this mod is for TSL, make sure you are using tk102's dlgeditor (available on our website: http://www.starwarsknights.com/tools.php ) and not Kotor tool's editor. More or less like this: http://img.photobucket.com/albums/v608/D333/dlgeditor.jpg (That screenshot was taken a while ago with one of the early versions of the editor. The editor has changed a lot since then but the principle is the same. Can't take a better screenie right now because I'm at the wrong PC). thanks for all the help Link to comment Share on other sites More sharing options...
Darth_Tratious Posted May 27, 2005 Author Share Posted May 27, 2005 can someone tell me what VO_ResRef is Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.