Jump to content

Papyrus - Check if Player is Thane


Saerileth

Recommended Posts

Is there some quest stage connected with the housecarls that you could use? You only get one after becoming thane. I don't know anything about quest design, just throwing a suggestion out there.

That was mentioned in the first sentence of my first post lol. It's how she(?) was doing it originally, but it didn't work, so she switched to figuring out how the guards check.

Edited by Xander9009
Link to comment
Share on other sites

Exactly, checking quest stages does not seem to work, at least not the way I tried initially. The GetOutofJail freecard works like a charm (see my previous post for code), so all is well.

 

PS: "She" is quite correct.

Edited by Saerileth
Link to comment
Share on other sites

It's not an instance, it's still a type of sorts. It's just that papyrus is set up such that if you replace a type with a script in a property declaration, it'll get the type from whatever the script extends. So, then it can refer to a script and its properties and functions. It actually works exactly the same as any other type because the other types each have their own script. For instance, there's a script called Quest. So when you make a property of type Quest, it gets checks the Quest script and you can refer to all its functions, and since the Quest script extends the Form script, you can use its functions as well. Form doesn't extend anything. And it'll refer to the script instance attached to whatever the property is set to. Quests and other items get their respective scripts attached automatically and invisibly. So, when you make a quest property "quest property somequest auto", it's just calling the functions from the script "quest" attached to "somequest". If that was confusing, ignore it. If it was wrong and you know it, you'll have to tell me lol (it's the only thing I've come up with on the subject that makes any of the properties make sense to me). Anyway, I'm glad you got it working again.

 

EDIT: Side note, do {} work for comments? I've never seen that. I always use ;/ /; for comment blocks.

Edited by Xander9009
Link to comment
Share on other sites

You are correct about the types, but the issue was another one. When I typed

FavorJarlsMakeFriendsScript.WhiterunImpGetOutofJail

notice that on the left side of the dot is the name of a script, not the name of a property or variable. This works for global functions or variables on the right-hand-side, e.g.

SKSE.GetVersionRelease()

will compile fine. It does not work with properties obviously, in Java that would be the equivalent of trying to access an attribute without creating an object first. That is why Papyrus tells me that I cannot access properties on a type.

 

{} are used for tooltips of scripts/properties. If a property declaration is followed by comments in curly brackets, later when you're in the property editor and mouse over that property the description will show up as a tooltip. Same when adding scripts (curly brackets right after the name / extends clause). Pretty useful, actually.

Link to comment
Share on other sites

  • 2 months later...

Hey there, I'm trying like mad to get this working as well, the best I have going is the favorquest stage 200 check which puts the banner active if you are ELIGIBLE for Thanedom, but haven't nailed down how to get this working. You shared the script that worked for you, but I notice it says that it extends another script of yours, could you possibly show that script so that I could piece them together and get some insight into getting these working. Thanks a bunch, yours is the best lead I've had so far

Link to comment
Share on other sites

Actually, I only have the banner scripts inherit from Replica_Script so I can use polymorphism - put all my displays into one array and treat them uniformly. I have a lot of different displays in my player home, some react to quest stages, some to other conditions. They all inherit from Replica Script and overwrite the OnUpdate() event. They also inherit the following function from Replica Script, but you can put that into the banner script just as well:

Function Notify()
	RegisterForSingleUpdate(0.1)
EndFunction

Now I don't know how you want to trigger your banners to check for thanehood. You don't want them to do it continuously, that would be a waste of resources. I have a custom activator (looks like a journal book) that has a list of all displays in the area, and whenever it is activated it will call Notify() on all of them. You can also have your banners check for thanehood whenever the cell is loaded, to do that change the OnUpdate() event to onLoad() or OnCellAttach(). That way your banners will become completely self-sufficient and you wont need another activator to control them (you won't need the Notify() function either).

 

Hope this helps, feel free to ask if you have more questions.

Link to comment
Share on other sites

Awesome, that helps. I wasn't aware there was a replica script, I was wondering where the register for update was, that's probably why it isn't working for me yet. But yes I have all the other displays in my museum which are conditional and quest stage related use an onattach event and they work swimmingly.

 

Now I just have to figure out how to get locations which don't have bosses to register as cleared at a certain point :)

Link to comment
Share on other sites

Yeah I usually scope stuff out there, but missed that one somehow. I'm really just trying to find a way of retroactively determining if a dungeon has been cleared so that people who use my mod won't have to re-explore a place to get the exploration achievement display activated, right now I just use a default trigger in the entrance which works fine, but trying to find a retroactive solution which doesn't seem realistic since many locations don't seem to have the clear status possibility on their location data. Thanks for the info
Link to comment
Share on other sites

Ah, I see. I don't think that's possible, if Skyrim doesn't track the information there's no way you can get it out of the savegames. You could see if IsCleared() shakes out, but odds are that flag is never set by the game if a location doesn't have a boss.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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