Chaos Project

RPG Maker => General Discussion => Troubleshooting / Help => Topic started by: Vince Crowe on December 20, 2009, 01:56:13 am

Title: [Request RPG Maker XP] Tracking battle victories from random encounters
Post by: Vince Crowe on December 20, 2009, 01:56:13 am
Ok. In my current RPG maker project, I'm trying to set up a trigger that will detect how many battles you've encountered (victories only). Once x amount of victories have occurred, a Mercenary Unit will leave your party... provided that unit is present. Any ideas on how to do0 this without really doing any scripting? If scripting is needed, I'll need a rundown on how to set it up. I don't know how to work with any coding language.

Keep in mind, I want my game to be able to track random encounter victories in addition to any other battles encountered.
Title: Re: [Request RPG Maker XP] Tracking battle victories from random encounters
Post by: Holyrapid on December 20, 2009, 04:53:48 am
Well, without scripting, you could do this with a simple common event. First, make a variable, lets call it Enemies Dead. Now, go to your database, and to your troops, and make events to them, that check if the enemy is dead, and when it´s dead, it adds one to the variable (raises it by one). Then make a conditional branch that tracks the deaths. When it´s x, use the change party members command, and remove the mercinary. I´ll put a pic up soon.
Title: Re: [Request RPG Maker XP] Tracking battle victories from random encounters
Post by: fugibo on December 20, 2009, 03:26:48 pm
In other words, yeah, a script would be a few billion times easier.
Title: Re: [Request RPG Maker XP] Tracking battle victories from random encounters
Post by: legacyblade on August 01, 2010, 03:14:45 am
Here's a script that'll increase a variable every time you win a battle. With that, eventing the mercenary unit leaving after a certain amount of victories is no problem

module LBConf
  WIN_VARIABLE = 1
end

class Scene_Battle
  alias battle_end_win_tracker_LB battle_end
  def battle_end(result)
    $game_variables[LBConf::WIN_VARIABLE] += 1 if result == 0
    battle_end_win_tracker_LB(result)
  end
end


Change WIN_VARIABLE near the top of the script to set which variable the wins are stored to.

Hope that helps.