Jump to content

Is there a way to script in a termporary boost to skills


Recommended Posts

I'm wanting to script in a way to temporarily boost an NPC's skill on a random chance. I can figure out the random part out, but the boosting of skill I'm not sure of. What is happening in my current mod state is that the script calls an NPC from a holding cell and enables them. What I want is the boost to randomly occur before the enabling, but I also want it to be temporary because when you defeat the NPC, another script recalls them back tot he cell, resurrects, and then disables them so that they can be used again. I'd also like to place this script in with the OnDeath script I have placed on each NPC.

 

Any ideas on how to do this?

Link to comment
Share on other sites

Couldn't you use spells for this? Just create several of the same kind of skill spell with varying degrees of settings and randomly assign one to each of your NPCs. When they are enabled, it is there with them. When they die, have your script that moves them back also remove the spell and assign a new one so it will be ready-to-go when you pull them out next.

 

LHammonds

Link to comment
Share on other sites

Couldn't you use spells for this? Just create several of the same kind of skill spell with varying degrees of settings and randomly assign one to each of your NPCs. When they are enabled, it is there with them. When they die, have your script that moves them back also remove the spell and assign a new one so it will be ready-to-go when you pull them out next.

 

LHammonds

 

I don't think that would work with what I'm trying to achieve. They would have to cast the spell in order for the effect to take place right?

 

I am thinking of just going about it differently now. What about using SetActorValue? I could just have the script change the skill once they die after a random chance decides the skill amount. Not sure about syntax though. Would this work?

 

short doonce

float C

Begin OnDeath

NPC1.disable

NPC1.moveto AAHoldingCell

NPC1.resurrect

Set C to Rand 1 2

If C == 1 NPC1.SetActorValue Alteration 150

Endif

If C == 2 NPC1.SetActorValue Alteration 50

Endif

 

Where NPC1 is the npc being enabled.

 

I'm not really sure what the float does, but I've been told its necessary for the random numbers that determine the outcome of the variable for C.

Link to comment
Share on other sites

I can't recall the specifics but I thought there was a way to make it an active effect...not so much having it where they can cast. But if you don't care to retain the original skill setting, then the method you just described would be a much better (faster / elegant) solution.

 

LHammonds

Link to comment
Share on other sites

I can't recall the specifics but I thought there was a way to make it an active effect...not so much having it where they can cast. But if you don't care to retain the original skill setting, then the method you just described would be a much better (faster / elegant) solution.

 

LHammonds

 

 

Good. I was hoping that would work. I thought about that after I typed in the first post.

 

I take the underline as a compliment :D

Link to comment
Share on other sites

Most definitely. You can contain everything inside a single script..no fuss, no muss. It would a much different scenario to create various spells and try to keep up with it all. :thumbsup:
Link to comment
Share on other sites

Hmm. I just thought of something. How would I aply that to multiple NPCs without having to write unqiue scripts for each of them. I have over 12 NPCs so far and possibly 3+ more.
Link to comment
Share on other sites

Not too sure about this, but maybe this would work?

Lets assume just 3 npc's are being used. Tom, Dick and Harry.

 

if((NPC1.GetIsID Tom == 1 || NPC1.GetIsID Dick == 1 || NPC1.GetIsID Harry == 1) && C == 1)

SetActorValue Alteration 150

if((NPC1.GetIsID Tom == 1 || NPC1.GetIsID Dick == 1 || NPC1.GetIsID Harry == 1) && C == 2)

SetActorValue Alteration 50

endif

endif

 

I know this is not too clear but i hope you see what i am getting at.

Link to comment
Share on other sites

Not too sure about this, but maybe this would work?

Lets assume just 3 npc's are being used. Tom, Dick and Harry.

 

if((NPC1.GetIsID Tom == 1 || NPC1.GetIsID Dick == 1 || NPC1.GetIsID Harry == 1) && C == 1)

SetActorValue Alteration 150

if((NPC1.GetIsID Tom == 1 || NPC1.GetIsID Dick == 1 || NPC1.GetIsID Harry == 1) && C == 2)

SetActorValue Alteration 50

endif

endif

 

I know this is not too clear but i hope you see what i am getting at.

 

That might work, but I have 15 npcs, and that would be a large string for one line. Would that be a problem? If not, that

would definately eliminate the need for 15 different scripts that all do the same thing.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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