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.

An 'easy' enemy encounter definer

I have been looking around for an easy enemy encounter definer and I can't find one I understand. I found one on here but my mind went totally blank. I just don't understand. I found one on Phylomortis too. I couldn't understand that one either.

This feature is in RPG Maker 2k, 2k3, and VX. It is to have a certain group of monsters be in that area of the map. Like in Final Fantasy, on the world map, you didn't have goblins always attacking you in the same part of the world map.

In other words: It's to define a area on a map to have defined monster encounters. In FFV you had Goblins around Tule. But in Karnak, you had those dog things... you know.

So, is there an actually easy enemy encounter definer or am I not in luck?

Thanks anyone!
 

poccil

Sponsor

Use this code.  Put it in a new script section just before the last one.  Look at DEFINEDENCOUNTERS
at the top to learn how to customize it.

Code:
class Game_Map
####################
 DEFINEDENCOUNTERS=[
   # Map ID, Left Edge, Top Edge, Right Edge, Bottom Edge, Troop IDs
   [1,0,0,10,10,[2,3,4,5]],
   [1,10,0,20,10,[2,3,4,5]]
 ]
####################
 def encounter_list
  if $game_player
   for enc in DEFINEDENCOUNTERS
    if enc[0]==self.map_id &&
       $game_player.x>=enc[1] && $game_player.x<enc[3] &&
       $game_player.y>=enc[2] && $game_player.y<enc[4]
     return enc[5]
    end
   end
  end
  return @map.encounter_list
 end
end
 

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