Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
254
Reaction score
242
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
194
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

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]
 

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
254
Reaction score
242
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
194
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
254
Reaction score
242
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,318
Reaction score
492
First Language
French
Hi,

Maybe this will help you?

 
Last edited:

Sigony

Crusader Masochist
Veteran
Joined
Aug 18, 2020
Messages
76
Reaction score
506
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
194
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.

f3c1c7a64e19d39e0b6ac088effc95b0.jpg
 
Last edited:

Kristina

Veteran
Veteran
Joined
Jun 22, 2019
Messages
254
Reaction score
242
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
76
Reaction score
506
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
254
Reaction score
242
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
194
First Language
thai
Primarily Uses
RMMV
Try this and define your own new variable.

2e0c079da34804b42ed1e5ac7bce08f6.gif

9001de08cce0964d56800558c3bd6fa2.jpg


0a8afed1eb7685065b9810dd5263debc.jpg


56e51e67fc8b57182d484792d0cfc942.jpg
 
Last edited:

Latest Threads

Latest Profile Posts

ready to fall into another development hell...
Mega has been giving me a lot of problems as of late, so I think I'll need to switch to another cloud service. I'm considering Dropbox.
Rough week, but in the end there's light in the darkness.
Mental health is an issue I wish was taken more seriously.
Take care.
1638421271905.jpeg
By the power of timezones! This picture shall still be posted on december 1st!!!
7xI2Gc2.jpg

This is not something I'd ever even considered but wow! What a way to use music in a game.

Forum statistics

Threads
117,123
Messages
1,104,762
Members
153,169
Latest member
StarkerKai
Top