메뉴 건너뛰기

창조도시 기록보관소

언어 질문입니다. 상당히 급함....

2006.01.20 05:49

『연금술사』 조회 수:79





지금 제가 전체 키 사용 스크립트로 완벽한
'키 사용 메뉴 호출'시스템을 제작하고 있습니다.
스테이터스 등의 윈도우 스테이터스는 링 메뉴의 윈도우 스테이터스에서
아이디어를 따서 만들고 있는 중인데......


윈도우 스테이터스
일반 Selectable과 동일. 다만 링 메뉴 처럼 네모 낳게 캐릭터 얼굴이 표시됨


위의 것을 다 만들고, 맵 에다가 적용 해봤습니다.



[메인 에서]
@status_window = Window_WindowPlus.new
@status_window.index = 0
@status_window.x = 240
@status_window.y = 240 - (($game_party.actors.size) * 16)
@status_window.visible = false
위의 것 처럼, 윈도우는 있으나 안보이게 해 놓고,
S 등의 키를 누르면 @status_window.active를 하게 해 놨습니다.

그래서 완성 된 것이 다음


[update 메소드 에서]
if Key.trigger?(34) # 스킬
  $game_system.se_play($data_system.decision_se)
  @status_window.visible = true
  @status_window.active = true
  @status_window.index = 0
  @win_num = 1
end
if Key.trigger?(28) # 장비
  $game_system.se_play($data_system.decision_se)
  @status_window.visible = true
  @status_window.active = true
  @status_window.index = 0
  @win_num = 2
end
if Key.trigger?(42) # 스테이터스
  $game_system.se_play($data_system.decision_se)
  @status_window.visible = true
  @status_window.active = true
  @status_window.index = 0
  @win_num = 3
end
def update_status
if Input.trigger?(Input::B)
  $game_system.se_play($data_system.cancel_se)
  @status_window.visible = false
  @status_window.active = false
  @status_window.index = -1
  return
end
if Input.trigger?(Input::C)
  @status_window.visible = false
  @status_window.active = false
  $game_system.se_play($data_system.decision_se)
  case @win_num
  when 1 # 스킬
    $scene = Scene_Skill.new(@status_window.index)
  when 2 # 장비
    $scene = Scene_Equip.new(@status_window.index)
  when 3 # 스테이터스
    $scene = Scene_Status.new(@status_window.index)
  end
end
end


win_num 이란것은 제가 그냥 만든것이고, 스테이터스가 active 일때
C 키를 누르면 win_num 의 숫자에 따라 각 씬이 소환 되는 시스템입니다.
씬들은 @status_window의 커서 위치(index)를 참조로(숫자로 나옵니다)
actor를 써서 씬을 마무리 짓습니다.




정리 해서, K키 (스킬 소환)를 누르면 파일 1처럼 되며, 거기서 선택하면
파일 2처럼 됩니다.



여기까지 3일동안 고생해서 만든 스크립트입니다..





그런데 문제 발생!




스테이터스 윈도우가 active인 상태에서 캐릭터의 동작이 움직입니다.....
@move_count = 0
이 방법도 안되고.....

for i in 0..3
  if Key.trigger?(i)
    return
  end
end

이 방법도 안되고....(위의 것은 전체키 스크립트가 있어야만 됩니다)



어떻게 하면 방향키를 막을수 있을까요...?
참고로 위의 return 을 return false(통행 불가 커맨드)로 고쳐도 안된답니다....

움직임을 봉인할수도 없고.....
방향키를 봉인할수도 없고.....
움직임을 봉인해도 캐릭터의 방향까지 봉인해야하니.....


if @status_window.active

이 경우에 움직임/방향 봉인 또는 방향키 봉인하는 방법을 알고 싶습니다....

정말로 필요합니다;ㅅ;

Game_Player나 Game_Character 에서 찾은것은 저 두가지...(더 있을지도 모르지만)






총 정리해서....



질문
캐릭터의 움직임을 막고 싶다. 물론 방향까지
(방향키를 막는 것도 됨)