Jump to content

Wanted to randomly assign perks at game start


Recommended Posts

Posted

Since I just started a new run, I thought about the perks. I noticed that, with a few exceptions, I always choose the same perks. Designed for my style of play, since I play without VATs.

 

Is there a mod that only randomly assigns the perks at the start of the game when the Vault representative knocks on the door? And otherwise doesn't change the perks?

Posted
11 minutes ago, ptmc2112 said:

Do you mean the S.P.E.C.I.A.L. stats that you pick at game start?

 

Yes, exclusively these. Right at the beginning, when the representative comes. I would like to have this random preset, that would bring a little more variety to the beginning of the game. I have set many of my mods' settings to random.

Posted

I know the total for all the stats must match an internal Game Setting (which I don't know if it can be changed via scripts) called uSPECIALPoints. The default number (without any mod changing it) is 28.

 

I don't know if any mod for it already exists, but one way it could be made would have to use https://falloutck.uesp.net/wiki/GetGameSettingInt_-_Game to get the current value for it, then some use of https://falloutck.uesp.net/wiki/RandomInt_-_Utility to randomize how much each stat gets, and either some math to make sure the total matches that value (no idea how), or just re-rolling each time till the total matches.

Posted

It is a bit complicated because you would have to hook into the game only when setting SPECIAL stats (not adding to them) and it also begs the question: Do I want the SPECIAL stats randomized twice (first when you meet the Vault Tec Salesman and then before you leave Vault 111)?

 

It's simply a lot easier to use a random number generator program for randomizing your SPECIAL stats and then just using the numbers you get from that.

 

Attached is a quick one I made in python. I'm not much of a "pythonista" so don't use it to study python programming. Remove the ".txt" ending and then run it in a python3 interpreter.

 

Also, this python script uniformly distributes the SPECIAL stats (as uniformly as possible for something like this), so it'll be somewhat rare to see any stat go up to 10.

random_special_distributor.py.txt

Posted (edited)
14 hours ago, Here4SlootyMods said:

It is a bit complicated because you would have to hook into the game only when setting SPECIAL stats (not adding to them) and it also begs the question: Do I want the SPECIAL stats randomized twice (first when you meet the Vault Tec Salesman and then before you leave Vault 111)?

 

It's simply a lot easier to use a random number generator program for randomizing your SPECIAL stats and then just using the numbers you get from that.

 

Attached is a quick one I made in python. I'm not much of a "pythonista" so don't use it to study python programming. Remove the ".txt" ending and then run it in a python3 interpreter.

 

Also, this python script uniformly distributes the SPECIAL stats (as uniformly as possible for something like this), so it'll be somewhat rare to see any stat go up to 10.

random_special_distributor.py.txt 624 B · 1 download

Can python even work in Fallout 4?

 

I don't know enough about python to convert it fully to Papyrus, Bethesda's custom scripting language used in the game. I do know, however, that Papyrus does not allow an array inside an array, unless you use the F4SE function VarArrayToVar to convert an array to a variable, then use VarToVarArray to return it to semi-useable state. Note: var variables cannot be used directly, and must be cast as the appropriate type to be used (internally, the var variable knows what type it is, but won't let you use that type directly).

Edited by ptmc2112
Posted
On 10/12/2024 at 1:37 PM, ptmc2112 said:

Can python even work in Fallout 4?

Not that I know of.

 

I was recommending using the python script outside of the game and then just use the generated stats when they meet the Vault Tec Sales man or before they leave Vault 111.

Posted
On 10/11/2024 at 4:39 PM, Here4SlootyMods said:

It is a bit complicated because you would have to hook into the game only when setting SPECIAL stats (not adding to them) and it also begs the question: Do I want the SPECIAL stats randomized twice (first when you meet the Vault Tec Salesman and then before you leave Vault 111)?

 

It's simply a lot easier to use a random number generator program for randomizing your SPECIAL stats and then just using the numbers you get from that.

 

Attached is a quick one I made in python. I'm not much of a "pythonista" so don't use it to study python programming. Remove the ".txt" ending and then run it in a python3 interpreter.

 

Also, this python script uniformly distributes the SPECIAL stats (as uniformly as possible for something like this), so it'll be somewhat rare to see any stat go up to 10.

random_special_distributor.py.txt 624 B · 1 download

created a mod that in theory should work based on that python script (source is included, so anyone can check or edit it), marked as ESL so doesn't take a plugin slot, built to work with the vanilla start (or at least any alternate start mod that uses the vanilla start up to after the mirror scene). Put it in a zip to make install via mod manager easy.

 

Note, haven't actually tested it, as my install broke awhile ago, and haven't had the motivation to rebuild it.

Random Starter Stats.zip

Posted (edited)
10 hours ago, ptmc2112 said:

created a mod that in theory should work based on that python script (source is included, so anyone can check or edit it), marked as ESL so doesn't take a plugin slot, built to work with the vanilla start (or at least any alternate start mod that uses the vanilla start up to after the mirror scene). Put it in a zip to make install via mod manager easy.

 

Note, haven't actually tested it, as my install broke awhile ago, and haven't had the motivation to rebuild it.

Random Starter Stats.zip 3.47 kB · 1 download

Realized I forgot a logical error (the starting points used to add random points would end up with 7 extra points, so I had to remove em). Here's an updated file

 

Still haven't actually tested it.

 

Random Starter Stats.zip

Edited by ptmc2112
  • 5 months later...
Posted
On 10/15/2024 at 2:47 PM, ptmc2112 said:

Still haven't actually tested it.

 

So, I've tested it. When should that happen? At the first meeting with the Vaulttec employee? Unfortunately, nothing happens then. I have to do everything manually.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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