Jump to content

"onhitwith" triggered by armor?


davidlallen

Recommended Posts

I am trying to accomplish a special effect where a suit of armor has a force shield which is very effective against energy weapons. When hit by energy weapons, a sparkle effect occurs and the wearer takes almost no damage. I have done this but in a poor way, and I hope somebody can suggest a better way. I have created a spell effect, which calls a shader. I would like to associate this with an armor. But, the only way I can find to trigger it is with "begin onhitwith EnergyWeapons" (an existing formlist) in the NPC script.

 

How can I associate an impact effect with an armor, instead of on the NPC directly? I will have many different NPCs with different scripts who might wear the armor, and I would really like this effect to go on the armor.

Link to comment
Share on other sites

I'll work on this more when I've got a mind to but atm I'm doing some heavy lifting myself. But this is what I found in the time I can spare: I figure that you can have the armor add a perk, and that perk can have a quest+stage type associated with it, then you can use that quest and the script you created for it to use the begin onhitwith codeblocks that you had before. I hopes this helps.
Link to comment
Share on other sites

Thanks for the suggestion. I already have the onhitwith working for actor scripts. Since NPCs cannot have perks, and I want the armor to be used by several classes of NPCs, I am not sure that a perk would be a good approach. I will try to look around in the oblivion forums, since "magic armor" like this may be more common in fantasy than SF.
Link to comment
Share on other sites

Have you tried using an Object effect for the armor, that has a base effect with a script to get the actor ref (getcontainer) in the scripteffectstart, then check for actorref.onhitwith int the scripteffectUpdate?

I haven't done anything like this - just throwing the idea out there.

Link to comment
Share on other sites

Idea that popped into my head not sure if it would work but,

 

Couldn't you add an impact script to all energy weapon ammunition, that checks if the ammunition is hitting the armor, and if it is it executes said commands, and from what I've read impact scripts execute before any damage is applied.

 

good luck with it.

Link to comment
Share on other sites

There are two problems with putting it as a script on energy weapons. The first is, some weapons already have scripts, and I don't want to go editing all these scripts. It will cause conflicts with other mods. The second is, if another mod adds energy weapons, I want the effect to work for those weapons also. So, if I can make it work, putting it on my armor seems like a better approach.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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