Coder Social home page Coder Social logo

notyourturn's Introduction

Not Your Turn

'Not Your Turn' is a Foundry VTT module that prevents tokens from moving when the GM doesn't want it. Using the default settings the module only blocks movement during combat, but by pressing the 'Block Movement' button in the Basic Controls (buttons on the left) you can enable the module for all movement.

Note: If you have a pre v1.1.0 version, you need to uninstall it before you can install the latest version! Any version later than that should update normally.

Operation

If a player moves a token when it's not the token's turn (or always, if 'Block Movement' is enabled) one of a few things can happen, depending on the settings:

  • Off - Nothing, the token can continue moving
  • Warning - A warning is given, but the token can continue moving
  • Dialog - A dialog box appears
  • Autoblock - The token is automatically blocked from moving

The dialog box contains the following options:

  • Undo - Returns the token to its previous position
  • Ignore - Ignores the step counter (can be disabled)
  • Request - Request the GM to move the token further

dialog

If the request button is pressed, a dialog box appears for the GM, with the following options:

  • Accept - Accepts the movement request
  • Decline - Declines the request and returns the token to its start position

request

Control Buttons

There are 2 'Not Your Turn' control buttons:

  • Block Combat Movement - Enabling this will enable movement blocking during combat
  • Block Non-Combat Movement - Enabling this will enable movement blocking when not in combat

Settings

The operation of the module can be modified in the module settings. Here is an overview of the settings:

  • Player/Trusted/Assistant/GM - This determines the behavior when a token tries to move when it's not its turn for the specified permission group
  • Ignore Button - This determines what users have access to the 'Ignore' button in the dialog box
  • GM Request Button - Adds or removes the 'Request' button (it is not needed if players have access to the 'Ignore' button)
  • Chat Messages - Creates a chat message whenever a non-gm user either: presses the 'Ignore' button, or moves a token when it's not their turn and 'Turn Block' is set to 'Warning Only'

moduleSettings

Software Versions & Module Incompatibilities

Foundry VTT: Tested on v12, v11 and v10
For support of Foundry Version 0.7.9 - 9.280 use earlier versions 1.1.5 up to 1.2.8 of this module
Module Incompatibilities: None known

Feedback

If you have any suggestions or bugs to report, feel free to contact me on Discord (STB#9841), or send me an email: [email protected].
Please contact only the actual maintainer, not the previous authors regarding this module.

Credits

Author / Maintainer: Andre / STB (stbaf on Discord (old: STB#9841))
Original author of this module was Cristian Deenen (Cris#6864 on Discord). Thanks for all the fantastic work on this module!

Localization

Spanish: Lozalojo (https://github.com/lozalojo)
French: Maxtor
German: GenX187 (https://github.com/GenX187) and RadicalEd (https://github.com/marcel-wiechmann)
Italian: smoothingplane (https://github.com/smoothingplane)

Abandonment

Abandoned modules are a (potential) problem for Foundry, because users and/or other modules might rely on abandoned modules, which might break in future Foundry updates.
I consider this module abandoned if all of the below cases apply:

  • This module/github page has not received any updates in at least 3 months
  • I have not posted anything on "the Foundry" and "the League of Extraordinary Foundry VTT Developers" Discord servers in at least 3 months
  • I have not responded to emails or PMs on Discord in at least 1 month
  • I have not announced a temporary break from development, unless the announced end date of this break has been passed by at least 3 months
If the above cases apply (as judged by the "League of Extraordinary Foundry VTT Developers" admins), I give permission to the "League of Extraordinary Foundry VTT Developers" admins to assign one or more developers to take over this module, including requesting the Foundry team to reassign the module to the new developer(s).
I require the "League of Extraordinary Foundry VTT Developers" admins to send me an email 2 weeks before the reassignment takes place, to give me one last chance to prevent the reassignment.
I require to be credited for my work in all future releases.

notyourturn's People

Contributors

cdeenen avatar stbaf avatar lozalojo avatar lozanoje avatar

Stargazers

 avatar Cornell Daly avatar  avatar Jacob McAuley avatar  avatar  avatar Anthony Ronda avatar

Watchers

 avatar  avatar

notyourturn's Issues

[FEATURE] Disable rotation along with movement.

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Players can rotate when it isn't their turn
Describe the solution you'd like
A clear and concise description of what you want to happen.
I wanted a way to disable rotation when it isn't the player's turn.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Functionality lost.

Hello, been using this module for a while, it worked fine 2 weeks ago, but lately i updated everything (module list, 5e system, foundry) and the module does not work at all, it does not block movement nor throw warnings,

This is the configuration that i have for the module:

image

I tested the module alone and I could still move tokens as a played while it isnt my turn.

Edit: Version 1.13 works as it should.

[BUG] When GM moves tokens who do not have initiative, tokens move on their own

Setup

  • OS: Windows
  • Browser: Edge
  • Module version: [e.g. 1.2.5]
  • Foundry version: 0.8.8
  • Gaming system & version: GURPS 0.11.3
  • Any other modules enabled: yes

Describe the bug
When attempting to move groups of NPC tokens, tokens will start moving everywhere, generating repeated error messages and causing the screen to jump from place to place.

Screenshots
image

image

image

It's really difficult to give a good view of this without doing a video, but these are just three images.

Console Log
foundry.js:19259 You are calling PlaceableObject#getFlag which has been deprecated in favor of Document#getFlag. Support will be removed in 0.9.0
getFlag @ foundry.js:19259
blockMovement @ NotYourTurn.js:187
(anonymous) @ NotYourTurn.js:157
_call @ VM5873:4
callAll @ foundry.js:153
callback @ foundry.js:8880
(anonymous) @ foundry.js:8850
_handleUpdateEmbeddedDocuments @ foundry.js:8850
_updateEmbeddedDocuments @ foundry.js:8739
3foundry.js:19241 You are calling PlaceableObject#update which has been deprecated in favor of Document#update or Scene#updateEmbeddedDocuments. Support will be removed in 0.9.0
update @ foundry.js:19241
setTokenPositionNew @ misc.js:51
blockMovement @ NotYourTurn.js:228
(anonymous) @ NotYourTurn.js:157
_call @ VM5873:4
callAll @ foundry.js:153
callback @ foundry.js:8880
(anonymous) @ foundry.js:8850
_handleUpdateEmbeddedDocuments @ foundry.js:8850
_updateEmbeddedDocuments @ foundry.js:8739
foundry.js:19268 You are calling PlaceableObject#setFlag which has been deprecated in favor of Document#setFlag. Support will be removed in 0.9.0
setFlag @ foundry.js:19268
setTokenPositionNew @ misc.js:52
6foundry.js:19241 You are calling PlaceableObject#update which has been deprecated in favor of Document#update or Scene#updateEmbeddedDocuments. Support will be removed in 0.9.0

(repeated)

Additional context
Add any other context about the problem here.

[FEATURE] Prompt to Confirm Movement Before Moving

Is your feature request related to a problem? Please describe.
Not Your Turn is almost perfect for our game, however the fact that players can still move their token, gain vision of an area, and I then receive the prompt to undo movement makes it difficult to use without having to still resort to keeping the game paused.

Describe the solution you'd like
Ideally I'd like the GM confirmation pop-up to appear prior to the player's token being moved, such that I can see where the player would like to move and then accept or cancel the movement rather than accepting or undoing the movement that was already completed.

Describe alternatives you've considered
Keeping the game paused and having playing show their intended movement, then when I agree I unpause so they can move and then pause again. I've also tried using other plugins including Dungeon Mode and Adjusted Movement (https://foundryvtt.com/packages/adjusted-movement). From what I can see, the latter of those does exactly what I'd like except it's outdated and only functions on old Foundry versions. I've also tried enabling the feature to block all movement, but that doesn't really seem any different than just pausing the game constantly, which is specifically what I'm trying to avoid.

Additional context
Fantasy Grounds Unity's player movement system is a great example of what I'd generally like to replicate. It doesn't need to have a fancy UI on the token itself, Not Your Turn's dialogue pop-ups are totally fine. The core features are allowing players to request movement, then their token does not move, I get to see where they'd like to move to, and I then confirm movement, at which point their token moves.

[BUG] Movement skips during combat

Setup

  • OS: [e.g. windows]
  • Browser: Chrome
  • Module version: 1.1.5
  • Foundry version: 0.8.6 / 0.8.7
  • Gaming system & version: dnd5e 1.3.5
  • Any other modules enabled: no (but happens more often if "Drag Ruler" is installed and enabled)

Describe the bug
When dragging a token using Ctrl+Drag+Space while in active combat, movement is very jumpy.

Additionally, when the "Drag Ruler" module is enabled, it always happens when dragging (originally reported in manuelVo/foundryvtt-drag-ruler#84).

Screenshots
Just the module by itself, using Ctrl+Drag+Space:
20210618_142211

With "Drag Ruler" enabled, simply dragging:
20210616_213658

Console Log
There is a warning constantly being triggered while "Not Your Turn" is active, but I'm not sure if it's related:

image

Additional context
The problem never happens if "Not Your Turn" is disabled.

[BUG] Possible not proper initialized object

Setup

  • Foundry version: 11.308
  • Gaming system & version: dnd5e
  • Any other modules enabled: yes, occured with other modules disabled, after that seem not to be reproducable without other modules enabled

Describe the bug
grafik

Additional context
User gets error message when moving Token in combat (2 Tokens in one Encounter is enoght

Summoned tokens that share turns with summoner cannot be moved

Certain summoned tokens (spiritual weapon for example) do not have initiative slots and instead can be moved on their owners turn. NYT doesn't account for this, warning that it's not their turn and preventing movement. Ideally, tokens that are not in an encounter (not in turn order) should be exempt from NYT prompts.

Doesn't work in 0.7.8 x undefined

Hi,

I'm getting:

Uncaught (in promise) TypeError: Cannot read property 'x' of undefined
at blockMovement (NotYourTurn.js:114)
at NotYourTurn.js:101
at Function._call (foundry.js:2496)
at Function.callAll (foundry.js:2456)
at Function._handleUpdateEmbeddedEntity (foundry.js:29997)
at Function._handleUpdateEmbeddedEntity (foundry.js:34248)
at Scene.updateEmbeddedEntity (foundry.js:29965)

Is this module getting an update for 0.7.8/9 ?

Thanks!

Movement restrictions stop working when switching scenes

Whenever Foundry gets loaded for the first time (the first scene that gets loaded), the movement restrictions work as intended for both GM and players.
As soon as a player/GM swaps to a new scene (themselves, or being dragged by DM), their movement restrictions no longer apply within the new scene. When swapping back to the previous scene, they are also able to move freely there.

If a player refreshes their browser on the new Scene, the movement restrictions will be re-applied to them, until they change scenes again.

[BUG] Does not work (at all) when used with Foundry 11 and Shadowdark game system

Foundry version 11.315
Shadowdark 2.2.2.

Modules installed: I've disabled everything except NotYourTurn, but it still doesn't work.

When I put the PCs in initiative order, roll init, and then start the combat, NotYourTurn has no effect. Players can move around as they wish at any time, even when out of their turn order. It's as if the module's not active at all. I've tried all the settings, Dialog shows no dialog when they act, autoblock has no effect, etc.

[Feature] Add an "Exploration Mode"

Since NotYourTurn works only in combat, I'd suggest adding a configuration toggle "Exploration Mode".

Config:
Enable Exploration Mode: on/off
Key to enable EM: CTRL+1

In Exploration Mode all tokens are locked and must request permission to move (as in combat). This denies the players to begin exploration and see the map, alllowing the GM to trigger events when someones enter an area.

If possible, also might be a button to enable/diable in the left quick bar.

[BUG] Possible probolems with the DSA System

Setup

  • OS: windows
  • Browser: edge
  • Module version: 2.1.4
  • Foundry version: 11.315
  • Gaming system & version: The Dark Eye, Version 5.2.8
  • Any other modules enabled: yes

Describe the bug
As soon as none-combat-movement is disabled token start to move "in a row". If a token is moved, all other tokens that were added to the scene later than that one, successive make the same movement one after another.

[BUG] Scene change throws error with 3+ players and crash scene rendering

Developer Issue:

NotYourTurn throws error with 3+ players to property scale.
This causes players tokens not rendered on scene.

foundry.js:37900

   Uncaught TypeError: Cannot read properties of undefined (reading 'scale')

[No packages detected]
at Token.refresh (foundry.js:37900:15)
at Token._onUpdate (foundry.js:38670:12)
at TokenDocument._onUpdate (foundry.js:9802:38)
at TokenDocument._onUpdate (foundry.js:18997:18)
at ClientDatabaseBackend.callback (foundry.js:10260:11)
at foundry.js:10243:43
at Array.map ()
at ClientDatabaseBackend._handleUpdateEmbeddedDocuments (foundry.js:10243:33)
at o. (foundry.js:9844:41)
at o.T.emit (index.js:143:20)
at o.value (socket.js:276:20)
at o.value (socket.js:263:18)
at o.value (socket.js:231:22)
at s.T.emit (index.js:143:20)
at s.value (manager.js:200:14)
at a.T.emit (index.js:143:20)
at a.value (index.js:105:51)
at s.value (manager.js:192:22)
at a.T.emit (index.js:143:20)
at a.value (socket.js:323:26)
at o.T.emit (index.js:143:20)
at o.value (transport.js:99:14)
at o.value (transport.js:92:14)
at WebSocket.ws.onmessage (websocket.js:76:40)
refresh @ foundry.js:37900

[Feature request] Add multilanguage support

Please add the framework for translating the module to other languages (as other modules do, with an en.json file in a lang folder with keys that we can translate).

I have translated more than 10 modules and this one doesnt support translating.

Thanks and great work!

Movement becomes bugged after first pop-up window for player

Hi,

I will try to describe the issue:

Setup:
I installed Not Your Turn.
I placed two tokens (A and B) representing characters on a map in a scene.
I started an encounter with those two tokens.

When it is token A's turn I try to move token B.
The dialog box opens, asking if I would like to ask gm or cancel.

If I cancel the move the token becomes stuck. -->
Stuck meaning that trying to move token B again does not re-open the dialog box. When the turn becomes Token B turn, token B still cannot move.
Coming out of combat stop this, but if I restart the combat Token B gets dragged back to the "stuck" position.

[BUG] unintentional reset to start position

I like to setup the movement so that when players attempt to move, a request dialog shows up for me and I can accept or decline their movement. Unfortunately, if I decline their movement, they are sent all the way back to their very first position on the map, rather than their previous position. This can be very frustrating when we are far into a session and I have to decline a movement, the player is moved all the way back to the beginning, and it can also lead to players moving through walls and seeing hidden areas without me wanting them to. It seems to me like declining their movement should work the same way as them undoing their movement. It would be amazing if you could implement this.

(by mail CAH8O_UhiA80OB5D+kf64kFrBcscv2jzPN2gbjNraCEp2Wg3xCQ)

Settings save issue + No Accidental Back Button incompatibility?

From: https://discordapp.com/channels/170995199584108546/486930822465716249/761329739226546207

0.6.6
dnd5e
it restarts on save changes
and no changes were made
ok, some module hooks up to the Save Changes and always restarts
might be why no changes were saved, it restarts before that happens
ok, its the Not Your Turn! module that makes the restart. I don't know what combo makes it that it doesn't save configs
ok, I think whats the combo. Not Your Turn! + No Accidental Back Button
Not Your Turn! restarts and probably the second module detects it as a false positive (backspace) and stops the saving process
probably, didn't test it with just those two

V9 compatiblity update

Module does not work under v9 (loads, bricks nothing but simply not working anymore).
I poked a little bit by myself in the code but changing all the token.setFlag/getFlag to token.document.setFlag/getFlag and make some corrections to the compatibleCore() calls seem not to solve the problem.

Would be nice to see this module updated to v9 - using this in all my games :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.