Jump to content

Scripting: GetEquipped for Armor Addons (glasses, etc)


WildCard21

Recommended Posts

So this is for a personal mod I'm making that's supposed to make the Friend of the Night perk a bit more immersive by giving the player low-light vision UNLESS they're wearing some form of protective eyewear (sunglasses, power armor helmets, and such). I'm very new to scripting but a fellow modder was able to help me with the GetEquipped function for checking if the target is wearing a specific piece of equipment. The problem is that this function only covers armor objects and weapons, not armor addons like glasses or gloves.

 

Getting around this small caveat could have some nice implications for future mods. I'll be working on this issue myself but was wondering if any experienced script writers had any advice. I'm not afraid to try using NVSE and, if it comes out well enough, I might publish the mod when I'm done :) Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

You could use this function.

 

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

 

(ID of equipped glasses goes here) = Player.GetEquippedObject 11

 

It can check for what object is equipped in the eyeglasses spot. You could just set the game to turn on the low light thing if this function returns 0 (there are no eyeglasses equipped), or you could find a way to check if the item is actually some sort of sunglasses. I guess that would involve checking the returned ID from GetEquippedObject against a list of all sunglasses in the game.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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