Jump to content

Home

Trouble with scripting an item to Inventory


harIII

Recommended Posts

I am working on a mod for K1 and there is a script that I need to take affect. I've tried to script an item into your inventory but for some reason it has yet to take effect. I've tried three different Lucasforums examples and two or three source game examples and yet it doesn't take effect.

 

I am inserting the script in a dialog and the preticular section of dialog is an option that you select.

 

I'm not sure if the script is correct or wrong or if I am placeing it in area where it isn't taking affect.

Link to comment
Share on other sites

Thanks, I'll try it. This is new dialog that I am working with and I've done a few things to recruit others, turn them hostile, make merchants, but this one has be stumpped as to what to do. I'm not sure if it is the dialog or the script but should this help for anything, my dialog does indeed work. I'm placing the script in an area where you have to select what the you want to say to the NPC.

Link to comment
Share on other sites

void main()

{

object oItem=CreateItemOnObject("k33_itm_sithmdln", GetFirstPC());

}

 

The k33_itm_sithmdln is the tag or templateresref of my custom item.

 

Actually, what you've done is to declare an action as an object, and that is wrong. Here is the correct form:

 

void main()
{
object oItem = GetObjectByTag("k33_itm_sithmdln");
object oPC = GetFirstPC();

CreateItemOnObject(oItem, oPC);
}

 

This works for K2 and should work for K1, too!;)

 

EDIT: @D3 Well I didn't know that, since I script mainly for TSL and that seems wrong. But if you say it isn't, I have no reason to doubt that.;)

 

|I|

Link to comment
Share on other sites

Thanks for you input and I will try it some more tonight. I do know about the compiling and do have an idea about how to fire scripts but I just don't know wheather the problem is in the section of fireing the script or the programming of the script itself.

 

I will do more testing and tell what happens.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...