RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX] Help writing additional messages into the battlelog during a fight.

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 40
RMRK Junior
I'm not sure if this is the right place to post this since I don't a full add-on script, just some advice for writing a few lines into a common event, but any help would be appreciated.

Basically, I have a few skills that deal damage that's calculated using variables and inflicted via the 'set enemy HP' command using a linked common event. When the skill is used, it obviously shows the base damage in the battle log, but not the additional bonus damage.
I was wondering if there was a way I could insert a script into the attached common event that would display the secondary damage effect in the logs as well.

Something like-

BattleLog.Print(This attack inflicted an additional (Variable x) damage!)

I haven't the faintest idea how to code in Ruby however and my attempts to do so have resulted in error after error - I'd assume this would only take a few lines at most once I figured it out though? Or is it more complex than that? Is it even possible?

Help D:

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
Found
http://forums.rpgmakerweb.com/index.php?/topic/25061-how-to-force-the-battle-log-to-display-certain-messages/

Quote from: Archeia of rpgmakerweb
Okay first, add this scriptlet.
 
Code: [Select]
class Scene_Battle < Scene_Base
  attr_accessor:log_window
end

Then 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:
         
Code: [Select]
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       
  end
end #End of Class
then 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

If you want it to clear make sure to use this.
Code: [Select]
SceneManager.scene.log_window.wait_and_clear

Hope this helps.
&&&&&&&&&&&&&&&&

**
Rep: +0/-0Level 40
RMRK Junior
Thanks! I'll try it out next time I get a chance and tell you how it goes.

Hopefully with great success :D

**
Rep: +0/-0Level 40
RMRK Junior
Hmmm, unfortunately that script was for ACE, so I don't know if all the syntax is the same :/

I'll keep tinking though and see if I can use it as a base.

*
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Rep:
Level 96
&&&&&&&&&&&&&&&&&&&&&&&&&&&
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
Oh I'm sorry. I wasn't paying attention.
I tried looking at how it works and could only figure out how to display it as a message, but not as a battlelog.
&&&&&&&&&&&&&&&&

**
Rep: +0/-0Level 40
RMRK Junior
It's cool - Enterbrain could've really saved their users a lot of time by just calling it RPG Maker ACE, but hey.

But yes, unfortunatly I didn't have much luck either :/

I imagine the concept is similar, but it's difficult to know what syntax needs changing and I still don't really understand the whole order of operations thing. Like, what happens if I call the event whilst another message is already being shown? Or during skill select? This isn't an issue in ACE, but in VX the battle log uses the same space as the action selection window.

I didn't really get what they meant be Method either. In Visual Basic they're like a separate section of code that can be referenced by any other line of code - but I'm not really sure how that translates into RPG Maker D:

Edit: Although I didn't find a solution to this exact issue, the 'YERD_DmgFormula' script solved all my problems for the purposes of incorporating bonus damage into the base damage of a skill, so I guess this thread can be closed :)

Again, thank you Boe for all your help :)
« Last Edit: December 20, 2015, 03:00:10 AM by Pixie1001 »