• Announcements

    • Ashal

      SITE MOVED - IN READ ONLY MODE   12/08/2015

      Please use http://www.loverslab.com moving forward. Site has been restored to a previous version, and this one placed into a read-only mode. This is available for a limited time so users may reference/copy content that has been lost in the transition. This will no longer be accessible by December 22nd, 2015.

Archived

This topic is now archived and is closed to further replies.

JosefGrey

Scripting Question/Help (Getting the armor a target is wearing)

Hey everyone. I'm taking a stab at learning Oblivion's scripting language and am working on a mod in which I have to get a reference for an NPC's equipped armor, then use it to compare to the formIDs in a list of custom armors to see which one the NPC is wearing. So far all I've gotten accomplished is becoming frustrated. Here's a brief example of what I'm trying to use to do this:


ref who
ref armorid

;get a reference for NPC armor in upper body, lower body,
;hand, foot slot
set armorid to who.GetEquippedObject 20
if armorid.GetIsID "FormIDGoesHere"
;do something
endif

From what I understand the GetIsID function should return a 1 if the reference belongs to the base object that the FormID represents. When the script runs in game however, it simply stops at the if statement (I'm assuming I'm using the GetIsID function incorrectly, but it looks valid based on the documentation on the construction set wiki). Can anyone please offer an alternative method or perhaps let me know what I'm doing wrong here? Thanks!

0

Share this post


Link to post