[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,209
Reaction score
3,577
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,438
Reaction score
924
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 Posts

Latest Profile Posts

My kitty still young (3-4 months), I think I could teach her some funny tricks... like: "Play dead-ly good music for my games"
Here's a quality DPS class idea: The Beekeeper, who uses the "Bees!!" skill to attack and poison enemies.
Please don't create long, boring cutscenes in which characters do nothing but stand around talking.
What if I took a lesson from Half Minute Hero? Let the player get dumb powerful each area, but reset them down to just slightly stronger than before for the next map?
Been averaging 2-3 hours sleep for almost a month now. Starting to space out all the time ^^;

Forum statistics

Threads
94,264
Messages
919,484
Members
123,982
Latest member
Rendechuu
Top