질문과 답변

Extra Form

현재 파티에 있는 멤버의 액터 아이디를 취득해서 변수로  저장을시켰는데


이 취득한 수치의 해당 멤버의 능력이나 착용장비를 분기로 사용하고 싶은데 분기에서는


멤버를 변수로 선택하는 항목이 없어서 분기를 스크립트로 해야할거 같은데 스크립트 까막눈이라


관련 스크립트좀 알려주시면 감사하겠습니다.


고수님들의 도움이 절실합니다.

Comment '4'
  • profile
    러닝은빛 2014.10.20 00:02

    아예 필요에 따라 조건 분기 스크립트를 변경해서 사용하시는 건 어떻습니까?


    조건 분기도... 스크립트에서 처리되는데 그 처리 구문이 스크립트 에디터에 정의되어있습니다.


    그래서 원하는 대로 바꿀 수 있습니다.


    아래 스크립트를 소재 밑에 추가하면 됩니다.


    액터의 번호가 있는 변수의 번호를 아래 굵은 부분에 넣어주시면 조건 분기를 질문자님께서 원하는 방향으로 사용하실 수 있습니다.


    기존에 액터를 고를 수 있는 부분만 무시하시고 쓰면 됩니다. 액터를 골라도 어차피 액터의 번호가 저장되어있는 변수의 값으로 골라집니다.




    class Game_Interpreter

      def command_111

        result = false

        case @params[0]

        when 0  # Switch

          result = ($game_switches[@params[1]] == (@params[2] == 0))

        when 1  # Variable

          value1 = $game_variables[@params[1]]

          if @params[2] == 0

            value2 = @params[3]

          else

            value2 = $game_variables[@params[3]]

          end

          case @params[4]

          when 0  # value1 is equal to value2

            result = (value1 == value2)

          when 1  # value1 is greater than or equal to value2

            result = (value1 >= value2)

          when 2  # value1 is less than or equal to value2

            result = (value1 <= value2)

          when 3  # value1 is greater than value2

            result = (value1 > value2)

          when 4  # value1 is less than value2

            result = (value1 < value2)

          when 5  # value1 is not equal to value2

            result = (value1 != value2)

          end

        when 2  # Self switch

          if @event_id > 0

            key = [@map_id, @event_id, @params[1]]

            result = ($game_self_switches[key] == (@params[2] == 0))

          end

        when 3  # Timer

          if $game_timer.working?

            if @params[2] == 0

              result = ($game_timer.sec >= @params[1])

            else

              result = ($game_timer.sec <= @params[1])

            end

          end

        when 4  # Actor

          actor = $game_actors[[1,$game_variables[100]].max]

          if actor

            case @params[2]

            when 0  # in party

              result = ($game_party.members.include?(actor))

            when 1  # name

              result = (actor.name == @params[3])

            when 2  # Class

              result = (actor.class_id == @params[3])

            when 3  # Skills

              result = (actor.skill_learn?($data_skills[@params[3]]))

            when 4  # Weapons

              result = (actor.weapons.include?($data_weapons[@params[3]]))

            when 5  # Armors

              result = (actor.armors.include?($data_armors[@params[3]]))

            when 6  # States

              result = (actor.state?(@params[3]))

            end

          end

        when 5  # Enemy

          enemy = $game_troop.members[@params[1]]

          if enemy

            case @params[2]

            when 0  # appear

              result = (enemy.alive?)

            when 1  # state

              result = (enemy.state?(@params[3]))

            end

          end

        when 6  # Character

          character = get_character(@params[1])

          if character

            result = (character.direction == @params[2])

          end

        when 7  # Gold

          case @params[2]

          when 0  # Greater than or equal to

            result = ($game_party.gold >= @params[1])

          when 1  # Less than or equal to

            result = ($game_party.gold <= @params[1])

          when 2  # Less than

            result = ($game_party.gold < @params[1])

          end

        when 8  # Item

          result = $game_party.has_item?($data_items[@params[1]])

        when 9  # Weapon

          result = $game_party.has_item?($data_weapons[@params[1]], @params[2])

        when 10  # Armor

          result = $game_party.has_item?($data_armors[@params[1]], @params[2])

        when 11  # Button

          result = Input.press?(@params[1])

        when 12  # Script

          result = eval(@params[1])

        when 13  # Vehicle

          result = ($game_player.vehicle == $game_map.vehicles[@params[1]])

        end

        @branch[@indent] = result

        command_skip if !@branch[@indent]

      end

    end




  • ?
    귀칸 2014.10.20 12:47
    오오옷!감사합니다!
    크으 드디어 일일히 설정하던 조건분기 지옥에서 벗어날수 있겠군요 ㅠㅠ
    정말 다시 한번 감사의 말 드립니다.
  • ?
    귀칸 2014.10.20 13:21
    으으 기존의 분기들로만 하려니 제약이 너무 많네요..
    해당 멤버의 파타메터도 계산하고 변경도 해야하는데...
    다시 찾아봐야겠네요 ㅜ
  • profile
    러닝은빛 2014.10.20 15:29
    새롭게 올리신 질문에 답변을 달았습니다.

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12392
Board Pagination Prev 1 ... 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 Next
/ 82