Randomly selecting an actor through variables

So i've come across a issue that i can't seem to overcome. I'm not sure if this is possible, unless I'm just over looking it.

What I'm trying to do is to have the game randomly select an actor to be placed into the party. How i hoped it would work, you talk to a guild, I.E place where you choose their class/job. It would play out like a follower system, as you progress it will have a variable saying you have this many followers looking to join increasing one variable.. You talk to say, the mage, and the mage turns one of your followers (lowering the variable by 1) into a mage. What would happen next is the game randomly selects one of many actors with a predetermined picture/race then changing the class of the character to mage or whatever guild they are entering the new character in.

What I had hoped to do is create a permenant class/job, but have a randomly selected personailty to go with it.

I tried variables, but i can't seem to connect anything to work appropriately. Is there a better way to go about doing this? Thanks in advance for the help. 🙂

Edit: Well... i did think of one way as to use it. Maybe making seperate event pages for each potential character, and 'rolling' one random variable and see what event page it lands on, then the game will select it from there. Maybe I could make that into a common event? Seems like a lot of work, but i would do it if i had too. Unless anyone can thnk of an easier way.
the random variable is correct, but no need for multiple event pages.

Just use conditional branches after the control variable command to check which number is in the variable and have a different actor added and changed based on that.
So will i need to make conditional branches for each character for the random selection. So if I had say 10, do i need to make a branch for each number going up?
yes
I managed to achieve what I believe to be what you were asking for, with some extra optional stuff, such as the personality state affecting the nickname, and certain guilds not having certain actors or personality types.

Here's a demo.

https://drive.google.com/file/d/0B9oxIE0LXB7cQ1ZlYWx6LXhrMWc/view?usp=sharing

For convenience, I included Galv's Group Manager and a use for it mid-demo.

http://galvs-scripts.com/2012/11/19/group-manager/
Thank you arsist I will give it a try.
I appriciate the quick demo you put together though, From what I've tinkered with its what i wanted plus more. 🙂

I really should learn ruby, the scripting part is hard to wrap my head around, but i understand the general gest of it... just wouldn't be able to write that myself at this point. Again, thank you for the help you two.
You're welcome. But do you at least understand how to customize the guild member aspect of the demo to use it in your own game?

Just making sure that I made it legible enough to be copy-able.
I think so. Variable wise I can manage, that's pretty simple to understand. The only thing that seems like gibberish is the script calls. I can't exactly follow the majority of it.

Also, while I may be able to figure it out. I will have to remove the fixed member, the main character or ' avatar' for the group is a non combat character who is the walking sprite. The actors will actually just be uses for combat only, so they won't be following around on the map or will need sprites (at least that's what I'm going with for now)
Gotcha. 

I made it so the main character is the controlled character but isn't a party member and that there's no followers on the map.

This was achieved using

https://crystalnoel42.wordpress.com/2012/11/10/crystal-engine-party-leader/

and then turning off the single-file feature in the event editor.

I also adjusted the party member switch crystal and the in-battle dialogue to follow that (e.g. if you run with more than 1 party member, it'll say "[main character's name]'s party attempts to escape!" instead of the first party member's name (check the script editor)

https://drive.google.com/file/d/0B9oxIE0LXB7cQ1ZlYWx6LXhrMWc/view?usp=sharing

Most of the script call stuff is copy and paste, as the script calls handle what you put in variables.

For banned guild members, just put each banned actor's id in a single bracket, like

[1,5,7,24]

In the big script call, where you see

random_personality_states = [51,52,53,54,55]

replace those with applicable personality states.

So if you wanted to have the guild give out states 61 through 67 but excluding state 64, you would replace it with

random_personality_states = [61,62,63,65,66,67]

then in the next part, where it says

case $game_variables[3] when 51 $game_actors[$game_variables[2]].nickname = "Head-strong and persistant." when 52 $game_actors[$game_variables[2]].nickname = "Calm and collected." when 53 $game_actors[$game_variables[2]].nickname = "Easily moved and disturbed." when 53 $game_actors[$game_variables[2]].nickname = "Self-kept and distant." when 54 $game_actors[$game_variables[2]].nickname = "Wise and intellectual." when 55 $game_actors[$game_variables[2]].nickname = "Naive and adorable."endAssuming you would want to use the nickname feature, you could replace the ids with the state ids you'd plan to use and the descriptions with the ones you'd want.

So let's say in this case, you'd make it

case $game_variables[3] when 61 $game_actors[$game_variables[2]].nickname = "Bold and daring." when 62 $game_actors[$game_variables[2]].nickname = "Calm and collected." when 63 $game_actors[$game_variables[2]].nickname = "Critical and cold." when 64 $game_actors[$game_variables[2]].nickname = "Self-kept and distant." when 65 $game_actors[$game_variables[2]].nickname = "Wise and intellectual." when 66 $game_actors[$game_variables[2]].nickname = "Naive and adorable." when 67 $game_actors[$game_variables[2]].nickname = "Hasty and temperamental."endAnd to make it easier on yourself, you could cut and paste that nickname script call into a common event and have every guild call that common event so that you can edit it universally as you like.
I think the demo you uploaded is the same one? I don't see any difference.

The breakdown helps a lot, i tinkered with it a bit and was able to change what pops up in the nickname. Also the banned members to go along with the list of characters i had available. It works well for what I had in mind. 🙂
Sorry about that. It should be this 

https://drive.google.com/file/d/0B9oxIE0LXB7cVFRGZzZqUDNIWDA/view?usp=sharing
That works perfectly. Also helps me with an easier way of stopping players from exiting out into dungeons and the like without having party members. Thanks for the help Arsist.

Original thread: https://forums.rpgmakerweb.com/threads/randomly-selecting-an-actor-through-variables.43473/