Global Variables (question for experienced modders)

  • Topic Archived
You're browsing the GameFAQs Message Boards as a guest. Sign Up for free (or Log In if you already have an account) to be able to post messages, change how messages are displayed, and view media in posts.
  1. Boards
  2. The Elder Scrolls V: Skyrim
  3. Global Variables (question for experienced modders)

User Info: T3nd0

5 years ago#1
In vanilla Skyrim, there's a global variable PlayerFollowerCount. It's initially set to 0, and switches to 1 once you hire someone. Once your follower leaves, it switches back to 0. As long as it sits at 1, you can't hire more people.

I'm planning to change the way it works. It'll still start at 0, but instead increment by 1 (not "set to 1") once you hire someone. While it's at 1, you can't hire more followers, but, and now comes the main part, I want to include perks and probably a racial ability that reduces PlayerFollowerCount. That would result in negative values, allowing more followers to be hired until 1 is reached.

Question: How can I create perks that affect a global variable exactly once (take perk -> variable changes -> done)?

I have already done pretty much everything else (replace the "set"s with increment/decrement), so I have basic understanding of Papyrus. The main question is: Where do I insert the code?

User Info: Galahaut

5 years ago#2
The method that comes to mind first is using a Perk of the "Quest" type to run a small quest that runs a script that changes the variable's value.

There is also a Papyrus Fragment option for Entry Point perks, but I didn't see any entry points that would work appropriately for your situation. I'm not entirely sure how the fragments work yet, though.
Bobblehunt -
Keybards -

User Info: Slakr

5 years ago#3
While that sounds like it should work, you might want to test it first. Change it to increment by 1, and set the default to -1. If that won't work, you might have to set the maximum number to a higher integer (x) and set the default to 1 below that (x-1). For example, you can't hire once 6 is reached, and 5 is default (and the perk tree would allow for 5 "-1" perks).
I poisoned my dog so he can't keep chasing that baby giraffe.

User Info: T3nd0

5 years ago#4
Thanks for the input so far.

Currently doing some playtesting. Hiring works as it should, dismissing does not (yet).

I'll try to go the quest-skill route and will report back once I've reached either success or a barrier.

User Info: Dead Guy Hubbin

Dead Guy Hubbin
5 years ago#5
I'm trying to get this to work myself. Every dialogue line for potential followers that says they won't join you because you already have a follower has a condition that requires PlayerFollowerCount to be 1. What I'm doing is changing that number to something really high. Similarly, every dialogue line where they accept your invitation to join has a condition that requires the follower count to be 0. I just delete that condition altogether.

I haven't gotten around to testing it out yet, but someone else who's gotten a second follower to join him has had the original follower automatically leave. I don't remember what he changed though.

User Info: T3nd0

5 years ago#6
Partially successful. Now I'm facing strange issues.

Mostly, stuff works. I have successfully managed to hire Cicero, then Mercurio, with both following me. Also, I checked whether PlayerFollowerCount increases correctly ("show playerfollowercount") when hiring someone (it does) and decreases when sending them on their war (it does). Also, when hitting the limits, no more followers can be hired.

However, in the following scenario, strangeness happens:

~ set playerfollowercount to 9
~ show playerfollowercount


- Hire Janessa

~ show playerfollowercount

2.00000000 (???)

- Dismiss Janessa

~show playerfollowercount


In this scenario, Janessa messes up stuff. Anyone has any idea why?

User Info: T3nd0

5 years ago#7
Bump and new questions.

Why do I fail when attempting to mod PlayerFollowerCount in a Papyrus Fragment in the perk?

In theory, this should suffice:


But that just gives errors.

Also, does anyone know whether perks fire any events when picked? I have a new idea based on that.
  1. Boards
  2. The Elder Scrolls V: Skyrim
  3. Global Variables (question for experienced modders)

Report Message

Terms of Use Violations:

Etiquette Issues:

Notes (optional; required for "Other"):
Add user to Ignore List after reporting

Topic Sticky

You are not allowed to request a sticky.

  • Topic Archived