Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console Warnings - Foundry V11 #10

Open
ottyn opened this issue Jul 8, 2023 · 1 comment
Open

Console Warnings - Foundry V11 #10

ottyn opened this issue Jul 8, 2023 · 1 comment

Comments

@ottyn
Copy link

ottyn commented Jul 8, 2023

Testing FollowMe in Foundry v11. Module works with some issues.

Issue 1: No longer get the popup notification on the token about follow distance. The token does correctly follow.
Edit: Issue was with the core "Scrolling Text" option

Issue 2: Get the following warnings in console while moving around scene. Not running into walls or other objects. Does not seem to effect token movement, just the depreciated warning.
image

@ottyn
Copy link
Author

ottyn commented Jul 12, 2023

Barring this module being updated to include routinglib for pathfinding, I was able to update the code to work with the new "testCollision" function for V11. I replaced the following code in scripts/followme.mjs and tested in a new world and existing world.

Original followme.mjs: (lines 120-127)

if (game.settings.get(MOD_NAME, 'collisions')){
      let ray = new Ray( follower.center, utils.vAdd(new_pos, { x: follower.bounds.width/2, y: follower.bounds.height/2} ) );
      if (canvas.walls.checkCollision(ray, options={type: "move", mode: "any"})){
        stopFollowing(follower.document, token.name, true);
        // Do not apply update
        continue;
      }    
    }

New followme.mjs: (lines 120-126)

if (game.settings.get(MOD_NAME, 'collisions')){
      if (CONFIG.Canvas.polygonBackends.move.testCollision(follower.center, utils.vAdd(new_pos, { x: follower.bounds.width/2, y: follower.bounds.height/2} ), { type: "move", mode: "any" })) {
        stopFollowing(follower.document, token.name, true);
        // Do not apply update
        continue;
      }    
    }

I also changed the default follow key (line 234) to KeyL since KeyF is is now used by the default system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant