I'm currently working through Beginning RPG Maker MV and I'm stuck on a relatively simple exercise. I am attempting to create a treasure chest that appears when I trigger enough trees linked to it.
Code for the trees is as follows:
Text : None, Window, Bottom
: : This tree looks peculiar
If : Self Switch A is OFF
Control Variables : #0001 Tree += 1
Control Self Switch : A = ON
: End
I have the Priority set on "Same as characters", the Trigger set on "Action button" and the Self-Switch A check turned on under Variables.
After that, I did a Quick Event Creation to make the chest and clicked on the Variable condition of "0001 Tree > 5"
Yet, no matter how much I reenter the programming in the trees or for the chest (including full deletion and retyping of the tree code as well as recreating the chest via Quick Event Creation) it's refusing to appear whenever I've hit enough trees.
In short, HELP!
Additionnaly to what has been said above, checking if self switch is set to OFF is a bit redundend (in this scenario).
By default, it is always OFF, meaning you can just skip that part of the code.
It can be usefull in certain conditions, especially when you are going back and forth with the selfswitches, but here it's a matter of "execute this event once".
You can rewrite it as such :
◆Text:None, Window, Bottom
:Text:This tree looks peculiar
◆Control Variables:#0001 Tree += 1
◆Erase Event
If you need that tree to be definitely put off (meaning, during the entire game), you can use the selfswitch with a second event page.
Instead of Erase Event, you want to set selfswitch A to ON
Then, create a new event page, set the conditions to self switch A, and leave the page blank.
To achieve desired result and using this logic, you will need to duplicate this event 5 times, so that the player cuts down 5 trees, resulting in the variable value being 5.
Which should then trigger your chest to appear.
If you ever doubt of the actual variable value, you can use a seperate event with a character, use the text command and make him say something like : Current variable value for Tree is : \v[1]
You will be able to see if it actually progress or not, enabling you to better target where the issue is.
The OP's tree code looks correct. I don't think using erase is a good idea because it will return once you leave the map. Besides, he didn't mention anything about cutting it down.
But I can't say for sure unless I see the treasure chest event screenshot.
There is a debug menu in playtest if you press F9 where you can check the variables.
if he needs to check, he can also set another if below BEFORE selfswitch A
is on, so it checks and do whatever it needs to do.
otherwise, a parallel event (wait 10 for checks) and execute it that way.
I also recommend if you need it often or is scattered by different maps, use a common
event and use that inside the events.
in this case, if you make a mistake, you edit it once, instead of 5+ times by recopy
and paste those events 🙂
another way is spawn event to grab all of those which is also an alternative.
Yeah, I caught right after. Sadly, even after I've removed it, it's now COMPLETELY non-responsive, doesn't even give me the text. Ideas?
Is your event in front of the tree, or on the tree? Since you have Priority "Below characters", you would have to stand on this event to trigger it.
Yes, if you're trying to activate from an adjacent tile, they need to be Same as Characters.
As Zia mentioned, the event needs to be set to "same as player" in it's priority in order to be activated from an adjacent tile.
When the priority is set to below or above player, the player must be in the same grid in order to activate it.
edit:
opened this page 30 minutes ago, go distracted, didn't refresh, then replied.
Turan slow-motioned ninja'd me.
Problem solved, everyone! It's working perfectly now. Thank you again for all your help!
This thread is closed due to being indicated as solved. Make sure to report it next time, so we can see! If you need it reopened, you can report to us to let us know. Thank you!