Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Eventing]Gardening, Made With Events! :)
RzrBladeMontage
post Sep 14 2009, 08:37 PM
Post #1


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




RPG Maker Version: XP
Difficulty Level: 3/10

Well this is my first tutorial submission, so I hope I explain clearly what you need to do in order to create this gardening event within your game. This event can be used to grow any number of plants (flowers, trees, herbs, etc). In this tutorial I explain how to grow herbs and then by talking to an NPC you can have these herbs created into potions! (This can also be used for weapon creation, and other skills such as this.)

There is a lot to do, so if you don't feel like reading and doing it yourself, you can download the demo and try it out that way. I'm sure someone who's much better at eventing (The Law G14 for example) could probably make a cleaner and smoother running event process then I can, but I figured I might as well practice my eventing and such. I also recolored some icons and pieces of map tiles and then compiled them into a 'character' sheet so I could use them within the demo. (Whoever downloads the demo will understand what I mean.)

The original version of this tutorial is found here: Gardening Tutorial. However, I've not only made it easier to understand, I've created a demo and added a potion making element to it as well. Credit for the basic tutorial goes to afwell1, everything else is by me smile.gif.



Okay, let's get started!

In this example I will be using 3 different types of herbs: Flux, Tuneq and Poe. Each has their own specific color, and growing time. I've created 3 spots in which you can plant any of the seeds.

[Show/Hide] Step One

Create 3 variables:
- Flux Herb
- Tuneq Herb
- Poe Herb

These variables will be used later for potion creation.

Create 18 switches:
Flux Planted
Flux Grown
Flux Planted 2
Flux Grown 2
Flux Planted 3
Flux Grown 3

Tuneq Planted
Tuneq Grown
Tuneq Planted 2
Tuneq Grown 2
Tuneq Planted 3
Tuneq Grown 3

Poe Planted
Poe Grown
Poe Planted 2
Poe Grown 2
Poe Planted 3
Poe Grown 3

You don't NEED this many switches if you're only using 1 spot for growing plants. I have planted/grown 1, 2, and 3 because I have 3 different spots to plant seeds. This makes it easier to handle each spot separately from the others.


[Show/Hide] Step Two

Create an event and name it "Planting Spot 1." The #1 switches will be used with Planting Spot 1, and #2 switches will be used with Planting Spot 2, and etc. Create 6 more pages (you should have 7 pages total). Pages 2, 4 and 6 should all be "Parallel Process."

Page 1:
This page is the bare ground before planting any seeds. Input the following into the commands box.



Page 2:
This page is after the Flux Seed has been planted. Under conditions, check "Switch" and select "Flux Planted." Also, select your growing picture to be shown on the map in front of the player, this gives it more of a realistic image instead of going from dirt to a full grown plant. Because of the selections on page 1, if the player decides to plant a Flux Seed, this will activate the switch and then show a small plant growing. Input the following into the commands box.


Here, we use the "Wait" command for 200 frames. 40 frames = 1 second in real time, so it takes our Flux Seed 5 real time seconds to grow into a full herb. (This can be used with many more pages to make a longer grow time, however the max wait time is 999, so many more event pages are needed.)

Page 3:
This page is after the Flux Seed has grown into a full Herb and is ready to be picked. Under conditions, check "Switch" and select "Flux Grown." Also, select your fully grown picture to be shown on the map in front of the player. On the 'Planted' page, after waiting the selected time, the 'Grown' switch is activated and the player is now able to pick the herb and then plant another seed if they wish to do so. Input the following code into the command box.



This will give the player the option of picking the herb if they wish, and if so, it creates the planting area again, allowing the player to plant another seed if they decide to.

Continue to do this for the rest of the pages for the other types of herbs. I'll post pictures to help those who still need help. Remember to turn on the correct switches for the correct pages and put the 'Planted' and 'Full Grown' pictures on the correct pages as well! When the player obtains a Herb, make sure to add to the correct variable, this is very important for potion creation later!

Page 4:


Page 5:


Page 6:


Page 7:



[Show/Hide] Step Three

Now that you've got a complete event make sure to APPLY (so you don't lose your work!) and then click OK. Copy the 'Planting Spot 1' and paste it on another planting spot. Go back into the event and change the name to 'Planting Spot 2' and change ALL of the switches to 'Planted 2' and 'Grown 2.' This will have to be done in the code so when the player decides to plant a Flux Seed, it turns on the Flux Planted 2 switch on instead of the Flux Planted 1 switch. You don't want your events clashing with each other!



Now copy 'Planting Spot 2' and paste it into another planting area and then go back into the event and change everything so it's "Planting Spot 3," "Planted 3" and "Grown 3." Once again, you don't want your events clashing!


There! Now all of your planting spots are completed and working, however now we can get into the NPC that creates potions for you! This is where the variables come in (and a LOT of eventing!)


[Show/Hide] Step Four

Okay, you have all your events set up so now all you have to do is make an NPC that can create potions for you. This will take a lot of conditional branches. Also, this is where the variables kick in, so many sure you have them set up correctly!

First, make an event, and give it a sprite. Then, make it ask if the player would like to create a potion. Show choices yes/no and if yes have the player choose what kind of potion he/she would like to make. For this example we will use a Normal Potion, Super Potion and X-Potion. After the player picks what kind of potion they want to make, have the NPC tell the player how many herbs of a certain kind it will take to create that potion, if the player agrees, the NPC will create the potion for the player if they have enough herbs and enough money. To do this, use conditional branches. For this example, a normal potion takes 10 Flux Herbs to create. Every time a player picks a Flux Herb, or gains a Flux Herb, make sure to add to the Variable "Flux Herb" by however many Flux Herbs the player has obtained. Create a conditional branch to check and see if the variable "Flux Herb" is over 10, if it is, the conditional branch goes to another branch that checks if the player has over 5 gold coins (to pay the NPC for creating the potion). If the player doesn't have enough Flux Herbs, they'll receive the message "You don't have enough Flux Herbs!" and if they don't have enough Gold to pay the NPC, they'll receive the message "You don't have enough Gold to pay me!" As your potion combination's get more complicated, you'll need to add more and more conditional branches to check for other ingredients. You can see that example with the X-Potion, where it takes 5 Flux Herbs, 5 Tuneq Herbs and 10 Poe Herbs to create one. Here is the full code. Put this into the commands box.





It looks like a lot, but it's really pretty simple. I've tried to make this tutorial as easy as I could for those who aren't good at eventing, or who are just starting out their project. This tutorial can be modified to do other skills such as mining and woodcutting (and other "Runescape-ish" skills, if your game has them.) Also, make sure all of your event images are on "Direction Fix" for the planting/growing and bare ground pages. Otherwise a player will get a different sprite when they click on the event from a different side.


After all that you'll have your own gardening/potion making set up! I hope you can all understand this tutorial easily and I hope I've helped, even if it's in the slightest! Please post any questions or comments below!

EDIT: If you plant some seeds, and then teleport to a different map, the plants do NOT keep growing. I just tried this and when you go back to the map with the garden, the "Wait" times start again from zero. So if you plant 3 Flux Seeds, teleport away, and then back, all three of your herbs will pop up at once, ready to be harvested. I'm not sure if there is a way to make the events continue while the player is away. If anyone has an idea, please post it here or PM me.


__________________________





Go to the top of the page
 
+Quote Post
   
The Law G14
post Sep 15 2009, 06:08 AM
Post #2


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,348
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Nice job Blade! Good to see that you're trying to make some event systems! Also, does the timer keep going even if you move to a different map? Like you start growing a plant and it's in the second stage and then you go to a different map then you come back, would the plant have still been growing?


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
RzrBladeMontage
post Sep 15 2009, 08:33 AM
Post #3


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




Well let's say there's 4 stages to your plant being grown. Sprout, Stem, Blossoming, Fully Grown. If the player stays there and waits for the flower, in this case, to go to it's stem stage, and then they teleport away, and come back 10 minutes later, the flower will still be in it's stem stage, however the wait time for the stem to change to Blossoming would be reset.


__________________________





Go to the top of the page
 
+Quote Post
   
Joe
post Sep 15 2009, 08:38 AM
Post #4


Level 29
Group Icon

Group: Revolutionary
Posts: 674
Type: Event Designer
RM Skill: Advanced




RzrBladeMontage, instead of using extended wait commands, you could utilize very short ones that add to a variable.

For example:

After planting a Flux seed, have the event loop with a
wait 20 frames
Change var (flux 1) =+1

Then when variable flux 1 reaches 10 (a wait time of 200 frames total), you can trigger the switch (or just use the variable).

Overall I think your tutorial is presented very nicely. It is easy to follow and has excellent supporting images. However, I feel that there is a much easier way to create a gardening system that would expand the player's options and functionality of the system. Despite that, this is a great way for people to begin experimenting with growing a variety of plants. Nice work.


__________________________
My Games

< OPEN BETA - DOWNLOAD HERE



Go to the top of the page
 
+Quote Post
   
RzrBladeMontage
post Sep 17 2009, 03:12 AM
Post #5


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




QUOTE (Joe @ Sep 15 2009, 12:38 PM) *
RzrBladeMontage, instead of using extended wait commands, you could utilize very short ones that add to a variable.

For example:

After planting a Flux seed, have the event loop with a
wait 20 frames
Change var (flux 1) =+1

Then when variable flux 1 reaches 10 (a wait time of 200 frames total), you can trigger the switch (or just use the variable).

Overall I think your tutorial is presented very nicely. It is easy to follow and has excellent supporting images. However, I feel that there is a much easier way to create a gardening system that would expand the player's options and functionality of the system. Despite that, this is a great way for people to begin experimenting with growing a variety of plants. Nice work.


Thanks for commenting on my tutorial Joe, I appreciate it. I understand what you mean about the wait time and variables, that could help whenever a player teleports away to do a quest or something, it won' t completely reset the timing just because it has some variables already in it. I wish there was a way we could modify this so it will keep processing when the player is away, because that would be very helpful with more rare plants that need longer to grow. If you have anymore ideas, please post them.


__________________________





Go to the top of the page
 
+Quote Post
   
Joe
post Sep 18 2009, 08:33 AM
Post #6


Level 29
Group Icon

Group: Revolutionary
Posts: 674
Type: Event Designer
RM Skill: Advanced




Rzr, have you thought about using a global variable? They would run no matter where the player is, however, they may have a big impact on performance.


__________________________
My Games

< OPEN BETA - DOWNLOAD HERE



Go to the top of the page
 
+Quote Post
   
RzrBladeMontage
post Sep 18 2009, 06:40 PM
Post #7


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




I don't know how to use that.. I've never even heard about it to be honest. Can you tell me more and I can see if I can implement it into this event?


__________________________





Go to the top of the page
 
+Quote Post
   
Joe
post Sep 19 2009, 06:21 AM
Post #8


Level 29
Group Icon

Group: Revolutionary
Posts: 674
Type: Event Designer
RM Skill: Advanced




Sure,

When I said global variable, I really meant "common event", which I'm sure you have seen within your database. But essentially common events are just like regular events, except that they work anywhere.


__________________________
My Games

< OPEN BETA - DOWNLOAD HERE



Go to the top of the page
 
+Quote Post
   
RzrBladeMontage
post Sep 22 2009, 12:38 PM
Post #9


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




QUOTE (Joe @ Sep 19 2009, 10:21 AM) *
Sure,

When I said global variable, I really meant "common event", which I'm sure you have seen within your database. But essentially common events are just like regular events, except that they work anywhere.


Oh I see, yeah I've actually used those before lol. Sorry for sounding dumb. If I edited the event to call a common event, it would work anywhere, and allow the plants to grow when the player is away from that map?

Also, do you think there is a way to add a "fail" event, so for example, a Flux Herb has a 9/10 chance of growing perfectly, and a 1/10 chance to die?


__________________________





Go to the top of the page
 
+Quote Post
   
Locke
post Oct 15 2009, 07:42 AM
Post #10


Level 10
Group Icon

Group: Revolutionary
Posts: 151
Type: Mapper
RM Skill: Intermediate




Nice gardening tutorial in my childhood days that i always like it gardening

But now in game it will be awesome and good job for the tutorial
i love it! laugh.gif


__________________________
We are one (Really i,m not joking)



I've seen many things when mankind rule the land


Which Final Fantasy Character Are You?
Go to the top of the page
 
+Quote Post
   
fizzly
post Oct 21 2009, 04:29 AM
Post #11


Level 3
Group Icon

Group: Member
Posts: 33
Type: Artist
RM Skill: Skilled




You should mention first, about the RM version used. smile.gif (Now I know, that this is for XP)
Go to the top of the page
 
+Quote Post
   
Holder
post Oct 21 2009, 04:45 AM
Post #12


Spoilers.
Group Icon

Group: Revolutionary
Posts: 4,204
Type: Developer
RM Skill: Advanced
Rev Points: 250




I've altered the topic icon to that of XPs one so there's no confusion in the future.


__________________________

 I'm running the Great North Run in September in aid of NACC. A condition my wife has in it's severe form.
Please sponsor me with whatever you can, thank you.
If you'd like to help spread the word please share the image and link to my fundraising page.

Go to the top of the page
 
+Quote Post
   
RzrBladeMontage
post Nov 2 2009, 07:39 AM
Post #13


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




Thanks Holder, and sorry to anyone who got confused on what maker this was for. I'm looking for ways to make this easier to use (via common events and such) but I'm in the process of moving so please stay tuned! smile.gif


__________________________





Go to the top of the page
 
+Quote Post
   
cupski
post Jan 21 2010, 08:21 PM
Post #14


Level 1
Group Icon

Group: Member
Posts: 13
Type: Event Designer
RM Skill: Beginner




Waw Taht Great An dLOng laugh.gif


__________________________
The XxXX
:P
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 11:48 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker