JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 91 of 171 View original ↗
  1. Nerine said:
    I have a plugin that executes some stuff on transfer, but I don't want it to happen when the transfer occurs across the same map.
    You should post a separate thread in plugin support asking the question with a link to the plugin. The JavaScript to check this is simple, but incorporating it into an existing plugin is more complex because you'll have to either edit the plugin or make a plugin for the plugin.

    Or, you can do what I showed you to store the map ID into a variable before the transfer event and put the stuff you execute via plugin into a conditional with that.

    Or you can make a plugin to modify the transfer code to set a variable or switch any time the transfer is within the same map.

    Really, there are many ways to implement it, but all of them are sufficiently complex for their own thread.
  2. Has there been someone who has tried to / managed to intergate plugin development with a unit testing framework?

    I got something simple running with the Jasmine standalone but was wondering if there exists some open source project that maybe even got it running on some continous integration runner with npm+jasmine.
  3. May I ask some basics about how could I make states and variables interact? I'm really new to RPG maker and I'm not sure how to do it.
    So, I want to make a state called "Distance", and a variable called "Actor1_Distance". The variable "Actor1_Distance" is an integer between 0-100.

    So how I want it to be:
    Actors with the state "Distance" will have increased defense parameters depending on "Actor1_Distance". "0 distance" grants 0% defense param increase, "50 distance" grants 50% defense param increase, and "100 distance" grants 100% defense param increase.
    So how should I do that?
  4. How could I get, via script, a class name from it's database ID? I'm making an event that checks for all party members classes', from last to first, and if any of them doesn't have it's class ID equal as stored in variable 2, he changes to class "variable 2 value". I'd like it to show a text for each changed member to show his class before and the class he was changed into.

    edit: I solved by following a tip from this message/text tutorial and using Yanfly's Message Core plugin's \nc code.

    Code:
    var members = $gameParty.members();
    for (var i = members.length - 1; i >= 0; i--) {
     var ID = members[i]._actorId;
     var actor = $gameActors.actor(ID);
       if (actor.currentClass().id != $gameVariables.value(2)) {
         $gameMessage.add(actor.name() + " changed from " + actor.currentClass().name + " to \\nc[" + $gameVariables.value(2) + "].");
    
         AudioManager.playSe({name: 'Absorb1', pan: 0, pitch: 110, volume: 90});
         actor.changeClass($gameVariables.value(2), false);
         break;
     }
    }
  5. Wasn't sure if this needed its own post or not, but...
    Wondering if anyone knows how to get rid of the 'button' effect any and all choice windows, menus, or name inputs have.
    Its like a shadowed box under the text/option. I've edited my windowskin but it didn't change. For example the name input, each letter has a box around it.
    I think it has something to do with the dimmer bitmap, but I am unsure how to disable it.
  6. [Moving question to its own seperate thread, sorry.]
  7. I'm assuming that I'm using this thread right.
    [MV] Using YEP, how do you make a skill that increases its damage based on the MP used for it? My skills have variable costs and will have effects that alter MP consumption, so this is something that is nice to have.
  8. MarxMayhem said:
    I'm assuming that I'm using this thread right.
    [MV] Using YEP, how do you make a skill that increases its damage based on the MP used for it? My skills have variable costs and will have effects that alter MP consumption, so this is something that is nice to have.

    I'm guessing it would be something like this, but somehow storing the mp cost into a variable (that I don't know how to do, but I'm sure there's a Tip or Trick somewhere that does something similar).

    edit: oh sorry, I thought you meant a state that did that, not a skill. Have you checked skill damage formulas to see if any covers MP cost?
  9. mellanny said:
    edit: oh sorry, I thought you meant a state that did that, not a skill. Have you checked skill damage formulas to see if any covers MP cost?
    Just did. It's doing as I intended. I was hoping for something that involves coding because I'd like to have custom formulas that would take effect if the user has certain buffs/debuffs.

    I can make this work, but if people have alternatives for me, I'm still all ears.
  10. How would I transform below into a script call in event?

    Code:
    this.createEventIndicators();
    
    Spriteset_Map.prototype.createEventIndicators = function() {
    
        this._indicatorsField = new Sprite();
    
        this._baseSprite.addChild(this._indicatorsField);
    
        this._eventIndicators = [];
    
        for (var i = 0; i < this._characterSprites.length; i++) {
    
             this._eventIndicators[i] = new EventIndicators(this._characterSprites[i]);
    
             this._indicatorsField.addChild(this._eventIndicators[i]);
    
        };
    
    };
  11. What does Can't load source map mean

    Here
    1625785984197.png
  12. It means exactly what it says, that it's unable to load a map file the game is telling it to load...but that's not a JavaScript question for this thread.
  13. Hi, I wanna ask, does Makerdev not update their download link for older plugins?
    Older plugin download URL is https://mvplugins.com//uploads/1060/Prefab/18-01-13-06-20-23-47377.zip where newer download URL is something like https://www.makerdevs.com/download/idQQvdZk8WM7TQWgQ.

    Is there anyway to get around this? Or should I contact the plugin creator?
  14. That is not a JavaScript question for this thread...also, no one here runs Makerdev, as far as I know, so they wouldn't have the answer to your question. Have you tried e-mailing support on that Web site?
  15. ATT_Turan said:
    That is not a JavaScript question for this thread...also, no one here runs Makerdev, as far as I know, so they wouldn't have the answer to your question. Have you tried e-mailing support on that Web site?
    Well, it's a plugin related question that doesn't deserve it's own thread. So I assume it belong here. The site lacks a report problem or email support for that matter, I look around the site and didn't found any. Can't even log in too (or reset password).

    So I'm asking this in here as a last resort.
  16. Warilized said:
    Well, it's a plugin related question that doesn't deserve it's own thread. So I assume it belong here.
    You're asking a question about technical services on another Web site entirely, not about a plugin or anything related to writing JavaScript. So insofar as it's possible for anyone here to be able to answer your question, it definitely deserves its own thread :stickytongue:
  17. @ATT_Turan ah sorry then, I thought it was the right place lol, I'm a little bit desperate but if I'll just search the net for the plugin I want. Thanks for responding man.
  18. Hey guys, I'm trying to change an event image using variables in a script, but I can't make it work.
    This is what I tried so far :
    $gameMap.event($gameVariables.value(488)).setImage($gameVariables.value(917)), 0);
    $gameMap.event($gameVariables.value(488)).setImage('$gameVariables.value(917)'), 0);

    The first variable has the event ID, and the second variable has the image name as a string, for exemple : !$game_random_200

    I can make it work but with only one variable like this : $gameMap.event($gameVariables.value(488)).setImage('!$game_random_200', 0);

    Any help on this?
  19. Narch said:
    Hey guys, I'm trying to change an event image using variables in a script, but I can't make it work.
    This is what I tried so far :
    $gameMap.event($gameVariables.value(488)).setImage($gameVariables.value(917)), 0);
    $gameMap.event($gameVariables.value(488)).setImage('$gameVariables.value(917)'), 0);

    The first variable has the event ID, and the second variable has the image name as a string, for exemple : !$game_random_200

    I can make it work but with only one variable like this : $gameMap.event($gameVariables.value(488)).setImage('!$game_random_200', 0);

    Any help on this?

    First of all you can simplify it like this. It could also be that the second variable isn't defined as a string, try converting it to one.

    Also, when you set the second variable value you could use Control Variable → Script: "!$game_random_200"or use $gameVariables.setValue(917, "!$game_random_200"), don't forget to use quotation mark (").

    Code:
    var src = $gameVariables.value(488),
    imageId = $gameVariables.value(917).toString(); //if you set the variable using the way i mentioned above, it isn't really necessary to use .toString().
    $gameMap.event(src).setImage(imageId, 0);

    There's a few error in your code like there's too many ")".
  20. @Warilized Thanks for the help. Fixing the parentheses worked, and you gave me more tools to fiddle with in the future.