Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

GTBS v1.5.1.4 - A FFT Styled Battle System (5/19/2010)

Amos36":1a19s8ap said:
GubiD - problem occured! When getting enemies to move, they can only move using the "else" bit. e.g - I am using soldier. Soldier is set up individually to move 3, but the default makes it move 5. Also I still can't get the different monsters to attack differently.

It would also be nice to see the name of the spell appearing at the top of the screen in textbox.

Please answer our prayers GubiD and save us! :angel:

I actually just fixed this recently. I can't remember EXACTLY what I did, but open up the GTBS Game_Enemy script. There should be a section that says "def weapon_range" and "def move_range." You want to change the sections in parentheses to look like this:

Code:
  def weapon_range

    return GTBS.m_range(self.enemy_id)

  end

  

  def base_move_range

    return GTBS::enemy_move(self.enemy_id)

  end

I THINK that's all I did to fix it.
 
Is it possible that someone could write up an easy step-by-step tutorial on what to do to make battles and make the game progress? I've been reading the help file, and am pretty much at a loss with what to do.

If there is already something written up, a simple reply or PM to me would suffice. This is an amazing piece of work, and I would like to play around with a few game ideas of mine to see what I can do for fun.

Thanks in advance.
 

Rya

Member

I actually had like no lag when using this. I've tested it and found no bugs. Wonderful script, just what I've been waiting for. I also like the summon system you incorporated. I hope to see this updated when you get a chance. Fantastic job.
 
Wow, this is an awesome script, I'm having great fun with this. Just one thing, I activated the remove body bit of the script. As in, if someone dies, they disappear from the battlefield.

But when I revive them, they're invisible, and I don't know why. Do you know how to fix this?
Oh, I'm using the VX version, if it helps.
 
Hello. I need help with a serious problem with Gubid's TBS.

In a sentence: When the player is placing their characters before the battle, if they hit Return too many times it loads the whole sprite sheet into the game.

In detail: We are using a setup that allows the user to place their characters before battle. This is what happens in game.

Steps to Reproduce:
1. Battle starts. The enemies are visible on the battlefield, as are a number of blue tiles (these are the allowed placement squares that we have set up on the battle map).
2. The user uses the cursor to highlight and hits Return on the different blue squares to place their party members in their desired formation.

(Now... once all party members are placed, if the user hits ESC, they get a confirmation 'Done placing characters?' and if they say Yes, no problem, everything works fine :) But...

3. IF the user places their last character and keeps hitting Return...

Result:
On the first extra hit of Return, the placement square beneath the character turns purple. On hitting Return again, the character's sprite sheet (yup, the whole thing!) loads into the battle, and battle begins. Everything works fine, except that the character is represented by his entire sprite sheet, instead of just the appropriate frame of animation at a given time.

Has anyone else ever had this and if so, solved it? Or if there are any gurus out there that would like to take a stab at it please PM me and I will be happy to supply whatever you need as far as our specific setup and configuration etc.

Thanks! This is one of the last few major bugs we need to solve before releasing our demo. It is a scifi story set in the last city left on earth, and is called City of Hope. We are very excited about sharing it with you all soon.
 
odinel":31rdh89z said:
Hello Gubid, long time no see

i just wanna ask if its able to do double team attack in GTBS.

if the two allies are attacking the same enemy

can u make a double team attack ?

This might not be exactly what you are looking for, but you might get a long way toward what you want by making a Skill that calls a common event that does 'Force Action' on you and your buddy. Then you could flip it around and give the Skill to both people, so that either one could trigger it. You should be able to make a special attack that can only be done when both people are present in this fashion.

Me and my teammate just discovered that the 'Force Action' workaround to some of GubiD's TBS limitations last night and it is HOT! It lets us do so much stuff in the battles that we used to think was just impossible. There are even some Common Events that we can't make Gubid's TBS do in battle, but we can make skills that Force Action ourselves to use the skill that calls the Common Event and it works! Great way to call your Common Events into mid-battle.

Anyways, it sounds like it (might) help you out. Try it and see where it gets you.
 
Hi, I'm reporting a bug (which may have already been fixed, I'm not sure, but I just downloaded the script, so I doubt it) with the GubiD tbs. In TEAM battle mode, if you move an actor and then exit out of the menu by pressing escape, then select the actor again, the move option still exists. My solution was to add the and clause !@active_battler.moved to the if statement on line 1960 of -Scene_Battle_TBS- (the conditions for disposing the window due to pressing the escape button), but this forces you to take an action immediately after moving the actor. Does anyone have a more elaborate solution? I did my best, but I've never used Ruby before.
 

CJF

Member

I'm using GuiD's system. I transfered all the files over to my game as instructed. Now, however, whenever your party is on the battle field an effect of a swirling wind is played over them whenever it isn't your turn and they flash purple. I've no idea why.

Any ideas?

FIXED: I forgot to call the script: $scene = Scene_Config.new
 

CJF

Member

What Switches/Variables does the TBS use? I used the 14th Switch and it caused there to be swirling winds played over the party members during combat. When I stopped using the 14th Switch, the swirls disappeared. So I'm wondering if the system uses any other Switches/Variables that I should avoid?

Thanks.
 
I downloaded this demo last night and tried it out. It is an excellent recreation of FFT. However, it does not appear to demonstrate many of the features listed in the readme file.

In particular, I am interested in seeing how the summoning system works. How would I go about enabling these additional features in the demo?
 
i read the first 9 pages and gave up is there a way to make a shop window happen during battle i've tryed with no luck, als is there a way to stop an actor from moving or attacking only skills?

also one last thing can you equiped stuff during battle

also how do you change scroll speed

thanks
ps : script rocks!
 

Wydrah

Member

I tried searching the topic, but I haven't found any relevant results, so I'm just going to ask: Has the wait bug been fixed? I think I posted about it over a year ago. I downloaded the demo and it's still in there, but maybe someone found a fix and the demo wasn't updated?

For those who don't know what I'm talking about:
If you move a character and the press escape, you can move the character again. Basically every character has infinite range.
 
Greetings,
I've looked in the first couple of pages and the last couple of pages and I haven't seen this question posted. Sorry if it has (there are 42 pages). I was wondering if it is possible to have more than 4 actors battle at once, similar to the ZTBS where actor1 refers to the database actors, not the actors in your group. Thanks in advance!

EDIT: I can add actors, neutral ones that is, but I cannot seem to make the be able to controllable. I think I need to change something but I'm not sure what

EDIT2: Figured this out. I'll post what I did so someone else can do the same.
1. Go to -Scene_Battle_TBS-
2. Go to line 359
3. change actor.neutral = true to actor.neutral = false

This will change all your neutrals to be controllable, not run by AI.
 
Hello, i have a probleme to use this script + add on from MGCaladtogel

I'm sorry but i don't read all 42 pages carrefully.
So I dl demo on page 1 and it seams Gubid use an old version of -Game_Map_Iso- from MGCaladtogel

MGCaladtogel make 2 add on for his iso script with :

- pixel move instead of square move
- 8 directions
- platform (jump / fall , platform in movment)
- hero can run

I'm french and i'm very interested about Gubid script but i need MGC platform with it
If i add additionnaly script from MGC (as demo below) to Gubid script, my hero pass trought all in the map :
So this is the code from MGC, he has posted on my forum and the link to download the platform demo (script iso + add on)

Thanks to give me some infos to mix : "MGC add on" + "Gubid script"
I hope this demo will interest some makers

http://www.megaupload.com/?d=AYHE6DJJ

screen :
platformMGC.jpg


Script to put under -Game_Map_Iso-
#---------------------------------------------------------------------------------------------------------------
# ● Script 2D_ISO Add-On 2, créé par MGCaladtogel pour la communauté rpgmakerxp-factory.net
# Maj 16/08/06
#---------------------------------------------------------------------------------------------------------------
#==============================================================================
# ■ Ajouts, modifications des classes d'origine
#
# indications : ce script doit être placé en-dessous du script 2D_ISO et remplace
#   l'Add-On 1.
#    Les éléments ajoutés sont ceux de l'Add-On 1 plus la gestion des plates-formes
#   mobiles telles que décrites dans le script "Plates-Formes" dans sa seconde version,
#   script et démo disponibles sur le forum communautaire.
# The Factory : http://rpgmakerxp-factory.net/forum/ind ... ic=10787.0
#==============================================================================
 
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title
  alias main_origine main
  def main
    ######Vous pouvez changer les valeurs suivantes######
    # Elles correspondent aux numéros d'interrupteurs réquisitionnés par le script
    $num_interrupteur_courir = 1
    $num_interrupteur_sauter = 2
    $num_interrupteur_8directions = 3
    $num_interrupteur_vide = 4
    $num_var_x_sure = 1
    $num_var_y_sure = 2
    $num_vide = 1 # numéro de terrain définissant le vide dans la gestion des chipsets
    ######Fin de vous pouvez changer les valeurs######
    $liste_events_tombes = []
    $data_events_tombes = []
    main_origine
    $game_switches[$num_interrupteur_courir.to_i] = true
    $game_switches[$num_interrupteur_sauter.to_i] = true
    $game_switches[$num_interrupteur_8directions.to_i] = true
  end
end
 
#==============================================================================
# ■ Game_Character
#==============================================================================
class Game_Character
  attr_accessor :end_press
  attr_accessor :diagonal
  attr_accessor :surPF
  attr_accessor :numPF
  attr_accessor :x_sol
  attr_accessor :y_sol
  #--------------------------------------------------------------------------
  alias initialize_orig initialize
  def initialize
    initialize_orig
    @x = 0.0
    @y = 0.0
    @real_x = 0.0
    @real_y = 0.0
    @end_press = false
    @diagonal = false
    @surPF = false
    @numPF = 0
    @x_sol = 0.0
    @y_sol = 0.0
  end
  #--------------------------------------------------------------------------
  def check_surPF(x, y)
    i = 0
    for event in $game_map.events.values
      m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
      n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
      if x.between?(m - 0.500, m + 0.500) and y.between?(n - 0.500, n + 0.500) and
        event.est_PF? and !event.est_Decor
        @surPF = true
        i = event.id
      end
    end
    if i == 0
      @surPF = false
    end
    return i
  end
  #--------------------------------------------------------------------------
  def check_surPF_int(x, y)
    for event in $game_map.events.values
      m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
      n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
      if x.between?(m - 0.500, m + 0.500) and y.between?(n - 0.500, n + 0.500) and
        event.est_PF? and !event.est_Decor
        return true
      end
    end
    return false
  end
  #--------------------------------------------------------------------------
  def check_vide(x, y)
    return false if !check_vide_terrain((x+0.700).to_i, (y+0.700).to_i)
    return false if !check_vide_terrain((x+0.250).to_i, (y+0.700).to_i)
    return false if !check_vide_terrain((x+0.700).to_i, (y+0.250).to_i)
    return false if !check_vide_terrain((x+0.250).to_i, (y+0.250).to_i)
    return true
  end
  #--------------------------------------------------------------------------
  def check_vide_terrain(x, y)
    if $game_map.terrain_tag(x, y) == $num_vide
       return true
    end
    return false
  end
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    unless $game_map.valid?(new_x, new_y)
      return false
    end
    if @through
      return true
    end
    unless $game_map.passable?(x, y, d, self)
      return false
    end
    unless $game_map.passable?(new_x, new_y, 10 - d)
      return false
    end
    return false if check_vide_terrain(new_x, new_y)
    for event in $game_map.events.values
      if event.x == new_x and event.y == new_y
        unless event.through
          if self != $game_player
            return false
          end
          if event.character_name != ""
            return false
          end
        end
      end
    end
    if Math.sqrt((new_x-$game_player.x)**2 + (new_y-$game_player.y)**2) < 0.7
      unless $game_player.through
        if @character_name != ""
          return false
        end
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  def screen_y
    y = (@real_y + @real_x) / 8 + 22 - $game_map.display_y/4
    if self.is_a?(Game_Event)
      y += (self.est_PF? ? 10 : 0)
    end
    if @jump_count >= @jump_peak
      n = @jump_count - @jump_peak
    else
      n = @jump_peak - @jump_count
    end
    return y - (@jump_peak * @jump_peak - n * n) / 2
  end
end
 
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
  attr_accessor :map
  #--------------------------------------------------------------------------
  def passable_p?(x, y, d, self_event = nil)
    unless valid?(x, y)
      return false
    end
    bit = (1 << (d / 2 - 1)) & 0x0f
    for event in events.values
      m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
      n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
      if event.tile_id >= 0 and event != self_event and
        (m == x) and (n == y) and not event.through
        if @passages[event.tile_id] & bit != 0
          return false
        elsif @passages[event.tile_id] & 0x0f == 0x0f
          return false
        elsif @priorities[event.tile_id] == 0
          return true
        end
      end
    end
    for i in [2, 1, 0]
      tile_id = data[x, y, i]
      if tile_id == nil
        return false
      elsif @passages[tile_id] & bit != 0
        return false
      elsif @passages[tile_id] & 0x0f == 0x0f
        return false
      elsif @priorities[tile_id] == 0
        return true
      end
    end
    return true
  end
end
 
#==============================================================================
# ■ Game_Event
#==============================================================================
class Game_Event < Game_Character
  attr_accessor :temps_pause
  attr_accessor :liste_x
  attr_accessor :liste_y
  attr_accessor :liste_p
  attr_accessor :nom
  attr_accessor :num_phase
  attr_accessor :phase_en_cours
  attr_accessor :x_cible
  attr_accessor :y_cible
  attr_accessor :cmpt_temps
  attr_accessor :PF_active
  attr_accessor :PF_desactivee
  attr_accessor :etape_simple
  attr_accessor :aller_simple
  attr_accessor :num_dest_aller_simple
  attr_accessor :boucle_simple
  attr_accessor :tombe
  attr_accessor :immobile
  attr_accessor :apparait
  attr_accessor :phase_tombe
  attr_accessor :move_speed_tombe
  attr_accessor :est_Decor
  attr_accessor :cmpt_temps_tombe
  attr_accessor :data
  attr_accessor :au_dessus
  #--------------------------------------------------------------------------
  def initialize(map_id, event)
    super()
    @map_id = map_id
    @event = event
    @id = @event.id
    @erased = false
    @starting = false
    @through = true
    @nom = $game_map.map.events[@event.id].name
    moveto(@event.x, @event.y)
    refresh
    @temps_pause = 0
    @cmpt_temps = 0
    @liste_x = []
    @liste_y = []
    @liste_p = []
    @num_phase = 0
    @phase_en_cours = false
    @x_cible = 0
    @y_cible = 0
    @est_Decor = Decor?
    @tombe = false
    @immobile = false
    @apparait = false
    @au_dessus = false
    if est_PF?
      initialize_PF
    end
    if @apparait
      @opacity = 0
      @est_Decor = true
    end
    @temps_pause = @liste_p[1]
    @PF_active = false
    @PF_desactivee = false
    @phase_tombe = false
    @move_speed_tombe = 8
    @cmpt_temps_tombe = 0
  end
  #--------------------------------------------------------------------------
  def est_PF?
    return nom.include?("+PF")
  end
  #--------------------------------------------------------------------------
  def Decor?
    return (est_PF? & nom.include?("Decor"))
  end
  #--------------------------------------------------------------------------
  def initialize_PF
    for i in 0..$liste_events_tombes.length
      if @id == $liste_events_tombes
        @event.pages[0].move_route.list  = $data_events_tombes
      end
    end
    @etape_simple = false
    @aller_simple = false
    @num_dest_aller_simple = 0
    @boucle_simple = false
    pt_pass = true
    index = 0
    while index <= @move_route.list.size - 1
      command = @move_route.list[index]
      if @liste_p.size == 0 and @liste_x.size == 1
        @liste_p.push(0)
      end
      if command.code == 0 or (command.code >= 16 and command.code != 45)
        index += 1
      end
      if command.code == 15
        @liste_p.push(command.parameters[0] * 2 - 1)
        pt_pass = false
        index += 1
      end
      if command.code == 45
        if command.parameters[0].include?("Vitesse")
          @move_speed = command.parameters[0].split[1].to_i
          index += 1
        end
        if command.parameters[0].include?("Etapes")
          @etape_simple = true
          index += 1
        end
        if command.parameters[0].include?("Aller simple")
          @aller_simple = true
          index += 1
        end
        if command.parameters[0].include?("Boucle")
          @boucle_simple = true
          index += 1
        end
        if command.parameters[0].include?("Arrivée")
          @num_dest_aller_simple = @liste_x.size
          index += 1
        end
        if command.parameters[0].include?("Tombe")
          @tombe = true
          index += 1
        end
        if command.parameters[0].include?("Immobile")
          @immobile = true
          index += 1
        end
        if command.parameters[0].include?("Apparait")
          @apparait = true
          index += 1
        end
        if command.parameters[0].include?("Dessus")
          @au_dessus = true
          index += 1
        end
      end
      if pt_pass and @liste_x.size != 0
        @liste_p.push(0)
        pt_pass = false
      end
      if command.code <= 14
        m = 0
        n = 0
        case command.code
        when 1
          while command.code == 1
            n += 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        when 2
          while command.code == 2
            m -= 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        when 3
          while command.code == 3
            m += 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        when 4
          while command.code == 4
            n -= 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        when 5
          while command.code == 5
            m -= 1
            n += 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        when 6
          while command.code == 6
            m += 1
            n += 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        when 7
          while command.code == 7
            m -= 1
            n -= 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        when 8
          while command.code == 8
            m += 1
            n -= 1
            index += 1
            command = @move_route.list[index]
          end
          @liste_x.push(m)
          @liste_y.push(n)
          pt_pass = true
        end
      end
    end
    @data = @event.pages[0].move_route.list
    @event.pages[0].move_route.list = [RPG::EventCommand.new]
    if !@immobile
      tot = 0
      for nb in @liste_x
        tot = tot + nb
      end
      @liste_x.push(-tot)
      tot = 0
      for nb in @liste_y
        tot = tot + nb
      end
      @liste_y.push(-tot)
    end
  end
  #--------------------------------------------------------------------------
  def refresh
    new_page = nil
    unless @erased
      for page in @event.pages.reverse
        c = page.condition
        if c.switch1_valid and !est_PF?
          if $game_switches[c.switch1_id] == false
            next
          end
        end
        if c.switch2_valid and !est_PF?
          if $game_switches[c.switch2_id] == false
            next
          end
        end
        if c.variable_valid and !est_PF?
          if $game_variables[c.variable_id] < c.variable_value
            next
          end
        end
        if c.self_switch_valid and !est_PF?
          key = [@map_id, @event.id, c.self_switch_ch]
          if $game_self_switches[key] != true
            next
          end
        end
        new_page = page
        break
      end
    end
    if new_page == @page
      return
    end
    @page = new_page
    clear_starting
    if @page == nil
      @tile_id = 0
      @character_name = ""
      @character_hue = 0
      @move_type = 0
      @through = true
      @trigger = nil
      @list = nil
      @interpreter = nil
      return
    end
    @tile_id = @page.graphic.tile_id
    @character_name = @page.graphic.character_name
    @character_hue = @page.graphic.character_hue
    if @original_direction != @page.graphic.direction
      @direction = @page.graphic.direction
      @original_direction = @direction
      @prelock_direction = 0
    end
    if @original_pattern != @page.graphic.pattern
      @pattern = @page.graphic.pattern
      @original_pattern = @pattern
    end
    @opacity = @page.graphic.opacity
    @blend_type = @page.graphic.blend_type
    @move_type = @page.move_type
    if !est_PF?
      @move_speed = @page.move_speed
    end
    @move_frequency = @page.move_frequency
    @move_route = @page.move_route
    @move_route_index = 0
    @move_route_forcing = false
    @walk_anime = @page.walk_anime
    @step_anime = @page.step_anime
    @direction_fix = @page.direction_fix
    @through = @page.through
    @always_on_top = @page.always_on_top
    @trigger = @page.trigger
    @list = @page.list
    @interpreter = nil
    if @trigger == 4
      @interpreter = Interpreter.new
    end
    check_event_trigger_auto
  end
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  def check_event_trigger_touch(x, y)
    if $game_system.map_interpreter.running?
      return
    end
    if @trigger == 2 and Math.sqrt((x-$game_player.x)**2 + (y-$game_player.y)**2) < 0.7
      if not jumping? and not over_trigger?
        start
      end
    end
  end
  #--------------------------------------------------------------------------
  def check_event_trigger_auto
    m = ((((((@real_x).to_f)/128)*8).to_i).to_f)/8
    n = ((((((@real_y).to_f)/128)*8).to_i).to_f)/8
    x = $game_player.x
    y = $game_player.y
    if @trigger == 2 and Math.sqrt((m-x)**2 + (n-y)**2) < 0.7
      if not jumping? and over_trigger?
        start
      end
    end
    if @trigger == 3
      start
    end
  end
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  alias update_orig update
  def update
    unless @erased
      update_orig
      if est_PF?
        @PF_active = check_active_PF
        if @apparait
          if @PF_active
          @opacity = 255
          @est_Decor = false
          else
            @opacity = 0
            @est_Decor = true
          end
        end
        if @PF_active
          @PF_desactivee = false
        end
        if @phase_tombe
          if @temps_pause != 0 and @cmpt_temps != @temps_pause
            @cmpt_temps += 1
          else
            @phase_tombe = true
            @move_speed = @move_speed_tombe
            @est_Decor = true
            @y_cible = @y_cible+0.5
            @y += 0.5
            @x_cible = @x_cible+0.5
            @x += 0.5
            @cmpt_temps_tombe += 1
            @opacity -= 64
            if @cmpt_temps_tombe == 4
              desactiver_PF
              @cmpt_temps = 0
              @cmpt_temps_tombe = 0
              @phase_tombe = false
              $liste_events_tombes.push(@id)
              $data_events_tombes.push(@data)
              self.erase
            end
          end
        end
        if @liste_x.size == 0 and !@phase_tombe and @PF_active
          @x_cible = @x
          @y_cible = @y
          if @liste_p[0] != 0
            @temps_pause = @liste_p[0]
          end
          @phase_tombe = true if @tombe
        end
        if @liste_x != [] and !@phase_en_cours and @PF_active and !@phase_tombe
            @x_cible = @x + @liste_x[@num_phase]
            @y_cible = @y + @liste_y[@num_phase]
            @x += @liste_x[@num_phase]
            @y += @liste_y[@num_phase]
            @phase_en_cours = true
        end
        if !@phase_tombe
          if @liste_x != [] and @x_cible*128 == @real_x and @y_cible*128 == @real_y and
            (@PF_active or !@PF_desactivee)
            if @temps_pause != 0 and @cmpt_temps != @temps_pause
              @cmpt_temps += 1
            else
              @phase_en_cours = false
              @cmpt_temps = 0
              @phase_tombe = true if (@tombe and @num_phase == @liste_x.length-2)
              @num_phase += 1
              @num_phase = 0 if @num_phase == @liste_x.length
              @temps_pause = @liste_p[0]
              @temps_pause = @liste_p[@num_phase+1]  if @num_phase < (@liste_x.length) - 1
              if @etape_simple
                desactiver_PF
                @PF_active = false
                @PF_desactivee = true
              end
              if @aller_simple and (@num_phase == @num_dest_aller_simple or @num_phase == 0)
                desactiver_PF
                @PF_active = false
                @PF_desactivee = true
              end
              if @boucle_simple and @num_phase == 0
                desactiver_PF
                @PF_active = false
                @PF_desactivee = true
              end
              if !@PF_active and !@PF_desactivee
                @PF_desactivee = true
              end
            end
          end
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  def screen_z(height = 0)
    z = super()
    z += (est_PF? ? ((@est_Decor or @phase_tombe) ? 0 : 32) : 0)
    return z
  end
  #--------------------------------------------------------------------------
  def check_active_PF
    unless @erased
      page = @event.pages[0]
      c = page.condition
      if c.switch1_valid
        if $game_switches[c.switch1_id] == false
          return false
        end
      end
      if c.switch2_valid
        if $game_switches[c.switch2_id] == false
          return false
        end
      end
      if c.variable_valid
        if $game_variables[c.variable_id] < c.variable_value
          return false
        end
      end
      if c.self_switch_valid
        key = [@map_id, @event.id, c.self_switch_ch]
        if $game_self_switches[key] != true
          return false
        end
      end
      return true
    end
  end
  #--------------------------------------------------------------------------  
  def desactiver_PF
    unless @erased
      page = @event.pages[0]
      c = page.condition
      if c.switch1_valid
        if $game_switches[c.switch1_id]
          $game_switches[c.switch1_id] = false
        end
      end
      if c.switch2_valid
        if $game_switches[c.switch2_id]
          $game_switches[c.switch2_id] = false
        end
      end
      if c.variable_valid
        if $game_variables[c.variable_id] >= c.variable_value
          $game_variables[c.variable_id] = 0
        end
      end
      if c.self_switch_valid
        key = [@map_id, @event.id, c.self_switch_ch]
        if $game_self_switches[key]
            $game_self_switches[key] = false
        end
      end
    end
  end
end
 
#==============================================================================
# ■ Game_Player
#==============================================================================
class Game_Player < Game_Character
  attr_accessor :course
  attr_accessor :x
  attr_accessor :y
  attr_accessor :eek:pacity
  attr_accessor :tjs_dessus
  attr_accessor :bloqué_down
  attr_accessor :bloqué_left
  attr_accessor :bloqué_right
  attr_accessor :bloqué_up
  attr_accessor :saut_PF
  attr_accessor :au_dessus
  #--------------------------------------------------------------------------
  def initialize
    super
    self.course = false
    self.tjs_dessus = true
    self.bloqué_down = false
    self.bloqué_left = false
    self.bloqué_right = false
    self.bloqué_up = false
    self.saut_PF = false
    self.au_dessus = false
  end
  #--------------------------------------------------------------------------
  def mode_course
    self.course = true
  end
  #--------------------------------------------------------------------------
  def mode_marche
    self.course = false
  end
  #--------------------------------------------------------------------------
  def check_event_trigger_here_ISOaddon1(triggers)
    result = false
    if $game_system.map_interpreter.running?
      return result
    end
    for event in $game_map.events.values
      m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
      n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
      if Math.sqrt((m-self.x)**2 + (n-self.y)**2) < 0.7 and triggers.include?(event.trigger)
        if not event.jumping? and event.over_trigger?
          if !self.tjs_dessus or triggers.include?(0)
            event.start
          end
          result = true
          self.tjs_dessus = true
        end
      end
    end
    self.tjs_dessus = false if !result
    return result
  end
  #--------------------------------------------------------------------------
  def check_event_trigger_there_ISOaddon1(triggers)
    result = false
    if $game_system.map_interpreter.running?
      return result
    end
    new_x = @x + (@direction == 6 ? 0.7 : @direction == 4 ? -0.7 : 0)
    new_y = @y + (@direction == 2 ? 0.7 : @direction == 8 ? -0.7 : 0)
    for event in $game_map.events.values
      m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
      n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
      if Math.sqrt((m-new_x)**2 + (n-new_y)**2) < 0.5 and triggers.include?(event.trigger)
        if not event.jumping? and not event.over_trigger?
          event.start
          result = true
        end
      end
    end
    if result == false
      if $game_map.counter?(new_x, new_y)
        new_x += (@direction == 6 ? 0.7 : @direction == 4 ? -0.7 : 0)
        new_y += (@direction == 2 ? 0.7 : @direction == 8 ? -0.7 : 0)
        for event in $game_map.events.values
          m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
          n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
          if Math.sqrt((m-new_x)**2 + (n-new_y)**2) < 0.5 and triggers.include?(event.trigger)
            if not event.jumping? and not event.over_trigger?
              event.start
              result = true
            end
          end
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  def check_event_trigger_touch_ISOaddon1(x, y)
    result = false
    if $game_system.map_interpreter.running?
      return result
    end
    for event in $game_map.events.values
      m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
      n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
      if Math.sqrt((m-x)**2 + (n-y)**2) < 0.7 and [1,2].include?(event.trigger)
        if not event.jumping? and not event.over_trigger?
          event.start
          result = true
        end
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  def update
    last_real_x = @real_x
    last_real_y = @real_y
    if !$game_switches[$num_interrupteur_vide.to_i]
      @move_speed = (@course ? 6 : 4)
    end
    @numPF= check_surPF(@x,@y)
    @au_dessus = false if !@surPF
    if @surPF and $game_map.events[@numPF].PF_active and (!jumping? or @saut_PF)
      @au_dessus = ($game_map.events[@numPF].au_dessus ? true : false)
      distance = 2 ** $game_map.events[@numPF].move_speed
      distance_x = @real_x - $game_map.events[@numPF].real_x
      distance_y = @real_y - $game_map.events[@numPF].real_y
      if $game_map.events[@numPF].y_cible * 128  + distance_y > @real_y
        @real_y = [@real_y + distance, $game_map.events[@numPF].y_cible * 128+distance_y].min
        @y = [(@y + distance.to_f/128), $game_map.events[@numPF].y_cible+distance_y.to_f/128].min
      end
      if $game_map.events[@numPF].x_cible * 128 + distance_x < @real_x
        @real_x = [@real_x - distance, $game_map.events[@numPF].x_cible * 128+distance_x].max
        @x = [(@x - distance.to_f/128), $game_map.events[@numPF].x_cible+distance_x.to_f/128].max
      end
      if $game_map.events[@numPF].x_cible* 128 + distance_x > @real_x
        @real_x = [@real_x + distance, $game_map.events[@numPF].x_cible* 128+distance_x].min
        @x = [(@x + distance.to_f/128), $game_map.events[@numPF].x_cible+distance_x.to_f/128].min
      end
      if $game_map.events[@numPF].y_cible * 128 + distance_y < @real_y
        @real_y = [@real_y - distance, $game_map.events[@numPF].y_cible * 128+distance_y].max
        @y = [(@y - distance.to_f/128), $game_map.events[@numPF].y_cible+distance_y.to_f/128].max
      end
    else
      if !@surPF and !check_vide((((8*@x).to_i).to_f)/8,(((8*@y).to_i).to_f)/8) and !jumping?
      @x_sol = @x
      @y_sol = @y
      end
      if check_vide((((8*@x).to_i).to_f)/8,(((8*@y).to_i).to_f)/8) and !@surPF and !jumping?
        @diagonal = false
        $game_switches[$num_interrupteur_vide.to_i] = true
        @move_speed = 5
        $game_variables[$num_var_x_sure.to_i] = @x_sol
        $game_variables[$num_var_y_sure.to_i] = @y_sol
      end
    end
    last_moving = moving?
    unless moving? or jumping? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      if $game_switches[$num_interrupteur_8directions.to_i]
        case Input.dir8
        when 2
          move_down_ISOaddon1
          bloqué_down?
        when 4
          move_left_ISOaddon1
          bloqué_left?
        when 6
          move_right_ISOaddon1
          bloqué_right?
        when 8
          move_up_ISOaddon1
          bloqué_up?
        when 1
          move_lower_left_ISOaddon1
        when 3
          move_lower_right_ISOaddon1
        when 7
          move_upper_left_ISOaddon1
        when 9
          move_upper_right_ISOaddon1
        end
      else
        case Input.dir8
        when 1..2
          move_down_ISOaddon1
          bloqué_down?
        when 3
          move_right_ISOaddon1
          bloqué_right?
        when 4
          move_left_ISOaddon1
          bloqué_left?
        when 7
          move_left_ISOaddon1
          bloqué_left?
        when 6
          move_right_ISOaddon1
          bloqué_right?
        when 8..9
          move_up_ISOaddon1
          bloqué_up?
        end
      end
    end
    if jumping?
      update_jump_ISOaddon1
    elsif moving?
      update_move
    else
      update_stop
      @x = (((8*@x).to_i).to_f)/8 if !@surPF
      @y = (((8*@y).to_i).to_f)/8 if !@surPF
    end
    if @anime_count > 18 - @move_speed * 2
      if not @step_anime and @stop_count > 0
        @pattern = @original_pattern
      else
        @pattern = (@pattern + 1) % 4
      end
      @anime_count = 0
    end
    if @wait_count > 0
      @wait_count -= 1
      return
    end
    if @move_route_forcing
      move_type_custom
      return
    end
    if @starting or lock?
      return
    end
    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
      case @move_type
      when 1
        move_type_random
      when 2
        move_type_toward_player
      when 3
        move_type_custom
      end
    end
    disp_y = screen_y + $game_map.display_y/4
    disp_x = screen_x + $game_map.display_x/4
    if CENTER_Y - (4*disp_y - $game_map.display_y) < 0
      $game_map.scroll_down(4*disp_y - $game_map.display_y - CENTER_Y)
    end
    if CENTER_X - (4*disp_x - $game_map.display_x) > 0
      $game_map.scroll_left(CENTER_X - (4*disp_x - $game_map.display_x))
    end
    if CENTER_X - (4*disp_x - $game_map.display_x) < 0
      $game_map.scroll_right(4*disp_x - $game_map.display_x - CENTER_X)
    end
    if CENTER_Y - (4*disp_y - $game_map.display_y) > 0
      $game_map.scroll_up(CENTER_Y - (4*disp_y - $game_map.display_y))
    end
    unless moving?
      if last_moving
        result = check_event_trigger_here_ISOaddon1([1,2])
        if result == false
          unless $DEBUG and Input.press?(Input::CTRL)
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      if Input.trigger?(Input::C)
        check_event_trigger_here_ISOaddon1([0])
        check_event_trigger_there_ISOaddon1([0,1,2])
      end
    end
  end
  #--------------------------------------------------------------------------
  def move_down_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = false
    if @direction == 2 and passable?(@x, @y, 2, a, c_d) and event_pass?(@x, @y, 2, a, c_d)
      turn_down
      @y += a/8
      increase_steps
      self.bloqué_down = false
    else
      check_event_trigger_touch_ISOaddon1(@x, @y+1)
      self.bloqué_down = true if @direction == 2 and event_pass?(@x, @y, 2, a, c_d)
    end
    if turn_enabled and @direction != 2
      turn_down
      self.bloqué_down = false if passable?(@x, @y, 2, a, c_d)
    end
  end
  #--------------------------------------------------------------------------
  def move_left_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = false
    if @direction == 4 and passable?(@x, @y, 4, a, c_d) and event_pass?(@x, @y, 4, a, c_d)
      turn_left
      @x -= a/8
      increase_steps
      self.bloqué_left = false
    else
      check_event_trigger_touch_ISOaddon1(@x-1, @y)
      self.bloqué_left = true if @direction == 4 and event_pass?(@x, @y, 4, a, c_d)
    end
    if turn_enabled and @direction != 4
      turn_left
      self.bloqué_left = false if passable?(@x, @y, 4, a, c_d)
    end
  end
  #--------------------------------------------------------------------------
  def move_right_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = false
    if @direction == 6 and passable?(@x, @y, 6, a, c_d) and event_pass?(@x, @y, 6, a, c_d)
      turn_right
      @x += a/8
      increase_steps
      self.bloqué_right = false
    else
      check_event_trigger_touch_ISOaddon1(@x+1, @y)
      self.bloqué_right = true if @direction == 6 and event_pass?(@x, @y, 6, a, c_d)
    end
    if turn_enabled and @direction != 6
      turn_right
      self.bloqué_right = false if passable?(@x, @y, 6, a, c_d)
    end
  end
  #--------------------------------------------------------------------------
  def move_up_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = false
    if @direction == 8 and passable?(@x, @y, 8, a, c_d) and event_pass?(@x, @y, 8, a, c_d)
      turn_up
      @y -= a/8
      increase_steps
      self.bloqué_up = false
    else
      check_event_trigger_touch_ISOaddon1(@x, @y-1)
      self.bloqué_up = true if @direction == 8 and event_pass?(@x, @y, 8, a, c_d)
    end
    if turn_enabled and @direction != 8
      turn_up
      self.bloqué_up = false if passable?(@x, @y, 8, a, c_d)
    end
  end
  #--------------------------------------------------------------------------
  def move_lower_left_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = true
    if @direction == 2 and passable?(@x, @y, 2, a, c_d) and event_pass?(@x, @y, 2, a, c_d)
      turn_lower_left
      @y += a/(8*Math.sqrt(2))
      @x -= a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x-1, @y+1)
    end
    if turn_enabled and @direction != 2
      turn_lower_left
    end
  end
  #--------------------------------------------------------------------------
  def move_lower_right_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = true
    if @direction == 6 and passable?(@x, @y, 6, a, c_d) and event_pass?(@x, @y, 6, a, c_d)
      turn_lower_right
      @y += a/(8*Math.sqrt(2))
      @x += a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x+1, @y+1)
    end
    if turn_enabled and @direction != 6
      turn_lower_right
    end
  end
  #--------------------------------------------------------------------------
  def move_upper_left_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = true
    if @direction == 4 and passable?(@x, @y, 4, a, c_d) and event_pass?(@x, @y, 4, a, c_d)
      turn_upper_left
      @y -= a/(8*Math.sqrt(2))
      @x -= a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x-1, @y-1)
    end
    if turn_enabled and @direction != 4
      turn_upper_left
    end
  end
  #--------------------------------------------------------------------------
  def move_upper_right_ISOaddon1(turn_enabled = true)
    a = (@course ? 1.5 : 1.0)
    c_d = true
    if @direction == 8 and passable?(@x, @y, 8, a, c_d) and event_pass?(@x, @y, 8, a, c_d)
      turn_upper_right
      @y -= a/(8*Math.sqrt(2))
      @x += a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x+1, @y-1)
    end
    if turn_enabled and @direction != 8
      turn_upper_right
    end
  end
  #--------------------------------------------------------------------------
  def turn_down
    unless @direction_fix
      @diagonal = false
      @direction = 2
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def turn_left
    unless @direction_fix
      @diagonal = false
      @direction = 4
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def turn_right
    unless @direction_fix
      @diagonal = false
      @direction = 6
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def turn_up
    unless @direction_fix
      @diagonal = false
      @direction = 8
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def turn_lower_left
    unless @direction_fix
      @diagonal = true
      @direction = 2
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def turn_lower_right
    unless @direction_fix
      @diagonal = true
      @direction = 6
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def turn_upper_left
    unless @direction_fix
      @diagonal = true
      @direction = 4
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def turn_upper_right
    unless @direction_fix
      @diagonal = true
      @direction = 8
      @stop_count = 0
    end
  end
  #--------------------------------------------------------------------------
  def jump_ISOaddon1(x,y)
    @end_press = false
    @jump_peak = 3
    @jump_count = @jump_peak * 2
    @stop_count = 0
  end
  #--------------------------------------------------------------------------
  def update_jump_ISOaddon1
    @end_press = true if !Input.press?(Input::A)
    if Input.press?(Input::A) and !@end_press and @jump_peak != 8
      @jump_peak += 1
      @jump_count += 2
    end
    a = (@course ? 1.2 : 0.8)
    if $game_switches[$num_interrupteur_8directions.to_i]
      case Input.dir8
      when 1
        update_jump_lower_left
      when 2
        update_jump_down
      when 3
        update_jump_lower_right
      when 4
        update_jump_left
      when 6
        update_jump_right
      when 7
        update_jump_upper_left
      when 8
        update_jump_up
      when 9
        update_jump_upper_right
      end
    else
      case Input.dir8
      when 1..2
        update_jump_down
      when 3
        update_jump_right
      when 4
        update_jump_left
      when 6
        update_jump_right
      when 7
        update_jump_left
      when 8..9
        update_jump_up
      end
    end
    @jump_count -= 1
    if @jump_count == 0
      @x = (((8*@x).to_i).to_f)/8
      @y = (((8*@y).to_i).to_f)/8
    end
    @real_x = @x * 128
    @real_y = @y * 128
  end
  #--------------------------------------------------------------------------
  def update_jump_down(turn_enabled = true)
    if turn_enabled
      turn_down
    end
    a = (@course ? 1.2 : 0.8)
    c_d = false
    if passable?(@x, @y, 2, a, c_d) and event_pass?(@x, @y, 2, a, c_d)
      turn_down
      @y += a/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x, @y+1)
    end
  end
  #--------------------------------------------------------------------------
  def update_jump_left(turn_enabled = true)
    if turn_enabled
      turn_left
    end
    a = (@course ? 1.2 : 0.8)
    c_d = false
    if passable?(@x, @y, 4, a, c_d) and event_pass?(@x, @y, 4, a, c_d)
      turn_left
      @x -= a/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x, @y+1)
    end
  end
  #--------------------------------------------------------------------------
  def update_jump_right(turn_enabled = true)
    if turn_enabled
      turn_right
    end
    a = (@course ? 1.2 : 0.8)
    c_d = false
    if passable?(@x, @y, 6, a, c_d) and event_pass?(@x, @y, 6, a, c_d)
      turn_right
      @x += a/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x, @y+1)
    end
  end
  #--------------------------------------------------------------------------
  def update_jump_up(turn_enabled = true)
    if turn_enabled
      turn_up
    end
    a = (@course ? 1.2 : 0.8)
    c_d = false
    if passable?(@x, @y, 8, a, c_d) and event_pass?(@x, @y, 8, a, c_d)
      turn_up
      @y -= a/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x, @y+1)
    end
  end
  #--------------------------------------------------------------------------
  def update_jump_lower_left(turn_enabled = true)
    if turn_enabled
      turn_lower_left
    end
    a = (@course ? 1.2 : 0.8)
    c_d = true
    if passable?(@x, @y, 2, a, c_d) and event_pass?(@x, @y, 2, a, c_d)
      turn_lower_left
      @x -= a/(8*Math.sqrt(2))
      @y += a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x-1, @y+1)
    end
  end
  #--------------------------------------------------------------------------
  def update_jump_lower_right(turn_enabled = true)
    if turn_enabled
      turn_lower_right
    end
    a = (@course ? 1.2 : 0.8)
    c_d = true
    if passable?(@x, @y, 6, a, c_d) and event_pass?(@x, @y, 6, a, c_d)
      turn_lower_right
      @x += a/(8*Math.sqrt(2))
      @y += a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x+1, @y+1)
    end
  end
  #--------------------------------------------------------------------------
  def update_jump_upper_left(turn_enabled = true)
    if turn_enabled
      turn_upper_left
    end
    a = (@course ? 1.2 : 0.8)
    c_d = true
    if passable?(@x, @y, 4, a, c_d) and event_pass?(@x, @y, 4, a, c_d)
      turn_upper_left
      @x -= a/(8*Math.sqrt(2))
      @y -= a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x-1, @y-1)
    end
  end
  #--------------------------------------------------------------------------
  def update_jump_upper_right(turn_enabled = true)
    if turn_enabled
      turn_upper_right
    end
    a = (@course ? 1.2 : 0.8)
    c_d = true
    if passable?(@x, @y, 8, a, c_d) and event_pass?(@x, @y, 8, a, c_d)
      turn_upper_right
      @x += a/(8*Math.sqrt(2))
      @y -= a/(8*Math.sqrt(2))
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x+1, @y-1)
    end
  end
  #--------------------------------------------------------------------------
  def passable?(x, y, d, a = 1.0, c_d = false)
    if @through
      return true
    end
    if !c_d
      case d
      when 6
        new_x = (x + a/8 + 0.95).to_i
        new_y = y.to_i
        new_x_2 = new_x
        new_y_2 = (y + 0.95).to_i
      when 4
        return false if x - a/8 < 0
        new_x = (x - a/8).to_i
        new_y = y.to_i
        new_x_2 = new_x
        new_y_2 =  (y + 0.95).to_i
      when 2
        new_x = x.to_i
        new_y = (y + a/8 + 0.95).to_i
        new_x_2 =  (x + 0.95).to_i
        new_y_2 = new_y
      when 8
        return false if y - a/8 < 0
        new_x = x.to_i
        new_y = (y - a/8).to_i
        new_x_2 = (x + 0.95).to_i
        new_y_2 = new_y
      else
        new_x = (x+0.5).to_i
        new_y = (y+0.5).to_i
        new_x_2 = new_x
        new_y_2 = new_y
      end
    else
      case d
      when 6
        new_x = (x + a/(8*Math.sqrt(2)) + 0.95).to_i
        new_y = (y + a/(8*Math.sqrt(2)) + 0.95).to_i
        new_x_2 = (x + a/(8*Math.sqrt(2)) + 0.95).to_i
        new_y_2 = y.to_i
        new_x_3 = x.to_i
        new_y_3 = (y + a/(8*Math.sqrt(2)) + 0.95).to_i
        unless $game_map.passable_p?(new_x_3, new_y_3, d, self)
          return false
        end
      when 4
        return false if (x - a/(8*Math.sqrt(2)) < 0 or y - a/(8*Math.sqrt(2)) < 0)
        new_x = (x - a/(8*Math.sqrt(2))).to_i
        new_y = (y - a/(8*Math.sqrt(2))).to_i
        new_x_2 = (x - a/(8*Math.sqrt(2))).to_i
        new_y_2 = y.to_i
        new_x_3 = x.to_i
        new_y_3 = (y - a/(8*Math.sqrt(2))).to_i
        unless $game_map.passable_p?(new_x_3, new_y_3, d, self)
          return false
        end
      when 2
        return false if x - a/(8*Math.sqrt(2)) < 0
        new_x = (x - a/(8*Math.sqrt(2))).to_i
        new_y = (y + a/(8*Math.sqrt(2)) + 0.95).to_i
        new_x_2 = (x - a/(8*Math.sqrt(2))).to_i
        new_y_2 = y.to_i
        new_x_3 = x.to_i
        new_y_3 = (y + a/(8*Math.sqrt(2)) + 0.95).to_i
        unless $game_map.passable_p?(new_x_3, new_y_3, d, self)
          return false
        end
      when 8
        return false if y - a/(8*Math.sqrt(2)) < 0
        new_x = (x + a/(8*Math.sqrt(2)) + 0.95).to_i
        new_y = (y - a/(8*Math.sqrt(2))).to_i
        new_x_2 = (x + a/(8*Math.sqrt(2)) + 0.95).to_i
        new_y_2 = y.to_i
        new_x_3 = x.to_i
        new_y_3 = (y - a/(8*Math.sqrt(2))).to_i
        unless $game_map.passable_p?(new_x_3, new_y_3, d, self)
          return false
        end
      else
        new_x = (x+0.5).to_i
        new_y = (y+0.5).to_i
        new_x_2 = new_x
        new_y_2 = new_y
      end
    end
    unless $game_map.passable_p?(new_x, new_y, d, self)
      return false
    end
    unless $game_map.passable_p?(new_x_2, new_y_2, d, self)
      return false
    end
    return true
  end
  #--------------------------------------------------------------------------
  def event_pass?(x, y, d, a, c_d)
    if !c_d
      case d
      when 6
        new_x = x + a/8
        new_y = y
      when 4
        new_x = x - a/8
        new_y = y
      when 2
        new_y = y + a/8
        new_x = x
      when 8
        new_y = y - a/8
        new_x = x
      else
        new_x = x
        new_y = y
      end
    else
      case d
      when 6
        new_x = x + a/(8*Math.sqrt(2))
        new_y = y + a/(8*Math.sqrt(2))
      when 4
        new_x = x - a/(8*Math.sqrt(2))
        new_y = y - a/(8*Math.sqrt(2))
      when 2
        new_y = y + a/(8*Math.sqrt(2))
        new_x = x - a/(8*Math.sqrt(2))
      when 8
        new_y = y - a/(8*Math.sqrt(2))
        new_x = x + a/(8*Math.sqrt(2))
      else
        new_x = x
        new_y = y
      end
    end
    for event in $game_map.events.values
      m = ((((((event.real_x).to_f)/128)*8).to_i).to_f)/8
      n = ((((((event.real_y).to_f)/128)*8).to_i).to_f)/8
      if Math.sqrt((m-new_x)**2 + (n-new_y)**2) < 0.7
        unless event.through
          if self != $game_player
            return false
          end
          if event.character_name != ""
            return false
          end
        end
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  def screen_z(height = 0)
    if @always_on_top
      return 999
    end
    z = screen_y
    z += 32 if @surPF
    if @tile_id > 0
      return z + $game_map_iso.priorities[@tile_id] * 32
    else
      return z + ((height > 32) ? 31 : 0)
    end
  end
  #--------------------------------------------------------------------------
  def bloqué_down?
    if self.bloqué_down
      a = (@course ? 1.5 : 1.0)
      new_x = (self.x + 0.500).to_i
      new_y = (self.y + a/8 + 0.95).to_i
      if $game_map.passable_p?(new_x, new_y, @direction, self) and
        !$game_map.passable_p?((self.x).to_i, new_y, @direction, self)
        @direction = 6
        rect_right_ISOaddon1
      else
        new_x = (self.x + 0.495).to_i
        new_y = (self.y + a/8 + 0.95).to_i
        if $game_map.passable_p?((self.x).to_i, new_y, @direction, self) and
          $game_map.passable_p?(new_x, new_y, @direction, self)
          @direction = 4
          rect_left_ISOaddon1
        end
      end
      self.bloqué_down = true
    end
  end
  #--------------------------------------------------------------------------
  def bloqué_up?
    if self.bloqué_up
      a = (@course ? 1.5 : 1.0)
      return if self.y - a/8 < 0
      new_x = (self.x + 0.500).to_i
      new_y = (self.y - a/8).to_i
      if $game_map.passable_p?(new_x, new_y, @direction, self) and
        !$game_map.passable_p?((self.x).to_i, new_y, @direction, self)
        @direction = 6
        rect_right_ISOaddon1
      else
        new_x = (self.x + 0.495).to_i
        new_y = (self.y - a/8).to_i
        if $game_map.passable_p?((self.x).to_i, new_y, @direction, self) and
          $game_map.passable_p?(new_x, new_y, @direction, self)
          @direction = 4
          rect_left_ISOaddon1
        end
      end
      self.bloqué_up = true
    end
  end
  #--------------------------------------------------------------------------
  def bloqué_left?
    if self.bloqué_left
      a = (@course ? 1.5 : 1.0)
      return if self.x - a/8 < 0
      new_x = (self.x - a/8).to_i
      new_y = (self.y + 0.500).to_i
      if $game_map.passable_p?(new_x, new_y, @direction, self) and
        !$game_map.passable_p?(new_x, (self.y).to_i, @direction, self)
        @direction = 2
        rect_down_ISOaddon1
      else
        new_x = (self.x - a/8).to_i
        new_y = (self.y + 0.495).to_i
        if $game_map.passable_p?(new_x, (self.y).to_i, @direction, self) and
          $game_map.passable_p?(new_x, new_y, @direction, self)
          @direction = 8
          rect_up_ISOaddon1
        end
      end
      self.bloqué_left = true
    end
  end
  #--------------------------------------------------------------------------
  def bloqué_right?
    if self.bloqué_right
      a = (@course ? 1.5 : 1.0)
      new_x = (self.x + a/8 + 0.95).to_i
      new_y = (self.y + 0.500).to_i
      if $game_map.passable_p?(new_x, new_y, @direction, self) and
        !$game_map.passable_p?(new_x, (self.y).to_i, @direction, self)
        @direction = 2
        rect_down_ISOaddon1
      else
        new_x = (self.x + a/8 + 0.95).to_i
        new_y = (self.y + 0.495).to_i
        if $game_map.passable_p?(new_x, (self.y).to_i, @direction, self) and
          $game_map.passable_p?(new_x, new_y, @direction, self)
          @direction = 8
          rect_up_ISOaddon1
        end
      end
      self.bloqué_right = true
    end
  end
  #--------------------------------------------------------------------------
  def rect_down_ISOaddon1(turn_enabled = true)
    @x = (((8*@x).to_i).to_f)/8
    @y = (((8*@y).to_i).to_f)/8
    if @direction == 2 and event_pass?(@x, @y, 2, 1.0, false)
      turn_down
      @y += 1.0/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x, @y+1)
    end
    if turn_enabled and @direction != 2
      turn_down
    end
  end
  #--------------------------------------------------------------------------
  def rect_left_ISOaddon1(turn_enabled = true)
    @x = (((8*@x).to_i).to_f)/8
    @y = (((8*@y).to_i).to_f)/8
    if @direction == 4 and event_pass?(@x, @y, 4, 1.0, false)
      turn_left
      @x -= 1.0/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x-1, @y)
    end
    if turn_enabled and @direction != 4
      turn_left
    end
  end
  #--------------------------------------------------------------------------
  def rect_right_ISOaddon1(turn_enabled = true)
    @x = (((8*@x).to_i).to_f)/8
    @y = (((8*@y).to_i).to_f)/8
    if @direction == 6 and event_pass?(@x, @y, 6, 1.0, false)
      turn_right
      @x += 1.0/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x+1, @y)
    end
    if turn_enabled and @direction != 6
      turn_right
    end
  end
  #--------------------------------------------------------------------------
  def rect_up_ISOaddon1(turn_enabled = true)
    @x = (((8*@x).to_i).to_f)/8
    @y = (((8*@y).to_i).to_f)/8
    if @direction == 8 and event_pass?(@x, @y, 8, 1.0, false)
      turn_up
      @y -= 1.0/8
      increase_steps
    else
      check_event_trigger_touch_ISOaddon1(@x, @y-1)
    end
    if turn_enabled and @direction != 8
      turn_up
    end
  end
end
 
#==============================================================================
# ■ Sprite_Character
#==============================================================================
class Sprite_Character
  alias update_orig update
  def update
    update_orig
    if @character == $game_player
      if !$game_switches[$num_interrupteur_vide.to_i]
        a=""
        a+="Diag" if !@character.diagonal
        a+="Courir" if @character.course
        a+="Sauter" if @character.jumping?
        self.bitmap = RPG::Cache.character(@character.character_name+a, @character.character_hue)
      else
        self.bitmap = RPG::Cache.character(@character.character_name, @character.character_hue)
      end
      @cw = bitmap.width / 4
      @ch = bitmap.height / 4
      self.ox = @cw / 2
      self.oy = @ch
      sx = @character.pattern * @cw
      if !@character.diagonal
        sy = (@character.direction - 2) / 2 * @ch
      else
        dir = @character.direction * 2
        dir -= 10 if dir > 10
        sy = (dir - 2) / 2 * @ch
      end
      self.src_rect.set(sx, sy, @cw, @ch)
    end
  end
end
 
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
  def update
    loop do
      $game_map.update
      $game_system.map_interpreter.update
      $game_player.update
      $game_system.update
      $game_screen.update
      unless $game_temp.player_transferring
        break
      end
      transfer_player
      if $game_temp.transition_processing
        break
      end
    end
    @spriteset.update
    @message_window.update
    if $game_temp.gameover
      $scene = Scene_Gameover.new
      return
    end
    if $game_temp.to_title
      $scene = Scene_Title.new
      return
    end
    if $game_temp.transition_processing
      $game_temp.transition_processing = false
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    if $game_temp.message_window_showing
      return
    end
    if $game_player.encounter_count == 0 and $game_map.encounter_list != []
      unless $game_system.map_interpreter.running? or
             $game_system.encounter_disabled
        n = rand($game_map.encounter_list.size)
        troop_id = $game_map.encounter_list[n]
        if $data_troops[troop_id] != nil
          $game_temp.battle_calling = true
          $game_temp.battle_troop_id = troop_id
          $game_temp.battle_can_escape = true
          $game_temp.battle_can_lose = false
          $game_temp.battle_proc = nil
        end
      end
    end
    if Input.trigger?(Input::Z)
      unless $game_system.map_interpreter.running? or
             $game_system.menu_disabled
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end
    if Input.trigger?(Input::A) and $game_switches[$num_interrupteur_sauter.to_i] and
      !$game_player.jumping? and !$game_switches[$num_interrupteur_vide.to_i]
      $game_player.jump_ISOaddon1(0,0)
    end
    if Input.trigger?(Input::L)
      print($game_player.x, $game_player.y)
    end
    if Input.press?(Input::B) and $game_switches[$num_interrupteur_courir.to_i]
      $game_player.mode_course
    else $game_player.mode_marche
    end
    if $DEBUG and Input.press?(Input::F9)
      $game_temp.debug_calling = true
    end
    unless $game_player.moving?
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      end
    end
  end
end

 
 
Hi, I'm using this script as the basis for my whole game and I was wondering about one important edit I want to make to it.

How do I get rid of the whole Help window that appears on the bottom of the screen during the battle? Its ok being there for maybe the first battle but I want my players to be able to play it without being told what everthing does 2 hours into the game.
 
what would I need to add to Actor/Enemy death at the if type == enemy line to make it so enemies are removed from the field? I want enemies to automatically remove from the field, but actors to stay and display a 'downed' image. I have the actor portion fine but not sure how to set it so just enemies are removed from battle.
 
First off, AWESOME script. The one roadblock I've hit is trying to make switches open doors in battle. I have battle events that toggles a switch when the player waits on it, and that switch affects another battle event which is a door. The problem is, the door is passable before the switch is triggered. How do I make a battle event impassable but able to be "opened"? Thanks a ton!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top