Guardinthena

Artist
Veteran
Joined
Nov 30, 2013
Messages
475
Reaction score
1,215
First Language
English
Primarily Uses
RMMV
Hello wonderful community! I would first like to start off by saying that I am not sure if this is the right forum to put this in. The Maker Specific does not have a section for MV...and this is learning javascript, I guess...so if it is in the wrong section please correct it!

Well, so what I am looking for is how to create an event that identifies when a player character is standing behind it and when the player is, then to make the event do something else. In this case, I'm wanting a solid tree(s) to turn transparent when the player walks behind them and then turn back when they are not.

I found a youtube video that already does this shown in the link below, but is there a simpler way to go about it? It feels..clunky, compared to when I asked this same question for VXAce. The solution I got for this there was cleaner.

https://forums.rpgmakerweb.com/index.php?threads/how-to-create-dynamic-trees.101767/

Youtube video:
[\Spoiler]
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,088
Reaction score
2,681
First Language
Greek
Primarily Uses
RMMZ
What if told you, you can do this only with Eventing?
You shall make the event get the X and Y position of the hero.
If they stand at the SPECIFIC tile you want to make things happen, you can do that by creating a Conditional Branch inside another Conditional Branch.

Thus you set one Variable to be equal to the X position.
You set another Variable to be equal to the Y position.

Then

Conditional Branch: Variable for X is equal to the value you wanna check
. Conditional Branch: Variable for Y is equal to the value you wanna check
Erase the Event
. End
End

You might need one or two Events to contain the tree graphics for that. ;)
In case you erase them it is over. Just set them same level as character to block their path.

https://www.dropbox.com/s/cewe7i26cbi9ddp/SetXpos.png?dl=0

For my example the tree was just above the tile with [X,Y] = [20,12]
Thus if you use Action button from tile 20,12 then you erase the event.

◆Control Variables:#0001 ForX = Map ID
◆Control Variables:#0002 ForY = Map Y of Player
◆If:ForX = 20
◆If:ForY = 12
◆Erase Event

:End

:End


The problem is that the second event tile graphic for the tree won't be erased.
Thus instead of erasing the event you can do a Control Switch and set a switch on.
Thus you can make blank Event pages for both events that will trigger when this Switch will turn on. In that way, setting the switch on will make BOTH events override the first Event page to their second one, which will be set blank and below character, so the player can pass.

Edit:
For bigger tree, you have to deal with the passability in a creative way.
If you use an EVENT to add a whole tree, you need to add several transparent events to handle passability and erase them as you erase the original one, the way i mentioned above. Using a Switch to override their first Event page to a Second blank.
 
Last edited:

Guardinthena

Artist
Veteran
Joined
Nov 30, 2013
Messages
475
Reaction score
1,215
First Language
English
Primarily Uses
RMMV
@Dreadshadow - Thank you for the tutorial tip! I don't think erasing the event will work will it? I would like the trees to be transparent when you walk behind them and solid again when your not and for that to continue. Wouldn't erasing the event make it a one time deal? That aside, I don't know why I didn't think of just using switches before! I guess I was just stuck thinking it had to be scripted to find the PC's location, where the tree was on a single event and that event was running in a parallel process to check for PC's location. I did this in VX Ace, and had the horrible issue of it lagging the whole map down because of how many trees I had. Even setting it to only check every 6 secs. It was tedious to set that all up and was dreading running into the same problems again in MV. Seriously, the simplicity has me shaking my head. I only issue would be flooding my village maps with lots of blank events, but I can live with that vs. having lag on the map again! So, once again, thank you!

@Shaz - Oh! Thank you Shaz! I feel very silly for missing that. It was late at night when I wrote up the request, more asleep than awake. Thank you for pointing that out for any future MV request I'll need.
 

Latest Threads

Latest Posts

Latest Profile Posts

Guess I had to do something related to xmas... :kaoswt2:
SWZtrkz.jpg
"16. Do NOT contact other members by private message, on the forum or status feed, inviting them to put additional tools (such as leaderboards, ads, etc - whether yours or another person's) into their game."
Oh no. Necessity is the mother of invention. Do I want to know what happened?
Early WIP for my next entry. Since it's early you're going to need to wait a little longer than usual. What's that? You'll find out in my next update!
12.PNG
20 festive cards can now be unlocked in BiteMe!

The cards are permanent, but can only be unlocked in December!
Once the year is over, you won't be able to unlock the cards, or to upgrade it.
https://johndoenews.itch.io/biteme-storymodeCard141-160-Ad.png

Forum statistics

Threads
117,183
Messages
1,105,258
Members
153,311
Latest member
Seafarer
Top