Oaks 28 Posted June 23, 2018 Hi! I am making a mod but I still need a script for the end of the battle. I need a script that makes the enemy fade away or just walk away instead of dying. Also you cant get any xp from his defeat. Many thanks to the one that help me with this. Quote Share this post Link to post Share on other sites
DarthParametric 3,783 Posted June 23, 2018 I believe you'd need to set the Minimum 1 HP flag in the NPC's UTC, then in its OnUserDefined script when its health hits some specific value have it end combat and change the NPC's faction to neutral and probably use ActionStartConversation to launch a dialogue if you want it to happen in a cutscene (you could just have it walk/run to a waypoint and then be destroyed, but that would be kind of awkward if the player still has active control). You may want to check out existing examples of that sort of thing, like say the Malak fight on the Leviathan. 1 Quote Share this post Link to post Share on other sites
Oaks 28 Posted June 24, 2018 But how do I make they fade away like Malak and Bastila in TSL? Quote Share this post Link to post Share on other sites
A Future Pilot 161 Posted June 24, 2018 Like so: DestroyObject("your_NPC", 0.0, 0, 0.0); The first 0.0 is the delay before the object is destroyed, the second 0 tells it to fade, and the third is how long to delay before fading (you may need to set a delay before the object is destroyed in order to see the fade effect). Quote Share this post Link to post Share on other sites
Oaks 28 Posted June 24, 2018 Thanks I was able to do what I wanted. But I still have a problem. I want my characters to receive 0 XP but the game keeps giving me 20 XP. Any one knows how to solve this? Quote Share this post Link to post Share on other sites
A Future Pilot 161 Posted June 24, 2018 Is your script calling another script that might be giving XP? If so, you may be able to counteract it with GiveXPToCreature(oPC, -20); Assuming oPC is the main player, and that GiveXPToCreature accepts negative values (I've never tried it). If your script isn't calling another script, I'm not positive why it would be giving XP. Quote Share this post Link to post Share on other sites
Oaks 28 Posted June 24, 2018 40 minutes ago, A Future Pilot said: Is your script calling another script that might be giving XP? If so, you may be able to counteract it with GiveXPToCreature(oPC, -20); Assuming oPC is the main player, and that GiveXPToCreature accepts negative values (I've never tried it). If your script isn't calling another script, I'm not positive why it would be giving XP. This wont work, I already tried. Quote Share this post Link to post Share on other sites
A Future Pilot 161 Posted June 24, 2018 Is this a new NPC you've made, or one already in the game? It could be that his OnDeath script gives XP. Quote Share this post Link to post Share on other sites
Oaks 28 Posted June 24, 2018 33 minutes ago, A Future Pilot said: Is this a new NPC you've made, or one already in the game? It could be that his OnDeath script gives XP. Originally yes, but I changed the ondeath script to give 0 xp and then removed the line. It still gives 20 xp. Quote Share this post Link to post Share on other sites
JCarter426 1,214 Posted June 24, 2018 I don't believe you can stop the game from giving you XP or get negative XP. Your best bet would be to copy the scripts from the tomb. Quote Share this post Link to post Share on other sites