Jump to content

OBSE CompareName function help


Surilindur

Recommended Posts

Hello again,

 

I have a small clothing-related project that involves checking whether the name of a certain item contains a certain word. OBSE seems to offer such a function, the CompareName, and I did manage to make it work, but I have run into a small problem. I have traced it to the combination CompareName and string_var.

 

When I enter the word directly into the function, it works. Like the following:

 

If CompareName "Legion" Item

(do something)

EndIf

 

But when I try to use a string_var ("Keyword", for example) containing the word, the function does not work. Like the following:

 

If CompareName Keyword Item

(do something)

EndIf

 

So I would like to know whether or not it is possible to use some kind of string. And if it is, am I doing something wrong? I would like to be able to change the variable and then run the same script again, so as to be able to determine which keyword (there will be many) the name includes.

Link to comment
Share on other sites

  • 5 years later...
  • Recently Browsing   0 members

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