Jump to content

Home

please help


Recommended Posts

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

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...