JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 77 of 171 View original ↗
  1. Second question,

    I have a picture that I use as a screen effect/filter/overlay that's constantly visible during gameplay. When I enter battles, it goes away. I've tried to make it appear again on Turn 0, but it noticeably starts the battle without the picture displayed, then begins to display it 1 or 2 seconds later. Is there a way to make a picture overlay transition into battle screens smoothly?
  2. (For MV) I want to change the x anchor in rpg_sprites.js for state icons (seen in the code below), but I want to make the anchor value variable on whether the battler is an actor or an enemy. Is there a simple if,else condition that would check if the current this being affected is an actor or enemy?


    JavaScript:
    Sprite_StateIcon.prototype.initMembers = function() {
        this._battler = null;
        this._iconIndex = 0;
        this._animationCount = 0;
        this._animationIndex = 0;
    //Want to add an if,else that tests if sprite is actor or enemy (and defaults to 0.5 if neither to catch any errors)
        this.anchor.x = 0.5;
        this.anchor.y = 0.5;
    };

    Thanks!
  3. Hey everyone, I'm recovering a file that got a bug. I'm copy pasting all the original game's files to a new game. I haven't copy pasted any data over because I don't know how to tell which data is bugged, but I realized this means I can't view my maps in the new game's map window (bottom left) because they are .json files. I can still access the maps in the playtest, but can't edit them. I'm wondering if any one has tips about how to safely move data over when there might be a bug in the data. I've never really coded before so don't know how bugs work.

    Could I just copy paste the new project's current "MapInfos.json" file to my desktop as a backup, so that if pasting the original game's data doesn't solve the problem I can switch them out again? Or do I run the risk of giving the new game a bug by doing that?
  4. hello i require assistance with this JavaScript error. It only happens whenever i try to equip something.
  5. What should I do if a plugin creator only made their plugin available in raw text, and my computer doesn't have the ability to create js files (even by manual .js suffix adding)?
  6. Fix your computer.

    What operating system? Windows, Linux, MacOS?
  7. In MV, is there a condition I can write that's valid only if a skill from the user crits? It's going to be put in a state's Custom Establish Effect.

    Full disclosure
    I made it so that weapon attacks and some skills generate TP.
    I've got a passive state that forces a crit on the next action, its condition is that the user needs to have 100 TP.
    This state has the Custom Establish Effect in question, and is here to remove 100 TP if the state's wearer performs a critical hit.
    So I just need a condition that detects if the action that was just performed by the wearer was a crit.

    EDIT: if(target.result().critical) works.
  8. SpacemanFive said:
    What should I do if a plugin creator only made their plugin available in raw text, and my computer doesn't have the ability to create js files (even by manual .js suffix adding)?
    Are file extensions showing in your file explorer?
    If not, a txt file would appear as "script", and putting the js extension at the end would change its real file name to "script.js.txt".
    If file extensions are showing, replace ".txt" at the very end with ".js" and the file type will actually change this time.
  9. CHKNRAVE said:
    Are file extensions showing in your file explorer?
    If not, a txt file would appear as "script", and putting the js extension at the end would change its real file name to "script.js.txt".
    If file extensions are showing, replace ".txt" at the very end with ".js" and the file type will actually change this time.
    Thank you! Apparently I'd missed the option to *enable* displaying file extensions, so when I tried to manually change the file extension previously the system didn't recognize it.
  10. Is there a script call I can use in conjunction with this one to get the database ID of an enemy (as opposed to the enemy's troop ID), and store it in a variable?

    BattleManager._action._subjectEnemyIndex
  11. According to this topic, using b.enemyId() will return the database ID of the enemy.


    My turn to ask a question: how do I see / change how the Luck stat influences state application?
    I want the chance of applying to be 50% if the luck of the user and the target are even, and inch towards 100% and 0% (never fully reaching them) if one is higher than the other.
    Also, I have no idea what the formula would be for that. I was thinking about (a.luk/b.luk)/100+(a.luk/b.luk), but it doesn't cover states I want to always apply and using b.addState would display 0 damage on state-only skills.
  12. Howdy, developers!

    How do I:
    - Completely nullify TP natural Gain?
    - Hide TP Bars outside of battles?

    I want TP Bars only to be shown in battle, and each character will have it's own methods of gaining TP.
  13. Hi y'all.

    While using the Buffs and States Core, is there a way to point at the user of the skill in a Custom Apply Effect?
    I want the user to apply a state on the target, who will then give the user another state in return.

    I could've used the formula bar and just done a.addState(X), but the state is given by a skill that does no damage / recovery so I'd end up with a 0 damage pop-up which isn't desirable.
  14. Iirc, you get the user of the skill by using "user". "a" should also work.
  15. And that's the issue, it works for action effects (from Initiate to Conclude and Select to Deselect) but not for timing effects like Apply.
  16. hmm... it should still work.
    there are only two places in that plugin that have the customEvalEffect method to process them.
    Once in Game_Action (for initiate, select, deselect, conclude, react, confirm, respond, establish)
    and once in Game_Battler (for add [includes apply], remove, leave, turn start, turn end, regenerate, action start, action end).
    In both methods "user" and "target" are assigned their values.

    can you post your notetag?

    /Edit:
    alright, I did a quick test.
    I added the "Fascination" state to a skill and tried to give the actor who uses that skill the "Immortal" state when he applies "Fascination" to an enemy.
    "user" gives "Immortal" to the target who gets "Fascination", so you have to use "origin" instead.

    pmlKTFa.png
  17. Hell yeah, origin. works as planned. Thank you!
  18. merboy22 said:
    Hey everyone, I'm recovering a file that got a bug. I'm copy pasting all the original game's files to a new game. I haven't copy pasted any data over because I don't know how to tell which data is bugged, but I realized this means I can't view my maps in the new game's map window (bottom left) because they are .json files. I can still access the maps in the playtest, but can't edit them. I'm wondering if any one has tips about how to safely move data over when there might be a bug in the data. I've never really coded before so don't know how bugs work.

    Could I just copy paste the new project's current "MapInfos.json" file to my desktop as a backup, so that if pasting the original game's data doesn't solve the problem I can switch them out again? Or do I run the risk of giving the new game a bug by doing that?

    Make a new game, and create as much as new empty maps as your old game.
    Then copy amd past all the maps from the old game to the newly created game?

    SpacemanFive said:
    What should I do if a plugin creator only made their plugin available in raw text, and my computer doesn't have the ability to create js files (even by manual .js suffix adding)?

    Past the raw codes into a new notepad file. Then save as
    "Plugin.js", make sure you use the " " when you safe the file.
  19. PauloHPBender said:
    Howdy, developers!

    How do I:
    - Completely nullify TP natural Gain?
    - Hide TP Bars outside of battles?

    I want TP Bars only to be shown in battle, and each character will have it's own methods of gaining TP.

    Are you still looking for a solution? If so, let me know and I'll help you out.
  20. Lanzy said:
    Are you still looking for a solution? If so, let me know and I'll help you out.
    I'd be interested in seeing the solution to that question as well ^^ :D