Jump to content

Recommended Posts

Posted (edited)

In Creation Kit, can a keyword be added to an armor that is in another mod but does not have to keep it a dependency?

 

I'm working with keywords to create conditions for dialogue and events. I have a specific armor that I want to trigger dialogue for, but the armor mod sits on its own mod. Without merging the two mods, how can I get the keyword attached in my mod without putting the full armor mod into mine?

 

 The situation for context — I'm using the keyword WornHasKeyword as a condition where if the player sneaks and is wearing revealing armor, the follower will make a comment. 

 

My theory is just adding an ARMO form in my mod, with the keyword attached that overrides the one in the armor mod (ignore the ARMA form), but that would likely still give me two pieces of the same armor instead of just adding the keyword to one? You can imagine the reason I ask if that I don't want to add 5 armor mods and make them all dependencies jsut so I can add keywords to them.

Edited by rydin
Adding further context
Posted
Just now, Tlam99 said:

Set the armor mod as master for your mod. Then you can use everything out of the master.

 

But won't I then have to keep that mod as a master dependency? (ie, if that master mod is not installed, the mod won't work at all?)

Posted

You'll need to use soft dependancies for your mod and conditional variables in your dialogue to do this.

 

You need to check if the plugin that contains the armor with the unique keyword is present, and if it is, set the value of the conditional variable storing it to true. Then call the check function in a script fragment in your dialogue to have it properly set the conditional variable that you will use as a dialogue condition for the line you want to trigger only if said armor with the specific keyword is worn.

 

In code form, this looks something like this:

Scriptname MyModScript extends Quest Conditional

;this boolean stores if the keyword we are looking for was found on one of the player's armors, so set a conditional variable
;this can be used as a condition for dialogue in the creation kit
;you need to set this with a script, potentially on the preceeding dialogue line
Bool Property PlayerWearsAwesomeArmor = False Auto Conditional

;will be filled with the keyword we are looking for
Keyword AwesomeArmorKeyWord = None

;will run when the mod is first loaded and set things
Event OnInit()
	;check if the plugin containing the armor and keyword is present
	If Game.GetModByName("SomeArmorMod.esp") != 255
		;since the plugin is present, we can pluck the keyword from it
		;provided that we know its ID, can be checked in xedit
		AwesomeArmorKeyWord = Game.GetFormFromFile(0x0000ABCD, "SomeArmorMod.esp") as Keyword
	EndIf
EndEvent

;will be called during dialogue, before the line with the condition that the awesome armor is worn
;needs to be called in a script fragment to set the conditional variable properly for the subsequent dialogue lines
Function CheckForCustomKeyword()
	If Game.GetPlayer().WornHasKeyword( AwesomeArmorKeyWord )
		PlayerWearsAwesomeArmor = True
	Else
		PlayerWearsAwesomeArmor = False
	EndIf
EndFunction

It may be a bit rough, but I think you get the idea.

Posted
5 minutes ago, Taki17 said:

You'll need to use soft dependancies for your mod and conditional variables in your dialogue to do this.

 

You need to check if the plugin that contains the armor with the unique keyword is present, and if it is, set the value of the conditional variable storing it to true. Then call the check function in a script fragment in your dialogue to have it properly set the conditional variable that you will use as a dialogue condition for the line you want to trigger only if said armor with the specific keyword is worn.

 

In code form, this looks something like this:

Scriptname MyModScript extends Quest Conditional

;this boolean stores if the keyword we are looking for was found on one of the player's armors, so set a conditional variable
;this can be used as a condition for dialogue in the creation kit
;you need to set this with a script, potentially on the preceeding dialogue line
Bool Property PlayerWearsAwesomeArmor = False Auto Conditional

;will be filled with the keyword we are looking for
Keyword AwesomeArmorKeyWord = None

;will run when the mod is first loaded and set things
Event OnInit()
	;check if the plugin containing the armor and keyword is present
	If Game.GetModByName("SomeArmorMod.esp") != 255
		;since the plugin is present, we can pluck the keyword from it
		;provided that we know its ID, can be checked in xedit
		AwesomeArmorKeyWord = Game.GetFormFromFile(0x0000ABCD, "SomeArmorMod.esp") as Keyword
	EndIf
EndEvent

;will be called during dialogue, before the line with the condition that the awesome armor is worn
;needs to be called in a script fragment to set the conditional variable properly for the subsequent dialogue lines
Function CheckForCustomKeyword()
	If Game.GetPlayer().WornHasKeyword( AwesomeArmorKeyWord )
		PlayerWearsAwesomeArmor = True
	Else
		PlayerWearsAwesomeArmor = False
	EndIf
EndFunction

It may be a bit rough, but I think you get the idea.

 

Thanks! This looks like it could work for me. I'll give it a go. Kudos for a scripting example!

 

18 minutes ago, VersuchDrei said:

 

Thanks! I'll take a look at it!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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