Git Product home page Git Product logo

turnmarker-alt's Introduction

Turn Marker

Turn Marker is a module for Foundry VTT that adds an image under a token who is currently active in the combat tracker. This is completely system agnostic, and fully customizable to fit right into your game.

GitHub release (latest by date) GitHub latest version downloads

Installation

It's always better and easier to install modules through in in app browser. Just search for "Turn Marker"

To install this module manually:

  1. Inside the Foundry "Configuration and Setup" screen, click "Add-on Modules"
  2. Click "Install Module"
  3. In the "Manifest URL" field, paste the following url: https://raw.githubusercontent.com/kckaiwei/TurnMarker-alt/main/dist/module.json
  4. Click 'Install' and wait for installation to complete
  5. Don't forget to enable the module in game using the "Manage Module" button

Usage

The turn marker will move to the active token on their turn, and move with them as they move: example

Settings

Image ratio

The image ratio is related to the size of the token. 1 will be the same size as the active token, 2 will be double the size, etc.

Animate Marker

If enabled, the marker will use a rotational animation as defined by "Animation Speed" and "Animation Degrees".

Animation Speed

Defines in milliseconds how often the animation should apply a rotation. The lower the number the faster the animation.

Animation Degrees

Defines in degrees how much the marker should rotate on each tick.

Marker Image

Select from a number of included images provided by the Foundry Community:

Marker images by Rin

Runes of the Cultist Runes of Regeneration Runes of the Cosmos Runes of Earthly Dust
Runes of Reality Runes of Incendium Runes of the Believer Runes of the Mad Mage
Runes of the Blue Sky Runes of the Universe Runes of Prosperity

Custom Image Path

Sets the path to an image to be used instead of the included images

Announce Turns

If enabled, a chat message will be sent when the turn in combat changes (unless the combatant is hidden in the combat tracker).

Compatibility

Most recently tested on Foundry VTT version 0.6.6.

I've been developing on it on version 0.7.9, but haven't used it enough to deem it stable.

Feedback

All feedback and suggestions are welcome. Please contact me on Discord (Brunhine#2182).

Any issues, bugs, or feature requests are always welcome to be reported directly to the Issue Tracker

Support Development

Want to help improve the module? Send a pull request.

Want to show support another way? Recommend this module to other users.

Getting started

src is the folder you want to work with. Make sure you have npm installed. Run npm install to install gulp

When you're done making changes, run gulp build to recompile the dist folder

Licensing

Turn Marker is a module for Foundry VTT by Jeremiah Altepeter (Brunhine) and is licensed under a Creative Commons Attribution 4.0 International License.

This work is licensed under Foundry Virtual Tabletop EULA - Limited License Agreement for module development v 0.1.6.

The included images are created by Rin (rin#0002 on Discord)

Credits

Originally created by Bruhine

turnmarker-alt's People

Contributors

crovaxon avatar dependabot[bot] avatar dev7355608 avatar drdwing avatar illandril avatar kckaiwei avatar lozalojo avatar pchouzenoux avatar snap01 avatar zeteticl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

turnmarker-alt's Issues

[BUG] Turn marker appears before combat is started or initiative is rolled

Describe the bug
When creating an encounter, the turn marker is added to the first Actor in the encounter list, even if the Encounter has not been started, and initiative has not yet been rolled.

This makes it difficult to "pre-set" encounters, as the players may be able to see the turn marker through walls.

Environment Details
Foundry VTT Version: 0.6.4
Turn Marker Version: 2.6.9

To Reproduce
1: Add some Actors to a new encounter
2: The turn marker appears on the first actor in the encounter list

Expected behavior
Turn marker should not appear until the GM clicks "Begin Encounter"

Animate markers in preview

It'd be nice to see markers rotating in the settings based on how the user has configured the animation setting.

[BUG] Leaving ghost icons for start movement only on player side

Describe the bug
Players were left seeing ghost icons for movement start location. As the GM I code not see this, I had to have them send a snap. It appears that player view was not policing the graphic after turn change....
https://media.discordapp.net/attachments/729428633885737031/734481323288297482/Capture.JPG

Environment Details
Foundry VTT Version: Example 0.6.5
Turn Marker Version: Example 2.6.9

To Reproduce
Not sure, just normal play.

Expected behavior
A clear and concise description of what you expected to happen.
Start icons icons should clean up on next player/mob turn.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

jaltepeter/TurnMarker#13

IF ANYONE HAS REPRODUCTION STEPS PLEASE COMMENT!

[FEATURE] Add classes to chat message so they can be styled/identified by macros/modules or custom CSS

Turn Marker messages currently lack any internal information for what they're for.

I'd like something as follows
<div class='turn-marker'> to wrap all the content
Same div should have something like data-actor-id="actorID" just because.

<p>PLAYER NAME</p> should include class='user' or similar.

and the <em>Turn Marker</em>... I don't know removed or add class='note' or something?

This would allow at minimum for example custom CSS to be used to alter the appearance of the message instead of current state of it being indistinguishable from any other chat message.

Hidden Name CUB support

Would be nice if TurnMarker start supporting CUB Hidden Name funcionality. It works great with multiple modules, sadly, TurnMarker's round announcement displays token name plain in sight. CUB hides name with "Unknow Creature" or any other string user defines in CUB settings.

Weird things going on

#1 When I end combat, the "on deck" turn marker remains and then cannot be deleted, giving a weird error messages. Two screenshots depicting Issue #1 and Issue #2.

#2 I have some kind of weird dots rotating around instead of the rotating turn marker. Not sure why that is. Another module, perhaps?

Screen Shot 2021-06-26 at 6 14 23 PM
Screen Shot 2021-06-26 at 6 14 51 PM

Pause doesn't stop the marker animation

let result = await Marker.placeTurnMarker(combat.combatant.token._id, (tile && tile.id) || undefined);
if (result) {
markerId = result.markerId;
animator = result.animator;
}

placeTurnMarker returns only the marker id. The code above sets markerId and animator to undefined. Therefore pause/unpause doesn't stop/start the spinning animation.

I also noticed that !game.paused && is missing here:

if (Settings.getShouldAnimate()) {

EDIT: And the pauseGame hook doesn't need to be async.

Issue new to Foundry 9 prevents chat message but trivially easy to fix...

I found and locally fixed a trivial issue that prevents chat message from appearing.
In the following code at the bottom of chatter.js, I replaced combatant._actor with combatant.actor:

    static placeImage(combatant) {
        if (Settings.getIncludeAnnounceImage()) {
            let img = combatant.img;
            if (combatant.actor.data.img) {
                img = combatant.actor.data.img;
            }
            return `<div style="flex:3;padding-right:4px"><img src="${img}" style="border: none;" /></div>`;
            // return `<div style="flex:3;"><video><source="${combatant.img}"></video></div>`;
        } else return '';
    }

There is another issue that already existed in utils.js in , when deleting the tiles, which I've patched locally as well. This code, which is invoked from ready, assumes that there is a scene on the canvas. A guard clause for the existence of canvas.scene before using it to call getEmbeddedCollection(...) will prevent it from spewing an error in the console.log on startup.

I have no idea what other issues exist. This module looks like it is capable of doing a lot more than what little I use it for, so as I get more into it, I'll see what I find.

Turn marker announces first actor twice

Hello AdagioT,

thank you for your amazing module. I found a small glitch: In SWADE, initiative is determined by drawing poker cards. When the end of the combat round comes along and the tracker draws new cards, I receive two turn announcements in chat: One for the first actor in the past combat round and immediately after that the correct turn announcement of the first actor of the current turn.

Is this something you can help with?`

Best regards,
Razortide

[FEATURE] Option to configure on deck markers

Currently on deck markers will show for any marker. A new setting needs to be added to decide who to show on deck for.

Like Turn announcements:

  • Players only
  • All
  • NPCs only

utils.js:getNextTurn should pull from settings similar to this: Settings.shouldAnnounceTurns()

You can use combat.combatant.actor.hasPlayerOwner to check if it's a player token, or npc token, as you iterate to the next token in the stack. If for some reason the next to go is the same as the current token, it's probably best to still have the marker show up. The case where that happens is likely a single player game, where I would anticipate the DM would use show on deck for all instead of player only, since it's only a single player.

[BUG] Sizing for marker messes up sometimes.

Clicking through the initiative rapidly messes up the dimension of the marker sometimes. Might've been introduced in the 0.8.6 compatibility update.

Foundry 0.8.6
Turnmarker 2.8.0

To reproduce: cycle through the initiative order quickly.

[BUG] Error: The key xXAPcjxrashacwIO does not exist in the EmbeddedCollection Collection

Whenever combat begins, a new actor is added to the combat tracker, or the turn changes in combat, this error is generated:

Error: The key xXAPcjxrashacwIO does not exist in the EmbeddedCollection Collection

image

Additionally, the turn marker does not move to the current actor's turn until the actor's token is moved. Furthermore, the start marker only appears at the first location of the first actor in the first combat in a scene - it then never changes, moves, or disappears, even when that combat is ended and a new one begins.

I'm happy to share the list of other modules I have enabled if it helps identify the issue. Let me know what you need and I'll get the data for you.

[BUG] Start Markers return as tiles after exiting/reentering World

To recreate:

  • Enable Turn Marker mod
  • Enable Start Marker (I'm using bluesky.png asset)
  • Begin combat, move tokens for each of their turns
  • End combat (at this point, the start markers will be gone)
  • Exit World/ Log Out
  • Re-enter World
  • Start Markers will reappear for every turn for every actor, showing up as "Tiles" which can then be deleted. They are visible and cause some lag.

Results - Start Markers shows up as Tiles upon reloading World
Settings 1
Settings 2
Settings 3

[BUG] Fix visibility toggle not changing marker visibility

It seems that turning off visibility will hide the marker properly, but enabling visibility right after seems to not show the marker.

The corresponding hook is updateToken, it's likely due to a visibility calculation error somewhere.

image

Note in the image attached, the token is now visible, but the marker isn't (this is GM view)

[Feature] Turn notifications & Sounds

I really like the simplicity of this module and the fact that it has a simple purpose: to help manage who is playing, nothing else.

In order to make it even more awesome, I would like to suggest some addons.

Sound
I think it will be very useful if it would be possible to enable/disable "sounds" for different events in combat. The module could have already some defaults sounds set but it would be nice if it would be customizable (so that every group could choose their own sounds). Of course, all these settings should be configured on GM side (and maybe some on the player side too?).

I think the following sounds would be relevant:

  • Combat Starts - this one would play to everyone but only when combat starts and would replace the "round start" for the first round
  • Round start - this one would play to everyone when a new round of combat starts. IF combat start is not enabled, then it would play when 1st round starts
  • You are next - this one would only play to the owner of the actor that is next in the initiative.
  • Your turn - this would only play to owners of the actor which can play his turn now
  • Combat End - this would play to everyone once the combat ends

Overlay Notification
I think it would be helpful to get a notification to highlight what is happening in the combat. Of course, all these settings should be configured on GM side (and maybe some on the player side too?).

The idea for these notifications would be to be shown at the centre of the canvas to catch the player's attention and alert him. could be a notification that must be manually closed by the user OR it could also close automatically after X sec if the user doesn't close it.

I think the following notifications would be relevant:

  • You are next - this one would only show for the owner of the actor that is next in the initiative.
  • Your turn - this would only show to the owners of the actor which can play his turn now

There are a couple of further restrictions and customization we could suggest regarding what to show to DM and what to now sow to DM since the DM has to manage multiple monsters and may get annoying to ear sounds and notification for every single monster but, that would be also sorted with a config to enable disable certain sounds/notification for the GM controlled actors.

I think these would improve this module a lot and would make it perfect and contained (so that we don't need to install multiple different modules because, one adds notification,s the other sounds, the other chat msg, the other a token highlight, etc...

Hope it helps ๐Ÿ‘

Only DM can see Turn Marker

Pretty self explanatory. Everything works fine for DM. Players get sound notifications, but no turn marker animation is playing.

[FEATURE] Hide names of enemies in chat

Hello,
First of all great module.
I was wondering if there was a way to disable the names of the enemies in chat when their turn comes up. I know I can turn this off completely for all actors, so nothing comes up in chat, but it would be great to keep it on, and for it just to say "unknown creature" instead of it's name. I have CUB hiding the names of creatures everywhere else but it doesn't work on with this module.

Thanks

Conflict with Drag Ruler

Observed on Version 9 - Build 238

[Detected 2 packages: turnmarker, drag-ruler]
    at modules/turnmarker/scripts/turnmarker.js:96
    at Function._call (foundry.js:294)
    at Function.callAll (foundry.js:253)
    at ClientDatabaseBackend.callback (foundry.js:10216)
    at foundry.js:10186
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleUpdateEmbeddedDocuments (foundry.js:10186)
    at ClientDatabaseBackend._updateEmbeddedDocuments (foundry.js:10068)
    at async Function.updateDocuments (common/abstract/document.mjs:373)
    at async DragRulerRuler.animateEntities (modules/drag-ruler/src/foundry_imports.js:89)
    at async DragRulerRuler.moveEntities (modules/drag-ruler/src/foundry_imports.js:40)

I opened a ticket with them too: manuelVo/foundryvtt-drag-ruler#136

Marker Stays On after leaving game in the forge

version 0.7.9
I'm hosting on The Forge.

After returning to the game, the Turn Marker remains on the last highlighted token.

Steps:

  1. End a combat.
  2. Leave the game.
  3. Return to game.

Observed:
Marker remains active.

Expected:
Marker to have been "closed" or "stopped".

[BUG] Compatibility with FXMaster

Describe the bug
When using TurnMarker and FXMaster, moving to a new turn causes the weather effect to reload. On reload, weather effects vanish and re-coalesce (as though the scene were reloaded). The effect is quite jarring.

Environment Details
Foundry VTT Version: 0.6.6
Turn Marker Version: 2.6.9

To Reproduce
Steps to reproduce the behavior:
_1. Enable the Turn Marker and FXMaster modules
2. Load a scene and turn on a fog effect in FXMaster
3. Start a combat encounter and move to the next turn
4. On each new turn, the weather effect reloads

Expected behavior
The process by which the TurnMarker moves the marker token should be able to avoid triggering the weather effect reload for FXMaster.

Screenshots
Not applicable

Additional context
Not applicable

jaltepeter/TurnMarker#17

Marker out of place / misaligned

It happens rather often that the marker is aligned with the pc/npc incorrectly. Sometimes just a block while other times way of.
I think it happens more often when you have more creatures on the scene that is part of combat.

Turn Marker

Build a document for releases

After taking over the repo, I realized since it's my "first" module, there's a lot about releasing to be figured out. I've pretty much all of it figured out, but should write some docs incase other maintainers want to assist, or if eventually someone ends up taking over this project from me.

[FEATURE] On-deck marker for any characters that are on deck.

Add a marker that shows when someone is next to move.

Note that having options for announce/display filters complicates this a bit more since we can't just throw it on whoever is next on the initiative order. It's likely we can just filter by isPlayerOwned and find the next player.

Since I'm not much of an artist, it will likely reuse available tokens already. And hence needs a second selection setting.

[DEBT] Refactor updatePreview/activateListeners in SettingsForm.js

updatePreview currently breaks out the turnmarker and deckmarker previews into two functions. They are both very similar, and I did a quick copy/paste to get the functionality working at first. It will be beneficial to make these two into a function that can just accept the differing arguments for cleanliness.

activateListeners is also the same code twice more or less, and can be split into helper functions as well to reduce code complexity.

Swade support request

I'm not sure if it's possible but is there a way you can make TurnMarker work with the Savage Worlds Game System? The issue is, at the start of every combat round new initiative rolls are made in savage worlds and TurnMarker seems to automatically select the first token that was listed in the previous round as opposed to the new rounds token order.

[Feature] Turn notifications & Sounds

I really like the simplicity of this module and the fact that it has a simple purpose: to help manage who is playing, nothing else.

In order to make it even more awesome, I would like to suggest some addons.

Sound
I think it will be very useful if it would be possible to enable/disable "sounds" for different events in combat. The module could have already some defaults sounds set but it would be nice if it would be customizable (so that every group could choose their own sounds). Of course, all these settings should be configured on GM side (and maybe some on the player side too?).

I think the following sounds would be relevant:

  • Combat Starts - this one would play to everyone but only when combat starts and would replace the "round start" for the first round
  • Round start - this one would play to everyone when a new round of combat starts. IF combat start is not enabled, then it would play when 1st round starts
  • You are next - this one would only play to the owner of the actor that is next in the initiative.
  • Your turn - this would only play to owners of the actor which can play his turn now
  • Combat End - this would play to everyone once the combat ends

Overlay Notification
I think it would be helpful to get a notification to highlight what is happening in the combat. Of course, all these settings should be configured on GM side (and maybe some on the player side too?).

The idea for these notifications would be to be shown at the centre of the canvas to catch the player's attention and alert him. could be a notification that must be manually closed by the user OR it could also close automatically after X sec if the user doesn't close it.

I think the following notifications would be relevant:

  • You are next - this one would only show for the owner of the actor that is next in the initiative.
  • Your turn - this would only show to the owners of the actor which can play his turn now

There are a couple of further restrictions and customization we could suggest regarding what to show to DM and what to now sow to DM since the DM has to manage multiple monsters and may get annoying to ear sounds and notification for every single monster but, that would be also sorted with a config to enable disable certain sounds/notification for the GM controlled actors.

I think these would improve this module a lot and would make it perfect and contained (so that we don't need to install multiple different modules because, one adds notification,s the other sounds, the other chat msg, the other a token highlight, etc...

Hope it helps ๐Ÿ‘

"Cannot read property 'token' of undefined" when using an ability from a character that is not in the encounter tracker

I use the Pathfinder 1 system.

Steps to reproduce :

  • Create a monster with any attack
  • Put the monster on the scene
  • Double-click on the monster's token to open its sheet
  • Use one of its attacks
    OR
  • Create a monster with any attack
  • Put the monster on the scene
  • Right click on the monster's token
  • Use one of its attacks from its quickbar under the token

Do NOT add the monster to the encounter tracker.

=> On the console, this error is displayed :

Uncaught (in promise) TypeError: Cannot read property 'token' of undefined
    at turnmarker.js:56
    at Function._call (foundry.js:2496)
    at Function.call (foundry.js:2481)
    at foundry.js:29991
    at Array.reduce (<anonymous>)
    at Scene.updateEmbeddedEntity (foundry.js:29978)
    at Token.update (foundry.js:11475)
    at ActorPF.updateEmbeddedEntity (foundry.js:31318)
    at ActorPF.PatchCore.ActorTokenHelpers.updateEmbeddedEntity (patch-core.js:199)
    at ItemPF.update (foundry.js:32513)

This error will also break the attack's calculation if you use the dialogue that appears when you use the attack to change some values.

Expected behaviour : I should be able to use a monster's attack even if it is not in the encounter tracker without breaking my roll's calculation

Update splash Screen

Splash screen is part of the release process, and needs to be updated with every release.

[DEBT] Refactor all getter/setters for Settings

settings.js and settingsForm.js use a lot of getter/setters for settings that could probably be shared between Turnmarker and Deckmarker.

I've already refactored a few when adding the original feature, but there are a few more to do, and this is a good first issue for anyone who wants to get into Foundry modding.

Good examples include Settings.setImage(), Settings.setIsEnabled().

[BUG] Marker not changing on new Turn (Savage Worlds)

version 0.7.9
SWADE version 0.16.2

When the turn cycles (either by selecting "next" on last combatant or selecting "next turn"), the marker remains on the last combatant. It doesn't switch to the new order. I believe this is due to how SWADE does initiative (there's a pause while it draws cards and then sets order...).

Steps:

  1. Start combat --> marker highlights first combatant
  2. Cycle through all combatants.
  3. Select "next" combatant or "next turn" arrow.
  4. Observe: New initiative cards are drawn, then oder is set based on draw.

Observed:
Marker remains on last combatant.

Expected:
Marker to switch to combatant at top of the list.

[BUG] Start marker visibility issues

Start marker is still showing visible even when the controlled token cannot see the unit starting.

Reproduced by controlling a PC (in a client browser), then switching turns to a NPC in GM browser, and a start marker will be seen.

image

[BUG/UPDATE] Support Foundry 0.8.x

TurnMarker doesn't work in Foundry 0.8.5.

I did spend a little time to see if I could quickly update it, but it looks like it might end up being a little complicated.

If you want it as a starting point, here's my initial work towards this:
https://github.com/illandril/TurnMarker-alt/tree/08x-test

This manages to fix a lot of the errors and deprecation warnings... unfortunately, the turn marker doesn't update at all so I either missed something or broke something along the way, and I don't have the time to continue this effort.

[BUG] Invalid BaseTexture

When logging in as a player, custom Turn Marker images are replaced by warning signs and I get the following errors in the Console:

Error: The requested texture icons/target-origin.svg could not be loaded: Invalid BaseTexture
    loadTexture http://localhost:30000/scripts/foundry.js:36234
foundry.js:36238:13

Error: The requested texture icons/target-current.svg could not be loaded: Invalid BaseTexture
    loadTexture http://localhost:30000/scripts/foundry.js:36234

They work fine as a GM.

[Error message] User "Name" lacks permission to update scene "Scene_id"

Following the most recent update of the dnd5e system my players get error messages when other players are added to combat trackers that they do not belong to. The error messages are as in the title. This seems to be a TurnMarker fault as the error appears only when TurnMarker is activated (even alone) and disappears when deactivated.

[BUG] Marker Scaling for Non-Square Tokens

When the turn marker is applied to rectangular tokens it scales into an awkward oval that wobbles as it rotates. The starting marker is also scaled oddly if it is enabled.

Oval Marker

Versions

Foundry VTT: 0.7.9
Turn Marker: 2.7.3

To Recreate

  1. Set the Width or Height for a token's image to be different values
  2. Enable that marker's turn in combat

My Suggestion

It would be nice if the turn marker remained a circle no matter the dimensions of the token, with a diameter of either the shortest or longest edge of the token (maybe configurable in options, but probably just whichever looks nicest when tested).

[FEATURE] Need new markers for on deck markers.

#29 will introduce on deck markers. As of now, I've simply shifted the index, so on deck markers will use the same set, but off by one. It would be ideal if someone could make an on deck marker since I'm not much of an artist myself.

I believe the only requirements for these markers are that they're 1:1 ratio so they will fit the squares and resize well.

Full /src/ directory included in Released Zip

Full /src/ directory included in Released Zip, causing the module to appear as if it is multiple modules (one at the root of the zip, as is proper, an additional one inside the /src/ folder.

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.