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

[BUG] - scaleToObject does not play well with JSON crosshairs #320

Closed MrVauxs closed 2 weeks ago

MrVauxs commented 2 weeks ago

Describe the bug When turning a crosshair to JSON (most commonly for sending thru a socket), some data seems to be lost that is integral to making .effect()s scale properly. When used in conjunction with scaleToObject, the JSON version of the Crosshair Template, the effect becomes flattened.

To Reproduce

const crosshair = await Sequencer.Crosshair.show()

new Sequence()
  //.addNamedLocation("test", crosshair)
   .addNamedLocation("test", JSON.parse(JSON.stringify(crosshair))) // Same with .toJSON()
  .effect()
    .atLocation("test")
    .scaleToObject()
    .file("jb2a.portals.horizontal.ring.blue")
  .play()

Expected behavior Same behavior as with a normal crosshair that has not been turned into JSON.

https://github.com/user-attachments/assets/5b97168a-2872-42ac-9f33-f3c4ad199bcd

Haxxer commented 2 weeks ago

Use crosshair.document.getOrientation() to get a json data compliant with Sequencer positional data