If you check out all the pages on my site, chances are you've noticed a new page under 'Game Making'. Reincarnation Assistant: 9 to 5 is the current game I'm working on. It'll be the full version of my short One-Map Challenge game, where Mana is an assistant to a God of Reincarnation who ends up being forced to send people to different worlds that require an Isekai hero to come help. This full version will have a lot more to do than just that, as well as having more than two characters. The fact that there will be more than two characters meant that I needed to find a good way to keep track of all their names and friendship statuses. While I could just write it out for each message and use a ton of conditional branches, I decided to find a cleaner way to do it: variables. First, some background as to what I even want. I'm using some of Yanfly's plugins to adjust the message size and add a name box, but I decided I also wanted to show an icon in the name box so that players can easily tell what the characters thinks of Mana (who's the main character). That's easy enough, thanks to Yanfly's plugin I can just stick this code into the message: \n<God of Reincarnation \i[97]> And it'll make the name box appear like this: But the problem occurs when I decided that I wanted to be able to change the name of the characters and the icon image. If I continued doing it the way above, then I'll need to have a conditional branch to check what exactly is supposed to be displayed... And honestly that's way too much work to do and means there's so many chances of myself messing up (Dog of Reincarnation has already appeared in one name box, and I'm sure there are much worse spelling mistakes possible). I started by using two variables, one for the name and one for the icon number. It turns out that you can stick a variable inside the icon control character, which makes life so much easier~ \n<\v[8] \i[\v[9]]> That means that instead of having to write out the name box and have conditional branches to make sure the right one is shown each time, I can just change the variables to have the right things show! So I added those to my event, like so: Which resulted in these options, depending on which choice was selected: Perfect! But I decided to make life even easier on myself, and grabbed Yanfly's message macro plugin so that I didn't have to remember which variables are for which characters. So now the name box info was all stowed in an easy to remember line: \m[re-god] While two variables are required for this method, I'm sure with a bit more work I could get it down to just one by using an array in the variable. But for now, I can safely move forward with roughing out mechanics and cutscenes without needing to worry about making a mistake in a name box while writing things out. I know this is a bit different than my normal resource blog posts, but I really want to share more about my personal game making methods so I thought a weekly(?) post where I talk about an issue I had while developing and how I found a way to work around it.
Hopefully some of y'all will find these useful in solving some of your own problems, or at least interesting to see how I over-complicate my dev life.
Comments
|
hiddenone tries to make a gamePosts about game making. Possibly updates on my current project, tutorials on how to event some things, or just random ideas. Archives
May 2019
Categories
All
|