lonewolfkai Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
LHammonds Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
lonewolfkai Posted May 5, 2010 Author Share Posted May 5, 2010 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 dooncefloat CBegin 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 More sharing options...
LHammonds Posted May 5, 2010 Share Posted May 5, 2010 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 More sharing options...
lonewolfkai Posted May 6, 2010 Author Share Posted May 6, 2010 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 More sharing options...
LHammonds Posted May 6, 2010 Share Posted May 6, 2010 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 More sharing options...
lonewolfkai Posted May 7, 2010 Author Share Posted May 7, 2010 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 More sharing options...
slygothmog Posted May 7, 2010 Share Posted May 7, 2010 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 150if((NPC1.GetIsID Tom == 1 || NPC1.GetIsID Dick == 1 || NPC1.GetIsID Harry == 1) && C == 2)SetActorValue Alteration 50endifendif I know this is not too clear but i hope you see what i am getting at. Link to comment Share on other sites More sharing options...
lonewolfkai Posted May 7, 2010 Author Share Posted May 7, 2010 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 150if((NPC1.GetIsID Tom == 1 || NPC1.GetIsID Dick == 1 || NPC1.GetIsID Harry == 1) && C == 2)SetActorValue Alteration 50endifendif 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 More sharing options...
slygothmog Posted May 7, 2010 Share Posted May 7, 2010 I have seen a string of 16 characters all on one line in a script and this did not cause problems ( or none i noticed ), you can also use the elseif command so you only need to end with one endif and not the two that i did. Link to comment Share on other sites More sharing options...
Recommended Posts