#Custom System Builder

1 messages · Page 33 of 1

formal goblet
#

I think it's this:

%{
options.explanation = false; //This removes the generated toplevel <div>-tag from the result
const items = ...; //fetch and filter items from the Actor.items-collection

const itemList = $('<ul></ul>');
items.forEach(item => itemList.append(generateItemLink(item)));

return itemList.prop('outerHTML');

function generateItemLink(item) {
  const itemBox = $('<li></li>');
  const itemLink = $('<a></a>');
  itemLink.addClass('content-link');
  itemLink.attr({
    'data-type': 'Item',
    'data-entity': 'Item',
    'data-id': item.id,
    'data-uuid': item.uuid,
    'data-tooltip': item.name ?? 'Item',
    draggable: 'true'
   });

   const itemImg = $('<img></img>');
   itemImg.attr({
     src: item.img,
     alt: `${item.name ?? 'Item'} image`,
     draggable: 'false'
   });
   itemImg.addClass('custom-system-item-container-image');

   itemLink.append(itemImg);
   itemLink.append(item.name ?? '');

   itemLink.on('click', () => {
     item.sheet?.render(true);
   });

  itemBox.append(itemLink);
  return itemBox;
}
}%

(or you use the @UUID-thing from Foundry, which converts such expressions to links. You can drag an Item to a Rich Text Editor to check the structure of that)

summer turtle
#

I'm lost as to why this isn't working:

<p>${item.damage_dice = d10 ? (roll = 10 ? 'ZEALOUS HATRED!' : ' ') : (roll = 5 ? 'ZEALOUS HATRED' : ' ')}$</p>```
What I'm after is for it to roll the dice, pulling from the item, and then to check if it's a d10 or not and to then check if the d10 or d5 are a 10 or 5 respectively and display "zealous hatred".

The roll works, and if I just use `${item.damage_dice}$` it will change between displaying d5 and d10 when making a roll if the respective radio buttons are pressed. I just can't seem to get a condition to recognise if a d5 or d10 has been selected.
#

My main clue in the console is Custom System Builder | Value expected (char 20) SyntaxError: Value expected (char 20) but again I don't know what it's telling me is wrong, I thought at this point I knew how to input all this.

empty glen
#

Thank you!

Problem is, I want it to not roll if dDT goes below 4.

summer turtle
#

Fantastic, thank you

latent wyvern
formal goblet
#
${#rollFormula:= nDT >= 4 ? concat(string(dDN), 'd', string(nDT), 'x') : '0'}$
<p>Damage: ${nDT >= 4 ? [:rollFormula:] : "Target's armor stopped all damage"}$</p> 
empty glen
formal goblet
empty glen
summer turtle
formal goblet
latent wyvern
#

As funny as that is, what they are trying to say is that = does not mean "is this equal to?" it means "becomes". == compares two values to each other to see if they are equal or not

wet heron
#

Will do!

turbid sorrel
#

Is there a way for a label button in an item container to trigger another button within that item

wet heron
#

Got this från Macro-polo, now I just need to figure it out how to implement it in CSB code

canvas.grid.measureDistance(game.user.targets.first(),token)

The method is correct, the order of arguments might not be and you definitely want to check the options for this one in the console

(in v12)

canvas.grid.measurePath([game.user.targets.first(), token]).distance;
storm stump
#

Does the Label Icon field of a Label support conditionals?

empty glen
formal goblet
empty glen
formal goblet
wet heron
#

${mag_current_1 < 1 ? 'No ammo!' : [:rollFormula:] + const distance = canvas.grid.measureDistance(game.user.targets.first(),token);,'0')}$
not working, i aint got thime to check donight

empty glen
turbid sorrel
#

I've got a text field with a formula, how can I pass that into a roll message and have it function

#

It just displays the formula itself

empty glen
ripe herald
#

Wracking my brain on this and I probably just need a second set of eyes to help me figure out what I'm doing wrong, or maybe to confirm it just isn't possible to pull the value in in this way.

I've got my "proficiencies" as items and am trying to populate a list of dropdowns with the list of relevant skills using a dummy actor/template that has all of the skills on it (as weapons can have up to three compatible proficiencies). This is what I'm trying to use to pull in the list of proficiencies from that actor sheet to populate my dropdowns:

${fetchFromActor('Proficiency Lookup Actor', "lookup('icCombatProficiencies','name')")}$

When I open the dropdown on the weapon template, there are no values populating.

On a different sheet, I'm doing a similar lookup minus the fetchFromActor - ${lookup('icSkills','name')}$ - to populate several dropdowns to allow for combined rolls of multiple proficiencies (e.g. a skill+knowledge roll, a combat skill+skill roll, a spellcasting+knowledge roll, etc.) and that loads fine. If I just do a fetchFromActor and fetch properties like 'name' or whatever off the actor, that works.

Fake Edit: I did just do a test where if I a new label column to my item container - named, say, testName and containing ${item.name}$ as the label, and then I do the lookup() against testName that works fine (per the second screenshot). That could work as a workaround, but I'm just trying to figure out if there's a cleaner way. Maybe it just doesn't work with the 'default' name column. 🙂

coarse shard
#

I'm entirely new to csb although some of scripting is bringing me back to IRC days...I'm just trying to sort out how to increase a stat after a particular dice result (explodes) on the rolling actor. I find the way the documentation is written really confusing (just a subjective mismatch - it's quite lovely documentation).
Is it possible to update a stat in an actor from the Label roll message?

coarse shard
#

Or is it that it has to trigger a macro?

latent wyvern
#

I can't seem to escape square brackets at all using the standard methods (adding a \ right before each one), is there a more proper way to do it?

formal goblet
formal goblet
formal goblet
ripe herald
latent wyvern
# formal goblet I think it's this: ```js %{ options.explanation = false; //This removes the gene...

The current problems I'm facing then is that the method of displaying items provided throws an JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 20 of the JSON data SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 20 of the JSON data error. I attempted to export the json of the item through the browser and it looked fine, although I doubt thats the object its referring to.
On the other hand, if I try to alter it to reference the items by uuid, I can't make it display because of the non-escapable brackets. (this includes replacing the concat'd strings with variable replacements)

empty glen
#

Is there a way to set the roll visibility within a roll message? I would like to make some rolls hidden to my players.

wet heron
coarse shard
woeful skiff
#

How do you remove/delete an item inside a Conditional Modifier List ?

coarse shard
#

How to make an & in conditional i.e. check a roll's value, increase a stat, but only if its not over the set maximum value?

#

I find the script increases it above max value when using setPropertyInEntity()

#

Oo..I'm realizing in the documentation you use "Max" as an actor name 🙃

#

So is there just simply a way to get the max value of a number field?

storm stump
#

If I use custom CSS in a label e.g. is there a way for that css to reference assets from the foundry server? E.g. background: url("somePath")
Whatever I try as URL doesnt seem to work. I even tried putting the image I want to reference right into the same folder as the custom css file but I cant get it to reference the Content. Web URLs work fine but I dont have a good way to host the content.

empty glen
storm stump
empty glen
storm stump
empty glen
#

@formal goblet Hey, I found these lines in the chat-enhancements.js file. I'm wondering if there is a way to pass something to roll.data from a roll message. That way I could make certain rolls blind regardless of what the user selected.

Hooks.on('renderChatMessage', (message, elt) => {
let rolls = $(elt).find('.custom-system-roll');
for (let rollElt of rolls) {
let roll = $(rollElt);
let rollMode = roll.data('roll-mode');
if (rollMode === CONST.DICE_ROLL_MODES.PRIVATE && !game.user.isGM && !message.isAuthor) {
hideRollData(roll);
}
else if (rollMode === CONST.DICE_ROLL_MODES.BLIND && !game.user.isGM) {
hideRollData(roll);
}
else if (rollMode === CONST.DICE_ROLL_MODES.SELF && !message.isAuthor) {
hideRollData(roll);
}
if (roll.data('hidden')) {
roll.addClass('custom-system-hidden-roll');
if (!(game.user.isGM && game.settings.get(game.system.id, 'showHiddenRoll'))) {
roll.hide();
}
}
}
});

keen iron
#

Is there anyone that can meet with me and help me build out a custom character sheet for the Electric State RPG? 🙏

formal goblet
empty glen
formal goblet
# empty glen I know you usually defer questions about World Scripts but do have any idea what...

I'd use a <span>-element in the Roll Message with a name, id or css-class (just something, so that we can use a selector on it) and then use something like this here to hide the content of it:

<span class="hidden-segment">${[1d20]}$</span>
Hooks.on('renderChatMessage', (message, elt) => {
  let segments = $(elt).find('.hidden-segment');
  for (let segmentElt of segments) {
    const segment = $(segmentElt);
    segment.find('span').text('?');
  }
});
empty glen
formal goblet
wet heron
#

I need some help with the code again.

I have this, and i want to incorperate the read range to target

i want the roll formula to be 1d20 + Rifles_mod_1 (this part is already done) => 10+( canvas.grid.measureDistance(game.user.targets.first(),token) / Weapon_range1 ) + GM_mod1

canvas.grid.measureDistance(game.user.targets.first(),token)

how can i do this?

${#rollFormula:= mag_current_1 < 1 ? '0' : '1d20x20'}$
${mag_current_1 < 1 ? 'No ammo!' : [:rollFormula:] + Rifles_mod_1 + first(lookup('WEAPON_SPECIALIZATION','Weapon_spec_mod', 'Weapon_spec_name', 

${mag_current_1 > 0 ? setPropertyInEntity('self', 'mag_current_1', mag_current_1 - 1) : 'Reload!'}$
#

also, is there a way for it to only show the complete roll and not avery part of the roll?

formal goblet
wet heron
keen iron
#

Is there anyone that can meet with me and help me build out a custom character sheet for the Electric State RPG? 🙏

woeful skiff
#

How do you remove/delete an item inside a Conditional Modifier List ?

formal goblet
woeful skiff
#

I see. Thanks

wet heron
wet heron
sonic vault
#

hy guys, I'm very unsure about the items

#

first a question about weapons for example.
First, how do I item rolls, would it be the same standard idea (the label roll massage)? Another thing and if I want to roll directly from the actor sheet whose item is equipped, what would I do?

#

another question in relation of item modifiers, i really don't understand from the documentation, could someone give me an example

formal goblet
# sonic vault first a question about weapons for example. First, how do I item rolls, would i...
  • It's the same for Actors, yeah
  • You need to set up an Item Container, which should show your Weapons. You are able to create additional columns in Item Containers, which can display additional information apart from the Item name. The additional columns are Label-Components, so you can also setup Rolls in there. Just keep in mind, that you need to use the item.-prefix to use the properties of an item. ${name}$ and ${item.name}$ return different results, so try that out
sonic vault
#

another thing if inside the item sheet I need to call something of the actor it is fixed to, it would be "actor.something"

formal goblet
# sonic vault another question in relation of item modifiers, i really don't understand from t...

Item Modifiers are used to modify values within a Label within an Actor. These modifiers have 4 important configuration fields:

  • Priority: Sets the order, in which modifiers are applied (from 0 [first] -> Infinity [last])
  • Key: This needs to be the component key of a Label within an Actor
  • Operator: The operation of the modification. If it's e.g. +, then it will do oldValue + modifier
  • Formula: The value of the modifier. This can be a Formula. It will be computed with the properties of the Item (not Actor)

Example would be Inventory-Items, which modify the TotalWeight-Label in your Actor

formal goblet
sonic vault
#

?

formal goblet
sonic vault
#

lol, so much simple, thanks :))), i will try

#

worked

sonic vault
#

My system has some attribute buff skills, I'm making skills items, how would I do this automatically? (my attributes are number fields)
for example one skill buffs all my atributes in one (+1 in strengh, dexterity etc).

The automation I'm looking for would be when using the skill, the attributes would be changed, and then (due to some trigger, or simply because the skill was deactivated) the attributes return to normal

#

How would I do this with attributes that are number field

formal goblet
sonic vault
#

I imagined

#

One way to get around this would be for all inputs to actually be bonuses for a label

half beacon
#

Is it possible to make a color picker? I'd like to use it so my players can choose the background color for their character sheets

formal goblet
half beacon
#

Nope! If it's complex, I'll avoid it.

formal goblet
#

Well, CSB doesn't have a color picker, so you'd need your own one. And also a possibility to change the CSS dynamically

formal goblet
half beacon
#

Interesting... I'll experiment with that

latent wyvern
#

I've been having problems trying to change the values of hidden properties. Say I have a hidden prop called sta with a formula of 20 (or even ${20}$ which I've also tried). I then have a label that displays it (${sta}$), and a button that changes it ${sta = 5}$. The value won't change, am I missing something?

half beacon
#

If you want to change the value of a label, you should use setPropertyInEntity() instead

latent wyvern
#

Ah!

formal goblet
latent wyvern
#

Oh that makes things leagues better

sonic vault
#

morning guys, How do I do items stack? like a potion for example, a character have 3 of that

#

I think items would have a quantity property

#

forget

#

It's simply having the quantity as a property, bringing it to the container item, and if you get more of the same item it just increases that quantity

half beacon
# latent wyvern Oh that makes things leagues better

Martin is right. If it's a hidden attribute, you can't exactly change it way. It'll revert when the sheet is reloaded. If it's an input component with limited visibility, setPropertyInEntity() should work as intended.

latent wyvern
#

Whats the best way to create a backup of the system we are creating? Most of my experience is with git, but it seems odd to create a backup of the entire world

#

"creating a system" is a stretch but

storm stump
#

I have a item container with items that call a macro. That macro changes a property in the item (by passing linkedEntity to the macro). The property changes value but the Label that displays that value doesn't update until I open that item. How can I refresh the item?

daring thunder
#

Hi there, how do I reference a drop down’s selected option? If I reference the drop-down it doesn’t return the option selected weirdly

formal goblet
daring thunder
#

Hmm I’ll try again later and send what I have in here if I’m still stuck

half beacon
formal goblet
storm stump
#

The macro just sets the property using: scope.item.system.props.p_uses = newUses; where item is the linkedEntity passed to the macro which sounds like is not the correct way? Or are you suggesting using await macro.execute(...)?

formal goblet
storm stump
#

Gonna check it out rn, tysm!

sonic vault
#

Hi guys, the actor sheet of my system has five item container:
holster <literally for fast access of items>;
The body equipment <things equipped on character body, like armors, accessories>;
Bag <all items can be place, but they will only be stored, that is, they have no effect while they are there>;
Equiped skills <skills that are equipped and can be used> ;
Not equipped skills <They are basically just stored and cannot be used>

knowing this, I have two doubts, firstly I am having a problem, I add a item on one item container and this appears on all item containers

formal goblet
sonic vault
#

and my other doubt is in relation to a condition, like while a skill is in the disabled skills container it will have no effect (modifiers for example)

sonic vault
#

But what if I have the same item, which can be placed in more than one item container, like a sword that can be equipped either in the holster for quick access, or in the backpack

formal goblet
sonic vault
#

aaa

#

like "equiped [X]"

formal goblet
broken sleet
#

Hello does this system work in V12?

formal goblet
broken sleet
#

Sad

storm stump
#

Not quite in the loop but sounds like v12 made lots of changes?

formal goblet
#

Application V2 and the Roll API are the new things

storm stump
#

Is there a way to disable/hide custom css in the template? It's getting a little hard to manage

half beacon
#

If I recall, it's
._template if you only want to affect the template
.character for only characters

half beacon
storm stump
sonic vault
#

translating:
concat(quantyofDicesDamage1, "d", (diceDamageOnehanded1 + scaling))

#

works without the scaling sum

#

helpi

#

exchanging scaling for number also does this
"concat(quantyofDicesDamage1, "d", (diceDamageOnehanded1 + 1))"

#

Why is that, trying to convert to a number, since it is a concatenation?

daring thunder
#

I was thinking I was getting the label, not the key!

ripe herald
#

I'm trying to create an item where the description can vary slightly depending on another value on the sheet (in this case, it's a spell, that has one description if cast with one type of magic, and another description if cast with another type of magic). I know we can't have the contents of a rich text field vary based on other elements of the sheet, but is there a way to have, say, the rich text field or a plain text field contain the static "formula"/formatted text (so it can be entered on a per-item basis) and then have that get parsed by a label to render as the fields change?

For example, can I have a text/rich text field with something like

This spell ${switchCase(magicType,"fire","calls down a pillar of flame dealing 2d4 Fire damage","ice","unleashes a blast of cold dealing 2d4 Cold damage","calls down a pillar of flame (if cast as Fire) or unleashes a blast of cold (if cast as Cold) dealing 2d4 damage of the appropriate type")}$ to the selected target.

And then have a label render it with the appropriate dynamic value? I tried a couple of ways unsuccessfully and and figured I'd ask here before I try a few more when I get back online later tonight :p

#

If not I can just put the full text in, but I thought it would be cute to have it switch depending on selected choices haha.

formal goblet
ripe herald
#

Oooh good shout, forgot about that

#

Thank you!

sonic vault
daring thunder
#

How do I reference the name of an item for a formula? I have a button that runs a macro and I want to pass to the macro the item's name

formal goblet
formal goblet
daring thunder
#

item.title

formal goblet
#

item.name is actually right if your Formula is inside an Item Container

daring thunder
#

I wrote this for a button in an item:

%{return await game.macros.getName('Power Roll!').execute({ability_title:'${item.name}$'})}%

formal goblet
#

Actors and Items work the same way in the Formula system if you think about them as separate sheets

daring thunder
#

it works if I replace item.name with some other component key, just not when I try using item.name

formal goblet
#

Remove the prefix and you should be good

daring thunder
#

Legend! Tysm

sonic vault
#

quick question

#

in the sheets, has the names component keys by default?

#

in this case, item.name or something, "Espada (+8)"

copper glade
#

how do I access the Label for a dropdown's option? e.g.

#

nvm sorry, I shouldhave searched first. Just changed the keys to match the label

wet heron
wet heron
wet heron
#

so something wierd has happend.
Till runing Foundry 11

${mag_current_1 > 0 ? setPropertyInEntity('self', 'mag_current_1', mag_current_1 - 1) : 'Reload!'}$

mag_current_1 no longer changes, only the roll message displays one less

wet heron
#

this worked before, but no longer

vestal vortex
#

CSS question: is there a way to let players choose what colors they want for their sheet? something like a dropbox with color choices and when they choose one, the sheet colors change accordingly?

woeful skiff
#

Can you reference a key on the character sheet from an item?

woeful skiff
low cape
#

Hi there! I just got into CSB and am still a total noob, so I apologize for my probably very silly question in advance: Is there any way that an item sheet has access to a character sheet? Let's say I want my sword sheet to have a clickable attack label with a formula that uses the characters strength

brisk finch
#

anybody know why item quantity doesnt work in Item Piles? it just doesnt track number...

low cape
#

Also, another quick question:
I am trying to use a formula in a label under "Net Value" to calculate the sum of "Base Value" + "Mod. Values". How do I refer to those? I have named them correctly and putting the value into : (:value:) has worked before when trying to make a roll.
This is what worked previously:
${[1d20+:str_base:]}$

woeful skiff
wet heron
#

can i make a downloaded sheet into a template?

low cape
woeful skiff
wet heron
timid agate
#

is there a way to make a panel in the red box only over a small margin while the text box on the left covers 3/4ths of it?

formal goblet
timid agate
formal goblet
timid agate
#

I'll see what i can do with it. what could be worse then assembly code.

formal goblet
timid agate
brisk finch
#

looks like i have same trouble

brisk finch
#

and i cant sell more than 1 pice of item. Just after update all is broken ._.
11-foundry

sonic vault
#

theres someway a player do your on effects, like a input of something?

#

effect (programmed) 1 | ${something}$

pliant leaf
vestal vortex
#

This may be a dumb question but is there a way to limit the maximum value of a number field with another number field?

For example, i'm adapting a system that has 20 as max level. Thing is that the players can do multiclass if they want to. The way i adapted it was to make it show the second class option if you select the first one and have each one have separate levels and then, create a label where both classes level are added up and assigned as a "character level" that the rest of the sheet uses to assign mastery/proficiency level and stuff.

Problem is: since i don't know how to link and limit the number fields with each other, the players can set different levels per class and go beyond the max level, partly breaking the mastery/proficiency stuff and forcing the player to reselect the class to fix if their levels ever go beyond the intended max.

#

What i want is to lock the number field so that
If a character has 12 levels in Black Mage Class, then they can't go beyond level 8 in the Rogue Class.
Just like a softlock on both fields so that they can never go beyond 20

latent wyvern
#

You mean like ${20-theothernumberfieldkey}$?

#

Which in your case would be the sum of all levels which sounds like you've got already

vestal vortex
latent wyvern
#

In what way didnt it work

vestal vortex
#

still goes beyond level 20 somehow

#

if i just set it to 20 and put anything above that, then it locks itself back to 20 and gives a warning which is the intended effect

#

ok

#

i was dumb

#

it worked now

latent wyvern
#

Okay good, I had this example loaded up just in case

#

What went wrong?

vestal vortex
#

wrote the wrong key on field 1

latent wyvern
#

Ah yea that would do it

vestal vortex
#

thats what i get for giving some field similar key names

#

thanks for the help

latent wyvern
#

I was a rubber duck is all

slate mulch
#

\

brisk finch
wet heron
pliant leaf
#

i had to roll back some of the plugins as well

daring thunder
#

Is there a way to change the colour of a meter bar (to something like blue) for a shield?

#

I’ve got a red/yellow/green bar for health already

wet heron
#

Is there a way to extract the formula from a sheet?
I have and old sheet that is not synced with my current Template that i want the formula

wet heron
#

now it seem to have stopped working that too,

#
${mag_current_1 > 0 ? setPropertyInEntity('self', mag_current_1, mag_current_1 - 1) : 'Reload!'}$

Intrestingly it displays the roll with mag_current one less

but does not update the sheet.
Anyone have an idea what could be wrong?

narrow crest
#

Hello I have a question sorry if it's been asked before. I created some tabs (after doing the whole main page for my sheet) and only then realized that I need tabs to switch between windows on the sheet. However, I can only create content inside of these tabs manually and can't drag the things I made earlier into it. Is there anything I can do?

narrow crest
#

Figured it out, so nvm on that.

wet heron
#

also, i cant figure out whats wrong with this, anyone can help?

${[:rollFormula:] + Rifles_mod_1 + first(lookup('WEAPON_SPECIALIZATION','Weapon_spec_mod', 'Weapon_spec_name', name_weapon1),'0') >= 10+(distance_weapon1/range_weapon1) + mod_weapon1 ? 'HIT!' : 'Miss'}$
daring thunder
#

It might be the '0' in first

#

Try just 0 without the quotes

daring thunder
lethal flax
#

@formal goblet btw is there blans to update CSB to V12?

vagrant hollow
wet heron
summer turtle
#

Is it possible to have a condition be met by a multiple of a number, say a multiple of 10?

wet heron
#

try

${condition  =  value*10 ? 'Yes' : 'no'}$
narrow crest
#

Is there a way I can add an existing macro as like a button inside a sheet?

wet heron
narrow crest
#

its a roll thingy I had chatgpt make, it works pretty well, I just want to have it so it can be clicked from the sheet

#
    title: "World of Darkness Roll",
    content: `
        <form>
            <div class="form-group">
                <label>Number of Dice:</label>
                <input type="number" id="numDice" name="numDice" min="1" value="1"/>
            </div>
        </form>
    `,
    buttons: {
        roll: {
            label: "Roll",
            callback: async (html) => {
                let numDice = parseInt(html.find('[name="numDice"]').val());

                if (isNaN(numDice) || numDice < 1) {
                    ui.notifications.warn("Please enter a valid number of dice.");
                    return;
                }

                let rolls = new Roll(`${numDice}d10`).evaluate({async: false});
                let results = rolls.dice[0].results.map(r => r.result);

                let successes = results.filter(r => r >= 7).length;
                let tens = results.filter(r => r === 10).length;

                let totalSuccesses = successes + tens;

                let resultMessage = `
                    <h2>Roll Results</h2>
                    <p>Dice Results: ${results.join(", ")}</p>
                    <p>Successes (>= 7): ${successes}</p>
                    <p>Extra Successes for 10s: ${tens}</p>
                    <p><strong>Total Successes: ${totalSuccesses}</strong></p>
                `;

                ChatMessage.create({
                    user: game.user._id,
                    speaker: ChatMessage.getSpeaker(),
                    content: resultMessage
                });
            }
        }
    },
    default: "roll"
}).render(true);```
daring thunder
#

you can call the macro with

#

%{return await game.macros.getName('YourMacro').execute()}%

narrow crest
#

Where can I put this?

daring thunder
#

put it in a lable, select Button for lable style, and put this in lable roll message

#

and untick "send roll message to chat"

narrow crest
#

oh it works! Thank you so much

daring thunder
#

🙂

empty glen
narrow crest
empty glen
narrow crest
#

yeah, just put everything inside of a panel that is within a tab

summer turtle
#

Basically I'm trying to get this to only flag Zealous Hatred on a roll of a 10 or 5 on any d10 or d5, this currently works if you're only using 1 dice for damage but as soon as you add more than one it'll take any combination of results that add up to 10 or 5
${!equalText(item.damage_dice, 'd10') ? (roll == 10 ? 'ZEALOUS HATRED!' : ' ') : (roll == 5 ? 'ZEALOUS HATRED' : ' ')}$

#

Which thinking about it whatever methods I was trying still wouldn't work because again it would just take the resulting numbers, sum them together, and then give you your answer. So you could still get a 2d10 roll of a 2 and 8 flagging Zealous Hatred when in reality you didn't get it. I genuinely don't know how to handle this, or if you even can.

formal goblet
# summer turtle Which thinking about it whatever methods I was trying still wouldn't work becaus...

CSB doesn't handle dice pools very well. So you'd need to work with your own Script, if you need to check every die within a pool. I'll try to add things, which make it easier to handle dice pools in Roll Messages, but until then you can only do that on the Script-level. For that, you can check the ComputablePhrase and Formula-classes and this peace of code in the Label-Component: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/src/module/sheets/components/Label.ts?ref_type=heads#L842

summer turtle
#

Cool, thank you very much

empty glen
#

Is it possible to roll on a table multiple times? Something like 3*[#HitLocationTable]?

formal goblet
empty glen
formal goblet
empty glen
#

I keep getting this error:
Uncaught (in promise) RangeError: undefined. Maximum call stack size exceeded

When I call this (it's the second setProperty in my roll message):
${!setPropertyInEntity('self','curROF','rof')}$

formal goblet
empty glen
#

Here are the two:
${!setPropertyInEntity('self','Shots_Remaining','Shots_Remaining - rof')}$</p>

${!setPropertyInEntity('self','curROF','rof')}$

formal goblet
#

Get rid of the newline in the first ome

empty glen
formal goblet
#

Then I need more context. This is not enough to spot the issue

#

Check if your variables are all available and not undefined

empty glen
#

Here's the whole thing, if that helps:

<p>Ranged Weapon: ${!name}$</p>

${?#{attackModifier}}$

${#attMod:=add((relatedRoll == true ? 4 : 0),(fWalking == true ? 2 : 0),(fRunning == true ? 4 : 0), (fMounted == true ? 2 : 0), (fHigher == true ? 2 : 0), (dFisting1 == true ? 2 : 0), (dFisting2 == true ? 6 : 0), (drawingBead*-2), (dBonus), (tSize*-1), (tMoving == true ? 4 : 0), (tConcealed == true ? 4 : 0), (tDark == true ? 4 : 0), (tDarker == true ? 6 : 0), (tDarkest == true ? 8 : 0), (cs1 == true ? 2 : 0), (cs2 == true ? 4 : 0), (cs3 == true ? 6 : 0), (cs4 == true ? 10 : 0), (otherMod*-1))}$

<p>Attack Roll: ${[:attFormula:-:attMod:]}$

${?#{shotNum}}$
${#rof:=(numShot>Shots_Remaining ? Shots_Remaining : numShot)}$
<p>ROF: ${rof}$
<p>Damage: ${[:rof:d10x+:dBonus:]}$</p>

Shots Remaining: ${!setPropertyInEntity('self','Shots_Remaining','Shots_Remaining - rof')}$

${!setPropertyInEntity('self','curROF','rof')}$

formal goblet
#

If it's true, no need to check if it's true, it is already true (if you know what I mean)

empty glen
empty glen
wet heron
#

its so wierd that it prints the value of mag_max_1 -1, but the value in the sheet is still the same

empty glen
#

What kind of component is mag_max_1?

formal goblet
wet heron
sonic vault
#

this roll works fine in the item sheet, but when i bring to the item container, in character sheet and roll

#

the roll is an [object object]

#

from what I thought I would have to create a label for this roll, then call this label in the character sheet as a roll, but I would have to change the code, to item.{something}, for all cases

#

would that be a solution? would there be a better way of doing this?

formal goblet
sonic vault
#

like this

formal goblet
sonic vault
#

worked

#

is that normal, roll two things?

formal goblet
#

Btw, you can simplify %{return Math.abs(${vant}$);}% to ${abs(vant)}$. You don't need nested Formulas for most cases.

formal goblet
sonic vault
#

aaaa

formal goblet
#

Label Roll Message + Roll-Script = 2 Messages

sonic vault
#

worked

sonic vault
grim patrol
#

hey y'all, i got what i feel like is a very silly question, but i finally went through and updated my instance after having sat there for a long while. I went from Custom System Builder version 3.0.0 to 3.2.5. I went in to check around and see what all changed, but when i attempted to open a character sheet, I noticed it did not open. In checking the console, i see the following error:

Error: ENOENT: no such file or directory, open '/home/ubuntu/foundryuserdata/Data/systems/custom-system-builder/templates/actor/actor-character-sheet.html

In checking that directory, i see the following:

actor-_template-sheet.hbs
actor-character-sheet.hbs
actor-sheet.hbs```

what did i do wrong?
formal goblet
grim patrol
#

ah

#

easy enough fix

#

Update: It's uh, updating =P ever since I said "easy enough fix". clear cache and cookies. reloaded the site and it's doing the migration. i'm gonna be here for a while it seems:

grim patrol
formal goblet
#

To be fair, we refactored quite a lot in the code and are still not done

grim patrol
#

i feel that

#

but i super appreciate y'alls work. I'm super enjoying custom system builder. i've even said at this point that if there ever is an official version released for Foundry for the game i'm playing, i doubt i'm gonna use it considering how customised this system is for the crew

#

whooo dawgy, that's a thick list

formal goblet
#

I'm at around 600. Over 2k is clearly a new dimension

grim patrol
#

i uh, i like making things. =P in terms of gameplay items: armour, weapons, food items, random loot, starship components, drone components.

formal goblet
#

Yeah, I moved all of the items to a compendium, so that I only have to update them at 1 place (I have mutiple worlds of the same system)

grim patrol
#

y'know... that's very smart

#

gonna have to do that

formal goblet
#

Just be aware that Compendiums aren't migrated automatically

#

But would be a nice feature to have that in the context menu tbh

grim patrol
#

hmm... good to know, good to know. thank ya for that info. and agreed on the context menu

grim patrol
#

i am pleased to declare that all is good and swanky. thank ya again for the assistance

vestal vortex
#

is there a way to fetch all results from a roll formula? Currently i have the following formula in my roll message and i want to show both results if they choose advantage or disadvantage but it seems to show either the highest (if advantage) or lowest (if disadvantage), not both.

daring thunder
abstract siren
#

Hello everyone, is there any native (no javascript) way to render text conditionally in chat roll messages? I am displaying rolls separated and processing them with JS, and not all dice are rolled everytime. Code (hopefully) for clarity. The system is a Daggerheart hack.


${?#{ACTION_ROLL_TEMPLATE}}$

<p>${NAME}$ effettua una prova di ${SELECTED_ACTION}$ con <b>Modificatore</b> ${MODIFIER:=SELECTED_ACTION+SELECTED_EXPERIENCE}$ e <b>Difficoltà</b> ${DC}$.</p>
<p> Ottiene: ${HOPE_DIE:=[1d12[radiant]]}$ + ${RUIN_DIE:=[1d12[force]]}$ + ${ADVANTAGES:=[:ACTION_ADVANTAGE:d6[white]]}$ - ${DISADVANTAGES:=[:ACTION_DISADVANTAGE:d6[black]]}$</p>

%{
    let hopeDie = Number(${HOPE_DIE}$);
    let ruinDie = Number(${RUIN_DIE}$);
    let advantages = Number(${ADVANTAGES}$);
    let disadvantages = Number(${DISADVANTAGES}$);
    let total = hopeDie+ruinDie+advantages-disadvantages;
    let difficultyClass = Number(${DC}$);
    let resultString = "<p>Il totale è <b>"+total+"!</b></p>"
    if (total >= difficultyClass){
        if (hopeDie == ruinDie){
            resultString += "<p><b>SUCCESSO CRITICO!</b></p>"
        } else if (hopeDie > ruinDie) {
            resultString += "È un <b>Successo</b> con <b>Speranza!</b>"
        } else {
            resultString += "È un <b>Successo</b> con <b>Rovina!</b>"
        }
    }
    else{
        if (hopeDie == ruinDie){
            resultString = "<p><b>FALLIMENTO CRITICO!</b></p>"
        } else if (hopeDie > ruinDie) {
            resultString += "È un <b>Fallimento</b> con <b>Speranza!</b>"
        } else {
            resultString += "È un <b>Fallimento</b> con <b>Rovina!</b>"
        }
    }
    return resultString
}%

</p>
abstract siren
abstract siren
formal goblet
abstract siren
# formal goblet Yep

hold on, options is globally available? like I can access it as is from any script?

abstract siren
#

or maybe %{options.explanation = false;}%?

formal goblet
abstract siren
#

is this normal or am I missing something?

#

the only JS is the big box at the bottom

formal goblet
#

What CSB-Version are you using?

abstract siren
abstract siren
formal goblet
abstract siren
# formal goblet Can you log the `options`-object within the Script and show me the result?
Object { source: "ACTION_ROLL_TITLE.labelRollMessage", reference: undefined, customProps: undefined, linkedEntity: undefined, computeExplanation: true, triggerEntity: {…} }
​
computeExplanation: truecustomProps: undefinedlinkedEntity: undefinedreference: undefinedsource: "ACTION_ROLL_TITLE.labelRollMessage"triggerEntity: Object { entity: {…}, _templateSystemUniqueVersion: 243483011, saveTimeout: 18589, … }
​​
_componentMap: Object { custom_header: {…}, custom_body: {…}, MAIN_PANEL: {…}, … }
​​
_templateSystemUniqueVersion: 243483011
​​
customBody: Object { _key: "custom_body", _templateAddress: "body", _role: 0, … }
​​​
_align: ""
​​​
_collapsible: false
​​​
_contents: Array [ {…} ]
​​​
_cssClass: null
​​​
_defaultCollapsed: true
​​​
_droppable: true
​​​
_flow: "vertical"
​​​
_key: "custom_body"
​​​
_parent: undefined
​​​
_permission: 0
​​​
_role: 0
​​​
_templateAddress: "body"
​​​
_title: ""
​​​
_titleStyle: "default"
​​​
_tooltip: null
​​​
_visibilityFormula: null
​​​
<prototype>: Object { … }
​​
customHeader: Object { _key: "custom_header", _templateAddress: "header", _role: 0, … }
​​
entity: Object { name: "TEST_ACTION_SCORES", type: "character", img: "icons/svg/mystery-man.svg", … }
​​
saveTimeout: 18589
​​
<prototype>: Object { … }
​
<prototype>: Object { … }
ComputablePhrase.js line 131 > AsyncFunction:29:9
#

hold on

#

Ok I can confirm that this is the options object, the closest I've seen is the computeExplanation property, but setting it to false does not change anything

formal goblet
#

Well, it got a lot more props since the last time I checked... If it doesn't work, then you can use this workaround: ${!%{...}%}$

abstract siren
timid agate
#

Is it not possible to have Item Container within a item? Trying to make a bag of holding.

timid agate
#

shoot

daring thunder
#

Is there a way within %{}% code to not move on until the code finishes? I have a button that does this:
%{ runs a macro that asks a user for something and then rolls some dice }%
${ edits some values }$

I want it to not edit the values until it's finished rolling the dice

#

Specifically this is the code:

%{

if (${item._ability_cost}$ <= ${resource_current}$) {
game.macros.getName('Power Roll!').execute()
}

${
setPropertyInEntity('self', 'resource_current', resource_current-item._ability_cost)
}$

}%

#

I tried adding await before the game.macros.getName part but it didn't work

coarse shard
#

How/can you add a function inside a switchcase - i.e. set the value in a number field based on dropdown selection? It's easy to reference it to min, max, and default, but I can't seem to get it to update the field

coarse shard
daring thunder
#

hmm that didn't work for me :/

coarse shard
#

Sorry wish I understood it better myself 😮

formal goblet
warm relic
#

im definitely missing the setting, which one is it to let a player add their own rows (or click the + to edit the sheet) I've set their ownership and they can edit existing text fields but they can't add rows in dynamic tables to fill out for items or traits and stuff.

formal goblet
daring thunder
# formal goblet `await` should do the trick

I've tried:

%{

if (${item._ability_cost}$ <= ${resource_current}$) {
return await game.macros.getName('Power Roll!').execute()
}

${
setPropertyInEntity('self', 'resource_current', resource_current-item._ability_cost)
}$

}%

and it still doesn't wait

#

also tried without the "return"

warm relic
daring thunder
#

Macro runs correctly, it completes

formal goblet
#

Although... If you get the result, it should be correct

warm relic
#

so you need to set the player permission to view the component

#

is what fixed it

#

nothing changed visually besides being able to add rows but that fixed it

daring thunder
#

Perhaps I'll just put the setProperty in the macro itself or something

#

Doesn't seem like async functions work well

vocal sorrel
#

Dear CSB Devs and Community!
Thank you so much for the continued support for this "system engine", with your help I am well on my way to my dream of creating my very own TTRPG, "Diamond Express". Thought I'd share the current state of the character sheet. Its still a long way to go, but I thought I'd extend a word of gratitude to the community here.
Stats:

  • 8 lines of JS
  • 20+ lines of HTML
  • 8000+ lines of CSS and counting.

https://www.youtube.com/watch?v=Oh_R5d7wEnQ

Temporary background art belongs to Ismail Inceoglu, I only use it as a backdrop to my work so that I don't have to stare at a blank canvas.

Here is brief overview of my personal project, Diamond Express TTRPG.
This includes the CSS work done on FoundryVTT as well as the character sheet, made from the ground up with CSB (Custom System Builder)...

▶ Play video
coarse shard
#

inspirational!

#

Could an item be set up to update the portrait on a character sheet? i.e. have a folder of portrait items that can be dragged to update portrait and/or token?

vocal sorrel
#

Not without some JS I think. There is a way to fake it probably (by hiding the actual portrait and then doing some CSS wizardry for it show up differently on the character sheet), but it is pretty tough all and all. As far as I know, there is no actual support for something of that scale.

coarse shard
#

Yeah still just trying to wrap my head around what's accessible through CSB itself and what's not. Thank you!

#

Items don't effect number fields...but is there an easy way to 'push' a change from a label to a number field? NFs have been driving me kind of crazy with having Min, Max, and Default, but no seemingly straight forward way to set them from various actions. Like, how can we force a setPropertyInEntity to fire off when selecting from a dropdown or dragging an item onto a sheet?

vocal sorrel
#

Yeah, no. I unfortunately haven't figured out how to do that either. The closest I've gotten is creating a label that simply combines the modifier from the item(-s) and the value from the NF and have that either nearby, or in place of the number of the NF (with CSS).

daring thunder
#

In a macro, how do I set a value in an actor's sheet?

wet heron
#

With a dropdown list, that i gave the key Gun_type_1 i have several lines, and i want an roll to use the selected value. but i cant get it to work.

in the list i have given them keys that corespond to the value. see picture.
i want the Gun_type_1 to be, in case of Rifle, 7

The code is

${[:rollFormula:] + Gun_type_1 + first(lookup('WEAPON_SPECIALIZATION','Weapon_spec_mod', 'Weapon_spec_name', name_weapon1),0) >= 10+(distance_weapon1/range_weapon1) + mod_weapon1 ? 'HIT!' : 'Miss'}$
ripe herald
#

What does it look like the formula is resolving to when you look in the console?

#

i.e. if it's showing you the object/formula as part of the error, it may be helpful to see what's showing up there.

formal goblet
formal goblet
ripe herald
#

Am I being dumb when it comes to the item container filters and using 'or' values? a and b, a and b != true, etc., work, but a or b throws a TypeError expecting an Array, DenseMatrix, SparseMatrix, or Matrix instead of a boolean in index 1.

formal goblet
formal goblet
ripe herald
#

Hmm, both are checkbox properties on the item, and the error thrown is this one. I'll go poke around I guess.

formal goblet
ripe herald
#

Was already drilling down.

formal goblet
ripe herald
#

#technology

#

🙂

#

Hey you know what's fun, I changed it to xor and reloaded the actor sheet and confirmed that comparison worked, then changed it back to or and reloaded the actor sheet, and it works now.

#

So it might have just need to have the checkboxes toggled a bunch, idk. It's there now.

#

I even tested a or (b and c != true), which was the criteria I really needed, and that works so... hurray.

charred spire
#

Good afternoon. Does anyone here know how I do a Pokémon style identification in CSB?
Like, I want the Bulbasaur token to be identified as Grass and when it takes damage from Fire, it calculates double.

#

And of course, also how do I identify that an attack is fire

formal goblet
charred spire
#

how do I do this?

coarse shard
#

Can you set run a formula in a conditional? i.e.

${ is_something >= 5 ? [:a_variable:=5:] : [:a_variable:=[:something+something_else:] }$

#

I think I'm very confused about running formulas within formulas, if that isn't obvious

coarse shard
#

Is it normal that a meter value that reads a number field doesn't add another label value when the number field gets updated?

For example, the meter is at 1/5 and it's value is ${ numberfield + labelvalue ]$
Updating the number field by 1 increases the field to 2/5 but updating the label value by 1 via an item does not affect the meter.

formal goblet
coarse shard
#

If I refresh the sheet it adds

#

But if I remove or add an item with modifiers it doesn't without a refresh

#

But increasing a number field either by script or by clicking the field control updates the meter

formal goblet
#

I see, seems to be an update anomalie

coarse shard
#

but number fields can't have modifiers so I'm caught in a loop XD

#

Is there a way in CSB to call the sheet refresh?

daring thunder
charred spire
charred spire
#

There is a tag field on the character sheet... is there any point in this regard?

daring thunder
coarse shard
#

A Label with Label text referencing its own key adds to itself every time the sheet is updated.

i.e. Label with key "stat" and Label text ${stat}$ and an item that modifies "stat" +3 gets +3 everytime the sheet is refreshed

#

3, 6, 9 , 12, 15 etc etc it just keeps going up

#

so if, for instance, I wanted to try to use its value to set another value (i.e. number field) then it increments itself

abstract siren
#

Any reason why I can't drag components into a tabbed panel's tabs? It doesn't seem to work on firefox

coarse shard
abstract siren
charred spire
coarse shard
#

You could change up the formula however you want

#

my script literally looks like this:

${num_dice:= NFstr+str_mod >5 ? 5 : NFstr+str_mod}$

#

where num_dice is a newly declared cariable, NFstr is a number field, and str_mod is a label that gets a modifier from an item

#

num_dice is further passed on to determine how many die are rolled on a click of that label

charred spire
#

hmm, ok but, how do I identify the pokemon's token and move with the elements? and then to apply this formula?

coarse shard
charred spire
#

lol kkk im sorry

coarse shard
#

easy on the k's, but no worries!

formal goblet
coarse shard
coarse shard
# formal goblet Thats... do you have a cyclic dependency somewhere?

Yep, reproduced. Here were my steps:

  1. Create Actor from _template
  2. Add Label component with key 'anything', with nothing in Label Text
  3. Create Actor using this template
  4. Create Item from _equippableItemTemplate
  5. Create Item that uses ItemTemplate, set to Unique
  6. Configure item modifier to affect 'anything' + 1
  7. Drag Item onto Actor
  8. Change Label Text in Actor to ${anything}$
  9. Refresh Actor - number goes up incrementally
formal goblet
#

You basically did anything = anything + modifier

coarse shard
#

Totally understood, but a bit unexpected since we're not explicitly adding 'anything' to itself

#

like I would expect to reference itself would only get the value and then add the modifier

formal goblet
#

To be fair, you have to know how CSB works under the hood. From my perspective, it is doing what I'm expecting

coarse shard
#

For sure. It makes sense

#

This value seems to 'stick' for an extra refresh too though as far as I have tested

#

If for example I have a different label set to ${anything}$ and then also Label key 'anything' set to ${anything}$

#

after I remove ${anything}$ from anything, the number still sticks to the other reference until there are two refreshes

#

I'm a bit of an idiot so thanks for humoring me 😅

coarse shard
#

My setup is working 90% the way I want except that I can't update the meter when changing a modifier via items without manually refreshing. Is there any way to script a refresh?

rotund mason
charred spire
#

I was thinking here, if I use conditional modifier list and a dynamic table, can I get the Pokémon effect?

sly mason
#

I'm trying to make a panel appear only when one of two types are selected but im not sure what the right syntax for it would be

wet heron
#

Is there a way to have the dice number to be visible beside the complete roll?

summer turtle
#

Can a condition check for any double on a dice roll?

#

And any condition with multiple things to fulfil it I guess, for instance in Black Crusade you can "Push" Psychic Powers between +1 to +5, which generate Psychic Phenomena, is there a way to get a single condition to look for any Push between "Push +1" to + "Push+5"?

coarse shard
#

...why does

${ NFadvtok < 1 ? "has no adversity tokens!" : [1d4] }$

still roll a die if conditional returns true?

coarse shard
formal goblet
formal goblet
formal goblet
formal goblet
timid agate
#

is there a section in the notes where it calls the item on a dynamic table, then grab the weight of the unit from it and place the results onto the table?

formal goblet
quiet plover
#

I'm having an issue on getting the output to show the dice result from either referencing a hidden attribute formula, or from a roll table

Right now I have a dropdown component that uses key values that match hidden attributes names (ie DiceD4, DiceD6, ect)
The hidden attribute formula for DiceD4 would be [1d4]

In the label component I have the label roll message refer to the dropdown value (ie ${ref(PC_Tough)}$ ) and set then set the dropdown value to DiceD4, when I select the label the output returned is just the "[1d4]" and it does not return the value of the 1d4 roll (I have also tried with ${[1d4]}$)

Also when I try to just use a roll table [#<Rolltable>] in the label component's Label roll message I only get [#] returned

I'm fairly new to using CSB, but is there something I'm missing for the dice rolls to be displayed when referenced or for roll tables to work from the label component? or is there a different approach I should be taking?

charred spire
sonic vault
#

Is it possible to pull a ${}$ formula from an input, like a text field?

#

my idea is for players to create roll formulas for their skills, so as not to have a template for each skill

charred spire
formal goblet
charred spire
quiet plover
formal goblet
charred spire
#

setPropertyInEntity('target', 'Health', "target.Health - Damage")

I tested this, in the documentation, and it worked... however... the result that appears in the chat is the final result, not the die roll, for example, the target has 50 HP, I dealt 5 damage, He will have 45 HP, so far so good, but the chat shows these 45, not my 5 damage, how do I change that?

formal goblet
charred spire
#

i don't understand

#

oh

formal goblet
#

The return value of setPropertyInEntity() is always the final value. You won't be able to change that. So if you don't need that, you can hide the result with # at the beginning of the Formula

charred spire
#

setPropertyInEntity('target', 'health', "target.health - [d6]")

it stayed like this

sonic vault
charred spire
formal goblet
# sonic vault my idea is for players to create roll formulas for their skills, so as not to ha...
%{
const rollMessage = entity.system.props.richTextAreaKey;

const phrase = new ComputablePhrase(rollMessage);
await phrase.compute(
  {
    ...entity.system.props,
    ...options.customProps
  },
  {
    ...options,
    computeExplanation: true,
    triggerEntity: entity
  }
);

if (postMessage) {
  let speakerEntity;
  switch (entity.entityType) {
    case 'actor':
      speakerEntity = entity.entity;
      break;
    case 'item':
      speakerEntity = entity.entity.parent;
      break;
    default:
      speakerEntity = null;
  }

  const speakerData = ChatMessage.getSpeaker({
    actor: speakerEntity,
    token: speakerEntity?.getActiveTokens()?.[0]?.document ?? null,
    scene: game.scenes.current
  });

  phrase.postMessage({
    speaker: speakerData
  });
}

return phrase.result;
}%
formal goblet
charred spire
formal goblet
sonic vault
#

When I was testing I thought I could simply convert it to string lol

#

thanks

sturdy mesa
#

Can someone recommend me an combat module for Custom System Builder?
I want a module to call an macro at the start of every turn

formal goblet
sturdy mesa
sturdy mesa
#

Thanks

dense pine
#

can i just put it in a label roll message of a button to make it work?

wet heron
#

with 1d20x20 the die will explode, but can i through formula see if a dieroll is 20?
For every roll of 20 (but only Nat 20) there is a +5 dm boost

#

same for a nat 1, but oposite

summer turtle
# formal goblet You'll need to roll the dices separately and check if both are equal

Having slept on the problem I didn't need to use seperate dice rolls, unless something down the line comes up. One of the few remaining bits of the Deathwatch system my Black Crusade one is based on is the code for hit location, and I was able to recycle this to get tens and units, then compare the two.

${#units:=roll-(floor(roll/10)*10)}$

<p style="font-size: 20px; color: darkred;">${!tens == units ? 'Psychic Phenomena!' : ' '}$</p>```
It seems to work well, I'm happy lol
dense pine
#

Hi all!
I would like to create a Button (Label) with a macro that lets players refresh their actor sheets as well as all calculations inside all owned items as my sheets dont do this automatically anymore after the lastest update of CSB. Can anyone please help me with that?

summer turtle
#

How come the roll part of this is being displayed as a header when posted to chat, when I have the same formatting for my other rolls and it just posts at the normal size?


${#concat(
?{power_level:"Power Level"|"${ceil(psy_rating/2)}$","Fettered"|"${psy_rating}$","Unfettered"|"${psy_rating+1}$","Push +1"|"${psy_rating+2}$","Push +2"|"${psy_rating+3}$","Push +3"|"${psy_rating+4}$","Push +4 (Daemonic/Unbound Only)"|"${psy_rating+5}$","Push +5 (Unbound Only)"},
string?{other:"Other Modifiers (Psy Rating Only)"[number]})
)}$

${#psychic_strength:=(power_level + other)*5}$

${!roll:=[1d100]}$ vs ${!wp_current + psychic_strength}$

<h2>${!roll <= wp_current + psychic_strength ? (roll == 01 ? 'Critical Success!' : 'Success') : (roll==100 ? 'Critical Failure!' : 'Failure')}$</h2>

${#tens:=floor(roll/10)}$
${#units:=roll-(floor(roll/10)*10)}$

${#degree:=(wp_current + psychic_strength - roll)/10}$

<p><strong>Degree of Success/Failure:</strong> ${!degree <= 0 ? floor(degree) : ceil(degree)}$</p>

${#loc:=(units*10)+tens}$

<p><strong>Hit Location (If Applicable):</strong> ${!loc < 11 ? 'Head' : loc < 21 ? 'Right Arm' : loc < 31 ? 'Left Arm' : loc < 71 ? 'Body' : loc < 86 ? 'Right Leg' : 'Left Leg'}$</p>```
#

Weapon Skill code for comparison:


${!roll:=[d100]}$ vs ${!ws_current + ?{Modifier|0}}$<br>

<h2>${!roll <= ws_current + Modifier ? (roll == 01 ? 'Critical Success!' : 'Success') : (roll==100 ? 'Critical Failure!' : 'Failure')}$</h2>

${#degree:=(ws_current + Modifier - roll)/10}$

<p><strong>Degree of Success/Failure:</strong> ${!degree <= 0 ? floor(degree) : ceil(degree)}$</p>```
daring thunder
#

If I want to share my sheets etc with others to use in their own games, what would the best way be?

summer turtle
# summer turtle How come the roll part of this is being displayed as a header when posted to cha...

Just replying to this rather than posting the code again, but I have something weird going on.

The roll works as expected, it takes the Psy Rating of the character, modifies it (or not) as required, and then times the final result by 5 to get my bonus to the focus power test. So why is it also throwing an error in the console?
Custom System Builder | Value expected (char 35) SyntaxError: Value expected (char 35)
Custom System Builder | Cannot convert "ERROR" to a number Error: Cannot convert "ERROR" to a number
(Got that second one 3 times I think)

wet heron
wet heron
summer turtle
daring thunder
#

Is there a way to change the colour of a lable icon? It's defualt to red for me and I can't figure how (or if) I can change it's colour

summer turtle
#

You use html in the label text, so for my buttons I use
<div style="color:darkred;"> <i class="fas fa-dice-d10"></i>
To have a dark red d10 as my button.

charred spire
formal goblet
summer turtle
#

So I did, a single slash.

brisk finch
#

hi all,anybody know how i can make link item in chat wile i press "Roll button" in inventory? because i make just "name" of item,not a link...

#

or myabe another way to fast look at this item from chat....

quiet plover
drowsy rune
#

Hello, I have two different squads under the same regiment in my wargame. Each Infantry Regiment reduces the cost of Infantry units by 20%. Originally I had only one infantry unit so I used this formula:
Infantry squads cost reduction: ${sum(infantry_regiments_total)*20}$

which led to:

Infantry squad cost: ${sum(100)-(infantry_cost_reduction)}$

it worked perfectly.

Now I have another unit which costs 150 so I wanted to try this formula:

ARC infantry squad cost: ${sum(150)-((infantry_cost_reduction)*1,5)}$

The last one doesn't work, what am I missing ?

#

It's been a few weeks since I haven't touched my formulas so I'm kinda rusty

drowsy rune
#

Aaaaaaah

dense pine
#

Hi all!
I would like to create a Button (Label) with a macro that lets players refresh their actor sheets as well as all calculations inside all owned items as my sheets dont do this automatically anymore after the lastest update of CSB. Can anyone please help me with that?

drowsy rune
dense pine
dense pine
#

It works but i have to press it 2-3 times to get all items updated. No errors in console, it just stops.

half beacon
#

For tabs, I'd like to make transitions smooth. Right now, I have a background to highlight the active tab. Do I need to use Javascript to translate the background from one active tab to another? Or can it all be done in CSS?

thorn sparrow
#

First time using CSB and I'm doing a pretty basic implementation of a number+1d10 against a target number for most dice rolls. Everything seems to be working fine but i noticed in testing for the labels that I created to roll dice, they don't seem to send a roll to chat if the roll would fail and I'm not sure why that is. My players on Tuesday kept saying "This is weird, sometimes I have to click 3 or 4 times to get it to roll" and I couldn't reproduce until today when I was trying to add some refinement and realized if I made the target number high enough (to test fail condition) it wouldn't seem to roll (or at least it didn't send anything visible to chat). Any ideas what this might be?

half beacon
#

Are you able to post the script for us to see what's going on? Any errors in the console?

thorn sparrow
#

Haven't checked the console cuz I forgot to check there 😅

I'll give that a look first and see if that sheds any light. If not, I'll share what I've got.

#

Okay it's definitely throwing an error in the console but I'm not really sure what it all means.

I'm not very javascript savvy and my stuff is mostly copied from the example system and making sense of the gitlab page.

#

Here's what I'm using for the attack roll but it's doing this error for all the pass/fail rolls:

#

It's whatever conditional output I'm doing that seems to break it. WIthout that, it outputs everything just fine. Pass, fail, whatever. The second part of the comparison seems to be where it breaks (probably because of bad syntax that I'm not sharp enough to spot)

sonic vault
#

is it that way?

#

because i got this error

formal goblet
sonic vault
#

worked

#

Another thing, is there a way for me to get a column from a container item?

#

I basically wanted to sum everything in the slots column

formal goblet
sonic vault
#

kay

thorn sparrow
sonic vault
#

Can i access a item icon?

latent wyvern
#

Hi I'm trying to hide a checkbox based on another checkbox using the visibility formula, but it seems like the conditional not operation ! (and by another fact, &&) don't seem to work. Here is what I have:
Checkbox 1: Hidden if NOT checkbox 2 -> !checkbox2
Label 1: Shown if checkbox 3-5 -> check1 && check2 && check3

#

Update, checkbox1 seems to work without shortcoding the boolean (check1 != true), and the second one works with words instead of symbols (and)

daring thunder
#

Does anyone know of a way (perhaps a module) that allows you to make active effects?

#

Like "blinded" or "restrained" etc

#

I tried DFred's Convenient Effects but it isn't compatible with Custom System Builder, only 5e

vagrant hollow
wet helm
#

Hi, while working on a character sheet template, foundry hung up. I was dragging a simple lable into a panel which already had severa labels in it. Now every time I try to open the template sheet, foundry hangs again. Foundry otherwise works fine as far as I can tell, it is just the sheet which seems to be broken. Any help would be greatly appreciated, several weeks of work have gone into that sheet :-(.

#

The error code seems to be "out of memory" if that helps with narrowing in the issue.

daring thunder
#

Is there a way to save/reference a global value that all sheets can see?

formal goblet
formal goblet
ripe herald
#

Hey Martin - I just wanted to say that a) I super appreciate this system and b) I super, super appreciate how responsive and helpful you are. ❤️

formal goblet
wet helm
daring thunder
#

Could someone explain the point of the recalculate function?

wet heron
#

hello there!
Need some help with my roll
i want it to do
Roll - (distance_weapon3_throw) * (ref(Wheight_throw) - mod_weapon_throw > 0, else the previous statemen /3

${[:rollFormula:] - (distance_weapon3_throw)(ref(Wheight_throw) - mod_weapon_throw > 0  ? 'HIT! Grenade in contact' : ([:rollFormula:] - (distance_weapon3_throw)(ref(Wheight_throw) - mod_weapon_throw)/3 }$
formal goblet
formal goblet
formal goblet
wet helm
formal goblet
#

Kannst auch schauen, ob du über die Konsole (F12) ne bessere Fehlermeldung bekommst. Der Fehlercode ist leider recht abstrakt

wet helm
formal goblet
#

Drag & Drop in den Chat (oder mir per DM). Da das aber einige MB sind, könnte es zu groß sein...

#

Dann brauchste nen Seite, auf der du die Datei hochladen kannst

wet helm
wet heron
#

oh im dumb, fixed

daring thunder
#

Is there a way to change the value of a hidden attribute?

#

setPropertityInEntity didn't seem to work

formal goblet
low cape
#

Hey guys! Is there any way I can nest instructions into a conditional check?
For example: ${ condition ? do.something : do.somethingElse }$

formal goblet
low cape
#

Alright, I'll rewrite my code a bit and try it out, thank you 🙂
Another question though: Is there any way to stack multiple of the same item in an item container?
Let's say I have the item "Bottle" and drag it into my character sheet several 5 times - this creates 5 single instances of "Bottle". I would like to just increase the amount of a single "Bottle" to 5

formal goblet
storm stump
#

I got a macro that generates a content link string like this
<a class="content-link" data-type="Item" data-entity="Item" data-id="T2YxWLbLNN6e4reU" data-uuid="Scene.TtIhf7Ouprfepdv5.Token.aBcLCPjwnqo1ulRP.Actor.sbeT2O4AS62bAvZJ.Item.T2YxWLbLNN6e4reU" data-tooltip="Minor Illusion" draggable="true">Minor Illusion</a>
I want that link to be in a Label. Pasting that string directly into the label works, I can see the label and click it. When I return that string inside a %{}% block inside the Label Text field, the label div is empty and doesn't have any content. What am I missing here?

sonic vault
#

help

sonic vault
#

forget

#

the problem is the ">" wich becomes ">"

#

Is there any way to solve this?

low cape
#

I have made a script in JS that should trigger a chat message once the "Attack" button from an item sheet is clicked. However, my script does not seem to work.

This is my script (all between %{ }% of course):

`//Immediately end roll if not enough AP left
var ap_cost = ${standard_ap_cost}$;
var current_ap = ${fetchFromActor('attached', "current_ap")}$;
if((current_ap - ap_cost)<0){
return "does not have enough AP for this attack.";
}

//Immediately end roll if not enough ammo in magazine
var ammo_cost = ${standard_ammo_cost}$;
var current_ammo = ${current_ammo}$;
var ammo_max = ${max_ammo}$;

if((current_ammo - ammo_cost)<0 && ammo_max>0){
return "does not have enough ammo for this attack.";
}else{
${#setPropertyInEntity('self', 'current_ammo', "current_ammo - standard_ammo_cost")}$;
}

//Determine which modifier is needed
var weapon_type = ${weapon_type}$;
var skill_mod;
switch(weapon_type){
case "energy":
skill_mod = ${fetchFromActor('attached', "energy_net")}$;
break;
case "melee":
skill_mod = ${fetchFromActor('attached', "melee_net")}$;
break;
case "unarmed":
skill_mod = ${fetchFromActor('attached', "unarmed_net")}$;
break;
case "traps":
skill_mod = ${fetchFromActor('attached', "traps_net")}$;
break;
case "explosives":
skill_mod = ${fetchFromActor('attached', "explosives_net")}$;
break;
default:
skill_mod = ${fetchFromActor('attached', "guns_net")}$;
break;
}
skill_mod = Math.floor(skill_mod/10);

//Determine if there is a STR penalty
var str_net = ${fetchFromActor('attached', "str_net")}$;
var str_req = ${str_req}$;
var str_penalty = 0;
if(str_net<str_req){
str_penalty = str_req-str_net;
}

//Returning the output string if all checks successful
var weapon_name = ${name}$;
var output = ("attacks with " + weapon_name + " for " + ap_cost + " AP:\n
${1d20 + skill_mod - str_penalty }$");
return output;`

low cape
storm stump
hazy saffron
#

Is it possible for the "key" in an Item Modifier equation to be calculated such as ${selected_stat}$ in order to affect the stat who's key matches another field with key selected_stat

wet heron
#

does anyone have a good "random direction" code?

elder jasper
#

How do I make an item scroll and place the measurement controls on the map? I would like my spells to have the effects of Automated Animations

#

example

daring thunder
sturdy mesa
#

Could someone share a code with the d10 system for successes and failures? If possible, with critical success. I would greatly appreciate it. I'm trying to create something similar to the Vampire: The Masquerade roll

hazy saffron
thorn sparrow
# sturdy mesa Could someone share a code with the d10 system for successes and failures? If po...

I think rolls use the standard Foundry rolls so it might look something like
[xD10 cs>={y}] where x is however you're calculating dice pools and y is whatever the target is. I haven't tested this though.

The only thing I've done so far with rolls is roll a single d10, saved that result as a variable then added modifiers to that and then compared that result to another number to determine success/failure.

thorn sparrow
#

I'm trying to set up an item template to take skill/attribute selections (like a dropdown) so when I create the item, I can set what those should be. For example, when I create a sword, I could set that what Skill and Attribute would be used to calculate rolls.

As it is, I have a number value called "Attack" that the players manually set after they get the item. That's fine for now but can result in input error.

formal goblet
formal goblet
thorn sparrow
#

Oh shoot - how can I do that? I tried using a dropdown list in the item template to pull from the actor sheet but I guess I didn't know how to correctly do that

#

Can I reference dynamic tables on other templates I guess is the question

formal goblet
#

Not Templates, but it is possible to fetch the data from actual Actors (be it a global Actor or the parent Actor)

thorn sparrow
#

Okay so if I had a global actor that has all of the skill/attributes on it, I could reference that actor in my item template? I may also be fixated on a solution that isn't the best to do what I'm trying to do.

I realize I could also have a manually created dropdown list on the item template that has the names of all the attribute/skills but I wasn't sure if once I put a created item on the actor, if it could match those values to values on the sheet.

formal goblet
#

I suggest to play a bit with the Dynamic Table and Formula-options of the Dropdown-configuration.

  • Dynamic Table: Dynamic Table key: You can use the parent.-prefix to reference the Dynamic Table of the attached Actor (note that this won't work as long as the Item is detached from an Actor)
  • Formula/Formula for Key-Options: You can use fetchFromActor('actorName', "lookup(...)") to fetch the data from a specific Actor (or even from the attached Actor, which would be the same as the previous option)
formal goblet
formal goblet
formal goblet
# low cape I have made a script in JS that should trigger a chat message once the "Attack" ...

I'd need the error message in the console. But you have to keep 1 thing in mind: Whenever you nest Formulas, the order of execution is from inner to outer Formula. So if you have something like %{4 * ${3 + 5}$}%, the 3 + 5 is evaluated first. This will bite you in the neck if you use this here:

if((current_ammo - ammo_cost)<0 && ammo_max>0){
    return "does not have enough ammo for this attack.";
}else{
    ${#setPropertyInEntity('self', 'current_ammo', "current_ammo - standard_ammo_cost")}$;
}
thorn sparrow
charred spire
#

Is it possible to make a dynamic table or a dropdownlist where each selected item is a scroll button? I couldn't do it

wet heron
#
function rollDirection() {
    const directions = ["north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest"];
    return directions[Math.floor(Math.random() * 8)];
}
 in feet
let distanceInFeet = await new Promise((resolve) => {
    new Dialog({
        title: "Grenade Displacement",
        content: `<p>Enter the displacement distance in feet:</p>
                  <input type="number" id="distance-feet" value="10" style="width: 100px;" />`,
        buttons: {
            ok: {
         label: "OK",
                callback: (html) => { 
resolve(parseFloat(html.find("#distance-feet").val()) * 100);
                },
            },
            cancel: {
                label: "Cancel",
                callback: () => {
                    resolve(null);
                },
            },
        },
        default: "ok",
    }).render(true);
});
if (!distanceInFeet) {
    ui.notifications.warn("No distance entered. Macro canceled.");
    return;
}
let token = canvas.tokens.controlled[0];
if (!token) {
    ui.notifications.warn("You need to select a token representing the grenade.");
    return;
}
let { x, y } = token;
let direction = rollDirection();
 and distance
let newPosition = {
    "north": { x, y: y - distanceInFeet },
    "northeast": { x: x + distanceInFeet / Math.sqrt(2), y: y - distanceInFeet / Math.sqrt(2) },
    "east": { x: x + distanceInFeet, y },
    "southeast": { x: x + distanceInFeet / Math.sqrt(2), y: y + distanceInFeet / Math.sqrt(2) },
    "south": { x, y: y + distanceInFeet },
    "southwest": { x: x - distanceInFeet / Math.sqrt(2), y: y + distanceInFeet / Math.sqrt(2) },
    "west": { x: x - distanceInFeet, y },
    "northwest": { x: x - distanceInFeet / Math.sqrt(2), y: y - distanceInFeet / Math.sqrt(2) }
}[direction];
token.document.update(newPosition);
ChatMessage.create({
    content: `The grenade flies ${distanceInFeet} feet to the ${direction}!`,
    speaker: ChatMessage.getSpeaker({token: token})
});
formal goblet
wet heron
charred spire
#

die button*

#

is just a button, sorry, typed wrong lol

formal goblet
charred spire
#

because there will be many options, if there are too many buttons, it will be huge

formal goblet
charred spire
#

but and the button?

hazy saffron
formal goblet
# charred spire but and the button?

Your Button is your Label with the Label Roll Message, which adjusts the Damage Formula according to the selection of the player. If we assume, that we have a TextField with the key damage, we can do the following in the Label Roll Message:

${[:damage:]}$

This will roll the damage depending on the dice-formula in the TextField (e.g. 2d20).

charred spire
#

i'll try

charred spire
half beacon
#

Couple of questions. Currently, the player can click the item icon to open the item's sheet.
First question: Is it possible to disable that? I want the player to click on the item's name/text to open the sheet for more details.
Second question: How do I disable tooltips for this item container?

half beacon
#

Oh well. Can't get everything I want. 😂

#

Thank you

hazy saffron
main magnet
#

Can someone help me set up an item filter properly with Item Piles? I have no idea what the path is it wants me to get and how I'm supposed to find it. Im using CSB.

The problem is that 'type' is the same for ALL items (abilities, equipment, etc.), and I just want to filter out the ones from a specific item category to not show up in a pile.

EDIT: Figured it out. If you're using Item Piles and CSB, type in flags.item-piles.item.customCategory in the type for item filters and the name of the item category you want to filter out in filters (mine was Abilities).

zinc verge
#

is the latest update of CSB not compatible with Foundry v12?

#

Getting this when I try to update CSB

sonic vault
#

hi guys

#

i am trying to make automatic wouds combatible with my custom system builder

#

it seems kinda simple i guess

#

This is more or less the logic he uses

#

I tried to do it this way, but would that really be how I access "pv?"

formal goblet
formal goblet
latent wyvern
#

When exporting my items to compendia, it retains the correct template (in this case, the ability for the agenda has the agenda ability template). If I try to load the content into a different world (fresh world just after importing the templates json) it reverts to the most alphabetical template. Is there a way to fix this?

#

These are the exact steps:
(World 1)

  • Export templates to json
  • Fill Compendia with content into Module 1
    (World 2)
  • Import templates from json
  • Load Module 1
  • Import from compendia
#

Or I guess the question I should be asking is: what is the best way to share this with people?

latent wyvern
#

Hmm I'll take another look and make sure when exporting the stuff I check keep document id

last comet
#

Hey! Quick question - I made a custom system and want to hand it off to a friend on a different computer who wants to use the system as a jumping point to make his own; what folders are necessary to share, and where are they located?

I did a basic "copy everything" a couple of weeks ago and it error'd everywhere, and figured I'm probably not the first person to try this.

#

I tried

C:\Users\USER\AppData\Local\FoundryVTT\Data\systems

Does it have to be a perfect match between Foundry and Custom System Builder versions, or are there other folders I should grab?

charred spire
# sonic vault hi guys

oh bro, I tried to send you a message but it didn't go through, I added you as a friend

half beacon
#

Think of it as making a system (your game/world) within a system (CSB)... that's technically within a system (Foundry VTT).

peak jacinth
half beacon
#

Forgot about that very common misunderstanding

brave delta
cosmic karma
#

just updated from v11 to v12, the Dice So nice rolls are not working in my game. CSB is still on v11 right?

latent wyvern
#

Yes, not supported on v12

wet heron
#

if the recipiant just want the sheet, you can right click on the template in Actors tab

last comet
wet heron
#

and export

#

Right-Click on the template and export, then the recipiant do the import

last comet
wet heron
#

yeah, Easy Peasy

storm stump
elder jasper
#

How do I count the number of items in this container item and add their values?

half beacon
#

From there, you can use .length to get the number of items

#

Assuming you're filtering by a template, the script might look something like this to get the number of items in the item container (there might be better ways to do it):

%{ const itemList = game.items.GetName('_TemplateName').id;
const itemValues = entity.items
                    .filter(item => item.system.template === itemList)
                    .map(item => item.system.props.yourItemKey);
return itemValues.length;
}%```
elder jasper
elder jasper
#

i trying
${consoleLog(fetchFromDynamicTable('tabela_armadura','compartimento_armadura'))}$

but it does not return any value in the array

elder jasper
#

It would be with the sum function instead of count, right?

#

using the error lookup function

formal goblet
elder jasper
formal goblet
half beacon
#

Is it possible to set multiple properties on a character using only one user input template?

#

I'm struggling to understand how user inputs work for CSB even with the Wiki.... 😅

formal goblet
half beacon
#

For my system, once a player uses a Skill, they can choose if they want to use "extra effort" for it, and also enter a number for advantages they have. Is it better not to implement it this way?

formal goblet
vestal vortex
#

Been having a fight with foundry lately, trying to find a way to show the players token/avatar when they send any message on the chat, kinda similar to what the 5e system has. Anyone has any ideas on how to do that on the global css?

I managed to do something similar it by hiding the original sender and emulating it inside a roll message but is there a way to make it so that it appears in every message instead of sheet rolls only?

#

left is my attempt to emulate it inside a label roll and right is what i want to achieve. Tried to reference the avatar by using:
.message .message-header .message-sender .custom-system-actor
.message .message-header .message-sender .profile-img
.message .message-header .message-sender entity.entity.img
and other similar css classes but none of then worked

#

i also managed to emulate de chat card style (thanks to @robust wren and @gaunt wagon ) but is there a way to automatize the dice results? as in normal foundry rolls, when any dice is rolled it recognizes the type of dice being rolled (eg d12) and print it to chat as well as identify discarded rolls (when using kh/kl), critical and fumbles without the use of macros or would i have to use JS for that?

formal goblet
vestal vortex
formal goblet
vestal vortex
#

Thanks for the help! i'll have to research a little about that part tho

sturdy mesa
vocal sorrel
#

Links to what exactly?

dusky mauve
vocal sorrel
#

Ah, no sorry. This is still far into pre-alpha of the project and its not ready for public viewing. So far its only the stuff on the image/video.

low cape
low cape
#

Also, another tiny question:
Is the template used by an item sheet also a value saved in the background? For example, if I have an item that uses my template "Weapon", is there some way to access that like item.template?

elder jasper
#

Is there a function that automatically refreshes the field?
I would like these formulas to update as I change the number of items inside a container item

timid star
#

Hello, first time really using Foundry and using the custom system builder and enjoy the flexibility it grants.

However, it seems like actors are not inheriting their template's resource bars? Attached a screenshot where I created a monster template then created a few attribute bars. Confirmed it was saved on the template but when I created an actor with the template all the stats are loaded properly but the attribute bars are blank. This is the case for all attribute bars, custom values or hard coded values.

I am currently using bar brawls mod so I can have more than 2 visible bars so that might be relevant if there is a conflict between the two? But I am not sure if I need to do anything else to get this working. I would rather not manually updating every actor to make their HP bar and similar show up.

Thanks if anyone can help with this 🙂

formal goblet
formal goblet
woeful skiff
#

Did you ever get a resolution to this? I seem to be having the same problem.

timid star
dense pine
elder jasper
dense pine
#

but if i just want to count the number of items, not a column sum?

elder jasper
#

I'm trying to use this script to run a macro on a scroll. But I need it to get the value passed by the item to run the macro. In this case I put the code: ${item.macro_item}$ to be able to get the value that I will pass to find the macro. However, it is generating the following error.

elder jasper
dense pine
heavy elm
#

Hello, I want a Dropdownlist in an Item Template to fetch Data from dynamic table from the Actor that the item is attached to. Is tried several approaches which didnt work. Anyone any recommendation?

heavy elm
#

I have a problem with an item modifier:

${fetchFromActor('attached', "lookup('Skills', 'Mod', 'Name', 'Aufmerksamkeit')")}$

${Test1}$

Doesnt add the value ${Test1}$ on that Value from 'Aufmerksamkeit'. I cant see what I do wrong here.

vestal vortex
#

silly question but is there a way to double the dice rolled instead of the results when rolling a critical or thats not possible? Like, if i get a critical hit, it rolls 4d6 instead of 2d6?

#

the only way i found to do it is to make the item have two separate roll formulas for each

vestal vortex
latent wyvern
#

Yea I was trying to figure out how to avoid multiple roll formulas in the roll message (since people were complaining about dice so nice cluttering the screen lol). Luckily the system lets me just show a different button (visibility formula) to roll something else haha

formal goblet
#

Rolling from a Script is also possible and more flexible. Doing multiple roll in there wouldn't be an issue, but requires some knowledge about JS

vestal vortex
#

as of now i have 0 knowledge on that part

#

First Objective: Finish up basic stuff to make the sheet functional and have a backup to rollback to
Second Objective: Complicate the basic and cry as you break everything trying to get it working

light lotus
#

Please help, how do I make the Maximum value reference another component? google said @ but that didn't work

latent wyvern
#

Youll want to use ${maxValue}$, where maxValue is the field you are referencing

chilly token
#

How do I make a Label automatically update when it adds together a Number field and another Label?
Basically, I have an inventory where the template item modifiers key is inventory_weight_label and the value formula is ${count_num*weight_num}$, which works fine for calculating the sum of the inventory items
And then I have a separate Number field for the amount of gold coins, gold_num
Finally, I have a total_weight_label which should be the sum of inventory_weight_label and gold_num
When I change the number field, it all works fine
But when I add or remove items from the inventory, the inventory_weight_label changes fine, but the total_weight_label doesn't, unless I then reload the entire sheet
It seems like CSB doesn't immediately recognize the inventory_weight_label as a number that can be added to gold_num for some reason?

vestal vortex
#

made a simple JS rolling script as a test and it worked like a charm in the label roll. Then tried to use equalText and switchCase to make it roll a different JS code if the attack roll was a critical hit and ran into a problem that it basically makes the roll twice, using both the crit damage and the normal damage

#

This is the code i used. Probably shouldn't use the JS script inside the label roll but i want to avoid using macros since i will make the system public once its done

${#concat(?{Crit_Check:'Crit Damage?'[button]|'no','No'|'yes','Yes'})}$

${!equalText (Crit_Check, 'yes') ? '%{let roll = new Roll("${item.actcritdmg}$ + ${item.actdmgflat}$");
await roll.evaluate({async: true});
await roll.toMessage();}%' : '%{let roll = new Roll("${item.actdmg}$ + ${item.actdmgflat}$");
await roll.evaluate({async: true});
await roll.toMessage();}%'}$
#

note that i have almost no knowledge on JS and this was made using the formula system and the api examples, so anything that goes beyond this is like alien to me

broken pumice
#

As far as I understand, when you use the <>? <> : <> syntax in a CSB formula everything is evaluated, but only one statement is returned.
In your case I would do something like :

${#dmg:= !equalText (Crit_Check, 'yes') ? item.actcritdmg : item.actdmg}$
${%{let roll = new Roll("${dmg}$ + ${item.actdmgflat}$");
await roll.evaluate({async: true});
await roll.toMessage();}%}$```
heavy elm
storm stump
#

You need the + inside a single ${}$ block. Right now you are creating 3 strings. So try ${fetchFromActor('attached', "lookup('Skills', 'Mod', 'Name', 'Aufmerksamkeit')") + Test1}$

heavy elm
#

so lookup doesnt work properly in itemmodifiers

low cape
#

Is there any way to break early out of a ${}$ script?
Let's say I want to do several conditional checks first and if one of them fails, I want to display a chat message with the failed check.

For example:
`${#enough_ammo ? continue script : end script}$
${#a:= 1}$
${#b:= 2}$

You have number a ${a}$ and b ${b}$`

#

I know I can nest conditionals but I can't create a normal or formatted chat message within the ${ }$, correct? They will always look like this:

formal goblet
formal goblet
low cape
# formal goblet Nope. Currently only doable with a Script

But even then I would have to return a variable that my message would then display.
Example:

Your value: %{if (something) { return a; } else { return 'not enough ammo'; } }%

I can't really alter the roll message or entirely skip out of it from within the code, right?

formal goblet
low cape
#

Does throwing an error not just return "Error"?

formal goblet
#

Nope, it will bail out of the creation of the Chat Message

low cape
#

Is there any type of documentation on the errors I can throw?
Or is it just "return error"?

formal goblet
#

Any error does, the type doesn't matter. Just check how to throw errors in JS

low cape
#

Alright, dope. Thanks for the help!

low cape
#

This snippet will always fall into the if-block, even when the condition should not pass and the else-block should be triggered:
${current_ap:=%{let ap_cost = ${standard_ap_cost}$; let current_ap = ${fetchFromActor('attached', "current_ap")}$; if((current_ap - ap_cost)<0){ ${notify('warn', 'Not enough AP!')}$; throw new UncomputableError('Not enough AP!'); }else{ return current_ap; }}%}$
Am I missing something?
The values current_ap and standard_ap_cost are 10 and 5 respectively, so 10-5<0should be false.

This is the output I receive in my console (see image attached)

formal goblet
low cape
#

Damn, I'm really running out of ideas 😄 Is there a way to delay that?

formal goblet
#

To be more precise, the execution order is:

  • ${standard_ap_cost}$
  • ${fetchFromActor('attached', "current_ap")}$
  • ${notify('warn', 'Not enough AP!')}$
  • Script
  • CSB-Formula
low cape
#

Fair enough, I guess I could throw the warn afterwards outside of the script after checking a conditional

formal goblet
low cape
#

Is there also one for setPropertyInEntity?

formal goblet
#

Document#update() (check Foundry-docs or the macro-polo channel)

low cape
#

Alright bet. Thanks again for your support! 🙂
It's amazing how fast this channel is and how dedicated you are to supporting us imbeciles.

storm stump
#

Is there an equivalent to linkedEntitiy in Dynamic tables that contains the row info for use with JS?

storm stump
#

perfect, thanks

hazy saffron
#

Is there a way to dynamically set the icon image on a new equippable item? I don't see a 'name' for the field so wasn't sure if that can be set with code inside the item itself. So if there is a dropdown on the item, and the user selects different entries could the image change too?

formal goblet
finite rapids
#

Hello all. I am trying to set up a roll message that references a few dropdown lists.
I want to be able to show in the chat log not only how many dice were rolled and their results, but also what skill/equipment etc was used to do it.
Is there a way to have the roll message result show the label of the dropdown item, instead of its key?
Thank you in advance.

elder jasper
#

Is it possible to automatically refresh the tab every time there is an update to a container item?

formal goblet
low cape
#

Is there a way to stop characters in JS code within %{}% to change into HTML when I select "Use rich text editor for roll message"?

I have a bunch of code set up for my roll. However, I would also like to use HTML to edit the displayed roll message

low cape
formal goblet
low cape
#

Yup. Damn 😄

elder jasper
#

I'm having the following problem:
I have a variable that adds up the compartments of the container item. And another variable that would be the limit of compartments before suffering a penalty.

However, when the variable that adds up the compartments passes the value, the variable that checks the penalty (which would be a 3rd variable looking at the previous two) ends up not updating on its own like the other two. So I need to refresh the page to be able to update this penalty variable.

hazy saffron
elder jasper
#

no penalty

#

With penalty, without updating the record

#

After updating the form, the penalty is computed

formal goblet
elder jasper
formal goblet
fathom cave
#

Just updated version, did something change in Dropdown Lists? I have a dropdown that gets set to blank called 'mequip' using '"${setPropertyInEntity('self', 'mequip', '');}$"' but it is now not working with the update but was working fine before. It just keeps whatever selection it previously had.

#

The code is run from a different label to set it blank.

formal goblet
fathom cave
#

? I didn't update FTT, just CSB, honestly not sure which version, 2-3 months ago latest version at that point

#

Do I need to call something else besides the dropdown key 'mequip' to get the selection to clear?

formal goblet
#

Your Dropdown must allow empty values. Otherwise I wouldn't know why not

fathom cave
#

It has the empty value because the default value field is blank, which was working as intended before. Nothing has changed on that front? Gonna reset Foundry and see if it is something weird not CSB related.

formal goblet
fathom cave
#

Let me check but almost positive, they are linked

formal goblet
#

Heh. Then I dunno

#

Are you able to change it to other values?

fathom cave
#

Yes, linked.

#

Yes, the dropdown works fine, I just have an equip setup where you pick the item to equip from the dropdown, click a label to equip that item from your inventory, and then an overlay goes over the dropdown forcing you to click the overlay label to unequip the item before a new selection can be made from the dropdown, so in the ss, the bottom 'Flail' usually goes over the dropdown 'Flail' above, but that overlay label is no longer clearing the dropdown when clicked on (I moved the bottom Flail down to troubleshoot)

formal goblet
fathom cave
#

gives me this error if I put in 'Shield' instead of '' in the code above

formal goblet
#

Ahhhh. You forgot additional quotes

#

setProp...('self', 'key', "'Shield'")

fathom cave
#

That did it! Thanks! Weird though because before it worked with just '' and didn't need "''"...

storm stump
#

Hey again! I have a lable and want the content of it to be fed by a macro. But I can't await the macro, it always tells me await is only valid in async functions, async generators and modules. This is the lable content:

%{
const c_features = entity.entity.system.props.c_features;
let ids = [];
for (const key in c_features) {
    ids.push(c_features[key].c_id);
}
return await game.macros.get('EQXpRtKFEehhAwpx')?.execute({itemId: ids, escape: true});
}%

What am I doing wrong here?

storm stump
#

Ah I see, thank you.

hazy saffron
charred spire
#

I made the Pokémon's Moves, tested it as a table and tested it as an item, but as an item I can't link it with the attributes on the token, does it have to be different?

viral tulip
#

Hello! I want to roll a bunch of d6 and print both the number of successes (5 or 6) and failures (1). I tried to do this using foundry's dice modifiers (d6cf=1cs>=5) but even though it colors both the successes and failures, it will only give me one of the numbers as a result (specifically the last in the expression) with seemingly no way to access the other. Is there a way to solve this so i can display both total successes and total failures?

formal goblet
main magnet
#

Was there a change in the path for item piles for quantity and/or value of items? It doesn't seem to work with the old path.

EDIT: Resetting the data for the price field in the settings for Item Piles seems to work.

Doesn't work for quantity though. Any ideas?

viral tulip
#

In the meantime, I have a perplexing issue: This formula resolves without problem and displays the result in the sheet, however I'm unable to use the key anywhere else. Is there some weird interaction here that I'm missing?

elder jasper
#

I'm trying to make it so that when an item is scrolled, a macro is executed to activate and deactivate it. However, when I click to execute the macro, it gives me this error. Does anyone know if what I'm trying to do is actually possible... Pull the name of the macro from inside the item to execute it while scrolling.

Example:
The Byakugan would use the macro ActivateByakugan (and when clicking again it would deactivate it)
The Sharingan would use the macro ActivateSharingan (and when clicking again it would deactivate it)

storm stump
#

Can I use JS in Item Container filter formulas or is it limited to CSB formulas?

formal goblet
formal goblet
formal goblet
formal goblet
viral tulip
chilly token
#

So I can use ${sum(lookup('equipment_container','Weight'))}$ to add up the weights in an inventory table
But can I first multiply by a separate Count column of numbers of each item?
Like, if I have 3 swords that each weigh 10 and 2 spears that each weigh 15, how do I multiply before summing?

elder jasper
high stag
#

Never lucky

%{
let mstr = ${sameRow('talentotree_tree', 0)}$
if (mstr<=0) {
    return Math.abs(mstr)+3+"d12kl";
}
return mstr+1+"d12dhkh";
}%

When I test this, it just works ok and without any problems on the console.
${roll:=[here+${mod}$]}$
but when i put it on the formula the consoles says:

charred spire
#

${
setPropertyInEntity('target', 'currenthp', "target.currenthp - [:power:]")
}$

I use this formula, and before it worked normally, but now that I added 3 more of these (to complete 4 moves), it does the calculation, it doesn't show the scroll in the chat, but it shows the result of the test, so far ok, but no actually decreases the target's HP (it used to), what should I do to fix this?

late ferry
#

hey guys is there any day tracker mod or something? Where i can define if its night and day and what time and which tracks how much days have passed etc?

formal goblet
weak granite
#

Hello i use Custom System Builder for Mutant Chronicles (2d20) settup.
So far, I have managed to create Actor Sheet from which you can roll the character's attributes and skills by selecting the number of dice required for the roll. And the formula reads the number of successes, correctly. However, it does not take into account skill focus. I have the skill focus saved under a separate key, so maybe I can somehow make it work. However, I would like to make the game easier and include skill rolls also in the character's items (weapons, art spells, Dark Symmetry, KI Powers etc.). I.e. add a formula that allows you to make a skill test from the item attached to character.

${#?{numDices: 'Dice'|1|2|3|4|5}}$
${#varName:=ref('Attribute')+ref('Skill_Expertise')}$
Liczba sukcesów: ${[:numDices:d20cs<=:varName:]}$

It's work fine from Actor sheet. But not from item card. Does anyone know how to make it work?

vagrant hollow
high stag
storm stump
#

How hard would it be to allow CSB to use templates from Compendiums instead of only templates created in game.items? From what I can tell I would have to adjust the getSheetData call to use something similar to getGameCollectionAsTemplateSystem but check packs instead? That would have to load the whole compendium though to see if it has templates I guess. Though you could probably filter for items of type _equippableItemTemplate or _template to limit the entries you'd have to search.

dense pine
#

This is a label inside an item template. I would like to display a certain label in my item container only when this Component key "TP_DICE" does NOT have the first value "0d6"
How do it set up the visibility formula?
This one doesnt work.

storm stump
dense pine
half beacon
#

Woke up this morning and opened an actor template to rearrange a panel. Changing the setting didn't work, and when I clicked/dragged it to a different area, it duplicated instead of moving. I closed out and restarted. Now clicking the template freezes Foundry. I'm also seeing this error in the console.

#

Also this. This line:

 ``` repeats about 10,000 times
low cape
#

Hi everyone!
Is it possible to display variables in roll/text messages as plain text instead of the variable boxes?

See image attached for an example case. The first message has my variable (of value 1) in that box, I would like it to look like the second message though.

formal goblet
low cape
formal goblet
low cape
#

Another question: I should be done with my system within the next week. I've seen there are some example compendiums or systems ready to download. I'm more than willing to share my system with the community - whom would I contact and figure out if they are interested?

formal goblet
storm stump
#

I'm trying to test it, but typescript isn't really my strong suit. Not sure how I can iterate over the index of a compendium in ts

formal goblet
low cape
formal goblet
formal goblet
low cape
#

Of course. The release would only happen after my group and I have tested out all the functionalities thoroughly. I will contact you once everything is optimized. Thanks 🙂

formal goblet
storm stump
#

I'm using ts and digging in the source of the CSB right now. Got it setup to build with yarn which is why I'm trying to hack it into CSB as a test right now.

formal goblet
#

Ah, I see. Then it is indeed TS (at least partially, because we haven't migrated everything to TS yet)

storm stump
#

I can iterate the packs and it's index just fine, but I can't seem to access the "type" property as it seems to be optional? or missing in the type description. I get a Property 'type' does not exist warning.

formal goblet
#

But that's something you can ask in the dev-channels of Foundry, because my knowledge there is also limited

storm stump
#

I think it should be, cause it should be part of the index which only holds metadata thats always loaded. But I'll keep poking around.

elder jasper
formal goblet
elder jasper
#

AtivarByakugan is the name of the macro

formal goblet
#

Give me the output of game.macros in the console

elder jasper
formal goblet
#

And item.macro_item should resolve to 'AtivarByakugan' ofc

#

Wtf, 215 entries? 😂

elder jasper
formal goblet
#

And now game.macros.getName('AtivarByakugan')

elder jasper
#

I put AtivarByakugan directly in getName and now I got this error

#

And I had the token selected when I pressed the use button.

formal goblet
#

Well, at least it's an object now, so you should be able to call execute() on that

#

Doesn't matter, you have no reference to an actor in this Script

elder jasper
#

So I would have to change the script construction as well?

formal goblet
#

I meant the Script in the Label Roll Message. Your Macro has a token-dependency, so you have to provide that

elder jasper
#

Oooooh It worked!!!!

#

GOD!!!!!!!!

#

ahsuashasu

storm stump
# formal goblet Then it's not part of the object? It also might be tight to the fact, that docum...

Got a working prototype, though implemented directly in the JS code of the system. I'm looking through the compendiums that match the entity type and search the compendium index (so in the always available metadata) for either "_template" or "_equippableItemTemplate" as their type. Then I request the found items from the compendium and then do the same checks you already do in the system:

async getSheetData(context) {
  let availableTemplates = getGameCollectionAsTemplateSystems(this.entityType).filter((entity) => entity.isAssignableTemplate).map((entity) => entity.entity);
  availableTemplates = availableTemplates.concat((await getCompendiumCollectionAsTemplateSystem(this.entityType)).filter((entity) => entity.isAssignableTemplate).map((entity) => entity.entity));

And then a similar thing in reloadTemplate:

...
let template = entityCollection.get(templateId);
if(!template) {
  template = await getTemplateFromPack(this.entityType, templateId);
}
if (!template) {
  throw new Error(`Trying to reload entity with undefined template : ${templateId} - ${this.entity.uuid} - ${this.entity.name}`);
}
...

Not sure if I'm missing anything else but that seems to work so far.

velvet heron
#

Here are the results from (top) a Roll Table taken from a character sheet macro and (bottom) the roll table result directly from the roll table.

What is the text to reference the roll table result image circled in red so I can reference it in the macro?

high stag
#

how can i get a string term to a dice roll?

the result 6d12dhkh its inside a [] so i don't understand how can i make it as a dice?
could someone help me with this?

latent wyvern
#

As far as Im aware you can't drop highest and keep highest at the same time? If you are, its a good idea to add the 1 after each one: 6d12dh1kh1

high stag
#

you can

high stag
#

It doesn't work, I tested it anyway.

formal goblet
wet helm
#

Hey everybody, the answer has probably been given already somewhere here but as I am a noob concerning Discord I have to ask again: Is there an easy way to add up a specific value (let's say "weight") of all items a character has "equipped"?

#

items in the sense of real "Items", the ones you drag and drop onto an item-container.

formal goblet
wet helm
formal goblet
wet helm
#

Got it working, thanks a lot again!

high stag
crisp citrus
#

Any idea why it's not updating? it's been like that since I went to v12

formal goblet
formal goblet
crisp citrus
formal goblet
crisp citrus
#

So it's not actually ready to update, even though it says it is

formal goblet
#

It had some updates, but only for V11. It was never V12-ready

crisp citrus
#

Ah ok. Thank you

high stag
#

if i want both the number of 6 in 2d6 and the result of [2d6] roll
how can i make this?

saying i call the [2d6] as ${roll}$
so its possible to view a list of the results?eg: ${roll[1]}$

Or does it only work with macros?

high stag
#

it works but i quite dont understand the results

why -1?

the idea its to highlight all the 12 or call the 12's quantity in another variable
and 6d12dhkh+-1 its a roll result 6 in the image.

#

with 12

formal goblet
#

I have no clue what your Roll Formula does tbh. Did you follow one of the examples in the Dice Modfifiers in the Knowledge Base of Foundry?

high stag
#

6d12
drop highest(10)
keep highest = result 7(first image)
then -1
=6

formal goblet
#

I think you have specify the amount of how many you want to drop and keep as well

#

And why the +?

high stag
high stag
#

however, even if discarded by the roll, these 12 need to be counted.

formal goblet
#

Then I have no clue if you're going the right direction. You can ask in macro-polo, they usually know more about the Foundry API

high stag
#

ok thanks either

high stag
#

its possible to save a result inside a macro?
as a variable.
like
let ${var}$ = x*y;

latent wyvern
#

Dunno about macros, but in roll messages: ${value:=5}$
you can hide the result with #, ${#value:=5}$

vagrant hollow
#

Hi, I am not sure if this is still interesting cause I am still on CSB 3.0.0

I tried using setPropertyInEntity inside an item container label roll message to change the value of an dropdown list inside an item.

Within the view of the item container it works perfectly. Can change the value an it shows it as wanted.

But if I open the item in 90% of my tries the dropdown list changes itself to the most top entry (not default). When simply closing the item the shown value inside the item container changes to this unwanted most top value of the list.

Only sometimes when opening the item (ca10%) the dropdown is on the right set value.

Should I open a ticket for this?

formal goblet
vagrant hollow
formal goblet
vagrant hollow
formal goblet
vagrant hollow
high stag
#

Hi!
im having a bit of confusion with the macro itself.

  • its possible to save a result inside a macro?
    as a variable.
    like
    let ${var}$ = x*y

and i only can see the results of a macro roll.evaluate()
if i use the roll.toMessage

  • There's a way to the roll.total(idk) show the tooltip when hovered?
#

the macro

#
${#mod:= [-%{return await game.macros.getName('HE').execute({entity: entity})}%+${fetchFromDynamicTable('escondidos_atributo', 'escondido_atributo', 'keyescondidos_atributos', sameRow('talentotree_atributo',fisico))}$]}$${#%{
let mstr = ${sameRow('talentotree_tree', 0)}$
let dice='2d13dhkh';
if (mstr<=0) {
    dice = Math.abs(mstr)+3+'d13kl';
}else {
    dice = mstr+1+'d13dhkh';
};
const formula = dice + "+" + ${mod}$;

const roll = await Roll.create(formula).evaluate();
const result = roll.total;
const maxRolls = roll.dice.reduce((acc, curr) => acc += curr.results.filter(r => r.result === curr.faces).length, 0);
let speakerEntity;
switch (entity.entityType) {
    case 'actor':
      speakerEntity = entity.entity;
      break;
    case 'item':
      speakerEntity = entity.entity.parent;
      break;
    default:
      speakerEntity = null;
}
const speakerData = ChatMessage.getSpeaker({
    actor: speakerEntity,
    token: speakerEntity?.getActiveTokens()?.[0]?.document ?? null,
    scene: game.scenes.current
});
if (maxRolls>2) {
    const wait = async (ms) => new Promise((resolve)=> setTimeout(resolve, ms));
    const file = "Músicas/SFX/UI/crit.mp3";

    AudioHelper.play({src: file, volume: 0.8, autoplay: true, loop: false}, true);
    await wait(1450);
};
let md = '🌸';
let txt = md.repeat(maxRolls);
await roll.toMessage({
    user: game.user._id,
    speaker: speakerData,
    flavor: txt
});}%}$
#

to clarify: trying to make a simple return result;
i only get the result but not the tooltip of the dice values.

formal goblet
formal goblet
# high stag and that?

Well, a Macro is nothing more than a Document and every Document has the flags-property, where custom data from various sources can be stored (if I've understood you correctly that you want to store data in a Macro Document)

high stag
#

i mean:
let ${mod}$ = 3;
but that doesn't work

formal goblet
#

So you want to return a result from a Macro?

high stag
#

i tried ${mod:=maxRolls}$

high stag
high stag
#

ok.
thanks

high stag
formal goblet
high stag
#

the roll.toMessage i used when i lost hope of making it shows the dices value. lol

#

The ideia its to use the default chat message from CSB

#

but i cant figure that : (

velvet heron
high stag
# high stag but i cant figure that : (

so the script will return result;
${roll:=[%{}%+${mod}$]}$
and something like this.
but if i do it that way
it shows the result of %{}%+mod
and dont show me the dice value.

formal goblet
# high stag The ideia its to use the default chat message from CSB

Well, that would require to work with an instance of a ComputablePhrase or your own chat enhancements (which is actually quite a lot of logic).

high stag
#

Thanks

high stag
#

one more thing srry
its possible to make another input command to choose the roll?
the midi D&D5e you have the "O" for the other roll, the "V" for versatile.

timid agate
#

Is there's a way to roll dice and then use the results later ?
( in a roll message )

I've tried something like this
${#roll:=[(:dicetotal:)d6]}$.
But it doesn't work

#

Trying to condense this.
By making advantage and disadvantage 4+ / 6. use the same roll result from the first one

<p style="text-align: center;">Total Dice Rolled: ${![:dicetotal:]}$</p>
${switchCase(rolltype, 'normal',
<p style="text-align: center;">Successes:${[(:dicetotal:)d6cs>=5]}$</p>,
'adv', <p style="text-align: center;">Successes:${[(:dicetotal:)d6cs>=4]}$</p>,
'dis', <p style="text-align: center;">Successes:${[(:dicetotal:)d6cs>=6]}$</p>}$```
latent wyvern
#

You could change the success condition instead of using a switch to choose a formula.
Example:

${#successvalue:= condition ? 4 : 6}$
Roll result: ${[:dicetotal:d6cs>=:successvalue:]}$

This will also avoid weird consequences with 3d dice rollers and reduce the display when clicked on

timid agate
#

alright, since the system i have are d6's, the more dice to roll the better the chances.

latent wyvern
#

Thats a lot of d6 systems

#

What Im saying is that the roll is intended to only roll once, but in your case foundry is rolling 3 times then showing the result you want

#

Also for your question on storing roll value:
${result:=[1d6]}$ works just fine for me

#

Just keep in mind again that hiding it with # will still roll it behind the scenes for 3d dice rollers

timid agate
#

luckly 3d dice rollers, won't be a thing for me

latent wyvern
#

Yea as long as you don't intend on sharing it with others then yea

timid agate
#

Well the system isn't able to hold the result if ${result:=[1d6cs>=5]}$

#

i've tried using kh (keep highest). but the result is not array friendly. Say out of 6 dices, 5 6 3 2 1 6 for your rolls. There are 3 successes (because anything 5 and up are found), but it only counts for 1 successes no mater what.

latent wyvern
#

I've just tested this on my world and it stores and counts successfully

${result:=[6d6cs>=5]}$
${result}$
#

Sorry I think Im misinterpreting your intentions

timid agate
#

no worries, but are we able to use the result and find out if there are any number 4 or greater? without rolling again.

timid agate
#

sweet

manic mason
#

Hello.

zinc verge
#

I'm getting a very funky error

manic mason
#

What is it?

zinc verge
#

fixed it. I appreciate the help 💀

#

trying to type out the issue rubber ducked me into solving it

manic mason
#

At least you got it fixed

#

currently facing why my character sheet is no longer showing up for me

#

I know it is likely due to me breaking each of the tabs for the character sheet in there own parts to make it easiler to work on with without messing all up