collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

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

Offline Colonios

  • Maker Nerd
  • VX-Kenner
  • ****
  • Beiträge: 596
  • Events <3
Re: Hilfe zu Skripten.
« Antwort #270 am: September 28, 2009, 13:39:58 »
Hey Jungs :)

Ich bin in den letzten zügen von meiner Eventsammlung und feile nur noch an kleinigkeiten. Ihr könnt mir echt wahnsinnig helfen, wenn ihr eine Lösung zu meinem Problem habt.
Schnelle Frage: Ich will Speichern und Laden ohne Save-Screen (also quasi ein Auto-Save/Load) per Script-Befehl. Also sowas wie dieser Befehl $save.("Filename") oder $load.("Filename")
Ist das möglich? Ich hab mir schon Scene_File angeschaut, blicke auch durch, aber meine RGSS kenntnisse sind einfach zu gering...

Danke im Voraus!
MfG
« Letzte Änderung: September 28, 2009, 13:40:09 von Colonios »

Re: Hilfe zu Skripten.

Offline Herendil

  • Jarl Turindo
  • Moderator
  • Mr. MACK-Tile
  • ***
  • Beiträge: 283
  • Jarl Turindo
Re: Hilfe zu Skripten.
« Antwort #271 am: September 28, 2009, 15:56:10 »
Hey Jungs :)

Ja das gibt es. Ich finde zwar das Topic auf RRR nicht, aber es gäbe da eines von Wora (Credits an ihn!)
Spoiler for Hiden:
#=======================================================================
# ? [VX] ? Quick Save / Load / Delete ? ?
# * Save/Load/Delete save file you want with call script *
#-------------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 22/05/2008
# ? Version: 1.0
#=======================================================================

#==================================================================
# ** FEATURES **
#-----------------------------------------------------------------
# - Call script to save/load/delete any save slot
# - Compatible with most of the scripts that edited Scene_File

#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# - To do a quick save, call script:
#  $save.do(slot)
# For example: $save.do(1)
# * Script above will save in slot 1
#
# - To do a quick save on last slot that you use quick save, call script:
#  $save.redo
#-----------------------------------------------------------------
# - To do a quick load, call script:
#  $load.do(slot)
#
# - To do a quick load on last slot that you use quick load, call script:
#  $load.redo
#-----------------------------------------------------------------
# - To do a quick delete save file, call script:
#  $save.del(slot)
#-----------------------------------------------------------------
#                             +[ TIP ]+
# If you want to use value in variable for slot, type this for slot:
# $game_variables[variable_id]
# For example: $save.do ($game_variables[1])
#===========================================================================

#--------------------------
# ** START SETUP PART
#--------------------------

QUICK_LOAD_FADE_SCREEN = true # (true/false)
# Do you want screen to fade when using Quick Load?

#--------------------------
# ** END SETUP PART
#--------------------------

$worale = {} if $worale.nil?
$worale["QuickSave"] = true
#-------------------------------
# Quick Save
#-------------------------------
class Quick_Save
  def do(slot = 0)
    return if slot == 0
    $game_system.last_qsave_slot = slot
    save = Scene_File.new(false,false,false,1,slot)
  end
 
  def redo
    save = Scene_File.new(false,false,false,1, $game_system.last_qsave_slot)
  end
 
  def del(slot = 0)
    return if slot == 0
    delete = Scene_File.new(false,false,false,3,slot)
  end
end
$save = Quick_Save.new
#-------------------------------
# Quick Load
#-------------------------------
class Quick_Load
  def do(slot = 0)
    return if slot == 0
    $game_system.last_qload_slot = slot
    save = Scene_File.new(false,false,false,2,slot)
  end
 
  def redo
    save = Scene_File.new(false,false,false,2, $game_system.last_qsave_slot)
  end
end
$load = Quick_Load.new
#------------------------------------
# Game System: Store Variables
#------------------------------------
class Game_System
  attr_accessor :last_qsave_slot, :last_qload_slot
  alias wor_qsave_gamsys_ini initialize
  def initialize
    wor_qsave_gamsys_ini
    @last_qsave_slot = 1
    @last_qload_slot = 1
  end
end
#------------------------------------
# Scene File: Save/Load/Delete File
#------------------------------------
class Scene_File < Scene_Base
  alias wor_qsave_scefil_ini initialize
 
  def initialize(saving, from_title, from_event, skip = 0, slot = 0)
    filename = make_filename(slot - 1) if slot >= 0
    if skip == 1 and slot > 0
      file = File.open(filename, "wb")
      write_save_data(file)
      file.close
      return
    elsif skip == 2 and slot > 0
      return if not FileTest.exist?(filename)
      file = File.open(filename, "rb")
      read_save_data(file)
      file.close
      $scene = Scene_Map.new
      if QUICK_LOAD_FADE_SCREEN
        RPG::BGM.fade(1)
        Graphics.fadeout(1)
        Graphics.wait(1)
      end
      @last_bgm.play
      @last_bgs.play
    elsif skip == 3 and slot > 0
      File.delete(filename) if FileTest.exist?(filename)
    else
      wor_qsave_scefil_ini(saving, from_title, from_event)
    end
  end
end

(Steinigt mich, wenn das exklusiv für RRR war :/ )

Re: Hilfe zu Skripten.

Offline KaN43

  • RTP-Mapper
  • *
  • Beiträge: 29
  • Kira sieht dich !
Re: Hilfe zu Skripten.
« Antwort #272 am: September 28, 2009, 16:49:03 »
Hi,

ich habe ein Problem mit dem Illumino Skript von hell:

Ich habe als erstes ein Common Event erstellt, das ein Bild über dem Spieler anzeigt,
sodass es dann so aussieht als ob man eine eingeschränkte Sichtweite hat.(Praktisch ein Bild mit nem Kreis in der mitte)
Das funktioniert auch, aber wenn ich jetzt auf einer Map ein LE per Illumino einsetzte verträgt sich das nicht mit dem anderen Bild.
Hoffe, dass ihr das so halbwegs verstanden habt.

MfG

Re: Hilfe zu Skripten.

Offline Colonios

  • Maker Nerd
  • VX-Kenner
  • ****
  • Beiträge: 596
  • Events <3
Re: Hilfe zu Skripten.
« Antwort #273 am: September 28, 2009, 20:04:11 »
Sehr gut, dass ist genau das, was ich brauche! Danke Herendil!

MfG

Re: Hilfe zu Skripten.

Offline Franky

  • Blutiger Fortgeschrittener
  • Eventmeister
  • ***
  • Beiträge: 390
Re: Hilfe zu Skripten.
« Antwort #274 am: September 30, 2009, 19:34:44 »
Endlich bin ich dahintergekommen, was die meisten Fehlermeldungen bedeuten:

Man muss einfach einen neuen Spielstand anlegen... dort funktioniert alles.
Naja, aufwendig.

Re: Hilfe zu Skripten.

Offline Kasaar

  • Epic Scripter !!
  • Eventmeister
  • ***
  • Beiträge: 305
  • Satanistischer Misantroph... noch Fragen? ]:)
Re: Hilfe zu Skripten.
« Antwort #275 am: Oktober 03, 2009, 12:15:08 »
Bräuchte Hilfe bei nem kleinen Condition-Script.. und zwar soll abgefragt werden, ob die Waffe mindestens 2 mal im Inventar vorhanden ist...
Wie müsste ich das machen?
Besucht mich auf


Und gebt Kommentare im Blog =)

Re: Hilfe zu Skripten.

Offline BaryK

  • Ralph
  • *
  • Beiträge: 10
Re: Hilfe zu Skripten.
« Antwort #276 am: Oktober 14, 2009, 17:47:16 »
ich weiß nicht obs hier rein passt aber hab da mal ne frage...

Wie kann man Schilde weglassen...sodass die auch bei ausrüstung nicht mehr zu sehen sind?

Mehrere Menüpunkte

Offline Franky

  • Blutiger Fortgeschrittener
  • Eventmeister
  • ***
  • Beiträge: 390
Mehrere Menüpunkte
« Antwort #277 am: Oktober 15, 2009, 18:33:51 »
Wie bekomme ich es hin, dass es mehr Menüpunkte im Menü gibt?
Als Beispiel: Script Questlog und Script Monsteralbum und Script Erfolge
Es erscheint immer nur ein Menüpunkt, je nach Reihenfolge der Scripts. Die anderen müssen durch Items aufgerufen werden.
Ist es möglich alle 3 in das Menü zu packen?



~Das braucht erstmal kein eigenes Thema ;)

MfG, Colo
« Letzte Änderung: Oktober 15, 2009, 21:02:26 von Colonios »

Re: Hilfe zu Skripten.

Offline Kasaar

  • Epic Scripter !!
  • Eventmeister
  • ***
  • Beiträge: 305
  • Satanistischer Misantroph... noch Fragen? ]:)
Re: Hilfe zu Skripten.
« Antwort #278 am: Oktober 18, 2009, 12:20:27 »
Hab ma wieder ne frage zum Scripten :/ und zwar wollt ich ma fragen obs möglich is bei commands den Namen abzufragen... z.B so:

@weap_array = []
w1 = "Schwert"
if $game_party.has_item?($data_weapons[10],true)
   @weap_array.push(w1)
end
@command_window = Window_Command.new(160, @weap_array)
end

def update_command_selection
   case @command_window.index
      when "Schwert"     
        $game_actors[1].change_equip_by_id(0, 1)
...
ist das irgendwie möglich?
Besucht mich auf


Und gebt Kommentare im Blog =)

Re: Hilfe zu Skripten.

Offline Franky

  • Blutiger Fortgeschrittener
  • Eventmeister
  • ***
  • Beiträge: 390
Re: Hilfe zu Skripten.
« Antwort #279 am: Oktober 18, 2009, 13:37:01 »
Frage:
Ich habe folgendes Skript zum Anzeigen von Zeit und Ort:
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/   ?       Play Time And Location Window - MRA_LocationPlayTimeWindow ? VX ?
#_/   ?                      Last Update: 2008/09/16                          ?
#_/   ?                      Created by Mr. Anonymous                         ?
#_/   ? Creator's Blog:                                                       ?
#_/   ? http://mraprojects.wordpress.com                                      ?
#_/----------------------------------------------------------------------------
#_/  This script adds a location and playtime window into the menu.
#_/============================================================================
#_/ Install: Insert above main.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#=============================================================================#
#                             ? Customization ?                               #
#=============================================================================#
module MRA
  module LocationPlayTimeWindow
  #            ? Full Size Location and Play Time Windows Toggle ?
  #  This toggle allows you to enable/disable the full-size Location and Play
  #   Time windows that display the below-specified messages above the values.
  #  true = Full Sized windows in effect.
  #  false = Compact windows in effect.
    FULL_SIZE_WINDOWS = false
  #                 ? Use Combined PlatTime/Location Window ?
  
    USE_COMBINED_WINDOW = false
  #                           ? Show Time Window ?    
    SHOW_TIME = true
  #                          ? Show Location Window ?    
    SHOW_LOCATION = true
  #                          ? Location Window Text ?
    LOC_TEXT = "Ort:"
    
  #                          ? PlayTime Window Text ?
    PT_TEXT = "Zeit gespielt:"
    
  end
end
#==============================================================================
# ¦ Game_Map
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # ? Open Global Variable
  #--------------------------------------------------------------------------
  attr_reader   :map_id
  #--------------------------------------------------------------------------
  # ? Convert and Load Map Name
  #--------------------------------------------------------------------------
  def map_name
    $map_name = load_data("Data/MapInfos.rvdata")
    $map_name[@map_id].name
  end
end

#==================================End Class===================================#

#==============================================================================
# ¦ Window_MapName
#------------------------------------------------------------------------------
# Create the window containing the current map's name.
#==============================================================================
if MRA::LocationPlayTimeWindow::USE_COMBINED_WINDOW == false
if MRA::LocationPlayTimeWindow::SHOW_LOCATION == true
  #--------------------------------------------------------------------------
  # ? Initialize
  #--------------------------------------------------------------------------
  class Window_Mapname < Window_Base
    def initialize(x, y)
      if MRA::LocationPlayTimeWindow::FULL_SIZE_WINDOWS == true
        super(x, y + 6, 160, WLH + 64)
      else
        super(x, y + 92, 160, WLH + 22)
      end
      refresh
    end  
    
    #--------------------------------------------------------------------------
    # ? Refresh
    #--------------------------------------------------------------------------  
    def refresh
      self.contents.clear
      self.contents.font.color = normal_color
      if MRA::LocationPlayTimeWindow::FULL_SIZE_WINDOWS == true
        self.contents.font.color = system_color
        self.contents.draw_text(4, 0, 120, 32, MRA::LocationPlayTimeWindow::LOC_TEXT)
        self.contents.font.color = normal_color
        self.contents.draw_text(4, 32, 120, 32, $game_map.map_name.to_s, 2)
      else
        self.contents.draw_text(4, -8, 120, 30, $game_map.map_name.to_s, 2)
      end
    end
  end
end
end
#==================================End Class===================================#
#==============================================================================
# ¦ Window_Time
#------------------------------------------------------------------------------
# Create the window containing the running playtime.
#==============================================================================
if MRA::LocationPlayTimeWindow::USE_COMBINED_WINDOW == false
if MRA::LocationPlayTimeWindow::SHOW_TIME == true
    #--------------------------------------------------------------------------
    # ? Initialize
    #--------------------------------------------------------------------------
  class Window_Time < Window_Base
    def initialize(x, y)
      if MRA::LocationPlayTimeWindow::FULL_SIZE_WINDOWS == true
        super(x, y + 2, 160, WLH + 64)
      else
        super(x, y + 46, 160, WLH + 22)
      end
      refresh
    end
    
    #--------------------------------------------------------------------------
    # ? Refresh
    #--------------------------------------------------------------------------    
    def refresh
      self.contents.clear
      if MRA::LocationPlayTimeWindow::FULL_SIZE_WINDOWS == true
        self.contents.font.color = system_color
        self.contents.draw_text(4, 0, 120, 32, MRA::LocationPlayTimeWindow::PT_TEXT)
      end
      @total_seconds = Graphics.frame_count / Graphics.frame_rate
      
      hours    =  @total_seconds / 60 / 60
      minutes  =  @total_seconds / 60 % 60
      seconds  =  @total_seconds % 60
      
      text = sprintf("%02d:%02d:%02d",  hours,  minutes,  seconds)
      
      self.contents.font.color = normal_color
      if MRA::LocationPlayTimeWindow::FULL_SIZE_WINDOWS == true
        self.contents.draw_text(4, 32, 120, 32, text, 2)
      else
        self.contents.draw_text(4,  -8,  120,  30,  text,  2)
      end
    end
    #--------------------------------------------------------------------------
    # ? Update
    #--------------------------------------------------------------------------  
    def update
      super
      if Graphics.frame_count / Graphics.frame_rate != @total_seconds
        refresh
      end
    end
  end
end
end

#==============================================================================
# ¦ Window_TimeMapName
#------------------------------------------------------------------------------
# Create the window containing the current play time and map's name.
#==============================================================================
if MRA::LocationPlayTimeWindow::USE_COMBINED_WINDOW == true
  #--------------------------------------------------------------------------
  # ? Initialize
  #--------------------------------------------------------------------------
  class Window_TimeMapname < Window_Base
    def initialize(x, y)
      super(x, y + 4, 160, WLH + 64)
      refresh
    end  
    #--------------------------------------------------------------------------
    # ? Refresh
    #--------------------------------------------------------------------------  
    def refresh
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(-2, -12, 120, 32, MRA::LocationPlayTimeWindow::LOC_TEXT)
      self.contents.draw_text(-2,  18, 120, 32, MRA::LocationPlayTimeWindow::PT_TEXT)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 3, 120, 32, $game_map.map_name.to_s, 2)
      @total_seconds = Graphics.frame_count / Graphics.frame_rate
      
      hours    =  @total_seconds / 60 / 60
      minutes  =  @total_seconds / 60 % 60
      seconds  =  @total_seconds % 60
        
      text = sprintf("%02d:%02d:%02d",  hours,  minutes,  seconds)
      self.contents.draw_text(4, 33, 120, 32, text, 2)
    end
    #--------------------------------------------------------------------------
    # ? Update
    #--------------------------------------------------------------------------  
    def update
      super
      if Graphics.frame_count / Graphics.frame_rate != @total_seconds
        refresh
      end
    end
  end
end
#==================================End Class===================================#
#==============================================================================
# ¦ Scene_Menu
#------------------------------------------------------------------------------
# Update Scene_Menu class to include the new windows.
#==============================================================================

  #--------------------------------------------------------------------------
  # ? Start Processing
  #--------------------------------------------------------------------------
class Scene_Menu < Scene_Base
  alias start_MRA_LocationPlayTimeWindow start
    def start
      if MRA::LocationPlayTimeWindow::USE_COMBINED_WINDOW == false
        if MRA::LocationPlayTimeWindow::SHOW_TIME
          @playtime_window = Window_Time.new(0,  270)
          @playtime_window.openness = 0
          @playtime_window.open
        end
        if MRA::LocationPlayTimeWindow::SHOW_LOCATION
          @mapname_window = Window_Mapname.new(0,  178)
          @mapname_window.openness = 0
          @mapname_window.open
        end
      else
        @timemapname_window = Window_TimeMapname.new(0, 270)
        @timemapname_window.openness = 0
        @timemapname_window.open
      end
=begin
      if $imported["PlaceMission"]
      @info_window = Window_Information.new
      @info_window.back_opacity = 160
      @info_window.x = 160
      @info_window.y = 264
      end
=end
      start_MRA_LocationPlayTimeWindow
    end

  #--------------------------------------------------------------------------
  # ? Termination Processing
  #--------------------------------------------------------------------------
  alias terminate_MRA_LocationPlayTimeWindow terminate
    def terminate
      if MRA::LocationPlayTimeWindow::USE_COMBINED_WINDOW == false
        if MRA::LocationPlayTimeWindow::SHOW_TIME
          @playtime_window.dispose
        end
        if MRA::LocationPlayTimeWindow::SHOW_LOCATION
          @mapname_window.dispose
        end
      else
        @timemapname_window.dispose
      end
      #@info_window.dispose if @info_window != nil
      terminate_MRA_LocationPlayTimeWindow
    end

  #--------------------------------------------------------------------------
  # ? Frame Update
  #--------------------------------------------------------------------------
  alias update_MRA_LocationPlayTimeWindow update
    def update
      if MRA::LocationPlayTimeWindow::USE_COMBINED_WINDOW == false
        if MRA::LocationPlayTimeWindow::SHOW_TIME
          @playtime_window.update
        end
        if MRA::LocationPlayTimeWindow::SHOW_LOCATION
          @mapname_window.update
        end
      else
        @timemapname_window.update
      end
      #@info_window.update if @info_window != nil
      update_MRA_LocationPlayTimeWindow
    end
end
#==================================End Class===================================#

Nun tritt folgender Fehler auf, wenn ich im ersten Menü vor Spielbeginn auf "Fortsetzen" gehe. Dort erscheinen alle Speicherdaten zum Auswählen. Wenn ich nun wieder mit Esc zurück ins Vorherige Menü gehe, kommt folgender Fehler:
« Letzte Änderung: Oktober 18, 2009, 13:37:51 von Franky »

Re: Hilfe zu Skripten.

Offline Dennvo

  • Exikutive-Maker
  • Database-Verunstalter
  • **
  • Beiträge: 124
  • Aktuelles Projekt: Lumenia Remake!
    • http://www.craften.de
Re: Hilfe zu Skripten.
« Antwort #280 am: Oktober 21, 2009, 19:42:59 »
Jo Leuts,

hab da nen Prob mit dem Script wo man die Lebensanzeigen beim Kaduki KS ändern kann.
und zwar zeigt er bei mir da einen Fehler an.

Spoiler for Hiden:

Dieser Fehler befindet sich dann in diesem Code
    def name_bitmap(actor)
    bitmap = Bitmap.new(100, 24)
    bitmap.font.size = 16
    bitmap.draw_text_f(0, 0, 100, 24, actor.name)
    return bitmap
  end

Und der Fehler trit in dieser Zeile auf    bitmap.draw_text_f(0, 0, 100, 24, actor.name)
Ich hoffe ihr könnt mir da bitte irgendwie weiterhelfen.

MfG †-.-Dennvo-.-†

Re: Hilfe zu Skripten.

Offline saschb2b

  • Ralph
  • *
  • Beiträge: 19
  • Aktuelles Projekt: Lumenia Remake!
    • www.lumeniagame.de
Re: Hilfe zu Skripten.
« Antwort #281 am: Oktober 23, 2009, 15:38:58 »
Ich besitze den FULL Tastatur Script, nur leider fehlt mir der Comment um abzufragen ob eine Taste X gedrückt bzw gehalten wird.
Außerdem fehlt mir der Credit. Wäre euch echt dankbar über diese beiden Hilfen!

Hier noch der Script.
Er ist in 2 Teile geteilt

Zum einen in eine Erweiterung zur Main
Spoiler for Hiden:
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

unless $keybd
  $keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
  $keybd.call 0xA4, 0, 0, 0
  $keybd.call 13, 0, 0, 0
  $keybd.call 13, 0, 2, 0
  $keybd.call 0xA4, 0, 2, 0
end
$keybd = true

Und zum Anderen als Materials Zusatz:
Spoiler for Hiden:
class W32API
  attr_reader         :tasten   #Der Hash der Tastennamen in Hexa-Code umwandelt
  attr_reader         :retasten #Der Hash der Hexa-Code in Tastennamen umwandelt
  def initialize()
    @key_push = Win32API.new('user32', "GetAsyncKeyState", 'i', 'i')
    $key_press = Win32API.new('user32', "keybd_event", 'iiii', '')
    @tasten = Hash.new(
      #--------------------------Maus
      "l mouse" =>      0x01,   #Linke Maustaste
      "r mouse" =>      0x02,   #Rechte Maustaste
      "m mouse" =>      0x04,   #Mittlere Maustaste
      #--------------------------Special
      "back" =>         0x08,   #Backspace
      "tab" =>          0x09,   #Tabulator-Taste
      "enter" =>        0x0D,   #Enter
      "shift" =>        0x10,   #Eine der Shift-Tasten
      "strg" =>         0x11,   #Alt Gr-Taste oder eine der Strg-Tasten
      "alt" =>          0x12,   #Eine alt oder die Num-Block-Taste5 mit num lock
      "umschalt" =>     0x14,   #Umschalttaste
      "esc" =>          0x1B,   #Escape
      "space" =>        0x20,   #Leertaste
      #--------------------------Extra-Block
      "bild oben" =>    0x21,
      "bild unten" =>   0x22,
      "ende" =>         0x23,
      "pos1" =>         0x24,
      #--------------------------Pfeil
      "left" =>         0x25,
      "links" =>        0x25,   #-
      "up" =>           0x26,
      "hoch" =>         0x26,   #-
      "oben" =>         0x26,   #-
      "right" =>        0x27,
      "rechts" =>       0x27,   #-
      "down" =>         0x28,
      "unten" =>        0x28,   #-
      #--------------------------Extra-Block
      "snapshot" =>     0x2C,
      "einfg" =>        0x2D,
      "entf" =>         0x2E,
      #--------------------------Zahlen
      "0" =>            0x30,
      "1" =>            0x31,
      "2" =>            0x32,
      "3" =>            0x33,
      "4" =>            0x34,
      "5" =>            0x35,
      "6" =>            0x36,
      "7" =>            0x37,
      "8" =>            0x38,
      "9" =>            0x39,
      #--------------------------Alphabet
      "a" =>            0x41,
      "b" =>            0x42,
      "c" =>            0x43,
      "d" =>            0x44,
      "e" =>            0x45,
      "f" =>            0x46,
      "g" =>            0x47,
      "h" =>            0x48,
      "i" =>            0x49,
      "j" =>            0x4A,
      "k" =>            0x4B,
      "l" =>            0x4C,
      "m" =>            0x4D,
      "n" =>            0x4E,
      "o" =>            0x4F,
      "p" =>            0x50,
      "q" =>            0x51,
      "r" =>            0x52,
      "s" =>            0x53,
      "t" =>            0x54,
      "u" =>            0x55,
      "v" =>            0x56,
      "w" =>            0x57,
      "x" =>            0x58,
      "y" =>            0x59,
      "z" =>            0x5A,
      #--------------------------Special
      "l windows" =>    0x5B,   #linke "Windows-Taste"
      "r windows" =>    0x5C,   #rechte "Windows-Taste"
      #--------------------------Num-Block
      "num 0" =>        0x60,
      "num 1" =>        0x61,
      "num 2" =>        0x62,
      "num 3" =>        0x63,
      "num 4" =>        0x64,
      "num 5" =>        0x65,
      "num 6" =>        0x66,
      "num 7" =>        0x67,
      "num 8" =>        0x68,
      "num 9" =>        0x69,
      "num *" =>        0x6A,
      "num +" =>        0x6B,
      "num -" =>        0x6D,
      "num ," =>        0x6E,
      "num /" =>        0x6F,
      #--------------------------F-Zeichen
      "F1" =>           0x70,
      "F2" =>           0x71,
      "F3" =>           0x72,
      "F4" =>           0x73,
      "F5" =>           0x74,
      "F6" =>           0x75,
      "F7" =>           0x76,
      "F8" =>           0x77,
      "F9" =>           0x78,
      "F10" =>          0x79,
      "F11" =>          0x7A,
      "F12" =>          0x7B,
      #--------------------------Num-Block
      "num lock" =>     0x90,
      #--------------------------Extra-Block
      "scroll" =>       0x91,
      #--------------------------Special
      "l shift" =>      0xA0,
      "r shift" =>      0xA1,
      "l strg" =>       0xA2,
      "r strg" =>       0xA3,
      "l alt" =>        0xA4,
      "alt gr" =>       0xA5,
      #--------------------------Sonderzeichen
      "ü" =>            0xBA,
      "+" =>            0xBB,
      "," =>            0xBC,
      "-" =>            0xBD,
      "." =>            0xBE,
      "#" =>            0xBF,
      "ö" =>            0xC0,
      #--------------------------Special
      "menü" =>         0xD5,
      #--------------------------Sonderzeichen
      "ß" =>            0xDB,
      "^" =>            0xDC,
      "´" =>            0xDD,
      "ä" =>            0xDE,
      "<" =>            0xE2
    )
    @tasten = @tasten[1]
    @retasten = @tasten.invert
    @nmomw = 1
    @nmoma = -1
  end
  #-----------------------------------------------------------------------------
  ####Rückgabe    Wandelt einen String in die Zeichen um, die durch
  #   drücken der Shift-Taste herauskommen
  ####Parameter
  #str      :Der umzuwandelnde String
  #-----------------------------------------------------------------------------
  def shift_string(str)
    str = str.tr(('a'..'z').to_a.join+'^1234567890ß´äöü+#<,.-',
           ('A'..'Z').to_a.join+'°!"§$%&/()=?`ÄÖÜ*\'>;:_')
    return(str)
  end
  #-----------------------------------------------------------------------------
  ####Rückgabe    Wandelt einen String in die Zeichen um, die durch
  #   drücken der Alt Gr-Taste herauskommen
  ####Parameter
  #str      :Der umzuwandelnde String
  #-----------------------------------------------------------------------------
  def altgr_string(str)
    str = str.tr('237890ßqe+<m', '²³{[]}\@€~|µ')
    return(str)
  end
  #-----------------------------------------------------------------------------
  ####Rückgabe    True, wenn die Taste gerade angefangen wird zu drücken.
  ####Parameter
  #taste    :Der Name der zu überprüfenden Taste
  #-----------------------------------------------------------------------------
  def an?(taste)
    if(@tasten[taste])
      iff = @key_push.call(@tasten[taste])
      if(iff < 0)
        ret=true
      else
        ret=false
      end
      return(ret)
    else
      return(false)
    end
  end
  #-----------------------------------------------------------------------------
  ####Rückgabe    True, wenn die Taste gedrückt ist.
  ####Parameter
  #taste    :Der Name der zu überprüfenden Taste
  #-----------------------------------------------------------------------------
  def press?(taste)
    if(@tasten[taste])
      iff = @key_push.call(@tasten[taste])
      if(iff != 0 and iff != 1)
        ret=true
      else
        ret=false
      end
      return(ret)
    else
      return(false)
    end
  end
  #-----------------------------------------------------------------------------
  ####Rückgabe    True, wenn die Taste gedrückt ist.
  ####Parameter
  #taste    :Der Hexadezimale Code der zu überprüfenden Taste
  #-----------------------------------------------------------------------------
  def pressc?(taste)
    if(@retasten[taste])
      iff = @key_push.call(taste)
      if(iff != 0 and iff != 1)
        ret=true
      else
        ret=false
      end
      return(ret)
    else
      return(false)
    end
  end
  #-----------------------------------------------------------------------------
  #Drückt eine Taste Extrem kurz (Wird von anderen
  #   Scripten nicht erfasst, aber von Windows ;) )
  ####Parameter
  #taste    :Gibt die Taste an, die gedrückt werden soll
  #-----------------------------------------------------------------------------
  def keypress(taste)
    keydown(taste)
    keyup(taste)
  end
  #-----------------------------------------------------------------------------
  #Drückt eine Taste ab jetzt
  ####Parameter
  #taste    :Gibt die Taste an, die gedrückt werden soll
  #-----------------------------------------------------------------------------
  def keydown(taste)
    if(@tasten[taste])
      $key_press.call(@tasten[taste], 0, 0x0, 0)
    end
  end
  #-----------------------------------------------------------------------------
  #Macht eine gedrückte Taste hoch
  ####Parameter
  #taste    :Gibt die Taste an, die gehoben werden soll
  #-----------------------------------------------------------------------------
  def keyup(taste)
    if(@tasten[taste])
      $key_press.call(@tasten[taste], 0, 0x2, 0)
    end
  end
end
$api = W32API.new

Vielen Dank im Voraus!

Saschb2b
C#, HTML/CSS und PHP kann ich gut, doch in Ruby bin ich ein N00b!

                       

PS3 Trophies


Powered by Windows 7

Re: Hilfe zu Skripten.

Offline Dennvo

  • Exikutive-Maker
  • Database-Verunstalter
  • **
  • Beiträge: 124
  • Aktuelles Projekt: Lumenia Remake!
    • http://www.craften.de
Re: Hilfe zu Skripten.
« Antwort #282 am: Oktober 23, 2009, 15:50:03 »
So habe mein Prob nun geschaft selber zu lösen.
Für die die es Interesiert und das selbe Problem haben hier die Lösung.

Geht einfach in die Zeile 144 und nimmt dann ersetzt diese dann durch diese Zeile hier
    bitmap.draw_text(0, 0, 100, 24, actor.name)
Im Grunde musste man einfach nur das _f hinter dem text wegnehmen, aber naja.

MfG †-.-Dennvo-.-†

Re: Hilfe zu Skripten.

Offline Kasaar

  • Epic Scripter !!
  • Eventmeister
  • ***
  • Beiträge: 305
  • Satanistischer Misantroph... noch Fragen? ]:)
Re: Hilfe zu Skripten.
« Antwort #283 am: Oktober 24, 2009, 15:25:10 »
Hey Ho Community..
Hab ein Problem mit Woratanas Minimap script...
Funktioneirt fast alles wunderbar...
Das einzige was blöd ist, es sollte eigentlich events auf der Map anzeigen könne, tut es aber irgendwie nit :/
Kann mir das jemand erklärn? hier das Script:
Spoiler for Hiden:
#==============================================================================
# ** MiniMap V1.0
# MiniMap.rb von Woratana (04.10.2008)
#------------------------------------------------------------------------------
# http://www.rpg-studio.de/scriptdb/node/178
# http://www.rpg-studio.de/forum/index.php?page=Thread&threadID=31236
# http://www.rpgrevolution.com/forums/?showtopic=17207
#==============================================================================
 
#===============================================================
# ? [VX] ? MiniMap ? ?
# * Plug N Play Minimap (Don't need image~) *
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 09/06/2008
# ? Version: 1.0
#--------------------------------------------------------------
# ? Credit: KGC for XP MiniMap Script,
# this script can't be done without his MiniMap.
#--------------------------------------------------------------
 
module MiniMap
  #===========================================================================
  # [START] MINIMAP SCRIPT SETUP PART
  #---------------------------------------------------------------------------
  SWITCH_NO_MINIMAP = 10 # Turn ON this switch to NOT SHOW minimap
 
  MAP_RECT = [410, 20, 150, 150] # Minimap size and position
  # [X, Y, Width, Height]
  # You can change it in game, by call script:
  # $game_system.minimap = [X, Y, Width, Height]
 
  MAP_Z = 0 # Minimap's Z-coordinate
  # Increase this number if there is problem that minimap show below some objects.
 
  GRID_SIZE = 7 # Minimap's grid size. Recommend to use more than 3.
 
  MINIMAP_BORDER_COLOR = Color.new(0, 0, 255, 160) # Minimap's border color
  # Color.new(Red, Green, Blue, Opacity)
  MINIMAP_BORDER_SIZE = 2 # Minimap's border size
 
  FOREGROUND_COLOR = Color.new(224, 224, 255, 160) # Passable tile color
  BACKGROUND_COLOR = Color.new(0, 0, 0, 160) # Unpassable tile color
 
  USE_OUTLINE_PLAYER = true # Draw outline around player in minimap?
  PLAYER_OUTLINE_COLOR = Color.new(0, 0, 0, 192) # Player Outline color
  USE_OUTLINE_EVENT = true # Draw outline around events in minimap?
  EVENT_OUTLINE_COLOR = Color.new(0, 255, 255, 192) # Player Outline color
 
  PLAYER_COLOR = Color.new(255, 0, 0, 192) # Player color
  #---------------------------------------------------------------------------
 
  OBJECT_COLOR = {} # Don't change or delete this line!
  #===============================================================
  # * SETUP EVENT KEYWORD & COLOR
  #---------------------------------------------------------------
  # ** Template:
  # OBJECT_COLOR['keyword'] = Color.new(Red, Green, Blue, Opacity)
  #-------------------------------------------------------------
  # * 'keyword': Word you want to put in event's comment to show this color
  # ** Note: 'keyword' is CASE SENSITIVE!
  # * Color.new(...): Color you want
  # You can put between 0 - 255 in each argument (Red, Green, Blue, Opacity)
  #-------------------------------------------------------------
  OBJECT_COLOR['npc'] = Color.new(30,144,255,160)
  OBJECT_COLOR['treasure'] = Color.new(0,255,255,160)
  OBJECT_COLOR['enemy'] = Color.new(139,35,35,160)
  OBJECT_COLOR['merchant'] = Color.new(255,255,0,160)
  #===========================================================================
  # * [OPTIONAL] TAGS:
  #---------------------------------------------------------------------------
  # Change keyword for disable minimap & keyword for show event on minimap~
  #-----------------------------------------------------------------------
  TAG_NO_MINIMAP = '[NOMAP]' # Tag for disable minimap
  TAG_EVENT = 'MMEV' # Tag for show event on minimap
  #---------------------------------------------------------------------------
 
  #---------------------------------------------------------------------------
  # [END] MINIMAP SCRIPT SETUP PART
  #===========================================================================
 
  def self.refresh
    if $scene.is_a?(Scene_Map)
      $scene.spriteset.minimap.refresh
    end
  end
 
  def self.update_object
    if $scene.is_a?(Scene_Map)
      $scene.spriteset.minimap.update_object_list
    end
  end
end
 
#==============================================================================
# ¦ RPG::MapInfo
#==============================================================================
class RPG::MapInfo
  def name
    return @name.gsub(/\[.*\]/) { }
  end
 
  def original_name
    return @name
  end
 
  def show_minimap?
    return !@name.include?(MiniMap::TAG_NO_MINIMAP)
  end
end
#==============================================================================
# ¦ Game_System
#==============================================================================
class Game_System
  attr_accessor :minimap
  alias wora_minimap_gamsys_ini initialize
 
  def initialize
    wora_minimap_gamsys_ini
    @minimap = MiniMap::MAP_RECT
  end
 
  def show_minimap
    return !$game_switches[MiniMap::SWITCH_NO_MINIMAP]
  end
end
#==============================================================================
# ¦ Game_Map
#==============================================================================
class Game_Map
  alias wora_minimap_gammap_setup setup
  def setup(map_id)
    wora_minimap_gammap_setup(map_id)
    @db_info = load_data('Data/MapInfos.rvdata') if @db_info.nil?
    @map_info = @db_info[map_id]
  end
 
  def show_minimap?
    return @map_info.show_minimap?
  end
end
#==============================================================================
# ¦ Game_Event
#==============================================================================
class Game_Event < Game_Character
  def mm_comment?(comment, return_comment = false )
    if !@list.nil?
      for i in 0...@list.size - 1
        next if @list.code != 108
        if @list.parameters[0].include?(comment)
          return @list.parameters[0] if return_comment
          return true
        end
      end
    end
    return '' if return_comment
    return false
  end
end
#==============================================================================
# ¦ Game_MiniMap
#------------------------------------------------------------------------------
class Game_MiniMap
  def initialize(tilemap)
    @tilemap = tilemap
    refresh
  end
 
  def dispose
    @border.bitmap.dispose
    @border.dispose
    @map_sprite.bitmap.dispose
    @map_sprite.dispose
    @object_sprite.bitmap.dispose
    @object_sprite.dispose
    @position_sprite.bitmap.dispose
    @position_sprite.dispose
  end
 
  def visible
    return @map_sprite.visible
  end
 
  def visible=(value)
    @map_sprite.visible = value
    @object_sprite.visible = value
    @position_sprite.visible = value
    @border.visible = value
  end
 
  def refresh
    @mmr = $game_system.minimap
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
 
    @x = 0
    @y = 0
    @size = [map_rect.width / grid_size, map_rect.height / grid_size]
 
    @border = Sprite.new
    @border.x = map_rect.x - MiniMap::MINIMAP_BORDER_SIZE
    @border.y = map_rect.y - MiniMap::MINIMAP_BORDER_SIZE
    b_width = map_rect.width + (MiniMap::MINIMAP_BORDER_SIZE * 2)
    b_height = map_rect.height + (MiniMap::MINIMAP_BORDER_SIZE * 2)
    @border.bitmap = Bitmap.new(b_width, b_height)
    @border.bitmap.fill_rect(@border.bitmap.rect, MiniMap::MINIMAP_BORDER_COLOR)
    @border.bitmap.clear_rect(MiniMap::MINIMAP_BORDER_SIZE, MiniMap::MINIMAP_BORDER_SIZE,
    @border.bitmap.width - (MiniMap::MINIMAP_BORDER_SIZE * 2),
    @border.bitmap.height - (MiniMap::MINIMAP_BORDER_SIZE * 2))
 
    @map_sprite = Sprite.new
    @map_sprite.x = map_rect.x
    @map_sprite.y = map_rect.y
    @map_sprite.z = MiniMap::MAP_Z
    bitmap_width = $game_map.width * grid_size + map_rect.width
    bitmap_height = $game_map.height * grid_size + map_rect.height
    @map_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
    @map_sprite.src_rect = map_rect
 
    @object_sprite = Sprite.new
    @object_sprite.x = map_rect.x
    @object_sprite.y = map_rect.y
    @object_sprite.z = MiniMap::MAP_Z + 1
    @object_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
    @object_sprite.src_rect = map_rect
 
    @position_sprite = Sprite_Base.new
    @position_sprite.x = map_rect.x + @size[0] / 2 * grid_size
    @position_sprite.y = map_rect.y + @size[1] / 2 * grid_size
    @position_sprite.z = MiniMap::MAP_Z + 2
 
    bitmap = Bitmap.new(grid_size, grid_size)
    # Player's Outline
    if MiniMap::USE_OUTLINE_PLAYER and MiniMap::GRID_SIZE >= 3
      bitmap.fill_rect(bitmap.rect, MiniMap::PLAYER_OUTLINE_COLOR)
      brect = Rect.new(bitmap.rect.x + 1, bitmap.rect.y + 1, bitmap.rect.width - 2,
        bitmap.rect.height - 2)
      bitmap.clear_rect(brect)
    else
      brect = bitmap.rect
    end
 
    bitmap.fill_rect(brect, MiniMap::PLAYER_COLOR)
    @position_sprite.bitmap = bitmap
 
    draw_map
    update_object_list
    draw_object
    update_position
  end
 
  def draw_map
    bitmap = @map_sprite.bitmap
    bitmap.fill_rect(bitmap.rect, MiniMap::BACKGROUND_COLOR)
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
 
    $game_map.width.times do |i|
      $game_map.height.times do |j|
        if !$game_map.passable?(i, j)
          next
        end
        rect = Rect.new(map_rect.width / 2 + grid_size * i,
          map_rect.height / 2 + grid_size * j,
          grid_size, grid_size)
        if grid_size >= 3
          if !$game_map.passable?(i, j)
            rect.height -= 1
            rect.x += 1
            rect.width -= 1
            rect.width -= 1
            rect.y += 1
            rect.height -= 1
          end
        end
        bitmap.fill_rect(rect, MiniMap::FOREGROUND_COLOR)
      end
    end
  end
 
  def update_object_list
    @object_list = {}
    $game_map.events.values.each do |e|
      comment = e.mm_comment?(MiniMap::TAG_EVENT, true)
      if comment != ''
        type = comment.gsub(/#{MiniMap::TAG_EVENT}/){}.gsub(/\s+/){}
        @object_list[type] = [] if @object_list[type].nil?
        @object_list[type] << e
      end
    end
  end
 
  def draw_object
    bitmap = @object_sprite.bitmap
    bitmap.clear
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    rect = Rect.new(0, 0, grid_size, grid_size)
    mw = map_rect.width / 2
    mh = map_rect.height / 2
 
    @object_list.each do |key, events|
      color = MiniMap::OBJECT_COLOR[key]
      next if events.nil? or color.nil?
      events.each do |obj|
        if !obj.character_name.empty?
          rect.x = mw + obj.real_x * grid_size / 256
          rect.y = mh + obj.real_y * grid_size / 256
          # Event's Outline
          if MiniMap::USE_OUTLINE_EVENT and MiniMap::GRID_SIZE >= 3
            bitmap.fill_rect(rect, MiniMap::EVENT_OUTLINE_COLOR)
            brect = Rect.new(rect.x + 1, rect.y + 1, rect.width - 2,
            rect.height - 2)
            bitmap.clear_rect(brect)
          else
            brect = bitmap.rect
          end
          bitmap.fill_rect(brect, color)
        end
      end
    end
  end
 
  def update
    if @mmr != $game_system.minimap
      dispose
      refresh
    end
    draw_object
    update_position
    if @map_sprite.visible
      @map_sprite.update
      @object_sprite.update
      @position_sprite.update
    end
  end
 
  def update_position
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    sx = $game_player.real_x * grid_size / 256
    sy = $game_player.real_y * grid_size / 256
    @map_sprite.src_rect.x = sx
    @map_sprite.src_rect.y = sy
    @object_sprite.src_rect.x = sx
    @object_sprite.src_rect.y = sy
  end
end
#==============================================================================
# ¦ Spriteset_Map
#------------------------------------------------------------------------------
class Spriteset_Map
  attr_reader :minimap
  alias wora_minimap_sprsetmap_ini initialize
  alias wora_minimap_sprsetmap_dis dispose
  alias wora_minimap_sprsetmap_upd update
 
  def initialize
    wora_minimap_sprsetmap_ini
    if $game_map.show_minimap?
      @minimap = Game_MiniMap.new(@tilemap)
      $game_system.show_minimap = true if $game_system.show_minimap.nil?
      @minimap.visible = $game_system.show_minimap
    end
  end
 
  def dispose
    @minimap.dispose if !@minimap.nil?
    wora_minimap_sprsetmap_dis
  end
 
  def update
    if !@minimap.nil?
      if $game_system.show_minimap
        @minimap.visible = true
        @minimap.update
      else
        @minimap.visible = false
      end
    end
    wora_minimap_sprsetmap_upd
  end
end
#==============================================================================
# ¦ Scene_Map
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
  attr_reader :spriteset
end
« Letzte Änderung: Oktober 24, 2009, 15:31:18 von Sartek »
Besucht mich auf


Und gebt Kommentare im Blog =)

Re: Hilfe zu Skripten.

Offline Franky

  • Blutiger Fortgeschrittener
  • Eventmeister
  • ***
  • Beiträge: 390
Re: Hilfe zu Skripten.
« Antwort #284 am: Oktober 30, 2009, 11:57:11 »
Hallo,
verstehe nicht, wie das mit den Questmaps in diesem Questlog-Skript funktioniert:
#==============================================================================
#  Simple Quest-Log
#
#  Version : 1.3a - 04.04.08
#  Created by : hellMinor
#  Do NOT redistribute without my permission
#  Description : A simple script for a Quest-Log
#
#==============================================================================
#==============================================================================
# F.A.Q.
#==============================================================================
# The Global Questlog-Name is $questlog
# To open the Questlog from the menu just do $scene = Scene_Questlog.new
# To open the Questlog from an event $scene = Scene_Questlog.new(false)
#
# To add a quest make a new call script with this Template :
# $questlog.addQuest("Unique ID","Quest Title","Quest Description","State")
#
# To update a Quest description make a new call script with this Template :
# $questlog.updateQuest("unique ID","Quest Description","State")
#
# To move a Quest to Completed Quests make new call script with this Template :
# $questlog.completeQuest("Unique ID")
#
# To delete a Quest from the Active-Questlog make a call script with this
# Template :
# $questlog.deleteQuest("Unique ID")
#
# You can get the current state of a Quest with this Template :
# $questlog.getQuestState("Unique ID")
# This may be useful in a conditional branch if you want to react with a
# special Quest-State
#
# If u want to add a Questmap, create a folder named Questmaps in your
# Graphics folder. The name of the Questmap must be the same as the Quest
# in the Game. Be sure that you set the correct MAP_FORMAT.
# A Quest-Map should have a size of 265*200 px !
# I.E. : If your Quest is named QuestYXZ , the picture in the Questmap folder
# has to be QuestYXZ.png if your map is a .png
#==============================================================================
# Setup
#==============================================================================
QUESTLOGNAME = "Questlog"               # Questlog Menu name
QUEST_MENU_ITEM_1 = "Active Quests"     # Active Quest name
QUEST_MENU_ITEM_2 = "Completed Quests"  # Completed Quest name
SIZE_VAR = 20                           # Character Size
MAP_FORMAT = "png"                      # Quest-Map Ending
#==============================================================================
class Questlog
#==============================================================================
  def addQuest(id,header,description,state = "")
    $activelog << [id,header,description,state]
  end
#------------------------------------------------------------------------------  
  def updateQuest(id,description,state = "")
    for i in 0..$activelog.size-1
      if $activelog[i][0] == id
        $activelog[i][2] = description
        $activelog[i][3] = state
        break
      end
    end
  end
#------------------------------------------------------------------------------
  def completeQuest(id)
    for i in 0..$activelog.size-1
      if $activelog[i][0] == id
        $completedlog << $activelog[i]
        $activelog.delete_at(i)
        break
      end
    end
  end
#------------------------------------------------------------------------------
  def deleteQuest(id)
    for i in 0..$activelog.size-1
      if $activelog[i][0] == id
        $activelog.delete_at(i)
        break
      end
    end
  end
#------------------------------------------------------------------------------
  def getQuestState(id)
    for i in 0..$activelog.size-1
      if $activelog[i][0] == id
        return $activelog[i][3]
        break
      end
    end
  end
  
end
#==============================================================================
class Scene_Questlog < Scene_Base
#==============================================================================
  def initialize(from_menu = true)
    @from_menu = from_menu
  end
  
  def start
    super
    create_menu_background
    @help_window = Window_Help.new
    @help_window.set_text(QUESTLOGNAME,1)
    
    s1 = QUEST_MENU_ITEM_1
    s2 = QUEST_MENU_ITEM_2
    
    @select_window = Window_Command.new(544,[s1,s2],2,1)
    @select_window.y = 55
    @select_window.active = true
    
  end
#------------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @help_window.dispose
    @select_window.dispose
  end
#------------------------------------------------------------------------------  
  def kill_questwindows
    @quest_window.dispose
  end  
#------------------------------------------------------------------------------
  def return_scene
    if @from_menu
      $scene = Scene_Menu.new
    else
      $scene = Scene_Map.new
    end
  end
#------------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @help_window.update
    if @select_window.active
      @select_window.update
      update_select_selection
    elsif @quest_window.active
      @quest_window.update
      update_quest_selection
    end
  end
#------------------------------------------------------------------------------
  def update_select_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    elsif Input.trigger?(Input::C)
      case @select_window.index
      when 0
        $oldlog = false
        @quest_window = Window_Quest.new(0,110,272,(24*11)+42)
        @select_window.active = false
        @quest_window.active = true
      when 1
        $oldlog = true
        @quest_window = Window_Quest.new(0,110,272,(24*11)+42)
        @select_window.active = false
        @quest_window.active = true
      end      
    end
  end
#------------------------------------------------------------------------------  
  def update_quest_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      kill_questwindows
      @select_window.active = true
    end
  end

end
#==============================================================================
class Scene_Title < Scene_Base
#==============================================================================
  alias create_game_objects_additions create_game_objects
  def create_game_objects
    create_game_objects_additions
    $questlog = Questlog.new
    $activelog = Array.new
    $completedlog = Array.new
  end
  
end
#==============================================================================
class Window_Help < Window_Base
#==============================================================================
  def initialize(x = 0,y = 0, width = 544, height = WLH+32)
    super(x, y, width, height)
  end
  
end
#==============================================================================
class Window_Description < Window_Base
#==============================================================================
  def initialize(x = 0,y = 0, width = 544, height = WLH+32)
    super(x, y, width, height)
    @text = nil
    @contents_x = 0
    @contents_y = 0
    @line_count = 0             # Line count drawn up until now
    update
  end
#------------------------------------------------------------------------------  
  def new_line
    @contents_x = 0
    @contents_y += WLH
    @line_count += 1
    @line_show_fast = false
  end
#------------------------------------------------------------------------------  
  def finish_message
    @text = nil
    @line_count = 0
    @contents_x = 0
    @contents_y = 0
  end
#------------------------------------------------------------------------------  
  def write_text(str)
    if str != nil || str != ""
      create_contents
      update_msg(str)
    end
  end
#------------------------------------------------------------------------------  
  def update_msg(str)
    str.each_line{|str2|iterator(str2)}
    finish_message
  end
#------------------------------------------------------------------------------  
  def iterator(str2)
    contents.font.size = SIZE_VAR
    contents.draw_text(@contents_x, @contents_y, str2.size*40, WLH, str2.delete("\n"))
    c_width = contents.text_size(str2).width
    @contents_x += c_width
    new_line
  end
  
end
#==============================================================================
class Window_Quest < Window_Selectable
#==============================================================================
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @column_max = 1
    self.index = 0
    
    @quest_helper = Window_Description.new(271,110,273,(24*11)+42)
    
    refresh
  end
#------------------------------------------------------------------------------
  def refresh
    @data = []
    if !$oldlog
      for i in (0..$activelog.size-1)
        @data.push($activelog[i])
      end
    else
      for i in (0..$completedlog.size-1)
        @data.push($completedlog[i])
      end
    end
    @item_max = @data.size
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end
#------------------------------------------------------------------------------
  def draw_item(index)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    item = @data[index][1]
    if item != nil
      rect.width -= 4
      self.contents.draw_text(rect.x, rect.y, 172, WLH, item)
    end
  end
#------------------------------------------------------------------------------
  alias update_addition update
  def update
    update_addition
    update_description(@index)
    update_selection
  end
#------------------------------------------------------------------------------
  def update_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      @quest_helper.dispose
      if @quest_map != nil
        @quest_map_bitmap.bitmap.dispose
        @quest_map_bitmap.dispose
        @quest_map.dispose
        @quest_map_viewport.dispose
        @quest_map = nil
      end
    end
  end
#------------------------------------------------------------------------------    
  def update_description(id)
    if defined?(@data[id][2])
      @quest_helper.write_text(@data[id][2])
      if @quest_map == nil
        if Cache.questmaps(@data[id][1]).is_a?(Bitmap)
          self.height /= 3
          @quest_map = Window_Description.new(0,210,272,(24*7)+38)
          @quest_map_bitmap = Sprite.new
          @quest_map_viewport = Viewport.new(3,213,268,(24*7)+35)
          @quest_map_bitmap.viewport = @quest_map_viewport
          @quest_map_bitmap.bitmap = Cache.questmaps(@data[id][1])
          @quest_map_bitmap.viewport.z = 150
        end
      else
        if Cache.questmaps(@data[id][1]).is_a?(Bitmap)
          @quest_map_bitmap.bitmap = Cache.questmaps(@data[id][1])
        else
          self.height *= 3
          @quest_map_bitmap.bitmap.dispose
          @quest_map_bitmap.dispose
          @quest_map.dispose
          @quest_map_viewport.dispose
          @quest_map = nil
        end
      end
      
    end
  end
  
end
#==============================================================================
class Scene_File < Scene_Base
#==============================================================================
  alias write_save_data_adds write_save_data
  def write_save_data(file)
    write_save_data_adds(file)    
    Marshal.dump($activelog,           file)
    Marshal.dump($completedlog,        file)
    Marshal.dump($questlog,            file)
  end
  
  alias read_save_data_adds read_save_data
  def read_save_data(file)
    read_save_data_adds(file)
    $activelog           = Marshal.load(file)
    $completedlog        = Marshal.load(file)
    $questlog            = Marshal.load(file)
  end
end
#==============================================================================
module Cache
#==============================================================================  
  def self.questmaps(filename)
    begin
      load_bitmap("Graphics/Questmaps/", filename)
    rescue
      return nil
    end
  end
  
end
  
end

Habe alles genau so gemacht, wie es dort steht.
Ich habe den Questmaps-Ordner unter Graphics.
Ich habe ein Bild eingefügt, dass den selben Namen hat, wie die Quest. (z.B. heisst es bei mir: "Plage", die Questmap heisst dann "Plage.png")
Ich habe auch die Grösse der Map ganz genau auf 265 x 200 gebracht!

Trotzdem wird nichts angezeigt (ich weiss ja noch nicht mal, wo es angezeigt wird)!
Was mache ich falsch?


Dazu kommt noch ein anderes Problem (unabhängig vom ersten):


Das Skript dort ist das Sidetext-Skript, welches einen Text am Rand anzeigen soll.
Das Event ist ein Parallel Process und soll nach Ablauf der Zeit, den Text anzeigen lassen, jedoch passiert gar nichts. (es kommt keine Fehlermeldung, es passiert einfach nur nichts).

Was ist hier falsch?

Das einzigste Skript, was daran beteiligt sein könnte, ist das mit den Map-Namen. Habe es mit Cut entfernt und erneut probiert... nichts passiert.
Habe darauf noch probiert ein Player Touch Event einzufügen, dass nur den Call Skript Befehl ausführt: Nichts passiert.

Hier noch das Skript:
#==============================================================================
# ** [STR14] Sidetext (von star) (Version 0.7)
#------------------------------------------------------------------------------
#  Ermöglicht zusätzlichen Text an der linken Seite anzuzeigen.
#==============================================================================

if false
# Das folgenden wird in ein Call Skript geschrieben
s = $game_temp.sidetext
i = s.index(nil)
i = s.size if (i == nil)
t = "Sidetext"           # Text, der angezeigt werden soll
f = true                 # Buchstaben haben Rand? (aus = false)
w = 120                  # Anzeigedauer (in Frames)
c = Color.new(64,32,128) # Farbe des Randes (rot, grün, blau)
s[i] = Sprite_Sidetext.new(t,f,w,c)
#
end

#==============================================================================
# ¦ Sprite_Sidetext
#==============================================================================
class Sprite_Sidetext < Sprite
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize(text, frame = false, wait = 120, c = Color.new(64,32,128))
    super()
    self.x = 16
    num = $game_temp.sidetext.index(nil)
    num = $game_temp.sidetext.size if (num == nil)
    y = 80 + (num * 24)
    self.y = y
    self.z = 200
    bitmap = Bitmap.new(32, 24)
    w = bitmap.text_size(text).width
    bitmap.dispose
    bitmap = Bitmap.new(w, 24)
    if frame
      bitmap.draw_text_f(0, 0, w, 24, text, 0, c)
    else
      bitmap.draw_text(0, 0, w, 24, text)
    end
    self.bitmap = bitmap
    self.opacity = 0
    @wait = wait
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def update
    if @wait > 0
      self.opacity += 24
      return if self.opacity != 255
      @wait -= 1
    else
      self.x += 4
      self.opacity -= 8
      dispose if self.opacity == 0
    end
  end
end
#==============================================================================
# ¦ Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  attr_accessor :sidetext
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  alias initialize_str14 initialize
  def initialize
    initialize_str14
    @sidetext = []
  end
end
#==============================================================================
# ¦ Spriteset_Map
#==============================================================================
class Spriteset_Map
  #--------------------------------------------------------------------------
  # ? S???????
  #--------------------------------------------------------------------------
  def create_sidetext
    $game_temp.sidetext = []
  end
  #--------------------------------------------------------------------------
  # ? S???????
  #--------------------------------------------------------------------------
  def dispose_sidetext
    for i in 0...$game_temp.sidetext.size
      $game_temp.sidetext[i].dispose if $game_temp.sidetext[i] != nil
    end
    $game_temp.sidetext = []
  end
  #--------------------------------------------------------------------------
  # ? S???????
  #--------------------------------------------------------------------------
  def update_sidetext
    for i in 0...$game_temp.sidetext.size
      if $game_temp.sidetext[i] != nil
        $game_temp.sidetext[i].update
        if $game_temp.sidetext[i].disposed?
          $game_temp.sidetext[i] = nil
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  alias create_parallax_str14 create_parallax
  def create_parallax
    create_parallax_str14
    create_sidetext
  end
  alias dispose_str14 dispose
  def dispose
    dispose_sidetext
    dispose_str14
  end
  alias update_str14 update
  def update
    update_str14
    update_sidetext
  end
end
#==============================================================================
# ¦ Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # ? S???????
  #--------------------------------------------------------------------------
  def create_sidetext
    $game_temp.sidetext = []
  end
  #--------------------------------------------------------------------------
  # ? S???????
  #--------------------------------------------------------------------------
  def dispose_sidetext
    for i in 0...$game_temp.sidetext.size
      $game_temp.sidetext[i].dispose if $game_temp.sidetext[i] != nil
    end
    $game_temp.sidetext = []
  end
  #--------------------------------------------------------------------------
  # ? S???????
  #--------------------------------------------------------------------------
  def update_sidetext
    for i in 0...$game_temp.sidetext.size
      if $game_temp.sidetext[i] != nil
        $game_temp.sidetext[i].update
        if $game_temp.sidetext[i].disposed?
          $game_temp.sidetext[i] = nil
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  alias create_battleback_str14 create_battleback
  def create_battleback
    create_battleback_str14
    create_sidetext
  end
  alias dispose_str14 dispose
  def dispose
    dispose_sidetext
    dispose_str14
  end
  alias update_str14 update
  def update
    update_str14
    update_sidetext
  end
end
#==============================================================================
# ¦ Bitmap
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  # ? ???????
  #--------------------------------------------------------------------------
  def draw_text_f(x, y, width, height, str, align = 0, color = Color.new(64,32,128))
    shadow = self.font.shadow
    b_color = self.font.color.dup
    font.shadow = false
    font.color = color
    draw_text(x + 1, y, width, height, str, align)
    draw_text(x - 1, y, width, height, str, align)
    draw_text(x, y + 1, width, height, str, align)
    draw_text(x, y - 1, width, height, str, align)
    font.color = b_color
    draw_text(x, y, width, height, str, align)
    font.shadow = shadow
  end
  def draw_text_f_rect(r, str, align = 0, color = Color.new(64,32,128))
    draw_text_f(r.x, r.y, r.width, r.height, str, align = 0, color)
  end
end
« Letzte Änderung: Oktober 30, 2009, 12:29:17 von Franky »

 


 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