Selecting and planting certain crops? Event help!?

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Sorry if I'm in the wrong board (it's my first time posting in this forum) but I really need some help with a certain event I'm making. I'm using this 

http://forums.rpgmakerweb.com/index.php?/topic/18377-simple-farming-system/

to make a nice farming game. I bought the Rural Farm Tiles Resource pack and making the planting event wasn't too hard. But now I'm stuck. See, the Rural Farm Tiles Pack contains multiple (30 or so) crops to grow. What I want to do is have an event (like the one shown in the link, though slightly altered) that instead of having the line that says "Conditional Branch: [Potion] in inventory" I want it to do something like "Conditional Branch: [Corn Seeds, Carrot seeds, Potato Seeds (etc)] in inventory" then display the items that ARE in the inventory and give a choice of which one to plant and then display the right crop with the right plant.

I don't know if I'm making a whole heap of sense, but basically I want a farming system similar to Rune Factory 1 where you can plant whichever seeds you want on the tilled soil and then it displays the right seed/crop graphic after planting. 

The other thing I want is a way to make certain crops grow slower in certain seasons. For example, say turnips grow best in spring, strawberries in summer, lettuce in fall, and radishes in winter. I'd like to make the event also include a way of judging what season it is and then making the crops that aren't seasonal grow (let's say 2 times) slower than the rest. 

I'm also using

http://forums.rpgmakerweb.com/index.php?/topic/9370-variable-calendarweather-system/

(the main script, calendar clock, and seasonal tones add on)

I've just learned how to use variables and switches (regular ones, not self) which always confused me before, and I'm thinking there's probably a way to make an event like the one I'm thinking with variables and whatnot, but I'm just not at that level. If someone could help me I'd really appreciate it. Thanks in advance!
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Use the "Select Key Item" event command to bring up a list of Key Items (be sure the seeds are marked with the "Key Item" type) and store the selected item's ID in a variable.  Then you can do whatever processing you want with that variable.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
as long as seeds are the ONLY type of item you list as "key item"
 

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Use the "Select Key Item" event command to bring up a list of Key Items (be sure the seeds are marked with the "Key Item" type) and store the selected item's ID in a variable.  Then you can do whatever processing you want with that variable.
I understand the first part of what you said, but since I'm new to using variables how would I store the item's ID in a variable? Sorry, I'm a serious noob here ha ha. 
 

Alkorri

Proofreading Penguin
Veteran
Joined
Jan 8, 2014
Messages
2,975
Reaction score
944
First Language
English
Primarily Uses
Have you looked at Celianna's Variables Guide for beginners? :) I found it a very useful learning tool as I could open it up to see how I can use variables.
 

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
 Have you looked at Celianna's Variables Guide for beginners?  :)  I found it a very useful learning tool as I could open it up to see how I can use variables.
Ooh thanks! That was very informative... but I'm still stuck.  :( Basically, I need my event to go something like this:

Page 1:

Show Choices: Plant seeds?, Leave it...

When [Plant Seeds?]

Conditional Branch: [seeds 1-30 in inventory]

Select Key Item

Text: You planted ____ (corresponds with key item chosen) seeds!

Script: set_spawn(o,o,1440) (not sure if this will work)

Self switch A=ON

Change graphic: ____ (corresponds with key item chosen)

Else

Text: You don't have any seeds!

When [Leave it...]

(Nothing happens of course)

Page 2 (with self switch A checked)

Change graphic: ____ (corresponds with key item chosen)

Text: ____ is growing!

(The move route is set to custom and the script call is place in the move route like the guide shows...)

Page 3 (with self switch B checked)

Text: The ____ grew! (corresponds with key item chosen)

Show choices: Harvest it?, Leave it...

When [Harvest it?]

Change items ____ +1 (whatever the first ____ grows into)

Text: The ____ is harvested!

Self switch A=Off

Self switch B=Off

When [Leave it...] (Nothing happens again)

I don't know if this is even possible. I feel kind dumb lol. Maybe I need someone to make a script? 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
you cannot make a single branch for multiple items.

This part of your event is wrong:

When [Plant Seeds?]

Conditional Branch: [seeds 1-30 in inventory]

Select Key Item

Text: You planted ____ (corresponds with key item chosen) seeds!

Script: set_spawn(o,o,1440) (not sure if this will work)

Self switch A=ON

Change graphic: ____ (corresponds with key item chosen)
It needs to be changed into something like:
Code:
when[Plant seeds?]select key item [variable ID]conditional branch: [variable ID= ID of seed1]text/script/change graphicconditional branch: [variable ID = ID of seed2)text/script/change graphicconditional branch for seed 3......
 

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
you cannot make a single branch for multiple items.

This part of your event is wrong:

Alci V, on 10 Oct 2014 - 10:56 PM, said:

When [Plant Seeds?]

Conditional Branch: [seeds 1-30 in inventory]

Select Key Item

Text: You planted ____ (corresponds with key item chosen) seeds!

Script: set_spawn(o,o,1440) (not sure if this will work)

Self switch A=ON

Change graphic: ____ (corresponds with key item chosen)
It needs to be changed into something like:

when[Plant seeds?]

select key item [variable ID]

conditional branch: [variable ID= ID of seed1]

text/script/change graphic

conditional branch: [variable ID = ID of seed2)

text/script/change graphic

conditional branch for seed 3
Ah! I think I see it now! Thanks! I will try that and see what happens. 

...

...
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Yep, Andar gave you the right way to do it.

As far as the other pages (X is growing / X has grown do you want to harvest it), I think you'll need to make pages for each type of crop if they have different graphics.  You can assign a single variable to each "plot" of land where seeds can be grown, and use that variable as page conditions.

For example, assume you can only grow Corn ("Crop 1"), Strawberries ("Crop 2"), and Pumpkins ("Crop 3").  This would be the event layout for the plot tied to Variable #19:

Page 1: As Andar laid out for you; this will probably be the longest page.  In the conditional branches for each crop, be sure to set Variable #19 to the appropriate crop number.

Page 2: Conditions: Variable 19 is 1 or greater and self switch A is on / "Corn is growing!" ...

Page 3: Conditions: Variable 19 is 1 or greater and self switch B is on / "Corn has grown!  Harvest it? (Yes/No)" ...

Page 4: Conditions: Variable 19 is 2 or greater and self switch A is on / "Strawberries are growing!" ...

Page 5: Conditions: Variable 19 is 2 or greater and self switch B is on / Strawberries have grown!  Harvest it? (Yes/No)" ...

Page 6: Conditions: Variable 19 is 3 or greater and self switch A is on / "Pumpkin is growing!" ...

Page 7: Conditions: Variable 19 is 3 or greater and self switch B is on / "Pumpkin has grown!  Harvest it? (Yes/No)" ...
 

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
No, something went wrong still. Sorry to be such a bother. I'm not sure how to post the text from my event directly onto here (ctrl+v doesn't work for some odd reason??) but I think I'm doing the variable ID wrong or something. Basically, it now looks like this.

Page 1:

Show Choices: Plant seeds?, Leave it...

When [Plant Seeds?]

Select Key Item

Conditional Branch: Variable[1000:Corn Seeds]==Variable[1000:Corn Seeds]

Change items: Corn Seeds +1

Text: You planted Corn Seeds!

Script: set_spawn(o,o,1440) 

Change graphic

Self Switch A=ON

Else

Text: You don't have any seeds!

When [Leave it...]

Conditional Branch: Variable[999:potato Seeds]==Variable[999:potato Seeds]

Change items: Potato Seeds +1

Text: You planted Potato Seeds!

Script: set_spawn(o,o,1440) 

Change graphic

Self Switch A=ON

Else

Text: You don't have any seeds!

When [Leave it...]

 

What's happening now is that it plants the corn and potato on the same tile saying "You planted Corn Seeds" "You Planted Potato Seeds!" regardless of whether Self Switch A is on or not. It also doesn't recognize the difference between the two seeds. I can select Corn Seeds to plant and it will say "You Planted Potato Seeds!" and vice versa! What am I doing wrong? This is quite upsetting....
 

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Yep, Andar gave you the right way to do it.

As far as the other pages (X is growing / X has grown do you want to harvest it), I think you'll need to make pages for each type of crop if they have different graphics.  You can assign a single variable to each "plot" of land where seeds can be grown, and use that variable as page conditions.

For example, assume you can only grow Corn ("Crop 1"), Strawberries ("Crop 2"), and Pumpkins ("Crop 3").  This would be the event layout for the plot tied to Variable #19:

Page 1: As Andar laid out for you; this will probably be the longest page.  In the conditional branches for each crop, be sure to set Variable #19 to the appropriate crop number.

Page 2: Conditions: Variable 19 is 1 or greater and self switch A is on / "Corn is growing!" ...

Page 3: Conditions: Variable 19 is 1 or greater and self switch B is on / "Corn has grown!  Harvest it? (Yes/No)" ...

Page 4: Conditions: Variable 19 is 2 or greater and self switch A is on / "Strawberries are growing!" ...

Page 5: Conditions: Variable 19 is 2 or greater and self switch B is on / Strawberries have grown!  Harvest it? (Yes/No)" ...

Page 6: Conditions: Variable 19 is 3 or greater and self switch A is on / "Pumpkin is growing!" ...

Page 7: Conditions: Variable 19 is 3 or greater and self switch B is on / "Pumpkin has grown!  Harvest it? (Yes/No)" ...
I think I get what you're saying about pages 2 and beyond, but I'm still stuck on page one. What is the limit for pages per event? I've never needed to use more than 3-4 pages. If I had 2 pages per crop and 30 crops to plant, would there be enough pages? 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
That part is wrong:

Select Key Item


Conditional Branch: Variable[1000:Corn Seeds]==Variable[1000:Corn Seeds]
Which variable do you use to store the selected key item?


It should be something like:


select key item[100:selected seed]


And then you need to compare that variable with the ID of the items, NEVER with other variables (unless you really know what you're doing).


conditional branch: Variable[100:selected seed]==1


(if 1 is the ID of a seed in the item database)
 
Last edited by a moderator:

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
YES! I got it to work! THANK YOU EVERYONE!!   :D  At first, I wasn't sure what you all meant by item ID but then I figured out that it was the number in front of the item in the database (obvious, but when you're trying to figure things out at 1am sometimes obvious things don't seem that way.). Then I tried to make my event again, but it ended up looping and only playing the first part (The corn seed planting part). It took a few hours of fiddling, but I finally got it to work thanks to you guys! Thanks again! 

Here's some screen shots (for those who would like to attempt an event like this themselves). 

For some reason the Erase Event Processing is a very important step and is what stops the first choice from looping forever. Also, if anyone wants to add more crops, the just repeat pages 2-4 with the right switches and stuff. 

Event Page 1.png

Event Page 2.png

Event Page 3.png

Event Page 4.png
 

Alci V

Villager
Member
Joined
Oct 9, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
I guess I spoke too soon.  :(  The event works fine now... except for some reason when I copy the event to a new tile in hopes of making  SEPERATE event with the same effects, it plants the same seeds on ALL the event tiles!! I THINK it's because I used regular (not self) switches. For those of you who are also attempting this event, I'm thinking we'll have to label the switches differently on each tile. Ugh! 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
1) ALLWAYS name your switches and variables. This is not only to help you remembering what you used a switch for, but also to prevent yourself from double-uses of the same switches. And the switches in your screenshots are only partially named.


Do yourself a favour and name all switches and variables when first used, it will save a lot of your time during bughunting.


2) General switches (and all Variables) are always identical through the entire project - they are intended to controll all events at the same time.


That's the difference of self-switches, those are event based and the self-switches of one event are different from the self-switches of another event.


If you need more self-contained data, you'll need PK8's Self-Data-Suite, a script that adds script commands for data handling not only for more self-switches, but also self-variables and more.


Also


Alci V, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Yeah, make sure you use self switches, and make sure you're using a different variable for each event (and its conditions) as well.  The game is just reading exactly what you tell it, so if every single event says "if Variable 19 is 1...", then every event will change when that variable changes.

There is a way to script (using RGSS) these events in a way so that you can create it once and then copy it to hundreds of other events, and have each event act only on itself.  But that's just going to mess you up if you haven't mastered eventing yet.  So just do it the hard way for now, and keep in mind that you can streamline it a lot later on once you've gotten good at it. :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top