[ACE] Add text to Window_BattleLog from Game_Battler?

● ARCHIVED · READ-ONLY
Started by Gleen 5 posts View original ↗
  1. Hello, I made a new method in Game_Battler wich will check if something happens then it'll show some text. Since RMVXAce doesn't have the sprite text like RMXP had I'll add the text in Window_BattleLog.

    The question is: it's possible to do that? If so how can i do that? I know that when in Scene_Battle both classes are being used but i don't know how i can make this.

    Thanks in advice
  2. Just create some extra attributes in Game_ActionResult and then have your battler add stuff to @result.

    That's the standard (Ace) way of processing action results.

    By default the battle log will run through a set of checks through the result object and see what to display.

    Example:



    Code:
       def draw_magic(user, item)
          skill_id = user.actions[0].draw_id
          return if skill_id == 0
          avail = get_magic_units(skill_id)
          drawn = calculate_draw_amount(user, self)
          amount = [[drawn, avail].min, 0].max
          if amount > 0
            user.add_magic_units(skill_id, amount)
            lose_magic_units(skill_id, amount)
            @result.draw_amount = amount
            @result.draw_magic_name = $data_skills[skill_id].name
            @result.success = true
          end
        end
    XOemQ.jpg
  3. Thanks man! Your example was more than enough for me to understand. Now i can finally finish this script (i hope so haha)

    EDIT: Somewhat related question... its possible to change text color for the line i want to show in battlelog?
  4. Does not seem as trivial as it looks, because it's being passed to draw_text_ex

    Window_BattleLog



    Code:
      def draw_line(line_number)
        rect = item_rect_for_text(line_number)
        contents.clear_rect(rect)
        draw_text_ex(rect.x, rect.y, @lines[line_number])
      end
    All of the text is pushed into the @lines array.

    You don't have much control over the color.

    It doesn't look like escaped control characters work either (eg: \V[n] to replace it with the value of the nth variable)
  5. I get it... well, maybe i'll edit draw_text_ex so i can color my lines the way i want inside my project but for sharing purposes my question is solved. Thanks again!