[MOD] - Random Character Generation for BGEE, BGEE+SOD, and BG2EE (v2.0+)
Mr2150
Member Posts: 1,170
Fed up playing the same characters all the time?
This mini-mod will let you generate a completely random character from all the options available. It pre-sets your abilities score to a minimum of 85, but allocates those points for you. It even chooses your initial proficiencies, skills & spells.
It doesn't:
- allocate a portrait (for the purposes of character generation it will use zzzzzzz.bmp as your portrait which is the ? image - once in the game you can then change your portrait to whatever fits your character better)
- set your colours / voice.
- choose a name for you.
So you will need to do those bits...
Any feedback/questions/suggestions gratefully received...
(Thanks to @lefreut for helping me solve a random crash issue...!)
Screenshot:
It's really easy to install:
1) Download the attached zip file. Inside are two files:
- Put the file zzzzzzz.bmp into your portraits folder
- Put the file M_random.lua into your override folder.
2) Now open UI.menu and search for the 'CHARGEN' menu (it will be around line 12330). You will find the line 'ignoreesc', just enter this line below it:
3) Only if you are using versions 2.0 or 2.1 of the game, then do the following - at the top of the UI.menu file type the highlighted line in:
4) Then scroll down a little bit and look for the button marked IMPORT and BIOGRAPHY buttons - they look something like this (may vary a little depending on the game):
and
Right, between these two buttons, just insert the following code depending which game you are altering:
BGEE+SOD - use this code:
BGEE and BG2EE - use this code:
And that's it...!
This mini-mod will let you generate a completely random character from all the options available. It pre-sets your abilities score to a minimum of 85, but allocates those points for you. It even chooses your initial proficiencies, skills & spells.
It doesn't:
- allocate a portrait (for the purposes of character generation it will use zzzzzzz.bmp as your portrait which is the ? image - once in the game you can then change your portrait to whatever fits your character better)
- set your colours / voice.
- choose a name for you.
So you will need to do those bits...
Any feedback/questions/suggestions gratefully received...
(Thanks to @lefreut for helping me solve a random crash issue...!)
Screenshot:
It's really easy to install:
1) Download the attached zip file. Inside are two files:
- Put the file zzzzzzz.bmp into your portraits folder
- Put the file M_random.lua into your override folder.
2) Now open UI.menu and search for the 'CHARGEN' menu (it will be around line 12330). You will find the line 'ignoreesc', just enter this line below it:
onopen "randomCharacter = 0;"
3) Only if you are using versions 2.0 or 2.1 of the game, then do the following - at the top of the UI.menu file type the highlighted line in:
4) Then scroll down a little bit and look for the button marked IMPORT and BIOGRAPHY buttons - they look something like this (may vary a little depending on the game):
and
Right, between these two buttons, just insert the following code depending which game you are altering:
BGEE+SOD - use this code:
button
{
enabled "createCharScreen:GetCurrentStep() == 0"
area 36 524 340 30
text "????"
text style "button"
pad 8 2 8 2
bam GUIBUTWS
action "randChar()"
}
button
{
enabled "randomCharacter == 1 and createCharScreen:GetCurrentStep() == 15"
area 36 524 340 30
text "Again?"
text style "button"
pad 8 2 8 2
bam GUIBUTWS
action "
chargen.information = nil
randomCharacter = 0
for i=1,5,1 do
createCharScreen:OnMainBackButtonClick()
end
randomCharacter = 1
randChar()
"
}
BGEE and BG2EE - use this code:
button
{
enabled "createCharScreen:GetCurrentStep() == 0"
area 22 574 340 30
text "????"
text style "button"
pad 8 2 8 2
bam GUICHLNG
action "randChar()"
}
button
{
enabled "randomCharacter == 1 and createCharScreen:GetCurrentStep() == 15"
area 22 574 340 30
text "Again?"
text style "button"
pad 8 2 8 2
bam GUICHLNG
action "
chargen.information = nil
randomCharacter = 0
for i=1,5,1 do
createCharScreen:OnMainBackButtonClick()
end
randomCharacter = 1
randChar()
"
}
And that's it...!
Post edited by Mr2150 on
23
Comments
Yeah - it's really easy to change it... but do note that the 85 is achieved via an autoroller... if you set the value too high then it could momentarily pause the game performing roll after roll, whilst it seeks that number - eg putting very high numbers could cause the game to crash if it never rolls that number (which is possible!)
I set it at a 'minimum of 85' because for me, it's low enough to roll quickly and was just enough of a boost to a random character - who may end up with some otherwise crazy choices - without feeling unfair or like cheating.
Anyway - to change the 85 all you need to do is:
1) Close your game. Go to your override folder.
2) Open the M_random.lua file, and scroll down until you get to the section marked abilities:
-- Abilities if createCharScreen:GetCurrentStep() == 8 then createCharScreen:OnMenuButtonClick() while chargen.totalRoll < 85 do createCharScreen:OnAbilityReRollButtonClick() end Infinity_PopMenu() createCharScreen:OnDoneButtonClick() end
2) And there you can see the 85 value... Feel free to alter that however you choose...
I wouldn't go higher than around 95 as for me that will roll within about 5 seconds but will pause until it achieves the roll (you can tell it's paused because the music stutters/stops until it finds the value).
If you want a version you can edit on the fly IN GAME without editing this file each time, then drop me a message and it will be quick enough to make a custom version for you, but that's treading into autoroller territory which this mod is not.
Thanks!
Send me a message with your UI.menu in a zip!
Should I have had one in the first place?
That's easy then, when I get home I will update the OP with a install of (UI.menu + this mod's changes). It will be about an hour
I have updated the mod instructions in the OP to include pre- 2.2 versions...
E: Is there a way to mod this mod so that multiclass is excluded?
Here's my code for Lefreut's UI (ui.menu tested for BGI SOD EE):
{
enabled "createCharScreen:GetCurrentStep() == 0"
area 22 565 340 32
text "Random"
text style "button"
pad 8 2 8 2
bam GUICHLNG
action "randChar()"
}
button
{
enabled "randomCharacter == 1 and createCharScreen:GetCurrentStep() == 15"
area 22 565 340 32
text "Again?"
text style "button"
pad 8 2 8 2
bam GUICHLNG
action "
chargen.information = nil
randomCharacter = 0
for i=1,5,1 do
createCharScreen:OnMainBackButtonClick()
end
randomCharacter = 1
randChar()
"
}
[/code]
EDIT: I think, it is because I use LeUI. I think, "createCharScreen:OnGenderSelectButtonClick(2)" may be a wrong reference, because the Gender screen has been massively changed in that UI.
EDIT: Solved. IThe semicolon? Also, I combined onOpen lines. Result:
onOpen
"
randomCharacter = 0
gender = 2
"
It happens e.g. for half-elves in the mage spell picking. The "Done" button is only available if correct spells are picked, which never seems to happen.
If you can do nothing you could still add counters to the while() loops so it does an emergency stop there.
-- Abilities if createCharScreen:GetCurrentStep() == 8 then createCharScreen:OnAbilityReRollButtonClick() createCharScreen:OnAbilityStoreButtonClick() local best = chargen.totalRoll for i = 1,150 do createCharScreen:OnAbilityReRollButtonClick() if chargen.totalRoll > best and math.random() > (0.2 * math.random()) then best = chargen.totalRoll createCharScreen:OnAbilityStoreButtonClick() end end createCharScreen:OnAbilityRecallButtonClick() createCharScreen:OnMenuButtonClick() Infinity_PopMenu() createCharScreen:OnDoneButtonClick() end
--> enabled "createCharScreen:GetCurrentStep() == 0"
to
--> enabled "createCharScreen:GetCurrentStep() <15"
Button will be available at any step and the advantage is, e.g. YOU can decide about gender and race, your mod will decide the rest. So you get as much control as you want.