The trigger.onStep is a pretty new thing, you might want this version of Verge for now (save this into a folder over your old verge.exe): http://www.bananattack.com/stuff/verge.exe
Anyhow, to use it, give it the name of a function, and it'll be called on every step.
The function would look something like this.
int steps;
void PlayerStep()
{
// Increases step counter by 1 on every step
steps++;
}
So in autoexec or one of your scripts, do something like this and it'll call that function whenever you take a step:
trigger.onStep = "PlayerStep";
If you wanted a poison function, assuming you declare some sort of player hp stats in your code, you can do something like this, maybe (adjust this as needed, it's just the general idea)
void PlayerStep()
{
// Increases step counter by 1 on every step
steps++;
// Lose hp every step if you have more than 1 health.
if(player.poison && player.hp > 1)
{
player.hp--;
PlaySound(poison_sound_effect, 100);
DoNiftyPoisonVisualEffectForAShortPeriodOfTime();
}
}
If you want a super fancy poison effect that doesn't interrupt movement, you'll probably also need to use HookRetrace so you can move while the damage effects are going on.
Does that at least get you started on the right path?
EDIT:
And stuff like random encounter stuff, would be something like a random number you generate, and it decreases. When it hits zero, it triggers battle, and rerandomizes the step countdown after battle.
int battle_countdown = Random(8, 16);
void PlayerStep()
{
battle_countdown--;
if(battle_countdown == 0)
{
battle_countdown = Random(8, 16);
RandomBattle();
}
}
Just the general idea, with a random 8-16 steps between each fight (that'd be too annoying for most games unless it's copying FF4 or something :D).