Chopping wood

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?
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

ea404f57bbbf28fa5f6ef3fec4f3ba62.jpg


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]
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.
$gameSystem.day() === 1

To 31

To set the date to receive the wood
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.
Hi,

Maybe this will help you?

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.
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.

f3c1c7a64e19d39e0b6ac088effc95b0.jpg
@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.
@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.
@Sigony Alright, thanks! I will play around with it.
Try this and define your own new variable.

2e0c079da34804b42ed1e5ac7bce08f6.gif

9001de08cce0964d56800558c3bd6fa2.jpg


0a8afed1eb7685065b9810dd5263debc.jpg


56e51e67fc8b57182d484792d0cfc942.jpg

Original thread: https://forums.rpgmakerweb.com/threads/chopping-wood.127096/