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

I'm making Toilet in Wonderland 2. and tell vinny about it lol
WE ARE THE BORG. YOUR BIOLOGICAL AND TECHNOLOGICAL DISTINCTIVENESS WILL BE ADDED TO OUR OWN. RESISTANCE IS FUTILE.
D2R save files are so broken. how was the beta test better then the full release. blizzard's last hope crashed and burned.
they're getting no more chances from me.
Anyone going to talk about Chris Pratt Mario?

Forum statistics

Threads
115,336
Messages
1,089,103
Members
150,007
Latest member
Jay_
Top