Jump to content

Changing XP for Specific Kill?


EPDGaffney

Recommended Posts

I would like to award a lot of XP to the player for killing a specific NPC. I see a way to add more XP after the default XP gain, but it looks really weird in-game. Can I somehow block the default one and just use my custom one, or can I modify the default one for just this NPC?

 

I don't care all that much if the player kills the NPC, as long as he's dead, so can I somehow take that 40% damage variable that the game tracks and requires the player to have dealt in order to award XP, and can I keep that at 0 for this one NPC? That way, when he dies, I can just award my custom 100 XP.

 

Thanks in advance.

Link to comment
Share on other sites

If you want custom anything for an NPC's death, the easiest way to do it is usually by giving the NPC a custom script and having an OnDeath section in that script. Then just have a "player.rewardxp 100" line in the OnDeath section of that script and your player gets 100 xp when the NPC is killed. If you do it this way, the player will always get the 100 xp even if a companion kills the NPC or if the NPC somehow kills himself (just the other day I had a Powder Ganger blow himself up with dynamite before I could even shoot at him, for example).

 

More info here:

http://geck.bethsoft.com/index.php?title=Scripting_for_Beginners

 

If you need more details, let me know.

Edited by madmongo
Link to comment
Share on other sites

Thanks, mongo. Unfortunately, that's what I have already. What happens however is that it awards 10, then you see your XP bar shoot up and it makes the XP sound, then it makes the sound again, then it awards 100 XP, then you see the bar shoot up to a different spot and it gets kind of glitchy in its display as it seems to be attempting to show both XP awards simultaneously.

 

So, I'm asking is it possible either to multiply the XP you'd normally get (it should be, with perks like Skilled), or can I somehow keep the game from awarding the XP it would normally give, so that I can use an OnDeath script.

 

Unrelated, been meaning to tell you that my Blender (now that I've sorted out the problems I was having) always exports with the correct shaders and I never have to go into NifSkope if I don't want to.

Link to comment
Share on other sites

How about a perk / entrypoint / adjust XP / add value / 100

 

And put a condition on it of "GetScriptVariable : MyNPC : iDead == 1"

 

Which you had put a script on the NPC to set the variable "iDead" upon death.

 

And then some how remove the perk or adjust iDead to 2 after that XP gain.

Edited by Mktavish
Link to comment
Share on other sites

That's exactly what I was going to try next, Mktavish. Thanks for confirming that it makes sense, haha. I was a bit worried that it wouldn't necessarily be timed correctly and the player would either get extra XP for other stuff or this NPC's death wouldn't 'catch' the perk effects before the player got the extra XP. Have to think about the implementation a bit.

 

Another workaround I thought of was making it a challenge with a message box and everything, so that when you kill him, you get 100 XP for the challenge, not necessarily for killing him. It would be something like:

 


Overlord Killer

You have gained a 50% damage bonus against Viper Overlords.

Too bad there aren't any more in the game.

Link to comment
Share on other sites

You mean have a challenge that is 99% winable ... pop it up upon the overlord death ... and then award xp ?

 

But I would think you could adjust their class / rank / sumthin to make the xp gain what you want ... all in one .

 

No need for tack on xp ... is a super mutant behemoth only worth 40xp ?

 

But I guess short answer ... have it a quest to kill said npc , then award xp for completing ?

Is that not already in your mod ?

Edited by Mktavish
Link to comment
Share on other sites

Well, he's very hard to kill, and he levels with the player, so it's a pretty tough challenge but if you kill him, you complete it. At least that's one idea.

 

And yes, each enemy is ranked from very easy to very hard, which as far as I know is based only on their level, and very hard enemies award 50 XP for a kill. I think he's worth more than that, even if I somehow rigged it to consider him very hard all the time but still level his stats with the player (which would be very annoying considering I just want to award some XP and make it look a little normal).

 

My mod is very anti-quest-marker and mostly pretty anti-quest in general. It is most definitely a quest mod, and in addition to its main quest there are many, many optional quests and wildly different approaches to achieving the same goal. This enemy happens to be quite optional. There's a puzzle behind one door, and if your character is just too combat-orientated to meet any of the intellectual requirements in that spot, you can try the other door for the fight of your life and a way to circumvent the puzzle.

 

So, with your perk idea, any idea how to make sure this NPC is the only one affected?

 

Otherwise, I may go with the challenge idea, or possibly the quest idea (which would be the same general concept with a different presentation).

Link to comment
Share on other sites

So is this npc the only source of xp in what I presume is its own cell for the fight ?

 

Because I'm having no luck with testing on the entry point of adjust xp up.

 

But if this is the only xp source in the cell ... then could give the player a Perk / Entry Point / Adjust XP / multiply value / 0 ... using the entry point to take away xp gain while in the cell , or in combat with the npc. Then with the npc script , award the xp with "Begin OnDeath"

 

But could do the same with other npc if they are also in the fight.

Edited by Mktavish
Link to comment
Share on other sites

So give them all a script of ...

 

Begin OnDeath

 

RewardXP 30

 

End

 

What ever int value per npc , and guessing quite a few can share the same script.

 

But on the Perk / EntryPoint / Adjust Xp / Multiply Value / 0

 

Use a condition of "GetInCell MyArena == 1"

 

And hopefully the XP given by the script won't get intercepted by the entry point ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...