Say I want to create a custom failure message, something or other, for a skill, to be displayed after its usage message in the Battle Log. Is there any way to do this? Or any way to force certain text to be generated by the Battle Log in general?
How to force the Battle Log to display certain messages?
RGSS3 Script Requestswell yes since you have access to the Battle Log's text showing methods anyways (assuming your calling from inside Scene_Battle)... else you would need to make an accessor for the @log_window first or add a method to the battle scene to handle it
But how exactly do I do it? What is the Battle Log's "text showing method" that I can use?
Go to Window_BattleLog, it's all there... When you have something that is involving a default script, easiest way is to read first thru the scripts
I know, and I did, but I couldn't glean anything useful.
then you're not looking close enough... you might also want to look at the battle scene and the other battle related things...
one method you might wanna be interested at is the add_text(text) method of battle log, that's what I use
one method you might wanna be interested at is the add_text(text) method of battle log, that's what I use
See, I tried that and it gave me an "undefined method" error.
How did you call that? You need a battle log object first of course
PS: If you already tried something, always see to it that you post ALL DETAILS on your first post...
PS 2: When posting errors, always post the WHOLE ERROR...
PS: If you already tried something, always see to it that you post ALL DETAILS on your first post...
PS 2: When posting errors, always post the WHOLE ERROR...
And how might I set that up?
Depends on where you want to call it... Like what I said before, Scene_Battle already has one, so if you're calling from within Scene_Battle then you can simply use @log_window... else you might wanna make an accessor on Scene_Battle for @log_window so you can do something like this when on battle: SceneManager.scene.log_window.add_text
Okay first, add this scriptlet.
class Scene_Battle < Scene_Base attr_accessor:log_windowendThen to force things, it kinda depends? Here's how I did it though. I made a custom formula but let it be called through a method.
Example:
class Game_Battler < Game_BattlerBase #--------------------------------------------------------------------------- # Ralph's Stale Bread (#if (b.id==5 || b.id==7); b.tp+=20; b.hp+=50; else; 20; end) #---------------------------------------------------------------------------- def bread(a, 😎 if b.id.to_i == 5 || b.id.to_i == 7 b.tp+=20 if SceneManager.scene.is_a?(Scene_Battle) #This is to add custom battle log SceneManager.scene.log_window.add_text(b.name + " gained 20TP") SceneManager.scene.log_window.wait end return 50 else if SceneManager.scene.is_a?(Scene_Battle) SceneManager.scene.log_window.wait end return 20 end endend #End of Classthen I put this in the formula box of the item stale bread:
b.bread(a, 😎 You could probably use:
SceneManager.scene.log_window.add_text("Insert custom text here")
SceneManager.scene.log_window.wait
in a script call. I have yet to test.
edit:
Okay I tried it out. It works.
If you want it to clear make sure to use this.
class Scene_Battle < Scene_Base attr_accessor:log_windowendThen to force things, it kinda depends? Here's how I did it though. I made a custom formula but let it be called through a method.
Example:
class Game_Battler < Game_BattlerBase #--------------------------------------------------------------------------- # Ralph's Stale Bread (#if (b.id==5 || b.id==7); b.tp+=20; b.hp+=50; else; 20; end) #---------------------------------------------------------------------------- def bread(a, 😎 if b.id.to_i == 5 || b.id.to_i == 7 b.tp+=20 if SceneManager.scene.is_a?(Scene_Battle) #This is to add custom battle log SceneManager.scene.log_window.add_text(b.name + " gained 20TP") SceneManager.scene.log_window.wait end return 50 else if SceneManager.scene.is_a?(Scene_Battle) SceneManager.scene.log_window.wait end return 20 end endend #End of Classthen I put this in the formula box of the item stale bread:
b.bread(a, 😎 You could probably use:
SceneManager.scene.log_window.add_text("Insert custom text here")
SceneManager.scene.log_window.wait
in a script call. I have yet to test.
edit:
Okay I tried it out. It works.
If you want it to clear make sure to use this.
Code:
SceneManager.scene.log_window.wait_and_clear
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
Thanks, Archeia, your method technically works; however, there doesn't seem to be enough room in the Script Call box for a message of substantial length. When I just enter the letter "A" it works fine (because the text isn't pushed to two lines), but anything longer than that and I get an Argument Error from Game_Interpreter, line 1411 (wrong number of arguments, 0 for 1)... because it's not treating the message as being part of the same line as "SceneManager.scene.log_window.add_text" (which pushes the boundary as it is). I'm not pressing enter when I hit the end of the line, either.
In one of the screenshots you posted, of the Troops editor, the Script Call lines appear much longer; how is this possible?
In one of the screenshots you posted, of the Troops editor, the Script Call lines appear much longer; how is this possible?
update to 1.02a for a larger script box... though why are you using script call boxes for this?
you can also do something like this:
or
you can also do something like this:
Code:
x="Hi."x+=" Hello."x+=" This is getting long eh?"x+=" Surely so long. wahahahahahaha"SceneManager.scene.log_window.add_text(x)
Code:
y=SceneManager.scene.log_windowy.add_text(text)
Thank you both so much. Would it be all right if I credited you in my game for helping me? If so, please let me know how you wish to be credited.
If you want to. 🙂
just put Adiktuzmiko
just put Adiktuzmiko
Great. By the way, about that update, would I just re-download the trial version and activate it using the same product registration info/key, or...?
What else has been updated since 1.01a? Any new issues to be concerned about?
What else has been updated since 1.01a? Any new issues to be concerned about?
I'm not sure as I haven't actually updated my Ace, but it's on the RM blog posts
There should be no issues and upgrade your Ace copy 🙂
If you're using the old DRM then you might have to contact support just in case your key won't work for some reason.
If you're using the old DRM then you might have to contact support just in case your key won't work for some reason.
Thanks again, Archeia, Adiktuzmiko.
By the way, Adiktuzmiko, you asked why I was using Script Call boxes for this. Pardon my not knowing, but what other method is there?
By the way, Adiktuzmiko, you asked why I was using Script Call boxes for this. Pardon my not knowing, but what other method is there?
Original thread: https://forums.rpgmakerweb.com/threads/how-to-force-the-battle-log-to-display-certain-messages.25061/