Chopping wood

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
126
Reaction score
83
First Language
Danish
Primarily Uses
RMMV
Hi game makers,

The player will be able to chop trees in my game. The idea is that the player will get 3 wood from each tree a day, if the party got an axe.

I got the time system working - I'm using Moghunter's. The only thing I got trouble with is to make it so the player only can get 3 wood. So, when they got 3 wood from the tree, then nothing else happens.

My mind is blank, so I hope anyone could help me out?
 

palatkorn

Veteran
Veteran
Joined
Nov 1, 2019
Messages
267
Reaction score
192
First Language
thai
Primarily Uses
RMMV
This is his time check code, you just run the skip to your power switch.
It is placed in the plugin description. If you want Check, just call Use command script



Code:
 * $gameSystem.time_system(boolean)
 * ============================================================================
 * - CHECKING THE TIME
 * ============================================================================
 *
 * $gameSystem.second()
 * $gameSystem.minute()
 * $gameSystem.hour()
 * $gameSystem.hour_pm()
 * $gameSystem.day()
 * $gameSystem.month()
 * $gameSystem.year()
 * $gameSystem.season()
 * $gameSystem.day_week_name()
 * $gameSystem.season_name()
 * $ gameSystem.month_name () [/ CODE]
 

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
126
Reaction score
83
First Language
Danish
Primarily Uses
RMMV
I don't have issue with his plugin. It's the chopping trees I got issue with. I want the player to only chop 3 wood on one tree. The player can chop a tree once a day, I got the time system working though, it's just the chopping trees I need to work.

Thanks though.
 

palatkorn

Veteran
Veteran
Joined
Nov 1, 2019
Messages
267
Reaction score
192
First Language
thai
Primarily Uses
RMMV
$gameSystem.day() === 1

To 31

To set the date to receive the wood
 

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
126
Reaction score
83
First Language
Danish
Primarily Uses
RMMV
I think you're misunderstanding my post. I'm sorry if I haven't been clear enough.

The only thing I need help with is to make sure that the player can only chop 3 wood per tree. I don't know how to check when the player got the 3 wood from the tree and then make the tree stop giving more wood.

I don't have issues with the time system. I only mentioned it just in case if anyone was wondering.
 

Chaos17

Dreamer
Veteran
Joined
Mar 13, 2012
Messages
1,311
Reaction score
485
First Language
French
Hi,

Maybe this will help you?

 
Last edited:

Sigony

Crusader Masochist
Veteran
Joined
Aug 18, 2020
Messages
74
Reaction score
462
First Language
English
Primarily Uses
RMMV
I think you may be able to make use of self-variables, which requires a plugin.
Every time the player chops wood, increment the variable of a tree by 1.

Also, have a global variable somewhere, not sure if your plugin gives you the absolute number of days that have passed. So, if a tree's variable is less than the number of days times 3, allow chopping, if it is greater or equal to the number of days times 3, then disallow chopping.

The problem with this is that if they didn't chop the tree every day, they'd be able to catch up on the lost wood. So, you can also check for if the tree's variable is less than the number of days times 3 subtract 3, and if so, then you set the tree's variable to the number of days times 3 subtract 3.

E.g. It is Day 3. The tree's variable is at 0, because the player has never chopped it. So, your conditional branch will set the tree's variable to (3*3)-3 = 6. The player chops once, variable is now 7, chops again, now it is 8, chops again, now it is 9. Tries to chop again, but the tree's variable is not less than the number of days times 3, which is (3*3) = 9. But, on the next day, Day 4, the number will be 3*4 = 12, and that tree can then be chopped three more times.
 

palatkorn

Veteran
Veteran
Joined
Nov 1, 2019
Messages
267
Reaction score
192
First Language
thai
Primarily Uses
RMMV
you create a variable and give it +1, you want + go in and end at 0.
Remove the equal 1 above, don't follow me as it won't work.

 
Last edited:

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
126
Reaction score
83
First Language
Danish
Primarily Uses
RMMV
@Chaos17 Thanks, I will watch it!

@Sigony Thanks, I would prefer that it will stay on 3 wood per day, even if the player didn't chop it the day before. I guess that it can be hard to make it like that?

@palatkorn Thanks, I will try to play around with your solution.
 

Sigony

Crusader Masochist
Veteran
Joined
Aug 18, 2020
Messages
74
Reaction score
462
First Language
English
Primarily Uses
RMMV
@Kristina, the way that I explained will work, just go through the logic in your mind and try out different scenarios to try and break it.
 

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
126
Reaction score
83
First Language
Danish
Primarily Uses
RMMV
@Sigony Alright, thanks! I will play around with it.
 

palatkorn

Veteran
Veteran
Joined
Nov 1, 2019
Messages
267
Reaction score
192
First Language
thai
Primarily Uses
RMMV
Try this and define your own new variable.






 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top