New account registration is temporarily disabled.

[RMVX ACE] ESCAPE SKILL WOES

Posts

Pages: 1
Had a friend playtest my current abomination, and he pointed out a severe glitch.

If a party member is dead, and another ion the second slot uses a skill with the special flag "escape", the game counts it as a defeat. It bypasses the special game over I made, even, going straight to the default game over screen.

Is there a way to fix this?
Interesting... can we see an image of the skill in question?
I make a quick default project to test this with a similar escape skill and a fight against an enemy that kills one character and couldn't reproduce any issue with the escape skill. My guess is a script you're using broke the escape skill.

My suggestion is to try and find what script is causing the issue. You can move the 'Main' script that starts the game above all the extra scripts in your game so it'll only load the default scripts then test to try and recreate the error. If it works then move the main script down some which will make the game load some of your extra scripts until you can find what script you're adding causes the error to occur.
I should note I'm using yanfly's scripts... does that mean anything?

I opened a fresh, new game. Had the first hero killed off. the second one uses flee.

GAME OVER.

Fat the Whuck?
Nah, I fucked up and overlooked the scope of your screenshot skill. Looks like when the scope is All Allies you get the Game Over bug like you're experiencing. I set mine to All Enemies and it worked by making the player win the fight. It's kinda awkward since you can 'win' fights that aren't marked as escapable.
So, what we have is a problem with the fundamental base code. Anyone have any bright ideas on how to circumvent this? Would an abort battle page work?

Plan C, as it were, is to make the flee skill inflict a status on the user, and then have a page check for the moment said status exists. If it does, abort battle.
Marrend
Guardian of the Description Thread
21806
From the looks of things, states cannot activate switches. However, why not just have the escape skill activate a switch via a common event? You'd still need the condition in the troop-tab that checks the switch is active, and aborts the battle when it is. I would also think that the special game over you've got would also check to see if that switch is active.

*Edit: I dunno what plans you have for this skill, but, it might behoove you to ensure that the switch in question deactivates after every battle that players aren't getting the special game over.

*Edit2: I'm... pretty sure this would work!
...well, crap.

Okay, so the solution that works so far is making a call event skill that aborts the battle.

Working on copying the end result of the escape battle command and trying to put that in the special effect slot.
I hacked together a quick script so using an escape skill does a somewhat more correct thing. A skill set to Escape and targets an actor makes the party run away from battle without resulting in a game over if somebody is dead. The skill is also disabled if escape isn't enabled for that fight. I don't know what the intended usage of targeting enemies to escape is so I just ignored it.

Demo project download link, I only tested against the default scripts. The blue slime is inescapable, the green slime is. The slime itself will kill one party member each turn.

class Game_Actor < Game_Battler
  
  # Override the original Battler escape method for actors.
  # We'll just tell the battle to end via the BattleScene instead of
  # the original fuckery that would cause GAME OVERS
  def escape
    # Don't process escapes if we aren't in battle or if the battle
    # we're in isn't escapable
    return if not $game_party.in_battle or not BattleManager.can_escape?
    # Tell the battle manager to end the battle via retreat
    BattleManager.force_escape
  end
  
  # Check to see if a skill is an escape skill. If it is then its only valid
  # occasion is in battle and when escaping is enabled. Otherwise it is disabled
  alias :occasion_ok_escapefix :occasion_ok? unless $@
  def occasion_ok?(item)
    result = occasion_ok_escapefix(item)
        
    if item.effects.any? { |effect| 
      effect.code == EFFECT_SPECIAL and effect.data_id == SPECIAL_EFFECT_ESCAPE }
      return result && $game_party.in_battle && BattleManager.can_escape?
    end
    
    return result
  end
  
end


module BattleManager
  # Add a method that forces a successful retreat by changing the escape ratio
  # before attempt an escape that should alway succeed
  def self.force_escape
    @escape_ratio = 1
    process_escape
  end
end
author=GreatRedSpirit
I don't know what the intended usage of targeting enemies to escape is so I just ignored it.


Maybe for making skills that scare enemies away? That'd be my best guess.
Currently that's what it does, the target of an Escape skill is responsible for handling the escape flag logic. If the scope is set to none then even an escape skill won't do shit since there's no target to handle that flag (if I wasn't doing a quick hack I'd move this so the battle itself handles the flag but that's effort). With my code it requires an actor to be targeted by the escape skill so Single/All Allies/User is needed. Targeting an enemy will just do the old code which my first attempt had 'worked' since the enemy itself was removed from battle (sets their Hidden flag to true which counts against being alive but also not dead). There's no check or anything against this so any target enemy escape skill will work 100% of the time against anything.

It's really half baked. I can see CrazyRob's frustration with it.


e: Don't thank me until you try it out yourself, I can miss dumb shit as much as enterbrain can!
The fact someone cared enough to try and fix this issue instead of shrugging and offering a workaround is more than enough.

Also.

It works. It works perfectly.

Credit will, of course, be given.
Workarounds are the devil's lettuce!


Glad it works though, no credit is necessary or anything but appreciated. I'm surprised this was an issue in 2016 when Ace came out ages ago, I figured somebody would've found and fixed it way back (but I've also found a bug last year in the event interpretor of every RM since 2k). I should probably submit this as a script so the other people that makes an escape skill can find it!
Pages: 1