Jump to content

External file with kist of keywords


Recommended Posts

That probably would help for maxarturo's situation.

 

Make and use a keyword with the same name as a keyword in the other mod. Call GetKeyword and since both variants have the same text string as the EditorID, both should return true. Would need to be tested, obviously.

Link to comment
Share on other sites

Since I was curious I did a quick test and was right. I made the same keyword TM_KeyWord in 2 seperate esps. I put it on the ArmorDaedricBoots in esp A and the ArmorBladesBoots in esp B. Then I put this script on a quest in esp A:

 

Scriptname TM_QuestScript extends Quest 

Armor Property ArmorDaedricBoots Auto ;has TM_KeyWord in esp A
Armor Property ArmorBladesBoots Auto ;has TM_KeyWord in esp B
Keyword Property TM_KeyWord Auto ;Linked to the TM_KeyWord in esp A

Event OnInit() 
    Debug.MessageBox("ArmorDaedricBoots " + ArmorDaedricBoots.HasKeyword(TM_KeyWord) + \
    "\n ArmorBladesBoots " + ArmorBladesBoots.HasKeyword(TM_KeyWord))
EndEvent

It returned true for the ArmorDaedricBoots and false for the ArmorBladesBoots. I also switched load order and got the same result. Then I switched the script to this:

 

Scriptname TM_QuestScript extends Quest 

Armor Property ArmorDaedricBoots Auto 
Armor Property ArmorBladesBoots Auto 

Event OnInit() 
    Keyword TM_KeyWord = KeyWord.GetKeyword("TM_KeyWord")
    
    Debug.MessageBox("ArmorDaedricBoots " + ArmorDaedricBoots.HasKeyword(TM_KeyWord) + \
    "\n ArmorBladesBoots " + ArmorBladesBoots.HasKeyword(TM_KeyWord))
EndEvent

If doing it this way, it finds the first keyword that matches in your load order, as I suspected. If esp A was first, the ArmorDaedricBoots will return True and ArmorBladesBoots will return False and vice versa if esp B is first in the load order.

Link to comment
Share on other sites

Thanks dizietemblesssma, IsharaMeradin and dylbill.


This is useful data that i'll for sure check it later on, i uploaded the updated mod yesterday and i'm taking a few days off (or weeks) from modding to rest my brain from a 3 months continuous "Looping Mechanical Processes".


Thanks dylbill for getting into the trouble to run a few tests.


Just as a note:

The scripted part of the idea will be to search or identify the spesific keyword of the other mod.


So that the 'Default Quest Dialogue Condition System' (this also includes SM) can utilize the condition "LocationHasKeyword" to fire dialogue on specific targeted locations of other mods.


* Or inject the keyword to the mod i want to work with. This specific 'injection idea' is my last resource which i want to avoid doing just for 'Cleaning' reasons, i want to do it as clean as possible.


Thank you all very much for your interest.

Link to comment
Share on other sites

No problem. So I also tested the HasKeywordString skse function too:

 

Scriptname TM_QuestScript extends Quest 

Armor Property ArmorDaedricBoots Auto 
Armor Property ArmorBladesBoots Auto 

Event OnInit() 
    
    Debug.MessageBox("ArmorDaedricBoots " + ArmorDaedricBoots.HasKeywordString("TM_KeyWord") + \
    "\n ArmorBladesBoots " + ArmorBladesBoots.HasKeywordString("TM_KeyWord"))
EndEvent

It behaves the same way as GetKeyword and finds the first keyword in you load order. ArmorBladesBoots returns True and ArmorDaedricBoots returns False if esp B is first and vice versa. Since you are looking for a keyword from a specific mod I would recommend instead using GetFormFromFile.

Link to comment
Share on other sites

Hey dylbill, thank you very much again for your input and collaboration. This is indeed very useful data which it'll help me a lot nailing down the issue, whenever i get into it...

Link to comment
Share on other sites

No problem. One more thing if anyone's interested. I thought about it some more and I figured out a way to find out if a form has a keyword with a string from any esp:

Scriptname TM_QuestScript extends Quest 

Armor Property ArmorDaedricBoots Auto 
Armor Property ArmorBladesBoots Auto 

Event OnInit() 
    Debug.MessageBox("ArmorDaedricBoots " + akFormHasKeywordString(ArmorDaedricBoots, "TM_KeyWord") + \
    "\n ArmorBladesBoots " + akFormHasKeywordString(ArmorBladesBoots, "TM_KeyWord"))
EndEvent

Bool Function akFormHasKeywordString(Form akForm, String akString) 
    Keyword[] akKeywords = akForm.GetKeywords()
    
    Int M = akKeywords.Length 
    While M > 0 
        M -= 1 
        If akKeywords[M].GetString() == akString 
            Return True 
        Endif 
    EndWhile 
    
    Return False 
EndFunction
Doing it this way, both boots return true. It still requires skse.
Edit: Further testing revealed that using object references of the boots with this function, both return false. I also tried using GetNumKeywords and GetNthKeyword instead of the array, and they still return false. So use GetBaseObject() for object references with this function.
Link to comment
Share on other sites

  • Recently Browsing   0 members

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