#Custom System Builder

1 messages · Page 26 of 1

stone swan
#

Ok. This is the new version I have:


let phrase = new ComputablePhrase(rollText);
await phrase.compute(this.entity.system.props, {
  computeExplanation: true,
  triggerEntity: entity
});

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

phrase.postMessage({
  speaker: speakerData
});}%```
#

I'm getting an error saying "Cannot read properties of undefined (reading 'system')"

formal goblet
#

4th line: remove this.

stone swan
#

Ok. That mostly works. It now posts to chat rolls are parsed correctly, but there are three new issues.
First, the proper chat message is followed by a second one that just says "undefined" in a grey box.
Second, if the Rich Text Area has a second line, it causes an "Invalid or unexpected token" error and nothing posts.
Finally, finally, while things like ${[1d30]}$ are parsed correctly, {${sameRow('SillyAbilityName')}$ causes an "Unexpected identifier' error.

formal goblet
stone swan
#

Well, I'm glad some of the problems were more complex than just me failing to read. 😝 Throw done does fix the extra message, so that's good.

stone swan
#

As for the third part, writing and calling abilities from a dynamic table is sort-of an MVP version of what I want to do. I think, ultimately, I'd like to have abilities come from items inside of another item that gets added to an item container on the sheet, but it sounds like that would complicate things further?

formal goblet
formal goblet
stone swan
#

Well, I'm glad I asked about that before trying it.

stone swan
normal ore
#

game.actors.getName('Somae').system.initiative
undefined

formal goblet
formal goblet
normal ore
#

But it's with initiative! Isn't this the initiative?

formal goblet
formal goblet
normal ore
formal goblet
stone swan
# formal goblet In the Script. ```js const dynamicRowRef = '${sameRowRef('columnKey')}$'.split(...

I hate to keep doing this, but A) I'm not sure if I'm implementing that correctly and B) It seems to be breaking things in new and interesting ways.

I'm assuming the constant declaration goes after the rollText declaration we already have and the rest of it replaces the await phrase section that follows the let phrase section from the old version. Unfortunately, that seems to just dump the contents of the roll message into the chat, as plain text. I also tried a few other variations that all produce the same results.

#

Also, is the reference line supposed to be using back ticks instead of single quotes? (It produces the same results either way.)

formal goblet
formal goblet
stone swan
stone swan
#

Just in case, here's the full roll message I'm using:

%{const rollText = '${sameRow('SillyAbilityText')}$';
const dynamicRowRef = '${sameRowRef('SillyAbilityText')}$'.split('.');

let phrase = new ComputablePhrase(rollText);
await phrase.compute(entity.system.props, {
  computeExplanation: true,
  triggerEntity: entity
  reference: `${dynamicRowRef[0]}.${dynamicRowRef[1]}`
});

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

phrase.postMessage({
  speaker: speakerData
});
throw 'done';}%```
formal goblet
stone swan
formal goblet
half beacon
#

Any idea what would cause checkboxes from an item container to operate slower? It used to be fairly quick. Now it lags for about 3 seconds between clicks.

formal goblet
half beacon
#

Ah. No fixing that?

formal goblet
#

Nope, CSB is compute-intensive and not well-optimized

stone swan
half beacon
#

Maybe I can think of some type of workaround then

formal goblet
stone swan
#

Do you mean the error message it's producing when I try an ability that has a sameRow() in it, or is this something more advanced?

formal goblet
#

I also take the error message if it's a different one

stone swan
#

Is this what you're looking for?

formal goblet
#

Yep. Seems correct

stone swan
#

The error is just the same "Unexpected identifier 'sillyAbilityName'".

formal goblet
stone swan
#

Is this the one you want?

stone swan
#

I think I might have figured out why having multiple lines in the Rich Text Area doesn't work. If you use the rich text editor to write some text and put it into a block quote, then the source code it generates will end up looking like this:

<blockquote>
<p>Test</p>
</blockquote>

And that will produce the same error as adding a new line (which the rich text editor represents with two paragraph blocks). However, you can go in and remove the inner <p> tag in the block quote example, to get code that looks like this:

<blockquote>Test</blockquote>

And that will run just fine. Similarly, manually creating a new line with a <br> tag, which also keeps the code to a single line, also runs. So it seems like the error occurs when the Rich Text Area's source code has multiple lines.

formal goblet
# stone swan Is this the one you want?

After some heavy testing...:

%{
const ref = '${!sameRowRef('rta')}$'.split('.');
const rollText = foundry.utils.getProperty(entity.system.props, ref.join('.'));

let phrase = new ComputablePhrase(rollText);
await phrase.compute(entity.system.props, {
  computeExplanation: true,
  triggerEntity: entity,
  reference: ref[0] + '.' + ref[1]
});

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

phrase.postMessage({
  speaker: speakerData
});

throw 'done';
}%

It's safer to get the RTA-content through the Script directly instead of using nested Formulas. The quotes inside the text made them appear in the Script-Expression, that's why they caused syntax-errors.

stone swan
#

That seems to have solved the multi-line issue. (Though, if anyone else needs to reference it, the last ;was changed into a :.

#

Thank you for your help with that. If we can figure out how to get the references working, that should solve all of my problems.

formal goblet
#

References weren't even broken, it had issues with quotes in the content 😅

stone swan
#

Huh. ... Either I'm misunderstanding something or you accidentally solved two problems at once.

formal goblet
#

Simply this here ${'just text'}$ would already break it

stone swan
#

With the latest version, multiline RTA-content works as does something like ${Lv}$. However, ${sameRow('SillyAbilityName')}$ still doesn't work.

formal goblet
stone swan
#

That solves it!

#

I think I should be able to put together a really good sheet now. Again, thank you for all your help and for taking the time to trouble shoot through all of that.

formal goblet
#

np

wind siren
#

Hello, im trying to define a range in a formula for visibility control, basically so that only levels 4-7 the element will show. I've tried the following but cannot seem to get it to work:

pclevel = 4:7
pclevel = [4,5,6,7}

Thank you in advance!

wind siren
stone swan
#

So. ... I think I encountered another issue when referencing RTA-content. Targeted successes on dice rolls seem to always parse as failures. So, for example ${[(1d3cs>=2)*2]}$ always results in 0, even if it shows a roll of 2 or 3.

stone swan
#

This is an odd question (and there might be a better way to go about what I'm doing), but I know you can sum checkboxes in a dynamic table. Is there a way to sum only a specific number of rows from that table? (So, for example, if you have 7 rows of check boxes, only sum the first 3.)

raw terrace
#

Has anyone come up with a way to manage slot-based inventories with CSB?

fierce harbor
raw terrace
raw terrace
#

Related quesion, how do I increase an existing item's quantity if another one of those items is dragged on to the character sheet (at the moment it just adds another instance of the item)? Item's quantity is GEAR_quant.

formal goblet
raw terrace
#

Okay, by chance is there an example of this somewhere?

formal goblet
#

No

raw terrace
#

Okay, I'll try to figure it out.

spiral dome
#

Is it possible for an item (spell) to refer to another item (skill)?

spiral dome
somber bay
#

So... Items cannot have item containers and even if they do, they will not work.

#

That said if you create a label (or whatever) you can change the type to item container which is useless... unless you do it as a sub template. Which means you can have a saved item container you can drop into different spots of actors.

formal goblet
#

You can achieve that with CSS

formal goblet
foggy grotto
formal goblet
# foggy grotto Is there a way to reference the image elsewhere in a label?

Well... You could reference the image path via a little Script. The image path is part of the Actor. Try out game.actors.getName('actorName') in the console to find the image-path (because I don't know it from the head). Then you can just use %{return entity.entity.<whatever the path is>}% to get the path and insert it into a custom img-tag.

somber bay
foggy grotto
#

Is there a command to delete a row in a dynamic table?

wet heron
#

Hello there!
Is there any update reguarding GM roll only with a button?

wet heron
latent sorrel
wet heron
#

it is no worries, erlier i had misunderstood that a roll through a button always was open for all to see, but i wans mistaken

spiral dome
#

A little bug report (I think 😄 )
I have an item container with a column named Special Rules. I want this column to show an 'X' when the item has something written in the 'Special Rules' rich text area of the item, when there is nothing in the 'Special Rules rich text area, the column should be empty.

The column uses this formula: ${equalText(string(item.skillSpecialRules),'') ? '' : 'X'}$ this works.

In this example, look at the skill 'Explosives'. In the top left corner, I just added this skill item. The table shows an 'X'. The 'Special Rules' rich text area in the item is empty though. When I edit the rich text section, leave it blank and save it, the table shows nothing as it is supposed to.

(When I do add text to the field, the 'X' is shown as is it should).

formal goblet
spiral dome
spiral dome
# formal goblet Because the Rich Text Area adds `<p></p>` when saving (you can see this if you e...

Hmm, I did some more testing, and I do no see the <p></p> in the Rich Text Area if there is no text. Only if there is text it adds the Paragraph.
I tried to test it a bit more. The 'Flexible' skill I saved the empty special rules, and as it's supposed to, there is no 'X'. The 'Long Arms' skill has a special rule. The formula recognizes it's not empty, and add the 'X'. I added the 'Music' skill, and as you can see it's an empty text area, but the formula does not recognize it as being empty.

I also made a column 'Test', with the formula ${equalText(string(item.skillSpecialRules),'<p></p>')}$ but as you can see it returns a negative on each row.

#

ah, I found it. I ran another test, this time with ${equalText(string(item.skillSpecialRules),'') ? '' : string(item.skillSpecialRules)}$, as you can see, the Rich Text Area gets a value 'Undefined'

formal goblet
spiral dome
fierce harbor
#

Any chance to limit the width of reference colmn in an item container? I'd like to have all columns aligned even when the reference one (Name in my case) changes in length.

crimson urchin
#

Howdy! I just started using CSB and I love it, but I have a question about creating custom roll formulas meant to emulate the Forged in the Dark / Year Zero game engine.

I've figured out how to get a "keep highest" out of a dice pool, but how can I include conditional modifiers to increase or decrease the dice pool size? The code as of now is:

${[: 'relevant attribute' :d6kh]}$

Your help is very much appreciated, and thank you so much for your hard work on this.

formal goblet
crimson urchin
#

Yes, there are multiple attributes, e.g. "moxie," such that the code reads:

${[:moxie:d6kh]}$

But I also have a checkbox for a harm condition of "Broken" that reduces the pool by 1. I am also hoping to include additional positive and negative modifiers that adjusts the final size of the dice pool when rolled. I saw the example you featured above:

${broken ? 1 : 0}$

but how do I incorporate that into the final pool size code?

formal goblet
crimson urchin
#

Oh my gosh that worked instantly! That's fantastic.

Is there a way to incorporate a dialog box or field for additional modifiers prior to executing the roll?

crimson urchin
#

Thank you!

silver lake
#

Is there a way to make a number field, where if I change it, it saves what value it was before the change?
Like for example, say a player spend points in stats, but the changes only save once the player clicks a button. So in this case, you must press a button to commit to all changes.
Is this possible with this system?

formal goblet
silver lake
#

Okay, thank you.

stone swan
#

I think there might be a way to do a work around, though it might be a little inelegant. The basic idea would be to have a duplicate set of numbers that are not visible to the player and, when you hit the commit button, those hidden variable are updated with the new values, but until you hit the commit button they'd have the old values and you could press a different button to retrieve them.

#

Depending on how you want to handle things, you could also set it up with an "entry" number field, a hidden "storage" number field and a "committed" label that points back to the storage number field.

stone swan
#

So, another odd question, but is it possible to use math.js's ability to take subsets of a matrix with either CSB formulas or scripts?

alpine tiger
#

Is there a good video tutorial to create a character sheet. I have a Character Sheet (Battletech's A Time of War) I would like to create a template for. I would like the possibility of creating Skills/Traits/Equipment Items and drag-and-drop onto the Character Sheet.

silver lake
#

I do have another question, however. How do I make the sheet perform formulas without throwing anything in the chat?
I tried adding '#' to the beginning but that still sends an empty chat message with a roll sound.

stone swan
# silver lake I'm figuring out some way. But to be honest I didn't entirely comprehend what yo...

I don't think this would work with actual hidden values, since it's based on using setPropertyInEntity() and I'm pretty sure that doesn't work with hidden values or Labels, so instead you'd want to create a set of number fields in a panel and set the panel's visibility formula to false, that way no one will be able to see it.

The most basic setup would be a visible number field (that the user edits), an invisible number field, a commit button, and an undo button. Pressing the commit button would run something like setPropertyInEntity(self, 'InvisibleNumber', 'VisibleNumber') to copy the newly entered values to the invisible fields. Then, if the player wanted to undo the operation, they'd press a second button that, effectively, runs the opposite command.

#

Did that make more sense?

silver lake
#

I think yes, but I'll have to come back to your message tomorrow when my brain isn't soup. I'm pretty tired.

#

Thank you for the swift response.

silver lake
#

Cause I want a button in the sheet to change some values, without throwing anything in the chat, or being visible at all. Cause it gets annoying very quickly.

stone swan
#

I don't know if it will cause other problems, so please be careful with this, but you could follow your CBS formula with %{throw 'done'}%.

wind siren
#

Hello friends, I was wondering where do i start if I want to sum up a column from a item container column? Such as goldvalue or weight?

formal goblet
formal goblet
stone swan
formal goblet
stone swan
#

Even in Scripts?

formal goblet
#

Should be fine in Scripts, but you don't have access to the utility functions of math.js in there

stone swan
formal goblet
#

btw @stone swan , this might be useful for you in the future (only needing to call entity.templateSystem.processRollMessage()). It's a byproduct from a small refactoring.

stone swan
formal goblet
stone swan
#

Still, good to know and something to look forward to. Thanks for telling me.

#

Also, here's a weird one. Using sum() on the output of fetchFromDynamicTable([stuff that points to a column of booleans]) you get a numerical response, but if you use run the output through a segment of Script and slice it, before passing it to the sum in a CBS script, you get an error.

formal goblet
#

I've also included options as global variable in Scripts, so that you can directly reference options.dynamicRowRef instead of the workaround we did with sameRowRef()

formal goblet
stone swan
silver lake
# silver lake What dangers could this pose?

Just going to bump my question:

And make a new one.
Why does setPropertyInEntity() only work 1/3 of the time? Often when activating it, it will change the value for a few moments, then the value will change back.

formal goblet
stone swan
#

Wait, so going from script to csv creates a string that just happens to look like a CSV array, because it was made from an array?

formal goblet
#

Some edge-cases for Script -> CSB:

    _castScriptResult(value) {
        if (value === undefined) {
            return 'undefined';
        }

        if (value === null) {
            return 'null';
        }

        if (typeof value === 'object' && !Array.isArray(value)) {
            return 'object';
        }

        if (!(typeof value === 'number' || typeof value === 'boolean')) {
            return `'${value.toString()}'`;
        }

        return value;
    }
stone swan
#

Ok. I think I solved it by using math.sum() while still inside the script portion.

silver lake
#

So, is there anyway to make formulas in the sheet produce no chat notifications?

formal goblet
silver lake
formal goblet
stone swan
silver lake
#

It's okay, thank you!

#

I do have one question, I'm still having issues with the setPropertyInEntity

#

It doesn't work a lot of the time.

#

I have this button:

${#setPropertyInEntity('self', 'CIntellect', "CIntellect - SInt")}$

${#setPropertyInEntity('self', 'SInt', "SInt = 0")}$

%{throw 'done';}%
#

It usually only does the first part of it.

#

Sometimes both.

silver lake
#

But it works sometimes.

#

What is invalid about it?

formal goblet
#

CSB doesn't have =

silver lake
#

But I tried with - "thing equal to zero"

#

And the " = " worked more often

#

both don't work though.

stone swan
#

You just want a '0' in the last section.

silver lake
#

or rather, don't work consistently.

silver lake
stone swan
#

Is there a convenient way to make labels count up as they go down a dynamic table (or to make text fields non-editable)?

silver lake
#
${#setPropertyInEntity('self', 'SInt', "SInt '0'")}$

So this would work?

stone swan
#

That is inconvenient.

formal goblet
silver lake
#
${#setPropertyInEntity('self', 'SInt', "0")}$

Does not work :/

#
${#setPropertyInEntity('self', 'CIntellect', "CIntellect - SInt")}$

${#setPropertyInEntity('self', 'SInt', "0")}$

%{throw 'done';}%

Only the first one works now, always.

#

Well, besides the 'throw done', that is working fine

stone swan
#

Just to be safe, what is SInt?

#

Also, I think I already know the answer to this one, but is there a way to make the rows of a normal table the same height as the rows of a dynamic table?

silver lake
silver lake
#

both SInt and CIntellect are number fields.

silver lake
#

It didn't really work, but it was a few months ago.

stone swan
stone swan
silver lake
silver lake
stone swan
silver lake
#

No errors.

#

In both the one I was using before, and the new one Martin sent me.

stone swan
stone swan
silver lake
formal goblet
#

Try to swap the positions

silver lake
#

And it doesn't send anything in chat.

#

But the SInt stays intact.

silver lake
#

If I swap them won't it try to lower CIntellect by 0?

formal goblet
stone swan
#

Wait, what do you mean by "the button's key is the 'Sint'"?

silver lake
silver lake
#

I'm still very tired.

#

Thanks guys!

#

All's working now.

#

Have a great time! All the love

stone swan
#

Glad to help.

formal goblet
#

Wait, how's that working? 😅

silver lake
#

Btw

${#setPropertyInEntity('self', 'SInt', "SInt = 0")}$

The '=' does seem to work. It's in fact the one that is working.

#

I will try it with just the "0" and come back before I leave

stone swan
#

I've tried it with just the 0 and it works fine.

silver lake
#

It works fine both ways.

stone swan
#

A ternary isn't going to like it if I do something like equalText([Lv]Facet, major)?1:0 and half the time [Lv]Facet evaluate to something that doesn't exist, is it.

silver lake
#

This worked fine. It just takes like, 1.5 seconds to 3 seconds to load.

formal goblet
#

I smell race conditions...

stone swan
#

Oh, good, that's not just me.

silver lake
#

I don't know what that means.

formal goblet
silver lake
stone swan
#

I think I'm misunderstanding something. The Formula System wiki page says " If you still need short-circuiting conditionals, use Script-Expressions instead," which lead me to believe that the false portion of a JS if statement wouldn't run. That doesn't seem to be the case.
What am I missing and what should I use instead?

formal goblet
stone swan
# formal goblet That should still be valid. Can you provide more details?

This is the code I'm trying to run:

%{MajInnerStars=[${fetchFromDynamicTable('TPerks','TPerksMaj')}$];
Lv=${Lv}$;
if (Lv%2===0 && Lv<14){
    MajAdj = ${(equalText(ref(concat(string(Lv),'LvFacit')), 'Major')?1:0)}$;
} else{
    MajAdj=0;
}
MajLv=math.floor((Lv+1)/2)+MajAdj;
return(math.sum(MajInnerStars.slice(0,MajLv))+0);
}%

[Lv]LvFacit only exists when Lv is even and less than 14. I thought my if statement would take care of that, but I keep getting errors about 1LvFacit.

formal goblet
stone swan
#

I'm thinking create a hidden attribute called "0LvFacit" and have the if statement set MajAdj = 0 if its false or Lv if its true, then move the CBS code to the MajLv line?

#

Wait, no, that doesn't work either, because I can't easily pass the MajAdj back into the CBS formula.

formal goblet
#

And you probably want to use const or let for variable declaration, otherwise it will implicitly use var

stone swan
#

Also, I may have figured out a solution, but it's kind-of horrible.

((((Lv%2==0)?true:false)*((Lv<14)?true:false))?Lv:0)LvFacet

#

There is a part of me that hopes that won't work.

#

... I didn't bother to check if logical and works in CBS before doing that. It seems to, which drastically simplifies things.

formal goblet
formal goblet
stone swan
#

... ref() doesn't work on hidden attributes and it's necessary for dropdowns, right?

#

Either way, I'm making lots of silly mistakes, so I think I'm going to call it a night.

formal goblet
#

And it's not necessary for Dropdowns, it depends on the use-case. But it's commonly used together with Dropdowns

stone swan
#

I spelled the hidden attribute's name wrong. (Or, more accurately, I spelled it wrong everywhere else and correctly for the hidden attribute.)

formal goblet
#

Happens 😅. Copy Pasta can help there

stone swan
#

Ok. I've actually got that thing working. I'm still probably going to call it a night and read the page you linked before replicating it for the other two columns.

#

As always, thanks for all the help.

#

Oh, before I go, if I put Scripts in Hidden Attributes, does it matter if different hidden attributes have internal variables that are the same or should they all be unique?

earnest imp
#

Hey guys, any pointers on how to modify the value of an entry in dynamic table with item modifier?

formal goblet
formal goblet
patent dust
#

Hello everyone! I don't know if this question was already made, but is it possible to disable (even only temporarily) these warnings?

#

They appear everytime I make a modification on the character sheet. I changed the template of some items attached to an actor, and now I get warnings about that every single time I modify some data on the character sheet. It's annoying. The only workaround I know is to create a new character and giving it all the new items created after the change of template.

formal goblet
silver lake
#

Is there a way to make a Number Field that the players can't change, and can only be changed by other sheet buttons making alterations to it?

#

Or only through making a chain of invisible numbers?

#

invisible keys*

silver lake
#
${#?{INT:'INTELLECT'} ?{PER:'PERSPECTIVE'} ?{PRE:'PRESENCE'} ?{AGI:'AGILITY'} ?{DEX:'DEXTERITY'} ?{STR:'STRENGTH'}}$

${CS:= INT+PRE

${#setPropertyInEntity('self', sameRow('CSpheres'), ref(sameRow('CSpheres')) - (INT + PER + PRE + AGI + DEX + STR))}$

${#setPropertyInEntity('self', 'SINT', "SINT + INT")}$

${#setPropertyInEntity('self', 'SPER', "SPER + PER")}$

${#setPropertyInEntity('self', 'SPRE', "SPRE + PRE")}$

${#setPropertyInEntity('self', 'SAGI', "SAGI + AGI")}$

${#setPropertyInEntity('self', 'SDEX', "SDEX + DEX")}$

${#setPropertyInEntity('self', 'SSTR', "SSTR + STR")}$

%{throw 'done';}%
#

In this formula, how can I make this part:

${#setPropertyInEntity('self', sameRow('CSpheres'), ref(sameRow('CSpheres')) - (INT + PER + PRE + AGI + DEX + STR))}$

More precisely, turn this: (INT + PER + PRE + AGI + DEX + STR) into one key?

#

Cause I think this formula isn't working because they're separate.

#

I tried ${CS:=(INT + PER + PRE + AGI + DEX + STR)}$
But I still get the same error, which is this:

quasi plume
silver lake
#

Lemme see where the quotes might go

silver lake
# quasi plume From my limited knowledge and just reading the formula, you forgot the double qu...
${#?{INT:'INTELLECT'} ?{PER:'PERSPECTIVE'} ?{PRE:'PRESENCE'} ?{AGI:'AGILITY'} ?{DEX:'DEXTERITY'} ?{STR:'STRENGTH'}}$

${#setPropertyInEntity('self', sameRow('CSpheres'), "ref(sameRow('CSpheres')) - (INT+PER+PRE+AGI+DEX+STR)")}$

${#setPropertyInEntity('self', 'SINT', "SINT + INT")}$

${#setPropertyInEntity('self', 'SPER', "SPER + PER")}$

${#setPropertyInEntity('self', 'SPRE', "SPRE + PRE")}$

${#setPropertyInEntity('self', 'SAGI', "SAGI + AGI")}$

${#setPropertyInEntity('self', 'SDEX', "SDEX + DEX")}$

${#setPropertyInEntity('self', 'SSTR', "SSTR + STR")}$

%{throw 'done';}%

Same error.

quasi plume
#

The first part of the formula is a user input correct?

silver lake
#

That part works fine

#

and the rest of the formula works dandy too. The only thing that doesn't work is this line:

${#setPropertyInEntity('self', sameRow('CSpheres'), "ref(sameRow('CSpheres')) - (INT+PER+PRE+AGI+DEX+STR)")}$
#

The top one is with the " " from this line "ref(sameRow('CSpheres')) - (INT+PER+PRE+AGI+DEX+STR)"
And the bottom error is without the " ".

#

With the " " the error speaks more directly about that line. I'm not sure if that's relevant though.

quasi plume
#

Hmmmm......

silver lake
#

Thanks for brainstorming with me btw.

quasi plume
#

No problem.

#

Can I ask what you're trying to accomplish with the formula? To better understand.
Part of me thinks it might be the user input, it looks funny. because it looks like you set it up as a conditional and the readme doesn't have ? between the options for user input which would funk up the formula further down.

silver lake
#

That's about it.

#

It adds the points to the Stats just fine. It simply doesn't subtract these points from the value within its own dynamic table.

quasi plume
#

Can you reuse the result of the user input like so?

`${#keyKey:=?{INT:'INTELLECT'} ?{PER:'PERSPECTIVE'} ?{PRE:'PRESENCE'} ?{AGI:'AGILITY'} ?{DEX:'DEXTERITY'} ?{STR:'STRENGTH'}}$

${#setPropertyInEntity('self', sameRow('CSpheres'), "ref(sameRow('CSpheres')) - keyKey")}$`

Basically like the usual reuse later in the formula component CSB has.

formal goblet
silver lake
formal goblet
silver lake
#

Or rather, a thing*

formal goblet
#

You can test that out in a Label, so that you actually see the difference

silver lake
#

Then, it would look like this?:

${#?{INT:'INTELLECT'} ?{PER:'PERSPECTIVE'} ?{PRE:'PRESENCE'} ?{AGI:'AGILITY'} ?{DEX:'DEXTERITY'} ?{STR:'STRENGTH'}}$

${#setPropertyInEntity('self', sameRow('CSpheres'), sameRowRef('CSpheres') - (INT+PER+PRE+AGI+DEX+STR)")}$
silver lake
#

oh, okay.

#

I'mma try that

#

Okay, I got something different, it's now changing the number in the CSpheres to ERROR.

#
${#?{INT:'INTELLECT'} ?{PER:'PERSPECTIVE'} ?{PRE:'PRESENCE'} ?{AGI:'AGILITY'} ?{DEX:'DEXTERITY'} ?{STR:'STRENGTH'}}$

${#setPropertyInEntity('self', sameRowRef('CSpheres'), "ref(sameRow('CSpheres')) - (INT+PER+PRE+AGI+DEX+STR)")}$
silver lake
#

I'm going to rest now. I'll come back to it tomorrow.

silver lake
quasi plume
#

Sleep well

silver lake
#

Thank you as well Martin.

empty glen
#

I'm trying to set up a hidden attribute. Not sure how to go about that.

#

More specifically I want to set the value of a hidden attribute based on a stat from an item on the actor's sheet.

empty glen
#

I just created an element and then hid it with css. Is there any particular reason I shouldn't do it that way?

formal goblet
warm flower
#

Hey @formal goblet by any chance you guys developed an BSA file to cover CSB system to use Beaver's Crafting Module?

formal goblet
warm flower
silver lake
#
${#concat(string(?{INT:'INTELLECT'[number]|0}), string(?{PER:'PERSPECTIVE'[number]|0}), string(?{PRE:'PRESENCE'[number]|0}), string(?{AGI:'AGILITY'[number]|0}), string(?{DEX:'DEXTERITY'[number]|0}), string(?{STR:'STRENGTH'[number]|0}))}$

${#setPropertyInEntity('self', sameRowRef('CSpheres'), "ref(sameRow('CSpheres')) - (INT+PER+PRE+AGI+DEX+STR)")}$

${#setPropertyInEntity('self', 'SINT', "SINT + INT")}$

${#setPropertyInEntity('self', 'SPER', "SPER + PER")}$

${#setPropertyInEntity('self', 'SPRE', "SPRE + PRE")}$

${#setPropertyInEntity('self', 'SAGI', "SAGI + AGI")}$

${#setPropertyInEntity('self', 'SDEX', "SDEX + DEX")}$

${#setPropertyInEntity('self', 'SSTR', "SSTR + STR")}$

%{throw 'done';}%

Value still becomes "ERROR".

formal goblet
silver lake
#

Number Field in the same Dynamic Table row as this button.

#

It contains 20.

formal goblet
#

Remove ref()

silver lake
#

If I set, let's say, INT to 1, it should reduce by 1, but it turns it into an ERROR.

#

Okay

#

It works perfectly now

#

I think it had "ref()" because I pulled from another old one I had made to pull from a dropdown.

#

I have to re-learn this every time I make a new system xD

silver lake
#

I love CSB, and thanks to it I can actually read most JS things now, even though I still make plenty of mistakes.

earnest imp
#

Any way to use a %{}% inside a ${}$ inside a %{}%?

See %{skill}% inside for reference, which is already declared inside the for

%{
    // Initialize variables.
    let skill_string = `${fetchFromActor('GM Panel', "fetchFromDynamicTable('atk_skill_table', 'atk_skills')")}$`;
    let skill_string_with_proficiency = ``;

    let skills = skill_string.split(",");
    for (let skill of skills){
        let proficiency = `${fetchFromDynamicTable('skills', 'proficiency', 'skill, '%{skill}%')}$`;
        console.log(skill, proficiency);
    }

    // console.log(skills);
}%```
normal ore
#

Hey guys, how's it going?
I have a question that might be quite simple to answer:

I wanted a certain item to appear in an Item Container only if a condition were true, is that possible?

For example: Let's say I have a skill that's already on the character sheet, but it will only appear when the character reaches level 5.

formal goblet
formal goblet
normal ore
stone swan
#

I'm trying to set a dropdown list using a formula, but I'm getting an error, on the template sheet no less, and I can't figure out why. This is the formula I'm using:
${fetchFromDynamicTable('WepPropList', 'WepProp', 'PropReq',WepClass,!==)}$

#

Also, in case it matters, WepClass is defined by a different dropdown, that's outside of the Dynamic Table.

#

Nevery mind.

#

I just figured it out.

formal goblet
earnest imp
#

oooooh thanks for the quick code

#

gotcha

stone swan
#

I think I just figured out a WAY simpler way to do the calculations I was trying to do last night. Rather than bothering with all of that java script stuff, I can just create a hidden variable that calculates the adjustment and another hidden variable that uses the filter function of fetchFromDynamicTable() to get the part of the table I wanted. I just needed to add a numbered column to the table. (I don't suppose there's any way to get a Label in a dynamic column to calculate its own position, is there?)

half beacon
#

Is it possible to use quotation marks within a string for html? Something like this works
out += "<b>Fireball!</b>";
but I'd like to be able to do something like this within a roll message to change the text color
out += <style="color:green">
or maybe I'm approaching this totally wrong

formal goblet
stone swan
#

... Probably not worth the effort.

formal goblet
stone swan
#

I feel like some way to easily reference the index of a row would be useful, if only so you could do things like have a column that counts up.

half beacon
formal goblet
half beacon
formal goblet
half beacon
stone swan
#

Just to double check, but what is the context for this?

formal goblet
stone swan
#

I think I already know the answer to this, but is there a way to get the names column from an item container into a dropdown list?

half beacon
# formal goblet Can you post the full code?

It's a disgustingly extensive script. But even cutting it down to just that part, the result is the same.


const skillTemplate = game.items.getName("_SkillsTemplate").id;
const skillName = entity.items
            .filter(item => item.system.template === skillTemplate)
            .filter(item => item.system.props?.Active == 'true').map(item => item.name);

if(skillName[0] == 'Athletics'){ out += '<p style=\"color:green\">Athletics!</p>'; }

return out;```
formal goblet
half beacon
#

Goddammit even var is outdated now? I'm rapidly aging.

formal goblet
#

Yeah, that's only used by old browsers nowadays.

half beacon
formal goblet
stone swan
#

Here's a wierd one. I'm using equalText('ItType', 'Other') to test a dropdown selection. Unfortunately, it's returning false, even when ItType is set to Other and `${ItType}$ returning Other. What am I missing?

stone swan
#

In my defense, I thought I tried that and it returned an error. (It doesn't.)

#

Thank you.

brisk finch
#

hi,anybody know how i can stack items in inventory while i trading with traders. If i buy 1 pie and later buy another pie they just 1 pie and 1 pie in my inventory not a 2 pie... i try do something in this settings. i try read documents but my eng not good (sry)

stone swan
#

Can you pass the key from a dropdown to a filter in an item container?

brisk finch
brisk finch
stone swan
stone swan
#

Ok. I think there's some kind of bug in the compatibility (or I'm missing something). If I add the path to an items quanity, in the module config, it doesn't seem to work, items don't stack naturally, and the merchants quantity column is blank. However, when I follow the same procedur to add the value it seems to work fine. To make things even wierder, if I add a custom column to the merchant, using the same quantity path, that column also works fine.

glad spade
#

You need to put name and type into that setting at the very least

#

If you read the setting's description, you will understand why 🙂

brisk finch
glad spade
#

Open configure item similarities and just put name and type into the fields there

#

it will make it so that items of the same type and name will stack

brisk finch
glad spade
#

No

#

Just

#

"type"

#

as in just put the text "type" into the field

#

not the type, just 'type'

stone swan
#

In the Item Piles settings, litterally type the words 'name' and 'type'.

glad spade
#

Yep

stone swan
#

You may also need to refresh. (It wasn't working for me until I did.)

brisk finch
#

yeah its work now! thanks!

stone swan
#

So, I've tried setting up the currencies, but the merchant is showing my character as having 0 money and it doesn't seem like I can add money to item piles. Is there some extra step I'm missing?

#

Never mind. I figured it out.

#

I should also be getting to bed. Night.

brisk finch
#

torch module work with CSB?

stone swan
#

Ok. I'm pretty sure I've figured out that the answer to this is no, but I just wanted to double check: If I have an item container, is it possible to set the tooltip for the labels in one of the columns based on an entry in a dynamic table in the item? I know I can make the label post a roll message based on that entry, but copying and pasting the same formula just produces an error in the tooltip.

formal goblet
empty glen
#

Good morning! How do I hide elements of a roll message from the chat when I'm hovering over the final output? I don't want to see the whole equation, just the converted stat numbers and the result dice.

formal goblet
gray bluff
#

Hi guys, so I've got a number field in my template that can change depending on player actions (for those who know it's for the adversity token for the Kids On Bikes system) is there a way for me to create a maccro allowing me (the GM) to modify the number in this field ?
And would it be possible to modify it for each sheet separatly ? I tried some things but don't have any ideas on how I can proceed ^^'
Ultimately if it's not possible I'll just trust my players anyways. But since I didn't manage to do it I am a bit curious.

earnest imp
#

Question, I'm trying to make a dropdown using the assistance of a macro. This is the following Key-Options Formula

#

And this is the content of the _Test macro:

return "Fight (+4),Shoot (+4),Summon (+4),Stealth (+4),Pyromancy (+4),Hydromancy (+4),Anemancy (+4),Elemancy (+4),Terramancy (+4),Cryomancy (+4),Holymancy (+4),Darkmancy (+4)";```
#

The content I got from the macro however, was an object, not the strings I fed into the dropdown component, any ideas on how to resolve this?

earnest imp
#

Something like that, the rest of what you want to do, that's up to you

earnest imp
#

ohhhhhhhhhhh i forgot about that

#

ohhhh wait it still doesnt work

#

New error

formal goblet
earnest imp
#

and this time its empty

#

ah rip

#

just dont use macro then?

formal goblet
#

Yep, Script itself is fine

earnest imp
#

i wanted it macro because the script i want to use to reproduce that result is 23 lines long

#

which is fine for a single dropdown component

#

But my dropdown option has dynamic content that uses switchCase lol

${switchCase(action_selection,
    'Attack', %{return game.macros.getName('_Test').execute({entity: entity, action: 'atk'})}%,
    'Defend', %{return game.macros.getName('_Test').execute({entity: entity, action: 'def'})}%,
    'Evade', %{return game.macros.getName('_Test').execute({entity: entity, action: 'eva'})}%,
    'Heal', %{return game.macros.getName('_Test').execute({entity: entity, action: 'hea'})}%,
    'Utility', %{return game.macros.getName('_Test').execute({entity: entity, action: 'utl '})}%,
    'NO ACTION FOUND'
)}$```
#

So I have to repeat the same 23-line code five times which I feel is a terrible idea down the line lol

#

but hmmm i guess if its no good, i can relegate the macro code to a minimodule of my own

#

just wanna make sure im out of options in CSB first 😅

formal goblet
earnest imp
#

Oh? Full JS? Might be worth trying again then 😅

earnest imp
#

close enough haha

#

Ill try messing around with it, see what I can do with your solution

wet heron
#

Probably a dumb question, but can i somehow incorperate a excell as a character sheet?

Im looking to incorperate Rolemaster Unified and the math skill dependencies are... a work of art?

formal goblet
#

Or build your own mapper

wet heron
#

oh joy.. Thanks fore a quick answer

earnest imp
#

With adding "await" being the same issue

#

Thanks for trying to help though

formal goblet
earnest imp
#

ill see what i can do

formal goblet
half beacon
#

My players are able to see the "Configure Item Modifiers" button on their item sheet. Is there a way to prevent that?
Also is it possible to set limited permissions for who can edit a rich text field, but keep its content visible to others?

half beacon
#

I put a roll button on an item (healing potion.) Using ${name}$ works in the item sheet to display the name, but it won't work in the label's roll message. ${item.name}$ doesn't work either. Is there another way to retrieve the item's name?

stone swan
#

Does anyone here have experience using Drag Ruler with CSB?

formal goblet
formal goblet
stone swan
formal goblet
#

I think it was actor.system.props.Speed

stone swan
#

That did it.

#

Out of curiosity, do you know why that required and actor segment when most other modules don't?

stone swan
#

So, I don't know if this is a CSB issue, a forge issue, or something else entirely, but I've started getting lots of "Some cookies are misusing the recommended “SameSite“ attribute" warnings, on load, and lots of other weird warnings about things not being calculated or having unreachable code. Do you have any idea what that's all about?

#

I also keep getting "Some props were not computed." warnings, for components that aren't new and that I haven't changed recently.

#

You know that's probably a better question for the general trouble shooting channel. I'll go bother them. Sorry about that.

formal goblet
stone swan
#

That's the weird thing. As far as I can tell, nothing is mistyped (they're not exactly complex components, and they are being calculated on the sheets.

fierce harbor
#

Good morning everyone.
Is entity.items[0] the correct way to access the first itam in an Item Container? I was searching around in the channel but got lost...

Well, nevermind, problem solved 😅

fierce harbor
#

Another question:
I cannot seem to get a roll to show an image. The label roll message runs a macro that correctly returns the image path (one of the icons from the system assets), but in the chat it does not show.
This is the Label Roll Message:

${#checkVal:=floor(arcanePoints/2)<floor(item.baseCostDD/2)}$
${#roll:=checkVal?'0':[1d100]}$
${#diff:=((arcaneChance)+(item.extraCostDD*10))}$
${#itemImg:=concat('\"\/',%{return await game.macros.getName('aaa1').execute({name: '${item.name}$'})}%,'\"')}$
<table style="width:100%">
<tr><th tyle="width:40%;"><img src=itemImg></th><th style="width:100%;text-align:center;font-size:25px;width:60%;">${!item.name}$</th></tr>
<tr><th style="width:40%">Description</th><td style="width:60%">${item.specDesc}$</td></tr>
<tr><th style="width:40%">Result</th><td style="width:60%">${checkVal?'<u><i>Not Usable!!</i></u>':(roll<=diff?'<b><i>SUCCESS!!</i></b>':'<u>FAIL!!</u>')}$</td></tr>
</table>

Any hint?
Tried with ${itemImg}$ too, but to no avail...

crimson urchin
#

Does the documentation talk about how to make one number field change when another does? I have two character attributes that change inversely to each other - raising one depletes the second, but you can spend from either at any time to trigger this.

E.g.: "I spend two points of Power, that raises my Dodge by 2. Later I spend 3 Dodge, raising my Power by 3."

formal goblet
fierce harbor
fierce harbor
#

Can a filter in an Item Container reference a Number Field value, as in the picture?

formal goblet
fierce harbor
raw terrace
#

Is there a way to make a die roll within a condition? eg ${ant_ROLE == 1 ? "+2" : ant_ROLE == 2 ? "+0" : ant_ROLE == 3 ? "+0" : "-1D10"}$

formal goblet
raw terrace
#

That's kind of what I am trying to do (I think) - the above condition is a hidden attribute on the actor sheet and then the following is part of a longer roll message on a label: <p><b>Damage:</b> ${[:DMG1: :LOCATION_dmg: + :BONUS_DMG: :ant_DMG_Mod:]}$</p> the above code is ant_DMG_Mod, if that makes sense. Basically unless ant_ROLE is 1, 2 or 3, ant_DMG_Mod should be -1D10, which needs to be rolled first. I am sure I am going about this the wrong way but have been fiddling for a couple of hours with little success.

#

There are a lot of moving parts

formal goblet
raw terrace
#

The last error was Error: Unresolved StringTerm [1D10] requested for evaluation, when I had wrapped "-[1D10]" in brackets thinking that might help (obviously not). Before that it was something about not being able to resolve -1D10 as a number.

#

Can you have a die roll as a hidden attribute which can then be used in another hidden attribute?

#

Apparently not (at least not the way I'm doing it)

formal goblet
raw terrace
#

The error I got reloading the actor sheet was Some props were not computed, is that what you mean?

formal goblet
#

That is usually also a hint about an error while updating a sheet. Can you check which Formulas it's affecting?

#

That's listed in the warning-message further down

raw terrace
#

The one I just put in to see if I could have a hidden attribute with a die roll: roll_d10 ${[1D10]}$

formal goblet
#

Yeah no, it can only contain 1d10 or ${'1d10'}$

raw terrace
#

it's case sensitive?

formal goblet
#

Don't think so

raw terrace
#

roll_D10 was the attribute name

#

Going off on a tangent, sorry.

formal goblet
#

I have no issues rolling something like this ${roll:= [4D20 - 5 - 1d10]}$

#

I want to know what DMG1, LOCATION_dmg, BONUS_DMG contain

raw terrace
# formal goblet I want to know what `DMG1`, `LOCATION_dmg`, `BONUS_DMG` contain

DMG1 is a hidden attribute that is a condition based on values from different selection fields on the actor sheet. DMG1 is ${ant_DIFF == 1 ? "1D10+5" : ant_DIFF == 2 ? "1D10+5" : ant_DIFF == 3 ? "2D12" : "3D12"}$, LOCATION_dmg is generated in the roll message via a variety of conditions and BONUS_DMG is generated from a user input field on the same roll message (these all work fine as they are returning a basic value, either as a number or a text value). The only problems I get is when I try to have a die roll in a condition (ant_DMG_Mod). To be honest, I might just go for the average of D10 and just put that in as a flat value, which feel easier.

formal goblet
raw terrace
#

Good point - I'll check that, I wasn't seeing any errors, but then I wasn't looking out for them before

#

Yes, they seem to be working fine, I wonder if it is just the "-"1D10 that is causing the issue

#

Hmm took out the "-" and still getting Unresolved StringTerm error

formal goblet
#

You can test if your Roll Formula works with resolved values for testing

raw terrace
#

Hah! Just fixed it! In the roll message formula, I changed the order to ${[:DMG1: :ant_DMG_Mod: :LOCATION_dmg: + :BONUS_DMG: ]}$ so that only bonus_dmg had a + in front of it (this is the only numeric value). Thanks for the extra set of eyes and pointing out that I already had a die roll working otherwise I would have stared at this for another two hours before giving up!

#

What the? I just checked my other formula where the order was how it was before and now that's working ... lol. No idea what I did to fix it then!

#

Thanks anyway, sometimes it is just good to talk these things though 🙂

half beacon
#

The script is
out += "<h3>" + ${name}$ + "</h3>";
and then a dice roll based on the settings in the item

formal goblet
half beacon
#

Thank you!

stone swan
#

Is there a way to dynamically add rows to a dynamic table or copies of a pannel based on an entered number?

formal goblet
stone swan
civic finch
#

Hello there! I'm trying to get the Heartbeat module to work with my game. I've looked through the previous notes and I'm not sure what I need to do. Character total HP is a total of Physique+Agility+Intellect. Do I need to make an attribute bar to let the program and module communicate with each other?

formal goblet
civic finch
#

no, they are just text fields on the character sheet. Combat Carousel uses props.phy2, props.agi2, and props.int2 to track the values

formal goblet
civic finch
formal goblet
# civic finch

Ok, I see. You're on the right track that you need the data of the Attribute Bars instead of the single props (although you could also do that). Now the fundamental question: When does CSB create Attribute Bars? There are 2 cases:

  • Whenever you define your own complex Attribute Bars with value and max (value becomes non-editable by other sources)
  • Whenever you create a Number Field with a defined max-value (value becomes editable by other sources)

What you also want to do, is to check the data-structure of the Attribute Bars. To do so, simply type game.actors.getName('actorName').system.attributeBar. You'll see that it splits further into key, max & value.

civic finch
#

where do I type that command?

formal goblet
#

The console is also capable of executing Scripts

stone swan
#

Ok. I'm having an extremely cursed problem.

#

I created a dropdown that draws from a dynamic table and filters based on another dropdown and a row of the table. It worked fine. Then, without me changing anything, or even touching the template it stopped (it doesn't throw an error or anything, but the dropdown doesn't populate, even with the default value).

Nothing looked wrong, so I exported a working item, copied the formula for the dropdown, and pasted it back in to the template. It worked, for 1 item. Then, again, without changing anything, new items aren't working again. To make matters even weirder, refreshing the item it worked on once does not break it.

#

I'm going to ask the dev. For now, you should probably just ignore them and/or use one of the working items.

#

(Staff and paired swords work.)

formal goblet
stone swan
#

The problem is that the drop down is showing up blank. Neither the default option nor the list of options (after you click it) show up.

The dropdown should draw from a text field column in a prepopulated dynamic table that gets stored in a hidden panel tab.

The key formula is ${fetchFromDynamicTable('WepPropList', 'WepProp', 'PropReq', WepClass, '!==')}$ and the default value is 'None'.

#

Is there anything else that would help?

formal goblet
#

Does it work when the Panel is not hidden?

stone swan
#

No.

formal goblet
#

No errors in the console, right? Huh... Can you create a Label with this Formula and see what it returns?

stone swan
#

Remember when I said "Extremely cursed?" So, I created a lable with the formula in both its text and roll message and both returned the array I expected. Also, the dropdown started working, despite not having changed it. In fact, the three other, identical, dropdowns that I didn't even interact with also started working.

#

Ok. I just changed it so the Lable's text is just a normal string and created a new item. The roll message still outputs correctly, but the dropdowns don't work.

formal goblet
#

I think it's linked to the issue that the Panel was/is hidden. In fact, it's not only hidden, it is handled as it was never there

stone swan
#

But it was still hidden in the version that worked?

formal goblet
#

The data gets available once it was visible

stone swan
#

Do you mean once the Lable's text accessed it?

formal goblet
#

No, the data from the Dynamic Table gets available once it was visible. You can verify that by typing game.items.getName('itemName').system.props in the console to check the props of the Item. Everything that is there is also available to Formulas.

stone swan
#

Ah. There's an extra wrinkle that as confusing me: If you unhide the panel (on the template) and the hit the refresh button on an item that's already open, the panel will be visible, but the dropdowns will still be broken. You have to close the item and reopen it for them to work.

formal goblet
stone swan
#

Ok. So that does seem to be the issue.

#

Is there any way to make it work while the panel is still hidden or to otherwise keep it inaccessible?

formal goblet
#

You can hide it afterwards, so you could hide it conditionally.

#

And to be fair, it's technically a bug which should be fixed from our side

stone swan
#

Follow up bug: Creating a new weapon, with the panel visible, still results in the dropdowns initially not working. Something needs to cause the sheet to update (or you need to close and re-open it) for them to populate.

#

I guess they're not being calculated? Though they're not one of the fields I'm getting a warning about.

formal goblet
amber nebula
#

Hi there everybody, hope you're all having a great weekend.

I was just wondering, am I able to send text fields from the sheet to chat?
Or maybe somehow setting up a a button to do it?

stone swan
#

Before I do something silly, is there a reason the stacking portion of Status Icon Counters doesn't work with CSB? (I mean is there a technical reason they conflict, not "why didn't you implement it.) I'm mostly wondering if I could make a foundry macro that lets players type a number to set the number on a status.

formal goblet
stone swan
#

That's what I was hoping you'd say. Thank you.

formal goblet
amber nebula
#

Thx a lot

amber nebula
amber nebula
formal goblet
amber nebula
#

This one's the label

#

this is the text field on an actor

formal goblet
# amber nebula This one's the label

The issue is that your Text Field is inside a Dynamic Table, so you cannot directly reference it. You have to reference it over sameRow(columnKey)

amber nebula
#

oh i see

fierce harbor
#

Hi there!
Bit of a 'complex' question...
My goal is to have an Item Container where a column contains values coming from items in another Item Container as Item Modifers...is this even possible? If yes, how?
I thought it could be done via a hidden Dynamic Table, but cannot find a way to get those modifiers ...

stone swan
stone swan
#

Is this a 1:1 connection or is it just one item that's providing a value to the entire table?

fierce harbor
#

The originating container holds items that provide several modifiers, so it would be more approriate to say that the summed modifiers pertaining to a specific item in the second container should go there.
Sorry for not being clear in the first place.
I'll make an example:

  1. item I1 in container A gives SkillX +5 and SkillY -5, item I2 in container A gives SkillX +10 and SkillZ -10
  2. container B has SkillX and need the total modifier from container 1.
stone swan
#

Ah. And you don't know which skills they'll have in advance, so you can't just have placeholders on the sheet, right?

fierce harbor
stone swan
#

I don't know if it's the best solution, but one thing you might be able to do is create a hidden attribute for each skill, then have the item modifiers effect that attribute and the column in the skill item's container display the hidden attribute.

#

With that said, if every character has the same skill set, how does making the skills themselves items help you standardize things?

fierce harbor
fierce harbor
stone swan
#

In that case, I suspect Item's will do the opposite of what you want. If you use items, then changing the template (or the individual item sheets) won't change any items that have been applied to character sheets.

#

At least, I'm pretty sure it won't.

#

However, if you use a dynamic table and you set one column up as a Label for rolling, then you can have the formula automatically propagate to every row.

fierce harbor
fierce harbor
stone swan
#

I think you're missing '_list' on the right side?

amber nebula
#

dang

#

i'm dumb

#

you're right

#

thx a lot mate

stone swan
#

No problem. I have definitely asked for help on equally silly mistakes.

#

I think I can see why Status Icon Counters doesn't have better integration. (The API is not pleasant.) On a related note, is there a way to set global variables in CSB?

formal goblet
stone swan
#

... I might do that. I mostly don't want to deal with Status Counter's seeming insistence on using image paths as IDs. The wierd thing is there are functions in their API that, nominally, take statusId, but they seem to always return null.

stone swan
amber nebula
#

is there a way to remove the dice rolling sound from a specific label roll message?

formal goblet
amber nebula
#

interesting, might look into that later

#

thx for yall time and attention btw, been learning a lot from you guys

gray bluff
#

Hi, another question here.
So I have a game in preparation where (for a number of reasons) I use 2 templates for the PCs sheets.
I would like to have a different background and header for each sheet.
Actually my CSS (for this part) look like this :

.custom-system-actor-content { background: url("..."); background-color: grey; background-size: cover; background-repeat: no-repeat; background-blend-mode: screen; } .header-fields { background: url("..."); background-size: cover; background-repeat: no-repeat; filter: drop-shadow(3px 3px 4px black); margin-left:10px;

But it obviously apply the same pics on both templates. If it was some other element than the header or background I see how to do it but in this case I have no clue how to do it... Is it manageable ?
(I don't know anything about CSS, I'm just trying things until it works xD)

#

here a pic for (I hope) better comprehension of what I want to do

brittle moth
#

Hello ! Long time no see everyone 🙂
Sorry for the delay, I've been caught up in personal projects which took all of my time... Anyway !

**Beta version 3.1.0-rc1 is now available, with the following changes : **

Features

  • [#280] Labels executing formulas without chat message
  • [#228] Added Filtering & Sorting for Item Containers & Dynamic Tables

Fixes

  • Fixed a bug where tooltip-formulas would not work when using references (Item / Dynamic Table)
  • Fixed a bug where visibility-formulas would not work when using references (Item / Dynamic Table)
  • Fixed a bug where dropdown-formulas would not work when using references (Item / Dynamic Table)
  • Fixed a bug where visibility-formulas would override role & permission-settings
  • Delete-operations in Dynamic Tables now delete rows instead of setting a delete-flag (excluding predefined lines)
  • Item Modifiers now have a bigger input-field for keys
  • Disabled preselected Item Templates when creating an Item Container
  • Fixed a bug where initial Checkbox value wouldn't be set correctly
  • [#342] Fixed a bug where initial Radio Button Group value wouldn't be set correctly
  • [#214] Fixed a bug where Template Filters in Item Containers wouldn't be imported correctly
  • [#328] Reworked Filtering for Item Containers (now uses Formulas)
  • [#346] Values of Attribute Bars are now Numbers instead of Strings (with numbers)
  • [#347] Fixed a bug where sameRow() would always return 0 on empty strings despite having a default-value

Special thanks to @formal goblet, he made most of the changes included in this release !

fierce harbor
#

Would it be possible to roll with a success chance threshold given by an actor prop value? Something along the line of /roll 1d100cs=<key>.
EDIT: looks like it's possible 😄

ornate junco
#

Are you able to include multiplication and division within a switchcase?

dapper ibex
#

Hey, is there an easy way to add an item's icon to a chat roll message?
For example, when you strike with a weapon, I want to to make the weapon image appear.

gray bluff
#

there's probably others ways but as far as "easy way" goes this one work 😉

formal goblet
# ornate junco Are you able to include multiplication and division within a switchcase?

I think you're misunderstanding something. It doesn't matter if you include static values or mathematical expressions. The thing that matters is to what values the expressions resolve and if the resolved values match the function-signature.

E.g. round(5.4) and round(2 + 3.4) produce the same results, because the mathematical expression is resolved first before being passed to the function.

formal goblet
cosmic karma
#

Hello All! Can someone point me in the correct direction? Is there any system done with CSB or there is a tutorial or doc explaining how to create a array of checkboxes and use it as a numeric value? Click on the label to roll. Typical WoD, Forged in the Dark, dot distribution system...

formal goblet
brave trench
#

does the field key on item filters need to come from an item? or can it be a key from a character sheet?

#

nm, found my answer.

formal goblet
brave trench
#

ooooh, is there an estimated time on that release? Maybe I'll just wait patiently lol

formal goblet
brave trench
#

I'm trying to have the same item container (spells) on two different tabs (different caster types (arcane/divine), show spells for only one based on whichever the player is using. I didn't want an item key as the player will have to change every single individual spell. I figured a key/trigger on a character sheet would be a more efficient way to filter in this way. This new feature does what I need right? Sounds like it should.

brave trench
#

I've never installed a beta version. the manifest link is just a system.json. am I just replacing the original in the folder? I'm sure there are instructions I just dont see them.

brave trench
#

im getting an error, says v2.3.0 rc2 requires an older version of foundry. why is it saying 2.3.0 when the build is 3.1 rc1?

formal goblet
#

@brittle moth can you take a look?

cosmic karma
brittle moth
formal goblet
brave trench
formal goblet
brave trench
#

oops, I didn't even realize that. I thought it would just update/override the original. My fault. ^_^

formal goblet
brave trench
#

yeah, now that I think about it I get why. What would be the best way to pull game info from 3.0 to the beta world then?

formal goblet
empty glen
#

I'm trying to make a tab only visible when the actor has a certain item. I put this code in the visibility formula for the tab: actor.items.get('GkxQF3uoQgHCyk4H'). The 'Gkx...' is the item's key. It's returning false even when item is on the sheet. What am I missing?

formal goblet
empty glen
formal goblet
empty glen
#

Copy that! Thanks!

ornate junco
formal goblet
cosmic karma
formal goblet
ornate junco
formal goblet
#

Or, if you really want to inline it, remove the :: and add quotes to the expressions

pallid kettle
#

I'm having an issue with some radio buttons. There are 7 tied to the same group. Button 1 and 2 work just fine. When i try to select button 3-6, it gets slung to button 7. Am I likely doing something wrong?

formal goblet
pallid kettle
#

I have all radio buttons in a horizontal panel.
Each has a unique Key and Label.

Their “group” is all the same: Cores

Each Value references a different Dropdown List.

fierce harbor
#

I'm experiencing something strange: Dropdowns are shown smaller, leaving only the arrow visible, in Chrome while in Firefox they are correctly shown...any idea?

pallid kettle
#

@formal goblet Figured my issue out. If the values two radio buttons were referencing were equal, it would move to the last with the same value. (something I hadnt tested with the dropdown lists) This does mean I can't use radio buttons, but hey, at least I know why.

brittle moth
#

**Beta version 3.1.0-rc2 is now available, with the following changes : **

Features

  • [#228] Added Column based Sorting for Dynamic Tables

Fixes

  • Fixed dependency link for the _chatcommands module

Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta

If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new

empty glen
#

I've got another one for y'all! I'm trying to filter an Item Container to show just two items. Is it possible to have a filter look for two values in the same key? For example: name is Mad Science or Tinkerin'.

formal goblet
brave trench
#

anyone know why this item modifier is returning NaN? currentCap1 is a label on actor sheet. on item... storageLocation = radio group, backpackSlot = radio button value, volume = number field on item.

formal goblet
brave trench
formal goblet
#

Ah wait, misinterpretation 😅 . Then something is off with your conditional statement

#

You can create a Label in the Item and play around with the conditional

brave trench
#

keys are all correct, so I'm stumped.

formal goblet
#

It's also important to verify what the keys actually return (not what you assume what they return)

brave trench
#

whats the best way to do that? I'm not really good at this, I just poke away at it blindly till things work lol

formal goblet
#

I'd create a Label and check what storageLocation returns. Then I'd check what backpackSlot returns. Then what storageLocation == backpackSlot returns. Verify every single step

brave trench
#

yeah I'm getting an error.. I just don't know why.

formal goblet
#

Console

formal goblet
brave trench
#

(im back, power went out) Yeah, console says can't convert backpackSlot to a number. Why does it need to be a number? when the condition is just checking if storageLocation==backpackSlot? (sorry, i'm probably missing something simple here, this is the first time I've tried to use Radio buttons 😅 )

brave trench
#

ooooh. You know, I remember seeing that faQ a long time ago but obviously forgot about it lmao.

#

Yep, that solved the problem. used equalText() Thank you! 🙂

brave trench
#

@formal goblet are you guys aware of an issue with reloading all items from the Template? Just had a heck of a time trying to figure out why things weren't working, and had to go to every item and refresh them one at a time. :/

formal goblet
brave trench
#

won't do in the directory either. I think I've run into issues like this before, typically when there is an error. When foundry loads up anything with an error it is difficult to get it to go away. When i have an error on a Test sheet I have to fix the error, delete and remake a new test sheet to see if it works. There are just reloading difficulties all around when dealing with errors.

formal goblet
faint wharf
#

CSB folk did anyone tried to use random procedural names with CSB? i realy wanted to achive random names for tokens with random prefixes. And i get eaighder random prefixes or random names from most modules. and one most promissing Random procedural Names does not work at all. anyone worked it thru or have other suggestion? please help

formal goblet
faint wharf
# formal goblet Why isn't that working? The name-property of Actors is the same within all syste...

mmm console says something like "Not a valid token type for name generation". i tried on no mods game it was the same on.ly in CSB. it should be system agnostic .
_sendMessage: function (method, message, prefix, style) { const now = Date.now(); const similarMessage = this.messageHistory.find((msg) => msg.message === message && now - msg.time < this.minInterval); if (!similarMessage) { console.log(`%c${prefix}${message}`, style); this._recordMessage(message); }

formal goblet
faint wharf
formal goblet
#

A screenshot is enough

faint wharf
formal goblet
faint wharf
formal goblet
faint wharf
faint wharf
#

I think it dislikes CSB usin character as a name for type

formal goblet
faint wharf
stone swan
#

I have a lable with the formula ${Cal*16+BonusHP}$, where Cal is another Lable that's being calculated based off a Number and BonusHP is a number. Cal seems to be calculating correctly, but the first formula isn't. When I first refresh the sheet, it shows up as ERROR and I get this error in the console " Unexpected type of argument in function multiplyScalar (expected: number or Complex or BigNumber or Fraction or Unit or string or boolean, actual: undefined, index: 0)". Changing the BonusHP number (but not other elements on the sheet) causes the lable to go from ERROR to whatever BonusHP is set to, ignoring the Cal portion. It also produces the this error: " Failed data preparation for Actor.fvjj3rvKdzjKqybj. token is not defined" which seems wierd and not related, but it doesn't show up until I modify the BonusHP field.

formal goblet
stone swan
#

Cal seems to be calculating correctly (or, at least, it's displaying correctly). Here's its formula: ${floor(Lv/4)+3}$ and Lv is just a user entered Number between 1 and 14.

formal goblet
#

I have to buy some things for breakfast, give me 30min. or so

stone swan
#

No rush.

formal goblet
#

Anything new?

stone swan
#

Not on that front, no.

formal goblet
#

Can you show the whole error message?

stone swan
formal goblet
#

Just to make sure that Cal and BonusHP are set correctly

stone swan
#

That's weird. Cal is showing up as Undefined, but it's definitely calculating on the sheet.

formal goblet
stone swan
#

Sure.

#

Does this work?

#

I just noticed that the Tier field wasn't calculating and one of the macros that uses Cal seems to have stopped working, but I haven't changed either of those things or Cal itself.

formal goblet
# stone swan

Your TestAt in the hidden attributes caused the issue with the undefined token

stone swan
#

Thank you for catching that. Deleting it also seems to have solved the Cal issue.

#

I'd forgotten I still had that attribute in there and I wouldn't have expected it to effect a completely different value, so I doubt I would have checked it any time soon.

formal goblet
#

Well, errors can interrupt calculations, so...

stone swan
#

Makes sense.

earnest imp
#

@formal goblet Hello, if I have a token unlinked with actor data, how can I retrieve the actor object of the unlinked token?

console.log(token.actor) returns me the primary actor object on the right sidebar, i want the ephemeral actor object attached to the token returned

formal goblet
uneven quail
#

Is there a way to reference an item's image in a label button? Like, if I wanted to create a button that, when clicked, just post's the item's icon image into chat, is that doable?

formal goblet
uneven quail
#

Nah, that's giving me this:

#

If it's a pain, don't worry about it. I was just trying to visually spruice up some of my rolls, haha

formal goblet
#

Wait, is the Label Roll Message in an Item Container or in the Item itself?

uneven quail
#

On the item. I just made a fresh label on the item template that looks like this:

uneven quail
#

Ah, got it. Now that's posting an empty image into chat with a 404 error in the console.

#

GET http://localhost:30000/undefined 404 (Not Found)

formal goblet
#

%{console.warn(entity)}% and check the console what the right path is for the image

uneven quail
#

It's showing the correct path icons/equipment/weapons/fist.webp

If I just put ${entity.img}$ into the label, it posts undefined to chat, if that helps

formal goblet
uneven quail
#

Got it. Sorry, getting back into CSB and I've forgotten everything, lol. But yeah, it shows the right path in the console still.

formal goblet
#

<img src="${!%{return entity.img}%}$"/>

uneven quail
#

Doesn't work, but what DOES work is <img src="${!%{return entity.entity.img}%}$"/>

formal goblet
#

Ah, yeah. Forgot that the first one is instance of TemplateSystem

uneven quail
#

So, just for me trying to understand: the first entity is part of TemplateSystem which points at the character's attributes, then the second refers to the actual section titled entity, under which is the img attribute? Attribute might be the wrong word but is that right?

formal goblet
# uneven quail So, just for me trying to understand: the first ``entity`` is part of TemplateSy...

More or less. I think this guide about Object Oriented Programming can explain it in more detail: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Object-oriented_programming#classes_and_instances

MDN Web Docs

This article has described the basic features of class-based object oriented programming, and briefly looked at how JavaScript constructors and prototypes compare with these concepts.

glad spade
#

As a module developer, what's the best way to detect the actor & item templates?

formal goblet
crimson urchin
#

Howdy! I have a dynamic table with narrative descriptors which can be employed in a variety of situations for a +1 to the roll. Instead of a custom dialog box, I was hoping to allow players to click the checkboxes in the dynamic table next to the descriptors to mark which ones will be tied into the roll. Is there anyway to tie those checkbooks into the formula this way?

earnest imp
#

I'm assuming you're trying to do something like having player select their own "narration" via a radio button or a checkbox on the dynamic table

#
let narration_dynamic_table = actor.system.props.narration_dynamic_table;
let selected_narrative = ``;

for (let key in narration_dynamic_table) {
    let narration_entry = narration_dynamic_table[key];
    if (narration_entry.deleted) continue;

    if (narration_entry.component_name_that_has_radio_button_or_checkbox_here === true) {
        selected_narrative = narration_entry.component_containing_the_narrative_text_you_want_here;
        break;
    }
}

return selected_narrative; ```
#

@crimson urchin Something like that

#

Any more details, its up to you to finetune it

crimson urchin
#

I'm assuming I don't put that into the roll message field on the label?

earnest imp
#

in one way or another you have to

#

put it in a macro, make a script that returns a value, etcetera

#

Have anyone used Item Piles on CSB yet by the way? I have it installed and... i dont know how to make make having items that can be stacked work.

#

Also having currencies on CSB.

glad spade
#

Give it a bit of a search, plenty of people have tried and succeeded

earnest imp
#

Okay, so I have currency somewhat working, any ideas how i can fix the "Split currency 0 ways"?

foggy grotto
#

Can you make a rollable table linked to a dynamic table on the character sheet?

glad spade
static cargo
#

I hate to be a pain, but what am I missing to make this Label Roll Message work?

Rolling Body: [[${bd6}$ + ${body}$]].
(bd6 = "2d6" from a Dropdown list, body = 5 from Number Field)

#

Current output is:

foggy grotto
#

unless b is the variable. But I don't konw if bd6 being a string might alter that

#

if b is the varible ${[:b:d6:+:body:]}$

static cargo
cosmic karma
#

having a strange behaviour with my tabbed panels. The added panels always stays at the right side, not on the bottom. Any idea on how to solve that?

formal goblet
cosmic karma
#

really?! hahahaha

empty glen
#

I'm having an issue where number fields aren't releasing focus on my actor sheet. I think it happens when I have too many items assigned to the actor. I don't know what the tipping point number is but is there any way to solve this?

My current work-around is to click rapidly on another tab until it switches and as long as I don't focus on a field, everything works fine.

earnest imp
#

is it not possible to have a ternary if-state that compares string in ${}$?

vagrant hollow
earnest imp
#

Content of code

#

what came out

#

what the error is

earnest imp
#

ohhhhh thanks for the solution

formal goblet
#

Don't ask me why the expression parser from mathjs doesn't allow to use == with strings

earnest imp
#

what why

#

i know you said to not ask you but

#

oh well at least it works now

formal goblet
#

That's not even the worst part. It executes everything regardless of conditions 😅

earnest imp
earnest imp
#

looking to fetch a dynamic table value from a different actor dynamically, the code below doesnt seem to work, any ideas?

${fetchFromActor(
    summoner_name, 
    concat("fetchFromDynamicTable('skills','proficiency','skill','",base_skill,"')")
)}$```
#

its mostly trying to pass base_skill
into "fetchFromDynamicTable('skills','proficiency','skill',[BASE SKILL HERE])" that im struggling

stone swan
#

By the way, @earnest imp did you ever make any progress with Status Icon Counters?

#

Also, unrelated question, but it wiki says Dynamic Active Effects does not work with CSB, but it's not in the Breaks CSB category. What kind of "does not work with" are we talking about here? Is it potentially problematic or do they just not talk to each other?

#

Is there a way to set up active effects (the normal Foundry kind) outside of the condition based ones that can be setup as part of a template? (Particularly in a way that works with Active Auras.)

earnest imp
#

Its holding on ducttapes and dreams but ive managed to make complex statuses work

stone swan
# earnest imp A ton, what do you need

Mostly I'm wondering if you figured out a good way to refer to statuses by a more reasonable ID than their icon location, if there's a good way to make sheets and/or prompts interact with the icon's value, and if there's a good way to set statuses to decay by half, rather than just 1, per round. I'm sure there's technically ways to do all of that, so I suppose my question is more about how feasible you think it would be and, maybe, if you have some already functional code you'd be willing to share.

stone swan
#

So, the documentation says:

Active effects are added to a token by a submenu in the token view. By clicking on an icon, you can add an active effect
to the character represented by the token. And now, you can add modifiers triggered by Active Effects!

But I can't seem to find the submenu or icon. Where is it and what am I looking for?

earnest imp
# stone swan Mostly I'm wondering if you figured out a good way to refer to statuses by a mor...

Mostly I'm wondering if you figured out a good way to refer to statuses by a more reasonable ID than their icon location, if there's a good way to make sheets and/or prompts interact with the icon's value,

Nope. This is the best I got, I use token and effect_name. 😅

const effect = CONFIG.statusEffects.find(e => e.name === effect_name);
let effect_counter = EffectCounter.findCounter(token.document, effect.icon);```
earnest imp
# stone swan Mostly I'm wondering if you figured out a good way to refer to statuses by a mor...

and if there's a good way to set statuses to decay by half, rather than just 1, per round. I'm sure there's technically ways to do all of that, so I suppose my question is more about how feasible you think it would be and, maybe, if you have some already functional code you'd be willing to share.

Not possible from the module's end unfortunately, the module rounds all decimal to its closest integer, so a 1.5 will be treated as 2

earnest imp
raw magnet
#

@formal goblet using a special dice module that allows for /desc2 rolls from the chat or macros, is it possible to use it in a roll formula in a label chat in CSB?

#

The command is simply
/desc2 (number of dice)(dice code in letter)

#

I wanted to ask cbs to roll /desc2 [ key] (referring to a number field from the sheet instead of a number) [ the dice code]

stone swan
stone swan
formal goblet
half beacon
#

Really basic question here. My system determines success based on multiples of 4 (4+ is 1 success, 8+ is 2 successes, etc.)
Up until now, I've been using Math.random() for the dice because I couldn't figure out how to make the dice roller work with it. Is that actually possible with CSB?

formal goblet
raven seal
modern wolf
#

Hey everyone o/
I've been using this system for a while. I recently wanted to update my spell template (item template), and I'm not sure if this is normal or a bug.
On the first screen, the 'modc' boolean isn't being converted.

${in:=fetchFromActor('attached', "modc")}$
${in ? '20' : '0' }$ 

but on the second screen, it's okay.

Êtes vous en combat ? ${#modca:=modc ? '20' : '0' }$ <br>

I have another question, is it possible to directly determine if a player is in combat? Because in my game, players receive a bonus to all their tests when they are in combat. Currently, it's a button (modc) on the character sheet that triggers this bonus.
Sorry for my poor English, I'm new to development :c

edit : it's a label roll message.

peak jacinth
#

Sorry for the dumb question, but does anyone know how to fix this? I'm trying to install CSB but it says I have to install a package dependency manually. Clicking the hyperlink just leads to a gitlab page with a bunch of code and no instructions, though.

quasi plume
peak jacinth
#

One of these two?

quasi plume
#

The top one

peak jacinth
#

Thank you!

quasi plume
#

You're welcome

real shuttle
#

if I've got ${concat(item.dmg_dice, ' ', item.dmg_type, ' damage')}$ in an item container column, how do I make it not show up if there's not a dmg_dice variable in the item?

quasi plume
real shuttle
#

equalText is like "does this string say xyz"?

#

i've got my dmg_dice box saying stuff like 2d6

#

is there a "isn't empty" conditional?

quasi plume
#

Well the conditional can be modified under the math.js logic. With equalText I believe you are correct but it returns "True" or "False" or "1" or "0".
So if your conditional for your damage dice reads "true" or "1" it'll display. I think the 2d6 is technically a string here so equalText should be appropriate.
I don't use item containers very often so I'm not familiar with how they behave.

#

${equalText(item.dmg_dice, "2d6") ? <Put true here> : ""}$
I think it should accept the "" and it'll appear blank

real shuttle
#

oooo so I could theoretically say equaltext(item.dmg_dice,"") and it'll return true if it's blank?

real shuttle
#

i mean equaltext(item.dmg_dice,"") will return true if item.dmg_dice is blank?

quasi plume
#

It'll return false

#

Well no you're right

#

Sorry

#

Because you're comparing an empty string to an empty string which I believe is true

real shuttle
#

shoot no it throws an error

#

regardless of whether item.dmg_dice is filled out for some reason

quasi plume
#

Does the console say
"Expects false part of conditional"
??

real shuttle
quasi plume
#

Oh oh I think CSB doesn't like the not operator

#

Can you expand the formula part of the console?

real shuttle
#

that's weird cause I put ${equaltext(item.dmg_dice,"") ? '1' : '0'}$

real shuttle
quasi plume
#

Hmmm, that's not the same formula right? Is it throwing an error on a different part of the item container?

real shuttle
#

apparently so

#

it's in a different column, after this one

quasi plume
#

Just to double check, did you put equaltext or did you put equalText ?

real shuttle
#

........

#

oops

#

😛

quasi plume
#

Don't worry, knowing my luck it'll still throw an error
😂

real shuttle
#

oh it did 😛

#

but progress
I put a test 1 or 0 conditional at the end of the damage line, and it's giving me the 0 if the condition is false as expected, but it's throwing an error if it's true

quasi plume
#

Alright let's look at what you have, can you show me the full formula as you have it in CSB?

real shuttle
#

${item.dmg_dice}$ ${item.dmg_type}$ damage ${equalText(item.dmg_dice,"") ? '1' : '0'}$

quasi plume
#

Ok and now the console, see if sheds some light on the errors.

real shuttle
#

found the right section at least!

#

hmm idk if the escapes are messing with it

quasi plume
#

Ok so it doesn't like the empty "" in the equalText it wants you to define what you're comparing to so, let's reverse your logic.

#

Let's have your false part be what defines if it's empty or not

#

So you'll have to put something that can be true in those ""

#

Like 2d6

real shuttle
#

it's actually doing the exact same thing

#

if I set it to one of their values I do get the 1, but still error if the field is empty

quasi plume
#

Does putting single quotes around the double quotes change anything?
' "" '

real shuttle
#

OOOOO WAIT A LEAD

#

so here's my idea...but I'm still getting damage on the ones that should be blank

quasi plume
#

Interesting

#

I want to know how to make equalText say true if the string is empty, I hadn't thought of that before.

real shuttle
#

okay i gave up and made a hidden attribute that adds ' damage' to the end of the dropdown key

#

but yeah it would be useful to know how to test if a string is empty

quasi plume
#

If you did it the other way, although you would have to do equalText for every string in the drop-down, I believe you would be error free as this is how I've setup my sheet.

real shuttle
#

one other question while you're here--do you know how to reference the item image url? like if I wanted to put the item image in the roll message with an <img src>?

quasi plume
#

I think it's just HTML

#

I don't actually know lol

#

I think Martin answered that question if you search in this channel you should find it fairly quickly

real shuttle
# formal goblet Ah, yeah. Forgot that the first one is instance of TemplateSystem

quick addition to this question:
I've got an img src that points to ${!%{return entity.entity.img}%}$ and it correctly gets the actor's image and places it in chat

how would I edit the path to point to the item image? (e.g., spells in an item container where you click the spell from the character sheet and it puts the spell image in chat)

I've tried item.entity.entity.img, entity.item.img, and item.entity.img with no luck

quasi plume
#

I don't know for sure but, if you can pass the results of your formula into HTML this may work
${characterPicture:=!%{return entity.entity.img}%}$ <img src="characterPicture">

real shuttle
#

yeah the img src part is working, but it's giving me the character image instead of the item image

#

I want the little green image from the item for the chat box

fierce harbor
# real shuttle I want the little green image from the item for the chat box

You can get that using something like entity.entity.collections.items then selecting the correct item checking its name.
Sorry for not providing the correct code but I'm not able to access my PC to check it.
Or, if using the selected token, game.canvas.controlledtokens[0].actor.items should do.
You can see if it works typing this line in the console.

real shuttle
#

I'm still having trouble figuring out the exact path--if you or someone else finds it, let me know 🙂
I'm signing off for the night...spent far too much time on it lol

formal goblet
real shuttle
#

thank you to everyone who's helped me tonight 🙂

formal goblet
#

No need for equalText if you just want to check for non-empty

real shuttle
#

ohh sweet 🙌🏻

#

okay now bed for real lol

formal goblet
# modern wolf Hey everyone o/ I've been using this system for a while. I recently wanted to up...

Try out typeOf(variable) and check what they return. My guess is that it is not a boolean.

About the combat-question: You can check via a Script if someone is in combat (consult https://discord.com/channels/170995199584108546/699750150674972743 for the specifics). Just be aware that the Sheet doesn't update when the combat-state changes. That's not an issue with Label Roll Messages, but with the rest of the Sheet.

If you want to know how to integrate Scripts: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#33-script-expressions

modern wolf
#

Ok you're right, the return was string. thx o7

real shuttle
#

is there a way to turn off the default roll sound for when you pop something in the chat? I like the roll sound when someone's actually rolling an attack or whatever, but there are a lot of cases where the thing going to chat is just info text from a roll message in the sheet

peak jacinth
#

...The macro doesn't run anyway. That wasn't a CSB problem - my mistake!

vagrant hollow
peak jacinth
#

If I post /m 2shoes in chat, it runs the macro 2shoes. If I put the same command in a label roll message, it just posts the text and doesn't run the macro. Is there some way to get this to work?

tidal hemlock
#

Alright

#

I'm not a programmer, I have no idea what I am doing

#

So I am just going to ask really stupid questions

tardy rain
#

Hi

#

why are

#

uh

#

conditonals not working

#

properly

#

is there somthing weird I need to do

#

I have tried every conditonal with every form of syntax I know and it keeps throwing errors

#

does anyone know why this is

tidal hemlock
#

Ok greater context, its trying to get a visiblity formula to work where some radio buttons only appear when we set a weapon type to say, melee.
So when melee appears you can say how many hands you are wielding it with. So we are trying to figure out how to have it actually trigger as true to have things be visible

#

So what should we be putting here

#

As the visibility formula, to have it work

real shuttle
real shuttle
tidal hemlock
#

Yeah I did lol.

real shuttle
tardy rain
#

dsiahgfopehgaoehgoaegoieghaegfhoi

#

i literalrlly read that

#

i just forgot

#

im so stupid

#

im sorry lol

real shuttle
#

the number of times i have done that lol such a mood

tardy rain
#

ie

#

${%{

#

^this shit

real shuttle
#

all one formula in general—what’s your specific scenario?

tardy rain
#

okay techinically dont need to know for the main issue

#

but just for displaying for testing purposes

real shuttle
tardy rain
#

would I make a lable

#

like

#

${ %{ yada yad conditonal stuff}% }$

#

or just keep the conditonal brakcets

real shuttle
#

ohh yeah you can just use the one set of ${}$

#

sorry i put percents but mostly you’d want $$

#

I’m so much worse at typing on mobile lol

#

there are ways to nest ${}$ inside %{}% and vice versa but i’m not good enough at it yet to advise

tidal hemlock
#

Stupid question but

#

How do

#

I make a thing roll.

#

I have a thing for equiv to damage. I want it to be 1d12 + Stuff

#

${ attack_modifier + item.dice_max + item.dice_power }$

So I have a label keyed to item.dice_max ?

#

And how do I have it so its an actual die..

fathom cave
earnest imp
#

@formal goblet Is there any way for player to drag items attached to their character to a macro bar? I wanna know my options if players can drag a shortlist of items they want to use to their macro bar

#

I considered dragging the item wholesale from the sidebar but since a character generates their own copy of said item when they "own" it, it wouldn't work

#

🤔

formal goblet
#

I've never tried to drag Items into the Hotbar 😅

fathom cave
#

Is there a way to get rid of the border around these numeric fields?

#

err Number Fields

raven seal
#

or just border: none?

tardy rain
#

because that is subject to alteration

#

is it procsceed as a string do I just have to do string wizardry?

raven seal
earnest imp
#

@formal goblet any ways to reload all item sheets attached to all characters? this button only reloads item sheets on the sidebar, not ones contained in the characters

fathom cave
vagrant hollow
formal goblet
vagrant hollow
#

Ah, even more elegant.

earnest imp
fathom cave
#

Is there a way to reference the radio selections 'label text' in a userinputtemplate? I would like to have chat output 'scskill' (the name of the radio group) so it display the scskill that was selected's label text.

fathom cave
#

Also is there a way to make a label's prefix text display above instead of left?

earnest imp
#

Trying to build a list of macro to select to a dropdown, this is the code:

let macro_list = game.macros;
let macro_string_array = [];

// Build macro string array.
for (let available_macro of macro_list) {
    macro_string_array.push(available_macro.name);
}

// Sort the array ignoring case sensitivity
macro_string_array.sort((a, b) => {
    // Convert both strings to lowercase
    var stringA = a.toLowerCase();
    var stringB = b.toLowerCase();

    // Compare the lowercase strings
    if (stringA < stringB) return -1;
    if (stringA > stringB) return 1;
    return 0; // strings are equal
});

// Implode macro string array.
macro_string_array = macro_string_array.join(",");

// Return macro string array.
// console.log(macro_string_array);
return macro_string_array;
#

The idea is to put it in a dropdown

#

But this is the result, any idea why this happens

copper jetty
#

Hello everyone, I apologize in advance, English is not my primary language

i just installed CSB, getting used to the features, right now i'm on the "sheet" conception, how did you guys do when you want to create a system with several races, classes, subclasses that have certain exclusive mechanics? And how do you plan to level up? I mean, should i use Item Containers or dropdown lists for example....

copper jetty
#

double thanks, that sheet is great

fierce harbor
fierce harbor
formal goblet
formal goblet
earnest imp
#

oh jeeze lol thats way shorter

#

let me try 🤣

fathom cave
wintry crow
#

I want to make a button that applies rolled damage to the character using custom system builder, could somebody point me in the right direction on what to look for?

I am assuming I'd need to create a macro and then add it as a button but any help is appreciated

tardy rain
#

why does the

#

why does

#

refrencing

#

a key

#

in label

#

refrence only the formula within the label

#

while refrencing it within

#

label roll message

#

pulls everything within label

#

and also

#

how does one pull only integer/forumula expressions

#

when pulling a key

#

ie:

#

instead of pulling the string "Rank 3"

#

I want it to pull the value assesed by this formula

#

which is 3

#

in this case

#

and pull it as the data type that results from the evaluation

fierce harbor
# tardy rain

It pulls everything in Label Text.
You could put Rank in the prefix and the formula in the text. This way you'll pull just the formula.

tardy rain
#

additonaly

#

for

#

sums of dice rolls with intergers

tardy rain
#

it has this decompisition

#

which is helpful

#

however after refrencing a varible

#

like so ^

#

it no longer decompses

#

sorry for spelling its late and im tired

fierce harbor
# tardy rain

Don't know about that.
But, if I may, things will be more clear after some sleep 😉

tardy rain
#

one more thing

#

wait sorry didnt mean to reply lol

#

sorry I pinged you

#

uh

#

is there an inbuilt system

#

for rolling

#

advantage

#

or do I have to use nested conditionals

fierce harbor
tardy rain
#

okay

#

and I would set that up like

#

roll:= disadvantage ? min(roll formula, roll formula) : advantage ? max(roll formula, roll formula) : roll forumula

#

^

#

?