Create two global variables; one labeled "encounter" that is set to a random number from 100-150 and one labeled "movement" with an initial value of zero. Then for every movement of the character on the overworld add to the movement variable based upon the type of terrain encountered (-2 for grassland, -5 for swamp, -3 for hills, etc...). Then create a compare two variables statement that if the movement variable is greater than or equal to the encounter variable go to random battle. Then be sure reset the movement variable back to zero.