QPlugins - Latest: QABS

Discussion in 'JS Plugin Releases (RMMV)' started by Quxios, Jan 2, 2017.

  1. Arise

    Arise Veteran Veteran

    Messages:
    131
    Likes Received:
    18
    @Quxios: Found a new bug.

    Player touch is not working properly for the event if the priority is below character.
    If the character is not stopping moving, or if the mouse click is not inside the defined polygon, then the character will enter the collider, will move through the collider and it will exit the collider without the "touch" being triggered.

    If the character stops inside the collider, then the Player touch trigger will work.
     
  2. Amy Pond

    Amy Pond Veteran Veteran

    Messages:
    667
    Likes Received:
    1,359
    First Language:
    English (UK)
    Excellent thank you.

    Also QSprite is amazing. Never thought we'd get that level of functionality as a public plugin. The opportunities for this are huge. I've set up some animations from the PVGames master sheets so far and they're seamless.
     
    ZcheK and Quxios like this.
  3. Quxios

    Quxios Veteran Veteran

    Messages:
    1,055
    Likes Received:
    781
    First Language:
    English
    Primarily Uses:
    RMMV
    @Arise Ah I see. You can edit which angles output which direction in the QPlus plugin. So I'd recommend creating a new js to override this function:
    Code:
    Game_CharacterBase.prototype.radianToDirection = function(radian, useDiag) {
    radian = QPlus.adjustRadian(radian);
    if (useDiag) {
    // use degrees for diagonals
    // since I don't know clean PI numbers for these degrees
    var deg = radian * 180 / Math.PI;
    if (deg >= 22.5 && deg <= 67.5) {
    return 3;
    } else if (deg >= 112.5 && deg <= 157.5) {
    return 1;
    } else if (deg >= 202.5 && deg <= 247.5) {
    return 7;
    } else if (deg >= 292.5 && deg <= 337.5) {
    return 9;
    }
    }
    if (radian >= 0 && radian < Math.PI / 4) {
    return 6;
    } else if (radian >= Math.PI / 4 && radian < 3 * Math.PI / 4) {
    return 2;
    } else if (radian >= Math.PI * 3 / 4 && radian < Math.PI * 5 / 4) {
    return 4;
    } else if (radian >= Math.PI * 5 / 4 && radian < Math.PI * 7 / 4) {
    return 8;
    } else if (radian >= Math.PI * 7 / 4) {
    return 6;
    }
    };
    
    You can then just increase the range for the diagonal values

    Ctrl will ignore all collisions, but thats only during debug mode (default mv behavior). For you getting stuck it's probably due to use polygons. I didn't intend to let people use polygons because I "cheaped" out on the collision checking algorithm and it isn't a complete check. So there will be some incorrect checks very rarely, and mainly only with polygons. Boxes and circles should zero issues.

    I'll look into the player touch, thanks for report!

    @Amy Pond No problem, glad u like! Most of my plugins are aimmed for artistic devs to make their games look less like a generic rm
     
    ZcheK likes this.
  4. Arise

    Arise Veteran Veteran

    Messages:
    131
    Likes Received:
    18
    @Quxios thanks! That looks like a good headstart so I know from where I should start with this.

    I don't have the issue with polygons, all the colliders in the "character stuck into the event" issue are circles or eventually squares.

    There is something special in this "stuck" issue, the character is not changing direction and not all keys works. For example direction keys are not changing the direction and the ESC key is not opening the menus. Works only the Action Keys (Enter/Space) and some F keys like F10 to see the colliders.

    But(now I'm talking about some different scenario) If I use the "Ctrl" key for example, to forcefully step inside the collision of the event, to cause a collision on purpose, and I release the "Ctrl" key, then the character will be stuck into the event, unable to go away, but at least direction keys will work, I can face up, down, left, right, etc... and also the ESC key will work just fine to let me open the menu.

    Later edit: (More details about the issue).
    Some of the keys are blocked (gets into a queue or something and waits there to be processed, including the ESC key).
    Also found two ways to force an unlock.
    1. If I use Enter, Space or mouse button to trigger the event (action) to open the message then the message will apear at the bottom. At this point I can press the ESC key multiple times (one will cancel the message, other ESC key press will open the menu) and the character will get unlocked and able to move again.
    2. Other way would be to just press F8 and open Chrome Developer window and in console type something $gameActor.setDirection(2) or (4), depending on how is the character facing. This command will correct the Character location on the map, like it will force move the sprite over its collider.

    Again, repeating myself just to make clear, when the “stuck” happens, there is a slight offset between the Character sprite that is stuck near the event and the collision circle which has a small offset and is just a couple of pixels far from the actual sprite.
    I studied the code a little and I’ve seen the collision circle moves first on the map, then it checks to see if is possible for such a movement (like no collision happens) then the actor sprite is moved into the new location.
    When the issue appears, the collider moves into the new place, but the actor stays in the original place, and then it gets stuck.

    Once I get stuck, I cant use Ctrl key for example to force the Character to ignore the collisions, it will be just stuck (i feel like is stuck in some sort of processing), direction keys dont change direction, ESC key not opening menu, mouse no longer works, ctrl key is not skipping collision checks. What works are the F keys and space/enter to retrigger the event.
     
    Last edited: Jan 2, 2018
  5. Sleepy Kitten Games

    Sleepy Kitten Games Veteran Veteran

    Messages:
    428
    Likes Received:
    187
    First Language:
    English
    Primarily Uses:
    RMMV
    @Quxios I've noticed an interesting thing that happens when I use an animation on a QMap (I don't know if it's a bug or if it's intended, but I wanted to mention it either way).
    On one map, for instance, I have a large section that's set to be above the player (at layer 4), while the section the player walks on has a couple of objects that're set to layer 3. A cutscene plays on that map where it shows animations at the location of two events (which are in roughly the same place as two objects on the map) and then shows another animation on an event (A QABS enemy, actually) that's partially underneath the layer 4 graphics. The problem is, both the animations shown at the objects and the animation on the enemy display over all layers. The other problem is that the first two animations also display over a QMap object that's in front of them, when it's expected that the object would be in front of the animations.
    I have a similar problem with the emotion balloons. On another QMap, in another cutscene, there is a small section of the map that is on layer 4, and part of the cutscene involves an event walking under the layer 4 section to another room. The event also displays an emotion balloon. However, the balloon displays over even the layer 4 graphic.
     
  6. Quxios

    Quxios Veteran Veteran

    Messages:
    1,055
    Likes Received:
    781
    First Language:
    English
    Primarily Uses:
    RMMV
    @Arise You'll need to figure out how to reproduce the issue and give me instructions / send a demo. And yes that's how the collision checking works, but it also sends the collision back to it's old position if it failed. And if it failed, it still shouldn't get your character that kinda of stuck. If it failed you should be able to move out with ctrl, which you're saying you can't. In which case it's a different issue, like maybe it's stuck trying to trigger an event over and over

    @GameFire That's completely normal. You can find the Z layers in the QMap Editors help and you'll see that animations and balloons are both higher then z 4
     
  7. Sleepy Kitten Games

    Sleepy Kitten Games Veteran Veteran

    Messages:
    428
    Likes Received:
    187
    First Language:
    English
    Primarily Uses:
    RMMV
    Ah, I see. So what about the problem of the layer 3 object that's in front of where the animation plays? (For reference, it's a tree, where the anchor point is set at the back of the tree. The animation that plays behind it is of fire, and its playing location is behind the tree's anchor point.) How can I make it so that the fire animation plays behind the tree instead of on top of it?
     
  8. Arise

    Arise Veteran Veteran

    Messages:
    131
    Likes Received:
    18
    @Quxios: I figured it out and fixed the issue, apparently.
    It was because of another plugin, loaded after QMovement.js.

    This plugin was Aliasing the Game_Player.prototype.update and at the bottom of it there was:
    Code:
        if (!this.isMoving()) {
            this.updateNonmoving(wasMoving);
        }
    
    I replaced that block with
    Code:
        if (!this.startedMoving()) this.updateNonmoving(wasMoving);
    
    I assume the new method startedMoving was introduced by you, because it doesn't seems to exist in the original MV base code.
     
  9. Kraden96

    Kraden96 Friendly Fox Veteran

    Messages:
    31
    Likes Received:
    10
    First Language:
    English
    Primarily Uses:
    RMMV
    I used the code you gave but it's still getting the whole number /:
     
  10. Shiko

    Shiko Villager Member

    Messages:
    27
    Likes Received:
    8
    Location:
    Portugal
    First Language:
    English
    Primarily Uses:
    RMMV
    Is there a way that you can lock the player's direction?
    I made the player lock his direction while holding a button(to aim), but the skill is still going to where the player last walked to.
     
    Last edited: Jan 5, 2018
  11. Arise

    Arise Veteran Veteran

    Messages:
    131
    Likes Received:
    18
    I found some more issue (maybe related???) with the QPathfind and QMovement.

    First issue:
    Demo is here:
    demo_NPC - forgets pathfinding.rar


    Please note that in QMovement settings are set for
    Grid:12
    Off Grid: true

    The hidden event is jumping from place to place on the map, and after each jump it tells the NPC Event to pathfind to its position.
    All works ok, as long as I don't mess with it, like trying to block its movement with my Actor.

    For example, blocking it with the keyboard is different than blocking it while moving with the mouse.
    If I block the NPC movement using the mouse, then after a new Pathfind command it will get stuck, and won't do any Pathfinding.
    After testing this seems to be related to the Grid:12 & Off Grid: true.
    If I go with a pixel movement (Grid:1) then I won't be able to get the event stuck in the the Pathfinding, however, as long as I stay near the event, then the event will not be able to move because 1 pixel movement will not be enough to get out of my collision.

    Second issue:
    This is actually the old issue reported on page 30 but I just discovered why it goes in zig zag, rather than a visual straight line.
    It is because of the QM+ColliderMap plugin. The pathfinding algorithm reacts completely different if there are colliders on the map versus no colliders. If the QM+ColliderMap is disabled, then the actor will properly "pathfind" in a straight line where the mouse clicks.
    Reposted the demo here for convenience:collider_issues_and_strange_path.rar
     
  12. krain11

    krain11 Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Hi Guys. I don't know why but I keep getting this error :

    Capture.JPG

    Can someone please tell me the solution? What could be the reason for this?
     
  13. Quxios

    Quxios Veteran Veteran

    Messages:
    1,055
    Likes Received:
    781
    First Language:
    English
    Primarily Uses:
    RMMV
    @GameFire Again you'll see that animations play on Z layer 8. You would need a plugin to be able to set which Z layer the animation should play.

    @Arise yes startedMoving() is a function I added. MV needs a function that gets called every grid, which was isMoving() and for pixel movement u need a constant is moving not one that toggles to false every X steps even though you're still moving. I thought I had flipped them so isMoving returns the old expected outcome, guess not

    Off Grid should idealy only be true when Grid is 1. QPathfind will act different depending on that value. As for the other pathing issue that you reported before, as I said I saw nothing "strange" and seemed to path as expected.

    @Kraden96 Sorry, forgot variables can't be decimals, they will always be whole numbers

    @Shiko Not atm, aimming is based off last moved direction. This is for making dir locked enemies but still want them to aim any angle

    @krain11 We'll need more info, like what did you do to cause that or what happened before it
     
  14. krain11

    krain11 Villager Member

    Messages:
    11
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    It occurs after an event where I have to disable the QABS of an enemy to gain control of him via eventing. After the event, I enabled the QABS of that enemy. After walking out of that map and saving, this happens.

    One plugin I am currently using that directly affects QABS is Yanfly's SkillCostItems (YEP_SkillCore is required). I use this to implement an ammo system in my game. I already tried disabling that also, but problem still persist even when I'm starting a new game.

    It wasn't happening earlier. What could be causing this problem?
     
  15. Arise

    Arise Veteran Veteran

    Messages:
    131
    Likes Received:
    18
    @Quxios: Sorry for being so pesky. :)
    Attached an image...

    And I've made a short video with the problem.
    First time the plugin for colliders is Off and pathfinding looks natural. Second time the plugin is enabled for the room corners and pathfinding tends to go in zig zag.


    Demo attached here:
    colliders.rar


    [​IMG]
     
  16. Quxios

    Quxios Veteran Veteran

    Messages:
    1,055
    Likes Received:
    781
    First Language:
    English
    Primarily Uses:
    RMMV
    @krain11 I see, the problem is probably with enabling / disabling enemies. Will look into it!

    @Arise Ah I was thinking u meant the path between the barrels lol. Will look into that, but it's probably your polygons. Cause if I remember your polygons were a bit odd, so I'll make an image on polygon best practices, and try to see if changing the polys fixes it.
     
  17. Arise

    Arise Veteran Veteran

    Messages:
    131
    Likes Received:
    18
    @Quxios: there are no polygons on those two barrels. Just their image painted on the map, but you can step over them.

    Excluding the small poly for the group of 4 barrels, then the rest of the polygons are mostly to define the boundaries of the room, and this is where I’ve noticed it the first time it goes on a funky A*pathfinding.
     
  18. ThePotatoOfFire

    ThePotatoOfFire Stop, in the name of candy! Veteran

    Messages:
    153
    Likes Received:
    56
    Location:
    Phoenix Caves
    First Language:
    English
    Primarily Uses:
    RMMV
    Starting trying out your ABS Plugin yesterday, and for some reason, as soon as I get within trigger distance of an enemy, I get this:
    TypeError: Cannot read property 'rotate' of null
    at Game_Event.Game_CharacterBase.makeSkillCollider (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:3161:17)
    at Function.QABSManager.skillWillHit (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:1125:31)
    at file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:1110:29
    at Array.filter (native)
    at Function.QABSManager.bestAction (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:1108:39)
    at Game_Event.AISimpleGetAction (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:3637:32)
    at Game_Event.updateAISimple (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:3596:42)
    at Game_Event.updateAI (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:3585:19)
    at Game_Event.updateABS (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:3570:19)
    at Game_Event.Game_CharacterBase.update (file:///C:/Users/The%20Potato%20of%20Fire/Documents/Games/Chronicle%207%20-Rebirth-/js/plugins/QABS.js:3038:57)

    I have all the settings filled out for every skill that's being used by the actor and the enemy (only 1 actor active, only 1 enemy active) and I filled out the action sequences and on damage tags. Any idea what's making this happen?
     
  19. Quxios

    Quxios Veteran Veteran

    Messages:
    1,055
    Likes Received:
    781
    First Language:
    English
    Primarily Uses:
    RMMV
    @Arise if I recall the first demo u sent had polys on them. Anyways I looked at it and updating all the QPlugins seemed to make it slightly better, though there was a still a few odd cases. But fixing your collider map made it even better. This is how the collider map polys should be. I'll have a detailed explanation in the QMovement help soon

    @krain11 I couldn't recreate so you will need to create a sample demo that can recreate the issue and send to me.

    @ThePotatoOfFire Looks like a skill is having an issue creating it's skills collider. What does your Enemies <absSettings> look like?
     
  20. Extazee

    Extazee Elite Shard Hunter Veteran

    Messages:
    80
    Likes Received:
    49
    First Language:
    English
    Primarily Uses:
    RMMV
    @Quxios
    Hey, I don't know if this gets asked a lot or if I'm missing something.
    I've installed QABS and QMovement, along with QPlus, Skillbar, gauges and QInput.

    Now, what happens, is my character always stays one block/grid below any object. I can't seem to approach anything and it kind of broke my maps. I really want to use your releases, however, this is getting in the way of it. Any idea how to fix it?
     

Share This Page