RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Event] Woodcutting Profession

0 Members and 1 Guest are viewing this topic.

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Woodcutting Profession


Summary
I'm sure there are systems out for this already, however, I'm going to share with you how to make an effective Woodcutting profession for your VX game. At the end, I've supplied a character sheet of the tree that you'll need for this to work. Feel free to make your own character sheets for trees as well.

Requirements
For this you'll require 2 global variables, a Hatchet item, and a Log item. There are no common events used and no global switches used.


Tutorial

Event Page 1

Specs
Conditions: None Set
Graphic: $Chop_Tree (see bottom of the post)
Autonomous Movement: Defaults
Options: Defaults
Priority: Same as Character
Trigger: Action Button

Code: [Select]
@>Conditional Branch: [Hatchet] in Inventory
  @>Control Variables: [0001: Success] = Random No. (0...5)
  @>Set Move Route: Player (Wait)
   :   : $>Turn 90 Right
   :   : $>Wait: 10 frame(s)
   :   : $>Turn 90 Left
   :   : $>SE: 'Earth6', 80, 50
   :   : $>Wait: 30 frame(s)
  @>Conditional Branch: Variable [0001: Success] == 0
@>Control Self Switch: A = ON
@>Change Items [Log], +1
@>Play SE: 'Decision2', 80, 150
@>Control Variables: [0002: WC EXP] += 5
@>Text: -, -, Dark, Middle
: :
: : You obtained a Log.
@>
   :   Else
@>
   :   Branch End
  @>
:   Else
  @>Text: -, -, Dark, Middle
   : :
   : :   You don't have anything to chop the tree with.
  @>
:   Branch End
@>

Event Page 2

Specs
Conditions: Self Switch A = ON
Graphic: TileB (Stump image)
Autonomous Movement: Defaults
Options: Defaults
Priority: Same as Character
Trigger: Parallel Process

Code: [Select]
@>Wait: 600 frame(s)
@>Control Self Switch: A = OFF
@>

Finished.

Conclusion
I thought I would wrap this up with a quick step by step explanation of what's going on here.
On the first page, the very beginning is just checking to see if you have a Hatchet in your inventory. If you don't, it'll just display a message and you won't cut the tree. If you do, it'll jump to the variable 0001 and pick a number between 0 and 5 including both 0 and 5. Directly after that, your character will make a simulated 'woodcutting' movement and play a 'tree chopping' sound effect for details. At the end of this movement, a new conditional branch will check the number that variable 0001 is equal to. If it is not equal to 0, then the event stops and you can begin again in a simulated button smashing log chopping frenzy. Each failed time will renew the random number that variable 0001 is equal to. When variable 0001 is equal to 0 you will then hear a sound effect meaning that you obtained a log and recieve a message saying that you recieved a log. Also, variable 0002 will increase by 5. Variable 0002 is tracking your wood cutting experience points. Self Switch A is turned ON that turns the page of the event. On page 2, the graphic is a stump which visually shows you that you cut the tree down after you obtained that log. The respawn time for the tree to come back is 600 frames which is equal to 10 seconds real time.

Things You Might Change
You can reduce the array that variable 0001 has. The shorter the array, the more often you'll chop a tree down on the first try.
You can add a bubble icon just before the player movements to simulate an extra action.
You can edit the +exp of variable 0002
You can edit the wait time of the tree to respawn on the second page. (Note that the maximum wait can be 999, but that doesn't stop you from placing multiple wait commands in sequence. You can have 6, 600 frame wait commands that will have the player wait in real time for 1 minute before the tree respawns.)

Credits
Credits are unnecessary, but welcome. If you do, you can credit me by Grafikal, Grafikal006, or Grafikal007.

Tree Graphic