JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 32 of 171 View original ↗
  1. I looked inside Yanfly's Visual State FX to see if I could adjust where icons can be displayed (with the Medieval Pack sprites they are far away from the character that I had to move the CTB to the left just because it'd interfere) and I haven't found the code to move the x and y coordinates for the icons. Anybody know how I could move them if those two things aren't an option?
  2. Hi~ Just posting here because I have no idea if this warranted its own thread.


    I'm just wondering if there's a way to control the camera for the side-view battle in the events. I've been looking through plugins and stuff, but all of them only occurs when an attack is being executed. I just need some camera effects to occur between turns, zooming into the actors as they speak to each other, and then zooming out when they are done; and later it zooms into the enemy when they speak, and zooms out when they are done. I've seen it being done, but I have no idea how to do it... Help. T_T
  3. Hi everyone, I want to remake my guild system on MV by using Custom Page Conditions, but for that I need to know which script call check if "battle members" include an specific actor?. Battle members is different from party check. The RGSS3 equivalent of this call is:

    Code:
    unless $game_party.battle_members.include?($game_actors[X])

    Thanks in advance
  4. @Oriceles, test this:

    Code:
    $gameParty.battleMembers().contains($gameActors.actor(n));
  5. Hi guys! I want to use GALV's event spawn timer with Yanfly's more Self switches.


    So far, I have this code in a parallel event:


    this.doTimer(this.setSelfSwitchValue(32, 7, 138, true));


    //upon the expiration of the time using galv's doTimer in map 32, self switch 138 should turn true in event 7 using yanfly's more self switches.


    The problem is, this.setSelfSwitch executes despite the fact that I have not yet started the timer. It bypasses the condition that a timer has to be first started and must expire to run. Both are running in a parallel process independently of each other. The question is, how do I script the code to execute successively rather than independently?


    EDIT: I have figured it out, sorry for the trouble.


    if //using the script in the conditional flow control tab


    this.respawnTime(32,7) == 0 && this.getSelfSwitchValue(32, 7, 126) == true;


    //script call


    this.setSelfSwitchValue(32, 7, 138, true)


    Though, I'm still interested to see if there is a more efficient way of doing the above codes.
  6. I'm trying to remove the MP bar from the battle screens, since my characters don't use magic.  Here is a screenshot of the problem.
  7. @TheGamedawg


    Make a new .js file


    Window_Base.prototype.drawActorMp = function(actor, x, y, width) {
    };


    put this in there and import is as a plugin. But it will remove the MP gauges from everywhere.
  8. Hi all! I'm modifying the Substitute function and ran into an issue.


    Basically: Substitute no triggers on all things, even State changes.


    What I want: Only trigger if attacked by enemy (phys or magic or certain hit)


    What I have so far:


    In rpg_manager.js   (Normally)


    BattleManager.checkSubstitute = function(target) {
        return target.isDying() && !this._action.isCertainHit();


    changed to:


    BattleManager.checkSubstitute = function(target) {
        return true;


    So this makes it so that anything that happens gets blocked. Even State changes. All I'm really looking for is what js I use to modify this.


    Something like:  return target. (is being attacked by enemy)


    Except I don't know what (is being attacked by enemy) is in js.
  9. @Ravnicor This should solve the problem.

    Code:
    BattleManager.invokeNormalAction = function(subject, target) {
        var realTarget = subject.isActor() ? target : this.applySubstitute(target);  //Substitute only if subject is an enemy
        this._action.apply(realTarget);
        this._logWindow.displayActionResults(subject, realTarget);
    };
  10. waynee95 said:
    @Ravnicor This should solve the problem.



    BattleManager.invokeNormalAction = function(subject, target) {
    var realTarget = subject.isActor() ? target : this.applySubstitute(target); //Substitute only if subject is an enemy
    this._action.apply(realTarget);
    this._logWindow.displayActionResults(subject, realTarget);
    };

    Thank you, so so much. I spent hours yesterday trying to parse out js on my own (I was trying to use the counterattack js and using trial and error to get about what I wanted to no avail)
  11. If you release a packaged game and need to patch it later, will the patched files be read before the encrypted ones, or do you have to have the player re-download the entire game?
  12. Hi, I am working with the Yanfly Skill Learn plugin and am trying to figure out how to format basic notetags to check for multiple conditions.  


    How do I set up this note tag so that the learn-able skill only appears when the user is affected by state 40 while also having already learned skill 20?


    <Learn Require Skill: 20>


    <Learn Show Eval>


    if (user.isStateAffected(40)) {


    value = true;


    } else {


    value = false;


    }


    </Learn Show Eval>


    Thanks for any assistance you can provide!
  13. Hey guys!


    I need help with this bit of code in Yanfly's damage core.


    Line 6: if (baseDamage < 0) {Line 7: value /= this.calcElementRate(target);Line 8: value *= Math.max(0, 2.0 - this.calcElementRate(target));Line 9: }


    Yanfly wrote this for me last year and it worked great until recently due to updates.


    What it used to do is heal the affected target more the more he resists the element of the healing special. For example, if a spell heals for exactly 100 and an actor has 50% resistance to light, he gets healed for 150 instead, but if he is weak to light then he will heal less.


    At the moment it does the opposite. I tried asking yanfly but they said I should ask around here instead.


    While I'm at it, I was wondering if anyone could show me how to make a state that per-emptively blocks specific states from being applied to the user.


    Thanks in advance :)
  14. Can someone explain to me how to do a loop?


    I mean, I have this skill that changes the numbers of hits based on the weapon,


    if (user.hasWeapon($dataWeapons[5]) || user.hasWeapon($dataWeapons[6]))


    with the above code and it works, however, if a want to add more weapons, then the code will slowly grow too much, I believe a loop can help me with that but I don't know how to implement the code, I have already look it up, but I wasn't able to understand, can someone explain to me how should I word it?
  15. What's missing from this plugin to make it work? It's not the actual function, because I tested it by temporarily patching rpg_objects.js.


    //=============================================================================
    // Magiland Adventures Story Max Level Limit
    // by Sundricat
    // Date: 11/17/2016

    //=============================================================================


    /*:
    * @plugindesc A specialized plugin for Magiland Adventures that increases the Max Level as the story goes on.
    * @author Sundricat
    *
    */

    var MA = MA || {};
    MA.Max_Level = MA.Max_Level || {};
    .
    (function($) {

    Game_Actor.prototype.maxLevel = function() {
    if (DataManager.isEventTest() === true || DataManager.isBattleTest() === true || $gameSwitches.value(21) === true) {
    return 200; }
    //Location 1: Zacorah
    else if ($gameSwitches.value(203) === false) { return 13; }
    //Location 2: Snowflake's School
    else if ($gameSwitches.value(205) === false) { return 25; }
    //Location 3: Thundra
    else if ($gameSwitches.value(211) === false) { return 35; }
    //Location 4: Windaria
    else if ($gameSwitches.value(202) === false) { return 45; }
    //Location 5: Arctica
    else if ($gameSwitches.value(204) === false) { return 55; }
    //Location 6: Volcanicara
    else if ($gameSwitches.value(208) === false) { return 65; }
    //Location 7: Junglara
    else if ($gameSwitches.value(207) === false) { return 75; }
    //Location 8: Mountanra
    else if ($gameSwitches.value(206) === false) { return 85; }
    //Location 9: Suncat Desert
    else if ($gameSwitches.value(219) === false) { return 95; }
    //Location 10: Mooncat Plains
    //Location 11: Enemy Base
    else if ($gameSwitches.value(23) === false) { return 110; }
    //Post Game Max Level
    else { return 200; }
    };
    })();


    If you're wondering about the levels above 99, they're already backed by Hime's Parameter Tables.
  16. I'm looking for a plugin that allows an Event to chase another Event (and would obviously love it if it were compatible with ct_bolt's event touch events plugin or similar) but have failed to find anything - does such a thing exist?


    @Prescott THANK YOU! (and thank you @Shaz for the plugin that makes it possible. Best,EZ
  17. @EthanZ 

    The event will continue to follow its target until told to stop. So if the target is another event or the player, if the target moves, the event will adjust its course or follow, depending on how close it is to the target. 





     
  18. Does anyone know where in the JS skills are evaluated? Specifically skills that neither heal, cause a state or deal damage. In this case I want my notetag only to refer to the plugin so I can use an effect as dictated by my functions but I keep getting lost while parsing through the JS and can't find a definite place... maybe I'm thinking too hard. Simple advice on how I should go about it would also be very much appreciated. Thank you in advance.
  19. @EthanZ have a look through that thread, as one or two people wrote either modified versions or addons to make that plugin more flexible.  You might find some of those useful too.


    @Sekunri look in the rpg_objects.js file.  I would say Game_Action.prototype.apply might be a good place to start.  I think that covers items as well as skills but if your notes only apply to skills you might be able to ignore that (if the note is optional).
  20. Luckily the same notes are used for both Items and Skills. Thank you Shaz I'll take a look.


    UPDATE:


    So I've been trying to follow the path of my skills through Game_Action.prototype.apply by sending alerts (which maybe i should use console log instead) but it came up with an interesting result.


    Whenever damage, states or healing would be dealt it runs however the alerts i have at the beginning of the function are never triggered if a skill has a scope of (none).


    NEW QUESTION:


    I didn't want to edit this but while working on my plugin I noticed something I had previously ignored and wanted to ask about it.


    When you set your Classes "Skills to Learn" you can choose the skill and set a note but the Classes themselves have their own Note box. So I was curious what do those notes belong to? Skills or Classes?



    I've tested this with my skill notetags and have confirmed its not attached to skills.


    I've run no test on $dataClass as of yet since my plugin doesn't use it.