Zoom & Camera for skills

Hi everyone !

I have a question for you.
I have some nice Zoom and Camera movement for some of my skills. but I want theim to have a 20% Chance to be activate.
So 80% of the time the camera doesn't move and 20% of the time the camera will make some action.

So I imagine something like a dice or something but I don't have any knowledge in JS to write a correct code :

....
Wait : 20


var dice = random between 1 and 5
If dice > 4
then

zoom: 200%
else nothing

motion thrust: user
Etc...


I'm not sure if I'm clear enough.

Can anyone could show me the correct form to accomplish what i'm trying to do ?

Thanks a lot and have a great Making !
Plugin Support is for when you want help to get a plugin working the way you want. This doesn't seem to be a problem with a plugin.

I am therefore separating this out into its own thread and putting it in MV Support.
I assume you're using Yanfly's action sequenes. How about calling a common event for the RNG and simply use the if statements in the action sequence to carry it out?
I assume you're using Yanfly's action sequenes. How about calling a common event for the RNG and simply use the if statements in the action sequence to carry it out?

Hey. I'm not confortable with english. How would you do that ?
Hey. I'm not confortable with english. How would you do that ?
Type "common event:" and its number in the sequence. It's run right there and then the sequence continues.

Vibrato has a few video tutorials on uses of YF's action sequences, this one is about things with the if statements:
Probably just like this (not tested, but should be roughly what you want)

if Math.random() < 0.2
zoom: 200%
end
Ah great ! Both solutions work perfectly !

Thanks a lot !

Original thread: https://forums.rpgmakerweb.com/threads/zoom-camera-for-skills.106727/