RMMV (Chrono Engine) make bushes drop hearts and gold like they do in Zelda Games

CyrusVisser

Villager
Member
Joined
Jun 18, 2021
Messages
12
Reaction score
0
First Language
english
Primarily Uses
RMMV
I'm trying to make it where bushes drop either a heart or 1 gold or nothing but randomly like they do in Links Awakening. I've been playing around in the event editor trying to do this but i cant seem to find an option that allows for randomness, but maybe im missing something. Or there is maybe a way to do this with like a plugin or script. If anyone knows how to achieve this please let me know.
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
848
Reaction score
707
First Language
English
Primarily Uses
RMMV
For randomness, use a conditional branch with a script call. In javascript Math.random() will generate a random number between 0 and 1.

So do something like

Conditional Branch: Math.random < 0.1 //Decide if anything will drop
Inner Conditional Branch: Math.random < 0.5 with an ELSE block //okay we know something is dropping, figure out what it is
>Give Heart
ELSE>give money



I'd recommend using an event cloner plugin for those grass tiles, since that way if you want to change something, you only have to change one instance of the grass event to update all of them. It will save a TON of time if you want to tweak things later.
 

CyrusVisser

Villager
Member
Joined
Jun 18, 2021
Messages
12
Reaction score
0
First Language
english
Primarily Uses
RMMV
For randomness, use a conditional branch with a script call. In javascript Math.random() will generate a random number between 0 and 1.

So do something like

Conditional Branch: Math.random < 0.1 //Decide if anything will drop
Inner Conditional Branch: Math.random < 0.5 with an ELSE block //okay we know something is dropping, figure out what it is
>Give Heart
ELSE>give money



I'd recommend using an event cloner plugin for those grass tiles, since that way if you want to change something, you only have to change one instance of the grass event to update all of them. It will save a TON of time if you want to tweak things later.
Im using that script and its always doing the else option on the conditional branch even when i set it to 1. I also tried it on a separate event to make sure the bushes had nothing to do with it and it still didn't work; any ideas why this might be happening?
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
848
Reaction score
707
First Language
English
Primarily Uses
RMMV
Math.random is a function, make sure you're calling it instead of referencing it

so use
Code:
Math.random()>0.1
or whatever
 

Latest Threads

Latest Profile Posts

Playing Aroma Indosiar theme song.
Aroma is an Indonesian TV show about cooking. :)
Working on a characteeer! (Why is it so hard to color hair?) ;-;
Silly-Sketches.png
Just finished eventing a couple simple puzzles in RMMV, for my very first game "Sample Quest." Just messing around, throwing things together, and calling it a story XD On a non-RM note, got my hair cut today!
I feel the need to inform everyone on the forums NOT to go with Web Hosting Canada for your hosting needs. It is by far the worst customer service and just overall experience I have ever had with hosting and I am Canadian...
BCj
Got another eye surgery monday. Hope I'll recover quick and all's well. A bit tired of surgeries. On a happy note, working on the next chapter of Escalia so hope I can continue soon :)

Forum statistics

Threads
115,372
Messages
1,089,344
Members
150,065
Latest member
Ariel240gamer
Top