[Solved] Yanfly Button Common Events - Question!

Discussion in 'Javascript/Plugin Support' started by Let's Make, Nov 10, 2019.

  1. Let's Make

    Let's Make Villager Member

    Messages:
    13
    Likes Received:
    5
    First Language:
    Italian
    Hi everyone, I've got a problem with Yanfly Button Common Events.

    I'd like to change Z key with E key. In this way I can talk to NPCs and activate events pressing E. Currently I'm using Common Event 001.

    So I bound E key with 1 in plugin parameters. After I went in Common Events section, selected Common Event 001 and filled out a new plugin writing SwitchButton Ok (is it correct?)

    Now, I don't really know what to do. Have I call the common event in map? or have I add any Switch?



    SOLUTION: In the end I decided to try editing that plugin. It's gone better than I thought :)
     
    Last edited: Nov 11, 2019
    #1
  2. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    916
    Likes Received:
    282
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    you dont need to atached a switch to it, just the name and teh common Event ID to the param,
    you just playtest the game and press E so it execute common event 1.

    you can make a sample of pressing E to 1, and place a text in common event 1 "common event 1 is executed" during playtest.
    it will show you that text.
     
    #2
    Let's Make likes this.
  3. Let's Make

    Let's Make Villager Member

    Messages:
    13
    Likes Received:
    5
    First Language:
    Italian
    Hey, thank you for the answer. I've just done a playtest like you said.
    The message box appears, but I can't talk to npc though. Why?
    I attached a picture.

    [​IMG]
     
    #3
  4. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    916
    Likes Received:
    282
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    because Z and Space and Enter was talking to NPC.
    from what plugin command is "SwitchButton OK"?

    if you want events to be opend and talk to NPC, you need to see what command it trigger to
    to talking/accept for it and use that scriptcall (I can check later unless someone does that before me)
     
    #4
    Let's Make likes this.
  5. Let's Make

    Let's Make Villager Member

    Messages:
    13
    Likes Received:
    5
    First Language:
    Italian
    I did two playtest for the sake of clarity.

    • I assigned I key and used a scriptcall "SceneManager.push(Scene_Item);" to call the Inventory. Apparently the scripcalls don't ever fail.

    • Then, I went back to E key and in CommonEvent page I assigned it a different plugin command: "TriggerButton Ok". Now, I can start the message box when I talk to npc, but I can't scroll the text (It seems that I need Z/Enter/Space yet).

    While I found these ones in the plugin description.
    Plugin Commands

    RevertButton Ok
    RevertButton Cancel
    RevertButton Dash
    RevertButton PageUp
    RevertButton PageDown
    RevertButton Left
    RevertButton Up
    RevertButton Right
    RevertButton Down
    RevertButton All

    - Reverts all keys bound to any of the original functions back to their
    original buttons and unbinds the common events bound to them. If the "All"
    function is reverted, then all affected buttons will revert back to their
    original functions.


    SwitchButton Ok
    SwitchButton Cancel
    SwitchButton Dash
    SwitchButton PageUp
    SwitchButton PageDown
    SwitchButton Left
    SwitchButton Up
    SwitchButton Right
    SwitchButton Down
    SwitchButton All

    - Switches all keys with original functions to use the common event binds
    instead of their original versions. If the "All" function is switched,
    then all affected buttons will switch to common event bindings if there
    are any.


    TriggerButton Ok
    TriggerButton Cancel
    TriggerButton Dash
    TriggerButton PageUp
    TriggerButton PageDown
    TriggerButton Left
    TriggerButton Up
    TriggerButton Right
    TriggerButton Down

    - This will cause the game to simulate triggering the button command of
    one of those original functions even if there is a common event bound to
    all of the keys of that original function.

    That "Ok" refers to Z/Enter/Space. But I don't know how to resolve it ;_;
     
    #5
  6. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    916
    Likes Received:
    282
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    SwitchButton OK is to RevertButton OK if used, TriggerButton OK something else if you use them,
    while Z, OK, Enter or Space has the talking to NPC, But the scriptcall for this one is differently,

    Btw, Esc (hardcode for Menu) is always active, same thing with Enter or Space (which I cant tell at the moment.
    But I look what button is attached to the Z for you to use. (later this day)
     
    #6
  7. Let's Make

    Let's Make Villager Member

    Messages:
    13
    Likes Received:
    5
    First Language:
    Italian
    Thank you so much. Meanwhile I'll try to find a soultion. See you later!
     
    #7
  8. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    916
    Likes Received:
    282
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    I just realized than the OK button is used, it trigger the event,
    so you can make a events like NPC have this part on top with:
    conditional branch: script: Input.isTriggered("OK")
    NPC Text: Hi, what can I do for you?
    and the bunch of events here for the NPC)
    end

    that's probably a bit of a downside if you need this part on every npc event (or to push)
    or to trigger something.

    but the text NEED to be inside the conditional branch thoug
    and not outside the conditional branch or it does nothing.

    but if someone know a work around for the button press, they can tell you.
    but this is than partly a solution though :)
     
    #8
    Let's Make likes this.
  9. Let's Make

    Let's Make Villager Member

    Messages:
    13
    Likes Received:
    5
    First Language:
    Italian
    To be honest I want to replace "Ok" command with E for all actions. Theoretically it should work like I already did.
    I watched the same video-tutorial more times and even read different guide. Yanfly says this:
    You may also notice that some of the keys have in parenthesis a word like (OK) or (Cancel) next to them. What this means is that those keys already have a function assigned to them by the game. If you assign a common event to these keys, the native function of the key will be removed in favor of the common event you’ve assigned.
    So, I think my setting are right, and moreover I've not any incompatible plugin. Another Yanfly-plugin called Keyboardconfig, that I've just added, it seems to be an alternative. But I don't want give up.
    Anyway I thank for you support again, and if someone other wants to help me, I'll appreciate it.
     
    #9

Share This Page