Altimit Pixel Movement [0.50β]

● ARCHIVED · READ-ONLY
Started by xilefian 545 posts Page 24 of 28 View original ↗
  1. AquaEcho said:
    Try telling it to wait 3 frames after selecting a choice because it's probably registering multiple button presses even if you just press it once. This happens if you hold the button for longer than it likes.
    Still repeating

    AquaEcho said:
    Set this top bedsheet event to Options>Through
    No change, actor is still staying at the edge of the bed, my guess since its set to Player touch.
  2. Puppet Knight said:
    No change, actor is still staying at the edge of the bed, my guess since its set to Player touch.
    Ok, yeah, Altimit is triggering the touch event as soon as you touch the border of the event's collision box.

    You can do Conditional Branch>Script
    Code:
    Math.sqrt(($gamePlayer.x - this.character(0).x) ** 2 + ($gamePlayer.y - this.character(0).y) ** 2)<0.2
    That will check if your player is on the bed event. Put whatever you want to happen inside the conditional/if statement.

    Then set it to Options>Through and Trigger>Parallel. At the end of the event box outside the if statement, you can put wait 10 frames since this needs to be parallel but doesn't need to check that often.
  3. AquaEcho said:
    Then set it to Options>Through and Trigger>Parallel. At the end of the event box outside the if statement, you can put wait 10 frames since this needs to be parallel but doesn't need to check that often
    That did it, I'll update the events elsewhere to match.

    I'll keep playing around with the Show Choices issue. Its only registering the second input. Even with that wait in place
  4. Puppet Knight said:
    Separate point: It appears oddly that this plugin is causing my "Show Choices" to repeat after selection. I only realized this is the cause because i disabled the plugin to show the screenshots. Anyone run into that before?
    Is this only happening when you select Yes or also with No? If it's happening only with Yes you'll need to show what's in your common event. You'll probably need a wait a few frames command after "When Yes" but before "Common event: Inn visited" then another wait command somewhere at the top of the common event itself depending on what's in it.
  5. AquaEcho said:
    Is this only happening when you select Yes or also with No?
    It's happening with any Choices that I set up. Not just Yes/No
  6. Puppet Knight said:
    It's happening with any Choices that I set up. Not just Yes/No
    Could you try putting a Wait 10 frames command on the next line whenever you have a When (Choice) command followed by "do some stuff" (i.e. not blank)
  7. AquaEcho said:
    Could you try putting a Wait 10 frames command on the next line whenever you have a When (Choice) command followed by "do some stuff" (i.e. not blank)
    Tried that after the initial suggestion. Didn't make a difference unfortunately
  8. Puppet Knight said:
    Tried that after the initial suggestion. Didn't make a difference unfortunately
    Unfortunately I'm stumped as I that fixes the issue whenever it comes up for me. If you could explain how to reliably reproduce the problem (from a blank project) that would help.
  9. Restart said:
    I believe this behavior is working as intended.

    If you want to make this facing-dependent, I think you can use yanfly's encounter aid as a workaround. Don't turn on the encounter direction lock, and just have your pillar events include a wrapper based on "this.checkEventFacingPlayerFront()". That should mean that the pillar events all turn to face the player when they get interacted with, but only the one that the player is facing towards is going to actually trigger your code.


    It might be a decent idea to safety-proof things a bit by making the colliders on map tiles one-way pointing out, so a character that gets stuck inside a wall can always move to an adjacent clear spot. IIRC that's how RMMV handles characters embedded in walls already.

    Wouldn't eliminate the problem entirely, but does mean that nobody's getting softlocked by clipping one tile into a wall.
    Late response but, it is because I'm trying to give this plugin another chance


    I still have the issue, and your solution won't work as it also triggers both events of the same direction

    If there's two NPCs standing next to each other and I press the action button while standing right between them, it will trigger both event and the dialogue box will open twice.

    EDIT : I added a break statement in the loop after the starting of an event when the script looks for triggerable events. It seems to work but anyone can tell me if I should do that ?

    here's the portion of code I'm talking about :


    JavaScript:
              // Test collision with characters
              for ( var ii = 0; ii < events.length; ii++ ) {
                var entryX = events[ii]._x;
                var entryY = events[ii]._y;
    
                if ( loopMap[events[ii]] == 1 ) { entryX += $gameMap.width(); }
                else if ( loopMap[events[ii]] == 2 ) { entryX -= $gameMap.width(); }
                else if ( loopMap[events[ii]] == 3 ) { entryY += $gameMap.height(); }
                else if ( loopMap[events[ii]] == 4 ) { entryY -= $gameMap.height(); }
                else if ( loopMap[events[ii]] == 5 ) { entryX += $gameMap.width(); entryY += $gameMap.height(); }
                else if ( loopMap[events[ii]] == 6 ) { entryX -= $gameMap.width(); entryY += $gameMap.height(); }
                else if ( loopMap[events[ii]] == 7 ) { entryX += $gameMap.width(); entryY -= $gameMap.height(); }
                else if ( loopMap[events[ii]] == 8 ) { entryX -= $gameMap.width(); entryY -= $gameMap.height(); }
    
                if ( events[ii].isNormalPriority() && Collider.intersect( this._x + vx, this._y + vy, collider, entryX, entryY, events[ii].collider() ) ) {
                  // Normal priority player-touch/event-touch
                  events[ii].start();
                  break; //THE BREAK I ADDED
                } else if ( events[ii]._trigger === 2 ) {
                  // Event touch is encasing
                  if ( Collider.encase( entryX, entryY, events[ii].collider(), this._x, this._y, collider ) || Collider.encase( this._x, this._y, collider, entryX, entryY, events[ii].collider() ) ) {
                    events[ii].start();
                  }
                } else if ( Collider.intersect( this._x, this._y, collider, entryX, entryY, events[ii].collider() ) ) {
                  events[ii].start();
                }
              }

    EDIT 2 : I have another issue unrelated to the first one. When using the MOVE TO command of YEP_MoveRouteCore, the game starts to terribly lag
  10. No idea if the author of this thread still even checks it, but is there any way this plugin could also apply to certain events? I'm trying to get an enemy chase to work similarly to MOTHER 2 with YEP's event chase plugin, and while it does work, the event itself is locked to MV's grid.
  11. UnforseenUplink said:
    No idea if the author of this thread still even checks it, but is there any way this plugin could also apply to certain events? I'm trying to get an enemy chase to work similarly to MOTHER 2 with YEP's event chase plugin, and while it does work, the event itself is locked to MV's grid.
    Restart already solved this
    Altimit Pixel Movement [0.50β]
    Put this code somewhere where your game can call it, either at the very end of AltimitMovement.js (after EVERYTHING, since it's new code not part of AltimitMovement.js, you're just putting it there so your game can call it) or a new .js file you create and add as a plugin to your project
    Restart said:
    Code:
    Game_CharacterBase.prototype.goTowardsPlayer = function (){
    var vx = $gamePlayer.x - this.x; 
    var vy = $gamePlayer.y - this.y; 
    var length = Math.sqrt( vx * vx + vy * vy ); 
    if ( length > this.stepDistance ) {
    this.setDirectionVector( vx, vy );
    vx *= 1/length;
    vy *= 1/length;
    this._moveTarget = true;
    this._moveTargetSkippable = true;
    this._moveTargetX = this.x + vx ;
    this._moveTargetY = this.y + vy;
    }
    } 
    
    Game_CharacterBase.prototype.setSelf = function(switchName,switchValue)
    {
    var key = [$gameMap._mapId, this._eventId, switchName];
    $gameSelfSwitches.setValue(key, switchValue);
    }
    
    //calculates the distance from an event to a given point.
    Game_CharacterBase.prototype.distanceToPoint = function(xcoord,ycoord)
    {
    var distance = Math.sqrt( (this.x-xcoord)*(this.x-xcoord) + (this.y-ycoord)*(this.y-ycoord) );
    return distance;
    }

    Then on your event make two event pages.
    Put this in a move route on page one:
    if (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)<5){setSelf('d',true)}

    And this in a move route on page 2, with D self switch checked
    if (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)>5){setSelf('d',false)}else{this.goTowardsPlayer()}
  12. AquaEcho said:
    Restart already solved this
    Altimit Pixel Movement [0.50β]
    Put this code somewhere where your game can call it, either at the very end of AltimitMovement.js (after EVERYTHING, since it's new code not part of AltimitMovement.js, you're just putting it there so your game can call it) or a new .js file you create and add as a plugin to your project


    Then on your event make two event pages.
    Put this in a move route on page one:
    if (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)<5){setSelf('d',true)}

    And this in a move route on page 2, with D self switch checked
    if (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)>5){setSelf('d',false)}else{this.goTowardsPlayer()}

    Just put this in and I got a Reference Error saying "setSelf is not defined"
  13. UnforseenUplink said:
    Just put this in and I got a Reference Error saying "setSelf is not defined"

    Ok, yeah, he forgot to put "this" as the object for the .setSelf function to act on and the switch name has to be capitalized.

    Try this on page 1
    if (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)<5){this.setSelf('D',true)}

    And this on page 2
    if (this.distanceToPoint($gamePlayer.x,$gamePlayer.y)>5){this.setSelf('D',false)}else{this.goTowardsPlayer()}
  14. Now it works, thanks a ton!
  15. Also this just crossed my mind, as I was thinking about this a while back. Is there any way to have the followers in the party echo the players movements rather than just ease into their position? The easing always has looked really awkward for me, and I think it would prevent followers getting stuck on walls and corners.

    For reference, something similar to MOTHER 2's movement is what I'm looking for.
  16. UnforseenUplink said:
    Also this just crossed my mind, as I was thinking about this a while back. Is there any way to have the followers in the party echo the players movements rather than just ease into their position? The easing always has looked really awkward for me, and I think it would prevent followers getting stuck on walls and corners.

    For reference, something similar to MOTHER 2's movement is what I'm looking for.
    I made this plugin that will make any event follow the player's path exactly since followers and chasing events kept getting caught on walls. It was mostly for my own use but I made it open source in case anyone else wants to use it.
    MV - Follow Player Path (Altimit Pixel Movement)
  17. I'm a bit lost with this, the followers move route is mostly confusing me, where would I find this?
  18. Never mind, I thought it would be an events move route and I was right. Sorry it's a bit late, brain's not workin right atm
  19. UnforseenUplink said:
    I'm a bit lost with this, the followers move route is mostly confusing me, where would I find this?
    Putting the script in the event's move route is making it choppy and less responsive in my testing right now so I have to look into what's causing it. For now you can put this version of the script in an event page instead and it's pretty smooth. I updated the instructions in the thread.
  20. Hello, I know i am late, but i tried to use this plugin but i get an error: cannot read property 'right' of undefined, is there any way to fix it