Difference between revisions of "SetNthIngredient - ConstructibleObject"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Seigneur Voland
imported>Seigneur Voland
m
 
(2 intermediate revisions by the same user not shown)
Line 14: Line 14:
*Ing : the new Form of the Ingredient
*Ing : the new Form of the Ingredient


*n : the Nth Ingredient of the ContructibleObject
*n : the Nth Ingredient of the ConstructibleObject


== Return Value ==
== Return Value ==
Line 21: Line 21:
== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
; Replaces in RecipeArmorIronCuirass LeatherStrips by DaedraHeart & IngotIron by SteelIngot
; Replaces in RecipeArmorIronCuirass LeatherStrips by DaedraHeart & IngotIron by IngotSteel
ConstructibleObject Recipe = RecipeArmorIronCuirass
ConstructibleObject Recipe = RecipeArmorIronCuirass
Recipe.SetNthIngredient(DaedraHeart, 0)
Recipe.SetNthIngredient(DaedraHeart, 0)
RecipeArmorIronCuirass.SetNthIngredient(SteelIngot, 1)
RecipeArmorIronCuirass.SetNthIngredient(IngotSteel, 1)


; Replaces the n Ingredient of a recipe by a corresponding Form from a FormList
; Replaces the n Ingredient of a recipe by a corresponding Form from a FormList
Line 31: Line 31:


== Notes ==
== Notes ==
None
This function does not allow to create new Ingredients, it can only replace existing ones.
 
== See Also ==
== See Also ==
*[[ConstructibleObject Script]]
*[[ConstructibleObject Script]]
*[[MiscObject Script]]
*[[MiscObject Script]]
*[[GetNthIngredient - ConstructibleObject]]
*[[GetNthIngredient - ConstructibleObject]]

Latest revision as of 05:22, 7 August 2012

SKSE Member of: ConstructibleObject Script

Sets the Nth Ingredient of a ConstructibleObject to the specified Form. (This function requires SKSE)

Syntax[edit | edit source]

Function SetNthIngredient(Form Ing, Int n) native

Parameters[edit | edit source]

  • Ing : the new Form of the Ingredient
  • n : the Nth Ingredient of the ConstructibleObject

Return Value[edit | edit source]

None

Examples[edit | edit source]

; Replaces in RecipeArmorIronCuirass LeatherStrips by DaedraHeart & IngotIron by IngotSteel
ConstructibleObject Recipe = RecipeArmorIronCuirass
Recipe.SetNthIngredient(DaedraHeart, 0)
RecipeArmorIronCuirass.SetNthIngredient(IngotSteel, 1)

; Replaces the n Ingredient of a recipe by a corresponding Form from a FormList
(ConstructibleObjectList.GetAt(i) as ConstructibleObject).SetNthIngredient(IngotList.GetAt(i), n)

Notes[edit | edit source]

This function does not allow to create new Ingredients, it can only replace existing ones.

See Also[edit | edit source]