EST - AUTO TEXT COLOR PLUS

Discussion in 'JS Plugin Releases (RMMV)' started by estriole, Nov 5, 2015.

  1. Lyson

    Lyson Potholders! Veteran

    Messages:
    91
    Likes Received:
    35
    Location:
    USA
    First Language:
    English
    Wow, as always estriole, this is fantastic.
     
    #21
  2. Neo Soul Gamer

    Neo Soul Gamer Veteran Veteran

    Messages:
    612
    Likes Received:
    329
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    N/A
    I'll definitely be waiting for that next update. Looking forward to it.
     
    #22
  3. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    updated the plugins to v1.5

    changelog:

       v1.5 2015.11.23       - Add new plugin parameter: UseInAllWindows
                               if set to true... all window that can autocolor will use autocolor
                               this plugin also compatible with Modern Algebra Global Text Codes
                               so now skill / item / status / other window can be auto colored.
                               make sure his plugin is placed BELOW my plugin.
     

    Note: since modern algebra already create that plugin for making text code available in all window...

    i cancelled making skill/item/status/etc window to be able to autocolor inside this plugin.

    you can use modern algebra plugin instead

    link:  Modern Algebra Global Text Codes

    make sure to place his plugin below my plugin...

    i also request him to modify his plugin so we don't have to add \* in the database. or at least option for it.

    i hope he willing to do that.

    for now you can also use this modified version of his plugin which don't need \* at front of the actor/skill name in database.

    //=============================================================================//  GlobalTextCodes.js//=============================================================================//  Version: 1.0.2//  Date: 21 November 2015//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/*: * @plugindesc Use basic escape codes in any window for any text * @author Modern Algebra (rmrk.net) * @help This plugin allows you to use basic escape codes in any text field, so long * as you include \* in the text field. By default, the options are limited to * \c[n]; \i[n]; \v[x]; \n[x]; \pn[x]; \{; \}; and \G. They may be expanded by * other message scripts which add escape codes, but not likely by all such * escape codes as some would be necessarily restricted to the message window. * * When using codes like \c[n] and others that change the font settings, * remember that you should set it back to normal afterwards. In other words, * write "\*\c[3]Text\c[0]" and not just "\*\c[3]Text" *///=============================================================================var Imported = Imported || {};Imported.MA_GlobalTextCodes = true;var ModernAlgebra = ModernAlgebra || {};ModernAlgebra.GTC = {};(function() {        // Draw Text - Check for \* and drawTextEx if it is present    ModernAlgebra.GTC.window_Base_drawText =            Window_Base.prototype.drawText;    Window_Base.prototype.drawText = function() {        var text = arguments[0];        if ((typeof text === 'string' || text instanceof String)) {            var tx = this.magtcCalculateAlignmentExX.apply(this, arguments);            // Draw Special Text if the \* code is present            this.drawTextEx(text, tx, arguments[2]);        } else {            // Draw Normal Text otherwise            ModernAlgebra.GTC.window_Base_drawText.apply(this, arguments);        }    };            // Calculate Alignment Ex X - Get display X when using different alignment    Window_Base.prototype.magtcCalculateAlignmentExX = function(text, tx, y, mw, align) {        if (align === 'center' || align === 'right') {            // Calculate line length and adjust x based on alignment            var tw = this.magtcMeasureTextEx(text);            var blankSpace = mw - tw;            if (align === 'center') {                blankSpace = blankSpace / 2;            }            tx = tx + blankSpace;        }        return tx    };        // Measure text that has escape codes    Window_Base.prototype.magtcMeasureTextEx = function(text) {        // Create temporary bitmap for testing to accomodate other scripts with unknown codes        this._magtcAlignmentTesting = true;        var realContents = this.contents;        this.contents = new Bitmap(24, 24);        this.resetFontSettings();        // Draw TextEx on the temporary Bitmap        var firstLine = text.match(/^\n?(.+)\n?/)[0] || '';        var tw = this.drawTextEx(firstLine, 0, 0);        // Restore normal contents        this._magtcAlignmentTesting = null;        this.contents = realContents;        return tw    }})();
    edit: if modern algebra didn't modify his plugin... maybe i will add the modified code inside my plugin but will add him to credit list.
     
    Last edited by a moderator: Nov 23, 2015
    #23
    Makeratore likes this.
  4. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    updated plugin to v1.6

       v1.6 2015.11.27       - minor bugfix - check switch max for auto color and auto correct.
                               i also advice didn't modify modern algebra and use it as it is
                               by adding \* at the database entry. also having enemies that autocolor
                               using modern algebra plugin combined with yanfly battle engine using
                               visual selection... could cause fps loss (up to 20fps). so if you
                               use yanfly plugin... don't add \* in your enemy name
     

    because of this issue... i might create my own global text codes maybe...

    btw... soon released. (will post the plugin topic after posting this)

    EST - BATTLE ROYALE EVO

    want to have PLAYER + ALLIED ENEMY vs ENEMY vs ENEMY vs ENEMY vs ENEMY vs ENEMY ???

    complex battle where suddenly 3rd party join the battle. maybe some other country troop suddenly attack you and your enemy.

    or some ecosystem where tiger monster eat rabbit monster. it's up to your imagination.
     
    Last edited by a moderator: Nov 28, 2015
    #24
    Makeratore likes this.
  5. Prescott

    Prescott argggghhh Veteran

    Messages:
    445
    Likes Received:
    292
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    This is great!

    Is there any way to make it case sensitive? I would like to have my weapons that say "Fire" have it in red, but when people normally say "fire" it would still be in white unless I manually chose to do that.
     
    #25
  6. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    updated to v1.7

       v1.7 2015.11.27       - minor bugfix - if switch is set to 0. will properly auto activate.

                               requested by Prescott... added new parameter.

                               DisableCaseSensitiveSwitch => switch ID

                               when this is set.

                               when switch on = CASE NOT SENSITIVE

                               when switch off = CASE SENSITIVE

                               if the switch id is 0. it will always CASE NOT SENSITIVE

                               there's also parameter to make it AUTO flip on.

    so basically it's controlled by switch. warning though...

    when you set it to case sensitive... the auto correct part won't fix the DoRaeMon to Doraemon. since it cannot detect it...

    i will think for another approach later when i have time. maybe like wrapping it inside escape code to make it not converted...

    \z[fire] maybe? any sugestion on what escape code? i'm afraid to conflict with other coder escape code too :D .

    edit: wrapping in escape code will be really hard. JS didn't recognize regexp for negative lookbehind
     
    Last edited by a moderator: Nov 28, 2015
    #26
    Makeratore likes this.
  7. Mattchaby

    Mattchaby Villager Member

    Messages:
    15
    Likes Received:
    3
    First Language:
    French
    Hey nice script! 

    Maybe I missed the answer somewhere but I'm facing an issue: I'm allowing the player to set his own actor names. Would there be a way for the plugin to recognize \n[x] in message windows regardless of the related name? To go even further maybe this could be done with other message codes that are calling a string. Thanks :)
     
    #27
  8. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    there's a way to do that by adding the name using scriptcall...

    1) BEFORE you call name input processing:

    (for this example i use actor 1)

    script call:

    var name = $gameActors.actor(1).name();delete $gameSystem._AC_setting[name];change 1 to your actor id

    this for deleting previous actor 1 name (if you do this at the start of the game and didn't add actor 1 in autocolor start entry... skip this step)

    useful only if you change the actor name more than 1 time... and don't want previous actor name still auto colored...

    2) Call Name input processing

    3) then AFTER you call name input processing:

    (for this example i color the actor 1 with color 7)

    script call:

    var name = $gameActors.actor(1).name();$gameSystem.add_AC_Entry(name,7);change 1 to your actor id

    change 7 to color of your choice...

    warning though.... since anyone can input anything... it might ruin the game...

    i will find another way for this later... thanks for your post that open up for this possible trouble... i will try to find a solution for this.
     
    #28
    Makeratore likes this.
  9. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    I found a new way to do this... but it will change how this plugin works for a bit...

    previously:

    plugin parameter setting: Doraemon; 10Actor 1 name = Doraemon Furytext: \n[1]Doraemon part will be colored... while Fury doesn't.

    changed to:

    it won't change the Doraemon part. all 'normal' plugin parameter setting will not affect names... EXCEPT:

    plugin parameter setting: \\n\[1\]; 10Actor 1 name = Doraemon Furytext: \n[1]it will auto color whole Doraemon Fury... the advantage is that even if you change actor 1 name to Nobita's Sorrow or anything...

    it will auto color it. also even if people put word that might break the auto color such as 'is', 'are', 'not' etc which used in lots of

    conversation... it will not auto colored and only the actual name is auto colored.

    btw... basically \\n\[1\] is \n[1]

    but with extra escape character(\) for \, [, and ]

    you could also use \\v\[1\] to autocolor variable 1.

    basically all escape code that return string could be use... just remember to escape all the 'special' character...

    so... updated plugin to v1.8

    changelog:

       v1.8 2015.12.17       - changed autocolor for actor name... now normal text plugin parameter

                               doesn't affect \n[1] which is actor 1 name...

                               ex: plugin param: Doraemon; 11. actor name: Doraemon.

                               it won't be colored...

                               but instead you could use

                               \\n\[1\];11

                               (it's basically \n[1] but \ , [ and ] is escaped using extra \)

                               in plugin parameter to color actor 1 name to color 11. this way...

                               even when you change actor 1 name... it will still colored.

    edit: add 20 entry for plugin parameter entry to 50 entry... since you might need it...
     
    Last edited by a moderator: Dec 17, 2015
    #29
    Makeratore likes this.
  10. Mattchaby

    Mattchaby Villager Member

    Messages:
    15
    Likes Received:
    3
    First Language:
    French
    Wow just tested it works perfectly, even with Yanfly Message Core. Congrats and thanks a lot!
     
    #30
  11. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    thanks...

    i do found some problem with yanfly message core though... especially with his name box...

    let me explain:

    plugin param1: Doraemon; 3plugin param2: \\n\[3\];11actor 3 name: Doraemon Zerowe want to use actor 3 name as namebox... so we add this in message:\n<\n[3] 's POV> somehow in namebox it transform to:\c[11]\c[3]Doraemon\c[0] Zero\c[0] 's POV so only the Doraemon part is colored with color 3... Zero is not colored.

    it because of two things... first is overlapping autocolor... second is because yanfly pass the already converted text to namebox...

    so \n[3] 's POV will first transform to \c[11]Doraemon Zero\c[0] 's POV. and passed to yanfly namebox...

    which will detect "Doraemon" and change it to \c[11]\c[3]Doraemon\c[0] Zero\c[0] 's POV

    it won't be a problem if you set your name and plugin parameter carefully... but it might become a problem if your actor name can be changed by player...

    so i made a patch to make yanfly name box use the unconverted text instead... fortunately... it's overwrite patch... (cannot find a way to alias it)..

    that's why the patch will work only if my plugin placed below Yanfly Message Core...

    i also add plugin command to turn off / on the patch...

    because of overwrite patch... if yanfly change the method i overwrite to add more feature for example... that mean i need to redo the patch again >.<.

    i will try asking yanfly to implement the patch directly in his plugin. hopefuly he willing to do that...

    so... updated the plugin to v1.9 (if yanfly update his plugin... just turn set plugin parameter to not using the patch).

    changelog:

       v1.9 2015.12.18       - add patch for Yanfly Namebox autocolor bugfix. it's overwrite patch...

                               so this plugin must be placed below yanfly's message core if you want

                               the namebox fix patch to work... the patch is optional and you can

                               turn it off if you want in plugin parameter...
     
    #31
    Makeratore likes this.
  12. Heartbreak61

    Heartbreak61 Wandering Noob Veteran

    Messages:
    188
    Likes Received:
    86
    Location:
    on your screen
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    Come on mate, one more patch and you got 2.0

    XDD
     
    #32
    estriole likes this.
  13. Todeswalzer

    Todeswalzer Veteran Veteran

    Messages:
    64
    Likes Received:
    18
    Location:
    Carlisle, Cumbria, UK
    First Language:
    English
    Is there a way to include special characters? A lot of the names I'm using in my game have accents etc. over/under some of the letters and even when I use words with punctuation marks, they don't change colour. So when i input something like Pratheṣ; 1 It doesn't auto colour and I can only assume it's because of the little dot under the S... It's not a huge deal, I can just go old school with those words, but I like this plugin...
     
    #33
  14. exnem

    exnem Veteran Veteran

    Messages:
    62
    Likes Received:
    8
    First Language:
    english
    Does anyone have a copy of this script? The download links are broken...

    Also does anyone know if this plugin works with GameUs Quest Journal plugin? I tried using Irina's Auto Message Color plugin, but I get weird characters in the Journal text when I use it.
     
    #34

Share This Page