Oaks

Fade or walk away script

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

  • Thanks 1

Share this post


Link to post
Share on other sites

But how do I make they fade away like Malak and Bastila in TSL?

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.