Jump to content

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


JosefGrey

Recommended Posts

Posted

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!

Archived

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

  • Recently Browsing   0 members

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