Battle GUI Core - hide actor comand on enemy select

Discussion in 'Javascript/Plugin Support' started by surunime, Oct 21, 2019.

  1. surunime

    surunime Villager Member

    Messages:
    14
    Likes Received:
    1
    First Language:
    indonesia
    Primarily Uses:
    RMMV
    hello, i was using this plugin http://sumrndm.site/battle-gui-core/

    when actor select item or magic, actor command automaticaly hidden, but when actor select enemy actor command still there not hidden.

    i try to read documentation about this plugin it can modify when actor command hide. so i try to change parameter 'Actor command Visible' on plugin manager to

    but i got error

    i dont know much bout javascript, and i need help if anyone can modify this plugin when actor select enemy actor command dissapear?

    thank you very much..
     
    #1
  2. surunime

    surunime Villager Member

    Messages:
    14
    Likes Received:
    1
    First Language:
    indonesia
    Primarily Uses:
    RMMV
    bumb
     
    #2
  3. Anyone

    Anyone Veteran Veteran

    Messages:
    74
    Likes Received:
    57
    First Language:
    German
    Primarily Uses:
    RMMV
    A bit late, but probably better late than never?

    I came across pretty much the same issue an hour ago, and at first was a bit dumbfounded, too.
    The answer is that SRD's linked to a wrong or outdated entry.

    EnemyList (which he links to) & enemyWindow (which he defines as his own "value holder" of EnemyList) both aren't terms used in the rpg_windows.js.
    To find the correct terms, that's where you have to go.

    So if you open rpg_windows.js (which is where the vanilla windows are handled) and scan through the lines, you'll come across this:
    Code:
    //-----------------------------------------------------------------------------
    // Window_BattleEnemy
    //
    // The window for selecting a target enemy on the battle screen.
    
    function Window_BattleEnemy() {
        this.initialize.apply(this, arguments);
    And that's the window function you're looking for when targeting enemies: BattleEnemy.

    In SRD's file, you'll find this entry:
    Code:
    //-----------------------------------------------------------------------------
    // BattleManager
    //-----------------------------------------------------------------------------
    followed by lines like this one:

    Code:
    BattleManager.setEnemyListWindow = function(enemyList) {
        this._enemyList = enemyList;
    This is where he tries to connect his script to the enemy target window - using an incorrect or outdated term.

    So if we select "enemyList" and use ctrl + f to open the search function, we can search for that term. If you press on count (using Notepad++) you'll probably get about 20 entries. These are all incorrect, either directly or indirectly. While some are indirect links, at least the code shown directly above this defines where to aim at and is the one that'll definitely have to be adjusted.

    Solution:
    So switch to replace function and let ALL "enemyList" entries be replaced by "BattleEnemy" then use
    Code:
    !BattleManager._BattleEnemy.visible
    in the plugin menu to mark this as something to hide.
    The result: The Actor Window disappears when selecting the enemy.

    If you follow the steps up above you can further find & fix other entries that don't point at the correct target file in the rpg_windows.js.
     
    #3
    surunime likes this.
  4. surunime

    surunime Villager Member

    Messages:
    14
    Likes Received:
    1
    First Language:
    indonesia
    Primarily Uses:
    RMMV
    wow thanks a lot sir, I really appreciate it :biggrin::biggrin::biggrin: but i already mix this battle gui core with mog battle hud and edit the js. but thanks again it might help on my future project when I doesnt use mog HUD
     
    #4

Share This Page