Letting player choose a character, and story choices between multiple games.

Just wondering how this stuff is possible with RPG Maker.

I know how to set it up so that players can choose to be a male or female and then have the dialogue reflect all that, but what I'm wondering is how that works with sprite sheets.

Let's say I let the player choose between 6 different characters (3 male and 3 female), and I've got cutscenes in the game where the player character throws up their hands, laughs, shakes their head, etc. How would I set that up? I imagine I could do a conditional for each of the character option. So, if(player is Male 2) then change image (Male 2 laughing, shaking head, etc)

But this seems like a ton of work, especially if there is a lot of character choices. For every single animation or sprite change I'd have to go in and set each image.

Is there an easier way to do this?

My second questions is: is there a way to make it so choices carry over between multiple games, similar to Mass Effect and games like that? Like, a way to read a save file and see variables or switches based on decisions the player has made?
For global Switches and Variables by using a plugin like this one. As for the other question, you can just have one main character and change their appearance sprite and face set through events. Otherwise, yeah you'll have to do it as you described.
For the first part, I'd say use a variable X that reflects your player's actor choice and when needed, change the sprite using script calls. Then you just need to name your sprite files like stuff_X, things_X and so on. And there you go, one command for as many actors as you like.
Just in case, to change the player's sprite : $gamePlayer.setImage('file name', spriteindex);
Keep in mind that the sprite will reset when changing map, so that's likely enough for cutscenes, but if you need to keep the pose between different maps, you'll need to either set it once again or use $gameParty.leader().setCharacterImage('file name', spriteindex);

Second question is not as simple. You could go the easy way and just ask questions to the player at the start of your second game.
Using saved datas from another game is not easily doable as far as I'm aware. You'll probably need some kind of script/plugin to read your first game save files directory, ask the player which one he wants to use and then read and add the relevant data in the current game.
For the first part, I'd say use a variable X that reflects your player's actor choice and change the sprite using script calls. Then you just need to name your sprite files like stuff_X, things_X and so on. And there you go, one command for as many actors as you like.

This sounds like an awesome way to do it, but I'm a bit confused about how to actually set it up.

So I would have a single variable for the player choice. So Male 1 might be linked to 1 on the variable, Male 2 to 2 on the variable.

Then for my files, it'd be something like player_m_01, player_m_02, etc?

How would I then use script calls? I found the following on a script reference thing:

$gameActors.actor(actorId).setCharacterImage("name", index);
$gameActors.actor(actorId).setFaceImage("name", index):
$gameActors.actor(actorId).setBattlerImage("name");

Are these the right things?

Is the poster in this thread asking the same thing?

https://forums.rpgmakerweb.com/index.php?threads/solved-scripted-actor-spriteset-change.82369/

If you could explain that a bit more, I'd really appreciate it, because it sounds like a better way than I'm planning it.
yeah sorry, I didn't have RM opened when I wrote the post.
I edited a bit my previous post to detail the commands.
Let's say you use 1, 2, 3 and so on to identify the player's choice and you put it into your variable 1. Let's also say your sprite files for alternate poses are named alt_sprite_1, alt_sprite_2, and so on. At last, let's assume you want a to use your laughing pose and it's the 1st one on the sheet.
Then that'd be : $gamePlayer.setImage('alt_sprite_'+$gameVariables.value(1), 0);

You can try messing aroung with those commands during test play using the developper console (F8).

EDIT : Yeah it's close to the thread you're pointing to. However that thread (and its solution) is asking for changing the sprite of any actor (regardless if they are in your party or not) and requires you to input the actor's id.
What I'm suggesting is only good to change the leader sprite (regardless what actor it is).
yeah sorry, I didn't have RM opened when I wrote the post.
I edited a bit my previous post to detail the commands.
Let's say you use 1, 2, 3 and so on to identify the player's choice and you put it into your variable 1. Let's also say your sprite files for alternate poses are named alt_sprite_1, alt_sprite_2, and so on. At last, let's assume you want a to use your laughing pose and it's the 1st one on the sheet.
Then that'd be : $gamePlayer.setImage('alt_sprite_'+$gameVariables.value(1), 0);

You can try messing aroung with those commands during test play using the developper console (F8).

Okay, so, I managed to get the character to switch using:

$gameActors.actor(actorId).setCharacterImage("name", index);

This changed it to what I substituted "name" and "index" for as expected.

But then, from here, let's say I want to change the character's index, because I usually have all my different poses and everything for a character on the one sheet. What would I do to make it so that I can change the image index? Is this where I need the variables to come into play?
yeah sorry, I didn't have RM opened when I wrote the post.
I edited a bit my previous post to detail the commands.
Let's say you use 1, 2, 3 and so on to identify the player's choice and you put it into your variable 1. Let's also say your sprite files for alternate poses are named alt_sprite_1, alt_sprite_2, and so on. At last, let's assume you want a to use your laughing pose and it's the 1st one on the sheet.
Then that'd be : $gamePlayer.setImage('alt_sprite_'+$gameVariables.value(1), 0);

You can try messing aroung with those commands during test play using the developper console (F8).

EDIT : Yeah it's close to the thread you're pointing to. However that thread (and its solution) is asking for changing the sprite of any actor (regardless if they are in your party or not) and requires you to input the actor's id.
What I'm suggesting is only good to change the leader sprite (regardless what actor it is).

I think I'm getting confused and this is going way over my head.

One thing to mention, I've avoided using multiple sprite sheets for different character animations because of the blinking effect that happens when you load up a new spritesheet for the first time. Today I tried TDD preload manager, but I was getting an error. I tried SumRndDude's one and it worked and removed the blinking! So, I'm not opposed to using new sprite sheets now.

I'm still trying to understand how to actually make this work for me though.

$gamePlayer.setImage('alt_sprite_'+$gameVariables.value(1), 0);

^^ I'm not entirely understanding what this means. I know some basic coding, but not in this language. So, it's accessing the set image function of the player. Then it's taking "alt_sprite" or whatever it is I've named the spritesheet. But from there I'm a bit lost as to what its doing.

EDIT: I think I'm making some progress with this now. So, I set a variable for the character choice. If they choose say 3 which is Female Variant 1, then what your method does is change the image to whatever the file name of the spritesheet is, but while also adding 1 to the end?

So, this method isn't actually using multiple tilesheets for a single character. Each fo those alt_sprite sets you mentioned are full character sheets with all their animations. Is that sort of right?

Alternatively, is there a script call that just looks at the current image and changes it's index? Without having to put in a file name? Because that might work for me too.
I'm gonna try to break it down using as an example $gamePlayer.setImage('alt_sprite_'+$gameVariables.value(1), 0);
- 'alt_sprite_' is the name of your file minus the last number.
- +$gameVariables.value(1) adds the value of your variable 1 at the end of the file name.
- and 0 is the index of the sprite.
If you're using only one sprite file per character and just want to change the index you can use the same command but replace the the file name by $gamePlayer._characterName
Wich gives : $gamePlayer.setImage($gamePlayer._characterName, index);
(just replace index by whatever index you want to switch to)
You could also just do this:

Fade out
Load the new spritesheet
Fade in

If you add that to all your cutscene pre-processing the player will never see it. That's what I do. Otherwise I usually put all animations on one sheet so it is already loaded in memory.

As for the 2nd (info between saves) that really requires good planning from the beginning. I believe the Millenium games did it in RPGMaker XP but they probably used a custom script which loaded the old save data, and converted the data into the format for the new game. In fact that is also how most old DOS games that did this did it as well (see Quest for Glory for another example of it). So it will probably come down to good coding to pull it off in the end.
I'm gonna try to break it down using as an example $gamePlayer.setImage('alt_sprite_'+$gameVariables.value(1), 0);
- 'alt_sprite_' is the name of your file minus the last number.
- +$gameVariables.value(1) adds the value of your variable 1 at the end of the file name.
- and 0 is the index of the sprite.
If you're using only one sprite file per character and just want to change the index you can use the same command but replace the the file name by $gamePlayer._characterName
Wich gives : $gamePlayer.setImage($gamePlayer._characterName, index);
(just replace index by whatever index you want to switch to)

Thanks a heap for the breakdown. It's starting to make sense and I was able to do the second part where I just change the index of the current character. This will probably be enough for me, unless I really need a lot more per character and need more sheets.

The first way, using $gamePlayer.setImage('alt_sprite_'+$gameVariables.value(1), 0); allows for me to use as many sheets as I want per character, right?

Again, thanks so much. I'd have never figured this out lol.

EDIT: your explanation helped me out further. I was worried I wouldn't have enough room if I was using a single texture sheet, but I was able to use one of Galv's scripts to let me change the character sprite to an individual frame(not sure why this isn't in RPG Maker by default) by using: this.set_frame($gamePlayer._characterName,2,1,4).

But using this, I don't have to waste an entire 3 frames just for one frame.
You could also just do this:

Fade out
Load the new spritesheet
Fade in

If you add that to all your cutscene pre-processing the player will never see it. That's what I do. Otherwise I usually put all animations on one sheet so it is already loaded in memory.

As for the 2nd (info between saves) that really requires good planning from the beginning. I believe the Millenium games did it in RPGMaker XP but they probably used a custom script which loaded the old save data, and converted the data into the format for the new game. In fact that is also how most old DOS games that did this did it as well (see Quest for Glory for another example of it). So it will probably come down to good coding to pull it off in the end.

Yeah, I know I could sort of hide the loading, but using that preload manager is good for me. It takes like 5 seconds to load everything, which is nice.

Original thread: https://forums.rpgmakerweb.com/threads/letting-player-choose-a-character-and-story-choices-between-multiple-games.104378/