Reztea 34 Posted May 10, 2017 Hope the title is self explanatory, I need a script where an NPC (or PC) uses a force power on another NPC. Only reason the title is plural is because I may need more if my ideas decided to flourish. EDIT: Above statement is now true. I'm in need of a script that clears all effects of an NPC with their tag (I tried to make this script myself, not working.) Quote Share this post Link to post Share on other sites
Fair Strides 509 Posted May 10, 2017 Please post the code that you've already tried to use. Oftentimes it just needs a slight tweak, but if not, I can help out more. 1 Quote Share this post Link to post Share on other sites
bead-v 251 Posted May 10, 2017 Please post the code that you've already tried to use. I second that. You'll get more useful information from us if you try to solve the problem yourself first, and then present us with the exact issue and the code. And generally, you're not very likely to get tutorial answers to questions of the type "How do you script ______?". Instead, try to think of an example in the game and go decompile those scripts and see how it's done there. If you run into issues, post about that and it'll be much easier for us to help you. Plus, you will learn more. Quote Share this post Link to post Share on other sites
Reztea 34 Posted May 10, 2017 Please post the code that you've already tried to use. Oftentimes it just needs a slight tweak, but if not, I can help out more. I second that. You'll get more useful information from us if you try to solve the problem yourself first, and then present us with the exact issue and the code. And generally, you're not very likely to get tutorial answers to questions of the type "How do you script ______?". Instead, try to think of an example in the game and go decompile those scripts and see how it's done there. If you run into issues, post about that and it'll be much easier for us to help you. Plus, you will learn more. Alright, I'll look through the scripts, Bead-V Here's my script for clearing all effects of an NPC (failed miserably) void main() { object oNPC=GetObjectByTag("Atton"); ClearAllEffects(); } and I'm still in need of a script where a NPC could use a force power (Preferably Drain life or Force Lighting) on another NPC, that script plays a big role in the entire mod. Quote Share this post Link to post Share on other sites
bead-v 251 Posted May 10, 2017 (edited) If you write it like that, ClearAllEffects() is executed on the object that is the "OWNER" of the main function (the object that the script was run on). If you know a function affects an object, and it doesn't take that object as a parameter, then you can assume it's gonna operate on the OWNER. You can use AssignCommand() to specify the OWNER if need be. In your case: void main(){ object oNPC = GetObjectByTag("Atton"); AssignCommand(oNPC, ClearAllEffects()); } If Atton was the owner of the script, however, your original script would work. But apparently he wasn't, so you were clearing the effects on some other object. Edited May 10, 2017 by bead-v 1 Quote Share this post Link to post Share on other sites
Reztea 34 Posted May 10, 2017 If you write it like that, ClearAllEffects() is executed on the object that is the "OWNER" of the main function (the object that the script was run on). If you know a function affects an object, and it doesn't take that object as a parameter, then you can assume it's gonna operate on the OWNER. You can use AssignCommand() to specify the OWNER if need be. In your case: void main(){ object oNPC = GetObjectByTag("Atton"); AssignCommand(oNPC, ClearAllEffects()); } If Atton was the owner of the script, however, your original script would work. But apparently he wasn't, so you were clearing the effects on some other object. Script worked perfectly! Thank you. I did a quick run down KT, I tried de-compiling A_Atrend2.ncs with DeNCS, was unsuccessful. This is getting so stressful now, this one last script would be so helpful. Let's say it's a convo between Kreia and Mira. I would want Mira to hit Kreia with force lightning. I would need a script for this, one last help and I will be out of your hair! Thanks. Quote Share this post Link to post Share on other sites
Reztea 34 Posted May 10, 2017 Bump.Admin: Re-read the rules - particularly sections 6 and 8 - and discover why your Deadly Stream reputation has gone down. Bumping a thread - in less than an hour and a half? Quote Share this post Link to post Share on other sites
bead-v 251 Posted May 10, 2017 I tried decompiling a_atrend2.ncs with DeNCS. I got "partial-byte code does not match", which I assume is also what you got. Now I'm gonna teach you a trick: right click on the binary code and select 'View Decompiled Code'. Also, before you lose your head reading the entire script – this one has an include script inside it (or maybe several), and those functions and variables come first. So for the stuff specific to a_atrend2.ncs, you need to look at the end of the script. Quote Share this post Link to post Share on other sites
Reztea 34 Posted May 10, 2017 I tried decompiling a_atrend2.ncs with DeNCS. I got "partial-byte code does not match", which I assume is also what you got. Now I'm gonna teach you a trick: right click on the binary code and select 'View Decompiled Code'. Also, before you lose your head reading the entire script – this one has an include script inside it (or maybe several), and those functions and variables come first. So for the stuff specific to a_atrend2.ncs, you need to look at the end of the script. Expect no more Topics because YOU, my friend, SAVED MY LIFE. Thank you SO MUCH!! 1 Quote Share this post Link to post Share on other sites