I_Jedi Posted June 4, 2009 Share Posted June 4, 2009 For K2, would this script work: void main() { object oNPC = GetObjectByTag ("czerka_dock"); object oNB = GetObjectByTag ("noob_blaster"); ActionGiveItem(oNB, oNPC); ActionEquipItem(oNB, 4, int bInstant=FALSE); ActionEquipItem(oNB, 5, int bInstant=FALSE); } ...for making a creature equipping two weapons; with knowledge that czerka_dock and noob_blaster can be found. The const most likely in question is 155 in nwscript.nss Thanks if you know. If it doesn't work please give suggestions. Thanks again. Link to comment Share on other sites More sharing options...
DarthNandis Posted June 4, 2009 Share Posted June 4, 2009 Idk... you don't need to give 2 oNB to work right? Link to comment Share on other sites More sharing options...
I_Jedi Posted June 4, 2009 Author Share Posted June 4, 2009 The reason, I believe, I put two oNB is due to two inventory slots. So...would it work? Link to comment Share on other sites More sharing options...
Exile007 Posted June 4, 2009 Share Posted June 4, 2009 The inb-instant part of your script seems to be causing a syntax error when you compile. Also, you aren't telling the oNPC guy to actually equip the weapon, unless the script is fired in a certain way. Try this variation; I don't know if it actually works in-game, but it does at least get past the compile portion of the process. void main() { object oNPC = GetObjectByTag ("czerka_dock"); object oNB = GetObjectByTag ("noob_blaster"); ActionGiveItem(oNB, oNPC); AssignCommand(oNPC, ActionEquipItem(oNB, 4)); AssignCommand(oNPC, ActionEquipItem(oNB, 5)); } Link to comment Share on other sites More sharing options...
I_Jedi Posted June 4, 2009 Author Share Posted June 4, 2009 "unless the script is fired in a certain way" Which way is that? Link to comment Share on other sites More sharing options...
Pavlos Posted June 4, 2009 Share Posted June 4, 2009 It's been a while but... "unless the script is fired in a certain way" Which way is that? If the script is fired from a dialogue node ("spoken" by the creature in question) or one of the scripts listed in the *.utc file then it should work, otherwise you have to tell the game who should be performing the action with the AssignCommand()... command. Link to comment Share on other sites More sharing options...
I_Jedi Posted June 4, 2009 Author Share Posted June 4, 2009 I have tried it and it didn't work. It is supposed to fire when a certain accessible node is spoken by the NPC. Link to comment Share on other sites More sharing options...
Pavlos Posted June 4, 2009 Share Posted June 4, 2009 I have tried it and it didn't work. It is supposed to fire when a certain accessible node is spoken by the NPC. Check to see if the item is definitely in the creature's inventory; check that the *.uti is definitely in the override; make sure that the script name is no more than sixteen characters and is correctly listed in the dialogue file; make sure that its tag is definitely "noob_blaster", and the same for the creature. What is probably easier than what you're doing is simply to create the item on the creature and then have him equip it: void main() { object oNPC = GetObjectByTag("OBJECT_SELF"); // I am guessing that you want the creature to be dual wielding; you therefore need to create the item *twice* object oItem1 = CreateItemOnObject("OBJECT_TEMPLATE_RESREF"); object oItem2 = CreateItemOnObject("OBJECT_TEMPLATE_RESREF"); // This should tell you if the items are being created or if there's a problem somewhere; // it won't tell you which one but I'm out of practice if (!GetIsObjectValid(oItem1) && !GetIsObjectValid(oItem2)) { SendMessageToPC(GetFirstPC(), "Something wrong with item creation"); return; } // Equip the items AssignCommand(oNPC, ActionEquipItem(oItem1, INVENTORY_SLOT_RIGHTWEAPON)); DelayCommand(0.1, AssignCommand(oNPC, ActionEquipItem(oItem2, INVENTORY_SLOT_LEFTWEAPON))); } Link to comment Share on other sites More sharing options...
I_Jedi Posted June 4, 2009 Author Share Posted June 4, 2009 That worked! Thanks. I believe that I read somewhere that kotor tool messes up the utc files in a thread. So, with that information, how do I make a weapon undroppable or not available in the remains? Link to comment Share on other sites More sharing options...
Mandalore_The_Great Posted June 6, 2009 Share Posted June 6, 2009 So, with that information, how do I make a weapon undroppable or not available in the remains? An easy way would be to click the "undroppable" box when making a new item(or editing an old one, for that matter). I can't remember a scripting solution at the moment. Haven't made a mod in... maybe a year Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.