Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

really stupid question

Hey Guys,
I just recently got myself back into RMXP and I just started working on a project

long story short..I'm terrible with events (haven't even looked at them in almost 2 years)
and I need to know how to automatically start random flashes of lightning...its only on an intro map, so it will probably be
event based
 
nonono I know how to do it once....but I want it to do it at random intervals

you know...
lightning strike
wait x seconds
strike
wait xx seconds and such

except I don't want it at set intervals...something using a random variable I thinkg
 
Code:
@>Control Variables: [0002: D100] = Random No. (0..100)
@>Conditional Branch: Variable [0002: D100] == 1
   @>Screen Flash: (255,255,255,255), @2
   @>Play SE: '123-Thunder01', 80, 100
   @>
   : Branch End
@>Conditional Branch: Variable [0002: D100] == 2
   @>Screen Flash: (255,255,255,255), @2
   @>Play SE: '124-Thunder02', 80, 100
   @>
   : Branch End
@>Conditional Branch: Variable [0002: D100] == 3
   @>Screen Flash: (255,255,255,255), @2
   @>Play SE: '125-Thunder03', 80, 100
   @>
   : Branch End
@>

This should create a lightning strike 3 times per 100 frames (5 seconds), on average.
Using 3 different sound effects to mix it up a bit.
Change the '100' to increase or decrease the frequency.
change the Screen Flash parameters to get a different flash with each SE.

Have fun
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top