[JS] Force Critical Hit Message

RedFoxGaming

Veteran
Veteran
Joined
Jan 14, 2018
Messages
88
Reaction score
16
First Language
English
Primarily Uses
RMMV
So I'm not using the engine's default CHIT system. I'm using a custom check in my attack formula function I've created and when the check passes, the damage returned will be based off a different formula for the critical hit. All I want to know, in addition to returning the damage, how could I return the Critical Hit message to signify a critical hit was successful. Also for reference, how could I do the same for a Miss and an Evasion if I want to do more than the base game calculations.
 

MushroomCake28

KAMO Studio
Moderator
Joined
Nov 18, 2015
Messages
2,229
Reaction score
3,591
First Language
English
Primarily Uses
RMMV

I've moved this thread to Learning Javascript. Please be sure to post your threads in the correct forum next time. Thank you.

 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,444
Reaction score
934
First Language
EN
Primarily Uses
RMMV
The messages as defined in the database are properties of the TextManager, e.g. TextManager.criticalToActor. You can manually add text to the log window during battle with a script call, e.g.
JavaScript:
SceneManager._scene._logWindow.push("Hello world!");
SceneManager._scene._logWindow.push(TextManager.criticalToEnemy);
If you're sticking this all in the damage formula box (eurgh) then remember to keep your formula result on the last "line" of code (lines are split by semi-colons).

With this method it's possible the log won't clear when you expect. If you need to clear it manually, try this:
JavaScript:
SceneManager._scene._logWindow.clear();
Here's some of the other values you asked about~
  • For "missed":
    • Target is actor: TextManager.actorNoHit
    • Target is enemy: TextManager.enemyNoHit
  • For "evaded":
    • Physical: TextManager.evasion
    • Magical: TextManager.magicEvasion
You can find the TextManager properties in rpg_managers.js, around line 1717; the battle log stuff can be found under Window_BattleLog in rpg_windows.js. :)
 

RedFoxGaming

Veteran
Veteran
Joined
Jan 14, 2018
Messages
88
Reaction score
16
First Language
English
Primarily Uses
RMMV
Thank you. That is a huge help
 

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

Latest Threads

Latest Profile Posts

Person: "Taxes are bs and money is, too! Anarchy!!" *Literally anything goes wrong* Same Person: "Why hasn't the government fixed this???"
Stream will be live shortly with a session of Haunting Ground! Feel free to drop by!
As for the Coronavirus? Well: "People that spend their life avoiding death are already dead (they're also rich, and I like to spend my life with their money.)"
- R. Sanchez, "Edge of Tomorty: Rick, Die, Repeat"
making pierogi and corrupting my game files wbu

Forum statistics

Threads
94,345
Messages
920,111
Members
124,105
Latest member
acelaces
Top