Class BaseUnitTemplateConfigurator<T, TBuilder>
Implements common fields and components for blueprints inheriting from Kingmaker.Blueprints.BlueprintUnitTemplate.
Inheritance
Inherited Members
Namespace: BlueprintCore.Blueprints.Configurators
Assembly: BlueprintCore.dll
Syntax
public abstract class BaseUnitTemplateConfigurator<T, TBuilder> : BaseBlueprintConfigurator<T, TBuilder> where T : BlueprintUnitTemplate where TBuilder : BaseUnitTemplateConfigurator<T, TBuilder>
Type Parameters
Name | Description |
---|---|
T | |
TBuilder |
Remarks
Each supported blueprint type has a corresponding Configurator
class to create and modify blueprints of
that type, e.g. FeatureConfigurator supports BlueprintFeature
. Configurators exist for all
blueprint types inheriting from Kingmaker.Blueprints.BlueprintScriptableObject, excluding any that are not used in the
base game.
Creating a Blueprint
Use New(string, string)
to create a blueprint:
FeatureConfigurator.New(MyBlueprintName, MyBlueprintGuid)
Once New()
is called the blueprint is added to the game library and can be referenced.
Using the Configurator
New()
returns a configurator with methods to set or modify blueprint fields and add or modify
Kingmaker.Blueprints.BlueprintComponent:
FeatureConfigurator.New(MyBlueprintName, MyBlueprintGuid).AddToGroups(FeatureGroup.Feat).AddPrerequisiteAlignment(AlignmentMaskType.LawfulGood).Configure();
Each method call returns the configurator allowing you to chain calls. Nothing is modified on the blueprint until
Configure()
is called, at which point the changes are applied and validated. Potential problems with the
blueprint are logged as warnings.
Modifying an Existing Blueprint
Use For(Blueprint)
to modify existing blueprints:
CharacterClassConfigurator.For(WizardClassGuid)
Usage is otherwise identical to creating a new blueprint.
For more information see Using BlueprintCore.
Constructors
| Improve this Doc View SourceBaseUnitTemplateConfigurator(Blueprint<BlueprintReference<T>>)
Declaration
protected BaseUnitTemplateConfigurator(Blueprint<BlueprintReference<T>> blueprint)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintReference<T>> | blueprint |
Methods
| Improve this Doc View SourceAddToAddFacts(Blueprint<BlueprintUnitFactReference>[])
Adds to the contents of Kingmaker.Blueprints.BlueprintUnitTemplate.m_AddFacts
Declaration
public TBuilder AddToAddFacts(params Blueprint<BlueprintUnitFactReference>[] addFacts)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintUnitFactReference>[] | addFacts | Blueprint of type BlueprintUnitFact. You can pass in the blueprint using:
|
Returns
Type | Description |
---|---|
TBuilder |
AddToRemoveFacts(Blueprint<BlueprintUnitFactReference>[])
Adds to the contents of Kingmaker.Blueprints.BlueprintUnitTemplate.m_RemoveFacts
Declaration
public TBuilder AddToRemoveFacts(params Blueprint<BlueprintUnitFactReference>[] removeFacts)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintUnitFactReference>[] | removeFacts | Blueprint of type BlueprintUnitFact. You can pass in the blueprint using:
|
Returns
Type | Description |
---|---|
TBuilder |
AddToStatAdjustments(BlueprintUnitTemplate.StatAdjustment[])
Adds to the contents of Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustments
Declaration
public TBuilder AddToStatAdjustments(params BlueprintUnitTemplate.StatAdjustment[] statAdjustments)
Parameters
Type | Name | Description |
---|---|---|
Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustment[] | statAdjustments |
Returns
Type | Description |
---|---|
TBuilder |
ClearAddFacts()
Removes all elements from Kingmaker.Blueprints.BlueprintUnitTemplate.m_AddFacts
Declaration
public TBuilder ClearAddFacts()
Returns
Type | Description |
---|---|
TBuilder |
ClearRemoveFacts()
Removes all elements from Kingmaker.Blueprints.BlueprintUnitTemplate.m_RemoveFacts
Declaration
public TBuilder ClearRemoveFacts()
Returns
Type | Description |
---|---|
TBuilder |
ClearStatAdjustments()
Removes all elements from Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustments
Declaration
public TBuilder ClearStatAdjustments()
Returns
Type | Description |
---|---|
TBuilder |
CopyFrom(Blueprint<BlueprintReference<BlueprintUnitTemplate>>, Predicate<BlueprintComponent>)
Copies fields and components of the specified types from the blueprint.
Declaration
public TBuilder CopyFrom(Blueprint<BlueprintReference<BlueprintUnitTemplate>> blueprint, Predicate<BlueprintComponent> componentMatcher)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintReference<Kingmaker.Blueprints.BlueprintUnitTemplate>> | blueprint | |
System.Predicate<Kingmaker.Blueprints.BlueprintComponent> | componentMatcher | Any components in |
Returns
Type | Description |
---|---|
TBuilder |
Remarks
NOT A DEEP COPY. This means objects copied are shared between blueprints. Changes to copied objects affect both blueprints.
Recommended when you need to create a nearly identical ability but change some parts such as a
ContextRankConfig
.
// Copy the Undead Bloodline's Incorporeal Form ability, replacing the duration w/ Character Level rounds
AbilityConfigurator.New(NewIncorporealForm, Guids.NewIncorporealForm)
.CopyFrom(
AbilityRefs.BloodlineUndeadIncorporealFormAbility,
typeof(AbilityEffectRunAction),
typeof(AbilityResourceLogic),
typeof(SpellComponent))
.AddContextRankConfig(ContextRankConfigs.CharacterLevel())
.Configure();
CopyFrom(Blueprint<BlueprintReference<BlueprintUnitTemplate>>, Type[])
Copies fields and components of the specified types from the blueprint.
Declaration
public TBuilder CopyFrom(Blueprint<BlueprintReference<BlueprintUnitTemplate>> blueprint, params Type[] componentTypes)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintReference<Kingmaker.Blueprints.BlueprintUnitTemplate>> | blueprint | |
System.Type[] | componentTypes | Any components in |
Returns
Type | Description |
---|---|
TBuilder |
Remarks
NOT A DEEP COPY. This means objects copied are shared between blueprints. Changes to copied objects affect both blueprints.
Recommended when you need to create a nearly identical ability but change some parts such as a
ContextRankConfig
.
// Copy the Undead Bloodline's Incorporeal Form ability, replacing the duration w/ Character Level rounds
AbilityConfigurator.New(NewIncorporealForm, Guids.NewIncorporealForm)
.CopyFrom(
AbilityRefs.BloodlineUndeadIncorporealFormAbility,
typeof(AbilityEffectRunAction),
typeof(AbilityResourceLogic),
typeof(SpellComponent))
.AddContextRankConfig(ContextRankConfigs.CharacterLevel())
.Configure();
ModifyAddFacts(Action<BlueprintUnitFactReference>)
Modifies Kingmaker.Blueprints.BlueprintUnitTemplate.m_AddFacts by invoking the provided action on each element.
Declaration
public TBuilder ModifyAddFacts(Action<BlueprintUnitFactReference> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<Kingmaker.Blueprints.BlueprintUnitFactReference> | action |
Returns
Type | Description |
---|---|
TBuilder |
ModifyRemoveFacts(Action<BlueprintUnitFactReference>)
Modifies Kingmaker.Blueprints.BlueprintUnitTemplate.m_RemoveFacts by invoking the provided action on each element.
Declaration
public TBuilder ModifyRemoveFacts(Action<BlueprintUnitFactReference> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<Kingmaker.Blueprints.BlueprintUnitFactReference> | action |
Returns
Type | Description |
---|---|
TBuilder |
ModifyStatAdjustments(Action<BlueprintUnitTemplate.StatAdjustment>)
Modifies Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustments by invoking the provided action on each element.
Declaration
public TBuilder ModifyStatAdjustments(Action<BlueprintUnitTemplate.StatAdjustment> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustment> | action |
Returns
Type | Description |
---|---|
TBuilder |
OnConfigureCompleted()
Declaration
protected override void OnConfigureCompleted()
Overrides
RemoveFromAddFacts(Blueprint<BlueprintUnitFactReference>[])
Removes elements from Kingmaker.Blueprints.BlueprintUnitTemplate.m_AddFacts
Declaration
public TBuilder RemoveFromAddFacts(params Blueprint<BlueprintUnitFactReference>[] addFacts)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintUnitFactReference>[] | addFacts | Blueprint of type BlueprintUnitFact. You can pass in the blueprint using:
|
Returns
Type | Description |
---|---|
TBuilder |
RemoveFromAddFacts(Func<BlueprintUnitFactReference, Boolean>)
Removes elements from Kingmaker.Blueprints.BlueprintUnitTemplate.m_AddFacts that match the provided predicate.
Declaration
public TBuilder RemoveFromAddFacts(Func<BlueprintUnitFactReference, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<Kingmaker.Blueprints.BlueprintUnitFactReference, System.Boolean> | predicate |
Returns
Type | Description |
---|---|
TBuilder |
RemoveFromRemoveFacts(Blueprint<BlueprintUnitFactReference>[])
Removes elements from Kingmaker.Blueprints.BlueprintUnitTemplate.m_RemoveFacts
Declaration
public TBuilder RemoveFromRemoveFacts(params Blueprint<BlueprintUnitFactReference>[] removeFacts)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintUnitFactReference>[] | removeFacts | Blueprint of type BlueprintUnitFact. You can pass in the blueprint using:
|
Returns
Type | Description |
---|---|
TBuilder |
RemoveFromRemoveFacts(Func<BlueprintUnitFactReference, Boolean>)
Removes elements from Kingmaker.Blueprints.BlueprintUnitTemplate.m_RemoveFacts that match the provided predicate.
Declaration
public TBuilder RemoveFromRemoveFacts(Func<BlueprintUnitFactReference, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<Kingmaker.Blueprints.BlueprintUnitFactReference, System.Boolean> | predicate |
Returns
Type | Description |
---|---|
TBuilder |
RemoveFromStatAdjustments(BlueprintUnitTemplate.StatAdjustment[])
Removes elements from Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustments
Declaration
public TBuilder RemoveFromStatAdjustments(params BlueprintUnitTemplate.StatAdjustment[] statAdjustments)
Parameters
Type | Name | Description |
---|---|---|
Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustment[] | statAdjustments |
Returns
Type | Description |
---|---|
TBuilder |
RemoveFromStatAdjustments(Func<BlueprintUnitTemplate.StatAdjustment, Boolean>)
Removes elements from Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustments that match the provided predicate.
Declaration
public TBuilder RemoveFromStatAdjustments(Func<BlueprintUnitTemplate.StatAdjustment, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustment, System.Boolean> | predicate |
Returns
Type | Description |
---|---|
TBuilder |
SetAddFacts(Blueprint<BlueprintUnitFactReference>[])
Sets the value of Kingmaker.Blueprints.BlueprintUnitTemplate.m_AddFacts
Declaration
public TBuilder SetAddFacts(params Blueprint<BlueprintUnitFactReference>[] addFacts)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintUnitFactReference>[] | addFacts | Blueprint of type BlueprintUnitFact. You can pass in the blueprint using:
|
Returns
Type | Description |
---|---|
TBuilder |
SetCrBonus(Int32)
Sets the value of Kingmaker.Blueprints.BlueprintUnitTemplate.CrBonus
Declaration
public TBuilder SetCrBonus(int crBonus)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | crBonus |
Returns
Type | Description |
---|---|
TBuilder |
SetRemoveFacts(Blueprint<BlueprintUnitFactReference>[])
Sets the value of Kingmaker.Blueprints.BlueprintUnitTemplate.m_RemoveFacts
Declaration
public TBuilder SetRemoveFacts(params Blueprint<BlueprintUnitFactReference>[] removeFacts)
Parameters
Type | Name | Description |
---|---|---|
Blueprint<Kingmaker.Blueprints.BlueprintUnitFactReference>[] | removeFacts | Blueprint of type BlueprintUnitFact. You can pass in the blueprint using:
|
Returns
Type | Description |
---|---|
TBuilder |
SetStatAdjustments(BlueprintUnitTemplate.StatAdjustment[])
Sets the value of Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustments
Declaration
public TBuilder SetStatAdjustments(params BlueprintUnitTemplate.StatAdjustment[] statAdjustments)
Parameters
Type | Name | Description |
---|---|---|
Kingmaker.Blueprints.BlueprintUnitTemplate.StatAdjustment[] | statAdjustments |
Returns
Type | Description |
---|---|
TBuilder |