Jump to content

Need help optimizing cloak script


Magnusen2

Recommended Posts

I'm trying to implement a disguise feature in my perk mod through a cloak ability that is cast on every NPC that meets the faction conditions for that particular disguise. So far so good.

 

But the problem comes when i came with the realization that it would be best to add some sort of racial system that makes harder for certain races to disguise in particular factions (Stormcloaks would certainly note a tail XD).

 

 

  Reveal hidden contents

 

 

Anything i can do with the above code to improve it's performance? Also if anyone find any errors please point out.

Edited by Magnusen2
Link to comment
Share on other sites

If you want to include custom races at some future point, you may wish to use a formlist or an array for the races and race modifier. Also if you do your PlayerRaceModifier condition checks from lowest value up, you don't need to check to make sure it is between the two numbers.

 

Your script modified using arrays and the adjusted condition checks. I did not check for compilation.

 

  Reveal hidden contents

 

 

 

Link to comment
Share on other sites

 

  Reveal hidden contents

 

Thank you. That seems to do it. But now there's another problem.

 

I created the effects and spells to test on bandits, The effect gets applied, but they still attack me.

 

This is not the case with certain bandits (The ones on Fort Greymoor), Before i made some edits, they warned my character to back off or they would attack. With the code below they don't. I can even talk to them with no problems.

 

 

  Reveal hidden contents

 

 

How do i make any NPC hit by the effect friendly towards the player?

Edited by Magnusen2
Link to comment
Share on other sites

  • Recently Browsing   0 members

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