fvtt-fria-ligan / twilight2000-foundry-vtt

Official Foundry VTT game system for the Twilight: 2000 (4th Edition) roleplaying game (Free League Publishing)
https://foundryvtt.com/packages/t2k4e
GNU General Public License v3.0
25 stars 9 forks source link

New Initiative card system not supporting Combat Awareness #133

Closed tinwe closed 4 months ago

tinwe commented 1 year ago

Describe the bug

Players with the Speciality "Combat Awareness - When drawing initiative, you may draw two cards instead of one and choose which one to act on." will not get the option to pick two cards when drawing intiative cards with the new card system.

Reproduction

Create a character with the speciality "Combat Awareness". Enter combat mode. "Roll initiative" for everyone. The characters with "Combat Awareness" will get one card as everyone and there is no way for them to pick another card and select what to use.

System Info

Several different player clients, mostly Chrome, but using the latest Foundry and T2k system.
Foundry 10, build 291
Twilight: 2000 (4th edition) system: 10.2.0
Twilight: 2000 (4th edition) core set: 2.1.0
Year Zero Engine Combat: 1.0.1

Logs

No response

Priority this issue should have?

Medium (minor functional impact)

Validations

Stefouch commented 1 year ago

I reproduced your steps but did not achieve to find the issue.

Note: Page 51 of the Player's Manual: Combat Awareness When drawing initiative (...), you may draw two cards instead of one and choose which one to act on.

Combat Awareness allows the player to draw an extra initiative card, choose one for their initiative turn, and discard the others.

If you don't have a card selection dialog when you draw initiative for everyone, maybe the settings are set to automatic (take the best). Verify in your settings that this option is not checked:

image

tinwe commented 1 year ago

I tried having it activated, but still got the same result. I need to clarify that I am using the built-in button on the Foundry battle tracker, to "roll" initiative for everyone. It results in a spam of cards in the chat for every character, but no option for the player characters with the ability to draw two cards, to do so. The macros to draw initiative cards manually for each player seems to be broken since a couple releases ago, so we can no longer use those macros. It only keeps saying that there are no cards left in the deck, but the Reset initiative macro does not seem to solve the issue even though it confirms that the deck has been reset.

These are the error logs from using the macros if they help;

foundry.js:6887 Foundry VTT | Retrieved and compiled template templates/hud/dialog.html
commons.js:1703 Error: You are accessing the YearZeroCombat#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly.
    at logCompatibilityWarning (commons.js:1692:19)
    at YearZeroCombat._logV10CompatibilityWarning (commons.js:6642:14)
    at get data [as data] (commons.js:6542:24)
    at Object.handleCombatUpdate [as fn] (nextUp.js:330:40)
    at #call (foundry.js:724:20)
    at Hooks.callAll (foundry.js:681:17)
    at ClientDatabaseBackend.callback (foundry.js:12824:13)
    at foundry.js:12766:43
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleUpdateDocuments (foundry.js:12766:33)
    at ClientDatabaseBackend._updateDocuments (foundry.js:12639:17)
    at async YearZeroCombat.updateDocuments (commons.js:6153:23)
    at async YearZeroCombat.update (commons.js:6250:23)
logCompatibilityWarning @ commons.js:1703
reverse-initiative-order.js:6 RIO | Replacing initiative roll with input field
nextUp.js:471 Uncaught (in promise) TypeError: undefined. Cannot read properties of undefined (reading 'children')
[Detected 1 package: Next-Up]
    at NextUP.clearShadows (nextUp.js:471:43)
    at Object.handleCombatUpdate [as fn] (nextUp.js:346:20)
    at #call (foundry.js:724:20)
    at Hooks.callAll (foundry.js:681:17)
    at ClientDatabaseBackend.callback (foundry.js:12824:13)
    at foundry.js:12766:43
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleUpdateDocuments (foundry.js:12766:33)
    at ClientDatabaseBackend._updateDocuments (foundry.js:12639:17)
    at async YearZeroCombat.updateDocuments (commons.js:6153:23)
    at async YearZeroCombat.update (commons.js:6250:23)
foundry.js:6887 Foundry VTT | Retrieved and compiled template templates/app-window.html
foundry.js:59187 There are not enough cards left. Shuffling the Deck.
fetch @ foundry.js:59187
foundry.js:59187 There are no available results which can be drawn from this table.
fetch @ foundry.js:59187
VM622:80 Uncaught (in promise) TypeError: undefined. Cannot read properties of undefined (reading 'data')
[No packages detected]
    at _rollInitiative (eval at _executeScript (foundry.js:20080:16), <anonymous>:80:44)
foundry.js:5099 Foundry VTT | Rendering Dialog
foundry.js:59187 There are not enough cards left. Shuffling the Deck.
fetch @ foundry.js:59187
foundry.js:59187 There are no available results which can be drawn from this table.
fetch @ foundry.js:59187
VM631:80 Uncaught (in promise) TypeError: undefined. Cannot read properties of undefined (reading 'data')
[No packages detected]
    at _rollInitiative (eval at _executeScript (foundry.js:20080:16), <anonymous>:80:44)
Fetch event handler is recognized as no-op. No-op fetch handler may bring overhead during navigation. Consider removing the handler if possible.
Stefouch commented 1 year ago

You have a couple modules that may conflict with the Year Zero Combat (YZEC) module:

I advise to test again in a new game world with only YZEC module activated and see if you still have your errors.

In addition, the previous initiative macro is not working anymore and has been abandoned. YZEC manages the initiative deck itself.

tinwe commented 1 year ago

Sorry for that. I had already testet with and without Next Up without result, but when I deactivated Reverse Initiative Order, some new features appeared, since there was card icons next to the battle tracker, but I still recieve the same error message about "There are not enough cards left. Shuffling the Deck." when trying to click the hotkey macro supplied for players picking their own initiative, and when I try to roll initiative for everyone as a GM, there's no option to pick more cards for the players with the speciality. Are both ways to generate initiative intended to be supported or what is the prefered method? Macro or GM button on combat tracker?

This is the error message in console when the player tries the hotkey macro.

foundry.js:5099 Foundry VTT | Rendering Dialog
foundry.js:59187 There are not enough cards left. Shuffling the Deck.
fetch @ foundry.js:59187
foundry.js:59187 There are no available results which can be drawn from this table.
fetch @ foundry.js:59187
VM821:80 Uncaught (in promise) TypeError: undefined. Cannot read properties of undefined (reading 'data')
[No packages detected]
    at _rollInitiative (eval at _executeScript (foundry.js:20080:16), <anonymous>:80:44)
Fetch event handler is recognized as no-op. No-op fetch handler may bring overhead during navigation. Consider removing the handler if possible.
Stefouch commented 1 year ago

Are both ways to generate initiative intended to be supported or what is the prefered method? Macro or GM button on combat tracker?

Button in the combat tracker. If you want your player to have a choice, you need to uncheck the option cited above, and let them click the card icon themself.

The initiative macro is something else that work differently. But now it is dead, it won't work anymore.

Stefouch commented 1 year ago

See screenshot: image

tinwe commented 1 year ago

Thanks for the clarification. However, when the player with Combat Awareness ("Karl" in the image) clicks that icon before I roll initiative for everyone, he only gets one regular initiative card and no option to pick two and select one. He also can not repick another initiative card when initiative has been set.

Skärmbild 2023-05-20 190119

The same goes if I as a GM roll initiative for everyone, "Karl" is not able to repick initiative, when initiative has been set for him.

Skärmbild 2023-05-20 190034

Stefouch commented 1 year ago

Is this setting correct in your world (case sensitive) ? image

tinwe commented 1 year ago

No, that field was blank by default. I've added "system.drawSize" to that field, but the problem persists, with the player not being able to pick more initiative cards.

Stefouch commented 1 year ago

image

I am sorry I cannot reproduce your issue.

When I prepare a character with a +1 Combat Awareness modifier, and put it in combat, I get the choice between two cards when I hit the button "Draw Initiative" next to the combatant in the sidebar (the white icon with four cards).

tinwe commented 1 year ago

I never get that dialogue option. Neither as the GM nor the players themselves. How should we go around to pick initiative cards correctly? Should the players themselves click the four cards-button? Should I click it as the GM? Should I click any of the "Roll initiative for all" buttons? Should I just click "Start" combat to autoroll initiative? What is the best and recommended practice for the module? Any roll or click only results in a two digit iniative result, but no cards except those presented in chat.

Skärmbild 2023-07-20 143343 Skärmbild 2023-07-20 143255

All modules except T2k, Dice So Nice, Swedish and Year Zero Engine: Combat has been disabled.

The macro buttons to pick initiative cards doesn't seem to work no more. They always result in an error message claiming that there are no cards left in the deck;

foundry.js:68000:78 Uncaught (in promise) TypeError: results[0] is undefined _rollInitiative https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:80 callback https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:130 submit https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:64942 _onClickButton https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:64870 jQuery 9 activateListeners https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:64842 _render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5815 render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5742 cardDialog https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:137 prepareCombatant https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:104 anonymous https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:141

executeScript https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:22757

execute https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:22705
_onClickMacro https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:78292
jQuery 9
activateListeners https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:78211
_render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5815
render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5742
initializeUI https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:8840
setupGame https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:8694
_initializeGameView https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:9957
_initializeView https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:9933
initialize https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:8619
async* https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:90908
async* https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:90884

foundry.js line 22753 > AsyncFunction:80:3 _rollInitiative https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:83 InterpretGeneratorResume self-hosted:1455 AsyncFunctionNext self-hosted:852 (Async: async) callback https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:130 submit https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:64942 _onClickButton https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:64870 jQuery 9 activateListeners https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:64842 _render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5815 AsyncFunctionNext self-hosted:852 (Async: async) render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5742 cardDialog https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:137 prepareCombatant https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:104 anonymous https://xxxxx.eu.forge-vtt.com/scripts/foundry.js line 22753 > AsyncFunction:141

executeScript https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:22757

execute https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:22705
_onClickMacro https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:78292
jQuery 9
activateListeners https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:78211
_render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5815
AsyncFunctionNext self-hosted:852
(Async: async)
render https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:5742
initializeUI https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:8840
setupGame https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:8694
InterpretGeneratorResume self-hosted:1455
AsyncFunctionNext self-hosted:852
(Async: async)
_initializeGameView https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:9957
_initializeView https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:9933
initialize https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:8619
InterpretGeneratorResume self-hosted:1455
AsyncFunctionNext self-hosted:852
(Async: async)
<anonym> https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:90908
InterpretGeneratorResume self-hosted:1455
AsyncFunctionNext self-hosted:852
(Async: async)
<anonym> https://xxxxx.eu.forge-vtt.com/scripts/foundry.js:90884

Foundry v11 build 305 T2k v 11.0.0 Year Zero Combat 1.0.1

Stefouch commented 1 year ago

The macro buttons to pick initiative cards doesn't seem to work no more. They always result in an error message claiming that there are no cards left in the deck;

That macro is deprecated and does not work anymore. It should be removed.

tinwe commented 1 year ago

Sorry for the macro error logs. Have had this issue opened for too long, that I forgot that you already answered that question. But what would you say is best practice? The intended way to pick initiative cards in v11 of the T2k module?

tinwe commented 1 year ago

Could it be a Forge issue when the game is hosted on Forge?

Stefouch commented 1 year ago

Sorry for the macro error logs. Have had this issue opened for too long, that I forgot that you already answered that question. But what would you say is best practice? The intended way to pick initiative cards in v11 of the T2k module?

Your players or yourself have to use the Foundry way: click the draw init button (with the Year Zero Combat module) image

The macro does not work anymore due to a breaking change made by Foundry in V10 or V11 (can't remember which one). I did not fix it because Year Zero Combat replaces it.

tinwe commented 1 year ago

We have tried clicking that icon and it produces a chat message with the initiative card drawn as well as the corresponding initiative number in the battle tracker. No dialogue for selecting multiple cards, like the macro used to question. No error messages in console either, but these log messages;

Foundry VTT | Created 2 Card documents with ids: [O98Tv1kqxHCmWBGT,PsI8lHnu0OA3tync] in parent Cards [AmspMHbXiVlMqxhR] commons.js:8711:20 Foundry VTT | Created ChatMessage with id [ZWvI83kwhots4ESa] commons.js:8711:20 Foundry VTT | Unloading audio element - modules/yze-combat/assets/sounds/card-flip.wav foundry.js:91850:13

I've disabled all other modules except All modules except Forge, T2k, Dice So Nice, Swedish and Year Zero Engine: Combat. Is this a Forge or Swedish issue then or what is causing it?

Stefouch commented 1 year ago

Is this a Forge or Swedish issue then or what is causing it?

I don't think so. No error is thrown.

From the log you shared, two init cards are drawn. But you only see one.

Can you send a screenshot of your Year Zero Engine: Combat settings ?