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 Gaminghas 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.
本贴来自国际rpgmaker官方论坛作者:Rubescen处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/in-game-character-generator-yanfly-common-event.62180/