Begging from desperation: Keywords woes

Post » Tue Jun 19, 2012 3:04 am

Please tell me that I can do this... please tell me I can do this!

I am writing a script in which I want the keywords for the cuirass and ONLY the cuirass. Basically, this...

If ( Self.WornHasKeyword(ArmorCuirass) )
If ( Self.WornHasKeyword(ArmorMaterialDaedric) )

Please, oh please tell me that it will only pick up both keywords if they are attached to the same item. Would I have any better luck if I used something like...

If ( Self.WornHasKeyword(ArmorCuirass) && Self.WornHasKeyword(ArmorMaterialDaedric))

What I'm afraid of is if the wearer is dressed unevenly. Basically, if he is wearing a fur cuirass, which would satisfy the first part, but a Daedric helmet, satisfying the second part.

Is there any way to detect what the wearer is wearing in a certain slot... then testing the keywords from that slot?

Thank you! And PLEASE say there's hope! :-D
User avatar
Valerie Marie
 
Posts: 3451
Joined: Wed Aug 15, 2007 10:29 am

Post » Mon Jun 18, 2012 8:02 pm

both of those code bits should do the same thing, but neither will do what you are looking for.

From what the wiki says, it looks like WornHasKeyword will return true for anything the actor is wearing.
e.g.
Self.WornHasKeyword(ArmorCuirass)
will return true for the equipped cuirass but
Self.WornHasKeyword(ArmorMaterialDaedric)
will return true for the equipped boots

so
If ( Self.WornHasKeyword(ArmorCuirass) && Self.WornHasKeyword(ArmorMaterialDaedric))
will return true but not because the equipped chest slot has both keywords

http://www.creationkit.com/OnObjectEquipped_-_Actor
You might be able to get somewhere with this, saving the equipped armor as a variable then checking keywords (using HasKeyword instead of WornHasKeyword)

In this case
Event OnObjectEquipped(Form akBaseObject, ObjectReference akReference)if akBaseObject.HasKeyword(ArmorCuirass) && akBaseObject.HasKeyword(ArmorMaterialDaedric);should return true only if the specific equipment piece has both keywordsendifEndEvent
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm


Return to V - Skyrim