How to Create Dynamic Trees in MV

Guardinthena

Artist
Veteran
Joined
Nov 30, 2013
Messages
189
Reaction score
279
First Language
English
Primarily Uses
RMVXA
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]
 

Dreadshadow

Lv 38 Tech Magician
Moderator
Joined
Mar 2, 2014
Messages
3,879
Reaction score
2,518
First Language
Greek
Primarily Uses
RMMV
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
189
Reaction score
279
First Language
English
Primarily Uses
RMVXA
@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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Damian Floyd increased the grand prize for the Driftwood Jam to a $75 steam GC!!! Thank you Damion! :)
Is everybody using their imagination?
5th Annual Driftwood Jam! $25 Steam gift card grand prize :D https://itch.io/jam/5adj
The character designer for my game is using my character for her class work lol :smile:
Why the frick frack snick snack is Pokemon Black & White so expensive now?! $99 on Amazon? $9999 ON EBAY!? WHAT?!

Forum statistics

Threads
94,419
Messages
920,819
Members
124,215
Latest member
Psychose
Top