질문과 답변

Extra Form
class Scene_Portal <Scene_Base
 
 
  def
    start
    super
    create_menu_background
      cmds=[]
    if $game_switches[80]==true
      cmds+=["1-1"]
      end
    if $game_switches[82]==true
      cmds+=["3-1"]
      end
    if $game_switches[83]==true
      cmds+=["1-3"]
     
      end
 
    @left_window=Window_Command.new(172,cmds)
    @left_window.x=72
    @left_window.y=200
  end
 
def update
    super
    @left_window.update
    if Input.repeat?(Input::B)
      Sound.play_cancel
      $scene=Scene_Map.new
    else if
      Input.repeat?(Input::C)
      Sound.play_decision
     
      if @left_window='1-3'
        Sound.play_save
        $game_player.reserve_transfer(17,5,7,0)
        update_transfer_player
        perform_transfer
 
        end
      if @left_window="3-1"
        Sound.play_load
      
        end
      if @left_window[@left_window.index]="1-1"
          Sound.play_save
        $game_player.reserve_transfer(9,9,4,0)
        update_transfer_player
        perform_transfer
 
      end
     
 
       $scene=Scene_Map.new
    end
    end
 
  def terminate
    super
    dispose_menu_background
    #@left_window.dispose
  end
end

 

 

 

다른기본 스크립트는 생략했습니다.

 

 

 

 

 

 

@left_window=Window_Command.new(172,cmds)
    @left_window.x=72
    @left_window.y=200

 

이런식으로 해서 선택창을 띄운다음

항목까지 표시하는건 성공했어요

문제는 그 항목중에서의 문자값으로 결과를 다르게 하려고 하는데

자꾸 문자값을 비교하려고 하면 오류가 나네요

또는 그냥 if  left_window ="1-1"

이런식으로 했더니 항목에 모두 포함된 1-3, 3-1 이런식으로 와리가리 이동이 되네요

 

선택된 항목의 문자값을 어떻게 읽을 수 있을까요??

 

      if @left_window[@left_window.index]="1-1"         

Sound.play_save

       end

     


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12387
Board Pagination Prev 1 2 3 4 5 Next
/ 5