Jump to content

Figure out Perk level


SameOldBard

Recommended Posts

Function GetPerkRank() is not exposed to Papyrus but you can utilize it through ConditionForms.

Create 4 ConditionForms in SF1Edit, each one should have only one condition item at Condition #0.

Condition data   --->   Type: Equal to; Comparison Value: X; Function: GetPerkRank; Perk: YourPerk; Run on: Subject.

X = the PerkRank you want the ConditionForm to look for.

So, by creating 4 ConditionForms with Comparison values 1, 2, 3, 4, only one ConditionForm would return True. And the one that returns True tells the PerkRank of theTargetReference.

 

In Papyrus:

ConditionForm HasPerkRank1 = (Game.GetFormFromFile(0x123, "YourMod.esp") as ConditionForm)
ConditionForm HasPerkRank2 = (Game.GetFormFromFile(0x456, "YourMod.esp") as ConditionForm)

If HasPerkRank1.IsTrue(theTargetReference, theTargetReference)
	Debug.MessageBox("theTargetReference has Rank 1 of the perk defined in the ConditionForm data")
ElseIf HasPerkRank2.IsTrue(theTargetReference, theTargetReference)
	Debug.MessageBox("theTargetReference has Rank 2 of the perk defined in the ConditionForm data")
EndIf

0x123 and 0x456   --->   replace these with the FormIDs of the ConditionForms

"YourMod.esp"   --->   replace with the name of the where this ConditionForm lives

theTargetReference   --->   replace with the Actor Reference you want the ConditionForm function GetPerkRank to be called on

 

Edited by LarannKiar
Link to comment
Share on other sites

24 minutes ago, LarannKiar said:

Function GetPerkRank() is not exposed to Papyrus but you can utilize it through ConditionForms.

Create 4 ConditionForms in SF1Edit, each one should have only one condition item at Condition #0.

Condition data   --->   Type: Equal to; Comparison Value: X; Function: GetPerkRank; Perk: YourPerk; Run on: Subject.

X = the PerkRank you want the ConditionForm to look for.

So, by creating 4 ConditionForms with Comparison values 1, 2, 3, 4, only one ConditionForm would return True. And the one that returns True tells the PerkRank of theTargetReference.

 

In Papyrus:

ConditionForm HasPerkRank1 = (Game.GetFormFromFile(0x123, "YourMod.esp") as ConditionForm)
ConditionForm HasPerkRank2 = (Game.GetFormFromFile(0x456, "YourMod.esp") as ConditionForm)

If HasPerkRank1.IsTrue(theTargetReference, theTargetReference)
	Debug.MessageBox("theTargetReference has Rank 1 of the perk defined in the ConditionForm data")
ElseIf HasPerkRank2.IsTrue(theTargetReference, theTargetReference)
	Debug.MessageBox("theTargetReference has Rank 2 of the perk defined in the ConditionForm data")
EndIf

0x123 and 0x456   --->   replace these with the FormIDs of the ConditionForms

"YourMod.esp"   --->   replace with the name of the where this ConditionForm lives

theTargetReference   --->   replace with the Actor Reference you want the ConditionForm function GetPerkRank to be called on

 

Woo. Thanks. That certainly will do.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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