Syndicate content

YamiTami's No Script Tutorials

33 posts / 0 new
Last post
Offline
Great TownieTownie
Joined: 28 Oct 2009
YamiTami's No Script Tutorials

This has gotten much bigger than the HUD, so I've added an index. If you want to go strait to a particular topic just paste it into the 'find' function.

ALL of this is 100% events. There's no scripting at all.

Page 1
Making Your Icons Post
Time of Day Intro: Your Type of Day
Creating Icons in PowerPoint and Paint.NET

Time of Day Post
Setting up the Hours of Day
Sleep Process
Changing Lighting in Outdoor Areas

Day of the Week Post

The Why I'm Doing All This Nonsense Post

The Food and Hunger Post
Basic Hunger System
Stuffed/Starving Caps
Gluttony Add-On
Favorite Food System

Health Regeneration Post
Mood Overview
Utterly Basic Health Regeneration
Regen Based on Max HP
Health and Hunger
Health and Mood

The Alcoholic Post
The What Now?
Livers of Steel Method
I'll Never Drink That Much Again Method
Passed Out on the Bathroom Floor Method
Hello, My Name is Mariana, and I'm an Alcoholic (Hi Mariana) Add-On
Other Possibilities

Follow Up Post
Consolidating
Nighttime Healing and Hunger
Rotting Food
Fast Forward Time

The Gathering Post
Overview of Equipment Items
Setting Up the System
Setting up the Command Event
The Basic Parallel Event
Area-Specific Gatherables Add-On

Page 2
Frankensprite Post

Hunting Options Post
What Is This For?
Setting Up the System
The Basic Version
Turning Off and Turning Up
'Off' is a Matter of Opinion
Killcount and Other End of Battle Functions
The Pokecenter System
You Don't Have the Prerequisite for that Class
Troops and Terrain Tags

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Mega TownieSuper TownieGreat TownieTownie
Joined: 15 Jan 2010

Yes... I... would... :Drool:
No scripting you say..?
Pwomise?

Offline
Great TownieTownie
Joined: 28 Oct 2009

Nope, it's all events. Common events to be precise.

Making Your Icons Post
Time of Day Intro: Your Type of Day
For a general overview, each of those icons is a picture. There are several versions of each icon for the different states, for example, seven different letters on the day of the week icon in the upper left. A common event will control each icon set, so for example I have events named Day of Week Display, Time of Day Display, Hunger Display, and Mood Display. I think the best way to do this will be to explain each icon and process in turn, so I'm going to start with Time of Day.

To start, you need to decide if you're going to have Pikmin days or Jak & Daxter days. To clarify for those of you who haven't played these games (if not you should get them immediately), in Pikmin the day starts at sunrise and ends at sunset. At the end of the day the main character goes into orbit to sleep until the next day. Jak & Daxter follows the insomnia principle where the sky and lighting change for day and night but the characters never actually sleep.

You'll also have to decide what the equivalent times will be between reality and game. If you're using the Pikmin style day then you're going to want to give the player around 15 minutes of real time to do things before they're forced to return to the home base/hotel/whatever. With the J&D insomnia style it's not as important, though you probably want the day to be longer than a couple minutes so it doesn't look like the sun is a strobe light. I'd recommend that the entire day be no shorter than 10 minutes: 5 for day and 5 for night.

Finally, you need to decide how many 'phases' of day you want and where they go. For example, you could have day and night where they last 8 minutes each, or if the game takes place near the arctic circle you might have a 4 minute day and a 12 minute night. You could also add in shorter segments for sunrise and sunset.

Now, the actual tutorial. I'm going to start with the parameters I chose for my game: Pikmin days, 1 real minute = 1 game hour, 2 hour sunrise / 8 hour day / 2 hour sunset / 5 hour night / 8 hours asleep (also night).

The next step is to make your icons. You can use anything you want, from a sundial, wall clock, a simple bar with the time on it anything. In my case I have these:

As you can see I'm only going to be updating the icon every in-game hour. If you're using a wall clock design then you'll probably want to be more specific, but I wouldn't recommend updating any more often than every quarter hour, if even that much. It won't hurt anything per se, but having more would mean more images and more conditional branches, which could get annoying. This process isn't actually difficult at all, it's just tedious.

Creating Icons in PowerPoint and Paint.NET
ANYWAY I created my icons with PowerPoint and Paint.NET. PowerPoint is probably not the program you'd expect me to be using for this sort of thing, but it works very well with Paint.NET to create these things.

Using this process, I made the outline and ONLY the outline in PowerPoint, as you can see below:

The upper right is the Time of Day template and under that is the guide I used to position the sun and moon correctly (you'll notice that middle arch is not in the final icons). I only used the rounded rectangle and circle autoshapes for it, plus the sun and moon autoshapes. Also note that these are MUCH bigger than the end icon. This is important in making it look non-pixely when it's finished. You'll also need to use a decently thick line, at least 3 pt. This icon is outlined in 6 pt.

When you're done creating the outline for your icon, copy the collection of auto-shapes into Paint.NET. In this case I'm copying in three sections: The main body, the placement template, and the sun and the moon.

First I get the main body of the template into Paint.NET. When I copy this over there will be gray pixels along the edges of the outline, which we do not want.

To get rid of them, and the white background, use the magic wand at 0% tolerance and shift+click on the pure black center of the line.

Then go to the Edit menu and choose 'Invert Selection', or hit Ctrl+I. This will select everything except for the pure black line. After inverting the selection, hit delete.

Crop the image down to the size of the outline, leaving one or two pixels of buffer around the whole thing. Now you're ready to color.

Create a new layer and place it below the outline layer. Then create the fill over the entire color layer. I tend to use the gradient fill and then I run it through the filters several times. Here's the start of the dawn sky color:

(note that I'm starting over so this finished color is going to look a little different from the icons above)

Then I ran it through the distortion filters of dents, crystallize, frosted glass, and then dents again. You can also use images, pre-made textures, leave it at flat tones, or anything else you like. You just have to try out the possibilities until you find one that works for you. I seem to have a thing for the dents and crystallize filters so you'll see me use them a LOT.

Now in order to get just the amount we need, go back to the Outline layer and select the sky area. Go back to the color layer, hit invert selection, and delete.

Rinse, lather, and repeat for the other sections of color (if I was making the icons over again, I would also make the day, sunset, and night skies at this time). I've also copied the sun over (since I'm just doing dawn here, I didn't move the moon), and put it in its own layer. After making the color for it I merged the outline down onto the color layer so that I could move them together. I also put the whole guide into the image.

Then I place the sun where I want it and add in the text for the hour. It now looks how I want it for the game.

Now to save it as a PNG and to scale it down so it won't take up the entire screen. Please note that you need to do it in that order; if you resize when it's all in layers then it'll turn out wonky. PLEASE SAVE THE TEMPLATE AS A PAINT.NET FILE BEFORE YOU DO THIS. You'll need it for the other icons.

Rinse and repeat for each icon, in this case each hour of the day until 11 PM. Just go back to the Paint.NET template and change the sun position, sky color, time, etc for each case, then save and resize to the same dimensions. In this case it's 90 pixels wide by 70 tall. So long as they're all the same size they'll line up right in the game.

That concludes the making the icons part of the tutorial. Remember that they can be as simple or as complex as you want them to be. Next time I'll get into the actual events controlling the Time of Day display.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Great TownieTownie
Joined: 28 Oct 2009

Time of Day Post
Setting up the Hours of Day
Okay! You have the icons all created and saved as PNG. Next step is to upload them into your game.

I do suggest naming them like I did. Doesn't necessarily need to be 'time' in front, but having all your display icon sets start with the same word or letter makes it easier to sort through, particularly if you're dealing with four sets like I am.

Now we'll be leaving the display for a little bit as we have to create the clock first. The way it counts up is easy enough: wait 20 frames or one second and then increase Time of Day by one. You can of course use a different unit of measure, but whole seconds are easy to deal with. The event will be triggered by the 'Count Time' switch being on. If you're doing this Pikmin style then you don't want the characters to go off to bed in the middle of a cutscene, so whenever one is going on you'll turn it off at the start and turn it back on at the end. If you're doing it insomnia J&D style then you have the choice of turning the switch on at the start of the game and never turning it off, or turning it off for cutscenes. In that case it's a matter of personal preference since the party won't be forced to go back to the hotel and interrupt the cutscene.

So, the code to advance the time is VERY simple:

Now to code in the check for what time of day it is (day, sunset, etc) and also the check for if it's the end of day. The only difference between Pikmin and J&D style days is that in Pikmin the end of day switch turns on the sleep process and in J&D it just resets Time of Day back to 0.

In my case I have the phases laid out like this:
Dawn: 7 - 9 AM = 0 - 119 minutes
Day: 9 AM - 5 PM = 120 - 599 minutes
Sunset: 5 - 7 PM = 600 - 719 minutes
Night: 7 - 11 PM = 720 - 1019 minutes
And a time of day 1020 minutes or greater will trigger the end of day.

In order for the lighting event to work (which we'll get to later) you'll need a variable to store the phases of the day. I numbered mine Dawn = 1, Day = 2, etc.

This is how the code for the J&D insomnia day will work (in a game where 7AM comes right after 11PM)

In this part, the only difference between J&D and Pikmin is that instead of resetting the time to 0 it turns on the sleep process event (the sleep event will take care of resetting things to 0).

And that is is for the timekeeper event, at least for the Time of Day process. If you're going to be using my Hunger process then we'll come back to this later.

Sleep Process
If you're using the Pikmin day then you'll also need a Sleep Process event. When the timekeeper event turns on the sleep process switch, you'll need to send your party back to their designated sleeping place. If you only have one option then just send them there. If you have the choice of different places, like warping back to the last used Pokemon Center, then do this:

Two more events left: the lighting event and the actual display event. Since lighting is shorter I'll start with that one.

Changing Lighting in Outdoor Areas
You'll need to trigger the lighting with a new switch. I've named mine 'Outside' since I don't want the nighttime lights to be dim in buildings, but the lighting event can also be shut off if you're in an open field which is tinted red for some reason. When the switch is on this event will automatically update the lights when you enter a new time of day.

The branch for this one is very simple: just check what the Phase variable is and then set the screen tone to something appropriate. These are the values I used, but if you don't like those then just play around until you find a tone you do like.

AND FINALLY the last step: coding the actual display. It's actually identical to lighting except instead of screen tone it has pictures and there's a LOT more of them. Plus it runs on the Display switch, so that you can leave it up for the little cutscenes and shut it down for the longer, more pivotal cutscenes.

PLEASE NOTE that BEFORE you code all the branches you need to figure out where the picture needs to sit. Otherwise if you want to change it then you're going to have to change ALL of them. This is going to look random since I copied it over from Slumber, and as you can see from my first post the upper left is taken up by the day of the week icon (next to be explained). Once I get that icon programmed into the tutorial game the time of day one will look less wonky.

Also note that all the icons above are set to 'picture 2'. In my game day of week is picture 1, time of day is picture 2, hunger is 3, and mood is 4. It is important to remain consistent. The whole reason why you don't have to delete the last picture when the time gets updated is because there can only be one picture 1 on the screen at once. Whenever you pick a picture number for your displays you can't use it for anything else. Well, you can, but it'll look wonky.

And so you have the time of day set programmed in. Note that not using the icons won't break the system. You only need it if the time of day actually matters. If you're running Pikmin days then it definitely does. If you're running your standard J&D days then it doesn't matter since you're going to be running around no matter what time it is. The only exception in J&D days where you might want it is if you program things to only happen at certain times, for example, shops closing at sunset.

Speaking of times, I'm also using local events in order to make the windows change in time with the times of day. Just made a character sheet with windows for each phase and set up a parallel event to change the graphic depending on what the phase variable said.

This is also how you'd do things like shops closing, just have a check that says if it's past 6PM then the door event will tell you its locked instead of transferring you to the shop map.

Well I should have been asleep two hours ago. I'll pick up with days of the week maybe tomorrow.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Townie
Joined: 17 May 2010

Thanks for the tut. Pictures weren't loading before, thats why Iasked for a text based, but they came up this time.

Cheers Laugh

[=10]Legends are not born legendary. They are created when they lose that of their own of which they hold dear- life itself

[url=http:

Offline
Great TownieTownie
Joined: 28 Oct 2009

Huh. I wonder if Photobucket was having issues or something.

Day of the Week Post
Next up is day of the week. You only really need to program in days of the week if you're going to have some things happen on certain days, like shops being closed all day on Sunday or something like that. If not then you don't really need it, though it won't hurt to have the indicator there.

In the case of Slumber I made up my own days of the week. Each of these is named after a god in the local pantheon. For example, Kin is the god of commerce and it's on Kinsday when the weekly fair happens in the nearby city of Crest, so if Mariana wants to do something in Crest she's going to have to be in the wagon by 10AM on Kinsday. Since I've switched up the day names I'll have an easily accessible note pinned to a wall in the common room listing them.

Once again, upload your icons. I've named the files both with 'day' in front and then numbers 1-7 so I can easily keep track of the order.

Now to make it so the game updates what day it is at midnight/end of the day. If you're using J&D days then stick this branch right after you reset the time of day to 0, if you're using Pikmin then place it in the sleep process like this:

You need the branch in order to make sure the day of the week doesn't keep going to infinity, and instead loops back to 1. That's all there is for that part.

Doing the display is the same as with the Time of Day, except you can check if the variable is equal to the value instead of less than.

And that's it for Day of the Week!

The two display icons left are Hunger and Mood. The reason why I have them is because their values effect health regeneration. It may seem backward, but I'm going to do Hunger and Mood before doing the health regen part of the tutorial since you need the values for each before calculating health regeneration (at least in this setup you do).

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Mega TownieSuper TownieGreat TownieTownie
Joined: 4 Dec 2009

......omg.

ilu, Yami. :lol3:

Trent saw you naked.

Need resources? Drop me a line! If I don't have it, I can likely find it!

Offline
Great TownieTownie
Joined: 28 Oct 2009

I'm still in the process of getting everything moved over to my new laptop, including the registration for XP, so I don't have any new screenshots in this post. However I feel that I should probably explain why I thought the processes behind the HUD were necessary for my project so that you guys have more information at hand when deciding if you want them for yours.

The Why I'm Doing All This Nonsense Post
Time of Day and Day of Week are both pretty basic and can have uses in just about any game style, however, Mood and Hunger go a bit beyond. The reason why I have these two functions in my game is because I'm trying to see if I can get things a little more realistic without making gameplay annoying. There's also a process running behind the scenes which both Hunger and Mood tie into: health regeneration.

The reason why I've decided to have health replenish naturally is because, in my mind, spamming healing spells seems like a good way to end up with cancer. After all, tumors are collections of cells which split and grow much faster than normal, and healing magic probably would work through accelerating the process. The other possibility is that the magic shifts around matter itself, thus knitting flesh without causing accelerated growth, and to me this seems like a good way to end up with your liver outside of your skin. All of this is made worse by the fact that rushing through a spell during a battle has to up the chances of mistakes.

After looking at all of this I decided to have the following system for healing magic in Slumber (and probably all future games): healing magic does exist and can be very helpful, but it has to be done slowly and carefully or else things get very ugly. Apprentices are guided by a master at all times to make sure someone is there to 'catch' the wandering threads of the spell if things go wrong. Furthermore, healing magic is only used if the patient will certainly die without it. The preferred method is natural healing, though it is often helped along by magical tonics and so on. These medicines do NOT have knitting-flesh-back-together magics, but they do have magics that help keep fever down, reduce swelling, keep infection out of wounds or keep it from spreading, etc. Treatment of symptoms so the body has an easier time with the healing.

SO what this means gameplay-wise is that there is a base health regeneration rate. I'm still playing with numbers, but I'm thinking that 1/100th of max health recovering every second (or in-game minute) will work as the base. There will be a series of sidequests the player can do to increase this base recovery. I'm thinking that it'll be fairly easy to get to about 1/50th max health every second and then after that they'll get really hard, but if the player gets through them health regeneration could be as high as 1/10th of total health every second.

Hunger and Mood will then factor in to either speed up or slow down recovery. In the case of Hunger it has no effect unless the number drops down below 0, or into the starving range. At that point recovery will stop until the party has been fed. Food can be bought in towns and/or the party can eat the meat of the animals they hunt on the road. If hard times have fallen and funds are low there will be a soup kitchen in almost every town, however, having to resort to charity will drop the party's mood.

And on to Mood. Unlike Hunger, each of the five states of the party's mood has a different effect on health recovery. Also, while the Hunger factor counts for everyone in the party, each character will have a separate mood rating. When more people are in the party than just Mariana their faces will also appear on the HUD under Mariana's, but they'll be smaller.

What Mood does is simple: the better you feel the faster you heal. So even if a character is severely depressed (as Mariana is at the start of the game) they will still heal over time, it'll just be a lot slower than someone who's happy. Again, I'm still playing with numbers, but I'm thinking it'll run like this:

Very happy: 5/3
Happy: 4/3
Indifferent: 3/3 (no change)
Sad: 2/3
Very Sad: 1/3

Now for an example. For ease, we'll say that the character has 1,000 max HP. The base regeneration would be 10 HP per second. Now, depending on the character's mood, it would be:

V Happy: 17HP/sec
Happy: 13HP/sec
Indifferent: 10HP/sec
Sad: 7HP/sec
V Sad: 3HP/sec

That might not seem like much of a difference, but think about what happens over the course of one minute, or an in-game hour:

V Happy: +1020 HP
Happy: +780 HP
Indifferent: +600 HP
Sad: +420 HP
V Sad: +180 HP

As you can see, it's a big difference over time.

As for ways to boost mood, there are lots of options. Some are plot-related, for example, Mariana starts out in the Very Sad range, given that she's depressed over the loss of her kingdom, but by the end of the first chapter she'll be in the just Sad range since doing something to save her people has her feeling better about life. There will also be sidequests, like bringing berries to a lonely patient or similar good-deed sort of things. Another option is food. Each character will have a set of favorite foods and eating them will give a boost to mood. I believe I settled on Apple Pie, Anise Liqueur, and Stuffed Poultry for Mariana.

Speaking of liqueur....

As I am crazy I added another facet to the Mood system which gives me two other Mood states: Drunk and Hungover. Since all alcohol gives the party a mood boost I felt it was necessary to insert consequences to destroying their livers. So, after a certain number of drinks, the party will get Drunk. This is not only a different mood icon, but a status effect which lowers accuracy, lowers speed, but raises defense a little since booze numbs you. If the party stops at the drunk threshold then there will be no major consequences except for stumbling around battles and possibly getting hurt more.

I'm thinking it'll be about two drinks over the drunk threshold when they'll hit the Hangover threshold. When it rolls over into the next day the sleep process will check to see how many drinks they had the night before. If it's over the hangover number then they'll get slapped with the Hangover mood and status effect, which lowers speed, accuracy, defense, magic defense, strength, and magic power. While the hangover is still in effect health regeneration will drop down to the 1/3 mood factor regardless of how happy the character was yesterday, and longterm mood will also take a decent sized hit. At the end of the day hangover will be lifted.

FURTHERMORE because I'm extra insane I added in an alcoholic factor. Since you build up tolerances to booze, after a certain number of drinks the drunk and hungover thresholds will be raised. So if you want to keep mood up by sending them to the bar then you'll be able to give them more mood-boosting drinks before hitting those points. There'll also be an alcoholic award at the end of the game if you reach an insane number of trips to the bar, since this is the kind of thing that amuses me.

So there is the explanation of why I decided to have all this nonsense into my game, and hopefully this has helped you decided if you want it in yours or not. My next post will have the tutorial for Hunger and the eating processes.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Mega TownieSuper TownieGreat TownieTownie
Joined: 15 Jan 2010

Omg Yami...
How on earth did you come up with these pieces of beauty?
I'm definetly using the time of day one, and perhaps the day of the week, but I'm not as commited to making a food and mood HUD. I like the way you've set up your system with reality and how terrible yet funny you make healing magics sound....

I would like to put in to requests though.
1. That you give us the time of day icons you've made (cause i'm to lazy to make my own Sticking Out Tongue... EDIT: and I don't have paint.net as it turns out...)
2. That someone pin up this thread!!! WOO YAMI!!! Laugh

Offline
Townie
Joined: 17 May 2010

I second a pinning of this topic... it's absolutely epic in its brilliance

[=10]Legends are not born legendary. They are created when they lose that of their own of which they hold dear- life itself

[url=http:

Offline
Great TownieTownie
Joined: 28 Oct 2009

Paint.NET is actually freeware. You can download it here: http://www.getpaint.net/

And here are the icons: http://www.megaupload.com/?d=89P9ILYA

I've actually redone Time of Day so that the sun and moon track across the sky more smoothly, and with a font that matches others used in my game. I went ahead and made them for all 24 hours, with sunrise being 7-8 AM and sunset being 6-7 PM. Since my Day of Week icons are for made up days and Consolas is a weird font (but it matches what I'm using) I've put the template in there sans any letters. You can add those easily in regular old Paint. I've also revamped it so it's a little different in coloration and the crescent is set to fit the upper left corner. If you want to put it in another corner just flip it around before you put in your text. And while I am probably the only one crazy enough to go for the full hunger/mood driven HP regen system I've added the revamped hunger icons as well. The colors are new and I ditched the carrot.

AND NOW the hunger section of the tutorial. Let's start putting some headings in here so you can actually find things, huh?

The Food and Hunger Post
Basic Hunger System
Hunger works on a minute system, meaning that with each minute the 'Fullness' variable goes down by one unit. To do this you just need to insert the variable change right under the one that increases the Time of Day variable:

(btw I forgot to backup the tutorial file so I'm starting over, thus why it's missing the sleep process and such)

I then backtracked and figured out how big the meals would have to be in order to keep someone full until the next mealtime. I ended up with this system:

Hunger Ranges:
Stuffed = 700 and higher
Full = 500 - 699
Okay = 100 - 499
Hungry = 1 - 99
Starving = 0 and lower

Food Values
+25: drinks and light snacks, like hard candy
+100: milk, apples, other snacks, pie
+300: light meals like what they'd cook on the road, like meat stew
+500: heavier meals like you'd get at a nicer restaurant, like a beef roast

The beauty of this system is that I'm only going to need 4 common events to deal with all of the food, be it 20 items or 200. The only reason to have more is if you're having a favorites system, which I'll cover later.

Below is a screenshot of the 'green tea' food item when it's set up properly. Note that the first two fields outlined in red--scope and occasion--can be set differently. I use this format because one item feeds the whole party because it easier that feeding each person individually and because the party doesn't need to be taking a tea break in the middle of a battle. No matter how you set that up you will need to call the +25 common event (or whatever you're using for tea).

Now, the event. It's all of two lines, so it's not too bad.

The reason why I call the menu screen is because when the event runs it exits. I would have it pull the item screen back up but A) I don't know how, and B) that would probably take scripts and I promised this would be 100% event. However calling the menu back up is optional, so if you want the party to eat and move on then just leave that line out.

The other three events are exactly the same, just with +100, +300, and +500 instead of the +25. Have each food item call the appropriate event just how the green tea did.

Now, the whole reason why I have the hunger system is for it to factor into healing. I'll cover this in detail when I get to the HP regen section, but here's a screenshot of the Slumber code for a preview:

And of course the display works the same as the others.

Stuffed/Starving Caps
This is just an extra precaution that I recommend you take. If you don't do this then you could get the party up to 3000 fullness and they won't have to eat for days, which is unrealistic for humans, and if they starve down to -1000 then you'll never get them back into positive numbers.

All you have to do is add these two branches underneath the fullness reducer in the Count Time event.

Note that you don't have to set handling if conditions do not apply. All this will do is check to see if it's gone over the cap, and if it has it'll set it back to the cap. So if you've stuffed your party when it runs through the code the next time and sees that Fullness is at 955 it'll scale it back to 800. On the other hand if no food is in sight and the event automatically runs Fullness down to -301 the check will catch it and it'll go back up to -300, and it'll just bounce back and forth between the two values until you feed your party.

Also, while I'm confidant in the ranges and food values, I'm more ehhhh about the 800 and -300 caps. Play around with it until you find something that suits you.

Gluttony Add-On
This is an extra bit you can have in the Stuffed Cap system. What it does is check to see if the party has gone over the Stuffed Cap and if so it makes them fatter. Gameplay-wise this translates to everyone losing one point in their speed stat.

Here's what the code will look like:

(NOTE: I forgot to put in that after this code you need to set Fullness back to the cap of 800)

Now, what in the name of math does that mean? I'll go through with the example overstuffed value of 1000 in Fullness:
After setting the check variable to the current Fullness value, we subtract 800 since that's our overstuffed cap. We only want to penalize the party for how much they've gone over.

1000 - 800 = 200

Then we divide by 100. This will give us how many hundreds over the cap the party went, rounded off since it's working in whole numbers:

200 / 100 = 2
Or for example:
212 / 100 = 2 (with a discarded remainder of 12)

And finally, we penalize the party one point of speed for every 100 units they went over the cap. Depending on how you have your stats laid out, you might want to make this for more or less. So for example if you wanted less points taken then dividing by 200 would only reduce it by 1, or if you want to make it more dividing by 25 would make it 8 (for this example of 1000 Fullness).

And then just do that for each party member. It's easy to do this quickly, just copy the first bit of code for however many members you have, then go through hitting 'space' to edit and chose the next name on the list with each one. Don't worry about it reducing stats for people who haven't joined you; when you add them it'll initialize to the default settings, no matter how much the stats have been changed before that.

EDIT:
Forgot to add that there are two other ways you can do this. One is to put the gluttony check in its own process, which will also be triggered by the Count Time switch. In this case you'll have it wait a long time, say one real world minute, and then check to see if Fullness is above the cap. If so then penalize the party one point and then DON'T change Fullness. Since it waits 60 seconds then the next time it checks 60 points of Fullness will have been bled off.

Having the program wait 600 frames twice comes to 1200 frames, or one minute worth. Once it runs through that it'll check and fatten just like the other version:

The other choice is to do it like the first version, but to do it at the end of the day. Just insert that same code into the sleep process, but don't add the 'Fullness = 800' bit since it'll go down over the course of the day. You only need the reset to the cap if you're doing it in the Time of Day event.
END EDIT

Favorite Food System
This really doesn't have a point if you're not using the mood system. With this when you feed the party something that someone really likes then they'll get a boost in mood. You can also use this in general for treats or (in my game) alcohol.

So say that Default Character Aluxes really likes Apple Pie. You'll set up the Apple Pie item like this, calling its own event:

Since each favorite will need its own event I would suggest limiting yourself to 1 or 2 per party member just because it gets cluttered. If you did 2 for each of an 8 member party then that would be 16 events (assuming there's no overlap), which I think is perfectly doable. However doing 4 each would get into 32 which I think is a little much (even for my insanity). However if you have a smaller party, say 4 people, then doing 3 favorites each would only amount to 12 extra events. It's up to you to decide where your limit is.

Anyway, onto the actual event. It's still not difficult; you're just adding the mood line.

Rinse and repeat for each favorite.

You can also take this system the other way and have it take away mood points. In Slumber I have this happen for Creature Meat family and Provision Beans. The way I have it set up for meat is that there's red meat (from cows, moose, deer), game (rabbits and such), poultry (chicken, ducks, quail), and then creature meat. Creature meat is the catch-all for anything I think would be stringy (like wolf) or otherwise unsavory (like giant sandworms), and thus the party will be unhappy if they have to eat it. To a lesser degree they're Undecided about the beans because they're boring and make them farty, but it's the cheapest thing they can stock up on in town.

The way to call an un-favorite is the same as calling a favorite. The only difference is that you're going to be subtracting mood instead of adding to it. Also below is an example of batch mood change; in Slumber I have the same thing going on for booze except it adds instead of subtracting.

And that's the Hunger system. Really that's the Mood system too since it's just adding or subtracting at plot points, sidequests, or food consumption. I'll give an overview for how to do each of those at the start of the next post and then continue with the health regen system. I'll also set up an index in the first post so you can find subjects more easily,and change the name of the thread since this is about more than HUD now. After HP Regen I'll do drunkeness, a more in-depth look at closing down businesses and such with the Time of Day and Week system, and also how to do achievements. I'll probably move the Frankensprite tutorial over here too to make things more consolidated. You can delete your own threads, right?

Defying the Grand List of Role Playing Game Cliches since 2009.

Emanzi's picture
Offline
Super TownieGreat TownieTownie
Joined: 9 Jun 2009

Wow, I thought the Frankenstein spriting tutorial was awsome but this is even beyond... :Drool:
Man, thanks alot Yami, this will help tons and to think I was gonna get a script, common events make it totaly customizable.
Favorite tutorials off all time! Sticking Out Tongue

I'm definitely bookmarking this page...

Notice:
Need a face-set or character sketch/concept P.M me. I draw mostly manga style though and it might take roughly a week

Offline
Great TownieTownie
Joined: 28 Oct 2009

*blush*

NOTE: On the Gluttony subsection of Hunger I forgot to put in that after you make your party fatter you need to set Fullness back to the cap (800 in this case) or else they'll keep getting the penalty. I'm fixing it and also adding in a paragraph for other options for it.

Health Regeneration Post
Mood Overview
I already posted above how to alter the character's moods with items. The other two ways are with sidequests or other encounters with NPCs/local events or to have it happen with the story.

When it's story related then you'll just adjust the mood levels at the end of the relevant cutscene, like this:

Also a reminder if you're running Pikmin days: when you go into a cutscene you need to turn off Count Time. Otherwise there's a chance you'll hit your end of day during the cutscene and go to bed in the middle of someone talking. Once the cutscene is done just turn Count Time back on.

When it's sidequest related you'll put the mood alteration in with the spoils. So if a girl gives you a potion for getting her cat out of a tree you'll put the +50 mood under the code adding the potion to your inventory.

As for the brackets for mood, this is what I'm currently using (though I might change it to be a bigger range):
V Happy = 200 and higher
Happy = 50 - 199
Indifferent = 49 - (-49)
Sad = -50 - (-199)
V Sad = -200 and lower

And now on to why I have food and mood. Though first I'll run through how to have HP regeneration without any variables.

Utterly Basic Health Regeneration
In this method, you'll be adding a set number of HP to the party's HP every time interval. In this case I'll be increasing HP by 10 every second. This will go in the Count Time common event. This one is very simple and it only takes one line of code for the whole party.

The downside to this method is that you can't upgrade the regen to match the party's higher level. Well, you can, but it's long and annoying and I much prefer this next method because you don't have to run any checks for it the party's reached level 10 or anything.

Regen Based on Max HP
This takes the basic to the next level by basing it on a specific fraction of each character's max HP. This is favorable because A) it automatically grows with the character's level and B) the guy with twice as much HP as the others isn't stuck with their regen rate.

First decide what fraction you want to use. This will mainly be based on how much damage the battles will do to them on average, and if you're leaving healing items in the game. I've already mentioned my Undecided about healing magic so I won't have them, but I'm also adjusting the monsters to do less damage. I'm using a 1/100th baseline for this reason. If your monsters still do more damage and you also have healing items then 1/100th should work for you too. If you're doing more damage with NO healing items then you'll probably want to scale it up to at least 1/50th if not 1/20th.

So, I'm using 1/100th. So with each second each character will regain 1/100th of their max HP.

You'll be setting up the code to calculate how much 1/100th is right above the regen code in Count Time. HOWEVER if you're using Pikmin days and there's a sleep process you can calculate it there and those numbers will be used for the whole day. The only real difference is where the code is; it'll run the same either way. It's just that in the sleep process version any changes to max HP that come with leveling up won't come into play until the next day.

Personally I'm using the sleep process method in Slumber, but I'm also doing fifty things to the factors. If you're just doing plain old by fractions as I'll demonstrate here then it won't be cluttering up your Count Time event.

ANYWAY on we go. First you'll need to set a variable to the character's max HP. Make sure you do choose Max HP and not just HP.

Then divide your healing factor by 100 (if you're using 1/100th) and add that variable to the character's HP. Rinse and repeat for each character.

Easy as pie. You can also make it so that the fraction can be upgraded if you like. In Slumber this is done by doing ludicrous sidequests for a crazy guy who lives in a cave. In order to make the fraction changeable, just use a variable instead of '100'. Set the variable to the starter baseline at the start of the game and then change it when sidequests are completed.

Health and Hunger
This is actually not hard, at least not how I have it set up for hunger to affect health regen. That is that hunger has no effect on regeneration unless it's dropped into the starving range, or below zero. At that point regeneration stops until the party has been fed. All you have to do is add a conditional branch.

And that's all there is to it for turning off health regeneration when you're starving.

Health and Mood
Now this is the one where things get a little longer. Also when I moved my health factor calculation into the sleep process. Because it is long and I'm feeling lazy here's a screenshot from Slumber. No fancy regen for you, Aluxes.

The blue box outlines what's new. As I stated in the 'why I'm crazy' post, the way this works is that each mood bracket has a fraction which is multiplied with the 1/100th of the max HP. Fractions for the brackets are:

V Happy: 5/3
Happy: 4/3
Indifferent: 3/3
Sad: 2/3
V Sad: 1/3

You'll notice that all the fractions are in thirds. This makes it so I only have to divide by one number, which I do at the top of the blue box:

Then opens up the conditional branch which checks which mood bracket Mariana is currently in and then multiplies by the appropriate number. Dividing by 3 and then multiplying by (for example) 4 ends up being the same as multiplying by 4/3. However since you have to use whole numbers with the variables the fractions have to be split up like this.

After doing Mariana's section I copied it and changed the variables and such over for each of the other characters. You're probably starting to see why I only have four. I may be crazy but I do have SOME self preservation instincts left.

And that's it for health regeneration! Next is drunkenness. I know you guys can hardly wait.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Great TownieTownie
Joined: 28 Oct 2009

The Alcoholic Post
The What Now?
I never intended for this section of the Mood/Hunger system to get so elaborate. It started with the idea of Mariana feeling a little better after having a drink and deciding that alcohol would be a mood boosting food item for everyone. Then I got to thinking about the consequences of trying to fight drunk and then it all spiraled downward from there.

The complete system involves the following: the alcohol food items with the drink hunger rating (+25) combined with mood boosting (I'm thinking 20ish points), status effects of Drunk and Hungover, mood icons for both states, and a few variables to keep track of everything.

The most basic system would work exactly like the favorites in the hunger post: adding some mood but having no other effects. But that's boring so here we go.

Livers of Steel Method
In this system there'll be the drunk status but no hangover.

The first thing to do is decide how much alcohol it will take to get the party to the drunk threshold and how many 'points' the drinks are worth. The simplest system is to have each drink be worth 1. The item would call this event:

Adds hunger, mood, and 1 to the 'Drinks Today' variable. Also note that if the party is getting their drinks at a bar you don't have to bring items into the picture: just have the barkeep local event call the Booze common event when the party decides to knock back a few.

The second system has different levels of drink as happens in real life. So beer is worth 1 point and whiskey is worth 2 points. All that is required for this is a second event:

You could have as many different levels of drink as you want using this system and have as many varieties as you want. After a lot of whittling I finally decided on 4 soft and 4 hard drink types. (I still have 50 total food items btw >_>)

Next, decide what your characters' alcohol tolerance is. You could put it at 10, you could put it at 1. Personally I'd go with 6 or so for this version of the system.

Now you can set up your sobriety check. All it does is check the Drinks Today total against your chosen threshold. If the Drinks Today count is higher than the threshold then drunkeness sets in.

So what does this mean? Well, what drunk does is completely up to you. You could make it so they just have a little trouble hitting things...

I would suggest unchecking the 'release at end of battle' box since we'll be releasing them from the thrall of alcohol during the sleep process (to be explained below).

Another common drunk-symptom is stumbling, so agility is an obvious choice for downgrading. Dexterity essentially does the same thing as Hit Rate, but taking both down will effectively make it so they can't hit the broad side of a barn. Not being able to grip things is not as universal a symptom as not being able to walk in a straight line, but taking that down a few pegs is definitely feasible. And then in the are of things it upgrades there's always the option of upping PDef since booze numbs the pain. And on the fantasy side of things you could have it either downgrade or upgrade magic abilities.

I'm mean to my people, so here's what I ended up with for Drunk:

Not <i>impossible</i> to fight with, particularly since enemies won't do as much damage, but it will be irritating. I'll have the barkeep who offers Mariana her first drink strongly suggest that she never go out of town while she's wasted.

Now, getting rid of it with a good night's sleep. All you have to do is remove the status from the entire party and also reset 'Drinks Today' to zero.

And that's it for Livers of Steel!

I'll Never Drink That Much Again Method
Now there are serious consequences for your shenanigans the night before. The process for the party getting drunk is the same, but in this case we'll be adding a bit of code to the sleep process checking to see if the party has gone over the hangover threshold. Again, this can be anything you want it to be. For a drunk threshold of 6, I think I'll go with 9.

As I've already admitted I'm mean, so this is my hangover:

As you can see it's mostly the same as Drunk except a little worse AND without the boost in defense, since with a hangover the tiniest sound makes your skull split.

Passed Out on the Bathroom Floor Method
This adds another layer and another threshold, this one being the passed out cold threshold. If you've reached it (12 in this example) then the party will stagger to the inn/wagon and pass out until morning. This translates to triggering the sleep process.

That's it for that one. Basically it causes your party to have wasted the rest of the day via getting wasted. Also, while you don't have to be using the mood system with this (food could restore health or such), if you are doing mood then you'd want a penalty to everyone's mood for both hangovers and for passing out. This would cancel out most of the benefit from the fun the night before, just like real life. And so just like in real life the goal becomes getting buzzed and NOT getting all out drunk, thus avoiding the headaches and other irritations of hangovers.

Hello, My Name is Mariana, and I'm an Alcoholic (Hi Mariana) Add-On
In real life you'll build up a tolerance to any chemical altering substance you take on a regular basis, alcohol included. This is why long-time drinkers aren't as 'drunk' as others with the same blood alcohol content. So I worked up a way to have the party build up a tolerance so it takes more to get drunk. Gameplay wise this means that you can boost the mood more without getting the party impaired.

The reason why I have this set up is because I'm having achievements for everything else you can level, so why not the booze?

The first step is to keep track of how many drinks the party has ever had. All you have to do is add Drinks Today to another variable before resetting it in the Sleep Process.

Now that you're keeping track of that you need to alter the checks a little. The way I have it set up is like this:

How this is set up, each 10 drinks sets the party to a new 'level'. So when you start out it's 0/10, or 0, for the base number. Obviously that's no good, because then they'd be drunk all the time if that was the drunk threshold. Unless that's what you're going for. Anyway, that's why I then add 4 (going for a lower threshold here). That way it'll start with 4 drinks, then when you get to 10 drinks 10/10 = 1 and 1 + 4 = 5 drinks to drunk.

Just do the same with the hangover and passed out checks, except add a little more to them. I think I'm going to settle on +6 for hangovers and +8 for passed out.

Other Possibilities
A fun thing you can do with this is have people react differently if you're drunk. Particularly if you make your character(s) out to be super friendly drunks who frighten people on the street with their sloppy declarations of affection. Or hey, you could even have a sidequest only accessible if you're drunk (maybe the guy is also drunk and won't talk to anyone who doesn't understand or something). Lots of fun can be had with this.

You could also be more strict with the party about their habit, like knocking 10 points off their MaxHP every time they get a hangover or pass out. How I have it set up in my game right now they don't get any mood penalty for just getting drunk, no hangover, but you could definitely do that. Not everyone is a happy drunk after all. Or you could have some people be happy and some not.

You could also do this for each individual person, so that not everyone has the same tolerance to alcohol. I'm sure I'm going to end up doing that, since I'm crazy, but even I'm a bit meh about coding that. Like everything here it's not really hard, it's just REALLY tedious.

Then there's also the superficial bit of giving the statuses their own icons in the HUD.

You do this by placing those ahead of line in the regular mood checklist, like this:

Really, you could do this with any status effect. Have one for poison, one for low HP, KO, whatever you want. Just know that whatever is at the top of the conditional tree will be displayed first. So between drunk and poisoned I'd probably put poisoned first (though really, hungover is a type of poisoned). KO would have to be at the top of the list. And so on.

Soooooooooo yeah. This is what I do with my free time.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Super TownieGreat TownieTownie
Joined: 25 Jan 2010

This is some epic eventing. I only thought you could have something like a hunger system possible only through scripting...but this proves my thoughts wrong big time. Probably amongst the most creative use of common events and variables I've seen yet.

The tutorial is very in-depth too...even a complete newbie to RMXP could get this because there's pics of everything you have to do in the post. This should be stickied or pinned...whatever it is called. It would be a shame to lose this tutorial a month or so later for no posts. Frown

I mostly like the health regeneration thing...it'll be a big help in my game I'm making since it's more futuristic-day based...and there is no magic from what I'm making it as. Thanks for the tutorials yamitami!

Offline
Great TownieTownie
Joined: 28 Oct 2009

I think it's going to be a while before I get through all of this given how much can tie into what I've already explained. So at least for a while things will stay up.

Follow Up Post
Consolidating
These are just a few little things I either forgot to put in the relevant tutorial posts or thought of after I'd already put up the relevant post.

Mostly it's about simplifying. At first I had separate events for a lot of things which have now been condensed. Mostly into Count Time. Here's the complete listing:

Count Time, Parallel by switch Count Time ON
(wait 20 frames)
Increase Time of Day var
Decrease Fullness var
HP Regen
Sobriety Checks
End of Day Check

Sleep Process, Autorun by switch Count Time ON
Count Time turned OFF
Fade out screen
Calculate HP Regen factors for the next day
Hangover Check
Gluttony Check
Nighttime Hunger (to be explained below)
Nighttime Healing (to be explained below)
Rotting Food (to be explained below)
Fast Forward Time (to be explained below)
Resetting Time of Day
Advance Day of Week
Transfer to sleep point
Turn Count Time back ON
Turn Sleep Process OFF

HU Display, Parallel by switch HU Display
Day HUD
Time HUD
Hunger HUD
Mood HUD
(this is separate from Count Time because I want the HUD to stay up during the sleep process)

Outdoor Lighting, Parallel by switch Outdoor Lighting
Check for phase of day + proper lighting settings

All of what I've explained has gone into those four events (minus food since I haven't gotten to those yet for Slumber). I think it's a lot cleaner than how I originally had it set up, with separate events for a lot of things.

I also took out the 'Phase of Day' variable and the other similar ones. I'm not sure why I thought I needed a separate variable for that since it's just as easy for the conditional branches to go 'if it's less than 960' as saying 'if it's equal to 3'.

Nighttime Healing and Hunger
The basic answer to nighttime healing is to fully restore the party's health. If you'd also like to remove all status effects then use the 'Recover All' function. I however am making it so they have to go to a hospital to wake up someone who's KOed and also that there are a couple statuses which survive a good night's sleep. Therefore I'll be removing the statuses that are healed by sleeping individually and to heal them I'll use Change HP, adding a bigger number than their max HP will ever get to. So +9999 will do it.

What I'm doing with nighttime healing is having them heal as much as they would over that much time in the day. Almost all of the time this will heal them completely anyway, but it leaves room for interesting effects from the negative states.

The first step (in the green box) is to figure out how long they're going to be asleep. If the day runs to its end naturally then it's going to be 8 hours, however, if the party goes to bed early then it'll be longer. Figuring this out is simple. Since there are 1440 minutes in 24 hours, the Night Heal Time variable is set to 1440. Then you just subtract the Time of Day factor. PLEASE NOTE that this has to be done before you reset Time of Day to 0, so it you have it where that happens at the top of your code then you'll need to move it below this.

Next (blue box) is calculating how much each member will heal in that time. 'WM Healing Factor' is a variable I'm using in Count Time and I'm reusing it here (since Count Time is off there'll be no conflict), thus why the name makes no sense. What I'm doing here is setting it to the Night Time Heal factor, then multiplying by each character's HP regen factor. This gives me the right number to heal them by. Then I turn around, reset WM Healing Factor to Night Heal Time and do it again for the other characters.

That does it for the healing. Next is hunger, which goes below healing since it also uses the Night Time Heal factor. Since you lose exactly one point of Fullness every in game minute we don't have to use fancy factors for this one. However, I am dividing the heal time by 3 since we don't get as hungry in the 8 hours asleep as we would not eating for 8 hours when we're awake.

And there you go.

Rotting Food
File this one under "what is wrong with Tami".

I have ended up with a list of about 50 food items. It used to be almost 100 so 50 is actually not all that much if you look at it that way. Anyway here's part of the list:

Thing is that I'm running in your typical psudo-medieval fantasy setting, and fridges don't really exist. At least not usually. I'm thinking of having a ludicrously expensive cooling spell you can buy for the wagon which keeps the food from spoiling.

ANYWAY unless that happens all the meat, soup, milk, juice, and so on are going to spoil eventually. There are things which don't spoil, however, such as jerky, dried meat, dried fruits, beans, cheese, tea leaves, booze, and 'Crest Milk' (one of the city states in my game is crazy about milk, so they have milkbottles with cooling spells built in).

This is mostly an issue when you're on the road. I'm having hunting built in (to be explained later) and after say a deer has been killed and cleaned you'll get another item in 'red meat'. You can choose to cook this into any of the red meat category foods or to preserve it as jerky. Same for killing a duck, except since poultry doesn't jerky quite as easily it's dried. The dried meat can then be used to make soup, which rehydrates it.

The end point is that the party would rather eat the good stuff but jerky and beans last for longer on the road. It's then up to each player to decide if they're just going to take the small hit to mood for eating beans all the time (they're the cheapest food) or if they'll take the time to go hunting so that the party can eat better. More on that system when I get into the hunting/gathering/preserving tutorial.

What I'm showing you now is the spoilage process. Another to fall into the 'easy but VERY tedious' category, doubly so since I have 50 food items. It's only four lines, and it's only four instead of three because I'm doing achievements, but there are a lot of sets.

First you set the "Spoiled Food Check" variable to the number of the perishable food in inventory. The first one (blue box) in my case is Fresh Red Meat. I then remove that number of Fresh Red Meat from inventory and add that many Spoiled Food to inventory. The last step, again for achievements, is to add that number to the Total Spoiled Food variable, which will keep track of how much food spoils over the course of the entire game.

Then it's just copypasta and changing names for the rest of them.

Fast Forward Time
This is completely superfluous, but it's pretty. This is for skipping through the time the party's sleeping, or anything else they're doing that you don't want the player to have to sit through. What it does speed through the HUD icons. In the case of my icons this will make the sun and moon track across the sky until it gets back to 7AM.

In order for this to work you'll have to have HUD in a separate event which runs even when Count Time is off. You'll also need to set up the HUD event for all hours of the day, not just the ones the characters will be awake for.

What you'll be doing in Sleep Process is using a loop. I've found that having it wait 1 frame and then adding 10 to Time of Day is a good speed for this to be happening. Then inside this loop you'll have a conditional branch which checks to see if Time of Day is equal to or greater than 1440, since that's how many minutes there are in a day. If Time of Day hasn't gotten that high yet then the program will reach the end of the loop and send it back to the top, where it will wait 1 frame and then add 10 to Time of Day.

Inside the conditional branch you only need one thing: break loop. THIS IS IMPORTANT. If you don't break the loop then it'll just keep running and will lock up your game.

After this is done running you're good to reset Time of Day to 0. Again, this bit doesn't do anything of consequence, but it does look neat.

Hmmmm.... I think that covers follow up for what I've posted so far. I'll start on hunting/gathering/etc once I finish coding it into my game.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Mega TownieSuper TownieGreat TownieTownie
Joined: 15 Jan 2010

:Drool: :Drool:
also, I can't get paint.net without downloading a service pack... And I do NOT want to wait 3 hours for that. No let me continue drooling
:Drool: :Drool:

Emanzi's picture
Offline
Super TownieGreat TownieTownie
Joined: 9 Jun 2009

plug and play scripts are addictive...

Notice:
Need a face-set or character sketch/concept P.M me. I draw mostly manga style though and it might take roughly a week

Offline
Great TownieTownie
Joined: 28 Oct 2009

The Gathering Post
Overview of Equipment Items
First off, an explanation of the system I'm using in Slumber. Minus the first chapter of the game the party's going to be in a wagon traveling the land for profit. While they're traveling they will have access to the equipment items. These include the gathering basket, taxidermy kit, and crafting kits. All work on the same basic principle of something happening every X minutes, though what happens at that point is very different for each piece of equipment.

One character can only do one thing at a time (if you want to be realistic). So if Mariana is assigned to gathering then she won't be able to work on her embroidery. It's up to the player to decide if they'll sink each character into one thing (there is a level up system for skill with each), have it rotate, or not use them at all.

I'm starting with the gathering basket. While the party travels whoever is assigned to the basket will pick up various things. In the case of Slumber the bulk of it will be useful plants, though they can also find stones, broken swords and such in dungeons, and on rare occasions a functioning piece of equipment. The most complex version of this will allow you to customize what they can find in different areas.

Setting Up the System
For any version you'll need three things: the item, a common event for setting it up, and a common event for carrying out the process. The first event will be called by the item and will have the 'who should do this' and so on questions. If the player chooses to have someone doing it then it will turn on a switch which will turn on the second parallel process event. In the case of gathering you'll also need the items which will be gathered. I have a screenshot of my list below.

None of these items will be usable by the party. When they get into town then they can sell them. In the case of my game they can either go to the Guild office and unload all of them at once, do it individually by class (all the herbs, all the stones), or they can also track down other places which will buy different classes of gatherables. For example, selling all the medicinal herbs to a hospital or all the magician's plants and stones to a mage. The explanation for that process will be later.

You'll also notice that for all the herbs and stones there's a regular and rare item for each. The only difference is that the rare one costs more and comes up less often. If you use the skill version then you can make it where the more skilled the character is the more often they find rare things. However if you don't want to have regular and rare just don't have the rare items.

Setting up the Command Event
This is the common event which will be called when you select the 'Gathering Basket' item from inventory. This is just a menu to set the options for it.

First step is to show who's already using the basket. I've found that the easiest way to do this is through images. Since I'm using picture slots 1-4 for my HUD I'm going to start with #5 for this, and since I have six possible characters for this (two are non-combative) I'll be using pictures 5-10 for the 'currently using' bit on ALL the equipment processes. However, if you only want one character using an item at a time then you'll only need one picture slot for this. I'll show how to kick the other characters off the item later.

First though, the 'everyone can gather at once if you want' version. In this case you'll need a switch for each character. You'll then have conditional branches checking each switch. If the switch is on then it'll display the picture for that character. I'm making images based off their battlers (or in Mariana's case a more timid battler) but the defaults should work fine. Since I want to finish this tutorial but I only have Mariana and Luther done I'm repeating their sprites. In the finished product there won't be three Marianas and three Luthers.

And this is what it looks like if all switches are set to true:

Make sure you erase ALL your pictures after doing this bit.

After that's taken down all you need are these three options, plus the cancel. The choice branch is inside of a loop with the break function inside the cancel option. This way you can change multiple assignments without having to go through the menu each time.

Start and stop are identical except that in start it turns the gathering switches on and in stop it turns them off. All of the choice branches are set to 'branch' for cancel.

PLEASE NOTE: In the case of my game, the party starts out with just Mariana, then at the start of Chapter 2 Kera and Luther join, then one or two chapters later Nathan shows up, and Charity and Chang are optional (several chapters in). Because of this I'm going to have different versions of this, first for just Mariana, then for the three of them, and so on. Since I'm doing things in chapters this is an easy fix; I just have to update the code for each chapter where a new party member joins. However if you're not doing chapters and you don't start out with the full party then you'd have to set up conditional branches for each configuration and I'd just as soon not do this if that is the case. Even I am considering taking Charity and Chang out of the picture due to their optional status making it so I'd have to have ONE conditional branch in the later versions.

Yeaaaaaaaaaaaah. Charity and Chang can show up as NPCs but I'm cutting them. Also I'm too lazy to go back and change previous images so disregard that there are 6 people up there.

The third option, 'Who's gathering?' just needs a copy-paste of the first bit with the pictures. If you don't want it to show up automatically then just have it in the options and not before them. And that's all there is for this or any equipment item setup event. The only difference is which switches are being thrown. The real differences in the processes come in the second, parallel, events for each item.

Please note that this code is for a system in which each character can use multiple pieces of equipment at once. I have it like this because I'm not sure how many variables I'll need for each piece of equipment so I haven't programmed that bit in yet. All you need to do is, in the 'start' choice branches, turn off any switches you have for other equipment items. So if I'm telling Mariana to gather I'll tell it to turn off the switches to her Embroidery Basket, Taxidermy Kit, and so on. The 'stop' portion will be the same as it is above.

The Basic Parallel Event
In this version there's no accumulated skill and no difference in the gatherables from setting to setting.

The switch for the gather event will be one which tells you if you're on the world map or not (to avoid gathering in towns). This switch will be set in the transfer events between maps. When you enter town you turn it off, when you leave you turn it on.

This event will work sort of like a random battle generator. There will be a certain range for the length of time it takes in between each item being gathered. It's up to you to decide what the range will be. For this example I'm using my lvl 0 base figures for the complicated version: a minimum of 30 seconds and a maximum of 90 seconds. So using these figures, and assuming the party spends an insomnia day of 24 game hours/24 real minutes on the world map, that means they'll have at least 16 items and no more than 48 items gathered.

The way this works is that the process will generate this number between 30 and 90, or whatever your settings are. With each second or 20 frames it'll subtract 1 from the variable (green box). Then, when the conditional branch turns up that the variable is equal to 0, the gatherable item will be added to your inventory (blue box). At the end of this it'll generate a new time for the variable.

As for the item code, it's a simple conditional tree in this version. A random number is generated (I reuse the Mariana variable since it's going to be reset at the bottom anyway) and then the branches find the item that goes with that number. You can have as few or as many possibilities as you want.

An easy way to do different probabilities is to have the random number be in the range of 1-100. This translates directly into percents. So if you want a 75% chance of herbs and a 25% of money then it would look like this.

To split it up into more than 2 you just keep adding. So if it's 50%, 25%, and 25% the first branch would check for less than 50 and the second for less than 75.

Area-Specific Gatherables Add-On
This makes it so you can only get certain classes in certain places. So if you're in a field you'll be able to find plants but you won't find rocks. If you're in a dungeon you can find broken equipment and rocks. Etc etc. Just like the gathering switch you'll set these in the map transfer events.

There are two ways to do this: switch or variable. With the switch method each category will be either on or off. With variables you can have it where in a field you almost always find plants but rarely you find stones or broken equipment, and vice versa for a deep cave or such.

First, simply switches. All of the code for 'if time = 0' will be inside of a loop EXCEPT for the recalculating of the time for the next item to be gathered. First you'll need a random variable for however many categories you have (green box). Here I have four, I've just only coded the plants category.

Each category will have a conditional branch (no handling needed) to check the random number. In this case, if the number is 1 then it comes up plants. THEN we have another conditional branch which checks to see if the Plants switch is on (red box). If it's not then it'll skip all the item bits, skip over the other categories since Gather Mariana will still equal 1, come to the end of the loop, and start over by re-randomizing the category number.

If it does pick plants and the plants switch is on then the item giving works the same as illustrated above (blue box). EXCEPT that after all the branches for the specific items you'll need to add the break loop command (pink box). Otherwise it'll keep looping in plants forever.

Rinse and repeat for as many categories as you like.

The next level of this is to have the transfer map events set variables for the categories instead of switches. I'm using a 10 point system. If the category gets 10 then that means it's a rampantly common thing to gather, 1 would be a very rare thing to gather, and if it's 0 then it'll never be gathered in that area.

For this version we still have a loop with the random number picking each category (random 1-4 in this case). In fact the only thing that changes is the one branch and the fact that we add another random varaible.

First thing is to check and see if the G Plants variable is greater than 0. This does the same thing as checking if the switch is on (green box). Then what you'll do is have it pick a random number. In my case, since the range for G Plants is 0 - 10, the random number will be from 1 - 10 (pink box). Then it checks to see if the random number is less than or equal to the G Plants variable.

So why do we do this? First, take the example of G Plants = 10. This means that it's the most rampantly common type of thing. Now we have the random variable to check. Since the variable picks a number between 1 and 10, and the branch checks to see if the random check is less than or equal to G Plants, it'll always be true. No matter what number the random picks between 1 and 10 it's always going to be less than or equal to 10.

Now take the example of G Plants being 5. If the random check picks the number 1, 2, 3, 4, or 5, then it'll be less than or equal to G Plants. If it picks 6, 7, 8, 9, or 10 then it won't. That makes 5 numbers which make it true and 5 that make it false. Therefore with a rating of 5 there's a 50/50 chance that it'll be picked.

Finally, the example of G Plants being 1. Now the only number the random check can pick which is less than or equal to 1 will be 1 (since 0 has already been ruled out by if G Plants > 0). If it picks any of the other 9 numbers then it won't work. Thus, any category with a rating of 1 will be very rare to find.

Cliffnotes: I promise this works. Setting a category variable to a higher number makes it more likely it'll be what's found and setting it low makes it less likely. Setting it to 0 turns it off completely.

Everything in the +++++PLANT ITEM CODE is the same as previously. Make sure that break loop command is in there.

The last part is putting in a system where each character can level up their skill on each piece of equipment. For gathering it would mean a shorter min and max time and more chance of finding rare (and more valuble) gatherables. However I've been planning that part under the thought that I could set a varaible to a random number based off other varaibles. An hour ago I realized, to my great dismay, that this is not the case. So I'll have to rework that part, though I am pretty sure I can still make it work. It'll just take ten more lines to do it.

Anyway, I'll put that part in the next post.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
NobleUltra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 12 Jul 2004

Good heavens! The amount of work that must have gone into these is frightening. I think they serve a very real purpose, too: for those who don't want to learn a scripting language but still want all those cool things that the scripted games boast about. Not to mention it brings XP/VX closer to 2K/2K3, which are my first loves. I'm being slightly presumptuous here, but once we've revamped the website these would be superb additions, with your permission, of course. To keep this tidy and accessible (and also because Karl advised me to Sticking Out Tongue but his demands are totally justified) I've stickied it.

Emanzi's picture
Offline
Super TownieGreat TownieTownie
Joined: 9 Jun 2009

That would be good, one wont have to hunt down this thread in the future.
Keep them coming Yami, I could use some no script systems since I think VX and plug and play scripts may rot my game-thinker.

Notice:
Need a face-set or character sketch/concept P.M me. I draw mostly manga style though and it might take roughly a week

Offline
Great TownieTownie
Joined: 28 Oct 2009

Wow. I had no idea these things would be so popular. Awkwardly blushing over here >_> I'd be happy to have these hosted, though I probably need to re-do some things in the earlier posts, say things I forgot to say, maybe do things in a different order. Let me know when it's getting closer to the time and I'll do that.

This post is not new; I'm just moving the Frankensprite tutorial into the thread.

Frankensprite Post

There's only so much you can do with the default sprites and creating your own from scratch is not always the easiest thing. Luckily there is an easy solution for adding some more variety to your cast of characters: chopping them up and sewing them back together. I'll be using XP sprites since that's what I use, but this'll work for the default sprites from any version. The program I'll be using is Paint.NET. You could get away with regular old Paint but it'll be more frustrating and recoloring will take far longer.

First we have to decide which sprites to sew together. I'm going to be working on my main character, Mariana. She'll spend most of the game in her traveling clothes seen below, but before she gets the job that starts her on her journey she wears a dress. Incidentally her main sprite is a recolor of one of the hunters, so you can see that even without cutting the sprites up you can still change the look. I'll cover how to do this kind of recolor at the end of the tutorial.

Default Sprite:

Mariana:

I decided to use the body of the maid sprite for her pre-travel dress:

The first step is to get all the body parts spread out on the table. Start with one sprite, any of them, and just open it into Paint.NET

Then go to the folder where the sprites are and click and drag the other sprite into the window. This menu will pop up:

Add into layers is what you want. Then you'll have each set of sprites on its own layer. You can make the layers invisible by clicking the little check next to their names in the layers menu. It helps to only be looking at one at a time in the first steps.

The next step is to strip away the extraneous limbs and organs. In this case I started with taking off most of the maid's skull. Whenever the color of what you're trying to take away is different from other parts of the sprite--here, the fact that nothing but the maid's hair is green--then use the magic wand tool.

BE SURE that tolerance is set to 0%. If left on the default of 50% then it would probably select her blue dress as well.

In order to do this quickly hold down the Shift and Ctrl keys as you click on the different areas of color. Shift will select all pixels of that color in the layer and Ctrl will keep adding to the selection instead of deselecting the last color and only selecting the new one.

And voila! She's been scalped.

The next step is to remove the frilly hat since Mariana has her mullet headband as a hair accessory. In this case using the Shift+Ctrl+click method won't work very well since that would also delete her apron, which I do want to keep. So I will use the box selector tool to capture all the hats. You can also hit Ctrl with this tool to make multiple boxes.

The maid then gets to keep her face since it's going to be completely covered. On to decapitating my main character!

The first step is to get rid of the majority of Mariana's body. I do this with the box selector and delete everything up to her chin. Now I only have to delete her shoulders. In order to make this go faster, I selected what was shown below...

And then cut and pasted it into a new layer. This way I could magic wand Shift+Ctrl+click all of the blue bits of shirt without getting rid of her headband.

When all that was left was her head, I merged the severed chin layer back down into the head layer.

Dr. Frank'n'Furter would be proud.

Now it is time to sew the two parts together. When the dress layer is made visible again we can see that there's not much of a problem with the edges matching up with the exception of the up facing set.

It's time to bring in a third donor! Look for a sprite of the same height as the one you're working on, one who's not wearing anything bulky. I ended up using the female prisoner. Place this layer below the others to serve as a guide.

Our next stars are the pencil and eyedropper combo. When the eyedropper tool is selected, choose the option of 'switch to pencil tool'; it'll make things go faster.

Then, on the DRESS layer since that's where the shoulders are missing, select the appropriate darker colors and fill in the outline and where the shadows at the armpits would be. Don't bother filling in the highlights at this time, just the shadow.

After you've done that for all the necessary sprites, delete the guide layer and fill in the rest of the missing parts. Getting the shading right is mostly a process of laying down a few pixels, zooming out, and seeing if it looks right. Note that you only have to do two sprites: one standing still and one walking. The standing still one you can copy right over and the walking you can copy, paste into a new layer, flip the layer horizontally, and then lay it over the mirrored sprite.

Now to the issue of recoloring your creation. Most of this will be done in Hue / Saturation, as shown.

However in the case of this dress I'm going to have to do a little extra. Because of where the colors of the highlights are set it looks really wonky if I just change the hue, see:

SO we're going to be doing this the by-the-color way. This is also the way to give a part which is black, white, or gray color, for example, changing gray armor to bright red. Sliding the hue and saturation around isn't going to do much since they're neutral colors.

Anyway, the dress. Let's make it green. I play around in the color menu until I get a green I like for the main color of the dress (between highlight and shadow).

In order to color all pixels of a particular color another color you just have to hold down Shift when clicking on any section. Makes this VERY easy.

Next we need to get the shadows and the highlights. I'm starting with shadows. Please note that in order to get the colors to work together correctly you're not just going to mess with the value. In order to make accurate shadows, you need to LOWER value by 6 to 10 clicks and RAISE saturation by 2 to 4. For highlights, you need to RAISE value and LOWER saturation.

And there you go, the dress has been dyed a much more harmonious green.

This will also make a good launch pad for messing with the hue and saturation to make it other colors.

Thank you for joining me for my mad scientist tutorial!

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Mega TownieSuper TownieGreat TownieTownie
Joined: 15 Jan 2010

YAY YAMI!!! Laugh
What's coming up next on the menu!?!

Offline
Great TownieTownie
Joined: 28 Oct 2009

Next is the hunting/battle bit. The basic function is, when working with the food and being able to hunt meat, that the party can choose not to look for edible animals on the world map. So if you're leveled enough that fighting a rabbit won't do anything of merit for experience, you're stocked up on jerky and dried chicken, and you don't need to hunt a bunch of skins for sale to de-broke your party, THEN you don't have to deal with all the random battles with said rabbits. However it'll have it where you can still have the things you don't go looking for attack you on occasion, for example, wolves or highway bandits. The way it's set up the enemies that attack anyway don't show up any more often if you're hunting or you're not. So say for example in a given length of time you fight 9 edible animals and 1 bandit. With hunting turned off you'll still only fight 1 bandit in that given time.

This will also allow for a greater range of control over your troops without having to make fifty maps for the same area. For example in the case of bandits you could have a check on the party's funds. If they don't have enough to make it worth stealing then the bandits won't bother, and since you tend to be broke a lot in the beginning of a game that'll keep the harder common enemies away until the party has a chance at not dying. The same can be done with the party's average level or with a certain plot point being reached. So if the party angers some organization then members can show up in random battles after the plot event but not before, all on the same map. Also being able to have different sets of troops in different parts of the same map. This DEFINITELY falls into the category of 'not really hard but oh god the conditional branch trees are endless'. Well, depending on how many troops you have.

This also allows for a 'back to the Pokecenter' system for all random battles. Meaning that if everyone is KOed the party will be transported to the hospital in the last town they visited having been rescued and brought there by someone. Guards on patrol or something. And if they're knocked out by bandits then all their money will probably be gone. Or maybe if it's wolves all the meat has been eaten. Whatever you like.

After that is the preserving/skinning nonsense. It works like gathering in that you assign someone to the equipment item (or multiple someones) and in a certain amount of time a piece of fresh meat will turn into jerky. Also turning a deer corpse into meat and hide since the developers for XP only gave you one slot for an item if you win.

Then will be the cooking set, which is pretty simple. Again for the perishable food system, it cooks raw meat into any of the options in the category. So in my case Fresh Red Meat can be cooked into a meat pie, meat skewer, or meat roast. The only difference in the three (aside from being someone's favorite food) is that the roast is the super nice version and it takes twice as much meat as the others, but it'll give a mood boost and also keeps the party fuller for longer.

Those are the end of the hunger related things (which therefore have to be done in order). After I'm done with those I guess I'll see which of the other processes I'd rather start on first. There's books which help you raise specific stats (but the higher the stat is the longer it takes to get another point) and also training halls which do the same sort of thing. Also a much simplified crafting system which requires no ingredient or finished product items. Then there's the way to do shop processing without doing shop processing, mostly so you can choose one command to unload all of your collected hides and gathered herbs and such instead of hitting SELL fifty times. Oh, and how to do achievements. I'm sure there's something else on the list that I am forgetting at the moment, but that should be the bulk of what I've thought of so far.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Mega TownieSuper TownieGreat TownieTownie
Joined: 15 Jan 2010

:Drool:
...
:Drool:
...
If you want to add more to the list (lol, because i'm sure you'd love to) what 'bout clothes and weapons getting worn out?I love all your tutorials YamiTami, your turning into the eventing master!

Offline
Great TownieTownie
Joined: 28 Oct 2009

Well, I've never played a game with weapon degradation where it actually added to anything. Either it's like Dark Cloud 2 where the repair powder is ridiculously easy to get so they might as well have skipped it, or it's really irritating because every sword breaks in three hits and then stays broken. HOWEVER I do want to put an alternative to that in a later game. In that there will be a certain threshold for the weapon to break, but anything under that won't do anything. So hitting a wolf with a sword isn't going to hurt the sword at all, but hitting a stone golem with the sword could break it and it won't do much damage either. That way you have the reality of not being able to kill rocks with blades without the irritation of rabbits damaging your weaponry.

I'd also like to figure out a system where you need a specific type of spelled weapon to kill things like jelly monsters. In my view of how the magic would work it doesn't matter how much you slice at a jelly thing with a physical weapon, it'll do not damage since the jelly thing is being held together by magic. Magic attacks might do some damage but the problem is not the jelly itself but the magic being sent to it from whoever created it. So you either have to completely obliterate all the molecules or you can sever the connection to the source, the latter working much better. I'm thinking I'd have these magic-cutting swords and such be made out of copper, since it's a very conductive metal for heat and electricity so why not magic as well? It'll also mean that they won't be much use against other monsters since copper is so soft.

I haven't been outlining these two yet since I'm focusing on what I've mentioned above for now, but I'm not entirely sure if this can be done without scripts. I'll know for sure later on.

Oh, there is something I forgot: a system for lawful/unlawful and good/bad. In my Brother game I'll have it set up so that the party can choose between following the law when taking down the conspiracy or breaking the rules since defeating the enemy is much more important. If the party stays lawful then they can wander around the main parts of cities all right and so on. If they're unlawful then they'll be forced to wander through the slums, or get disguises, or else face the possibility of getting arrested. Plus the people in the slums aren't near as likely to talk to you if you're not one of them, so if they have info you need it might take longer, but if you're on the wanted list then you can't have a friendly chat with the upright scholar in the library. So it'll even out.

Defying the Grand List of Role Playing Game Cliches since 2009.

Emanzi's picture
Offline
Super TownieGreat TownieTownie
Joined: 9 Jun 2009

Good idea, I needed a good/bad no scripts system. I already know how one works but you may have a better idea also I wanted to add a fame hierarchy like in a game called Red Dead Redemption where you don't have to be very evil or good to be famous and you can stay in between.

Notice:
Need a face-set or character sketch/concept P.M me. I draw mostly manga style though and it might take roughly a week

Offline
Great TownieTownie
Joined: 28 Oct 2009

Actually one facet you can have of fame is your kill count, so I can start on that sort of system in the hunting post. I still have some things to iron out in that (plus cleaning the house) but I think I should have it up within a week. Since the developers were geniuses and made it so you can't trigger something at at enemy's death OR at the end of a battle you have to use the manual random battle system to do anything like that.

HMMMM.... come to think of it I could probably use a reputation system in Slumber (the full system is in a later, even more involved game). Something to gauge how good of an employee Mariana is to the Guild she's a part of, and the better she does the more connections she has and the faster she can get her problem fixed. I'll go ahead and work on that, and the reputation tutorial, after hunting. Actually could probably have it as part of the hunting post since the system isn't all that difficult. It just requires checks for what your levels are everywhere.

Is there anything else anyone would like to request being sooner than later off that list?

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Great TownieTownie
Joined: 28 Oct 2009

Sorry this took so long. I had it finished several days ago but I didn't have internet access while on vacation.

Hunting Options Post

What Is This For?
Now, the core of this is the same as what the program will do automatically for random battles. It'll take an average number of steps and trigger a battle when those steps have been reached. However you have a LOT more control over what happens with the battles this way.

For starters, there's triggering something to happen when the battle ends. There is no way to do this in the events in the troop pages in the database. This is very frustrating. However it's easy enough with this manual system; it just takes a lot of conditional branches. Things you can trigger include getting more than 1 drop item from each enemy, earning some sort of reputation for each kill, doing WoWesque missions where you have to kill X of a certain animal, and so on. There's also setting up a failsafe for if all the party members die in battle, like how in Pokemon you get sent to the last Pokecenter if all your pokemon are KO.

Another very nice feature is being able to change the battle set. The other way to do it requires setting up various identical looking maps with different battle sets. This way requires, again, LOTS of conditional branches, but you only have one map and you don't have to mess with the transfer events. Changes to the set include being able to adjust the encounter rate beyond the range of ON or OFF and having different enemies in different areas of the same map. There's also being able to trigger a certain set of troops based on the party's level, some other stat like how much gold they have, or a plot point.

Setting Up the System
Like gathering you'll need an item for access, a command common event which is called by that item, and then a parallel event which will do the grunt work. Difference is that in this case the parallel event will NOT be a common event, but rather a local event. Each section of your world map, dungeon, or other place-with-random-battles will need one if you're going with this system.

By the way I am going to be making icons for all these specialize items, and once I finish them I'll upload them here. The Tracking Guide will be a book with a paw print on the cover.

You'll also need to decide on your troops for each area and the rare/common distribution. This might not help you if you're not a visual learner, but this is how I figure mine out: graph paper and a lot of scribbles.

My handwriting is horrible, I know, but what I've done is gone through and counted up by 25s to 1000. 1-1000 will be the range for the random variable which will pick the troop the party will have to fight. This is working on the same principle of setting the 'pick the gatherable' random variable to 100 even though you shouldn't have anywhere near that many options. It just makes it easier to think about.

Anyway, I went down the column and blocked it off visually. So instead of going 'rabbits should be X percent' I started drawing the bracket and stopped when it looked about right. I'll be making some further adjustments, and doing a couple of versions so that there's an area with more turkeys and one with more deer and so on. Then I looked at what numbers I ended up with.

ALSO NOTE that I am once again making things harder for myself. If anyone's played FF8 you'll have noticed that there's, what, a maximum of 4 types of monsters in an area and maybe 7 different troops? The same for a lot of big-name games. So it's not like you're somehow cheaping out if you don't have eleventy billion troops as I do here. You're just more sane. And will have to make far fewer enemy battlers from scratch.

The Basic Version
This is the bare bones of it, identical to the built in system except you have the option of the battles being triggered by either the party's steps or by passing time. If this was all you were doing then you'd be just as well with the built in system, but since everything else is an add-on to this I figured I should start with the no-frills-at-all version.

This is the parallel process in the world map section, by the way. Obviously if you're doing this you'll be using the command event and the item as well, but those bits will come later.

The first example is how it'll work if the battles are triggered by lengths of time. In this case it works just like gatherables. Wait 20 frames or 1 second. If Battle Timer is greater than 0 then you subtract 1, if it is 0 then toss a battle at the party. After the battle's done, reset the Battle Timer.

PLEASE NOTE: you'll probably want to toss the Battle Timer = random (20...40) into a startup cutscene or such. Otherwise the variable will equal 0 when you first set foot on the world map and your party will instantly get a battle. Setting it to a number before this happens will make it seem less ambushy. You won't have to worry about it after the first one, though, since the Battle Timer number will carry between each world map section. So if you have 10 left when you go to a different part of the world map then it'll keep that 10 instead of resetting it or anything. Also, when you go into town, it's not going to mess with Battle Timer. So if you had 10 when you went into town you'd still have 10 when you return to the world map.

Also, the numbers I'm randomizing the variable to. In this case I used 20 - 40, which means 20-40 seconds. With it set up like this the party will have at least 20 seconds between battles and no more than 40 seconds, which makes an average of 30 seconds between battles. If for example you used 10 - 40 then the average would be 25 seconds between battles. In order to know what you want to use you'll just have to pick a couple numbers and then wander around the map for a little while to see if that feels right. If it seems like there's too long between battles then lower the numbers, if it seems like they're coming too fast then raise the numbers.

The second way to time things is by steps, which is how the default system does it. It requires a couple more lines of code but not too many more. You'll need another variable which I'm calling Check Steps.

Just like the timed version you'll start with Wait 20. Then you'll set Check Steps to the party's steps. This option is in 'other' as is shown below.

Now, in this case you don't have to count down the timer (the Battle Timer -= 1 bit) since the game is doing that for you. Every time you take a step the built in Steps variable goes up by one. Because of this we're switching things around a bit. Instead of checking if Battle Timer > 0, we're going to check if Battle Timer is <= Check Timer. If Battler Timer is still greater than the current steps then it doesn't have to do anything, so we don't need an 'else'.

After the battle has been sent the party's way, you'll need to reset Battle Timer. What you'll do here is a little different. First you will set Battle Timer to a random variable fo how many steps you want between battles. Again, you'll just have to play with it to decide what numbers to put here. After you randomize, you'll then need to ADD the current party steps.

So what does all this do?

For example, say that when the party gets hit with a battle their step count is 100. The event will randomly pick a number between 20 and 50, and it picks 30. This means that 30 steps from that point another battle will happen. So, since the current steps are 100, the next battle will happen at 130 steps.

Now the event will go back to the top, since Battle Timer (130) isn't less than or equal to the steps (100). So the party takes a couple steps in the course of the second the event waits. The next time it rolls around it'll be checking if Battle Timer (130) is less than or equal to Check Steps (103). Still not true, so it keeps going.

Finally it comes around and Check Steps is 134. Now Battle Timer (130) IS less than Check Steps, and the battle happens.

MATH EVERYWHERE.

Now, either way you do this, steps or seconds, the troop picking section is the same. You'll reuse Battle Timer as the troop picking variable. In my case I'm going to randomize it to a number between 1 and 1000. According to what I have blocked out in graph paper anything less than 150 will result in fighting 1 rabbit, so I have a conditional branch which checks if Battle Timer is less than 150. If yes, we get a rabbit, if no, it goes down the tree.

Note than in this case I have 'can escape' checked off, as found below.

This will make the battles behave like the default random ones, where the party can escape from the enemy. If you don't have this checked then they won't be able to run away, just like in a boss fight.

That's it for making this work just like the default system. Now let's start mixing things up.

Turning Off and Turning Up
With the default system you can turn the encounters off, and that's all. Doing that in this system is easy enough.

So if you want to turn off all the battles on a map which usually has battles, just have an event turn the Battles switch off. You won't have to do this when you go into town, however, since there aren't any of the local battle process events there (unless of course you want battles to be in town). However if you're having a cutscene it would be safe to turn battles off for the duration, just like how you would turn off Count Time.

However, with this system you can be more specific. First off, you can have it where there are half as many encounters or twice as many encounters. For example with the Slumber hunting system, this translates to half encounters being when they only go after the rabbits they happen to see, regular is when they do look for the rabbits but not too hard, and twice the encounters is when they're putting heavy efforts into finding those bunnies.

So here is how you set up a system with regular, half, and twice the encounters. If you want to turn them off completely then you'll still use the Battles Are Go switch.

In this example I'm back to the time system (instead of steps) and my regular rate of encounters is going to be between 20 and 40 seconds. This means that half the encounters will be 40 to 80 seconds and twice will be 10 to 20 seconds. If you have a different baseline then you just have to divide each end of the range by 2 for the twice factor and multiply by 2 for the half. Or you could do it in thirds and multiply and divide by 3. Whatever you like.

Now you're going to need an indicator for what setting you're running. This will be a variable. Since I have regular, half, and twice, it'll be set up like this for me:
1 - half
2 - regular
3 - twice

Then you'll just have a short conditional tree to check what the rating is. This will go where the Battle Timer is reset.

And that's all there is to that bit.

But wait, how is this variable set? This is where your equipment item comes in, in my case, the Tracking Guide. All you need is the choice code with the options, in this case, the choice of half, regular, twice, and no encounters.

PLEASE NOTE that in the picture above the choice for no encounters is NOT turning off the battle switch, but rather setting the Battle Rate variable to 0. What does this mean? Well, if you do want to give your player the ability to turn off battles completely then just put the switch change in there, AND turn the switch on in each of the other three options. However, if you'd like to do something a little different...

'Off' is a Matter of Opinion
In this bit you can make it so no encounters doesn't entirely mean no encounters. This mostly makes sense in the kind of context I have running, where I'll be turning off the animals a party would deliberately hunt. In the case of the ratios I have drafted I'll be leaving the rare occurrence of wolves, a mountain lion, or a highway bandit. So basically while you can ignore the animals you're hunting, you can't ignore the ones hunting you.

Know that this isn't going to give you the same number of battles as you would get when you're hunting. If you would fight 9 game animals and 1 thing that hunts you in a given length of time then you would only fight 1 thing that hunts you in that same length of time with hunting turned off.

This is a very simple thing. Divide out what you want to be turned off and what you want to stay. Then put what you want turned off in a simple conditional branch which checks if the Battle Rate is greater than 0 (green box). Then, OUTSIDE OF THAT CHECK, put the things that hunt you (red box).

So for example say that hunting is turned off. It goes through the randomizer and picks a number which lands in rabbit territory. The program will run down the code, won't see the rabbit bit since Battle Rate = 0, and will go right to the end where it recalculates the Battle Timer. This way it'll skip the times it would have picked a huntable but will still do something when it lands on a thing that hunts you. The more hostile the enemy set in an area the less good turning hunting off will do you.

Killcount and Other End of Battle Functions
Here is how to do different things when the party wins a fight, mainly getting more than one thing from each enemy and having some sort of reputation.

All you have to do to add items is to add items. Here I've chosen a random pair of things to find on a rabbit corpse (green box). If you'd like a kill count variable then you'll just increase it by 1 (blue box).

Now, don't think you have to stop at something as simple as a kill count. You could have a karma or a bad/good system which sees killing as a negative thing. In that case you would subtract from the karma or bad/good variable. Or there could be some protected species, like a sacred animal in a certain country or area, and killing enough of those will earn you serious fines or not being allowed back inside the temple or something.

If you have the 'can escape' box checked then you can also trigger something when the party runs away.

Besides just keeping count of how many retreats have been made, you could subtract from their tough reputation every time they run away. Or, if you're using the mood system, you could subtract from the party's mood. Defeating a tough enemy could raise their mood. The possibilities are endless.

Aside from just giving things to people, you can set up a rarity system just like with the troop set. Just use Battle Timer for another random number and go to our old friend the conditional tree. It can be as simple as this or as complex as anything.

The Pokecenter System
In this case you'll have a failsafe for when the party is all in KO. Usually this would trigger a game over, however if you have 'continue if loser' checked on the event battle process then you can use a Pokecenter system. In Pokemon when all six of the player's pokemon are knocked out they will be automatically transported to the last Pokecenter they visited. You can do a similar thing with human characters by sending them to a hospital.

First of all, how to set the location for the all KO condition. This can vary depending on what system you use. One is the straight up Pokemon system when a new KO spot is set ONLY when you enter the Pokecenter or hospital. So, if you stop at the center in Town A, go through Town B without stopping at theirs, and then get knocked out on the way to Town C then you'll get sent back to Town A.

The second way is to have it where simply entering a town will set that town's hospital as the KO spot. Instead of having an automatic process in the hospital you'll have it at the entrance(s) to the town.

The third is to set it up by world map region. So going onto that particular region will set it to, say, the largest city in that particular world map chunk. This also allows you to make it so they WON'T go back to a hospital if they hit all-KO out in the outlying regions.

With any of these three options the code is the same; the only difference is where you put it. For the first 'must visit the hospital' option the local event will go in the hospital entrance. For the second 'must visit the town' option the event will go in the entrance to town. And then for the third 'just get near the thing' option the event will go in the world map.

So you'll need the local event, a switch, and three variables for this. The local event will be set to auto-run if the switch is on (red box). This 'New to Section' switch will be TURNED ON in the transfer event which puts the player on the new map. Once the event has run the switch is TURNED OFF. This way the event will run every time you enter a new map.

When the event runs it'll set the three variables. One is the Map ID. This option is in the 'other section of variable setting options. The next two are going to be the Map X and Map Y where you want the player to go on the map. For example I'm going to set mine to the location of a cot in the hospital ward (green box). The last thing to do is to turn off the event (blue box).

I just realized that I never mentioned how to set the location for sleeping in the Pikmin day system >_>. Anyway it's exactly like this, except the probable trigger for setting a new sleep point will be checking into a hotel or such.

Note that if you're using the 'no rescue if you're in the boonies' theory that you'll need to have another switch which will be flipped when you enter a section of world map where no rescue will come.

The next step is how to trigger this process to happen. Back in the battle process you'll simply call a common event in the lose option of all the battles.

NOW the third part, the common event. Very simple. All you have to do is fade out, transfer the player to the saved point, and then fade back in. This will also be where you add any mood penalties, having been robbed by your rescuers, the WoW style loss of experience, curing health and status including KO, and so on. If you're using Pikmin Days I'd also trigger the sleep process.

You Don't Have the Prerequisite for that Class
We've separated the enemies into two sets. Now for some finer divisions. I'm talking about requiring a certain amount of money, level, plot point, or so on to have a particular troop or troops show up.

You can do this one of two ways. Either have it where it'll skip over the troops as it does with rabbits when you have hunting turned off, or have two different sets for not triggered and for triggered. The first is good if you only have one or two troops falling under the requirement, the second is the way to go if you have a lot of troops adding in (and also if you have a lot being taken out).

First example: bandits will only attack you if you have enough money worth stealing.

The nice thing about this is you could stick this branch outside of the others, OR you could put it down in the bandit area in the regular branch. That way if you roll that range of numbers you'll always get a bandit troop, but your gold will determine how many.

The next option is the party's average level. To do this you start by setting the varaible to the first member's level. Then you add each person's level and divide by the number of members, in this case, 4.

And plot point. This just takes a conditional branch to check if the switch is on or the variable is a certain level. Which you do just depends on how you mark plot progression in your game.

If you have a number of changes between one set of troops and the next, just put the whole thing in seperate checks and then it'll randomly pick the troop inside of that.

Troops and Terrain Tags
This is how to have different troops in different sections of the same map. The usual mainstream example of this is how it worked in FF8.

We'll be using terrain tags in this one. Terrain tags are one of the options in the tileset tab of the database, like passability or priority. What will happen is the battle process will check what terrain tag the player is standing on when the battle timer hits 0, and then choose the appropriate set of troops for beach, plain, mountain, etc.

PLEASE NOTE: If you have two tiles with different terrain tag values layered over each other then it will not work. 0, the null value, is the only one which won't interfere with other tags. So for example if your grass is value 1 and you put trees of value 2 on top it's not going to read them as either.

Because of the layering issue, what I do is make 7 extra tiles which are copies of the grass/ground tile. Then I'll go around and put the appropriate ground tile under the trees, next to the mountains, and so on.

The only potential problem with this is that you'll easily forget if you already tagged the grass under the trees since every grass tile of that shade will look the same. However, this is easily fixed. Copy whatever map you're using after you've added in the extra tiles for each terrain tag. Then go into the copy and put the proper number on top of each tagged tile.

I'm using Inquisitor's World Map tileset here, but this will work for any of the tilesets, even indoors. However since they don't have spaces like Inq's World Map you'll just have to make it a taller image. Each tile is 32x32, so for example if you wanted to increase the length by two tiles you'll add 64 pixels to the end of the image.

Next, upload the numbered tileset to the materialbase. Keep the basic name the same, so you know what goes where, but put some note that this is the numbered version for easier roads later on.

So now you have the tiles set to the correct terrain tag and the number for each in plain sight. You load this into the same tileset as the numberless because then all the passage and priority and other things stay the same.

Now build your map, or edit and existing one, by tagging the ground under everything which needs to be a different troop set. Here I have three zones: the plain grass is tagged 0, the trees are tagged 1, and the tall grass is tagged 2. Once you have everything settled properly, just go back and set the tileset graphic to the non-numbered version. You can always change it back if you want to check something.

Also: you can also have different zones without there being trees or such. So you could have something optional which they can only fight if they're standing on one tile which looks like all the others. That senario works best with the timer option versus steps, since with timer the player can stay on the tile once they've found it and get into the battle all right; with steps they can easily miss it.

With the map set up all that's left to do is set up battle processing. Once the battle timer has counted down to zero you'll set a variable to the player's terrain tag, the option showed below.

Then you'll just have a conditional tree checking the terrain tag and handing out troops.

Any of these methods can be combined, though you'll want to have another variable dedicated to checking things. For example, reusing Battle Timer for the 1-1000 troop picker and then having another to store the terrain tag. If you reused the Battle Timer variable for the tag then you'd have to calculate the 1-1000 in EVERY branch of the tree instead of once.

Defying the Grand List of Role Playing Game Cliches since 2009.

Offline
Mega TownieSuper TownieGreat TownieTownie
Joined: 15 Jan 2010

YOU'RE ALIVE!!! Laugh Laugh
Nice tutorial by the way, I like the "MATH EVERYWHERE!" :lol3:
I will definetly be implementing this system in my next game!

Offline
Great TownieTownie
Joined: 28 Oct 2009

It's probably going to be a couple months before I get another tutorial posted. I need to catch up on the coding of all these common events for Slumber AND I need to catch up on creative pursuits elsewhere. My fanfics have been horribly neglected, and I need to redo my website.

Also as a quick note, I forgot to mention two other features. One is a rent system for hotels and boarding house type places. With it the room can be rented via payments daily, weekly, monthly, or a staggered system (like every two weeks, or every Monday and Thursday). You don't have to choose just one system either; you can have a hotel with daily rates and a boarding house with monthly rates, all using the same common event. The way it works is when you wake up on a payment day a choice box pops up asking if you want to stay another day/week/whatever. If you choose yes the payment is taken from funds and you stay on. If you're using Pikmin Days and a sleep point to match then when you choose no the sleep point settings will be switched from the hotel to a default setting. To take the example from Slumber, at first the default setting will be to what amounts to a homeless shelter, and then when Mariana joins the Guild the default will be the wagon. The reason to rent a room is due to mood. Staying at a homeless shelter is depressing, after all. Plus as an added bonus I have a chance that she'll be robbed.

The second is a salary system. Think FF8 except with more bells and whistles. Again to take the example from Slumber, the party leader gets a lump sum based on how valuable (read: leveled) their team is and by how much revenue they're bringing to the Guild via animal skins and other spoils. The leader/player then chooses how much to pay each party member. There'll be a standard pay rate based on their stats and such. If you pay them less than standard then they take a mood hit, pay them more and they get a boost. Even if you're not using the health regen based mood system then you can still have a mutiny function where you get a game over if you irritate your party enough. Or you could just have the simple FF8 version where you get X money every week based on your kill count.

I've also figured out how to have a gathering system with levels. I'll do a full work up before the next full tutorial.

The next tutorial will probably be the rent function, since that's something I can set up in full even in the first chapter of Slumber (most things don't come into play until chapter 2).

Defying the Grand List of Role Playing Game Cliches since 2009.

meustrus's picture
Offline
RoyalÜber TownieUltra TownieMega TownieSuper TownieGreat TownieTownie
Joined: 18 Jan 2006

Opened the topic per author's request.

Offline
Great TownieTownie
Joined: 28 Oct 2009

I haven't forgotten about these. I took a bit of a break to work on my fanfics (this idea failed miserably btw), but for the past two months I've been back working on RPGM XP. Most of it was spent trying to make the schedule system shiny in that people would actually walk to wherever they go when they go to bed and such. It was determined that the code necessary to do this made the game WAY too slow. But at least you guys don't have to mess with it. The next tutorial will be on schedules.

This post is actually supplementary to a previous one. Back in the gathering post I said that I knew there was a way to have it skill based (in the case of gathering this translates to finding things at a faster rate) but at the time I couldn't figure out the way to do it. Now I finally found the solution and of ONWARDS!

Supplemental Post: Skill Based Timers

Basic System

This has to do with any of these events running on a timer, mostly the gatherables and the battle timers. In the case of gatherables you just have to go through and have the basic system; with battle you'll probably want to have an option system. But I'll get to that later.

The basic idea is that if you are more skilled in, for example, gathering, then you can gather more items in a given time period. The initial problem I had with making this work was the fact that you can't set the parameters for a random number as variables. Finally I figured out the embarrassingly obvious solution.

This is how it works. You have your baseline time range which will be what is used when a character is at level 0 (or level 1 if that's how you like it). In the case of Slumber I'm using 120 - 240 seconds. Given that I have a 16 minute day (or 960 seconds), this means that if Mariana is at level 0 and she spends the whole day in a gatherable area, she will gather a minimum of 4 items (960 / 240) and a maximum of 8 items (960 / 120). Which is not a whole lot in this case since I have the profit from gatherables at very low per item.

I'll talk about the actual process of leveling up in a minute, but for now we're just looking at how a higher level effects the time. In the case of Slumber I've decided that each level will knock 10 seconds off the time between items. This means that while level 0 takes 120 - 240, level 1 will take 110 - 230. There won't be much difference in the total items between levels 0 and 1, but consider that level 6 will have a range of 60 - 180, which means a minimum of 5 and a max of 16.

The way this is achieved is simply by subtracting level*10 from the random baseline.

The top line is Mariana's Gather Timer being set to a random number between 120 and 240. The second is where the Gather Bonus is being subtracted. The Gather Bonus would be the level*10 number, and it's set up during the sleep process. More on that later. First we'll finish the gather process code.

The only problem with this system is that eventually the Bonus is going to be greater than or equal to the baseline numbers. In this case, at level 12 the Bonus will be equal to 120, which means the range will be 0 - 120. After that the minimum gets negative, which is not helpful to life.

The way to fix this is through a simple boundary. In my case I've decided that it'll be at least 5 seconds between items, but it can be as low as 1. You just put a simple conditional branch after the timer picking code to check if the random Timer value is less than your boundary. If it's true, then set the timer to your boundary, in this case 5.

Now the question of how this skill is leveled up. In this case it'll happen every time the character finds something. In my case I have both common and rare items, and so a common item will give 1 point and a rare item 2 points.

If you're doing this for the battle timer, then you'll have this increase in experience in the spoils section of your control-freak variety of battle system (in other words, the one in my battle tutorial).

The only thing left is to set up the Bonus variable in the first place. As I said before, this is done in the sleep process. However before we do the code there's one more thing to decide: how many points between levels.

The Leveling Question

First of all, there's the question of whether you're going to have a straight line or a curve for your experience point levels. In straight line it will always be X amount of points to the next level. So if you choose 100 for X then you'll hit level 1 at 100, level 2 at 200, and so on. The thing about this is that when you're at level 2 you're going to gather more items in a day than you did with level 1, which means you'll gain XP faster. Thus with each level you're going to reach the 100 points for the next level faster than the last.

Let me stress that there's nothing wrong with this system. It isn't unreasonable for some skills to be picked up faster as you get more skilled in them. For example with gathering once you start learning how to look at the shapes of the leaves then you'll pick up the particular shapes faster (thus why I'll use a straight line for my gathering process). The straight line also takes less code.

The other option is a curve, where each level takes more points to reach than the last. So maybe to get to level 1 you need 25, then for level 2 you need 50 more, and then level 3 takes 100.

To do a curve you'll have some baseline X, we'll go back to the example of 100, and then with each level we'll add that X or 100 to how much was added to the last level. I know that was as clear as mud so here's an example.

The character starts at level 0 with 0 XP. At 100 XP they get to level 1. In order to get to level 2 they will need how much was added to the last level, which is 100, and then add X to that. This gives us 100 + 100 = 200 points to level 2. Then if you go to level 3 it'll be 200 + 100 = 300 points to level 3. The breakdown of the total XP would be 100 for level 1, 300 for level 2, and 600 for level 3.

Now then, how do we code these two options?

NOTE: Whichever system you choose the code for the process (in the example, gathering) stays the same. The only difference is how the level is calculated in the Sleep Process.

Straight Line XP System

The way the Bonus is calculated is similar to how the health regen factors are recalculated each night.

With straight line you have your amount of points between levels. After some wandering around I decided on 180 for Slumber. The reason for this is because with my base 120 - 240 seconds Mariana will gather an average of 6 items per day, I decided that I wanted it to take her about a month to get to level 1 so that's 30 days * 6 per day = 180. You could also just pick a random number, that works too.

So I have my X = 180 and I'll have the Skill Level variable where all the XP goes when something is gathered. I'll then set my Bonus variable to the SKill variable and divide by 180. So if Mariana has 187 points then 187 / 180 = 1 (plus change), so that'll give me her level. I then multiply that level by my baseline bonus which is in this case 10.

Curved XP System

This is the one where it takes X points to get to level 1, 2X to level 2, and so on. To make the numbers round we'll say it's 100 points to level 1, which means 200 to level 2 and so on.

This one takes a little more wandering around, since you'll take the total points and subtract your first level (in this example, 100) and then check if it's less than 0. If it's not then you'll subtract 2X, or 200, and again check if it's less than 0.

To illustrate what this does, say your character has 476 points. You then subtract 100, which gives you 376 remaining. Then you subtract 2X, or 200, and get 176. When you subtract 300 you'll end up with -124. When the code checks to see if that variable is less than 0 it'll find that is true on the third step. Because the third step goes below 0 that means that the character is still on the second level (if they were on level 3 exactly that would be 600 points, which would give you 0, and it wouldn't read as less than 0 until step 4).

MAAAAAAAAAAAAATH

So yeah the actual way to do this. You're going to need 3 variables to help you out: one to hold the number of points so you can subtract from it, one to hold which step you're on, and one to hold the number you're subtracting from the total points.

First off we reset our variables. You'll want to make the step counter your Bonus variable, since it's what keeps track of the level. Once you're done you'll just have to multiply it by your factor (I'm using 10 remember) and you're done. If you use another variable for this then you'll have to move the final level over to Bonus so save yourself the trouble and skip a step. Set your Bonus to 1.

The other two variables can be whatever. I'm going to use the Gather Timer to hold the number of points. This variable needs to be set to the Gather Skill.

And now it's time for a loop. Make sure you start your loop AFTER you reset the Bonus and your total points variables. The first step inside of the loop is to set your third varaible to your X between levels, in this example 100. I'm using my Rotten Food Check for this, but again, it doesn't matter what this variable is as long as it's not in use by something else (so don't use your Time of Day).

Now, multiply your X varaible by the current step number, which is stored in Bonus. For the first step this will multiply by 1, leaving your X variable at 100. The next time around Bonus is going to be 2, so you'll end up with an X varaible of 200. More on how the Bonus increases in a second.

Once you multiply your X by your Bonus, subtract your X from the total points.

To recap, the first time the code runs through this you'll have a Bonus of 1, an X variable (rotten food) of 100, and your total points (timer) will be 100 less.

The next step is to check if the total points is less than 100. If it is then you're done, if not then it has to go around the horn again. You do this with a conditional branch checking if the total points varaible is less than 0. If true, use the 'Break Loop' command. If not then add 1 to the Bonus.

Say for example your character only has 80 points, which means they're not quite to the second level (when level 1 is the lowest you can be). After your X of 100 is subtracted you'll have -20 and the loop will end, leaving you with a Bonus variable of 1, which is what level they're at. If you're working on a level 0 system then you'll have to subtract one from Bonus OUTSIDE of the loop.

On the other hand if the character has 180 then the conditional branch will add 1 to the Bonus and start over. This time Bonus will be 2, which will give an X variable (rotten food) of 200. And so on with 300 and on and on until it gets to a negative number.

The very last thing to do is to multiply your Bonus by your factor, in Slumber's case 10.

And that's all you have to do to have skill based timers in your game!

Defying the Grand List of Role Playing Game Cliches since 2009.

Topic locked

Who's online

There are currently 0 users and 1 guest online.