collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: Hilfe zu Skripten.  (Gelesen 51441 mal)

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #420 am: Mai 30, 2010, 19:52:44 »
Ich bräuchte auch mal Hilfe, und zwar möchte ich, wenn ein Char angreift, das er dabei ein Kampfgeräusch von sich gibt (wie man es eben aus RPGs kennt)

dazu habe ich dieses Skript gefunden
hier auch noch mal der Link dazu KLICK

<br />
<b>Notice</b>:  ob_clean() [<a href='ref.outcontrol'>ref.outcontrol</a>]: failed to delete buffer. No buffer to delete. in <b>/var/www/vhosts/rpg-studio.de/httpdocs/scriptdb/1/dl.php</b> on line <b>23</b><br />
#==============================================================================
# ** Actors in Pain Script V1.5
# ActorsInPainScript.rb von SojaBird (13.06.2009)
#------------------------------------------------------------------------------
# http://www.rpg-studio.de/scriptdb/node/266
# http://www.rpg-studio.de/forum/index.php?page=Thread&threadID=30538
#==============================================================================

=begin
################################################################################
################################################################################
 
  Actors in Pain
 
  Autor: SojaBird
  Data: 25-01-'09
  Version:  1.5
 
################################################################################
 
  This script overwrites:
  display_hp_damage
 
################################################################################
 
  For each actor, make a map in '../MyGame/Audio/SE'
  In each map you can add sound effects up to 100 different.
  The names of the files must be numbered, starting with zero.
 
Example for the actor named "Frank"
  '../MyGame/Audio/SE/Frank' contains:
    - 0.ogg
    - 1.mp3
    - 2.wav
    - 3.ogg
    - 4.ogg
    - 5.wav
 
When actor Frank it's HP is damaged, it'll scream one of the 6 above files.
 
################################################################################
################################################################################
                              WARNING!!
        Don?t touch below if you don?t know what you are doing!!
################################################################################
################################################################################
=end
 
module Sound
  # New Actor Damage
  def self.play_actor_damage(actor)
@actor = actor.name
@avalible = false
ary = ["ogg","mp3","wav"]
nbr = 0
for key in 0..100
  ary.each do |i|
    if FileTest.exist?("Audio/SE/#{@actor}/#{key}.#{i}")
      nbr += 1
      @file = rand(nbr)
      if FileTest.exist?("Audio/SE/#{@actor}/#{@file}.#{i}")
        @avalible = true
        @location = "Audio/SE/#{@actor}/#{@file}.#{i}"
      end #FileTest @file
    end #FileTest key
  end #ary each do
end #key 100
if @avalible == true
  Audio.se_play(@location)
else
  $data_system.sounds[12].play
end
  end
end
###############################################################################
################################################################################
module Sound
  # New Enemy Damage
  def self.play_enemy_damage(enemy)
@enemy = enemy.name
@avalible = false
ary = ["ogg","mp3","wav"]
nbr = 0
for key in 0..100
  ary.each do |i|
    if FileTest.exist?("Audio/SE/#{@enemy}/#{key}.#{i}")
      nbr += 1
      @file = rand(nbr)
      if FileTest.exist?("Audio/SE/#{@enemy}/#{@file}.#{i}")
        @avalible = true
        @location = "Audio/SE/#{@enemy}/#{@file}.#{i}"
      end #FileTest @file
    end #FileTest key
  end #ary each do
end #key 100
if @avalible == true
  Audio.se_play(@location)
else
  $data_system.sounds[12].play
end
  end
end
################################################################################
################################################################################
################################################################################
################################################################################
 
class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * New Show HP Damage
  # target : Target
  # obj : Skill or item
  #--------------------------------------------------------------------------
  def display_hp_damage(target, obj = nil)
if target.hp_damage == 0            # No damage
  return if obj != nil and obj.damage_to_mp
  return if obj != nil and obj.base_damage == 0
  fmt = target.actor? ? Vocab::ActorNoDamage : Vocab::EnemyNoDamage
  text = sprintf(fmt, target.name)
elsif target.absorbed                # Absorb
  fmt = target.actor? ? Vocab::ActorDrain : Vocab::EnemyDrain
  text = sprintf(fmt, target.name, Vocab::hp, target.hp_damage)
elsif target.hp_damage > 0          # Damage
  if target.actor?
    text = sprintf(Vocab::ActorDamage, target.name, target.hp_damage)
    Sound.play_actor_damage(target) # <<<|EDIT|>>> #
    $game_troop.screen.start_shake(5, 5, 10)
  else
    text = sprintf(Vocab::EnemyDamage, target.name, target.hp_damage)
    Sound.play_enemy_damage(target)
    target.blink = true
  end
else                                # Recovery
  fmt = target.actor? ? Vocab::ActorRecovery : Vocab::EnemyRecovery
  text = sprintf(fmt, target.name, Vocab::hp, -target.hp_damage)
  Sound.play_recovery
end
@mes

Aber wenn ich das unter meine Skripte eintrage, kann ich nicht einmal das Spiel öffnen, weil sofort ein Error kommt.
Frage, gibt es auch noch ein anderes Skript dazu oder mag sich das Skript hier mal anschauen?
Kenn mich zwar nicht mit dem skripen aus, aber der Anfang erscheint mir schon so komisch. (aber selbst wenn ich die ersten Zeilen weg lasse läuft es nicht)


Projekt by FlipelyFlip

Re: Hilfe zu Skripten.

Offline Ðeity

  • No Pain, no gain!
  • Administrator
  • Eventmeister
  • ****
  • Beiträge: 427
  • No Pain, no Gain!
    • Deity-VX
Re: Hilfe zu Skripten.
« Antwort #421 am: Mai 30, 2010, 20:11:17 »
Das liegt ganz eifnach daran, dass das Script nicht komplett ist. Du hast nicht den ganzen Teil.

MfG
Deity



Re: Hilfe zu Skripten.

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #422 am: Mai 30, 2010, 21:22:46 »
Das Skript schien wohl auf der Seite fehlerhaft gewesen zu sein, hab nun das komplette
Nun hab ich die Errors zwar nicht mehr, aber funktionieren tut es auch nicht wie es dort steht
Ich habe einen Ordner mit dem Namen des Hauptcharakters in den SE Ordner gemacht und die datei "0" genannt.
So hab ich es zumindest verstanden, oder muss man da noch mehr machen bzw was anders machen?


Projekt by FlipelyFlip

Re: Hilfe zu Skripten.

Offline Ðeity

  • No Pain, no gain!
  • Administrator
  • Eventmeister
  • ****
  • Beiträge: 427
  • No Pain, no Gain!
    • Deity-VX
Re: Hilfe zu Skripten.
« Antwort #423 am: Mai 30, 2010, 21:40:50 »
Da steht, dass man für jeden Spieler der Schaden nehmen kann, ein Ordner unter SE erstellt werden soll, desen Namen dem Namen des Helden entspricht. In diesen Ordner kopierst du alle Schadengeräuschte, die er "schreien" kann.
Die Namen der Geräusche müssen aber 0-100 sein.
Also es müssen nicht 100 sein aber können die Zahlen dazwischen sein. ^^

MfG
Deity
« Letzte Änderung: Mai 30, 2010, 21:41:26 von Ðeity »



Re: Hilfe zu Skripten.

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #424 am: Mai 30, 2010, 21:47:38 »
Joa, genau so hatte ich es ja gemacht q.q
Aber wenn die Geräusche kommen wenn der Charakter dmg bekommt, ist es eh das falsche Script für mich
wollte ja das der Charakter beim zu schlagen ein Geräusch von sich gibt, aber trotzdem danke!


Projekt by FlipelyFlip

Re: Hilfe zu Skripten.

Offline Ðeity

  • No Pain, no gain!
  • Administrator
  • Eventmeister
  • ****
  • Beiträge: 427
  • No Pain, no Gain!
    • Deity-VX
Re: Hilfe zu Skripten.
« Antwort #425 am: Mai 30, 2010, 21:49:58 »
Das ist jetzt natürlich ein bischen doff gelaufen.
Kein Problem, ich hoffe du findest das was du suchst. :)

MfG
Deity



Re: Hilfe zu Skripten.

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #426 am: Juni 04, 2010, 18:29:30 »
Ich bräuchte mal Hilfe bei einem Skript, da es nicht läuft und ich nicht weiß woran es liegt
und zwar nennt es sich "Save Screen Customization" wenn ich es bei meinen Skripten einfüge, bekomme ich sofort einen Error beim Spielstart
line4 "Original Japanese Version From: RGSS2 DAIpage" es bringt auch nichts die alten Savedateien zu löschen und wenn ich es in ein ganz neues Projekt einfüge funktioniert es ebenfalls nicht, daher glaube ich das schon im Skript irgend ein Fehler ist q.q

begin
#-------------------------------------------------------------------------------
 Save Screen Customization
 Original Japanese Version From: RGSS2 DAIpage
 English Translation By: SuperMega
#-------------------------------------------------------------------------------

 Script Features:

 -Alterations to the save screen with HUGE customization!
 -Can be plug 'n play, but customization is something you want to look at
 
 -You can choose one of four possible layouts:
  1 = character sprites, level, HP with MP. Not recommended for a small party.
  2 = characters sprite & name, level, class, HP with MP.
  3 = Face Image, Name, level, class, HP with MP.
  4 = Face Image & Name Face, HP · MP. Not recommended for a small party.

 -You can choose to hide playtime, location, gold, etc.
 -If a location contains a "#" (Or anything you choose), that location will not
  be displayed on the save screen (This is what the script creator says, but this
  is not the case.  So I have no idea what this does...)
 
  Note:
  THIS SCRIPT IS NOT COMPATIBLE WITH OLD SAVE FILES.  IF YOU INSTALL THIS SCRIPT
  AFTER YOU HAVE ALREADY SAVED, YOU MUST START OVER.

 Update History:
 7/6 Script Released
 7/7 Fixed a bug where "#" wouldn't work correctly

 This script redifines:
 Scene_File
 Window_SaveFile

 Changing this script may result in compatability errors, so do so at your
 own risk...

=end
#==============================================================================
# Begin Customization
#==============================================================================

module DAI
 # Maximum Save Files (If 6 or more, you will have to scroll down.)
 FILE_MAX = 6

 # Save File box height. (It's not really neccessary to change this.)
 FILE_HEIGHT = 60

 # Window Arrangement (0 = left displays files, right shows stats 1 = reversed)
 FILE_ARRANGEMENT = 1       

 # Message Displayed if there is no file saved
 FILE_NOT = "Keine Datei vorhanden"
 
 # Display the play time?
 FILE_PLAY_TIME = true
 # If above is true, what term should "Play time" go by?
 FILE_PLAY_TIME_NAME = "Verstrichene Spielzeit"
 
 # Display Amount of Gold?
 FILE_GOLD = true
 # If above is true, what term should display before the gold amount?
 FILE_GOLD_NAME = " Gold im Besitz:"
 
 # Display Location Name?
 FILE_PLACE_MAP = true
 # Not exactly sure what this does, so DON'T TOUCH IT!
 FILE_MAP_NAME_DE = "#"
 
 
  # Display Type
  # 1 = character sprites, level, HP with MP. Not recommended for a small party.
  # 2 = characters sprite & name, level, class, HP with MP.
  # 3 = Face Image, Name, level, class, HP with MP.
  # 4 = Face Image & Name Face, HP · MP. Not recommended for a small party.
  FILE_TYPE = 3


 # Height of One Character in Save Window
 #(Type 1 = 32-70, type 2 = 60 to 70, Type 3 = 60 to 70, Type 4 33-70)
 FILE_LENGTN = 70
 
 
  #--------------------------------------------------------------------------
  # ? IF YOU CHOSE DISPLAY TYPE 3...
  #--------------------------------------------------------------------------

  # Display the class of all actors?
   FILE_TYPE_C_3 = true
 
  # Face Size Used on The Save Screen
  # Please note, the greater the height, the screen gets more crowded
   FILE_FACE_LENGTN_X_3 = 96 # horizontal
   FILE_FACE_LENGTN_Y_3 = 68 # vertical
 
  #--------------------------------------------------------------------------
  # ?IF YOU CHOSE DISPLAY TYPE 4...
  #--------------------------------------------------------------------------
  # Face Size Used on The Save Screen
  # Please note, the greater the height, the screen gets more crowded.
   FILE_FACE_LENGTN_X_4 = 96 # horizontal
   FILE_FACE_LENGTN_Y_4 = 31 # vertical
   
  # Face Graphic Alignment (Default aligns the eyes centered)
   TYPE_4_POSITION_Y = 20

end

#==============================================================================
# End Customization
#==============================================================================

#==============================================================================
# ¦ Scene_File
#------------------------------------------------------------------------------
#  ??????????????????
#==============================================================================
class Scene_File
  #--------------------------------------------------------------------------
  # ? ???? (????)
  #--------------------------------------------------------------------------
  alias _exmincrsv_start start
  def start
    @file_max = DAI::FILE_MAX
    _exmincrsv_start
    wh = DAI::FILE_HEIGHT
    adj = (416 - @help_window.height) % wh
    @help_window.height += adj
    @page_file_max = ((416 - @help_window.height) / wh).truncate

    for i in 0...@file_max
      window = @savefile_windows
      if @index > @page_file_max - 1
        if @index < @file_max - @page_file_max - 1
          @top_row = @index
          window.y -= @index * window.height
        elsif @index >= @file_max - @page_file_max
          @top_row = @file_max - @page_file_max
          window.y -= (@file_max - @page_file_max) * window.height
        else
          @top_row = @index
          window.y -= @index * window.height
        end
      end
      window.y += adj
      window.visible = (window.y >= @help_window.height and
      window.y < @help_window.height + @page_file_max * window.height)
      window.x = 404 if DAI::FILE_ARRANGEMENT == 1
    end
    if DAI::FILE_ARRANGEMENT == 0
      @Save_window = Window_Dai_Save.new(140,56,make_filename(@index))
    else
      @Save_window = Window_Dai_Save.new(0,56,make_filename(@index))
    end
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  alias dai_save_terminate terminate
  def terminate
    dai_save_terminate
    @Save_window.dispose
  end
  #--------------------------------------------------------------------------
  # ? ??????????????? (???)
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @top_row = 0
    @savefile_windows = []
    for i in 0...@file_max
      a = 0
      a = 1 if FileTest.exist?(make_filename(i))
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i),a))
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????? (???)
  #     wrap : ??????????
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @file_max - 1 or wrap
      @index = (@index + 1) % @file_max
      for i in 0...@file_max
        window = @savefile_windows
        if @index == 0
          @top_row = 0
          window.y = @help_window.height + i % @file_max * window.height
        elsif @index - @top_row > @page_file_max - 1
          window.y -= window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row > @page_file_max - 1
        @top_row += 1
      end
    end
    filename = @savefile_windows[@index].filename
    @Save_window.refresh(filename)
  end
  #--------------------------------------------------------------------------
  # ? ????????? (???)
  #     wrap : ??????????
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @file_max) % @file_max
      for i in 0...@file_max
        window = @savefile_windows
        if @index == @file_max - 1
          @top_row = @file_max - @page_file_max
          window.y = @help_window.height + i % @file_max * window.height
          window.y -= (@file_max - @page_file_max) * window.height
        elsif @index - @top_row < 0
          window.y += window.height
        end
        window.visible = (window.y >= @help_window.height and
          window.y < @help_window.height + @page_file_max * window.height)
      end
      if @index - @top_row < 0
        @top_row -= 1
      end
    end
    filename = @savefile_windows[@index].filename
    @Save_window.refresh(filename)
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #     file : ??????????????? (??????)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
      characters.push([
      actor.character_name,
      actor.character_index,
      actor.name,
      actor.level,
      actor.class_id,
      actor.face_name,
      actor.face_index,
      actor.maxhp,
      actor.hp,
      actor.maxmp,
      actor.mp,
      ])
    end
    assistance = []
    gold = $game_party.gold
    map_name = $game_map.name

    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(characters,           file)
    Marshal.dump(gold,                 file)
    Marshal.dump(map_name,             file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,         file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,       file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  file)
    Marshal.dump($game_actors,         file)
    Marshal.dump($game_party,          file)
    Marshal.dump($game_troop,          file)
    Marshal.dump($game_map,            file)
    Marshal.dump($game_player,         file)
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #     file : ??????????????? (??????)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters           = Marshal.load(file)
    gold                 = Marshal.load(file)
    map_name             = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system         = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches       = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors         = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player         = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

#==============================================================================
# ¦ Window_SaveFile
#------------------------------------------------------------------------------
#  ???????????????????????????????????
#==============================================================================
class Window_SaveFile
  #--------------------------------------------------------------------------
  # ? ????????? (???)
  #     file_index : ?????????????? (0~3)
  #     filename   : ?????
  #--------------------------------------------------------------------------
  def initialize(file_index, filename , a)
    wh = DAI::FILE_HEIGHT
    super(0, 56 + file_index % DAI::FILE_MAX * wh, 140, wh)
    @file_index = file_index
    @filename = filename
    load_gamedata
    refresh(a)
    @selected = false
  end
  #--------------------------------------------------------------------------
  # ? ??????(???)
  #--------------------------------------------------------------------------
  def refresh(a)
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = 128 unless a == 1
    name = Vocab::File + " #{@file_index + 1}"
    self.contents.draw_text(4, 0, 200, WLH, name)
    @name_width = contents.text_size(name).width
  end
end

#==============================================================================
# ¦ Window_Dai_Save
#------------------------------------------------------------------------------
#  ???????????????????????
#==============================================================================
class Window_Dai_Save < Window_Base
  #--------------------------------------------------------------------------
  # ? ?????????
  #     x : ?????? X ??
  #     y : ?????? Y ??
  #--------------------------------------------------------------------------
  def initialize(x, y, filename)
    super(x, y, 404, 360)
    load_gamedata(filename)
    refresh(filename)
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh(filename)
    self.contents.clear
    load_gamedata(filename)
    unless FileTest.exist?(filename)
      self.contents.draw_text(4, 150, self.width - 40, WLH, DAI::FILE_NOT, 1)
      return
    end
    if DAI::FILE_GOLD
      if DAI::FILE_PLAY_TIME
        draw_party_gold(0, 280, contents.width - 4, 0)
      else
        draw_party_gold(0, 307, contents.width - 4, 0)
      end
    end
    draw_playtime(0, 307, contents.width - 4, 0) if DAI::FILE_PLAY_TIME
    case DAI::FILE_TYPE
      when 1
        draw_party_characters(16, 33)
        draw_actor_hp_gauge(120, 5)
        draw_actor_hp(120, 5)
        draw_actor_mp_gauge(250, 5)
        draw_actor_mp(250, 5)
        draw_actor_level(50, 5)
      when 2
        draw_party_characters(16, 33)
        draw_actor_name(50, 5)
        draw_actor_hp_gauge(250, 5)
        draw_actor_hp(250, 5)
        draw_actor_mp_gauge(250, 30)
        draw_actor_mp(250, 30)
        draw_actor_level(50, 30)
        draw_actor_class(116, 30)
      when 3
        draw_face(0, 0, DAI::FILE_FACE_LENGTN_X_3, DAI::FILE_FACE_LENGTN_Y_3)
        if DAI::FILE_TYPE_C_3
          draw_actor_level(100, 25)
          draw_actor_class(168, 25)
          draw_actor_name(100, 0)
        else
          draw_actor_level(120, 25)
          draw_actor_name(120, 0)
        end
        draw_actor_hp_gauge(250, 0)
        draw_actor_hp(250, 0)
        draw_actor_mp_gauge(250, 25)
        draw_actor_mp(250, 25)
      when 4
        draw_face_type_4(0, 0, DAI::FILE_FACE_LENGTN_X_4, DAI::FILE_FACE_LENGTN_Y_4)
        draw_actor_hp_gauge(120, 5)
        draw_actor_hp(120, 5)
        draw_actor_mp_gauge(250, 5)
        draw_actor_mp(250, 5)
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #    ?????????????????? (??????????) ?
  #--------------------------------------------------------------------------
  def load_gamedata(filename)
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(filename)
    if @file_exist
      file = File.open(filename, "r")
      @time_stamp = file.mtime
      begin
        @characters     = Marshal.load(file)
        @gold           = Marshal.load(file)
        @map_name       = Marshal.load(file)
        @frame_count    = Marshal.load(file)
        @last_bgm       = Marshal.load(file)
        @last_bgs       = Marshal.load(file)
        @game_system    = Marshal.load(file)
        @game_message   = Marshal.load(file)
        @game_switches  = Marshal.load(file)
        @game_variables = Marshal.load(file)
        @screen_dump    = Marshal.load(file)
        @total_sec = @frame_count / Graphics.frame_rate
      rescue
        @file_exist = false
      ensure
        file.close
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #     align : ??
  #--------------------------------------------------------------------------
  def draw_party_gold(x, y, width, align)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width, WLH, DAI::FILE_GOLD_NAME + " " + @gold.to_s + " " + Vocab::gold, 2)
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #     x : ??? X ??
  #     y : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_party_characters(x, y)
    for i in 0...@characters.size
      name = @characters

*

      index = @characters[1]
      draw_character(name, index, x , y + i * DAI::FILE_LENGTN)
    end
  end
  #--------------------------------------------------------------------------
  # ? HP ????? 1 ???
  #--------------------------------------------------------------------------
  def hp_gauge_color1
    return text_color(20)
  end
  #--------------------------------------------------------------------------
  # ? HP ????? 2 ???
  #--------------------------------------------------------------------------
  def hp_gauge_color2
    return text_color(21)
  end
  #--------------------------------------------------------------------------
  # ? MP ????? 1 ???
  #--------------------------------------------------------------------------
  def mp_gauge_color1
    return text_color(22)
  end
  #--------------------------------------------------------------------------
  # ? MP ????? 2 ???
  #--------------------------------------------------------------------------
  def mp_gauge_color2
    return text_color(23)
  end
  #--------------------------------------------------------------------------
  # ? HP ???????
  #     actor : ????
  #--------------------------------------------------------------------------
  def hp_color(actor)
    return knockout_color if actor.hp == 0
    return crisis_color if actor.hp < actor.maxhp / 4
    return normal_color
  end
  #--------------------------------------------------------------------------
  # ? HP ???
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_hp(x, y, width = 120)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      maxhp = @characters[7]
      hp = @characters[8]
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + i * DAI::FILE_LENGTN, 30, WLH, Vocab::hp_a)
      self.contents.font.color = normal_color if hp >= maxhp / 4
      self.contents.font.color = crisis_color if hp < maxhp / 4
      self.contents.font.color = knockout_color if hp == 0
      xr = x + width
      if width < 120
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, hp, 2)
      else
        self.contents.draw_text(xr - 90, y + i * h, 40, WLH, hp, 2)
        self.contents.font.color = normal_color
        self.contents.draw_text(xr - 50, y + i * h, 10, WLH, "/", 2)
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, maxhp, 2)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? HP ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_hp_gauge(x, y, width = 120)
    for i in 0...@characters.size
      h = DAI::FILE_LENGTN
      gw = width * @characters[8] / @characters[7]
      gc1 = hp_gauge_color1
      gc2 = hp_gauge_color2
      n = y + i * h
      self.contents.fill_rect(x, n + WLH - 8, width, 6, gauge_back_color)
      self.contents.gradient_fill_rect(x, n + WLH - 8, gw, 6, gc1, gc2)
    end
  end
  #--------------------------------------------------------------------------
  # ? MP ???
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_mp(x, y, width = 120)
    for i in 0...@characters.size
      maxmp = @characters[9]
      mp = @characters[10]
      h = DAI::FILE_LENGTN
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + i * h, 30, WLH, Vocab::mp_a)
      self.contents.font.color = normal_color if mp >= maxmp / 4
      self.contents.font.color = crisis_color if mp < maxmp / 4
      self.contents.font.color = knockout_color if mp == 0
      xr = x + width
      if width < 120
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, mp, 2)
      else
        self.contents.draw_text(xr - 90, y + i * h, 40, WLH, mp, 2)
        self.contents.font.color = normal_color
        self.contents.draw_text(xr - 50, y + i * h, 10, WLH, "/", 2)
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, maxmp, 2)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? MP ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_mp_gauge(x, y, width = 120)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      if @characters[9] > 0
        gw = width * @characters[10] / @characters[9]
      else
        gw = 0
      end
      gc1 = mp_gauge_color1
      gc2 = mp_gauge_color2
      n = y + i * h
      self.contents.fill_rect(x, n + WLH - 8, width, 6, gauge_back_color)
      self.contents.gradient_fill_rect(x, n + WLH - 8, gw, 6, gc1, gc2)
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_actor_level(x, y)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + i * h, 32, WLH, Vocab::level_a)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 32, y + i * h, 24, WLH, @characters[3], 2)
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_actor_name(x, y)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      self.contents.font.color = normal_color
      self.contents.font.color = knockout_color if @characters[8] == 0
      self.contents.draw_text(x , y + i * h,108 , WLH, @characters[2], 0)
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_actor_class(x, y)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      id = @characters[4]
      c = $data_classes[id].name
      self.contents.font.color = normal_color
      self.contents.draw_text(x , y + i * h,108 , WLH, c, 0)
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #     x            : ??? X ??
  #     y            : ??? Y ??
  #     size_x       : ?????x
  #     size_y       : ?????y
  #--------------------------------------------------------------------------
  def draw_face(x, y, size_x = 96,size_y = 57)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      face_name = @characters[5]
      face_index = @characters[6]
      bitmap = Cache.face(face_name)
      rect = Rect.new(0, 0, 0, 0)
      rect.x = face_index % 4 * 96 + (96 - size_x) / 2
      rect.y = face_index / 4 * 96 + (96 - size_y) / 2
      rect.width = size_x
      rect.height = size_y
      self.contents.blt(x, y + i * h, bitmap, rect)
      bitmap.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????????(???4??)
  #     x            : ??? X ??
  #     y            : ??? Y ??
  #     size_x       : ?????x
  #     size_y       : ?????y
  #--------------------------------------------------------------------------
  def draw_face_type_4(x, y, size_x = 96,size_y = 57)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      face_name = @characters[5]
      face_index = @characters[6]
      bitmap = Cache.face(face_name)
      rect = Rect.new(0, 0, 0, 0)
      rect.x = face_index % 4 * 96 + (96 - size_x) / 2
      rect.y = face_index / 4 * 96 + (96 - size_y - DAI::TYPE_4_POSITION_Y) / 2
      rect.width = size_x
      rect.height = size_y
      self.contents.blt(x, y + i * h, bitmap, rect)
      bitmap.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #     align : ??
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    time_string = sprintf("%02d:%02d", hour, min)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width, WLH, DAI::FILE_PLAY_TIME_NAME+" " + time_string, 2)
  end
end
 


Projekt by FlipelyFlip

Re: Hilfe zu Skripten.

Offline PDM

  • Bibliothekar
  • Global Mod
  • VX-Kenner
  • ****
  • Beiträge: 468
    • Mein Blog
Re: Hilfe zu Skripten.
« Antwort #427 am: Juni 04, 2010, 18:37:41 »
Setz mal vor das begin am Anfang ein "=" Zeichen.
PDM's Gameplays
Skype-Name: lordpdm

Re: Hilfe zu Skripten.

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #428 am: Juni 04, 2010, 18:46:20 »
hatte ich schon versucht, aber das hats leider auch nicht gebracht q.q


Projekt by FlipelyFlip

Re: Hilfe zu Skripten.

Offline Ðeity

  • No Pain, no gain!
  • Administrator
  • Eventmeister
  • ****
  • Beiträge: 427
  • No Pain, no Gain!
    • Deity-VX
Re: Hilfe zu Skripten.
« Antwort #429 am: Juni 04, 2010, 19:08:34 »
ALso bei mir funktionierte es, nachdem ich wie PDM es schon gesgat hat, ein = vor begin gesetzt habe.
Hast du es direkt vor begin eingefügt oder neue Zeile gemacht oder ähnliches?
Es muss einfach nur
=begin
am Anfang stehen.

MfG
Deity



Re: Hilfe zu Skripten.

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #430 am: Juni 04, 2010, 19:12:26 »
ja genau so hatte ich es
also
=begin
bekomme jetzt sobald man saven möchte den Error
line147 "window.y += adj"


Projekt by FlipelyFlip

Re: Hilfe zu Skripten.

Offline Ðeity

  • No Pain, no gain!
  • Administrator
  • Eventmeister
  • ****
  • Beiträge: 427
  • No Pain, no Gain!
    • Deity-VX
Re: Hilfe zu Skripten.
« Antwort #431 am: Juni 04, 2010, 19:34:54 »
Man waren da viele Fehler im Script. O.o
Kann es sein, dass es nicht vollständig ist oder in zwei Teile geteilt wurde oder ähnliches?
Naja habe mal alles was ich gesehen habe geändert. Versuch es aus. (*Aufschreib Save Script zu schreiben.*)

=begin
#-------------------------------------------------------------------------------
 Save Screen Customization
 Original Japanese Version From: RGSS2 DAIpage
 English Translation By: SuperMega
#-------------------------------------------------------------------------------

 Script Features:

 -Alterations to the save screen with HUGE customization!
 -Can be plug 'n play, but customization is something you want to look at
 
 -You can choose one of four possible layouts:
  1 = character sprites, level, HP with MP. Not recommended for a small party.
  2 = characters sprite & name, level, class, HP with MP.
  3 = Face Image, Name, level, class, HP with MP.
  4 = Face Image & Name Face, HP · MP. Not recommended for a small party.

 -You can choose to hide playtime, location, gold, etc.
 -If a location contains a "#" (Or anything you choose), that location will not
  be displayed on the save screen (This is what the script creator says, but this
  is not the case.  So I have no idea what this does...)
 
  Note:
  THIS SCRIPT IS NOT COMPATIBLE WITH OLD SAVE FILES.  IF YOU INSTALL THIS SCRIPT
  AFTER YOU HAVE ALREADY SAVED, YOU MUST START OVER.

 Update History:
 7/6 Script Released
 7/7 Fixed a bug where "#" wouldn't work correctly

 This script redifines:
 Scene_File
 Window_SaveFile

 Changing this script may result in compatability errors, so do so at your
 own risk...

=end
#==============================================================================
# Begin Customization
#==============================================================================

module DAI
 # Maximum Save Files (If 6 or more, you will have to scroll down.)
 FILE_MAX = 6

 # Save File box height. (It's not really neccessary to change this.)
 FILE_HEIGHT = 60

 # Window Arrangement (0 = left displays files, right shows stats 1 = reversed)
 FILE_ARRANGEMENT = 1       

 # Message Displayed if there is no file saved
 FILE_NOT = "Keine Datei vorhanden"
 
 # Display the play time?
 FILE_PLAY_TIME = true
 # If above is true, what term should "Play time" go by?
 FILE_PLAY_TIME_NAME = "Verstrichene Spielzeit"
 
 # Display Amount of Gold?
 FILE_GOLD = true
 # If above is true, what term should display before the gold amount?
 FILE_GOLD_NAME = " Gold im Besitz:"
 
 # Display Location Name?
 FILE_PLACE_MAP = true
 # Not exactly sure what this does, so DON'T TOUCH IT!
 FILE_MAP_NAME_DE = "#"
 
 
  # Display Type
  # 1 = character sprites, level, HP with MP. Not recommended for a small party.
  # 2 = characters sprite & name, level, class, HP with MP.
  # 3 = Face Image, Name, level, class, HP with MP.
  # 4 = Face Image & Name Face, HP · MP. Not recommended for a small party.
  FILE_TYPE = 3


 # Height of One Character in Save Window
 #(Type 1 = 32-70, type 2 = 60 to 70, Type 3 = 60 to 70, Type 4 33-70)
 FILE_LENGTN = 70
 
 
  #--------------------------------------------------------------------------
  # ? IF YOU CHOSE DISPLAY TYPE 3...
  #--------------------------------------------------------------------------

  # Display the class of all actors?
   FILE_TYPE_C_3 = true
 
  # Face Size Used on The Save Screen
  # Please note, the greater the height, the screen gets more crowded
   FILE_FACE_LENGTN_X_3 = 96 # horizontal
   FILE_FACE_LENGTN_Y_3 = 68 # vertical
 
  #--------------------------------------------------------------------------
  # ?IF YOU CHOSE DISPLAY TYPE 4...
  #--------------------------------------------------------------------------
  # Face Size Used on The Save Screen
  # Please note, the greater the height, the screen gets more crowded.
   FILE_FACE_LENGTN_X_4 = 96 # horizontal
   FILE_FACE_LENGTN_Y_4 = 31 # vertical
   
  # Face Graphic Alignment (Default aligns the eyes centered)
   TYPE_4_POSITION_Y = 20

end

#==============================================================================
# End Customization
#==============================================================================

#==============================================================================
# ¦ Scene_File
#------------------------------------------------------------------------------
#  ??????????????????
#==============================================================================
class Scene_File
  #--------------------------------------------------------------------------
  # ? ???? (????)
  #--------------------------------------------------------------------------
  alias _exmincrsv_start start
  def start
    @file_max = DAI::FILE_MAX
    _exmincrsv_start
    wh = DAI::FILE_HEIGHT
    adj = (416 - @help_window.height) % wh
    @help_window.height += adj
    @page_file_max = ((416 - @help_window.height) / wh).truncate

    for i in 0...@file_max
      window = @savefile_windows
      if @index > @page_file_max - 1
        if @index < @file_max - @page_file_max - 1
          @top_row = @index
          window.y -= @index * window.height
        elsif @index >= @file_max - @page_file_max
          @top_row = @file_max - @page_file_max
          window.y -= (@file_max - @page_file_max) * window.height
        else
          @top_row = @index
          window.y -= @index * window.height
        end
      end
      for i in window
      i.y += adj
      i.visible = (i.y >= @help_window.height and
      i.y < @help_window.height + @page_file_max * i.height)
      i.x = 404 if DAI::FILE_ARRANGEMENT == 1
      end
    end
    if DAI::FILE_ARRANGEMENT == 0
      @Save_window = Window_Dai_Save.new(140,56,make_filename(@index))
    else
      @Save_window = Window_Dai_Save.new(0,56,make_filename(@index))
    end
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  alias dai_save_terminate terminate
  def terminate
    dai_save_terminate
    @Save_window.dispose
  end
  #--------------------------------------------------------------------------
  # ? ??????????????? (???)
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @top_row = 0
    @savefile_windows = []
    for i in 0...@file_max
      a = 0
      a = 1 if FileTest.exist?(make_filename(i))
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i),a))
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????? (???)
  #     wrap : ??????????
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @file_max - 1 or wrap
      @index = (@index + 1) % @file_max
      for i in 0...@file_max
        window = @savefile_windows
        if @index == 0
          @top_row = 0
          window[@index].y = @help_window.height + i % @file_max * window[@index].height
        elsif @index - @top_row > @page_file_max - 1
          window[@index].y -= window[@index].height
        end
        window[@index].visible = (window[@index].y >= @help_window.height and
          window[@index].y < @help_window.height + @page_file_max * window[@index].height)
      end
      if @index - @top_row > @page_file_max - 1
        @top_row += 1
      end
    end
    filename = @savefile_windows[@index].filename
    @Save_window.refresh(filename)
  end
  #--------------------------------------------------------------------------
  # ? ????????? (???)
  #     wrap : ??????????
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @file_max) % @file_max
      for i in 0...@file_max
        window = @savefile_windows
        if @index == @file_max - 1
          @top_row = @file_max - @page_file_max
          window[@index].y = @help_window.height + i % @file_max * window[@index].height
          window[@index].y -= (@file_max - @page_file_max) * window[@index].height
        elsif @index - @top_row < 0
          window[@index].y += window[@index].height
        end
        window[@index].visible = (window[@index].y >= @help_window.height and
          window[@index].y < @help_window.height + @page_file_max * window[@index].height)
      end
      if @index - @top_row < 0
        @top_row -= 1
      end
    end
    filename = @savefile_windows[@index].filename
    @Save_window.refresh(filename)
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #     file : ??????????????? (??????)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
      characters.push([
      actor.character_name,
      actor.character_index,
      actor.name,
      actor.level,
      actor.class_id,
      actor.face_name,
      actor.face_index,
      actor.maxhp,
      actor.hp,
      actor.maxmp,
      actor.mp,
      ])
    end
    assistance = []
    gold = $game_party.gold
    map_name = $game_map.name
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(characters,           file)
    Marshal.dump(gold,                 file)
    Marshal.dump(map_name,             file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,         file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,       file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  file)
    Marshal.dump($game_actors,         file)
    Marshal.dump($game_party,          file)
    Marshal.dump($game_troop,          file)
    Marshal.dump($game_map,            file)
    Marshal.dump($game_player,         file)
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #     file : ??????????????? (??????)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters           = Marshal.load(file)
    gold                 = Marshal.load(file)
    map_name             = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system         = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches       = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors         = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player         = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

#==============================================================================
# ¦ Window_SaveFile
#------------------------------------------------------------------------------
#  ???????????????????????????????????
#==============================================================================
class Window_SaveFile
  #--------------------------------------------------------------------------
  # ? ????????? (???)
  #     file_index : ?????????????? (0~3)
  #     filename   : ?????
  #--------------------------------------------------------------------------
  def initialize(file_index, filename , a)
    wh = DAI::FILE_HEIGHT
    super(0, 56 + file_index % DAI::FILE_MAX * wh, 140, wh)
    @file_index = file_index
    @filename = filename
    load_gamedata
    refresh(a)
    @selected = false
  end
  #--------------------------------------------------------------------------
  # ? ??????(???)
  #--------------------------------------------------------------------------
  def refresh(a)
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = 128 unless a == 1
    name = Vocab::File + " #{@file_index + 1}"
    self.contents.draw_text(4, 0, 200, WLH, name)
    @name_width = contents.text_size(name).width
  end
end

#==============================================================================
# ¦ Window_Dai_Save
#------------------------------------------------------------------------------
#  ???????????????????????
#==============================================================================
class Window_Dai_Save < Window_Base
  #--------------------------------------------------------------------------
  # ? ?????????
  #     x : ?????? X ??
  #     y : ?????? Y ??
  #--------------------------------------------------------------------------
  def initialize(x, y, filename)
    super(x, y, 404, 360)
    load_gamedata(filename)
    refresh(filename)
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh(filename)
    self.contents.clear
    load_gamedata(filename)
    unless FileTest.exist?(filename)
      self.contents.draw_text(4, 150, self.width - 40, WLH, DAI::FILE_NOT, 1)
      return
    end
    if DAI::FILE_GOLD
      if DAI::FILE_PLAY_TIME
        draw_party_gold(0, 280, contents.width - 4, 0)
      else
        draw_party_gold(0, 307, contents.width - 4, 0)
      end
    end
    draw_playtime(0, 307, contents.width - 4, 0) if DAI::FILE_PLAY_TIME
    case DAI::FILE_TYPE
      when 1
        draw_party_characters(16, 33)
        draw_actor_hp_gauge(120, 5)
        draw_actor_hp(120, 5)
        draw_actor_mp_gauge(250, 5)
        draw_actor_mp(250, 5)
        draw_actor_level(50, 5)
      when 2
        draw_party_characters(16, 33)
        draw_actor_name(50, 5)
        draw_actor_hp_gauge(250, 5)
        draw_actor_hp(250, 5)
        draw_actor_mp_gauge(250, 30)
        draw_actor_mp(250, 30)
        draw_actor_level(50, 30)
        draw_actor_class(116, 30)
      when 3
        draw_face(0, 0, DAI::FILE_FACE_LENGTN_X_3, DAI::FILE_FACE_LENGTN_Y_3)
        if DAI::FILE_TYPE_C_3
          draw_actor_level(100, 25)
          draw_actor_class(168, 25)
          draw_actor_name(100, 0)
        else
          draw_actor_level(120, 25)
          draw_actor_name(120, 0)
        end
        draw_actor_hp_gauge(250, 0)
        draw_actor_hp(250, 0)
        draw_actor_mp_gauge(250, 25)
        draw_actor_mp(250, 25)
      when 4
        draw_face_type_4(0, 0, DAI::FILE_FACE_LENGTN_X_4, DAI::FILE_FACE_LENGTN_Y_4)
        draw_actor_hp_gauge(120, 5)
        draw_actor_hp(120, 5)
        draw_actor_mp_gauge(250, 5)
        draw_actor_mp(250, 5)
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #    ?????????????????? (??????????) ?
  #--------------------------------------------------------------------------
  def load_gamedata(filename)
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(filename)
    if @file_exist
      file = File.open(filename, "r")
      @time_stamp = file.mtime
      begin
        @characters     = Marshal.load(file)
        @gold           = Marshal.load(file)
        @map_name       = Marshal.load(file)
        @frame_count    = Marshal.load(file)
        @last_bgm       = Marshal.load(file)
        @last_bgs       = Marshal.load(file)
        @game_system    = Marshal.load(file)
        @game_message   = Marshal.load(file)
        @game_switches  = Marshal.load(file)
        @game_variables = Marshal.load(file)
        @screen_dump    = Marshal.load(file)
        @total_sec = @frame_count / Graphics.frame_rate
      rescue
        @file_exist = false
      ensure
        file.close
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #     align : ??
  #--------------------------------------------------------------------------
  def draw_party_gold(x, y, width, align)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width, WLH, DAI::FILE_GOLD_NAME + " " + @gold.to_s + " " + Vocab::gold, 2)
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #     x : ??? X ??
  #     y : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_party_characters(x, y)
    for i in 0...@characters.size
      name = @characters

*

      index = @characters[1]
      draw_character(name, index, x , y + i * DAI::FILE_LENGTN)
    end
  end
  #--------------------------------------------------------------------------
  # ? HP ????? 1 ???
  #--------------------------------------------------------------------------
  def hp_gauge_color1
    return text_color(20)
  end
  #--------------------------------------------------------------------------
  # ? HP ????? 2 ???
  #--------------------------------------------------------------------------
  def hp_gauge_color2
    return text_color(21)
  end
  #--------------------------------------------------------------------------
  # ? MP ????? 1 ???
  #--------------------------------------------------------------------------
  def mp_gauge_color1
    return text_color(22)
  end
  #--------------------------------------------------------------------------
  # ? MP ????? 2 ???
  #--------------------------------------------------------------------------
  def mp_gauge_color2
    return text_color(23)
  end
  #--------------------------------------------------------------------------
  # ? HP ???????
  #     actor : ????
  #--------------------------------------------------------------------------
  def hp_color(actor)
    return knockout_color if actor.hp == 0
    return crisis_color if actor.hp < actor.maxhp / 4
    return normal_color
  end
  #--------------------------------------------------------------------------
  # ? HP ???
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_hp(x, y, width = 120)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      maxhp = @characters[i][7]
      hp = @characters[i][8]
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + i * DAI::FILE_LENGTN, 30, WLH, Vocab::hp_a)
      self.contents.font.color = normal_color if hp >= maxhp / 4
      self.contents.font.color = crisis_color if hp < maxhp / 4
      self.contents.font.color = knockout_color if hp == 0
      xr = x + width
      if width < 120
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, hp, 2)
      else
        self.contents.draw_text(xr - 90, y + i * h, 40, WLH, hp, 2)
        self.contents.font.color = normal_color
        self.contents.draw_text(xr - 50, y + i * h, 10, WLH, "/", 2)
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, maxhp, 2)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? HP ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_hp_gauge(x, y, width = 120)
    for i in 0...@characters.size
      h = DAI::FILE_LENGTN
      gw = width * @characters[i][8] / @characters[i][7]
      gc1 = hp_gauge_color1
      gc2 = hp_gauge_color2
      n = y + i * h
      self.contents.fill_rect(x, n + WLH - 8, width, 6, gauge_back_color)
      self.contents.gradient_fill_rect(x, n + WLH - 8, gw, 6, gc1, gc2)
    end
  end
  #--------------------------------------------------------------------------
  # ? MP ???
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_mp(x, y, width = 120)
    for i in 0...@characters.size
      maxmp = @characters[i][9]
      mp = @characters[i][10]
      h = DAI::FILE_LENGTN
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + i * h, 30, WLH, Vocab::mp_a)
      self.contents.font.color = normal_color if mp >= maxmp / 4
      self.contents.font.color = crisis_color if mp < maxmp / 4
      self.contents.font.color = knockout_color if mp == 0
      xr = x + width
      if width < 120
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, mp, 2)
      else
        self.contents.draw_text(xr - 90, y + i * h, 40, WLH, mp, 2)
        self.contents.font.color = normal_color
        self.contents.draw_text(xr - 50, y + i * h, 10, WLH, "/", 2)
        self.contents.draw_text(xr - 40, y + i * h, 40, WLH, maxmp, 2)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? MP ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #--------------------------------------------------------------------------
  def draw_actor_mp_gauge(x, y, width = 120)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      if @characters[i][9] > 0
        gw = width * @characters[i][10] / @characters[i][9]
      else
        gw = 0
      end
      gc1 = mp_gauge_color1
      gc2 = mp_gauge_color2
      n = y + i * h
      self.contents.fill_rect(x, n + WLH - 8, width, 6, gauge_back_color)
      self.contents.gradient_fill_rect(x, n + WLH - 8, gw, 6, gc1, gc2)
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_actor_level(x, y)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      self.contents.font.color = system_color
      self.contents.draw_text(x, y + i * h, 32, WLH, Vocab::level_a)
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 32, y + i * h, 24, WLH, @characters[i][3], 2)
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_actor_name(x, y)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      self.contents.font.color = normal_color
      self.contents.font.color = knockout_color if @characters[i][8] == 0
      self.contents.draw_text(x , y + i * h,108 , WLH, @characters[i][2], 0)
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_actor_class(x, y)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      id = @characters[i][4]
      c = $data_classes[id].name
      self.contents.font.color = normal_color
      self.contents.draw_text(x , y + i * h,108 , WLH, c, 0)
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #     x            : ??? X ??
  #     y            : ??? Y ??
  #     size_x       : ?????x
  #     size_y       : ?????y
  #--------------------------------------------------------------------------
  def draw_face(x, y, size_x = 96,size_y = 57)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      face_name = @characters[i][5]
      face_index = @characters[i][6]
      bitmap = Cache.face(face_name)
      rect = Rect.new(0, 0, 0, 0)
      rect.x = face_index % 4 * 96 + (96 - size_x) / 2
      rect.y = face_index / 4 * 96 + (96 - size_y) / 2
      rect.width = size_x
      rect.height = size_y
      self.contents.blt(x, y + i * h, bitmap, rect)
      bitmap.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????????(???4??)
  #     x            : ??? X ??
  #     y            : ??? Y ??
  #     size_x       : ?????x
  #     size_y       : ?????y
  #--------------------------------------------------------------------------
  def draw_face_type_4(x, y, size_x = 96,size_y = 57)
    h = DAI::FILE_LENGTN
    for i in 0...@characters.size
      face_name = @characters[i][5]
      face_index = @characters[i][6]
      bitmap = Cache.face(face_name)
      rect = Rect.new(0, 0, 0, 0)
      rect.x = face_index % 4 * 96 + (96 - size_x) / 2
      rect.y = face_index / 4 * 96 + (96 - size_y - DAI::TYPE_4_POSITION_Y) / 2
      rect.width = size_x
      rect.height = size_y
      self.contents.blt(x, y + i * h, bitmap, rect)
      bitmap.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #     width : ?
  #     align : ??
  #--------------------------------------------------------------------------
  def draw_playtime(x, y, width, align)
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    time_string = sprintf("%02d:%02d", hour, min)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, width, WLH, DAI::FILE_PLAY_TIME_NAME+" " + time_string, 2)
  end
end
class Game_Map
  def name
    return load_data("Data/MapInfos.rvdata")[@map_id].name
  end
end

MfG
Deity



Re: Hilfe zu Skripten.

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #432 am: Juni 04, 2010, 20:17:25 »
Deity du bist ein Lebensretter, funktioniert (bis jetzt) ohne Probleme, danke! <3


Projekt by FlipelyFlip

Re: Hilfe zu Skripten.

Offline Ðeity

  • No Pain, no gain!
  • Administrator
  • Eventmeister
  • ****
  • Beiträge: 427
  • No Pain, no Gain!
    • Deity-VX
Re: Hilfe zu Skripten.
« Antwort #433 am: Juni 04, 2010, 22:35:37 »
Kein Problem, immer wieder gern. ^^

MfG
Deity



Re: Hilfe zu Skripten.

Offline koushirou

  • Database-Verunstalter
  • **
  • Beiträge: 174
Re: Hilfe zu Skripten.
« Antwort #434 am: Juni 06, 2010, 18:16:24 »
edit: wah, was hat das Forum mit meinem Post gemacht x_x *noch mal versuch*

Noch eine kleine Frage, ich benutze das Neo Message System (von Woratana)
und möchte das Namenskästchen auf der rechten Seite anzeigen lassen, finde dazu aber keine Befehl
könnte ich den Befehl nun einfügen? (und wenn ja möchte jemand das für mich machen)
oder gibt es ein anderes Skript mit dem Befehl der sich aber nicht mit dem Neo Skript beißt?

Dann hätte ich noch eine Frage zum GubiD's Tactical Battle System, gibt es ein Add-on oder ähnliches dafür
damit man beispielsweise auch Skill und Victoryposen einbauen kann?
« Letzte Änderung: Juni 06, 2010, 20:28:06 von koushirou »


Projekt by FlipelyFlip

 


 Bild des Monats

rooftop party

Views: 3583
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal