HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

RPG / Random Battles Trigger

04-08-2009, 04:39 AM#1
Sgt_Johnson
I'm working on a new RPG project that in the end will be similar to the old RPG map Final Fantasy Forever, it will have a world map and such and party gameplay, along with random battles. However there are certain things I cannot figure out how the maker of FFF pulled off, so as the random battles. Does anyone happen to know how that is done?
04-08-2009, 02:53 PM#2
TEC_Ghost
There's alot of different ways you could go about it.

1.For every second the players unit is moving decrease an integer by a random value till it hits 0, when it does cue random battle.

2.Have a timer going and everytime it hit's 0 do a GetRandomInt() and if it's within a certain range cue random battle.

Etc Etc
04-10-2009, 06:12 AM#3
Ignitedstar
From GameFAQs, the people were crazy enough to find out how exactly encounters in Final Fantasy III/IV worked.

Quote:
Originally Posted by http://www.gamefaqs.com/console/snes/file/554041/13573
***********************
2.3 Random Encounters
***********************

The game keeps a counter that increases each time you take a step. Walking on
the overworld map adds 192 to the counter for each step taken; walking in
caves, towns, etc. where monsters can be encountered adds 112 to the counter
for each step. Each step, a random number is picked from 0 to 255; if this
number is less than (counter / 256 ) then a fight occurs. When a random
encounter occurs, the counter is reset to 0. If the lead party member has a
Charm Bangle equipped, then the number added is cut in half. If Mog has the
Moogle Charm equipped, then the counter is not increased, and there is no
chance of random encounters.

... I tried looking at other games for their equations, but I guess they're all the same since I can't find them...
04-10-2009, 06:50 AM#4
Blackroot
Yeah; use a counter which tracks steps and divide by an abstract number (which will be your %/counter)

Or you could just roll a random number per step and see if it's above X; but this method is harder to controll.
04-10-2009, 12:19 PM#5
Sgt_Johnson
How exactly do you track steps via a trigger, I can't seem to figure it out in any way, I'll see if theres any systems on the site, I couldn't find any on other sites and WC3C has been down so I couldn't check here.
04-10-2009, 12:29 PM#6
Vexorian
Quote:
use a counter which tracks steps
04-10-2009, 12:42 PM#7
Sgt_Johnson
Quote:
Originally Posted by Vexorian
use a counter which tracks steps

I have no clue where to find one, or how to make one myself, that's why I was asking ><
04-10-2009, 12:48 PM#8
Tide-Arc Ephemera
Make a timer that goes off every X or so and set a location and set the previous location to a temporary variable. Compare the distance between current and previous location, and you have a step/length, just filter out zeroes.

I can't think of any other real way to be honest.
04-10-2009, 12:50 PM#9
Sgt_Johnson
Quote:
Originally Posted by Tide-Arc Ephemera
Make a timer that goes off every X or so and set a location and set the previous location to a temporary variable. Compare the distance between current and previous location, and you have a step/length, just filter out zeroes.

I can't think of any other real way to be honest.

Guess I'll experiment today and try and figure it out, thanks.
04-13-2009, 04:43 AM#10
TEC_Ghost
Just store the unit's X and Y, have a timer that checks every so often, if the units current X or Y is different then the stored you know he moved.
04-13-2009, 05:35 AM#11
Feroc1ty
Set a random number to be the random battle number, than calculate how far they go until they reach the number, than do the battle and set another random number, and reset their walked distance.