I'm having a bit of a problem with this one. So, thanks to Tsukhime, I was about to use a script to run commands after a battle end in victory, as well as in defeat (with 'continue Even When Loser' mode on).
I am wondering if it's possible to run an event after the battle is aborted, before returning me to the overworld, or if I can turn escaped into defeated, to run the same event/script for a defeated condition.
You can't do that in the default engine, you'd have to modify it with scripts to run an event before it exits the battle.
Figured as much. Getting this battle system to work is becoming a huge headache, and I couldn't find any script that is something like it...
Just go to BattleManager, to where it says def self.process_abort (line 235), and shove in a reserve_common_event script call.
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.
Can you please add a link to the script you're using?
Thanks for that Shaz.
So I'm taking a look at Battlemanager, for the escape process.
#--------------------------------------------------------------------------
# * Escape Processing
#--------------------------------------------------------------------------
def self.process_escape
$game_message.add(sprintf(Vocab::EscapeStart, $game_party.name))
success = @preemptive ? true : (rand < @escape_ratio)
Sound.play_escape
if success
(How to call a common event here)
else
@escape_ratio += 0.1
$game_message.add('\.' + Vocab::EscapeFailure)
$game_party.clear_actions
end
wait_for_message
return success
end
I found the location I need to edit, but I don't know the correct script language to make it work. In the (How to call a common event here), i need to tell the game to run a common event (in my case, it is Id = 6). I've tried $data_common_events = 6 but all it does it freeze, so im doing it wrong lol. (Don't really know much about scripting but simple editable things)
I am writing a script for escape events but there are some issues I am running into.
I was going to add it to the post-battle events but then realized there are many different types of escapes...
It would not be a trivial task to add post-escape event processing before you return to the map scene because the battle scene does not check for events anymore, which means common events won't run.
Which means simply reserving a common event would have it run outside of battle, not in battle.
That's for defeat though. Are you sure that's what you want? (cause the same event would run when you lose the battle)
Yes. I am considering 'escape' as 'defeat' they both serve the same purpose for this style of combat. Basically, 'not winning'. Since there is no game over in my game, whether you lose or escape, you will return to back to the map and lose a bit of currency. What I needed to accomplish is that Actor 1, returns to the party after the fight is 'over' but before it returns me back to the overworld. He/She is removed at the beginning of the fight, because I want the minion actors to do the fighting, not the human actor. (Sort of like Pokemon if you will. [Although pokemon sends you back to the pokemon center >__> but that's a different point XD])
As long as it's doing what you want it to do, I'll mark this as resolved. If, with further testing, you realize it's NOT working as you need it to, just report the post and we'll reopen.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.