Window_BattleLog itself looks like this:
#==============================================================================
# ** Window_BattleLog
#------------------------------------------------------------------------------
#==============================================================================
# Battle log window
# By gerkrt/gerrtunk
# Version: 1
# License: MIT, credits
# Date: 24/01/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================
=begin
------INTRODUCTION------
This window shows a new window and in battle that displays a list of the last
actions executed.
You can configure witdh, lines heigh, x and y and all the vocabulary used.
-----INSTRUCTIONS-------
The vocabulary is pretty self explanatory. Thet are the variables called Voc and
they dot whay you see. Note that a . is added always at the end of a phrase.
Lines height is the max lines of the log window.
Battle window X and Y control these positions. You can changue they at your will
for aesthetichs or improve interface.
Finall You can modifiy the Battle witdht window if you think that it takes too
space or you need more.
=end
module Wep
Lines_height = 10
BattleWindow_Width = 350
Wep::BattleWindow_X = 0
Wep::BattleWindow_Y = 0
VocStart = 'Walka rozpoczęta!'
VocMiss = ' chybia'
VocAtk = ' atakuje'
VocDies = ' umiera'
VocWin = 'Zwycięstwo!'
VocLose = 'Porażka!'
VocEscape = 'Drużyna ucieka!'
VocEscapeFails = 'Nie udało się uciec'
VocMag = ' rzuca '
VocItem = ' używa '
VocDef = ' broni się'
VocNothing = ' nic nie robi'
VocItem = ' użyje przedmiotu '
VocItemZS = ' użyje na sojuszniku przedmiotu '
VocItemZW = ' użyje na wrogu przedmiotu '
VocSkill = ' rzuci zaklęcie '
VocSkillZS = ' rzuci na sojusznika zaklęcie '
VocSkillZW = ' rzuci na wroga zaklęcie '
VocRez = ' coś chciał ale się rozmyślił'
VocCeluje = ' zaatakuje '
VocNakogo = ' na '
VocNic = ' '
VocObrona = ' będzie się bronić'
VocNowaTura = '------------------------------ Nowa tura ------------------------------'
VocTura = 'TURA '
end
class Window_BattleLog < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# exp : EXP
# gold : amount of gold
# treasures : treasures
#--------------------------------------------------------------------------
def initialize(troop_id)
@small_list = []
@troop_id = troop_id
Wep::Lines_height.times {@small_list.push('')}
# until this, no contents
super(Wep::BattleWindow_X, Wep::BattleWindow_Y, Wep::BattleWindow_Width, $game_party.actors.size * 20 + 40)
self.z = 99
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.clear
self.back_opacity = 160
refresh
end
def end_log
if Wep::Battle_Ends[@troop_id] != nil
@list.push Wep::Battle_Ends[@troop_id]
else
@list.push Wep::Default_End
end
@list.push Wep:Battle_Ends[troop_id]
end
def refresh
self.contents = Bitmap.new(width - 32, height - 32)
for i in 0...@small_list.size
self.contents.font.size = 15
self.contents.draw_text(0, (($game_party.actors.size * 20 - 20) - (i * 20)), Wep::BattleWindow_Width-32, 32, @small_list[i], 1)
self.contents.font.size = 22
end
end
def add_line(line)
# Add to the start and move
@small_list.unshift(line)
# Remove last element
@small_list.pop
end
def add_linem(line)
# Add to the start and move
@small_list.unshift(line)
# Remove last element
@small_list.pop
end
def add_linema(line)
# Add to the start and move
@small_list.unshift(line)
# Remove last element
@small_list.pop
end
def add_linesy(line)
# Add to the start and move
@small_list.unshift(line)
# Remove last element
@small_list.pop
end
def add_special_line(line)
# Add to the start and move
@small_list.unshift(line)
# Remove last element
@small_list.pop
refresh
end
def clear
self.contents.clear
end
end
The rest is scattered throughout the scripts it was modyfing (Game_Battler and Scene_Battle) in theirs respective places.
I added this at the end of Scene battle 1:
# Chequea turno, linea, posa . final,etc
def log_add_line(line, origin, extra, jeszcze)
complete = origin.name + line + extra + jeszcze
@log_window.add_line(complete)
@log_window.refresh
end
# Chequea turno, linea, posa . final,etc
def log_add_linem(line, origin, extra)
complete = origin.name + line + extra
@log_window.add_linem(complete)
@log_window.refresh
end
# Chequea turno, linea, posa . final,etc
def log_add_linema(line, origin)
complete = origin.name + line
@log_window.add_linema(complete)
@log_window.refresh
end
# Chequea turno, linea, posa . final,etc
def log_add_linesy(line)
@log_window.add_linema(line)
@log_window.refresh
end
Its right after this thing:
# Branch according to phase
case @phase
when 1 # pre-battle phase
update_phase1
when 2 # party command phase
update_phase2
when 3 # actor command phase
update_phase3
when 4 # main phase
update_phase4
when 5 # after battle phase
update_phase5
end
end
As you can see i copied "def log_add_line" and added some letters so i can use this command with less amount of arguments than 3 to display lines in battle log. Sometimes they require less information, for example line about defending requires only the name of the actor and the quote " is going to defend himself" which means 2 arguments, or the information about what turn it is, it requires only 1 argument).
And of course there are many commands in the Scene_Battle 3 like...
" $scene.log_add_line(Wep::VocSkill, @active_battler, @skill.name, " on the enemy #" + (@enemy_arrow.index+1).to_s)"
([Actor's name] + " will cast the skill " + [skill name] + " on the enemy #" + [enemy's id in battle(number in a row)].
or
$scene.log_add_line(Wep::VocItem, @active_battler, @item.name, " on the ally #" + (@actor_arrow.index+1).to_s)
([Actor's name] + " will use the item " + [item name] + " on the ally #" + [ally's id in party(number in a row)].
...to make the lines appear in the battle log when the action is ordered to be done in the main phase of the battle turn.
And thats it, let me know if you need more informations.