Scripting QuestionHelp (Getting the armor a target is wearin

Post » Thu May 03, 2012 5:55 pm

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 whoref armorid;get a reference for NPC armor in upper body, lower body,;hand, foot slotset armorid to who.GetEquippedObject 20if armorid.GetIsID "FormIDGoesHere"   ;do somethingendif

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!
User avatar
nath
 
Posts: 3463
Joined: Mon Jan 22, 2007 5:34 am

Post » Thu May 03, 2012 2:46 pm

Duplicate topic. http://www.gamesas.com/topic/1340233-scripting-questionhelp-getting-the-armor-a-target-is-wearing/
User avatar
P PoLlo
 
Posts: 3408
Joined: Wed Oct 31, 2007 10:05 am


Return to IV - Oblivion