Pixi Filter Controller - fancy screen effects by pixi

Discussion in 'JS Plugin Releases (RMMV)' started by cji3bp62000, Jan 24, 2018.

  1. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    I'm not sure what you're talking about. I'm "play testing" it on my PC(Win).
    So how can I fix it? Simply my changing my default browser?
     
  2. Galenmereth

    Galenmereth I thought what I'd do was Veteran

    Messages:
    2,206
    Likes Received:
    1,912
    Location:
    Norway
    First Language:
    English
    Primarily Uses:
    RMMV
    You have to have a browser and computer that supports WebGL (GPU-based rendering), otherwise the filters simply are not available.
     
    KotoYama likes this.
  3. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Oh, I didn't know that! :0 Thank you!
     
  4. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    So I enabled WebGL rendering in my browsers (Chrome and Firefox) but it still doesn't work. Again I'm testing it in the RPG Maker itself ((1.5.1) not sure if that could be a problem).
    How do I know if my laptop suppports WebGL rendering?
    Can I somehow play test it in my browser? (I'm totally lost)
     
  5. Galenmereth

    Galenmereth I thought what I'd do was Veteran

    Messages:
    2,206
    Likes Received:
    1,912
    Location:
    Norway
    First Language:
    English
    Primarily Uses:
    RMMV
    @KotoYama Sorry, completely forgot to mention how you can check that :kaoswt2: When you playtest the game, hit F2 and look at the top left corner, below the framerate FPS counter. It'll say "WebGL mode" or "Canvas mode".
     
  6. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    It's in WebGL mode. WebGL renderer works perfectly fine it both browsers.
    I tested this plugin by using map notes from the first post.
    Is there something else I could do?
     
  7. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    I tried to create I new project. Same thing happens :(
     
  8. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,593
    Likes Received:
    10,511
    First Language:
    English
    Primarily Uses:
    RMVXA

    KotoYama, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


    If you want to add something, and less than 72 hours have passed since your last post and no one has posted after you, just use the Edit button on your earlier post to add the additional info/comment.
     
  9. adachis

    adachis Villager Member

    Messages:
    5
    Likes Received:
    7
    Location:
    Los Angeles, CA
    First Language:
    English
    Primarily Uses:
    RMMV
    Just to tackle the part of this I know I can answer first: this plugin can't always work properly with RPGMaker MV versions below 1.5. There's a note in the original post about it. If you don't need to use an older version for a specific reason, I'd stick with 1.6.2. (I'm pretty sure 1.6.1 works just as well with plugins, as I've never seen a break in compatibility between these two versions, but I haven't seen everything and I think it's generally a good idea to work with the latest version of any software if you can.)

    Anyway, I had trouble getting this plugin to work in the beginning. It was awhile ago so I can't remember what problem I had, specifically, but I think it was similar to yours and I remember most of what I did to figure it out. First, let's get into what's happening. The plug-in is looking for a filter with the name you specified but it's undefined. That could mean one of several things. First, though, I think it'd be good to understand what's going on here so you can troubleshoot more easily.

    When an errors tells you that a variable is undefined, it's like the code is doing a roll call for attendance. Rather than just mark the variable absent during roll call, the code reacts more like "f* this, I quit!" With these errors, your goal is to find the truant variable. Your error has some clues in it. We know it's not finding the "filter name" property and can't. It wouldn't be looking for the filter name property if you didn't try to add a filter to some part of your game so we can assume that the entire object is undefined. (If you're not familiar with the terms, an object is just a variable that can contain a bunch of variables in one nice little package. Events in RPGMaker are objects. When you set a self switch, for example, you're actually setting a boolean—true or false—property on the instance of an event class—or, in other words, a copy made from the "blueprint" for how events are structured.) If the entire object is undefined and you've defined it, it either means you've defined it and are referencing it incorrectly or something is unsetting/overwriting it. The error you're getting is likely one of these two things but the second can have different sources. I'll go over the likeliest possibilities.

    1) Your syntax is wrong and you're using the name of the filter and not the instance name of the filter you created. If this is the case, you have a very easy fix because you just need to change the name you're referencing. If you paste in examples of the ways you've tried to create filters (map notes or otherwise) I'll know right away if this is the problem and can tell you what to fix. It's a little confusing to get the syntax right so don't feel bad if the problem is just as simple as a misplaced word. I screw it up all the time. That might be my dyslexia, though. :p

    2) This plugin isn't working because another plugin is in conflict with it. When you make plugins for RPGMaker MV, you're writing code that alters existing classes and functions in the original code. Ideally that's done by making a copy first because then that copy will contain any changes made by plugins that run before it in the plugin order. When plugins don't do this, it can cause problems. You'll rarely find a plugin that doesn't do this, but if you have any less-common ones installed it's entirely possible that it's completely overwriting the Pixi Filters plugin and that's throwing the error. But it's also possible that you have another plugin that interacts with the same stuff, comes later in your plugin list, and is overwriting the object even if it's following the best practices for creating a plugin (that being the copying thing I just mentioned). In either case, plugin order can make or break any plugins. If you have any other effects plugins—or any sort of visual enhancement, such as overlays—try putting the PixiFilters plugin before and after those plugins to make sure the position isn't the sole issue. If that doesn't get you anywhere, try disabling every other plugin you can and test a very simple filter targeting the entire screen to see if that works. If you can't do that or it doesn't work, try creating a new game with nothing but this plugin active and try the same thing. If that doesn't work, you've probably got issue #1 or something strange and unique. While system compatibility issues are definitely possible, I'm having trouble coming up with any reason they'd cause this type of error.

    3) It's also possible that you're trying to use the plugin in a way that causes an error due to a bug in the plugin's code. After fixing the issue similar to yours, I ran into something like this myself. If you scroll back a little in this thread's history you'll see the fix I posted for it. It's a pretty simple adjustment. It fixes an error similar to this, where the plugin fails to apply effects because it's looking for something that doesn't exist in a specific situation (specifically, in my case, map stuff that doesn't exist during a battle). I don't think that's what's happening in your case because your error is much more broad. Nevertheless, it's possible that you have a unique use case that causes a bug in the code. If this is the case, one of the tests in #2 will have worked for you because you'll have tested a generic map with a simple filter applied to the entire screen when on the map. So if that works and you just can't get your unique use case to work, it's possible there's a bug. It's probably not a hard bug to fix, but I'd need to know more about what you're trying to do with the filters to know where to look for that. This is unlikely, but if you're not able to fix things on your own please post your note tags (or whatever else) you're using to create and set filters. That'll tell me the location in the code that's throwing the error. Also, the full text of the error usually includes the line that failed so that's useful as well. :) It's not always the correct location, but it's related to the correct location if not.

    Okay, I think that's plenty to start with. :) Hopefully this helps you get to the bottom of the problem! If not, please share more information. This plugin definitely does work but it's not the easiest to get to work in every situation. If you're diligent, though, you'll get it working and it's absolutely worth it to be able to use the Pixi filters. It took me a couple of hours, but it saved me from having to write this plugin from scratch myself which would've taken sooooo much longer. And you can do some really awesome things if you explore the Pixi filters beyond what's built into this plugin. There's a lot more you can do with very little JavaScript. It's not too difficult even if you don't know how to code.
     
    ∊η∊ηra, KotoYama and KaYsEr like this.
  10. Restart

    Restart Veteran Veteran

    Messages:
    202
    Likes Received:
    130
    First Language:
    English
    Primarily Uses:
    RMMV
    I think self switches are actually off in their own little $gameSelfSwitches object
     
    adachis likes this.
  11. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Indeed :D Thank you very much!

    So, that's what I get when using this effect in New project (no plugins installed except filter controller):
    [​IMG]

    [​IMG]

    I also tried to use examples from the first post (both Map Notes and plugin commands).

    Here is what happens when I'm trying to use it in my original project (with some installed plugins)
    [​IMG]

    What I really need in my game are RGB, Noise and Glitch filters.


    Sure thing!
     
  12. Espilonarge

    Espilonarge Veteran Veteran

    Messages:
    116
    Likes Received:
    49
    Location:
    Australia
    First Language:
    English
    1) The most likely cause of your issues is due to plugin conflicts as I've just personally tested your RGBSplit settings in a map and they are working. Please either move SumRndmDde's Game Upgrade plugin above/below Tsukimi's Pixi Filter Controller plugin or disable it (I do not use SumRndmDde's Super Tools Engine or Game Upgrade as I've found them both to be rather intrusive with specific features that MV uses).

    2) Instead of just using the maps note field for filters, you could always use a Parallel event instead to have more defined control over the filters. A Conditional Branch can check if a "Switch" is enabled/disabled or a "Variable" that's larger/smaller than a certain value to enable the filters. You can even use a plugin like Yanfly's Plugin Commands - Switches & Variables Access to give even more refine control over the filters by specifying a variables value instead of just a flat number when creating a filter. Just remember that unless another map already has a filter enabled, you will need to "erase" the current filters upon doing a Transfer Player call.
     
    adachis and KotoYama like this.
  13. adachis

    adachis Villager Member

    Messages:
    5
    Likes Received:
    7
    Location:
    Los Angeles, CA
    First Language:
    English
    Primarily Uses:
    RMMV
    You're probably right. :) I was assuming because why would they be separated? That seems weird to me. But MV does a lot of code-related things that seem weird to me so I probably shouldn't assume things like that anymore.
     
  14. adachis

    adachis Villager Member

    Messages:
    5
    Likes Received:
    7
    Location:
    Los Angeles, CA
    First Language:
    English
    Primarily Uses:
    RMMV
    I agree with Espilonarge. I think SumRndmDde makes some amazing stuff, and I'm using some of his plugins as well, but I've definitely run into conflicts with them multiple times. His plugins and Galv's plugins don't seem to play well with others that cross into their territory. That's not to say they did anything problematic, but more so that they have some really useful plugins that change a lot of stuff and that's always going to create a greater chance of conflict if another plugin overlaps. I ran into issues with an SRD plug-in and Pixi Filters. If it's the same issue for you, Pixi Filters needs to be lower than any SRD plugins that change anything about how the game displays things (which Game Upgrade definitely does).

    I agree with this, too, though I think you should get it to work in the map notes before changing anything—if only just to help you with future issues that may come up. I think it helps a lot to solve a problem as-is whenever possible so you know exactly what went wrong in case something else breaks later. That way you won't find yourself at square one. Personally, I like to use the map note tags for the overall settings and then parallel events with conditional branches when I need to control changes. This is mostly a personal preference to help me keep things organized in a way that makes sense to me, but there are a couple of advantages that may or may not matter in your case.

    First, if your effects are going to be on a lot of maps you can create a template map with those note tags in it and then just copy and paste it when you need a new map (instead of opening one map, copying the relevant tags, and pasting those tags into the new map). It's a small thing but it helps me. :) The main reason you'd want to avoid a parallel event, though, is if you have a lot of events. Nothing slows down MV games like events. I like big maps with a lot of events so I run into performance issues a lot. Parallel events can slow game performance down a lot depending on the other stuff you've got going on. I go overboard with minute details and like making big areas to explore, so I minimize event activity as much as possible in those situations. On smaller maps (maps that fit entirely in the game window) you will pretty much never run into this problem so there's no advantage in that case.

    Anyway, in most cases it's a personal preference thing and Espilonarge's suggestion of parallel events with conditional branches have some advantages, too. For one, if the filters conflict with something you can use conditions to disable them if you can't figure out how to fix the code. If I hadn't fixed the code that caused battle errors, for example, I'd have gone this route instead. But like Espilonarge said, it refines the control you have over things and that can be a very big advantage in many situations. Developing software (even in a GUI like MV) is a balancing act, so I think it's good to learn multiple ways to do things because you'll probably need to do the same thing multiple ways at some point. But you should do what works best for you. I just wanted to offer some options. :)
     
    KotoYama likes this.
  15. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    First of all, as I said, I tried to use it in New project with no plugins installed except the filter controller.
    Second, If I'm turning off the SRD plugins NOTHING changes.

    I tried this too. I made a Parallel event with these plugin commands:
    createFilter tw#1 twist 0
    createFilter GLOW godray 2 screen


    And again - it doesn't work. I even tried to use a Conditional branch but game will tell me the same thing after reading a message.
    [​IMG]

    UPD #1:
    So very strange thing happened.
    I created a new project in MV 1.6.1 (the first one was created in 1.5.1) and it works FINE.

    The problem is that I made my project in 1.2.1 so even though I open it with the 1.6.1 version it seems like it still lacks some files for it to work properly.


    UPD #2:
    I think I FIXED IT :D

    SO what I had to do is manualy replace all the files from the JS folder + index. Now it's working fine!
    I hope someone will find it usefull.

    Thank you everyone for helping me out!

    P.S. I tested all the filters, but GlitchFilter(glitch) doesn't seem to do anything. Should I ask @cji3bp62000 about it?
     
    Last edited: Jul 30, 2019
  16. Espilonarge

    Espilonarge Veteran Veteran

    Messages:
    116
    Likes Received:
    49
    Location:
    Australia
    First Language:
    English
    I went through the plugin and while it does make one reference to the Glitch filter, @cji3bp62000 forgot to actually add functionality to "initiate" let alone there's no "default" values to fall back on it so even if you did it right, the plugin has no way to apply its effects.
     
    KaYsEr and KotoYama like this.
  17. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    That's too bad :(
    Is there something I could do to make it work?

    I'll probably have to read this Make your own Filter Controller thing. I don't have any actual Java-script skill, so I don't know if it's worth trying.
    What do you think?
     
    Last edited: Jul 31, 2019
  18. adachis

    adachis Villager Member

    Messages:
    5
    Likes Received:
    7
    Location:
    Los Angeles, CA
    First Language:
    English
    Primarily Uses:
    RMMV
    It's worth trying. It's super easy. You don't really need to know JavaScript to do it. You just need to be able to replicate the syntax. You basically just have to look up the filter parameters and translate them into the proper format (as described in the OP), save that as a .js file in the plugins folder and then just add (and enable) it as a plugin in your game (after the Pixi Filters plugin in the order). I've attached my custom filters "plugin" so you can see some examples. If you're having trouble and just feel intimidated by all of this (that's how code used to make me feel) let me know one custom filter you want to create, I'll make it for you, and walk you through the process.

    But you'll see "glitch" is the last one in my custom file so you might be fine just copying that. ;)
     

    Attached Files:

    KaYsEr and KotoYama like this.
  19. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Oh! This is super useful! Thank you so much!
     
  20. KotoYama

    KotoYama Veteran Veteran

    Messages:
    47
    Likes Received:
    5
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Hm...Unfortunately, it doesn't seem to be working.

    I tried this:
    <Filter:eff,glitch,0>
    <SetFilter:eff,5,100,0,0,0,8,512,0,0,0>

    I installed your plugin and placed it below Pixel Pixi Filter. It gives me nothing but a black screen (without any errors).
    If I place it above it, the plugin just doesn't do anything. I was trying to change parameters but nothing.
    What should I do?
     

Share This Page