RPG Maker VX Ace

RPG Maker VX Ace

View Stats:
Pujii Aug 3, 2013 @ 12:03am
Special condition for battle escape
I have multiple npc events moving randomly around the area that trigger a direct battle with battle processing when the player comes into contact. The battle is inescapable, unless the player uses a specific item to escape, and if so, I want the npc to walk away and "leave" the area completely.

I set the item properties to allow escape but how can I setup the after escape effect (preferably without scripts)? There's only win/lose conditions when escape is disabled.

As a semi-related question, how can I allow escape after a certain number of turns have passed?

***All solved***
Last edited by Pujii; Aug 10, 2013 @ 1:04pm
< >
Showing 1-8 of 8 comments
Kii Aug 3, 2013 @ 12:59am 
setup a battle processing event and in the "If Escape" function of the battle processing just put in "Set Move Route..." the way you want it to move away then just do Erase Event right after it and it will just remove the event, you could also use switches to get rid of it completely.
Pujii Aug 3, 2013 @ 12:06pm 
But I don't want the player to be able to escape normally, only if they use the item that they have to find in the area.
kzadur Aug 3, 2013 @ 11:11pm 
I assume your battle is somewhat designed without a chance to win? Than I would just add the "Set move Route ..." after "Battle Processing". Once the battle is over (no matter how) it will process the stuff after the battle. So you can start the battle without escape being allowed. Your item will still work as intended.

Now let's assume you leave it open for the PC to defeat those NPC. To check if the PC used the item to escape I tried using a counter. I added as an effect to count the uses of the item. Therefor I am just calling a "Common Event" as item effect (preferably before the escape effect).

The common event just adds to the counter variable +1. Now you can check the state before the battle and save it to another variable. And after the battle you can check if it changed. If it did, that means the player used it to escape the battle, if not the player won. Now you can handle the win or escape behavior, since your checking it with a conditional comparing the saved state of the counter and the actual value of the counter.
Last edited by kzadur; Aug 3, 2013 @ 11:12pm
Pujii Aug 4, 2013 @ 11:43am 
K, sounds good. The battle is somewhat difficult but winnable. Should I add the counter check in the win/lose conditions or after the battle processing event? Thanks!
Last edited by Pujii; Aug 4, 2013 @ 11:46am
kzadur Aug 6, 2013 @ 6:41am 
I would put it just behind the battle processing event. Unless you need the loose-condition (instead of going Game Over).

So it would look like that:
1.) Save the state of the variable
2.) Do the battle, without win/loose, without escape option
3.) Compare the new value and the stored variable
Pujii Aug 8, 2013 @ 10:05pm 
Thank you. Any help on this: how to allow escape only after a certain number of turns have passed?
kzadur Aug 10, 2013 @ 2:42am 
I tried a few easy things, but didn't found a good way, unless you just want to give an escape item in turn X or force abort the battle.

But I searched a bit and found that small script: http://forums.rpgmakerweb.com/index.php?/topic/14976-how-to-make-battles-unescapable/?p=151139

1.) Just put it in a free space below "Materials" in the scripts. Name it what you want to.
2.) The event on the map has to have "Can Escape" enabled.
3.) In the "Troop Window" on turn 0 execute the script $Can_Escape = false
4.) Make a new page and on turn 5 execute the script $Can_Escape = true

Now what's happening:
At the end of turn 0 (= start of battle) escape gets deactivated (the new script just removes the option to escape). At the end of turn 5 (= starting with round 6) the "Escape" command becomes visible and selectible. If escape is possible you can use it, if you forgot to make escape possible it will be grayed out.
Last edited by kzadur; Aug 10, 2013 @ 2:43am
Pujii Aug 10, 2013 @ 1:04pm 
Excellent, thanks again!
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: Aug 3, 2013 @ 12:03am
Posts: 8