Character Generator Question

lerugray

Veteran
Veteran
Joined
Apr 4, 2014
Messages
52
Reaction score
11
Primarily Uses
Hello all,

in the interest of not bombarding one member with tons of questions, I figured I would ask for help here.

Gracious member Traveling Bard came up with this logic for setting events for a character generation idea I had, below is the logic. As of right now I've been putting these together in the Database Common Event editor.

*****On Map Event*****
//USAGE: This is the entry point into game & shows a menu with various options
Loop
//Menu List/Show Choices: Create New Character; View/Edit Characters; Build Party
//For this "logic dump", Let's explore only the Create New Character option
Call CE Configurations
Call CE Character Slot Check
Call CE Character Builder
Loop Above

*****CE Configurations*****
//USAGE: Set all of your variables in one place.
//TESTER SWITCH, Show stuff that wouldn't normally be shown or added in production
//set the switch, reference it when you have areas you'd like to test.
//Racial Base Stats
//Human Base Stat Variables
//Cat Base Stat Variables; excluding Cha which is set at character creation
//Class Stat Requirements
//Mercenary Requirement Variables; set STR, DEX, and CON requirement vars
//Priest Requirement Variables; set PIE, CON, and CHA requirement vars
//Have Character Slot switches been initially set conditional branch? If not, set them.
//Set a Character Slot Switch to OFF which means it's available
/*Once all of the above slot switches are OFF, set a switch to say it's done. That way if we call this again, we don't make all the character slots available again. */

*****CE Character Slot Check*****
/*USAGE: Checks switches for open character slot & sets currentCharacter variable to the appropriate actorID*/
//Conditional Branches for each Character Slot Switch; if ON do nothing; If OFF then
//Set CurrentCharacter variable to the appropriate actorId
//Go to End Check label
//Set an End Check Label at the bottom of the Common Event, effectively skipping to the end

*****CE Character Builder*****
/*USAGE: Consumes the base variables, character slot, rolling stats, and starting the character building loop*/
//Check which character we are working with; currentCharacter variable
Loop
//Have the user choose gender & set it to Character specific Gender variable
//Have the user choose race & set it to Character specific race variable
//Set all base stats to current character variables based on race choice
/*Conditional branch; "have I rolled before" Switch; if OFF ignore the rolling logic & just call the CE Class Options Builder; if ON ask if you would like to re-roll stats. */
//Roll random variables that are left like Bonus points, CHA for Cats, etc...
//Set the switch to state that you have rolled to ON
//IF TESTER SWITCH ON, then Show each value in a text box
//Add BaseStats + racial randoms (CHA) + Bonus points to BaseStatPlusBonus
//IF TESTER SWITCH ON, then Show each value in a text boxCall CE Class Options Builder
Call CE Class Options Displayer
Loop above

*****CE Class Options Builder*****
/*USAGE: Consumes Character Builder's BaseStatPlusBonus & compares it against class requirements to build options.*/
//For each Class, subtract all the values of the class requirements from StatChecker
//Mercenary
//StatChecker variable set to BaseStatPlusBonus for check
//StatChecker -= Merc Str Requirement
//StatChecker -= Merc Dex Requirement
//StatChecker -= Merc Con Requirement
//If StatChecker < 0 then MercOption Switch = ON Else it's OFF
//IF TESTER SWITCH ON, then Show StatChecker value in a text box
//Priest
//StatChecker variable set to BaseStatPlusBonus for check
//StatChecker -= Priest Pie Requirement
//StatChecker -= Priest Con Requirement
//StatChecker -= Priest Cha Requirement
//If StatChecker < 0 then PriestOption Switch = ON Else it's OFF
//IF TESTER SWITCH ON, then Show StatChecker value in a text box

*****CE Class Options Displayer*****
/*USAGE: This is up to you, but it might be where you leverage a script like Tsukihime's or Yanfly's to display a large amount of options based on a condition like "is the Merc switch ON" then show; otherwise, don't. This is also where we will allow the user to either select an available class option or go back (which will put us back in the loop of Character Builder & where we will ask if we'd like to reroll).*/
//Display class options based on option switches; Leave one option to "go back".
//Mercenary, if available, as an option.
//If selected, ask if they are sure.
//If sure, then set ClassChoice = 1
//BaseStatPlusBonus -= Merc Str Requirement
//BaseStatPlusBonus -= Merc Dex Requirement
//BaseStatPlusBonus -= Merc Con Requirement
//BaseStatPlusBonus -= each other Character Specific Stat Var
Call CE Bonus Point Allocation
//Priest, if available, as an option.
//If selected, ask if they are sure.
//If sure, then set ClassChoice = 2
//BaseStatPlusBonus -= Priest Pie Requirement
//BaseStatPlusBonus -= Priest Con Requirement
//BaseStatPlusBonus -= Priest Cha Requirement
//BaseStatPlusBonus -= each other Character Specific Stat Var
//Character Specific Bonus Point Var -= BaseStatPlusBonus
Call CE Bonus Point Allocation
//Go Back option; Does nothing.
*****CE Bonus Point Allocation*****
/*USAGE: This is where you would take the remaining bonus points & use them to increase stats as the player sees fit. This could be fancy or low tech... your call.*/
//Check which character we are working with; currentCharacter
//*insert however you want to do this*
//Once a choice is made update the Character Specific Stat value += choice
Call CE Finalize Character

*****CE Finalize Character*****
/*USAGE: All of the options we have set thus far need to be pushed to the character we are working on. This is where we will do that.*/
//Check Character we are working with; CurrentCharacter variable
//Push Character Specific Stat Variable values to the actual character in the database
//Check ClassChoice & set the actual character to the class in the database
//Add skills
//Add weapons/armor/items/starting gold
//Ask them to pick a portrait *perhaps make another CE for that*
//Ask them to Name the Character
//Show off the character data and do a confirmation check.
//Textbox that says the character is created! (do nothing & loop back to main menu)

So far, I have understood everything up to the Character Builder CE, this is driving me crazy:

*****CE Character Builder*****
/*USAGE: Consumes the base variables, character slot, rolling stats, and starting the character building loop*/
//Check which character we are working with; currentCharacter variable
Loop
//Have the user choose gender & set it to Character specific Gender variable
//Have the user choose race & set it to Character specific race variable
//Set all base stats to current character variables based on race choice

how would I set something like Gender to a specific variable? If the idea is that this is supposed to be used over and over again, if I were to do something like set a switch genderPC1 = ON, then I figure it would just keep editing the first PC over and over again. I feel like im being dumb and missing some base bit of logic here, or overthinking this. Any help would be appreciated.
 

Traveling Bard

The Bard
Veteran
Joined
Jul 4, 2012
Messages
565
Reaction score
491
First Language
English
Primarily Uses
You know, it might make it simpler if instead of using character specific variables we just have a set of variables for all of our work leading up to actually placing the values onto the character themselves. (Development is all about innovating and improving ideas! lol) I'll probably have to go back and revise the logic dump accordingly but let's move forward with something easier to work with.

//Here are the variables we will work with.
currentCharacter
characterGender
characterRace
characterStrStat
characterDexStat
characterConStat
characterPieStat
characterChaStat
characterIntStat
characterBonusPoints
characterFateStat
... //I can't remember if there were any others

Then we will use Character Builder like this:
1. I get the currentCharacter value from setting it in the Character Slot Check CE. So let's say it associates to the actorId 1. So, currentCharacter = 1.
2. The first thing I want to do in the Character Builder CE is setup a loop so we can reroll stats or start all over if we want. Put everything inside this.
3. Next I'm going to start asking questions like, what is the Gender of your character? If Male, then set the characterGender to 1; if Female, then set the characterGender to 2.
4. Next question is about Race. If Human, set the characterRace to 1; if Dwarf, set the characterRace to 2; if Cat, set the characterRace to 3; etc
5. Now, based on the characterRace value, I will push our base stats set in the configuration CE into the character###Stat variables accordingly.
6. Next, I will setup a conditional branch that will answer the question "have I rolled before?". I will tie that question to a switch... let's call it rollCheck and we will see if the switch is OFF. If it is do nothing and continue to the rolling logic; if ON ask if you would like to re-roll stats. If yes, then hit the rolling logic; if no, assume you don't need to roll stats again and just call the Class Options Builder CE; The reason we do this is for the second time we come here. Let's say we go through the whole process of building this character & all of it's class options and we want to re-roll the stats... this is where we make that check. The first time we want to roll them regardless so no question is asked. Make sense?
7. The rolling logic comes next where we will set our variables that need to be randomized. There should be a race check here using characterRace to fill in some of the missing variables like CHA for cats.
8. After you are done with setting all the randomized variables, turn that rollCheck to ON. This means "yes I have rolled before." And if this CE is called again and we hit that conditional branch on #6 then we will ask the user "Would you like to Re-roll your stats?". Make sense?
9. Next I'd throw in a Tester Switch check if you want more information... though now that I think about it you'd probably need to output these values regardless so that the user knows whether or not they want to re-roll stats lol so maybe ignore this tester switch check and just output all the stats in a textbox regardless. You can make it pretty later.
10. Next up, we add up all the stats into one place so we can help out the Class Options Builder CE in making calculations. So how I would do this is take the variable, BaseStatsPlusBonus, and add each character###Stat to it like BaseStatsPlusBonus += characterStrStat; BaseStatsPlusBonus += characterDexStat; etc... and then make sure to include the characterBonusPoints variable as well. That's how we get those numbers that we check on in Class Options Builder CE.
11. Next, you can throw in that Tester Switch check now... your player might not want to see these numbers but you as a tester definitely do. So check to see if the Tester switch from our configuration CE is ON, if so then output the BaseStatsPlusBonus variable in a textbox so you can make sure your math is right.
12. Call the Class Options Builder CE. That's it for this CE :)
 

lerugray

Veteran
Veteran
Joined
Apr 4, 2014
Messages
52
Reaction score
11
Primarily Uses
You know, it might make it simpler if instead of using character specific variables we just have a set of variables for all of our work leading up to actually placing the values onto the character themselves. (Development is all about innovating and improving ideas! lol) I'll probably have to go back and revise the logic dump accordingly but let's move forward with something easier to work with.

//Here are the variables we will work with.
currentCharacter
characterGender
characterRace
characterStrStat
characterDexStat
characterConStat
characterPieStat
characterChaStat
characterIntStat
characterBonusPoints
characterFateStat
... //I can't remember if there were any others

Then we will use Character Builder like this:
1. I get the currentCharacter value from setting it in the Character Slot Check CE. So let's say it associates to the actorId 1. So, currentCharacter = 1.
2. The first thing I want to do in the Character Builder CE is setup a loop so we can reroll stats or start all over if we want. Put everything inside this.
3. Next I'm going to start asking questions like, what is the Gender of your character? If Male, then set the characterGender to 1; if Female, then set the characterGender to 2.
4. Next question is about Race. If Human, set the characterRace to 1; if Dwarf, set the characterRace to 2; if Cat, set the characterRace to 3; etc
5. Now, based on the characterRace value, I will push our base stats set in the configuration CE into the character###Stat variables accordingly.
6. Next, I will setup a conditional branch that will answer the question "have I rolled before?". I will tie that question to a switch... let's call it rollCheck and we will see if the switch is OFF. If it is do nothing and continue to the rolling logic; if ON ask if you would like to re-roll stats. If yes, then hit the rolling logic; if no, assume you don't need to roll stats again and just call the Class Options Builder CE; The reason we do this is for the second time we come here. Let's say we go through the whole process of building this character & all of it's class options and we want to re-roll the stats... this is where we make that check. The first time we want to roll them regardless so no question is asked. Make sense?
7. The rolling logic comes next where we will set our variables that need to be randomized. There should be a race check here using characterRace to fill in some of the missing variables like CHA for cats.
8. After you are done with setting all the randomized variables, turn that rollCheck to ON. This means "yes I have rolled before." And if this CE is called again and we hit that conditional branch on #6 then we will ask the user "Would you like to Re-roll your stats?". Make sense?
9. Next I'd throw in a Tester Switch check if you want more information... though now that I think about it you'd probably need to output these values regardless so that the user knows whether or not they want to re-roll stats lol so maybe ignore this tester switch check and just output all the stats in a textbox regardless. You can make it pretty later.
10. Next up, we add up all the stats into one place so we can help out the Class Options Builder CE in making calculations. So how I would do this is take the variable, BaseStatsPlusBonus, and add each character###Stat to it like BaseStatsPlusBonus += characterStrStat; BaseStatsPlusBonus += characterDexStat; etc... and then make sure to include the characterBonusPoints variable as well. That's how we get those numbers that we check on in Class Options Builder CE.
11. Next, you can throw in that Tester Switch check now... your player might not want to see these numbers but you as a tester definitely do. So check to see if the Tester switch from our configuration CE is ON, if so then output the BaseStatsPlusBonus variable in a textbox so you can make sure your math is right.
12. Call the Class Options Builder CE. That's it for this CE :)
beautiful, thank you so much dude, ill get to work on this now, youre the best!
 

lerugray

Veteran
Veteran
Joined
Apr 4, 2014
Messages
52
Reaction score
11
Primarily Uses
Yeah I was curious how I would have done character specific variables anyway given the limitations of the system, wouldnt I have had to have done multiple conditional branches? like if current char is 1, yada yada yada
 

Traveling Bard

The Bard
Veteran
Joined
Jul 4, 2012
Messages
565
Reaction score
491
First Language
English
Primarily Uses
Yeah I was curious how I would have done character specific variables anyway given the limitations of the system, wouldnt I have had to have done multiple conditional branches? like if current char is 1, yada yada yada
Yeah and that just turns ugly. Sometimes you have to but if you can...always try to find a way to simplify & reuse things :)
 

lerugray

Veteran
Veteran
Joined
Apr 4, 2014
Messages
52
Reaction score
11
Primarily Uses
oh yeah, and not sure what you mean by ###

whoops meant to send this in our chat lol my bad, and not I get it, my bad, i assume im doing this with a conditional branch, think this is all starting to come back to me now, thank you for bearing with me.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,855
Messages
1,017,007
Members
137,563
Latest member
MinyakaAeon
Top