GithubHelp home page GithubHelp logo

warpgate's Introduction


I am unable to continue development on Warp Gate and have been in denial about this fact for too long now. Warp Gate was and always will be my love letter to FoundryVTT -- the powerful platform, the amazing staff, and the truly remarkable community.

To everyone who has had a better Foundry experience due to this module, thank you.

To everyone who has supported this module's development through feature requests, bug reports, and pull requests, thank you.

To everyone who has taken this library module and built amazing things with it, thank you.

To the entire FoundryVTT community, thank you.

This module, and the community support behind it, has played no small part in allowing me to follow my passions and bring content from phenomenal creators to the Foundry platform. I am forever grateful.



GitHub all releases GitHub release (latest by date)

Reinforcements have arrived

Warp Gate is a system-agnostic library module for Foundry VTT that provides a growing number of API functions to make programmatically spawning tokens and modifying those tokens easier for players and GMs alike. Usable both directly via client Macros and as a dependency for other modules to build and expand upon.

warpgate_demo.mp4

Quick Links

Special Thanks

  • siliconsaint for the inspiration to turn a set of absurd macros into something usable and constantly pushing the envelope.
  • LorduFreeman for the pre and post callbacks and immediately using it for beautiful things.
  • Wasp for pushing me to make Crosshairs more full featured.
  • Arbron for the initial v9+v10 conversion updates.
  • Mr. Vaux for stretching warpgate's malleability to its limit.
  • Devioushearts for the wonderful branding badges.

Bundled with care by
built with Badger Den

warpgate's People

Contributors

barrientosjesus avatar bloy avatar brothersharper avatar daft-develop avatar dmrickey avatar haxxer avatar mrvauxs avatar razortide avatar trioderegion avatar txm3278 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

warpgate's Issues

Collision with DF QoL

Ratzing โ€”
okay so those are the options in DF QoL that make warpgate-spawned tokens leave those leftover templates.
image

Highlighted templates or just the highlighted that cannot be removed easily are a product of this collision, as seen here
image

Add setting to optionally allow modules to override the "Always accept mutation requests setting"

Modules that make use of Warpgate's mutation system to apply changes to unowned actors currently prompt the same mutation request as macros using the system. As such a GM either has to automatically accept all mutation requests from both macros and modules, or manually click through both of them even if they would like to only automatically allow requests send by modules (or vice versa).
As such an additional setting to only automatically accept requests from modules would be desirable.

Remove reliance on '_id' field for create/delete

Assuming that a valid id in the update data implies a create/delete is erroneous and blocks the use of this otherwise coherent update:

const scimitarId = token.actor.items.getName("Scimitar").id;

const updates = {
    embedded: {
        Item: {
            [scimitarId]: {name: "HAH!"}
        }
    }
}

await warpgate.mutate(token.document, updates, {}, {comparisonKeys: {Item: '_id'}})

The item is correctly updated, but the delta creation (for revert) is interpretting this as a DELETE operation. Find a better way to differentiate an existing from non-existing item for shorthand update logic.

Config option for non-resizeable targeting

For example, if I'm using Crosshairs to select a specific square on the grid, or am casting a fireball, those are fixed sizes so it would be nice to turn off template resizing. Maybe something like { fixed: true } where it defaults to false. Or maybed fixedSize or something like that

[Feature Request] - suppress mutation notifications

I'd like there to be an option to be able to suppress mutation notifications. Adding a property to the options input seems like a good way to do it. Possibly also an overall world setting as well to supply a global default (personally I like world settings so I can set things up so my players don't have to worry about it or see more info than they know what to do with).

Specifically I only care about hiding successes, I believe that if I tell "the thing" to do something and the thing "doesn't tell me it failed" that's enough for me. So success notifications are just white noise for me.

Detect incorrect player permissions and warn

warpgate requires several permissions that are not default for "Player" level accounts.

  • create tokens and configure tokens

Detect if a user lacks these permissions and gracefully exit and warn.

Reverting mutations fails on flags that did not exist prior.

I ran into the following issue while making a mutation on a (linked) actor in D&D 5e:

  • The mutation sets an actor's token.actor.data.flags.dnd5e.weaponCriticalThreshold flag to, e.g., 19, but then does not revert properly.
  • The flag does not exist prior to the mutation (defaulting to 20).
  • It stays 19 after reverting.

If the flag exists (set to 20) prior to the mutation, everything works as intended.

Expand dialog helpers to accept `render`

Render allows a callback to be execute on render. Helpful for modifying the dialog in arbitrary ways.

example (from Freeze):

new Dialog({
    title: "Morph",
    content: "",
    buttons: {
        "humanoid": {
            label: "Humanoid Shape",
            callback: async () => {
                animate(humanName);
            }
        },
        "hybrid": {
            label: "Hybrid Shape",
            callback: async () => {
                animate();
            }
        },
        "beast": {
            label: "Beast Shape",
            callback: async () => {
                animate(beastName);
            }
        }
    },
    render: listeners
}).render(true);

The Arcane Hand script in the wiki no longer works

If you run the Arcane hand script (either the basic or advanced version) in the wiki, it gives errors:

logger.js:35 Warp Gate | ERROR |  Item Add data missing 'type' field. Was this supposed to be an Update instead? Double-check comparison keys and Item identifier.

Allow for batch mutation requests

If one wishes to apply the same mutation to multiple tokens they currently have to loop over each token, passing the request to warpgate and then continuing with the next. This causes multiple mutation request popups the GM has to accept. Adding a batchMutate function that allows passing of an array of token documents to apply the same mutation to would not only remove the nessecity of a loop but also potentially allow warpgate to only display a single mutation request message for all passed token documents, something that may be desirable should one not wish to automatically accept all mutation requests as per the warpgate setting.

[DOCUMENTATION] Wrong signature in the documentation

Hello,

Tried the new features. That's awesome!!
For buttonDialog, example in the documentation doesn't work.

Made it working by passing:
const data = {buttons: [{label: 'First Choice', value: {token {name: 'First'}}, {label: 'Second Choice', value: {token: {name: 'Second'}}}]} (was also missing two quotes in the example)

Support mousewheel rotations on placement

To give an initial rotation to the spawned token.

Crosshairs carries the prototoken data. I should be able to update it with a mousewheel event to set its initial rotation value. Be sure to mirror these rotations on the control icon as well.

More crosshairs icon controls

In lieu of #22, provide a way to further customize how the center icon is displayed.

Offset from center, size, background color (or no background). This could be used to emulate a line or square template by using an empty icon box or an arrow icon, respectively.

Possible bug

I'm not 100% sure this is caused by warpgate, but culprit is pointing towards it so I'll post it here.
It seems warpgate is throwing this error:
image

It is thrown when reloading a page with an animated tile.

Allow more crosshairs shapes

Consider expanding crosshairs to support more shapes -- squares and lines are a good start.

Many issues to consider when doing this -- this is LOW PRIORITY.

[Feature request] Multiple tokens at once

Hello,

When a character is using "Summon animals" or "Dancing lights" in 5e, they have to place multiple tokens.
Maybe this can be implemented in warpgate? Click once, place the first token, click another time and place the second token, and so on.
Right click and skip the current token to be placed on the canvas.

Ability to modify/customize crosshairs

Consider a callback function for crosshairs.show similar to spawn and mutate callbacks

Identify the temporary template in canvas.templates.preview such that it can be grabbed with getChildAt or getChildByName

Expand utilities for working with warpgate data

Currently checking if a given mutation exists is possibly by digging through the flags, but it would be handy to be able to quickly do a boolean check by name (or set of names)

Something like warpgate.hasMutation(document, mutationName = "removeMe") which returns boolean would be useful for cases where you want to revert a specific mutation by name if it exists.

Alternative: an option to suppress errors and return early when calling revert with a name that doesn't exist ({silent:true} or something).

Error on opening actor sheet if there is no token for the actor

On opening an actor sheet for an actor without a token, the following error happens:
image

No obvious symptom here other than the console error (though I presume if I had any mutations I wouldn't get the revert button - doing setup for game so don't have the time to deep dive debug it)

v9 compatibility

Token permissions update. Put permissions in actorData instead of on the actor. Leave legacy support in place.

Example:

const a = game.actors.getName("Acolyte"); // An actor I don't have ownership of
const td = await a.getTokenData({
  x: 1000, 
  y: 1000, 
  "actorData.permission": {[game.user.id]: CONST.DOCUMENT_PERMISSION_LEVELS.OWNER} // Assigning myself permission
});
await TokenDocument.create(td, {parent: canvas.scene}); // Creating an unlinked token that I own

Placement event fires twice

Remove second notification of placement, so that a single notification is always sent regardless of cancel state.

Revert/Dismiss Header Button Enhancements

WIth mutation requests opening up the landscape for non-GM users, a setting option to invert the shift-click behavior for the character sheet revert button would be nice to allow players to revert specific changes more easily.

[BUG] Conflict with system DND35 and the 'mutate' function

After some tests I can confirm there is some strange behaviour when call the mutate function on the system DND35.
For some strange reason the token is been update again with the actor data after the mutation.

dd

unfortunately I do not know the system very well and I have not been able to enter into detail about the origin of the problem.
What I can say is that with PF2E and DND5E I have not replicated the problem with the same code.

More crosshairs drawing controls (infill)

Relevant code in crosshairs that controls the color drawn inside the template borders:

    // Draw the Template outline
    this.template.clear()
      .lineStyle(this._borderThickness, this.borderColor, this.drawOutline ? 0.75 : 0)
      .beginFill(0x0000FF, 1); <---

    // Fill Color or Texture
    if ( this.texture ) this.template.beginTextureFill({
      texture: this.texture
    });
    else this.template.beginFill(0x0000FF, 1); <---

Allow these two values (color and alpha) to be passed in as part of the crosshairs config.

[BUG] Error with duplicates

Hello,

I have an error with duplicates.

When I run this:

await warpgate.spawn(
        'Dancing Lights',
        {token: {name: `${item.data.name} (${actor.data.name})`}},
        {},
        {duplicates: 4}
    )

I get this error:
image
I'm using a lot of module wrapping methods with LibWrapper.

Ran the same script without all the modules and without LibWrapper, got this error:
image

Sanity check known bad or dangerous mutations

Expand "type field missing, was this an update?" to be more explicit (include name or comparison key used, etc).

Additionally, allow for the following checks (will expand as developed):

  • Any update containing flags.warpgate.mutate should throw a console warning about recursive mutation stacks. Add update option to suppress this warning for when you are purposefully getting weird.
  • Any excessively large (tbd) updates. Eg. do you really need a single mutation half the size of the whole actor? For polymorphers...yes, actually.
  • Excessively large (tbd) mutation stack lengths. E.g. do you really need 30 mutations?

Forced crosshairs placement

Interval = 1 will lock to grid intersections, but there is no way to lock to grid centers.

Consider either a special interval option, or a x/y offset as part of the crosshairs config.

For example: interval = 1, x offset = y offset = gridsize/2. Should lock the crosshairs to the center.

Module not loading properly

Hi,

When launching a world the following error occurs:
Warpgate error

The module is installed here: /var/www/vhosts/dnd/foundry_vtt/data/Data/modules/warpgate

Thank you.

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.