Jump to content

Search an armor in a list ( in a geck script )


hereticus

Recommended Posts

Hello everybody !

 

I have an issue with a script that don't return "1" when searching an armor in a list ...

 

I first create a list with the item outfitmerc01 (hereticuslist)

 

An object , when added to an npc inventory do this :

 

scn nonworkingscript

 

ref contid

ref armor

 

begin onadd

 

set contid to getcontainer ;catch the npc id that have the object

 

set armor to contid.getequippedobject 2 ; catch the id of the npc armor (NVSE function)

 

if armor.isinlist hereticuslist ; show the message "test" if the armor is in the list

showmessage test

endif

end

 

 

But it don't work at all :( , and when i change the "showmessage test" by "additem (something)" ... kill contid ... or wathever ... it don't work ... :(

 

BUT , if i do this :

 

if armor == outfitmerc01

showmessage test

endif

 

It work , but the list of armors is realy long so the code is not optimized and it's more difficult for me to manage it with the entire code ... a list with all armors is realy better !

 

Thanks in advance ,

 

Hereticus

Edited by hereticus
Link to comment
Share on other sites

This seems like a slightly complicated approach. If I understand, you want to do something when any actor picks up this item, while also wearing any armor which is mentioned in your formlist. Getcontainer will give you the ref of the actor. Then it seems that you can use "if ref.getequipped myarmorlist".
Link to comment
Share on other sites

This seems like a slightly complicated approach. If I understand, you want to do something when any actor picks up this item, while also wearing any armor which is mentioned in your formlist. Getcontainer will give you the ref of the actor. Then it seems that you can use "if ref.getequipped myarmorlist".

 

Thank you , i'll try it this evening :P

 

I also responded on the bethsoft forums duplicate thread : http://forums.bethsoft.com/index.php?/topic/1160419-search-an-armor-in-a-list-in-a-geck-script/

Link to comment
Share on other sites

  • Recently Browsing   0 members

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