crnormand / gurps

Implementing a GURPS 4e game aid for Foundry VTT
MIT License
105 stars 49 forks source link

Additional resource trackers are gone #1093

Closed Farmeroz closed 2 years ago

Farmeroz commented 2 years ago

I had a token with borked resource tracking showing on the character sheet. So I deleted the actor and the token and recreated and now there are no additional resource trackers available in the Full GCS, the Editor, the Combat, or the Tabbed. Just the HP and FP. Other tokens that still had additional resource trackers still have them, but new ones can't add them.

So instead of seeing what's shown and described at https://docs.google.com/document/d/1NMBPt9KhA9aGG1_kZxyk8ncuOKhz9Z6o7vPS8JcjdWc/edit#heading=h.8rmvjb8diyx2 I have just the HP and HP.

Farmeroz commented 2 years ago

Using the Tabbed sheet, for example, tokens with previously existing resources trackers are shown under the Reactions section when you're on "Stats". The new tokens go straight to "notes" under Reactions.

mjeffw commented 2 years ago

I no longer default to 4 trackers. By default there are none. To add one go to the editor sheet. There should be a header for the trackers ("Resource Trackers") with a plus ("+"). Click the plus to add a tracker.

Farmeroz commented 2 years ago

OK - thanks, Jeff - I found it - all good!

Farmeroz commented 2 years ago

Sorry, Jeff - that's all good, but a related question:

We are using Threshold magic which requires the tracked value to increase every time it's used. That works manually, of course, and I thought if I ticked Damage Tracker then applying points to the tracker would increase it instead of decrease it, but when using the "fireball" macro, it doesn't do that (ticked or unticked it just decreases the current value).

function fireballDamage(energy) {
 GURPS.executeOTF(`/r [${energy}d burn *Cost ${energy}TR(Threshold)]`)
}

new Dialog({
  title: `Fireball Damage`,
  content: `<div><label for="energy">Energy</label><input id="energy" type="text" /></div>`,
  buttons: {
    confirm: {
      label: "Confirm",
      callback: async (html) => fireballDamage(html.find('#energy').val())
    }
  }
}).render(true);

Is there a way to adjust this so it will increase the tracker?

crnormand commented 2 years ago

You could separate the commands into a damage roll, and then a chat command to increase the resource tracker:

function fireballDamage(energy) {
 GURPS.executeOTF(`/r [${energy}d burn]`)
 GURPS.executeOTF(`/tr(Threshold) +1`)
}
mjeffw commented 2 years ago

There's a checkbox on the tracker editor that says something like "track as damage (points are added)". Checking that box will change the behavior to what you need.

Farmeroz commented 2 years ago

Jeff - yep, I tried that, but it makes no difference when using the script above - it still reduces the tracker value. Is that because it's not coming in via the damage pop up and just through a direct call?

Chris - thanks. If I want to use a variable like $energy instead of just +1, is it just a matter of something like

GURPS.executeOTF(/tr(Threshold) +[${energy}])

With the + to make it add the value rather than (presumably) it being a negative value?

Farmeroz commented 2 years ago

Hi guys - the use of the "Damage Tracker" still has no impact on anything.

However, I ended up using:

function fireballDamage(energy) {
 GURPS.executeOTF(`/r [${energy}d burn]`)
 GURPS.executeOTF(`/tr(Threshold) +${energy}`)
}

And that works perfectly - adding the right level of Threshold based on the energy cost to cast.

Now all I really need to do is be able to check the level of a related spell to see whether the energy cost to cast should be reduced (for example, skill 15 gives a -1 to cost to cast and a crit is usually given as a free cast - but that can be manually returned).

Farmeroz commented 2 years ago

All working great now, and spell level check also provided in #1094