Caethyril's MZ Plugins

● ARCHIVED · READ-ONLY
Started by caethyril 209 posts Page 6 of 11 View original ↗
  1. @Seedspreaderent - Cae_SelectItemFilter filters which items are displayed in the Select Item event command. The plugin command just configures the filter: use it, then use Select Item. Also, the plugin only supports reducing the number of items normally available for selection: you can't use it to, for example, select from the Regular Item and Key Item categories simultaneously.

    (For all my plugins, any parameter in the "Advanced" section should be ignored unless you know what you're doing with it. E.g. the "Save Property Name" parameter is for configuring how the plugin names its data in save files. It's there as a measure to mitigate conflicts with other plugins.)

    As usual, Select Item shows a list of items in the party's inventory that match the specified category. The player can select one of those. Selecting an item from there does not use it: the command simply stores the ID of the selected item (or 0 if cancelled) in the variable you specified. You can then check the value of that variable and react accordingly.

    In case it helps, here's an excerpt from a test event I have in my scrap project:
    event excerpt
    ◆Change Items:Encounter Decreaser + 2 ◆Change Items:Drop Increaser + 2 ◆Change Items:HP Increase + 1 ◆Text:None, Monster(1), Window, Bottom : :Filtering for "potion" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["potion"] : :Action = Set ◆Select Item:input, Regular Item ◆Text:None, Monster(1), Window, Bottom : :Adding "epic" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["epic"] : :Action = Add ◆Select Item:input, Regular Item ◆Text:None, Monster(1), Window, Bottom : :Removing "potion" & "epic" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["potion","epic"] : :Action = Remove ◆Select Item:input, Regular Item ◆Text:None, Monster(1), Window, Bottom : :Adding "special" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["special"] : :Action = Add ◆Select Item:input, Regular Item
    (I don't actually do anything with the selected ID here, it's just to show the filter at work.)
  2. caethyril said:
    @Seedspreaderent - Cae_SelectItemFilter filters which items are displayed in the Select Item event command. The plugin command just configures the filter: use it, then use Select Item. Also, the plugin only supports reducing the number of items normally available for selection: you can't use it to, for example, select from the Regular Item and Key Item categories simultaneously.

    (For all my plugins, any parameter in the "Advanced" section should be ignored unless you know what you're doing with it. E.g. the "Save Property Name" parameter is for configuring how the plugin names its data in save files. It's there as a measure to mitigate conflicts with other plugins.)

    As usual, Select Item shows a list of items in the party's inventory that match the specified category. The player can select one of those. Selecting an item from there does not use it: the command simply stores the ID of the selected item (or 0 if cancelled) in the variable you specified. You can then check the value of that variable and react accordingly.

    In case it helps, here's an excerpt from a test event I have in my scrap project:
    event excerpt
    ◆Change Items:Encounter Decreaser + 2 ◆Change Items:Drop Increaser + 2 ◆Change Items:HP Increase + 1 ◆Text:None, Monster(1), Window, Bottom : :Filtering for "potion" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["potion"] : :Action = Set ◆Select Item:input, Regular Item ◆Text:None, Monster(1), Window, Bottom : :Adding "epic" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["epic"] : :Action = Add ◆Select Item:input, Regular Item ◆Text:None, Monster(1), Window, Bottom : :Removing "potion" & "epic" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["potion","epic"] : :Action = Remove ◆Select Item:input, Regular Item ◆Text:None, Monster(1), Window, Bottom : :Adding "special" ◆Plugin Command:Cae_SelectItemFilter, Select Filter : :Values = ["special"] : :Action = Add ◆Select Item:input, Regular Item
    (I don't actually do anything with the selected ID here, it's just to show the filter at work.)
    Thanks for the quick reply, @caethyril ! You've been a big help in some of my other forum posts as well!

    When you say "in the variable you specify", that is where my confusion lies. Is this a local variable in the plugin or is it suppose to be tied to a RPGmaker variable? I dont seem to see an area in the command or plugin notes of where to assign a variable number, like what is used in the "select item" command.
  3. Seedspreaderent said:
    When you say "in the variable you specify"
    The paragraph you're quoting that from was entirely focused on the Select Item event command:
    caethyril said:
    As usual, Select Item shows a list of items in the party's inventory that match the specified category. The player can select one of those. Selecting an item from there does not use it: the command simply stores the ID of the selected item (or 0 if cancelled) in the variable you specified.
    Cae_SelectItemFilter does nothing with game variables. It stores its filter internally, saves/loads it automatically (if the plugin's "Add Save Data" parameter is set to true) and checks it automatically.

    All my plugin does is filter the list of choices available when the Select Item command is used. The plugin command simply changes the filter, very much like the Control Switches or Control Variables commands change switches/variables:

    Plugin Command: Select Filter - adjust the Select Item filter values; - excludes existing items based on their notetags; - filter persists until reset.
    As seen in my example, it should be very straightforward:
    1. Use the plugin command to adjust the filter;
    2. Use the Select Item command as normal.
    Select Item will then only show items that both:
    1. Meet the standard Select Item conditions, i.e. the item:
      • Is present in the party inventory; and
      • Matches the specified item category (e.g. Key Item).
    2. Pass the filter from my plugin, i.e.
      • The filter is empty, or
      • The item matches at least 1 keyword from the filter.

    Seedspreaderent said:
    For the ItemSelector, do I need to assign the store saved property name to a variable?
    Hold up, have you named my plugin "ItemSelector"? It should be named "Cae_SelectItemFilter", otherwise, as noted in the opening post of this thread, things will break:
    caethyril said:
    • Avoid renaming my plugins.
      (Renamed plugins won't see their plugin parameters.)
    • Save your project after making changes in the Plugin Manager.
      (Plugin changes are only applied to the game after saving.)
    Otherwise, if you're still having trouble, I suggest you show screenshots of the event where you are trying to use it.
  4. caethyril said:
    The paragraph you're quoting that from was entirely focused on the Select Item event command:

    Cae_SelectItemFilter does nothing with game variables. It stores its filter internally, saves/loads it automatically (if the plugin's "Add Save Data" parameter is set to true) and checks it automatically.

    All my plugin does is filter the list of choices available when the Select Item command is used. The plugin command simply changes the filter, very much like the Control Switches or Control Variables commands change switches/variables:

    Plugin Command: Select Filter - adjust the Select Item filter values; - excludes existing items based on their notetags; - filter persists until reset.

    As seen in my example, it should be very straightforward:
    1. Use the plugin command to adjust the filter;
    2. Use the Select Item command as normal.
    Select Item will then only show items that both:
    1. Meet the standard Select Item conditions, i.e. the item:
      • Is present in the party inventory; and
      • Matches the specified item category (e.g. Key Item).
    2. Pass the filter from my plugin, i.e.
      • The filter is empty, or
      • The item matches at least 1 keyword from the filter.


    Hold up, have you named my plugin "ItemSelector"? It should be named "Cae_SelectItemFilter", otherwise, as noted in the opening post of this thread, things will break:

    Otherwise, if you're still having trouble, I suggest you show screenshots of the event where you are trying to use it.
    Sorry for the confusion, Caethyril!

    I think most of my confusion came from where the variable came into play for the Item select command. I read through the documentation and understand that part now.

    As for the name, I was talking about the notetag name that I changed, not the plugin. Full credit was added to my credit document without change to the plugin Javascript file.

    Thanks for your response and this awesome plugin!
  5. I've been using the Cae Picture Touch plugin to emulate oldschool point and click games, and it's been phenomenal so far!
    Adding interactable pictures to a map is now so quick and easy! :kaocry:

    However, I've been running into some trouble with the 'enter' and 'leave' triggers T-T

    Specifically, in most point and click games, a vital feature is that when the cursor moves over something that can be interacted with, the name of that object will show.
    Example:

    ---------------
    So far, it's been easy having an parallel event w/ 'enter' trigger to set an ID variable, then use that IdVar # to display a name!

    example: Pictures 1, 2, and 3 each have an 'Enter' Trigger, that will set the 'Hover Picture ID' Variable to 1, 2, and 3. I then have a seperate parallel event that will set the 'Hover Display Name' Variable based on the 'Hover Picture ID' Variable.

    So if mouse is over Picture 2, then IDVariable set to 2,
    then If IDVariable set = 2 then DisplayNameVariable set = Window.

    Seems simple, but I quickly realized the problem lay in when the player ISN'T holding the mouse over an picture. If you move the mouse up into the sky, it will still show the name of the last Object, ie window...

    So I tried fiddling with the 'leave' trigger to set the PictureID Variable = 0, and the parallel event is set to change the Display Name Var to = ' ' (so it would just be blank).
    This works, but unfortunately, it ends up erasing the name if I move from one picture to another picture that is adjacent to it. So any pictures that are next to the first picture moused over won't have a name when the cursor moves over the next picture T-T
    Example:

    ----------------------------------------------------
    I'm wondering if there's something I'm doing wrong?
    Or if there's an easy fix? Like a way to check 'If mouse NOT over picture that has trigger' then set Var to 0 or something? :dizzy:
  6. @Ghoost - the plugin sets the assigned variable (which you've called "IDVariable") whenever a picture event bind starts: as you've seen, it is only really designed to be used within the triggered events.

    Show Text can be a handy debug tool for events. E.g. you could show messages like Enter \v[1] and Leave \v[1] (replace 1 with the ID of your "IDVariable") to check the trigger order.
    technical
    The triggers should process in the order ((Enter -> Press) OR (Leave)) -> Click. The core scripts process these in order of increasing picture ID, i.e. 1 -> 2 -> 3, etc. Event/script binds will be queued/executed in this order. So if you enter pic 1 and exit pic 2 in 1 frame, the responses will be queued in that order: enter 1, exit 2. Going the other way, enter pic 1 from pic 2: exit 1, enter 2.

    In your video I notice that the correct values seem to be appearing briefly before resetting to 0. Usually multiple common events queued back-to-back should be able to complete within a single frame, so either you've got some wait time in those events (?) or there's something else going on. :kaoswt:

    I think you can track the most recently-hovered picture using only the enter trigger: on Enter, set a different variable, e.g. "LastHoveredPicID", equal to "IDVariable". (It needs to be a different variable because you want it to update independently of the plugin.) Then on Leave, you are leaving the most recently-hovered picture if and only if those 2 variables are equal. :kaohi:
  7. How compatible is your MapEvents plugin with MV? It looks like something I could use.
  8. @AquaEcho - the core scripts might not have changed enough to make a difference (?) but I skimmed the code of Cae_MapEvents and it uses at least one ES11 feature, the optional chaining operator ?., which MV playtest does not support out of the box. There may be other things.

    Except for the <save> event notetag, Cae_MapEvents is a port/compilation of some of my MV plugins:
    • Cae_DisableEventStart
    • Cae_MapUpdateRate
    • Cae_TwoEventsOneTrigger
    They can be found on my MV plugin thread (linked at the top of the first post of this thread).
  9. @caethyril
    Yeah, I noticed that too! The correct name flashes briefly before getting erased by the Leave Trigger, which is weird because I have the erase triggers happening BEFORE the Enter triggers on the same event! :kaoback:

    I'll try some of the solutions you recommended when I get back later tonight, but in the meantime, I copied this picture-clicking scene onto a blank example project.
    It's got 1 map, 1 common event, and 2 variables. And only your plugin.
    It might shine some light on if I'm just making an obvious blunder or leaving something important out:

    (reuploaded the sample project, seems it gets deleted if downloaded even once. if there's a better place to upload please let me know -_-)
  10. @caethyril
    Okay, update, I took your idea to add another variable! Things are looking much better now!
    Example:
    vid



    There is a problem though...
    Whenever a picture is clicked, during the text that appears (ie: "Looks like a large rock.") it stops the 'leave' and 'enter' triggers from working.
    So if you move the mouse over to the window picture during the dialogue, the display name Var will still read: 'rock' and worst of all, if you click after the dialogue ends, it'll still think the cursor is over the rock and just repeat the rock dialogue. Which could be really frustrating for players... T-T

    It just seems to stop updating the variables during the dialogue -which is weird, considering my 'X and Y coords of the mouse' variables right below it onscreen have no problem countinously updating in this next Example video of the new problem:
    vid



    The 'show text' seems to pause the 'Enter' and 'Leave' Triggers -which i thought was due to my 'disable triggers event', but that's only set to disable the CLICK trigger for a little while after clicking, nothing else...
    ----------
    So now I'm a little bit stuck. T-T
    Is there anyway to continuously update the 'Enter' Trigger to get var if the mouse is over a new picture?
    Or allow the enter and leave triggers to function while the Show Text command is happening?

    Also, I've updated the sample project to reflect the new changes (and new problem...)
    Temp File - CaePicTest2.rar
    -Sorry for still bothering you, I'm just sooo close to getting a good point and click foundation from this :kaodes:
  11. @Ghoost - OK, so I downloaded your second demo and I'm going to list what I noticed. Apologies if it sounds harsh. Here goes~
    1. You use Script fields a lot when you could just use the existing event command. Scripting is a last resort, for when event commands do not suffice. Reasons for that include:
      • The engine has to compile Script text into code on the spot (slow), then run that code.
      • The engine cannot preprocess things, e.g. preload Show Picture when an event starts.
      • The editor's Event Searcher tool cannot find switches/variables in Script commands.
      So, a couple of examples:
      • Use 3 Show Picture commands instead of a Script with 3 showPicture calls.
      • Use Branch -> Variable instead of Branch -> Script: $gameVariables.value(148) == 14.

    2. You are using Script Binds instead of Event Binds for calling events. However, the plugin's newest feature, "Picture ID Variable", only works with Event Binds! (The point is to ensure the variable is set when the event starts, not when it is reserved.) Fortunately (?), you seem to be using variable 150 for the display text instead...your Script Binds actually set variable 148. So: use Event Binds and double-check your variable IDs.

    3. In your Enter common event, you set a "LeavingPicID" variable equal to 0, then check if that's different from "EnterPicID". But you only do this inside one of 4 branches, where "EnterPicID" must be 14, 15, 16, or 17. So those inner branches will always be true.

      In fact, it seems "LeavingPicID" is always 0. If it's supposed to track the most recently-hovered picture, then:
      caethyril said:
      on Enter, set a different variable, e.g. "LastHoveredPicID", equal to "IDVariable". (It needs to be a different variable because you want it to update independently of the plugin.) Then on Leave, you are leaving the most recently-hovered picture if and only if those 2 variables are equal.
      In your case, "IDVariable" -> "EnterPicID", and "LastHoveredPicID" -> "LeavingPicID". I.e. don't set "LeavingPicID" to 0: set it equal to "EnterPicID" instead.

    4. You turn switch 150 on/off in your "Click" common event. In map event 1 you note that it "disables pic clicking", but you never seem to check its value, so it actually does nothing.

    5. Map events 2 & 3 (update text pictures) don't need to be separate, or running every frame: you could call them as a single common event from the enter/leave events to update the text only when necessary.

    6. Map events 4, 5, & 6 (assign picture binds) only need to run once, not every frame. Like map events 2 & 3, they can also be merged: always try to minimise the number of active Parallel events.

    7. Map event 8 (enable all binds) seems unnecessary because I don't think you ever disable the binds and they're all enabled by default. It also repeats every frame.

    8. Map event 9 (show pictures) runs only once per map visit, good! You might want to use a Parallel trigger instead of Autorun, because Parallel never has to wait for the transferring event to finish.
  12. @caethyril

    Okay, I've been able to implement most of your advisements:

    I think I did my best despite my eventing-knowledge limitations
    1. Funny enough, I actually hate using script binding as opposed to common event binding (the reason being is that i'm worse at scripting than eventing -_-; )
    BUT The reason I've been using script binding instead of event binding is that if I only use event binding, I end up not being able to set the variable. It just goes straight to the Common Event with no variable assigned. Which means nothing happens. At least with Script Binding, I'm able to set the Picture ID first, then call the common event. Am I missing something important?

    -For the 'show pictures' event, I've done as advised and changed from scriptcall to event command. I've also changed the autorun to parallel.

    2.Ohhh, the 'picture ID Variable'! Truthfully I could never figure out how to get that working! Seems that every time I tried to use it, whatever variable I selected would just ended up constantly never set...
    So it only works with Event Binds, as in the 'Call common event' plugin command, instead of the 'Script Bind' plugin command... -although just now trying it still seems I can't get it working, even after changing out my Enter Trigger Event's 'Script Binds' for 'Common Event Binds'. Infact, having it set the proper var148 just seems to make var148 always blank T-T Oh well.

    3. Making it "LeavingPicID" = "EnterPicID" works great, better than setting it to 0 each time.

    4.Switch 150 'Click on/off' actually controls map event 8's second page. When the switch turns on, it enables that 2nd page to disable all clicking triggers while active.

    5.Map events 2 & 3 (update text pictures) have been merged.

    7. (I touched on this in 4.) Map event 8 (enable all binds) is actually 2 event pages, the second is previously mentioned 'Disable Click trigger' which happens when clicking so the calling of common events doesn't endlessly queu. It repeats every frame because I'm afraid a quick mouse click from the player would start queuing things T-T.

    ------
    Seems right now, almost everything is working perfectly.
    The only remaining issue is the 'enter' and 'leave' triggers not working while a 'show text' command is happening.
    (ie, that whenever a picture is clicked, during the text that appears (ie: "Looks like a large rock.") it stops the 'leave' and 'enter' triggers from working.
    So if you move the mouse over to the window picture during the dialogue, the display name Var will still read: 'rock'. It seems the 'show text' seems to pause the 'Enter' and 'Leave' Triggers):

    VID


    (the video is before implementing the changes mentioned above)

    As can be seen in the video, even while clicking around the map to walk, the display still shows 'Flowers'..
    I don't believe this one is a result of my poor eventing, but rather from either how the plugin works or how the RPGMZ editor works.
    It just seems to stop updating the variables during the dialogue -which is weird, considering my 'X and Y coords of the mouse' variables right below it in the above video have no problem countinously updating during a Show Text event...
    Clicking over a new different picture seems to 'refresh' it -unless my mouse isn't over a picture (ie the rest of the map), then it never refreshes and continues to just show 'Flowers' as the Display name until I happen to mouse over a new picture...
  13. Ah, that may be because reserved common events are run in the main event interpreter (non-Parallel). That means they cannot run while any other non-Parallel event is running. They will still be queued, though. I forgot about that aspect. :kaoslp:

    Some ideas:
    1. You could hide the text pictures, or skip/disable the Enter/Leave binds, during Show Text.

    2. You could show the descriptions using the TextPicture plugin instead of Show Text.

    3. You could make your existing Enter and Leave common events Parallel, each event tied to its own switch. Then assign Script Binds that store the picture ID in a variable (for reference in the event) and turn on the respective event's switch, e.g.
      JavaScript:
      // Store triggered picture ID in variable 148.
      $gameVariables.setValue(148, pictureId);
      // Turn on "Enter" common event switch.
      $gameSwitches.setValue(200, true);
      If the Parallel event ends with a "turn off switch 200" command, it will effectively only run once. Similarly for the Leave bind, just use a different switch. (pictureId is a local variable available in Script Binds, you don't need to replace it with a number.)
    If you do decide to use only Script Binds, I suggest you set my plugin's Picture ID Variable parameter to 0. That lets the plugin skip some patches.
  14. Alright, managed to fix just about all the previous issues.

    -no issues with moving the cursor really fast and losing the display name.
    -Moving off a named Pic sets name to blank space '_'.
    -text box no longer freezes cursor vars updating.



    Here's some screenshots for anyone interested in what the events, common events, and variables look like:

    PICS OF EVENTS AND VARS
    ----------------------------------------------------------------------------------------------------------------------------------------
    Enable/Disable Event: 1 Enable.png
    ENTER LEAVE EVENTS:
    2 EnterLeave.png
    CLICK EVENT
    3 Click.png
    CLICK SHOW TEXTS BASED ON VAR:
    4 ClickText.png
    COMMON EVENT ENTER and LEAVE
    5 Common Events.png
    VARIABLES AND SWITCHES:
    6 VarSwitch.png
    ----------------------------------------------------------------------------------------------------------------------------------------

    There's probably some redundancies or better ways to event this, but at the momment I've reached the limits of my knowledge and also all I know is that every single thing that I wanted is working, and I'm too afraid to change anything lest I break it T-T

    Thank you so much @Cae for all the advice, I'm sorry for making you watch me abuse your wonderful plugin, but if anything, this proves that this one plugin alone + a couple variables and switches could definetly be used to make a game-base that could fill the FlashGame-shaped void left in peoples hearts.
  15. :kaophew: Good to hear it's working now!

    Ghoost said:
    I'm sorry for making you watch me abuse your wonderful plugin
    Haha, it's OK! My plugin is written to be very flexible, but that does means you need to be much more careful with how you use it. :kaoslp:
  16. Just wanted to stop by and thank you for making the Picture Touch plugin, it's fantastic and I'll be using it in my project, with attribution of course. Thanks Caethyril! :rock-right:
  17. Hey there, your Window Motion plugin is exactly what I've been looking for. However I can't for the life of me figure out how to use it. I did try to use the examples you provided, but nothing changes. I've tried messing around with the other parameters, but I only mess it up even more haha. If you have the time, I would love an example of how to input the plugin parameters properly. Thanks!!
  18. @NoahB - I was going to say "yes, it's a script-heavy plugin", but...wow, I just tried it and it looks like it's been broken for 3 years. Maybe I uploaded the wrong file for v1.3 by mistake. :kaoslp:

    I've updated Cae_WindowMotion to v1.4 (same link) as a quick fix for some stuff; tested a little (title and message windows) and it seemed OK, hopefully it doesn't make anything worse. Passive movement should now work, at least! The Reset On Open/Show parameter should no longer block movement for windows that open every frame, e.g. Window_TitleCommand. I also changed the default JS: Open Frames & JS: Close Frames parameter values, and made their descriptions slightly more helpful.

    There are still some issues, like if you set an "Open" movement for the message window, its subwindows (e.g. Show Choices) will be placed based on the starting point of the movement, not the ending point.


    To use the plugin, you can define the passive, open/close, and/or opening-/closing-animation curves for each kind of window in the plugin parameters. E.g. Window_MenuStatus for the pause menu status window.
    • Passive movement is intended to be cyclic, e.g. try the Math.sin example for JS: Formula Y.
    • Open movement teleports the window to the start point, then transitions it to its default position.
    • Close movement procs when the window closes.
    • Opening-/closing-animation define how the window's openness changes in those cases.
    I see what past-me had in mind, and the passive movement stuff seems sound. But if you want it for making "window move routes" then you might be better off looking for an alternative.
  19. Amazing, seems to be working now! Thank you for taking the time to update a 3 year old plugin, and so fast too!
  20. Great, you're welcome! Let me know if you run into any other problems with it. :kaohi: