harIII Posted November 14, 2008 Share Posted November 14, 2008 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 More sharing options...
Star Admiral Posted November 14, 2008 Share Posted November 14, 2008 You might want to consider posting an example of your code, as it is a bit difficult to isolate what is wrong without it. - Star Admiral Link to comment Share on other sites More sharing options...
harIII Posted November 14, 2008 Author Share Posted November 14, 2008 void main() { object oItem=CreateItemOnObject("k33_itm_sithmdln", GetFirstPC()); } The k33_itm_sithmdln is the tag or templateresref of my custom item. Link to comment Share on other sites More sharing options...
Star Admiral Posted November 14, 2008 Share Posted November 14, 2008 I'm not a scripting expert, but your code looks fine to me. What dialog is supposed to fire the script? You could try adding a feedback message to your code to see if it even fires at all. DelayCommand(4.0, SendMessageToPC(GetPartyLeader(), "MY SCRIPT IS RUNNING!")); - Star Admiral Link to comment Share on other sites More sharing options...
harIII Posted November 14, 2008 Author Share Posted November 14, 2008 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 More sharing options...
Darth333 Posted November 14, 2008 Share Posted November 14, 2008 Is k33_itm_sithmdln the name of your .uti file? Link to comment Share on other sites More sharing options...
harIII Posted November 17, 2008 Author Share Posted November 17, 2008 Yes, I know that it's the same name as the Sith Medallion that you use on Korriban but I have the new item which is called the Master's Medallion in the override folder. Link to comment Share on other sites More sharing options...
Darth333 Posted November 18, 2008 Share Posted November 18, 2008 The ingame name doesn't matter. What matters is the file name: make sure that it is the same as the one in your script unless you want to replace an actual game item. Link to comment Share on other sites More sharing options...
The Padawannabe Posted November 18, 2008 Share Posted November 18, 2008 I think I may have the solution. Have you compiled the files together yet? Link to comment Share on other sites More sharing options...
Istorian Posted November 18, 2008 Share Posted November 18, 2008 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 More sharing options...
Darth333 Posted November 18, 2008 Share Posted November 18, 2008 The other way works just fine in Kotor too. It might just be a compilation issue like The Padawannabe said or the script is not being fired. Link to comment Share on other sites More sharing options...
harIII Posted November 19, 2008 Author Share Posted November 19, 2008 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.