JavaScript questions that don't deserve their own thread

Discussion in 'Javascript/Plugin Support' started by Shaz, Oct 23, 2015.

  1. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    103
    Likes Received:
    83
    First Language:
    German
    Primarily Uses:
    RMMV
    @Aloe Guvner Thank you for the detailed answer.
    I propably already accessed a lot of underscore variables without knowing that I shouldn't and declared a lot of underscore variables without knowing the underscores purpose, but now thanks to you I know it which is good for future coding.
     
  2. 00Cedric

    00Cedric Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    upload_2019-5-18_11-26-29.png
    I have trouble at getting length of dataSkills
    pls help
     
  3. BurningOrca

    BurningOrca Veteran Veteran

    Messages:
    103
    Likes Received:
    83
    First Language:
    German
    Primarily Uses:
    RMMV
    @00Cedric This is because your function is called immediately which means it is called before the database is loaded, when $dataSkills is still null.
    Try something like this:
    Code:
    _DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
    DataManager.isDatabaseLoaded = function () {
        if( !_DataManager_isDatabaseLoaded.call(this) ) return false;
        // Add your for loop here in between. $dataSkills won't be null anymore.
        return true;
    }
     
    Last edited: May 19, 2019
  4. PH2

    PH2 Villager Member

    Messages:
    6
    Likes Received:
    1
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Hey guys, I'm making a One Actor game, and I am already using Ventiqus plugin to bypass actor select when selecting Skill or Equip on the Main Menu.

    But when choosing an Item or Skill, an Window_MenuActor still pops up, and I want to bypass this, and always choose the first actor.

    Making an item or skill target to "All Allies" work for battles, but not for the menu.

    I think one or two lines can solve this, somewhone can help me?
     
  5. Virage_Detoldev

    Virage_Detoldev Villager Member

    Messages:
    14
    Likes Received:
    5
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Guys, how can I hide the cursor from just a window on the menu?
    I'm trying to make a FF9 menu to practice, but I try to hide the cursor from Window_MenuCommand and I try to use:
    this._cursorAll.hide();
    this._cursorAll.opacity = 0;
    this._commandWindow.cursor.hide();

    But I out of ideas now. Can someone help me?
     
  6. Virage_Detoldev

    Virage_Detoldev Villager Member

    Messages:
    14
    Likes Received:
    5
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    I think if you remove the if that need the confirmation from what character use the item, will work.

    Original:
    Window_MenuActor.prototype.processOk = function() {
    if (!this.cursorAll()) {
    $gameParty.setTargetActor($gameParty.members()[this.index()]);
    }
    this.callOkHandler();
    };

    New one:
    Window_MenuActor.prototype.processOk = function() {
    this.callOkHandler();
    };

    That is only a idea, I still learning javascript.
     
  7. KorvasTerindar

    KorvasTerindar Villager Member

    Messages:
    19
    Likes Received:
    1
    First Language:
    English
    Hey, complete novice here when it comes to using plugins in MV. How exactly do you use these things? Like, how do you set them up or call them?
     
  8. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,056
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    @KorvasTerindar Completely depends on each plugin. You have to follow the directions given in each plugin to understand how to use it. If you have a specific issue, please describe it specifically.

    If you need some help installing a plugin, this will teach you:
     
  9. Kiba

    Kiba Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    German
    Primarily Uses:
    RMMV
    Hey People!
    I am sreaching for a script command, which should be Battle-Only.
    I am making a fight like the Iron Council from WoW-Ulduar Raid.
    It works like this:
    You have 3 enemies. Once you kill one enemy the other 2 switch to a diffrent enemie. And once you killed one more, the last one switches again.
    I can do the switch stuff for the first phase with commands only, Enemy Change etc. but I can't get the last step to work, as the Maker only lets me change me the "Original" enemy. Once I changed for example Orc1, to Orc2, I can't change Orc2 to Orc3, only Orc1 to Orc3. I know it is possible to change an enemy name during combat, so the Number should be possible too, right?
    Looking forward to answers :)
     
  10. Popelus

    Popelus Villager Member

    Messages:
    14
    Likes Received:
    2
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Hey! I am using YEP_AutoPassiveStates and I'm wondering if there's a simple way to make "Being in battle" a condition for the passive states to occur.

    The thing is, I have a passive that gets activated whenever your HP is below 30%, but I only want it to be active in battle. I don't want the state's icon to show up in the main menu or in the map.

    I'm guessing I just need to add some javascript code that checks whether a battle is going on or not, and add it like this...
    <Custom Passive Condition>
    if IN BATTLE {
    condition = true;
    } else {
    condition = false;
    }
    </Custom Passive Condition>

    Can someone help me? Thank you very much!
     
  11. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,056
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Popelus likes this.
  12. Mr-Toyblock

    Mr-Toyblock Villager Member

    Messages:
    8
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey everyone.
    I'm having a huge issue with yanfly engine core.
    I'm trying to use events that have the conditional branch of: "If [Switch] is on, this will happen." With an else command.

    But for some reason, with the engine core, it assumes all switches are turned on, and even if the switch is off, the event will still occur as if it was on.
    When tested with a new project, the game simply locks up when trying to use an else command with the conditional branch switch.

    Example:

    "Test" is the switch btw.

    When booting up MY game, the event will always say "Hello", even if I have another event that is programmed to turn the event off.

    When booting up a NEW project, the game will simply lock up when talking to the event.
     
  13. DGC

    DGC Villager Member

    Messages:
    6
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    [MV] I have an odd problem with Yanfly's action sequence. Not sure if this is the right place to ask, please let me know what to do if not. (I'm not familiar with protocol. )
    I have 4 enemies using the same skill, and part of the skill depends on a state that is added to the actor it targets. At the end of the skill, the state is removed. The first 2 enemies use the skill fine, and everything works perfectly. Then the third enemy tries to use the skill, and the state never gets applied, so it breaks for that enemy, but then it starts working again for the 4th enemy. Is there some overlap happening that doesn't allow the skill to finish before starting the 3rd enemy's turn? I have a feeling I need to somehow stop processing long enough for the skill to run its course, but none of the "wait for" or wait: commands seem to work.
     
  14. peq42_

    peq42_ Yeet Veteran

    Messages:
    465
    Likes Received:
    278
    Location:
    Brazil
    First Language:
    Portuguese(BR)
    Primarily Uses:
    RMMV
    Do the Gamepad Config plugin that comes with MV still work ? I'm trying to use it in my project(MV 1.6.2) and every time I try to change one of the inputs, the game simply doesn't respond anymore.

    I don't know if its because I'm using a PS2 controller instead of a gamepad or if the plugin itself isn't working anymore. No errors are shown in the console.
     
  15. standardplayer

    standardplayer Keeper of Kitties Veteran

    Messages:
    424
    Likes Received:
    1,733
    First Language:
    English
    Primarily Uses:
    N/A
    I remember reading somewhere a while ago that you weren't supposed to store data other than numbers and (maybe) strings in the Game Variables.
    I can't remember the reasoning. I sometimes store arrays or objects in Game Variables because it makes some things easier to pull off with mostly just events, although usually it's all just short-term testing. I've never run into a problem, but that doesn't really mean anything.
     
  16. MushroomCake28

    MushroomCake28 KAMO Studio Veteran

    Messages:
    1,833
    Likes Received:
    3,268
    Location:
    Montreal, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    @standardplayer I don't see why storing arrays inside arrays is so bad. However, personally, I just don't like putting everything inside the same basket. That's why I create another "basket" which is an array inside the $gameParty object to store stuff. I have an array to keep quest data inside, another for hero abilities, etc. I could of have just stored everything in $gameVariables, but I'm too orderly to do that (like it's a brain itch lol).
     
  17. Burgerland

    Burgerland Veteran Veteran

    Messages:
    263
    Likes Received:
    58
    First Language:
    English
    Primarily Uses:
    N/A
    Is there a script call for changing the frequency of every event in the game? I know there's a script call for turning off every self-switch in the game, so I figured there could be one for event frequency too. In case you need the switch script call, it's

     
  18. Winek

    Winek Villager Member

    Messages:
    26
    Likes Received:
    3
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey! Here's a question.

    How could I have access to an actor's/class' learnable skills? I'd like, if possible, an array of their ID.

    It's for a perk system that can grant random skills based on the class, completely independent of levels themselves, and I'm sure there's a better alternative than doing a common event to check for each classes. I have MANY classes, so it's kind of crucial, at this point.
     
  19. Narch

    Narch Veteran Veteran

    Messages:
    62
    Likes Received:
    9
    First Language:
    French
    Hi.

    Anybody knows if there's a script for the Event Command "Change Skill"?

    I'm looking to give random skills to an actor via variables.
     
  20. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,056
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    Looking inside rpg_objects.js and do ctrl-f for "change skill" finds this:
    Code:
    Game_Interpreter.prototype.command318 = function() {
    You can look at the rest of the code under there, the important one is "actor.learnSkill" and "actor.forgetSkill". So to make Harold learn the skill in variable #42:
    Code:
    $gameActors.actor(1).learnSkill($gameVariables.value(42))
     
    Narch likes this.

Share This Page