Achilles Posted August 9, 2004 Share Posted August 9, 2004 Has anyone ever tried to edit a function in a .ncs, then copy it into the Override folder? Does it work? I would try it myself but I don't have any savegames near the script that I want to test. TIA Link to comment Share on other sites More sharing options...
Glamador Posted August 9, 2004 Share Posted August 9, 2004 kotor save game editor does wonders for that Link to comment Share on other sites More sharing options...
Darth333 Posted August 9, 2004 Share Posted August 9, 2004 Originally posted by Achillies Has anyone ever tried to edit a function in a .ncs, then copy it into the Override folder? Does it work? Huh? What do you want to do? One thing you can sometimes do is to call the ExecuteScript function. You can have a look at the script in my MInd Trick forcepower if you wish, it calls that function and the source code is included in the package: http://www.pcgamemods.com/5904/ (source is not included in the all-in-one force power package due to the number of files). And what does KSE has to do with that? Link to comment Share on other sites More sharing options...
Achilles Posted August 9, 2004 Author Share Posted August 9, 2004 Originally posted by Darth333 Huh? What do you want to do? One thing you can sometimes do is to call the ExecuteScript function. You can have a look at the script in my MInd Trick forcepower if you wish, it calls that function and the source code is included in the package: http://www.pcgamemods.com/5904/ (source is not included in the all-in-one force power package due to the number of files). And what does KSE has to do with that? I want to change the items that the Assassination Droid on Korriban gives you after you destroy his Sith programming. I know that this is done via a script. I found the .ncs for that part and I want to know if I can change the items there, move it to the Override folder and have it work. Sorry if I wasn't clear. Link to comment Share on other sites More sharing options...
Darth333 Posted August 9, 2004 Share Posted August 9, 2004 Originally posted by Achillies I want to change the items that the Assassination Droid on Korriban gives you after you destroy his Sith programming. I know that this is done via a script. I found the .ncs for that part and I want to know if I can change the items there, move it to the Override folder and have it work. Sorry if I wasn't clear. Here is what you could try: (note this script will only add new objects, not replace existing ones) void main () { object oPC = GetPCSpeaker(); CreateItemOnObject("my_item1", oPC); CreateItemOnObject("my_item2", oPC); ExecuteScript("the_script_i_want_to_fire",oPC); } Save as a .nss file with a custom name then extract the dlg file, change the name of the script in the proper script field and type the name of the new script. I haven't checked the script but if the original script simply calls the CreateObjectOnItem function, you could simply replace it with your own script. In this case, simply remove the ExcecuteScript line. Link to comment Share on other sites More sharing options...
Achilles Posted August 10, 2004 Author Share Posted August 10, 2004 Originally posted by Darth333 Here is what you could try: (note this script will only add new objects, not replace existing ones) void main () { object oPC = GetPCSpeaker(); CreateItemOnObject("my_item1", oPC); CreateItemOnObject("my_item2", oPC); ExecuteScript("the_script_i_want_to_fire",oPC); } Save as a .nss file with a custom name then extract the dlg file, change the name of the script in the proper script field and type the name of the new script. I haven't checked the script but if the original script simply calls the CreateObjectOnItem function, you could simply replace it with your own script. In this case, simply remove the ExcecuteScript line. So I would replace "my_item1" with my file name and then "the_script_i_want_to_fire" with the script that already exists??? That seems circular, so I must be missing something. I'm still very new to scripts so please use small words Link to comment Share on other sites More sharing options...
Darth333 Posted August 10, 2004 Share Posted August 10, 2004 Originally posted by Achillies So I would replace "my_item1" with my file name and then "the_script_i_want_to_fire" with the script that already exists??? That seems circular, so I must be missing something. I'm still very new to scripts so please use small words yes, this is exactly what you have to do. A complete example would be: Let's say you want to add 2 items, one called my_sword.uti and another one my_armband.uti. Since it is on Korriban, I assume that the originial script attached to the droid's dlg file is something like k_pkor_blahblah.ncs. So to to fire this script and add your items at the same time you would use: void main () { object oPC = GetPCSpeaker(); CreateItemOnObject("my_sword", oPC); CreateItemOnObject("my_armband", oPC); ExecuteScript("k_pkor_blahblah",oPC); } Then save this script as achillies.nss Open the dlg file go to the dialog brach where the original script, k_pkor_blahblah, is atached and in the script field replace k_pkor_blahblah by achillies. One more thing: I haven't checked the script and where it is attached: i don't have my game with me. But you may have to replace: ExecuteScript("k_pkor_blahblah",oPC); by object oDroid= GetObjectByTag("droid_tag"); ExecuteScript("k_pkor_blahblah",oDroid); Is that any better? Link to comment Share on other sites More sharing options...
Achilles Posted August 10, 2004 Author Share Posted August 10, 2004 That's brilliant! I ended up using something slightly different to get it done, but I will definitely remember this for next time Thank you! Link to comment Share on other sites More sharing options...
Darth333 Posted August 10, 2004 Share Posted August 10, 2004 glad i could help Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.