Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

 

 



I'm making a DLC MCM version of my mod however I would like to make it available to use with Vanilla Skryim without glitching the recipes I added. Is there a way to do that?

If your recipes are using DLC items, traditionally the answer would be no the DLC is a hard requirement because of that. However, SKSE has added numerous functions to the ConstructibleObject script. With them you could have your recipes use stock/vanilla items and swap them out for the DLC items if the DLC is present. You can also include a condition that a global variable be at a certain value in order for the recipes to display. If the DLC is present, set the global. Otherwise leave the global at a non-matching value and those without the DLC won't even see the recipes.

 

I'm taking a look in more depth into using something like this, I've started the script but I get a ton of errors when trying to compile. Is it possible to get an example of what item swap would look like to give me a base reference please?

 

This is my best guess as I haven't actually swapped items before on recipes via script.

ConstructibleObject Property MyRecipe Auto
MiscObject Property MyPlaceHolderIngredient Auto
Form MyDLCIngredient

;some event

If GetModByName("SomeDLC.esm") != 255
	MyDLCIngredient = Game.GetFormFromFile(0x00123456,"SomeDLC.esm")
EndIf

Int NumIng = MyRecipe.GetNumIngredients()
While NumIng >= 0
	If MyRecipe.GetNthIngredient(NumIng) == MyPlaceHolderIngredient
		MyRecipe.SetNthIngredient(MyDLCIngredient,NumIng)
	EndIf
	NumIng -= 1
EndWhile

;end some event 

 

Would this be the same if the DLC ingredient is the constructible object and not the required to make the item?

 

For Instance, the constructed object would be 1 Ancestor Moth Wing but would require gold to craft it.

 

Script I came up with but I still get an error pertaining to this line.

 

 

 

Function DawnguardCompatibility()
If LCCADLCDawnguard.getValue() == 0
ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetSize()
CurrentRecipe.SetResult("DragonflyBlue")
ElseIf LCCADLCDawnguard.getValue() == 1
LCCA_DGIngredientsFList.AddForm(Game.GetFormFromFile(0x020059BA, "Dawnguard.esm")) ;Ancestor Moth Wing
DG_RecipeIngredientAncestorMothWing.SetResult("DLC01MothWingAncestor")
EndIf
EndFunction

 

 

I can see where your script is going wrong. GetSize() returns an integer count of the total number of entries in the form list. You use GetAt() to work with a specific entry.

Your lines:

ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetSize()
CurrentRecipe.SetResult("DragonflyBlue")

Become:

Int RecipeListCount = LCCA_DGIngredientRecipesFlist.GetSize()
While RecipeListCount >= 0
  RecipeListCount -= 1
  ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetAt(RecipeListCount)
  CurrentRecipe.SetResult("DragonFlyBlue")
EndWhile

I got the position of the subtraction wrong in the earlier example. When you are using a variable that starts with the total number of entries, you have to subtract one first because the GetSize() function returns the total count starting at 1 yet GetAt() uses an index count starting at 0.

Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

 

 

I'm making a DLC MCM version of my mod however I would like to make it available to use with Vanilla Skryim without glitching the recipes I added. Is there a way to do that?

If your recipes are using DLC items, traditionally the answer would be no the DLC is a hard requirement because of that. However, SKSE has added numerous functions to the ConstructibleObject script. With them you could have your recipes use stock/vanilla items and swap them out for the DLC items if the DLC is present. You can also include a condition that a global variable be at a certain value in order for the recipes to display. If the DLC is present, set the global. Otherwise leave the global at a non-matching value and those without the DLC won't even see the recipes.

 

I'm taking a look in more depth into using something like this, I've started the script but I get a ton of errors when trying to compile. Is it possible to get an example of what item swap would look like to give me a base reference please?

 

This is my best guess as I haven't actually swapped items before on recipes via script.

ConstructibleObject Property MyRecipe Auto
MiscObject Property MyPlaceHolderIngredient Auto
Form MyDLCIngredient

;some event

If GetModByName("SomeDLC.esm") != 255
	MyDLCIngredient = Game.GetFormFromFile(0x00123456,"SomeDLC.esm")
EndIf

Int NumIng = MyRecipe.GetNumIngredients()
While NumIng >= 0
	If MyRecipe.GetNthIngredient(NumIng) == MyPlaceHolderIngredient
		MyRecipe.SetNthIngredient(MyDLCIngredient,NumIng)
	EndIf
	NumIng -= 1
EndWhile

;end some event 

 

Would this be the same if the DLC ingredient is the constructible object and not the required to make the item?

 

For Instance, the constructed object would be 1 Ancestor Moth Wing but would require gold to craft it.

 

Script I came up with but I still get an error pertaining to this line.

 

 

 

Function DawnguardCompatibility()
If LCCADLCDawnguard.getValue() == 0
ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetSize()
CurrentRecipe.SetResult("DragonflyBlue")
ElseIf LCCADLCDawnguard.getValue() == 1
LCCA_DGIngredientsFList.AddForm(Game.GetFormFromFile(0x020059BA, "Dawnguard.esm")) ;Ancestor Moth Wing
DG_RecipeIngredientAncestorMothWing.SetResult("DLC01MothWingAncestor")
EndIf
EndFunction

 

 

 

I can see where your script is going wrong. GetSize() returns an integer count of the total number of entries in the form list. You use GetAt() to work with a specific entry.

Your lines:

 

 

ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetSize()
CurrentRecipe.SetResult("DragonflyBlue")

Become:

Int RecipeListCount = LCCA_DGIngredientRecipesFlist.GetSize()
While RecipeListCount >= 0
  RecipeListCount -= 1
  ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetAt(RecipeListCount)
  CurrentRecipe.SetResult("DragonFlyBlue")
EndWhile

I got the position of the subtraction wrong in the earlier example. When you are using a variable that starts with the total number of entries, you have to subtract one first because the GetSize() function returns the total count starting at 1 yet GetAt() uses an index count starting at 0.

 

 

Ok got that working, thank you. However, now the swap isn't working in game any ideas?

Edited by LadyCrystyna
Link to comment
Share on other sites

 

 

 

I'm making a DLC MCM version of my mod however I would like to make it available to use with Vanilla Skryim without glitching the recipes I added. Is there a way to do that?

If your recipes are using DLC items, traditionally the answer would be no the DLC is a hard requirement because of that. However, SKSE has added numerous functions to the ConstructibleObject script. With them you could have your recipes use stock/vanilla items and swap them out for the DLC items if the DLC is present. You can also include a condition that a global variable be at a certain value in order for the recipes to display. If the DLC is present, set the global. Otherwise leave the global at a non-matching value and those without the DLC won't even see the recipes.

 

I'm taking a look in more depth into using something like this, I've started the script but I get a ton of errors when trying to compile. Is it possible to get an example of what item swap would look like to give me a base reference please?

 

This is my best guess as I haven't actually swapped items before on recipes via script.

ConstructibleObject Property MyRecipe Auto
MiscObject Property MyPlaceHolderIngredient Auto
Form MyDLCIngredient

;some event

If GetModByName("SomeDLC.esm") != 255
	MyDLCIngredient = Game.GetFormFromFile(0x00123456,"SomeDLC.esm")
EndIf

Int NumIng = MyRecipe.GetNumIngredients()
While NumIng >= 0
	If MyRecipe.GetNthIngredient(NumIng) == MyPlaceHolderIngredient
		MyRecipe.SetNthIngredient(MyDLCIngredient,NumIng)
	EndIf
	NumIng -= 1
EndWhile

;end some event 

 

Would this be the same if the DLC ingredient is the constructible object and not the required to make the item?

 

For Instance, the constructed object would be 1 Ancestor Moth Wing but would require gold to craft it.

 

Script I came up with but I still get an error pertaining to this line.

 

 

 

Function DawnguardCompatibility()
If LCCADLCDawnguard.getValue() == 0
ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetSize()
CurrentRecipe.SetResult("DragonflyBlue")
ElseIf LCCADLCDawnguard.getValue() == 1
LCCA_DGIngredientsFList.AddForm(Game.GetFormFromFile(0x020059BA, "Dawnguard.esm")) ;Ancestor Moth Wing
DG_RecipeIngredientAncestorMothWing.SetResult("DLC01MothWingAncestor")
EndIf
EndFunction

 

 

 

I can see where your script is going wrong. GetSize() returns an integer count of the total number of entries in the form list. You use GetAt() to work with a specific entry.

Your lines:

 

 

ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetSize()
CurrentRecipe.SetResult("DragonflyBlue")

Become:

Int RecipeListCount = LCCA_DGIngredientRecipesFlist.GetSize()
While RecipeListCount >= 0
  RecipeListCount -= 1
  ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetAt(RecipeListCount)
  CurrentRecipe.SetResult("DragonFlyBlue")
EndWhile

I got the position of the subtraction wrong in the earlier example. When you are using a variable that starts with the total number of entries, you have to subtract one first because the GetSize() function returns the total count starting at 1 yet GetAt() uses an index count starting at 0.

 

 

Ok got that working, thank you. However, now the swap isn't working in game any ideas?

It was late when I replied. There might need to be a cast.

ConstructibleObject CurrentRecipe = LCCA_DGIngredientRecipesFlist.GetAt(RecipeListCount) as ConstructibleObject

 

Reason I say this is that the form list, lists the forms but doesn't list the type of form. If that doesn't help, test on a new game if you haven't been already. And if that doesn't help, I'm just as clueless as you are.

Link to comment
Share on other sites

So say I build the mod with DLC, can it be run without DLC being installed. I didn't remove the DLC masters, loaded it in the game without the DLC enabled. Game and mod loaded fine, had no issues or are my files bugged.

 

I thought if the mod required the DLC then without it wouldn't load.

Link to comment
Share on other sites

So say I build the mod with DLC, can it be run without DLC being installed. I didn't remove the DLC masters, loaded it in the game without the DLC enabled. Game and mod loaded fine, had no issues or are my files bugged.

 

I thought if the mod required the DLC then without it wouldn't load.

Are you modding original Skyrim or SSE? If SSE, as I understand it, the game will re-enable all the DLC. If original Skyrim, the game should have crashed.

Link to comment
Share on other sites

 

 

So say I build the mod with DLC, can it be run without DLC being installed. I didn't remove the DLC masters, loaded it in the game without the DLC enabled. Game and mod loaded fine, had no issues or are my files bugged.

 

I thought if the mod required the DLC then without it wouldn't load.

Are you modding original Skyrim or SSE? If SSE, as I understand it, the game will re-enable all the DLC. If original Skyrim, the game should have crashed.

 

 

Original Skyrim, not SSE. It didn't crash with the DLC disabled through mod organizer. Was the MCM version I've been working on, I had the mod checks running for DLC though.

Edited by LadyCrystyna
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...