JavaScript questions that don't deserve their own thread

● ARCHIVED · READ-ONLY
Started by Shaz 3413 posts Page 53 of 171 View original ↗
  1. @Anarcho-paladin

    I have not used these plugins before, so am I unsure if this will work.

    Have you tried in the enemy's notebox:
    Code:
    <AI Priority>
    STATE !== state 30: Enlacement, Random
    </AI Priority>
  2. boikish said:
    @AutoBlaze

    1.) Open the database and navigate to "Types"
    2.) Under skill types, add a new item, name it Chemistry
    3.) In the Class/Actors tab, add the Skill Type Chemistry to whoever you want access to.
    4.) When you create a skill, in the drop down for skill type, select Chemistry.

    Chemistry will now appear as a separate battle command option for all Actors who have access to it.

    Hi @boikish , Thanks for your specific reply. Now I figured it out from your instruction!!
  3. Thanks for your answer, @boikish . Unfortunately, that didn't work... I also tried inverting the conditions' order, but to no avail. I now realize I haven't provided a screenshot so here I go, just in case:

    index.php
  4. @Anarcho-paladin You are supposed to put that tag in the Enemy's notebox, not the skill. Did you do that?
  5. @boikish Hum, indeed, I had missed that one... I have copied-pasted the note's content to the enemy's, yet, unfortunately again, to no avail. I guess there's still something I've missed, so I hereby post another screenshot:

    index.php

    Everything that comes before <Select Conditions> is linked to another of Yanfly's plugins, the Animated Sideview Enemy plugin http://yanfly.moe/2015/12/13/yep-44-animated-sideview-enemies/, and is thus unrelated to the present issue.
  6. @Anarcho-paladin Why are you using <Select Conditions>? I don't see that anywhere on Yanfly's plugin page.

    The tags you have to use are <AI Priority>.
  7. Hi friends,

    I am using the YEP_Auto Passive States plugin. It is easy to assign an actor a passive status with an icon at beginning. But I came up with one question: How could the player know what the icon means? How can I give the icon a description and where the player should find that description?

    Thanks in advance!
  8. Thanks @boikish . Sorry, I've been sick for a couple of days now. I'll check this out when I'm feeling better.

    @AutoBlaze Maybe produce a help file to go with the game? I think there's even a way using Yanfly's plugins to set it up in the game itself.
  9. Hello.

    Do you guys know a way to count how many items the player has in the category "Hidden Items A" ?

    I'm searching a short script to do this:
    Variable1 = total number of Hidden A Items

    The only way I found so far is to count items independantly and add them progessively, wich is pretty long... lol.
  10. Is there a javascript value that determines whether a ui window gets placed 'beneath' or 'on top' of other ui windows?

    I've been trying out oliviafallenangel's OTB battle system plugin today, and the turn order graphic is sitting on top of everything else, obscuring other text. I'm trying to get it to sit underneath other windows when they're out.
  11. Anarcho-paladin said:
    Thanks @boikish . Sorry, I've been sick for a couple of days now. I'll check this out when I'm feeling better.

    @AutoBlaze Maybe produce a help file to go with the game? I think there's even a way using Yanfly's plugins to set it up in the game itself.
    Thank you @Anarcho-paladin , I haven't find to add discription for the passive status icon yet. But anyway, I hope you feel better soon!
  12. Question about action sequence pack 1.
    How to add state in a skill and active it immidiately during the skill.
    I use the note that "add state 20: target, (show)" but it seem to trigger after the skill, not during it
    And 1 more thing about the note " (show) " , i use the note: "HP -20: target, (show)" . Yes, the HP of enemy has decrease but it does not show up ( popup something like 20, i guess)
    When i use " add state 20: target ", i see no different with "add state 20: target, (show)".
    Thank you for reading this post
  13. Is there a way to check if a variable contains a space? (I.e., variable Var1 is set to "noSpaces". Check if it has any spaces, returns false. Variable Var2 is set to "Has Spaces". Check if it has any spaces, returns true.)
    Followup question to that, is there a way to set a variable to be everything after the space? I.e., Var2 would be "Has Spaces", while Var3 would just be "Spaces". And is there a way to check if a variable has more than one space? (I.e., Var2 set to "This Has Spaces" and the check would return true, Var3 set to "Has Spaces" and the check would return false)
  14. @GameFire
    1.) Is there a way to check if a variable contains a space?
    Check if the string includes a space.

    2.) Is there a way to set a variable to be everything after the space?
    Get the index of the first space and then slice the string to only contain what's after that space.

    3.) Is there a way to check if a variable has more than one space?
    You can just perform the same test as question #1 on the result from question #2, right?
  15. Hi @boikish .

    <Select Conditions> is used with Yanfly's Target Core plugin (http://yanfly.moe/2016/02/26/yep-74-target-core/), which I use to make it so that actors on rear rows cannot attack (because I'm also using Yanflyy's Row Formation plugin: http://yanfly.moe/2016/01/02/yep-54-row-formation/).

    I realize I might have mixed up the to plugin's functions... Here's what I then did: I placed the Target Core conditions in the skill's notebox, and the AI Core in the enemy's notebox, as on these screenshots:

    index.php
    index.php

    It still doesn't work, though. Might those two plugins be competing?
  16. @Aloe Guvner I've tried setting up the event, but it doesn't quite seem to be working.
    (I'm using a plugin, https://forums.rpgmakerweb.com/inde...pad-in-game-text-editor-for-the-player.91259/ , which is what the plugin commands are for.)
    Spoiler
    ◆Text:None, Window, Bottom
    : :\nt<\c[1]Shadowy Figure>Tell me, what's your name?
    ◆Label:Name
    ◆Plugin Command:InputDialog text Enter your name.
    ◆Plugin Command:InputDialog maxLength 33
    ◆Plugin Command:InputDialog variableID 101
    ◆Plugin Command:InputDialog open
    ◆Script:var str = $gameVariables.value(101);
    ◆If:Script:str.includes(' ');
    ◆Script:var string = $gameVariables.value(101);
    : :var index = string.indexOf(' ');
    : :var slice = string.slice(index);
    : :$gameVariables.value(102) = slice;
    ◆If:Script:slice.includes(' ');
    ◆Text:None, Window, Bottom
    : :\nt<\c[1]Shadowy Figure>Is \v[102] really your surname?
    ◆Show Choices:Yes, No (Window, Right, #1, #2)
    :When Yes
    ◆Text:None, Window, Bottom
    : :\nt<\c[1]Shadowy Figure>Alright, then.
    ◆Script:$gameActors.actor(10).setName($gameVariables.value(101))

    :When No
    ◆Text:None, Window, Bottom
    : :\nt<\c[1]Shadowy Figure>Then what is your surname?
    ◆Label:Surname
    ◆Plugin Command:InputDialog text Enter your surname.
    ◆Plugin Command:InputDialog maxLength 16
    ◆Plugin Command:InputDialog variableID 102
    ◆Plugin Command:InputDialog open
    ◆Text:None, Window, Bottom
    : :\nt<\c[1]Shadowy Figure>Is \v[102] your surname, then?
    ◆Show Choices:Yes, No (Window, Right, #1, #2)
    :When Yes
    ◆Text:None, Window, Bottom
    : :\nt<\c[1]Shadowy Figure>Alright, then.
    ◆Script:$gameActors.actor(10).setName($gameVariables.value(101))

    :When No
    ◆Jump to Label:Surname

    :End

    :End

    :End

    :End
    However, this is the result:
    Spoiler
    8lhnAyY.png
    I'm probably missing something, or maybe several somethings, but I can't quite figure it out.
  17. @GameFire

    I'm not sure that's the right link, because you linked to my plugin but those aren't my plugin commands :smile:

    First, make sure that the plugin is actually capturing the input into a variable. Make a simple event where you capture the input and then press F9 to open the debug menu and check that it displays as expected. Or open the console with F8 and type "$gameVariables.value(x)" to see the value of the variable with ID#x.

    Second, the problem likely has to do with var scoping, which you can read more about here. Given this example:
    Code:
    ◆Script:var str = $gameVariables.value(101);
    ◆If:Script:str.includes(' ');
    RPG Maker MV executes each of these commands in a different function. What this means is that the Condition Branch (the "if" statement) doesn't have access to the "str" variable because it was defined in a different scope. This actually causes a Javascript error, but MV hides that error from you. It should work if you do:
    Code:
    ◆If:Script:$gameVariables.value(101).includes(' ')
    Same thing for your "slice" variable later on.
    $gameVariables is scoped globally, which is why it can be accessed from anywhere.
  18. I have a weird question, and this will more than likely require a plugin to do, but I wanted to ask it here regardless to see if it's possible.

    Is it possible to put a note tag on an enemy, so that when that enemy is hit with a basic attack, the basic attack damage formula would be changed to the one in the note tag of the enemy?

    For example, let's say my player has a hunting skill tied to a variable that increases when he defeats nature type monsters. Whenever the player faces a nature type monster, I would want the basic attack damage formula to change so that it includes the hunting variable inside of it, increasing damage proportionate to your hunting level.

    It would also make sense if thiscould be tied to the actor as well, for example Actor 1 might have a hunting skill of 90 and deal more damage using a basic Attack to nature beasts then Actor 2 with a hunting skill of 22.

    Hopefully this makes sense and someone can inform me if this would require a full on plugin or something like this can be done with a couple lines of code.
  19. Ah, yeah. Somehow crtl+v retrieved the wrong link. Oi vey.
    This is the link I meant to paste in: https://forums.rpgmakerweb.com/index.php?threads/keyboard-input-dialog.66908/
    I know it is saving the value into the variable (that's what that window on the right shows, the bit where it says "101 PlayerName [Emily Su]".
    It's still doing it. I even checked using the console, and it still has "Emily Last Name" all set to variable 101.
    Code:
    $gameVariables.value(101)
    "Emily Last Name"
    $gameVariables.value(102)
    0
    EDIT: Here's what else the console says:
    Code:
    CONDITIONAL BRANCH SCRIPT ERROR    YEP_EventCopier.js:436 
    $gameVariables.value(102).includes(' ')        YEP_EventCopier.js:437 
    TypeError: $gameVariables.value(...).includes is not a function
        at eval (eval at Game_Interpreter.command111 (YEP_CoreEngine.js:1809), <anonymous>:1:27)
        at Game_Interpreter.command111 (YEP_CoreEngine.js:1809)
        at Game_Interpreter.command111 (YEP_SelfSwVar.js:388)
        at Game_Interpreter.executeCommand (rpg_objects.js:8930)
        at Game_Interpreter.update (rpg_objects.js:8838)
        at Game_Map.updateInterpreter (rpg_objects.js:6115)
        at Game_Map.update (rpg_objects.js:6022)
        at Game_Map.update (QABS.js:2559)
        at Game_Map.update (QPathfind.js:858)
        at Scene_Map.updateMain (rpg_scenes.js:608)
  20. @GameFire
    Perhaps you're using an old version of MV? string.includes() was added in the 2015 specification of Javascript, which is supported in the most recent version of MV.
    If that's the case, then you could use this instead which will accomplish the same thing:
    Code:
    $gameVariables.value(101).indexOf(' ') >= 0