?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
밑에 질문했었는데....
이벤트로 할려는건 포기. ^^;; 어떻게 하는지 잘 모르겠어요 =_=;;

XP강좌 란에 보면 gunmong님께서
올리신 스크립트 있잖아요. 레벨업할때마다 스텟 조절할수있는.......


그거 세이브 하고 난뒤에 다시 로드해서 게임해보면
제가 올린 능력치가 아닌, 원래 설정치대로 능력치가 되어있는 버그가 있는데
그거 버그 수정 할수 없나요?

그 스크립트가 상당히 맘에 들어서 그러는데, 어떻게 해야 그 버그가 없어지는지
제발 알려주세요 ㅠㅠ


스크립트는 이겁니다.

#==============================================================================
# ■ Window_Levelup
#------------------------------------------------------------------------------
#  커스터마이즈       programed by gunmong
#==============================================================================

class Window_Levelup < Window_Base
  LEVELUP_POINT = 10                     # 레벨업시 얻는 포인트
  HP_PER_POINT = 10                       # 보너스 1포인트당 증감되는 HP, SP 포인트
  SKILLUP_POINT = 1
  ACCEPT = 6                                   # 결정의 index

attr_accessor :actor
attr_accessor :present_level
attr_accessor :index  
#--------------------------------------------------------------------------
# ● 오브젝트 초기화
#--------------------------------------------------------------------------  
  def initialize(actor, last_level)
    # 윈도우 창 초기화
    super(220, 10,200, 300)
    self.contents = Bitmap.new(width - 32, height - 32)
    # 액터 스테이터스 초기화
    @actor = actor
    @name = $data_actors[actor.id].name
    @present_level = actor.level
    @last_level = last_level
    @status = []
    @text_status = []
    @temp_status = []
    @bonus_point = (@present_level - last_level) * LEVELUP_POINT
    for i in 0...6
      @status[i] = $data_actors[actor.id].parameters[i, last_level]
      @temp_status[i] = $data_actors[actor.id].parameters[i, last_level]
    end
    # 액터 그림 로드
    @battler_pic = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
    # 인덱스 초기화
    @index = 0
    refresh
    update_cursor_rect
  end
#--------------------------------------------------------------------------
# ● 리프레쉬
#--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @text_down = "◀"
    @text_up = "▶"
    @text_status[0] = $data_system.words.hp
    @text_status[1] = $data_system.words.sp
    @text_status[2] = $data_system.words.str
    @text_status[3] = $data_system.words.dex
    @text_status[4] = $data_system.words.agi
    @text_status[5] = $data_system.words.int
    @text_bonus_point = "B.point " + @bonus_point.to_s

    self.contents.blt(50, 50, @battler_pic, Rect.new(0, 0, @battler_pic.width, @battler_pic.height),150)
    
    self.contents.draw_text(0,0, 168 , 32, @name.to_s, 1)
    self.contents.draw_text(0, 25, 45, 18, "Lv. ".to_s + @present_level.to_s)  
    
    for i in 0...@status.size
      self.contents.draw_text(0, 50 + i * 30, self.contents.text_size(@text_status[i]).width, 32, @text_status[i].to_s)
      self.contents.draw_text(50, 50 + i * 30, self.contents.text_size(@text_down).width, 32, @text_down)
      self.contents.draw_text(70, 50 + i * 30, 80, 32, @temp_status[i].to_s, 1)
      self.contents.draw_text(150, 50 + i * 30, self.contents.text_size(@text_up).width, 32, @text_up)
    end
    
    self.contents.draw_text(0, 240, 110, 32, @text_bonus_point )
    self.contents.draw_text(130, 240, 40, 32, "결정" )
    
      
  end
  
#--------------------------------------------------------------------------
# ● 커서의 구형 갱신
#--------------------------------------------------------------------------
  def update_cursor_rect
    # 커서 위치가 [결정]  의 경우
    if @index == ACCEPT
      self.cursor_rect.set(130, 240, 40, 32)
    # 커서 위치가 [결정]  이외의 경우
    else
      x = 50
      y = 50 + @index * 30
      self.cursor_rect.set(x, y, 120, 32)
    end
  end
  
  
#--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    # 항목 선택
    if Input.trigger?(Input::UP)
      $game_system.se_play($data_system.cursor_se)
      @index -=1 if @index > 0
    end
    if Input.trigger?(Input::DOWN)
      $game_system.se_play($data_system.cursor_se)
      @index +=1 if @index < ACCEPT
    end
    # 수치 증감
    if Input.trigger?(Input::LEFT)
      $game_system.se_play($data_system.cursor_se)
      #커서가 [결정]이거나 기존 스테이터스보다 크지 않으면 수행하지 않음.
      if @index != ACCEPT and @temp_status[@index] > @status[@index]  
        # HP 또는 SP는 HP_PER_POINT를 곱한다.
        @temp_status[@index] -= 1 * HP_PER_POINT if @index < 2
        @temp_status[@index] -= 1 if @index >= 2 and @index != ACCEPT
        @bonus_point += 1
        refresh
      end
    end
    if Input.trigger?(Input::RIGHT)
      $game_system.se_play($data_system.cursor_se)
      #커서가 [결정]이거나 기존 보너스 포인트가 1이상이 아니면 수행하지 않음.
      if @index != ACCEPT and @bonus_point > 0
        # HP 또는 SP는 HP_PER_POINT를 곱한다.
        @temp_status[@index] += 1 * HP_PER_POINT if @index < 2
        @temp_status[@index] += 1 if @index >=2 and @index != ACCEPT
        @bonus_point -= 1
        refresh
      end    
    end
    update_cursor_rect
  end
  def status(i)
    return @temp_status[i]
  end  
end


  
  
class Scene_Battle
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  alias gunmong_main main
  def main
    #레벨업 데이터 초기화
    @actor_level_list = []
    @actor_last_level = []
    gunmong_main
  end
  
  #==============================================================================
# ■ Scene_Battle (분할 정의 2)
#------------------------------------------------------------------------------
#  배틀 화면의 처리를 실시하는 클래스입니다.
#==============================================================================
  #--------------------------------------------------------------------------
  # ● 애프터 배틀 국면 개시
  #--------------------------------------------------------------------------
  def start_phase5
    # 국면 5 에 이행
    @phase = 5
    # 배틀 종료 ME 를 연주
    $game_system.me_play($game_system.battle_end_me)
    # 배틀 개시전의 BGM 에 되돌린다
    $game_system.bgm_play($game_temp.map_bgm)
    # EXP, 골드, 트레이닝 전기밥통을 초기화
    exp = 0
    gold = 0
    treasures = []
    # 루프
    for enemy in $game_troop.enemies
      # 에너미가 숨어 상태가 아닌 경우
      unless enemy.hidden
        # 획득 EXP, 골드를 추가
        exp += enemy.exp
        gold += enemy.gold
        # 트레이닝 전기밥통 출현 판정
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    # 트레이닝 전기밥통의 수를 6 개까지 한정
    treasures = treasures[0..5]
    # EXP 획득
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
#sssssssssssssssssssssssssssssssssssssssssssssssssss
          @actor_level_list.push(actor)
          @actor_last_level.push(last_level)
#eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
          @status_window.level_up(i)
        end
      end
    end
    # 골드 획득
    $game_party.gain_gold(gold)
    # 트레이닝 전기밥통 획득
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # 배틀 결과 윈도우를 작성
    @result_window = Window_BattleResult.new(exp, gold, treasures)
    # 웨이트 카운트를 설정
    @phase5_wait_count = 100
  end

#--------------------------------------------------------------------------
  # ● 프레임 갱신 (애프터 배틀 국면)
  #--------------------------------------------------------------------------
  def update_phase5
    # 웨이트 카운트가 0 보다 큰 경우
    if @phase5_wait_count > 0
      # 웨이트 카운트를 줄인다
      @phase5_wait_count -= 1
      # 웨이트 카운트가 0 이 되었을 경우
      if @phase5_wait_count == 0
        # 결과 윈도우를 표시
        @result_window.visible = true
        # 메인 국면 플래그를 클리어
        $game_temp.battle_main_phase = false
        # 스테이터스 윈도우를 리프레쉬
        @status_window.refresh
      end
      return
    end
    # C 버튼이 밀렸을 경우
    if Input.trigger?(Input::C)
      # 배틀 종료
      battle_end(0)
    end
  end

    #--------------------------------------------------------------------------
  # ● 배틀 종료
  #     result : 결과 (0:승리 1:패배 2:도주)
  #--------------------------------------------------------------------------
  def battle_end(result)
    # 전투중 플래그를 클리어
    $game_temp.in_battle = false
    # 파티 전원의 액션을 클리어
    $game_party.clear_actions
    # 배틀용 스테이트를 해제
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # 에너미를 클리어
    $game_troop.enemies.clear
    # 배틀 콜백을 부른다
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end
#ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
# 레벨업 액터가 있을경우
if not @actor_level_list.empty?
$scene = Scene_Levelup.new(@actor_level_list, @actor_last_level)
return
end
#eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
    # 맵 화면으로 전환하고
    $scene = Scene_Map.new
  end
  
end
  
  
    
    
    
    
    
    










    
    
#==============================================================================
# ■ Scene_Levelup
#------------------------------------------------------------------------------
#  레벨업시 스탯포인터를 조절하는 화면을 처리하는 클래스입니다.
#==============================================================================

class Scene_Levelup
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     menu_index : 커멘드의 커서 초기 위치
  #--------------------------------------------------------------------------
  def initialize(actor_level_list, actor_last_level)
    @actor_level_list = actor_level_list
    @actor_last_level = actor_last_level
  end
  #--------------------------------------------------------------------------
  # ● 메인 처리
  #--------------------------------------------------------------------------
  def main
    # 스프라이트 세트를 작성
    @spriteset = Spriteset_Battle.new
    @status_window = Window_BattleStatus.new
    # 초기 윈도우를 작성
    @edit_window = Window_Levelup.new(@actor_level_list.shift, @actor_last_level.shift)

    # 트란지션 실행
    Graphics.transition
    # 메인 루프
    loop do
      # 게임 화면을 갱신
      Graphics.update
      # 입력 정보를 갱신
      Input.update
      # 프레임 갱신
      update
      # 화면이 바뀌면 루프를 중단
      if $scene != self
        break
      end
    end
        # 트란지션 준비
    Graphics.freeze
    # 윈도우를 해방
    @spriteset.dispose
    @status_window.dispose
    @edit_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 윈도우를 갱신
    @spriteset.update
    @edit_window.update
    
    # C 버튼이 밀렸을 경우
    if Input.repeat?(Input::C) and @edit_window.index == 6
      for i in 0...6
        $data_actors[@edit_window.actor.id].parameters[i, @edit_window.present_level] = @edit_window.status(i)
      end      
      if @actor_level_list.empty?
        $scene = Scene_Map.new
      else
        @edit_window.dispose
        @edit_window = Window_Levelup.new(@actor_level_list.shift, @actor_last_level.shift)
      end
    end
  end
end
?

List of Articles
번호 제목 글쓴이 날짜 조회 수
8827 힐다의 학자금퀘스트 스크립트 관련 질문 5 심심치 2014.10.11 1833
8826 흠...오프닝에 관한 질문인데요. 다크아머 2005.05.28 472
8825 흠...오프닝에 관한 질문인데요. Survivor-c 2005.05.28 621
8824 흠.. 케릭터가 안움직여져요.... 일당백 2005.08.20 465
8823 흠.. 케릭터가 안움직여져요.... 카리스 2005.08.20 372
8822 흠.. 케릭터가 안움직여져요.... ☆무적기사★ 2005.08.21 527
8821 흠.. 맵배치에 관해서.. 1 『덩키동크』 2006.02.20 441
8820 흠.. 맵배치에 관해서.. 아두 2006.02.20 421
8819 흠.. 궁금한거 하나 있는데요.. 1 다크진™ 2005.08.06 494
8818 흠.. rpg2003에 대해서 인데요 꼭좀 알려주시면... 재티s 2005.11.06 976
8817 흠.. 2k만하다가 xp하려는데.. 1 잘생긴넘 2007.02.14 680
8816 흠,, 뭐가 문제인지좀,, 좌표의 이동에대해,, XLostTimesX 2006.01.10 434
8815 흠 그;;; 조건분기그런거 할때 쓰는 명령어좀~~ ☆무적기사★ 2005.08.05 497
8814 아마란스 2005.06.19 318
8813 ★RPG_Maker★ 2005.09.02 522
8812 흑흑 콩나물 2015.05.16 361
8811 흑인rpg왜없어짐? 2 자라토끼 2014.05.18 586
8810 흑백으로 만들기(RPG2003)(빠른답변부탁) 『덩키동크』 2006.05.25 1040
8809 흑백으로 만들기(RPG2003)(빠른답변부탁) 1 cyverjen 2006.05.25 1093
8808 흑룡님 사라진터전 최신판 없나요? 2 에에... 닉넴바뀨라네요.. 2014.06.22 414
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 442 Next
/ 442


[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)