Jump to content

Papyrus - Check if Player is Thane


Saerileth

Recommended Posts

Hi all,

 

I'm trying to make my player home display the banners of all the holds the player is thane of. To do that I need a script function that checks whether or not the player has become a thane in a particular hold.

 

Usually I'd try checking some quest stages, but the problem is there are several different quests associated with becoming a thane depending on which side was taken during the civil war questline (e.g. Whiterun: Dragon Rising or Battle for Whiterun). UESPWiki lists a quest called Favor253, but using that makes the banners appear too early (when the player has earned the jarl's trust, but not yet formally accepted the office).

 

Next I looked up the guard dialogue topics to figure out how they recognise thanes in their crime topics, but I'm not familiar with the notation used and I can't make sense of it. They somehow check a variable in the FavorJarlsMakeFriends quest, but I don't know how to make use of that.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

UESP doesn't list stage 25 which is the stage the quest is set to when the player is actually named Thane of Whiterun, at least when it's done through Vignar. I found that by looking in Vignar's dialogue and in the middle column of the left half of the dialogue window, I found the quest Favor253. The resulting dialogue showed Vignar sets the quest to stage 25 when he says "I name you Thane". The other Thane of ___ quests also seem to have the stage 25 which is where the player is given the weapon and their housecarls are enabled.

 

Balgruuf makes the player Thane in MQ104. He sets the stage to 160 to do it. At 160, the player is given the weapon and Lydia as expected. So, you should be able to check Whiterun with an or which checks Favor253 stage 25 and MQ104 stage 160.

 

The other holds don't seem to make you thane using the main quest. They all use the normal favor quests. Perhaps Solitude or Windhelm, but I don't think so. Check them to be sure, but they should all use the quests Favor250 to Favor258.

 

Favor251 is missing, which would have been for The Rift. The Rift uses the quest I Done Got Thaned (FreeformRiftenThane) and doesn't use stage 25, it activates everything at stage 200.

Link to comment
Share on other sites

  • 1 month later...

Sorry for reviving this thread, but a lot of my users report that the thane banners are actually not working. I think Whiterun performs as expected (using Favor253 stage 25 or MQ104 stage 160), but some of the other holds appear even when the player has never actually been to the respective city. I still can't figure out how guards recognise a thane, but I have a feeling that might be the place to look for a reliable solution. The Favor quests don't seem to do the job.

Link to comment
Share on other sites

  • 1 month later...

Sorry to bother you again, but I still can't get this to work. So I've opened the guards dialogue and found the following line among the prerequisites for the "I'm Thane, unhand me" option:

FavorJarlsMakeFriends.WhiterunImpGetOutofJail == 1

Apparently this value is initialised to 1 once the player becomes thane, and set to 2 after using the excuse to get out of trouble. So I should be able to check for > 0 to know if the player is infact thane of the respective hold (of course there are two values, for imperials or stormcloaks, not an issue I can just check both).

 

The trouble is, if used in a script attached to the banners this does not compile, I'm guessing because FavorJarlsMakeFriends is an alias and Papyrus does not know about this quest? So I should probably make a property called like that and use auto-fill. But I have no idea how to access the GetOutofJail variables, obviously the Quest script does not contain properties called like that...

 

Edit: a closer look at the FavorJarlsMakeFriends quest revealed that there is a FavorJarlsMakeFriendsScript, which contains the following properties:

Int Property WhiterunImpGetOutofJail Auto Conditional
Int Property WhiterunSonsGetOutofJail Auto Conditional

I have no idea what the conditional stands for, and trying to access the properties via

FavorJarlsMakeFriendsScript.WhiterunImpGetOutofJail > 0

fails with the following compiler error: a property cannot be used directly on a type, it must be used on a variable

Edited by Saerileth
Link to comment
Share on other sites

If you look at the properties of the script on that dialogue, you'll see the type used for the FavorJarlsMakeFriends property is FavorJarlsMakeFriendsScript. Make a property on your script of type FavorJarlsMakeFriendsScript and name FavorJarlsMakeFriends. Then autofill, and it should work.

Link to comment
Share on other sites

Ah, thank you! Got it to work. I think the problem was not with the property (wasn't even using one at the time), I was trying to access WhiterunImpGetOutofJail like a global variable of FavorJarlsMakeFriendsScript, this does not work. I needed an instance on the left side of the dot instead of a type.

 

For anyone interested, this is the final version of the script:

Scriptname Saeri_ReplicaScript_Thane extends Saeri_ReplicaScript

Int Property Hold Auto
{1 = Reach
2 = Rift
3 = Haafingar
4 = Whiterun
5 = Eastmarch
6 = Hjaalmarch
7 = Pale
8 = Winterhold
9 = Falkreath}

FavorJarlsMakeFriendsScript Property ThaneScript Auto Hidden

Event OnInit()
	ThaneScript = Game.GetForm(0x00087E24) As FavorJarlsMakeFriendsScript
EndEvent

Event OnUpdate()
	If(Hold == 1)
		If(thaneScript.ReachImpGetOutofJail > 0 || thaneScript.ReachSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 2)
		If(thaneScript.RiftImpGetOutofJail > 0 || thaneScript.RiftSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 3)
		If(thaneScript.HaafingarImpGetOutofJail > 0 || thaneScript.HaafingarSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 4)
		If(thaneScript.WhiterunImpGetOutofJail > 0 || thaneScript.WhiterunSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 5)
		If(thaneScript.EastmarchImpGetOutofJail > 0 || thaneScript.EastmarchSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 6)
		If(thaneScript.HjaalmarchImpGetOutofJail > 0 || thaneScript.HjaalmarchSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 7)
		If(thaneScript.PaleImpGetOutofJail > 0 || thaneScript.PaleSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 8)
		If(thaneScript.WinterholdImpGetOutofJail > 0 || thaneScript.WinterholdSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	ElseIf(Hold == 9)
		If(thaneScript.FalkreathImpGetOutofJail > 0 || thaneScript.FalkreathSonsGetOutofJail > 0)
			Enable(true)
		EndIf
	EndIf	
EndEvent

Thanks again for all your help. :smile:

Edited by Saerileth
Link to comment
Share on other sites

  • Recently Browsing   0 members

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