kandashi / Active-Token-Lighting

MIT License
23 stars 25 forks source link

Prototype token settings override token settings #127

Closed tposney closed 1 year ago

tposney commented 1 year ago

By copying the prototype token settings (in applyEffects)

const originals = entity.prototypeToken;

Any token specific changes are lost, including for example the token img, vision settings etc and reset to the prototype token.

I can't think of a solution to the issue, since there is no other place to look for base unchanged values for tokens when the changes are committed to the database. Perhaps the orignals copied should be limited to just the things that ATL modifies to avoid other overwrites.

It should probably be a note in the readme since it confused me when I discovered it.

Kharmans commented 1 year ago

Yeah, this happen to me too. I can't configure, for example, an AE to give See Invisibility of 10 ft to a player, because it will reset the vision of that player. So, if he have 100 ft of Darkvision, it just became 0.

I came here just to post this, but you already do it.

tposney commented 1 year ago

For player characters (i.e. linked tokens) it's an okay workaround to modify the prototype token to have darkvision 100ft and readd the token to the scene since the prototype token refers only to the player's actor and will revert correctly when the effect is removed.

For the case you mention, ATL.detectionModes.seeInvisibility.range UPGRADE 10 should do what you want, leave darkvision unaffected but let you see invisible out to 10 feet. When the effect is removed it will go back to whatever is set on the prorotype token - if you make sure to set the prototype token to the right settings all will be good.

Kharmans commented 1 year ago

Yeah, I did that and work. Thanks!

dineshm72 commented 1 year ago

My guess is this is probably the same issue as these: https://github.com/kandashi/Active-Token-Lighting/issues/120 https://github.com/kandashi/Active-Token-Lighting/issues/122 https://github.com/kandashi/Active-Token-Lighting/pull/109 https://github.com/kandashi/Active-Token-Lighting/issues/107

kaelad02 commented 1 year ago

I've got an preview release of a version that changes how ATE works and it no longer uses the prototype token. It saves the old values to a flag on the token if it changes something to a new value. Then when that active effect is disabled/deleted it will use the value stored in the flag to restore the token back to its original state. It also cleans up the flag's value so if it's changed manually and the active effect is toggled on/off, it restores it back to that manual change.

https://github.com/kaelad02/Active-Token-Lighting/releases/download/v0.6.0-alpha1/module.json

If you have the time, I wouldn't mind a little extra testing before I merge it. Thanks.

tposney commented 1 year ago

Am happy to help, but currently sick in COVID hotel quarantine until April 5th, so after that

On Sat, Apr 1, 2023, 08:58 Chris Seieroe @.***> wrote:

I've got an preview release of a version that changes how ATE works and it no longer uses the prototype token. It saves the old values to a flag on the token if it changes something to a new value. Then when that active effect is disabled/deleted it will use the value stored in the flag to restore the token back to its original state. It also cleans up the flag's value so if it's changed manually and the active effect is toggled on/off, it restores it back to that manual change.

https://github.com/kaelad02/Active-Token-Lighting/releases/download/v0.6.0-alpha1/module.json

If you have the time, I wouldn't mind a little extra testing before I merge it. Thanks.

— Reply to this email directly, view it on GitHub https://github.com/kandashi/Active-Token-Lighting/issues/127#issuecomment-1492530713, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCHH7YTET633OTY6I7NSV3W64ZMZANCNFSM6AAAAAAUUUT32Y . You are receiving this because you authored the thread.Message ID: @.***>

jboyle1013 commented 1 year ago

@kaelad02 I haven't done any super rigorous testing with it, but your version, unlike the current release does appear to work with both wildcard images and the module "All goblins have names" and doesnt reset the randomly generated image or name.