In Game Character Generator (Yanfly Common Event)

Ahlan All,


I've been lurking on these boards for a while (1000+ XP hours), but now that I'm delving into MV I thought I'd try to contribute. Thus a brief tutorial for  a character generator using MV and Yanfly's Common Events Menu Plugin (You'll also need/want the Yanfly Core Engine, and Message Core; update: it seems you may also need the Battle Engine Core).


There are other character generator tutorials available (Driftwood Gaming has a good one), but none take advantage of Yanfly's recent plugin, which allows more visual options. What follows is the basic setup (video version), which could be expanded on with more images.


Create a game (of course); Create an event set to autorun.  This event can have a message text. But needs to call for the player name using the editor command, input processing.


With this complete you can use a simple choice command to ask for gender (or anything) at this point Yanfly's engine comes into play. I have Gender choice associated with a variable so that I can call recall the player's decision at a latter point. In any case have the choice call a common event with the following details:


Plugin Command: SetCommonEventMenuSettings Default Setup
Plugin Command: ClearCommonEventMenu
Plugin Command: DisableCommonEventMenuCancel
Plugin Command: AddCommonEventMenu 8 through 15 ##these correspond to the various picture events in the common event database
Plugin Command: OpenCommonEventMenu



This calls a common event via the Yanfly plugin, and blocks cancellation of that event. 8 through 15 in this case correspond to the additional options  outline below. Change those numbers as necessary.



Common Events 8 through 15 (or whatever) each have a set of addtional [comment] scripts associated with them via Yanfly's plugin.


Comment: <Picture: male1> ##The file name of the picture associated with this option
Comment: <Help Description>
Select a portrait: ##this can be any text you like
</Help Description>
Comment: <Subtext>
Portrait 1 ##this can be any text you like
</Subtext>
Play SE:Load(90, 100, 0) ## this plays a sound -- it is a generic engine sound call
Change Actor Images: Player, PlayerSelectFaces1(0), PlayerSelectMaleChar(0), PlayerSelectMaleBattler1 ##This sets the actor image to the file of your choice; same with character and battler.



With those details set for each common event 8-15 (or however many), you now have a functional character generator. If you want pictures, you'll need each of the files associated with the picture to be unique (in this case I have 8 different male portrait options, and 8 female options, where I've gray scaled the "non-selected" portraits, thus 16 total .png images).


You can additionally ask for class (and in this case use the same sort of commands as above to change images). Finally, using labels you can give a player the option of returning to earlier choices using a choice call, "jump to label: [name]".


If you want to allow the player to see the face image they choose automatically you'll need to use the command \af[#] (\ac[#] for class), using Yanfly's message core. Otherwise this gets the basic idea across.


Here is a video showing the setup: Character Generation Tutorial ; And here is a simplified demo version.



Let me know if you have questions/comments/critiques.
Very helpful thanks
Thanks for this tutorial. I'm going crazy I swore I got it all right but I can't bring up the window after I select a gender. 


I'm wondering if you be willing to share an example project so I can compare it.


Thanks 🙂
@mpurnell glad it's helpful!



@Kane,


I've started putting together a quick demo and discovered this setup also has a dependency on Yanfly's Battle Engine Core plugin as well (though I'm not quite sure why). You might try adding that, and see if it solves your problem! If not, I'll try and get a demo up here in the next couple days. Thanks for the question, which forced me to trouble shoot this a bit more!




 
@mpurnell glad it's helpful!



@Kane,


I've started putting together a quick demo and discovered this setup also has a dependency on Yanfly's Battle Engine Core plugin as well (though I'm not quite sure why). You might try adding that, and see if it solves your problem! If not, I'll try and get a demo up here in the next couple days. Thanks for the question, which forced me to trouble shoot this a bit more!




 

Darn I actually did have it installed myself. I kept going through the tutorial over and over I feel like I have it right. I will wait till you have a demo one up and then start cross debugging with your demo.


Thanks for your time and effort put into this.
Darn I actually did have it installed myself. I kept going through the tutorial over and over I feel like I have it right. I will wait till you have a demo one up and then start cross debugging with your demo.


Thanks for your time and effort put into this.

hi @Kane Hart.. i think @Rubescen make a slight mistake in the last plugin command.. i watched his youtube video, and it's a bit different than this (in common event ).. 


Plugin Command: SetCommonEventMenuSettings Default Setup
Plugin Command: ClearCommonEventMenu
Plugin Command: DisableCommonEventMenuCancel
Plugin Command: AddCommonEventuMenu 8 through 15 ##these correspond to the various picture events in the common event database
Plugin Command: DisableCommonEventMenuCancel



in the video is written Plugin Command : OpenCommonEventMenu. Try to change this.. the last plugin command only... 


i was like you yesterday... couldn't find the menu.. but then i re-watch his video like, i don't know, ten times or even more, and find this slight mistake..  😀


hope it helps..  🤘 🤘
Thanks @goodkat666


That for sure got me to open the character portrait select screen. It's a 100% blank but it might because I never added the pictures for it yet. But that got me further along at least 🙂
the video is written Plugin Command : OpenCommonEventMenu. Try to change this.. the last plugin command only... 


i was like you yesterday... couldn't find the menu.. but then i re-watch his video like, i don't know, ten times or even more, and find this slight mistake..  😀


hope it helps..  🤘 🤘



*sigh, proof reading fail. That's embarrassing! 🙂  Definitely a typo above. I'll fix that above too. Thanks for the solution!



I'm still not entirely sure why it requires the battle engine plugin (I have another common event menu for map functionality that does not)-- I suppose it has something to do with the connection to actor changes, but I'll look into it more.
*sigh, proof reading fail. That's embarrassing! 🙂  Definitely a typo above. I'll fix that above too. Thanks for the solution!



I'm still not entirely sure why it requires the battle engine plugin (I have another common event menu for map functionality that does not)-- I suppose it has something to do with the connection to actor changes, but I'll look into it more.

well, happens.. 😀  but your post really really helps... thanks alot @Rubescen..
Any chance of an example demo? Still never got it to work sadly myself 🙂
Any chance of an example demo? Still never got it to work sadly myself 🙂

@Kane Hart  Sorry, got caught up with work. Here is a simplified demo version. Hopefully this helps! 


Demo: https://www.dropbox.com/s/rdjsd7s79z6d1nt/Char%20Gen%20Demo.zip?dl=0
I can't get this working either. Can i pay you $50 to get this set up in my game? (Using screen share software, obvously too big to up/download). Hope so!

Original thread: https://forums.rpgmakerweb.com/threads/in-game-character-generator-yanfly-common-event.62180/