fantasycalendar / FoundryVTT-Sequencer

This module implements a basic pipeline that can be used for managing the flow of a set of functions, effects, sounds, and macros.
Other
47 stars 25 forks source link

[REQUEST] - Database support for hit timestamps #154

Closed ZotyDev closed 1 year ago

ZotyDev commented 1 year ago

Currently, almost all databases have assets with variations (dagger.01, dagger.02, etc) and some of them have the weapon/spell impact on different times, lets say we have two animations under dagger, 01 and 02, first one is a stab, second one is a slash, 01 will be shorter and end earlier, while 02 will be longer. Now we have a big difference for them, if I want to make a effect that happens exactly at the time that the weapon strikes, how should I do that? Currently there is no way.

This is a good example, as the halberd from JB2A have this behavior of having different impact times for the variations: A elegant solution would be to provide asset makers with a _hitTimestamp value for the database. such as:

halberd: {
        melee: {
            _hitTimestamp: [
                [1250],
                [1250],
                [1250, 1350],
                [1250],
                [1250]
            ],
            _template: 'melee',
            '01': {
                dark_orangepurple: [
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_01_Dark_OrangePurple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_02_Dark_OrangePurple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_03_Dark_OrangePurple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_04_Dark_OrangePurple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_05_Dark_OrangePurple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_06_Dark_OrangePurple_800x600.webm'
                ],
                blue: [
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_01_Regular_Blue_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_02_Regular_Blue_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_03_Regular_Blue_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_04_Regular_Blue_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_05_Regular_Blue_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_06_Regular_Blue_800x600.webm'
                ],
                orange: [
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_01_Regular_Orange_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_02_Regular_Orange_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_03_Regular_Orange_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_04_Regular_Orange_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_05_Regular_Orange_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_06_Regular_Orange_800x600.webm'
                ],
                purple: [
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_01_Regular_Purple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_02_Regular_Purple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_03_Regular_Purple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_04_Regular_Purple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_05_Regular_Purple_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_06_Regular_Purple_800x600.webm'
                ],
                white: [
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_01_Regular_White_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_02_Regular_White_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_03_Regular_White_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_04_Regular_White_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_05_Regular_White_800x600.webm',
                    'modules/jb2a_patreon/Library/Generic/Weapon_Attacks/Melee/Halberd01_06_Regular_White_800x600.webm'
                ]
            }
        }
    }

Basically a array that contains arrays of timestamps, just in case the asset has more than 1 impact in the animation.

This is a somewhat big limitation since we cannot make effects that are exact. As the author of OIF, I cannot implement many features because of this limitation, thanks in advance, hope you add it :D

Haxxer commented 1 year ago

Added in 3.0.0