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.

Random Battles by Event (RESOLVED)

I'm trying to make a random battle system using events. Here's a screenshot of what I was last using.

http://i442.photobucket.com/albums/qq144/tohsierb/RandomBattleEvent.jpg[/img]

I messed around with it a lot and this was one of three I was testing the last time I worked on it. I can't remember if this one worked the best or not. It does work (either this one or one of the other two), but my problem is that for everyone button press, the event looped several times even if the player only moved one step. If anyone can help, I only want it to do the check for battle once per step, either fixing what I have or something else from scratch. Thanks.
 
Here's the system I set up for the "random" part to determine encounters. The numbers used here are for example.
  X=1~50
  X is then added to Y
  Once Y is > 300 it does a battle

My problem is I'm not sure how to make this happen everytime the player takes a step. The event I made works, but instead of doing it once per step, it keeps doing it while the arrow keys are pressed. I just need to know how to make this happen whent he player takes a step and only when they take a step. If I can get that, I can figure the rest out myself.
 
I tried that.  I started the event with this:
  RandomX = Player's Map X
  RandomY = Player's Map Y
Then a conditional branch for pressing up, down, left, or right.
  RandomX2 = Player's Map X (or Y depending on the direction.
  RandomX != RandomX2 then...
and that's where I put in my system. But it was setting the variables too fast and it was happening before the player had moved. The variables were always equal and never different. When I first tried it I accidently set RandomX and RandomY both to Player's Map X. Battles happened when the player moved up or down but not left or right because the RandomY(Player's Map x) never equalled RandomY2(Player's Map Y). Is there another way to use the map coordinates and variables to check if the player has taken a step?
 
One reason is to make rare monsters. Since the battle is started with an event you can set switches and stuff after battle depending on winning, losing, or running away. So you could make a really tough monster you didn't have to win against and could come back later to find him or make a monster that you could only fight once and after winning it would trigger a switch and you would never see that particular monster again.

Another reason, you could also make an accessory or something that would reduce chances of fighting and/or remove random encounters entirely. I know there is the Change Encounter option but that only disables it while this has the possibility of just redusing it.

There was another that I forgot, but the main reason was the rare encounter anyways.
 

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