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
706
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
706
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 Posts

Latest Profile Posts

Holy cow, I have made Row Formation work again with OTB!

Now, my devious machinations can finally be born...
finished the second chapter of deltarune today, I gotta say that the 3 years wait was worth it lol
Happy Friday, y'all! I just got home from work and am sitting down with a nice cider, and I'm ready to chill and enjoy myself. Not sure if I'm gonna dive into any of my game-related projects or not tonight.... we'll see how I feel after unwinding for a bit I guess!

Forum statistics

Threads
115,147
Messages
1,087,627
Members
149,675
Latest member
ElektroHaexe
Top