RPGVX.net

  RPG-Maker VX => VX Skripte [Fertiger Code] => Thema gestartet von: Phi am Juli 09, 2009, 21:26:12

Titel: [MenüAddOn]HauptQuestFortschritt im Menü
Beitrag von: Phi am Juli 09, 2009, 21:26:12
Vorwort:
Ich hab im Grunde nur ein bisschen umhergespielt. (bin gerade dabei scripten zu lernen)

Was ist das für ein Script?
Das Hauptmenü bekommt ein zusätzliches Fenster (siehe Screenshot unten) in dem man reinschreiben kann was man will.
Meine Idee war es zu benutzen als eine Art "Questlog" für das Hauptquest.

Was kann ich einstellen?
Die Breite des Fensters(BREITE), die Variable aus der der Fortschritt des Hauptquests ermittelt wird (MQVARI) und natürlich das was angezeigt wird. Dazu muss man am Ende des scripts einfach eine weitere when-funktion einfügen. (sollte nicht so schwer zu verstehen sein)

Ich benutze noch andere AddOns, was soll ich machen?
nach der Anzahl an Auswahlmöglichkeiten im Hauptmenü muss man COMMANDS verändern.
wenn ihr ein Questlog und ein Monsterbuch benutzt um 2 erhöhen (also 8) allerdings sind 2 Zeilen weniger verfügbar.
dieses AddOn müss über den anderen MenüAddOns sein
im anderen MenüAddOns musst du danach suchen: (oder einen ähnlichen, je nach AddOn, das Beispiel ist ein Questlog)
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s7 = "Questlog"
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(120 [s1, s2, s3, s4, s7, s5, s6])
    @command_window.index = @menu_index
    if $game_party.members.size == 0
      @command_window.draw_item(0, false)
      @command_window.draw_item(1, false)
      @command_window.draw_item(2, false)
      @command_window.draw_item(3, false)
    end
    if $game_system.save_disabled
      @command_window.draw_item(4, false)
    end
und den Befehl:
@command_window = Window_Command.new(120, [s1, s2, s3, s4, s7, s5, s6])
ändern in
@command_window = Window_Command.new(BREITE, [s1, s2, s3, s4, s7, s5, s6])

Screens:
wie ihr seht wird der Heldenname und das Level ins Face verschoben wenn nicht genug platz ist
(http://img3.imagebanana.com/img/5uuoj47c/screen1.PNG)
(http://img3.imagebanana.com/img/gwjyhyif/screen1.PNG)

und hier ist das script:
#==============================================================================
# ** HauptQuest-fortschritt im Menü
# version 1.1 von Phi
# 10.07.2009 um 10:00
#==============================================================================
BREITE = 120        # nicht mehr als 260
MQVARI = 1          # Variable die den Fortschritt des Hauptquests entspricht
COMMANDS = 6        # Anzahl an Auswahlmöglichkeiten (Item, Skill, Equip)
#==============================================================================
class Scene_Menu < Scene_Base
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_MenuGold.new(0, 24 * COMMANDS + 36)
    @status_window = Window_MenuStatus.new(BREITE + 4, 0)
    @mainquest_window = Window_Mainquest.new(0, 24 * COMMANDS + 96)
  end
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(BREITE, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    if $game_party.members.size == 0
      @command_window.draw_item(0, false)
      @command_window.draw_item(1, false)
      @command_window.draw_item(2, false)
      @command_window.draw_item(3, false)
    end
    if $game_system.save_disabled
      @command_window.draw_item(4, false)
    end
  end
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @mainquest_window.dispose
  end
end
#------------------------------------------------------------------------------
# * Goldfenster
#------------------------------------------------------------------------------
class Window_MenuGold < Window_Base
  def initialize(x, y)
    super(x, y, BREITE, WLH + 32)
    refresh
  end
  def refresh
    self.contents.clear
    draw_currency_value($game_party.gold, 4, 0, BREITE - 40)
  end
end
#------------------------------------------------------------------------------
# * Menu
#------------------------------------------------------------------------------
class Window_MenuStatus < Window_Selectable
  def initialize(x, y)
    super(x, y, 540 - BREITE, 416)
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
      y = actor.index * 96
      if BREITE > 180
        draw_actor_name(actor, 0, y)
        draw_actor_level(actor, 0, y + 72)
        draw_actor_class(actor, 120, y)
        draw_actor_state(actor, 120, y + 24)
        draw_actor_hp(actor, 120, y + 48)
        draw_actor_mp(actor, 120, y + 72)
      else
        draw_actor_name(actor, 100, y)
        draw_actor_level(actor, 100, y + WLH * 1)
        draw_actor_state(actor, 100, y + WLH * 2)
        draw_actor_class(actor, 388 - BREITE, y)
        draw_actor_hp(actor, 388 - BREITE, y + WLH * 1)
        draw_actor_mp(actor, 388 - BREITE, y + WLH * 2)  
      end 
    end
  end
end
#------------------------------------------------------------------------------
# ** Hauptqueststatus
#------------------------------------------------------------------------------
class Window_Mainquest < Window_Base
LINES = 12 - COMMANDS
  def initialize(x, y)
    super(x, y, BREITE, LINES * 24 + 32)
    refresh
  end
  def refresh
    self.contents.clear
    case $game_variables[MQVARI]
    when 0
      self.contents.draw_text(0, 0, BREITE - 40, 24, "Line01") if LINES >= 1
      self.contents.draw_text(0, 24, BREITE - 40, 24, "Line02") if LINES >= 2
      self.contents.draw_text(0, 48, BREITE - 40, 24, "Line03") if LINES >= 3
      self.contents.draw_text(0, 72, BREITE - 40, 24, "Line04") if LINES >= 4
      self.contents.draw_text(0, 96, BREITE - 40, 24, "Line05") if LINES >= 5
      self.contents.draw_text(0, 120, BREITE - 40, 24, "Line06") if LINES >= 6
      self.contents.draw_text(0, 144, BREITE - 40, 24, "Line07") if LINES >= 7
      self.contents.draw_text(0, 168, BREITE - 40, 24, "Line08") if LINES >= 8
      self.contents.draw_text(0, 192, BREITE - 40, 24, "Line09") if LINES >= 9
      self.contents.draw_text(0, 216, BREITE - 40, 24, "Line10") if LINES >= 10
      self.contents.draw_text(0, 240, BREITE - 40, 24, "Line11") if LINES >= 11
    when 1
      self.contents.draw_text(0, 0, BREITE - 40, 24, "Line01") if LINES >= 1
      self.contents.draw_text(0, 24, BREITE - 40, 24, "Line02") if LINES >= 2
      self.contents.draw_text(0, 48, BREITE - 40, 24, "Line03") if LINES >= 3
      self.contents.draw_text(0, 72, BREITE - 40, 24, "Line04") if LINES >= 4
      self.contents.draw_text(0, 96, BREITE - 40, 24, "Line05") if LINES >= 5
      self.contents.draw_text(0, 120, BREITE - 40, 24, "Line06") if LINES >= 6
      self.contents.draw_text(0, 144, BREITE - 40, 24, "Line07") if LINES >= 7
      self.contents.draw_text(0, 168, BREITE - 40, 24, "Line08") if LINES >= 8
      self.contents.draw_text(0, 192, BREITE - 40, 24, "Line09") if LINES >= 9
      self.contents.draw_text(0, 216, BREITE - 40, 24, "Line10") if LINES >= 10
      self.contents.draw_text(0, 240, BREITE - 40, 24, "Line11") if LINES >= 11
    when 2
      self.contents.draw_text(0, 0, BREITE - 40, 24, "Line01") if LINES >= 1
      self.contents.draw_text(0, 24, BREITE - 40, 24, "Line02") if LINES >= 2
      self.contents.draw_text(0, 48, BREITE - 40, 24, "Line03") if LINES >= 3
      self.contents.draw_text(0, 72, BREITE - 40, 24, "Line04") if LINES >= 4
      self.contents.draw_text(0, 96, BREITE - 40, 24, "Line05") if LINES >= 5
      self.contents.draw_text(0, 120, BREITE - 40, 24, "Line06") if LINES >= 6
      self.contents.draw_text(0, 144, BREITE - 40, 24, "Line07") if LINES >= 7
      self.contents.draw_text(0, 168, BREITE - 40, 24, "Line08") if LINES >= 8
      self.contents.draw_text(0, 192, BREITE - 40, 24, "Line09") if LINES >= 9
      self.contents.draw_text(0, 216, BREITE - 40, 24, "Line10") if LINES >= 10
      self.contents.draw_text(0, 240, BREITE - 40, 24, "Line11") if LINES >= 11
#------------------------------------------------------------------------------
# einfach für jeden fortschritt im Hauptquest eine weitere Bedingung hinzufügen
#------------------------------------------------------------------------------
    end
  end
end

Version 1.1 behebt den Fehler dass das Goldfenster, wenn es von wo anders aufgerufen wird (z.b. per Textevent \G) nicht am Screenrand steht bzw. in den aus dem Screen herausragt
Titel: Re: [MenüAddOn]HauptQuestFortschritt im Menü
Beitrag von: Prince am Juli 10, 2009, 08:43:59
Hey, das ist eigentlich gar nicht si schlecht, für eben solche Spiele wo man nen Code oder so bekommt ^^
Ich werds aber nicht verwenden weil ich's momentan einfach nicht brauch, aber allgemein eig ganz nützlich ^^

MfG Prince
Titel: Re: [MenüAddOn]HauptQuestFortschritt im Menü
Beitrag von: Phi am Juli 10, 2009, 10:05:33
Nett eine positive bewertung zu hören, ich war mir gar nicht sicher ob ich es überhaupt reinstellen soll da es zu einfach und umständlich ist (neuen Fortschritt hinzufügen)

Außerdem hab ich gerade den Fahler behoben dass das Goldfenster, wenn es von wo anders aufgerufen wird (z.b. im Shop) nicht am Screenrand steht bzw. in den aus dem Screen herausragt.
Titel: Re: [MenüAddOn]HauptQuestFortschritt im Menü
Beitrag von: xelawebdev am Juli 11, 2009, 13:01:29
Da du es erst lernst, find ich das ganz toll das du schon sowas gemacht hast, auf eine weise ist das nützlich da es simpel ist und nicht viel configs benötigt, viele questlogs haben zusätzliche optionen, die einen brauchen das, die anderen nicht. Es wird sich schon jemand finden der das nutzen wird, ansonsten find ich´s gut.
Ps: Ich brauch questlogs nicht. Noch nicht :D
MfG
SimplePortal 2.3.3 © 2008-2010, SimplePortal