collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: Script Problem!  (Gelesen 765 mal)

Offline Mumuniac

  • Ralph
  • *
  • Beiträge: 2
Script Problem!
« am: Juli 31, 2011, 15:20:48 »
Also ich habe ein Problem mit meinem Teleportsystem  :hehe:
Das Teleportscript rufe ich über ein Event auf, dann erscheint ein Menü
in dem eine Auswahl verfügbarer Orte steht.
Wenn ich mich nun zu einem der Orte teleportiere,
verschwinden meine Teammitglieder.
Nur der Held1, welchen man von Anfang an hat bleibt bestehen.
Ich weiß zwar nicht, ob es an dem Skript liegt, aber ich finde keine andere Lösung.
Es spielt keine Rolle an welchen Ort ich mich teleportiere.
Spoiler for Hiden:
#==============================================================================
# ** Waypoint System
#------------------------------------------------------------------------------
#  Von Jacques
#==============================================================================
module SCENEWAYPOINTSETUP
  HINTERGRUNDAN = false #Ein Hintergrund wird angezeigt
  MAPANZEIGEN = true #Die Map ist im Hintergrund zu sehen
  #Wenn  "ZURÜCKMENU = false" ist kommt man zurück auf die Map
  ZURÜCKMENU = true #Man kommt zurück ins Menu
  COMMANDWINDOWWIDTH = 160
  OPACITY = 255
  #Bezeichnung, Switch, Map ID, X, Y
  MAP = [["Dorf Konlar", 181, 8, 1, 10], ["Langpass", 182, 29, 23, 29]]
  UNBEKANNT = "???"
  EXIT = "Zurück"
  HINTERGRUND = "Title_Pano01" #Der Name des Hintergrundbildes
end
 
class Waypoint < Scene_Base
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
    @commands = []
 
  end
 
  def start
    super
    create_command_window
    if SCENEWAYPOINTSETUP::HINTERGRUNDAN
      @sprite = Sprite.new
      @sprite.bitmap = Cache.picture(SCENEWAYPOINTSETUP::HINTERGRUND)
    end
    if SCENEWAYPOINTSETUP::MAPANZEIGEN
      create_menu_background
    end
  end
 
  def terminate
    super
    if SCENEWAYPOINTSETUP::HINTERGRUNDAN
      @sprite.dispose
      @sprite.bitmap.dispose
    end
    if SCENEWAYPOINTSETUP::MAPANZEIGEN
      dispose_menu_background
    end
    @command_window.dispose
  end
 
  def update
    super
    @command_window.update
    if SCENEWAYPOINTSETUP::MAPANZEIGEN
      update_menu_background
    end
    if @command_window.active
      update_command_selection
    end
  end
 
  def create_command_window
    SCENEWAYPOINTSETUP::MAP.each_index {|x| @commands[x] = (SCENEWAYPOINTSETUP::MAP[x][0]) if $game_switches[SCENEWAYPOINTSETUP::MAP[x][1]] == true}
    SCENEWAYPOINTSETUP::MAP.each_index {|x| @commands[x] = SCENEWAYPOINTSETUP::UNBEKANNT if $game_switches[SCENEWAYPOINTSETUP::MAP[x][1]] == false}
    @commands.push(SCENEWAYPOINTSETUP::EXIT)
    @command_window = Window_Command.new(SCENEWAYPOINTSETUP::COMMANDWINDOWWIDTH, @commands)
    @command_window.index = @menu_index
    @command_window.x = 544 / 2 - @command_window.width / 2
    @command_window.y = 416 / 2 - @command_window.height / 2
    @command_window.opacity = SCENEWAYPOINTSETUP::OPACITY
  end
 
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command_selection
    # If B button was pressed
    if SCENEWAYPOINTSETUP::ZURÜCKMENU
      if Input.trigger?(Input::B)
        # Play cancel SE
        Sound.play_cancel
        # Switch to menu screen
        $scene = Scene_Menu.new
        return
      else
        if Input.trigger?(Input::B)
          # Play cancel SE
          Sound.play_cancel
          # Switch to map screen
          $scene = Scene_Map.new
        end
      end
    end
    # If C button was pressed
    if Input.trigger?(Input::C) && @command_window.index != @commands.size-1
      teleport(@command_window.index)
    else
      if Input.trigger?(Input::C) && SCENEWAYPOINTSETUP::ZURÜCKMENU
        # Play cancel SE
        Sound.play_cancel
        # Switch to menu screen
        $scene = Scene_Menu.new
      else
        if Input.trigger?(Input::C)
          # Play cancel SE
          Sound.play_cancel
          # Switch to map screen
          $scene = Scene_Map.new
        end
      end
    end
  end
 
  def teleport(comwinin)
    if $game_switches[SCENEWAYPOINTSETUP::MAP[comwinin][1]] == true
      Sound.play_decision
      $game_party.setup_starting_members            # Initial party
      $game_map.setup(SCENEWAYPOINTSETUP::MAP[comwinin][2])    # Initial map position
      $game_player.moveto(SCENEWAYPOINTSETUP::MAP[comwinin][3], SCENEWAYPOINTSETUP::MAP[comwinin][4])
      $game_player.refresh
      $scene = Scene_Map.new
      RPG::BGM.fade(1500)
      Graphics.fadeout(60)
      Graphics.wait(40)
      RPG::BGM.stop
      $game_map.autoplay
    else
      Sound.play_buzzer
    end
  end
end
Das ist der Teleport Skript.

Re: Script Problem!

Offline Kasaar

  • Epic Scripter !!
  • Eventmeister
  • ***
  • Beiträge: 305
  • Satanistischer Misantroph... noch Fragen? ]:)
Re: Script Problem!
« Antwort #1 am: August 01, 2011, 10:07:31 »
Das problem ist einfach... Die Zeile
$game_party.setup_starting_membersin der Methode teleport sorgt dafür, dass die Gruppe wieder auf das Anfangssetup gestellt wird... Der Ersteller des Scripts hat einfach die Methode vom new_game in Scene_Title kopiert. Dadurch wurden auch die initialisierungen aufgerufen.... Einfach die oben genannte Zeile löschen dann sollte es gehn ;)
Besucht mich auf


Und gebt Kommentare im Blog =)

Re: Script Problem!

Offline Mumuniac

  • Ralph
  • *
  • Beiträge: 2
Re: Script Problem!
« Antwort #2 am: August 01, 2011, 13:52:20 »
Funktioniert nun einwandfrei!
Vielen Dank wäre ich von alleine nich drauf gekommen. :grimace:

 


 Bild des Monats

rooftop party

Views: 3615
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