How to force the Battle Log to display certain messages?

Status
Not open for further replies.

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
well 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
 

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
But how exactly do I do it? What is the Battle Log's "text showing method" that I can use?
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 
Last edited by a moderator:

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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...
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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
 
Last edited by a moderator:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
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, B) 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, B) 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
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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:

Code:
x="Hi."x+=" Hello."x+=" This is getting long eh?"x+=" Surely so long. wahahahahahaha"SceneManager.scene.log_window.add_text(x)
or

Code:
y=SceneManager.scene.log_windowy.add_text(text)
 
Last edited by a moderator:

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
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.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
If you want to. :)


just put Adiktuzmiko
 

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
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?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
I'm not sure as I haven't actually updated my Ace, but it's on the RM blog posts
 
Last edited by a moderator:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
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.
 

Solo

Veteran
Veteran
Joined
Jul 26, 2013
Messages
1,104
Reaction score
154
First Language
English
Primarily Uses
RMVXA
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?
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top