[RESOLVED] Unknown script

Started by Torque, June 19, 2008, 01:34:42 am

Previous topic - Next topic

Torque

June 19, 2008, 01:34:42 am Last Edit: June 19, 2008, 07:57:10 am by Torque
Can somebody tell me what this script does
i saw it in a game i downloaded and got curious
oh yeah i can't read it... japanese
there seems to be smilees in it too lol

Spoiler: ShowHide
#==============================================================================
# ? KN_Custom
#------------------------------------------------------------------------------
# ?????????KNight-Blade Howling of Kerberos????????????
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # ? ??? : ??????
  #--------------------------------------------------------------------------
  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 $DEBUG and Input.press?(Input::CTRL)
      return true
    end
    # ?????????? 4 ??????????? 1 ?????????
    if $game_party.actors.include?($game_actors[4]) and
       $game_map.terrain_tag(new_x, new_y) == 1
      return false
    end
    # ?????????? 5 ??????????? 1 ?????????
    if $game_party.actors.include?($game_actors[5]) and
       $game_map.terrain_tag(new_x, new_y) == 1
      return false
    end
    # ?????????? 6 ??????????? 1 ?????????
    if $game_party.actors.include?($game_actors[6]) and
       $game_map.terrain_tag(new_x, new_y) == 1
      return false
    end
    # ?????????? 7 ??????????? 1 ?????????
    if $game_party.actors.include?($game_actors[7]) and
       $game_map.terrain_tag(new_x, new_y) == 1
      return false
    end
    # ?????????? 8 ??????????? 1 ?????????
    if $game_party.actors.include?($game_actors[8]) and
       $game_map.terrain_tag(new_x, new_y) == 1
      return false
    end
    super
  end

  #--------------------------------------------------------------------------
  # ? ??? : ??????
  #--------------------------------------------------------------------------
  alias orig_update update
  def update
    # ?????????? 4 ???????A ????????
    if $game_party.actors.include?($game_actors[4])
      unless $game_system.map_interpreter.running? or
             @move_route_forcing or $game_temp.message_window_showing
        if Input.dir4 == 0
          if Input.trigger?(Input::A)
            @move_speed = 5
            @character_name = "ag0_b"
            @dash = true
          elsif not Input.press?(Input::A)
            @move_speed = 3
            @character_name = "ag0"
            @dash = false
          end
        end
      else
        # ????????????
        if @dash
          @move_speed = 3
          @character_name = "ag0"
          @dash = false
        end
      end
      # ???????????
      if @dash
        Audio.se_play("Audio/SE/dash", 80, 150)
      end
    end

    # ?????????? 5 ???????A ????????
    if $game_party.actors.include?($game_actors[5])
      unless $game_system.map_interpreter.running? or
             @move_route_forcing or $game_temp.message_window_showing
        if Input.dir4 == 0
          if Input.trigger?(Input::A)
            @move_speed = 5
            @character_name = "ag_c_b"
            @dash = true
          elsif not Input.press?(Input::A)
            @move_speed = 3
            @character_name = "ag_c"
            @dash = false
          end
        end
      else
        # ????????????
        if @dash
          @move_speed = 3
          @character_name = "ag_c"
          @dash = false
        end
      end
      # ???????????
      if @dash
        Audio.se_play("Audio/SE/dash", 80, 150)
      end
    end
    # ?????????? 6 ???????A ????????
    if $game_party.actors.include?($game_actors[6])
      unless $game_system.map_interpreter.running? or
             @move_route_forcing or $game_temp.message_window_showing
        if Input.dir4 == 0
          if Input.trigger?(Input::A)
            @move_speed = 5
            @character_name = "ag2_b"
            @dash = true
          elsif not Input.press?(Input::A)
            @move_speed = 3
            @character_name = "ag2"
            @dash = false
          end
        end
      else
        # ????????????
        if @dash
          @move_speed = 3
          @character_name = "ag2"
          @dash = false
        end
      end
      # ???????????
      if @dash
        Audio.se_play("Audio/SE/dash", 80, 150)
      end
    end
    # ?????????? 7 ???????A ????????
    if $game_party.actors.include?($game_actors[7])
      unless $game_system.map_interpreter.running? or
             @move_route_forcing or $game_temp.message_window_showing
        if Input.dir4 == 0
          if Input.trigger?(Input::A)
            @move_speed = 5
            @character_name = "ag3_b"
            @dash = true
          elsif not Input.press?(Input::A)
            @move_speed = 3
            @character_name = "ag3"
            @dash = false
          end
        end
      else
        # ????????????
        if @dash
          @move_speed = 3
          @character_name = "ag3"
          @dash = false
        end
      end
      # ???????????
      if @dash
        Audio.se_play("Audio/SE/dash", 80, 150)
      end
    end
    # ?????????? 8 ???????A ????????
    if $game_party.actors.include?($game_actors[8])
      unless $game_system.map_interpreter.running? or
             @move_route_forcing or $game_temp.message_window_showing
        if Input.dir4 == 0
          if Input.trigger?(Input::A)
            @move_speed = 6
            @character_name = "ag4_b"
            @dash = true
          elsif not Input.press?(Input::A)
            @move_speed = 4
            @character_name = "ag4"
            @dash = false
          end
        end
      else
        # ????????????
        if @dash
          @move_speed = 4
          @character_name = "ag4"
          @dash = false
        end
      end
      # ???????????
      if @dash
        Audio.se_play("Audio/SE/dash", 80, 150)
      end
    end

    # ?????????
    orig_update
  end
end

class Window_Base < Window
  #--------------------------------------------------------------------------
  # ? ??? ?????????
  #     actor : ????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
def draw_actor_graphic(actor, x, y)
    bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) #(actor.character_name, actor.character_hue)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw /4, y - ch +16, bitmap, src_rect)
  end
end

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 30, 144)
    draw_actor_name(@actor, 4, 8)
    draw_actor_class(@actor, 4 + 124, 8)
    #draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 128, 56)
    draw_actor_hp(@actor, 128, 96, 172)
    draw_actor_sp(@actor, 128, 128, 172)
    draw_actor_parameter(@actor, 352, 240, 0)
    draw_actor_parameter(@actor, 352, 272, 1)
    draw_actor_parameter(@actor, 352, 304, 2)
    draw_actor_parameter(@actor, 352, 80, 3)
    draw_actor_parameter(@actor, 352, 112, 4)
    draw_actor_parameter(@actor, 352, 144, 5)
    #draw_actor_parameter(@actor, 128, 384, 6)
    self.contents.font.color = system_color
    #self.contents.draw_text(320, 48, 80, 32, "--")#EXP
    #self.contents.draw_text(320, 80, 80, 32, "--")#NEXT
    self.contents.font.color = normal_color
    #self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    #self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.draw_text(128, 208, 96, 32, "[Equip]")
    draw_item_name($data_weapons[@actor.weapon_id], 112 + 16, 240)
    draw_item_name($data_armors[@actor.armor1_id], 112 + 16, 272)
    draw_item_name($data_armors[@actor.armor2_id], 112 + 16, 304)
    draw_item_name($data_armors[@actor.armor3_id], 112 + 16, 352)
    draw_item_name($data_armors[@actor.armor4_id], 112 + 16, 384)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(352, 80, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(352, 112, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(352, 144, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(352, 176, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(352, 208, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 352 + 24, 80)
    draw_item_name($data_armors[@actor.armor1_id], 352 + 24, 112)
    draw_item_name($data_armors[@actor.armor2_id], 352 + 24, 144)
    draw_item_name($data_armors[@actor.armor3_id], 352 + 24, 176)
    draw_item_name($data_armors[@actor.armor4_id], 352 + 24, 208)
  end
end

class Window_Base < Window
  #--------------------------------------------------------------------------
  # ? ??? ??????
  #     actor : ????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_actor_class(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 236, 32, actor.class_name)
  end
end
 
class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ? ??? ??????
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x + 64, y) #16 draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 64, y + 32) #90
      #draw_actor_level(actor, x + 16, y + 32) #draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 210, y) #144
      #draw_actor_exp(actor, x + 16, y + 64) #draw_actor_exp(actor, x, y + 64)
      draw_actor_hp(actor, x + 210, y + 32) #236
      draw_actor_sp(actor, x + 210, y + 64) #236
   end
  end
end

class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # ? ??? ??????
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
      x = 4
      y = i * 116
      actor = $game_party.actors
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      #draw_actor_level(actor, x + 8, y + 32)
      draw_actor_state(actor, x + 8, y + 64)
      draw_actor_hp(actor, x + 152, y + 32)
      draw_actor_sp(actor, x + 152, y + 64)
    end
  end 
end

class Window_PartyCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # ? ??? ?????????
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.back_opacity = 160
    @commands = ["Fight", "Escape"]
    @item_max = 2
    @column_max = 2
    draw_item(0, normal_color)
    draw_item(1, $game_temp.battle_can_escape ? normal_color : disabled_color)
    self.active = false
    self.visible = false
    self.index = 0
  end
end

class Window_EquipLeft < Window_Base
  #--------------------------------------------------------------------------
  # ? ??? ??????
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4, 32)
    draw_actor_parameter(@actor, 4, 64, 0)
    draw_actor_parameter(@actor, 4, 96, 1)
    draw_actor_parameter(@actor, 4, 128, 2)
    if @new_atk != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 64, 40, 32, ">>", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
    end
    if @new_pdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 96, 40, 32, ">>", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
    end
    if @new_mdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 128, 40, 32, ">>", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
    end
  end
end

class Window_Message < Window_Selectable
  #--------------------------------------------------------------------------
  # ? ??? ??????
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    x = y = 0
    @cursor_width = 0
    # ???????????
    if $game_temp.choice_start == 0
      x = 8
    end
    # ???????????????
    if $game_temp.message_text != nil
      text = $game_temp.message_text
      # ??????
      begin
        last_text = text.clone
        text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
      end until text == last_text
      text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
      end
      # ????"\\C" ? "\001" ??"\\G" ? "\002" ???
      text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
      text.gsub!(/\\[Gg]/) { "\002" }
      text.gsub!(/\\\\/) { "\\" }
      # c ? 1 ????? (????????????????)
      while ((c = text.slice!(/./m)) != nil)
        # \C[n] ???
        if c == "\001"
          # ??????
          text.sub!(/\[([0-9]+)\]/, "")
          color = $1.to_i
          if color >= 0 and color <= 7
            self.contents.font.color = text_color(color)
          end
          # ?????
          next
        end
        # \G ???
        if c == "\002"
          # ????????????
          if @gold_window == nil
            @gold_window = Window_Gold.new
            @gold_window.x = 560 - @gold_window.width
            @gold_window.y = self.y >= 128 ? 32 : 288#384
            @gold_window.opacity = self.opacity
          end
          # ?????
          next
        end
        # ???????
        if c == "\n"
          # ??????????????
          if y >= $game_temp.choice_start
            @cursor_width = [@cursor_width, x].max
          end
          # y ? 1 ???
          y += 1
          x = 0
          # ???????????
          if y >= $game_temp.choice_start
            x = 8
          end
          # ?????
          next
        end
        # ?????
        self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
        # ?????????
        if c == "?"
          # x ? "?" ???????
          x += self.contents.text_size("?").width
        else
          # x ????????????
          x += self.contents.text_size(c).width
        end
      end
    end
    # ??????
    if $game_temp.choice_max > 0
      @item_max = $game_temp.choice_max
      self.active = true
      self.index = 0
    end
    # ???????
    if $game_temp.num_input_variable_id > 0
      digits_max = $game_temp.num_input_digits_max
      number = $game_variables[$game_temp.num_input_variable_id]
      @input_number_window = Window_InputNumber.new(digits_max)
      @input_number_window.number = number
      @input_number_window.x = self.x + 8
      @input_number_window.y = self.y + $game_temp.num_input_start * 32
    end
  end
end

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # ? ??? ???????????HP,SP?????
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors
      actor_x = i * 160 #+ 4
    #self.contents.font.color = system_color
    #draw_actor_name(actor, actor_x, 0)
    self.contents.font.size = 18
    draw_actor_hp(actor, actor_x , 0)
    draw_actor_sp(actor, actor_x , 24)
    #self.contents.font.size = 20
    #draw_actor_hp(actor, actor_x , 30)
    #draw_actor_sp(actor, actor_x , 56)

    #self.contents.font.color = system_color
    #self.contents.draw_text(actor_x , 32, 32, 32, $data_system.words.hp)
    #self.contents.draw_text(actor_x , 60, 32, 32, $data_system.words.sp)
        #self.contents.font.color = normal_color
        #self.contents.draw_text(actor_x + 80, -12, 64, 120, "/")
        #self.contents.draw_text(actor_x + 80, 15, 64, 120, "/")
        #self.contents.draw_text(actor_x + 96, -12, 64, 120, actor.maxhp.to_s)
        #self.contents.draw_text(actor_x + 96, 15, 64, 120, actor.maxsp.to_s)
        #self.contents.font.color = actor.hp == 0 ? knockout_color :
        #actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
        #self.contents.draw_text(actor_x + 34, 32, 48, 32, actor.hp.to_s)
        #self.contents.font.color = actor.sp == 0 ? knockout_color :
        #actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
        #self.contents.draw_text(actor_x + 34, 60, 48, 32, actor.sp.to_s)
      if @level_up_flags
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        self.contents.font.size = 15
        draw_actor_state(actor, actor_x, 100)
      end
    end
  end
end

class Scene_Title
  #--------------------------------------------------------------------------
  # ? ??? ?????
  #--------------------------------------------------------------------------
  def main
    # ????????
    if $BTEST
      battle_test
      return
    end
    # ??????????
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    $data_mapinfos      = load_data("Data/MapInfos.rxdata")
    # ?????????????
    $game_system = Game_System.new
    # ?????????????
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    # ????????????
    s1 = "NEW GAME"
    s2 = "LOAD GAME"
    s3 = "END GAME"
    @command_window = Window_Command.new(192, [s1, s2, s3])
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 288
    # ???????????
    # ?????????????????????????
    # ???? @continue_enabled ? true????? false ???
    @continue_enabled = false
    for i in 0..3
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end
    # ???????????????????????????????
    # ?????????????????????????
    if @continue_enabled
      @command_window.index = 1
    else
      @command_window.disable_item(1)
    end
    # ???? BGM ???
    $game_system.bgm_play($data_system.title_bgm)
    # ME?BGS ??????
    Audio.me_stop
    Audio.bgs_stop
    # ?????????
    Graphics.transition
    # ??????
    loop do
      # ????????
      Graphics.update
      # ???????
      Input.update
      # ??????
      update
      # ????????????????
      if $scene != self
        break
      end
    end
    # ?????????
    Graphics.freeze
    # ????????????
    @command_window.dispose
    # ?????????????
    @sprite.bitmap.dispose
    @sprite.dispose
  end
end

class Window_BattleResult < Window_Base
  #--------------------------------------------------------------------------
  # ? ??? ??????
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    x = 4
    self.contents.font.color = system_color
    self.contents.draw_text(x, 0, 192, 32, "[Items]")
    y = 32
    for item in @treasures
      draw_item_name(item, 4, y)
      y += 32
    end
end
end

class Scene_Map
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def call_menu
    # ???????????????
    $game_temp.menu_calling = false
    # ???? SE ????????????????
    if $game_temp.menu_beep
      # ?? SE ???
      $game_system.se_play($data_system.decision_se)
      # ???? SE ?????????
      $game_temp.menu_beep = false
    end
  # ????????? [0004]AG??????????OFF???
    $game_switches[0004] = false
  # ????????? [0156]EV??????????OFF???
    $game_switches[0156] = false
  # ???????????
    $game_player.straighten
    # ???????????
    $scene = Scene_Menu.new
  end
end

Calintz

I don't know anything about scripting really, but it looks as though it could function as a vehicle. Maybe a horse or something you know??

It's dealing with pass ability and your party. I would say, it's looking whether or not you can pass, and calling a vehicle if you can't...

Don't quote me though.

shdwlink1993

June 19, 2008, 08:11:24 am #2 Last Edit: June 19, 2008, 08:15:56 am by shdwlink1993
Right off the bat, this script is from KNight_Blade Howling of Kerberos, which I have. This would be their custom function script, as it does the following:

1) Controls if you are running or not (If you are in an Assault Gear (which, for the record, is a blatant rip-off of Full Metal Panic's Arm Slave. AS & AG), you can run)
2) Rearranges how it draws the Actor on the screen for menus and battles (since there are no levels in that game, I think)
3) Defines all the places stuff goes in the Status Menu
4) Same with redefining how the Actors class is shown.
5) Defines all the places stuff goes in the Status Windows that appear on the pause menu.
6) Defines the same for Item user's selection (who gets the item)
7) Defines the Command Window for selecting Fight or Escape.
8 ) Same on Equip Menus
9) Not entirely sure what Message Box mods were made.
10) Where things go in Battle Status Window at the bottom of every fight
11) Does something with the Title Screen. Again not 100% positive here.
12) BattleResult Window has EXP removed.
13) Lastly, the Map Scene has some Switch stuff associated with it.

Most of this appears to be to remove the Levels and EXP from all windows because KNight_Blade does not have.
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

GAX

yeah, this is KNight Blade's system, and it does quite a bit of heavy modding but retains the basic look, I've messed with this script a lot.

Anyone have the original KNight Blade laying around?  I remember there was one made for I think RM2000 or RM1995

And yeah, Assault Gear is a ripoff of Arm Slave, even in terms of design too...then again

I think anyone who's seen FMP remembers the SHINING FINGER moment which brougth me back to my good friend G Gundam...which reminds me...

THIS HAND OF MINE GLOWS WITH AN AWESOME POWER!
ITS BURNING GRIP TELLS ME TO DEFEAT YOU!
TAKE THIS!  MY LOVE, MY ANGER, AND ALL OF MY SORROW!
SHINING FINGER SWORD!!!

GO, GO, GOOOOOOOOOOOOOOOO!

Rule 2: ShowHide
Quote from: Rule No.2Keep your signatures at reasonable size. The pictures in your signature may altogether be no more than 200kB and take up an area of 1600px2. That means 2 pictures of 400x200 are fine, one picture of 800x200 is fine and so on. Also your pictures height must not exceed 200 pixels, width can be as big as you want as long as your pictures match the other criteria. Every signature not matching this criteria is a subject of the moderator team to remove and leave this rule as message in your signature.