#Custom System Builder

1 messages ยท Page 37 of 1

worn iron
#

I messed up my own example, my bad

#

there are times where every success adds a wound, but they're rare and mostly power related (Also siege weapons)

formal goblet
worn iron
#

Yeah, that tracks

#

Good night and thank you so much for all the help

heavy elm
#

Any idea whats going on here and how I can proceed? In some cases everything works fine but its Like random what value I get here from several Items. Some return me two values one 14 and another one the correct value. Even when I use just a Copy of the requested item and dont make any changes. Its complete random what I get here.

formal goblet
heavy elm
#

๐Ÿ˜ฎโ€๐Ÿ’จ

formal goblet
#

Maybe the console has some input

heavy elm
#

I'll check at home

formal goblet
#

And you could check your props in the console too

static cargo
#

Hello, is it possible to make items that bring other items along when added, such as "Fire elemental" species item that has "Fire Resistance" piggybacking on it?

formal goblet
dense pine
#

It seems that after the Update to V12 / CSB 4 tehz following Label Roll Message of a Button stopped working:

#

${
setPropertyInEntity('self', 'MUT_base', 15)
setPropertyInEntity('self', 'KLUGHEIT_base', 15)
setPropertyInEntity('self', 'INTUITION_base', 15)
setPropertyInEntity('self', 'CHARISMA_base', 15)
setPropertyInEntity('self', 'FINGERFERTIGKEIT_base', 15)
setPropertyInEntity('self', 'GEWANDHEIT_base', 15)
setPropertyInEntity('self', 'KONSTITUTION_base', 15)
setPropertyInEntity('self', 'KOERPERKRAFT_base', 15)
}$

#

anyone have a clue why? Had no issues with this before

#

it updates the first value and then stops

umbral jackal
#

One thing I really want to try to do is have a chat message for an attack roll list all of the player's selected targets, highlighting the target on hover similar to combatants in the combat tracker, and include a button that allows them to make a defense roll. I'm not entirely sure how to do that, though,

formal goblet
umbral jackal
#

._.; It may not be doable at all, then.

formal goblet
#

I could figure out how to get the targets of a user, but highlighting is completely out of my scope

umbral jackal
#

That may have to be an optional part, then.

formal goblet
#

Try out game.users in the console and see if you find any useful functions in the prototype

umbral jackal
#

All righty.

formal goblet
#

If you find nothing, then you can consult the Foundry API or the macro-polo channel for the first 2 topics

#

For the defense roll...

My idea would be to store all necessary data for the defense check in the data-attr of the HTML-Element (Button) and then call a Macro in the onclick-event

umbral jackal
#

Hmm...the only issue I have with using macros is not knowing if I can easily export them along with the JSON data to other GMs I'm sharing the system data with.

formal goblet
umbral jackal
#

Oooooh. I don't know why I hadn't thought of that. Thank you!

umbral jackal
#

Thank you! ๐Ÿ™‚

As for the game.users thing, I do see that each user in that list has a targets array.

umbral jackal
#

Each holds a token.

umbral jackal
#

...Okay, maybe that isn't the only problem with using a macro...I have no idea how to write a macro with this system.

EDIT: Never mind, a search helped.

umbral jackal
#

Okay, that didn't help. All I want is to be able to save the below to a macro and call it whenever I need it. Can I even do this? Or do I have to convert the whole thing to a Javascript script?

?{rollModifier:"Edges/Obstacles (positive is edge, negative is obstacle)"[number]|0},
?{attributeMod:"Modifier"[number]|0})}$
${#rollFormula:=concat(string(2 + abs(rollModifier)), 'd6', switchCase(sign(rollModifier), 1, 'kh2', -1, 'kl2', ''), '+ ${attributeMod + stat_ACV}$')}$
${#modSeverity:=switchCase(abs(rollModifier), 0, '', 1, 'Minor', 2, 'MAJOR'can, '${abs(rollModifier)}$x')}$```
formal goblet
umbral jackal
#

Wait, derp, ComputablePhrase is a thing.

umbral jackal
#

I'm really just looking to use the macro to pre-emptively set some variables. Is there really no way to do it with just CSB formulas?

umbral jackal
#

Never mind, I'm just going to include all that in label roll messages. It's too complicated for me to try to do it as macros when I'm still stuck in the CSB mindset.

heavy elm
exotic blaze
#

Heya, wanted to ask if it's possible to create these side tabs you also have in DnD5e?

heavy elm
formal goblet
formal goblet
formal goblet
heavy elm
formal goblet
formal goblet
formal goblet
heavy elm
#

Okay, I'll give you access to the world later

#

Thank you

exotic blaze
formal goblet
exotic blaze
formal goblet
umbral jackal
umbral jackal
#

Thanks.

umbral jackal
#

Well, I got this far.

#

<p><strong>Roll:</strong> ${[%{return await game.packs.get(`world.macros`).getDocument(`1eyuUXQfSrcKAJvO`).then(m => m.execute({ rollMod: ${rollModifier}$ }));}%]}$</p>

formal goblet
#

It would be easier to save the result in a variable and use that in the Roll Formula instead

umbral jackal
#
let keepMod = ``;
switch(Math.sign(rollMod)) {
  case 1:
    keepMod = `kh2`;
    break;
  case -1:
    keepMod = `kl2`;
}
let rollFormula = `${2 + Math.abs(rollMod)}d6${keepMod}`;
return rollFormula;```
formal goblet
umbral jackal
#

All right, I'll give that a try.

#

Progress?

formal goblet
umbral jackal
#

...I...did not know that. ๐Ÿคฆ๐Ÿผโ€โ™‚๏ธ

#

Oh! That fixed it! Thank you so much!

#

Now to see if I can modify it so that the macro also returns an edge/obstacle announcement string.

#

I think I'd do that by turning the return rollFormula; to return { rollFormula: rollFormula, eoString: eoString};, and change ${[:result:]}$ to ${[:result.rollFormula:]}$, and then doing whatever with result.eoString...right?

formal goblet
umbral jackal
formal goblet
#

You might need to edit options.localVars within the Script

umbral jackal
#

Possibly. Doing it the way I tried just resulted in "object" being called an uncomputable token.

umbral jackal
#

Well, my thing for adding a list of targeted tokens to the chat message was working, until I actually tried to add the list of targeted tokens. I honestly don't understand what it is about this system that I'm just not getting. I know the problem is between the keyboard and chair, and it's frustrating the crap out of me.

#

...Okay, hang on, there's one thing I haven't tried yet.

#

No, that didn't work.

#

What's even more frustrating is that it works just fine in the debug console, but not when placed in a script thingy in the chat message.

#

...Never mind, I figured it out.

humble geyser
#

How do I phrase this? You know how with labels, you can click them, and it can do a dice roll and send a message in chat. How can I add something like that to an individual item without effecting its template?

#

I have a template for "abilities" that I want to be able to drag and drop onto character sheets, so I made them an "Item". But each ability will have different rolls and macros and what not. I wish I could edit the item sheets individually, and just have the template act as the baseline.

#

Cause I would rather not have to make a template for each individual ability or item

umbral jackal
#

It's kinda seeming like this system doesn't play well with template strings.

lethal flax
#

@formal goblet yo trying to do this formula ${switchCase(InitiativeStatDropwdown, 'brainsinitiative', brainsmod, 'brawnsinitiative', brawnsmod, 'braveryinitiative', braverymod)):0}$, which depending which drop down option listed returns a value of a choosen number field, however all i'm getting from it in vewing the hiiden attribute is ERROR.

formal goblet
lethal flax
formal goblet
#

)

lethal flax
#

okay now its just retuning a blank value (not even a 0) and now showing the actual value it should have.

lethal flax
formal goblet
lost wigeon
#

OK, quick question. I'm sure there is a simple answer to this.

I use macros inside of labels to allow people to spend experience by clicking on a Label text.

Example for Strength:


const { strength, experience, rank } = entity.entity.system.props;

if ( ( ( parseInt(strength) + 1 ) <= (rank) ) && ( parseInt(experience) >= ( (  parseInt(strength)  + 1 ) * 4 ) ) ) {

await entity.entity.update({"system.props.experience":  parseInt(experience)  - ( (  parseInt(strength)  + 1 ) * 4 ) });
await entity.entity.update({"system.props.strength":   parseInt(strength)  + 1  });

return "Strength increased!";

} else {}

return "Strength already at maximum for rank or out of Experience!";

}%```

However, I have a table of Specialties in which I wish to use a similar method.  

For the table called "specialtyTable", I want to increase the value of "specialtyValue" in the same row as the Label that you click on to perform the macro in the roll message.  How do I specify this in the above?  Thank you! ๐Ÿ™‚
formal goblet
lost wigeon
#

So, I'd say options.reference.specialtyValue ?

formal goblet
#

It's a string (something like 'specialityTable.0.specialityValue')

lost wigeon
#

Got it. Obviously, it's dynamic using the same row, and the players can add more to the table by selecting new specialities to add, etc, etc.

#

So, the label has to dynamically update the value on the same row as itself.

#

On the good note, I think this is the final mystery that I need to solve to get my sheet to 100% ๐Ÿ™‚

formal goblet
#

The 0 is the row index, so you can use that to get the row data. The row data itself is just an object with the properties of the column

lost wigeon
#

Got it! Perfect:) Thank you!

lost wigeon
#

And...I just noticed that you guys already implimented inherently a simpler way to do all of this. ๐Ÿคฆโ€โ™‚๏ธ

brittle moth
left osprey
#

can i make a conditional that checks a string instead of a number? or do have to go to js for that?

worn iron
#

Ooc, how do people set up Hit Boxes?

formal goblet
worn iron
#

Something that shows you have

x/y health or wounds remaining so that I could then work on making something that could remove wounds when damage occurs

#

I guess I don't really know how to describe it

#

Like, currently I have 2 seperate boxes for Current and Max "Wounds"

velvet heron
# worn iron Ooc, how do people set up Hit Boxes?

The way I have mine set up is, in my template I have a separate tab called GM which players do not see (set to minimum Assistant GM role) where I have Number Fields set up that I can enter the character's starting/current stats - I only have Body Points and Mind Points.

Then, under the Prototype Token's Resources tab, I set up Bars 1 and 2 Attributes as the Keys for those two Number Fields.

This way, when you drag the character's token onto the mat, it should display those stats as bars that you can then adjust with a right click.

If you need screenshots for clarity, I'd be happy to assist.

worn iron
velvet heron
# worn iron Yeah, I think i'd need Screenshots to understand. Sorry

No worries. Each of the next paragraphs will reference each of the screenshots here.

So my actor sheets have a tabbed panel at the top. So I have added an extra tab called GM, which has a minimum role as Asst GM so the players don't see it.

In that GM tab I have two number fields which correlate to a character's BP and MP. In my case, I set the maximum to be a formula taken from another number field section, so players can't accidentally add more health than they are allowed when they heal themselves.

Then, on the Prototype Token box, under Resources, I set two attribute bars, one for each of the resources I already set.

Finally, when I drop the token down, it will show the bars for each of those attributes correctly.

I hope this helped.

mint prawn
#

Was thinking of doing a project with this but before I started, was curious about the ease of sharing it for others to run - I see the manual says something about being able to export templates in the settings and then import. Easy as that or any pitfalls?

brittle moth
#

#package-releases message
Hi everyone ๐Ÿ™‚

**Version 4.1.0 is now generally available, with the following changes : **

Technical Features

  • Added mandatory getTechnicalName method for Component classes. This will output a warning in the console until Foundry v13 compatibility version.
  • Allowed Component Registration to only take one argument : the Component Class

Features

  • Added the ability to drag and drop rolls to the Macro Hotbar
  • Added translation support
  • Added french translation
  • Added german translation
  • Reworked various texts, notably renamed Item Container to Item Displayer

Fixes

  • Fixed Dynamic Tables wrongly allowing any type of component as a column - Restrictions are back in place
  • Fixed Tabbed Panels not accepting dropped component
  • Fixed Macro rolls from ItemContainer

If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new

last mirage
#

is there a module or an easy way to track experience on a character sheet and automatically level them when they hit certain numbers?

half beacon
#

This should be good

half beacon
brittle moth
# half beacon Dynamic tables allowing any type of component? ๐Ÿ‘€

No that's the opposite ^^"
Dynamic Tables should not be able to allow anything as a Column, specifically Containers do not work. An issue made its way in and allowed unauthorized components to be added to Dynamic Tables, but this was not intended
Sorry the changelog was not clear :/

safe halo
#

how can i convert a string "str" into the value of the property str?

#

exist a function like getProperty(myProp) ?

#

found it

#

ref

#

_>

charred spire
#

Does anyone know why this little button appears at the bottom? And how to remove it?

#

Under name Jimbo

#

// Rola trรชs dados de 6 lados
let roll = await new Roll('3d6').roll({async: true});
let roll1 = roll.dice[0].results[0].result;
let roll2 = roll.dice[0].results[1].result;
let roll3 = roll.dice[0].results[2].result;

// Cria um array com os resultados e os ordena
let rolls = [roll1, roll2, roll3].sort().join(",");

// Define a mensagem com base nas combinaรงรตes
let message = "";
switch (rolls) {
case "1,1,1":
message = "รšNICO 1, 1 ,1" ;
break;
case "2,2,2":
message = "SUPER RARO 2, 2, 2" ;
break;
case "3,3,3":
message = "SUPER RARO 3, 3, 3" ;
break;
case "4,4,4":
message = "SUPER RARO 4, 4, 4" ;
break;
case "5,5,5":
message = "SUPER RARO 5, 5, 5" ;
break;
case "6,6,6":
message = "LENDรRIO 6, 6, 6" ;
break;
case "1,3,5":
message = "SHINY 1, 3, 5" ;
break;
case "2,4,6":
message = "SUPER SHINY 2, 4, 6" ;
break;
case "1,2,3":
message = "RARO 1, 2, 3" ;
break;
case "2,3,4":
message = "RARO 2, 3, 4" ;
break;
case "3,4,5":
message = "RARO 3, 4, 5" ;
break;
case "4,5,6":
message = "RARO 4, 5, 6" ;
break;
default:
message = Rolagem: ${roll1}, ${roll2}, ${roll3};
}

// Exibe a rolagem e a mensagem no chat
roll.toMessage({
speaker: ChatMessage.getSpeaker(),
flavor: message
});

#

this is the script

#

let roll = new Roll('2d6');
await roll.roll({async: true}); // Executa a rolagem com animaรงรฃo

let result = roll.total;
let message;

if (result >= 10) {
message = "Sucesso Total";
} else if (result >= 7) {
message = "Sucesso Parcial";
} else {
message = "Falha";
}

// Exibir o resultado no chat com a rolagem animada
roll.toMessage({
flavor: Resultado: ${message},
});

#

the same thing happens here

formal goblet
charred spire
charred spire
formal goblet
charred spire
formal goblet
# charred spire

Go into the permission settings and allow your users to execute Macros

sinful spade
#

Hey, is there a better way to create radio buttons in a dynamic table?
Rather than having 5 columns for 5 buttons, can it all somehow fit in 1 column?

#

I suppose a table in a table could work if there's a way todo that?

sinful spade
formal goblet
sinful spade
formal goblet
sinful spade
#

I'm probably going to do the up and down arrows on each side of the radio buttons since I (dont think can) can't stack them.

#

(probably going to have to change the dropdown to a label as well)

formal goblet
sinful spade
formal goblet
sinful spade
# formal goblet Yep. Quite a bit of work, but I think it's handleable

I think for that amount of work splitting thre arrows on either side of the radio is my best bet ๐Ÿค” should way simplify the process.
Not sure if this is a bug, but I have a tooltip for the panel tab that's a few levels above this table, and it shows the tip not only when hovering the tab itself but any content within the tab

#

visual:

the tooltip (TT) is set to the social tab but shows all the way down in another panel (no tt set) into a table

formal goblet
#

Interesting one. I think it's worth a report in Gitlab

sinful spade
#

I've never actually done that before lol
Not the most technical of people if you can't tell..
I'm over here trying to figure out how to make my up down buttons function lmfao

#

i actually dont even have a gitlab account, only github

sinful spade
#

So if I set the downarrow to a label and put this in the roll message:

${#notify('info', 'test')}$
It still outputs this to chat and makes a roll sound, can I disable that?

exotic blaze
#

what is the internal css name for the background of the character sheet?

sinful spade
#

using a formula for label text, how do i return an output to be displayed?

sinful spade
#

I also need to figure out how to set the group of a radio button to be different PER ROW in the dynamic table

glad bison
#

I have a question, I'm using the custom system builder, and i'm not really well versed in the language used for it and i wanted to know how i would reference one component to answer another. For example say i put the number 20 into a component where i track Dexterity and I have a formula of (dexterity-12)/2, how would I make it so another component would take the 20 and put it through that formula to get an answer.

sinful spade
#

Note the math there is boiling down to ((input - 10) / 2) THEN round down.

glad bison
#

so if i wanted to take the number put for Str and use it in a formula to output a number in the tiny box to the right what code would I use and where would would I put in in the component.

#

say the number for Str is like 15 or something

sinful spade
#

make sure the box next to STR is a number field.
Where the box on the right is, set it to a label
in the label text set it to ${(floor(STR)-12)/2}$
where STR is the component key for the number field.

glad bison
#

it worked but I;m getting a -6 with a 15 in Str

sinful spade
#

what formula did you put? parenthesis matter.

glad bison
#

is this right?

sinful spade
#

yeah you copied what i did exactly lol which was a half conversion from 5e to what you said.
change up the parenthesis to be in the right order of operations.

floor((STR-12)/2)

glad bison
#

should I keep the ${ before and after?

sinful spade
#

absolutely.
that's telling the system that it's a formula and not just text.

glad bison
#

thank you been stressing about this for like an hour ๐Ÿ™

sinful spade
#

trust me i know

#

i've been fighting with getting radio buttons to have per-line grouping,
and getting arrays to work and output in a dynamic table for about 5 hours now

#

the wiki is absolutely no help.

sinful spade
# glad bison thank you been stressing about this for like an hour ๐Ÿ™

this is a out of date tutorial but it covers the basics and isn't horrible, most of what's wrong you can figure out: https://www.youtube.com/watch?v=yGVOj_iqiKg&t=123s

glad bison
#

aight thx

glad bison
#

is there any way to change the color of the meter component, i wanna change it to blue

sinful spade
charred spire
rich dagger
#

Hi! After the update Custome System Builder stopped working on Forge. It won't even show up among the installed systems, and when you try to install it, is says ok, but nothing is changing. I tried to uninstall, tried to upload through the Importer as well. Local version is working perfectly.

vagrant hollow
# charred spire

Head to the macro directory, find your macro, open the permission setting for this macro and grand at least viewer rights to the persons you want to be able to use tis macro.

brittle moth
sinful spade
#

dang that was fast

#

mr creator man ๐Ÿ™‚
heads up there is a bug with the tooltips carrying into items beneath the panels, into other panels and tabels if no other tooltip is set โค๏ธ

brittle moth
# sinful spade dang that was fast

I had trouble building the package for this version, I think the Forge had downloaded a faulty version. The new version is nothing other than a new number to force the Forge into redownloading the package ^^"

#

But since I don't use it, I can't make sure it worked as intended :/
And the default Foundry Version for a standard User is v11, so the versions aren't even displayed in the bazaar :/

sinful spade
#

i currently have my css file set to /charactersheet_css_custom.css in the settings.
the wiki just says to set it to the file path starting from the data location - yet there are multiple data folders...
since im using node JS my dir looks like:

FoundryVTTServers\v12\data\Data\worlds\worldName\data
I've tried a few options but nothing seems to be working to load the css.
to test I have it set it * { background-color: red; }

#

opp -- nvm
worlds/worldName/data/charactersheet_css_custom.css worked... wild.

brittle moth
#

It's the path inside FoundryVTTServers\v12\data\Data

sinful spade
#

yeah on my linux OS it had worked with just "/style.css" which is why i was confused why it didnt work, and i tried the first and last data dirs... it was the middle one lol.

#

Heads up everyone:
when setting a meter color you need to add the !important css modifier as there appears to be a green overlay from the default element styling

.additionalCSSClass .custom-system-meter-fill {
background-color: #8d0621 !important;
}

#

Can someone ping me in the reply so I can get to it when I wake up?

But is there a way to change css coloring of a meter based on a dropdown value?

It'd be super dope to change the meter to a darker redish purple as you're more disliked and a lighter greenish blue as you're liked

#

I really think the visual distinctions would really help organize and quickly relay information

broken pumice
#

@sinful spade Not sure if it's what you want exactly, but you can change the colour of the meter based on the optimal, sub-optimal and sub-sub-optimal values.
I managed to make it work for firefox browser, but not for chrome. Here is what I currently have :

.custom-class-name {
--background: rgba(180,180,195,1);
--optimum: rgba(150,150,220,1);
--sub-optimum: rgba(100,100,155,1);
--sub-sub-optimum: rgba(50,50,90,1);

meter{
background: var(--background);
}
/Firefox/
meter:-moz-meter-optimum::-moz-meter-bar {
background: var(--optimum);
}
meter:-moz-meter-sub-optimum::-moz-meter-bar {
background: var(--sub-optimum);
}
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar {
background: var(--sub-sub-optimum);
}

brittle moth
# sinful spade Can someone ping me in the reply so I can get to it when I wake up? But is ther...

I'd say you have two solutions :

  1. Use a dropdown for the liking level, with numbers as key (a liking rating from 1 to 5 for example) and a meter with that dropdown as a value and min:0, max:5, low: 3, high: 4
    The meter will be red on 1-2, yellow on 3, green on 4-5

  2. Use a dropdown for the liking level, with numbers as key (a liking rating from 1 to 5 for example) and a label with an html element and custom styling based on the dropdown's value

rich dagger
brittle moth
rich dagger
rich dagger
brittle moth
#

Glad this is solved ๐Ÿ™‚
Enjoy the system, don't hesitate to message again if you have any issues ๐Ÿ™‚

glad bison
#

how would i make this code round the number down, ${floor(Str-12)/2}$

sinful spade
sinful spade
sinful spade
# brittle moth I'd say you have two solutions : 1. Use a dropdown for the liking level, with ...

yep, i got a drop down to signify the degree of which they like you - and a meter to show progress between reputation tiers.
So basically "xp bars" and levels.
Already have a dropdown containing all of the reputation tiers (1-11 as the key, so 5 pos 5 neg 1 neutral)

I have zero clue how to use the key as a HTML selector though... Is there a way in CSB to identify the key as a css class? and how would i port that information to sameRow(meter)? I'll be playing around with it for a few minutes here...

#

Sorry to always be in here asking questions but I've read the wiki on gitlab up and down about 6 times and frankly am at a loss for how to do most of what I want to do, at least the more advanced side of things

glad bison
humble sonnet
#

more parentheses, I think

sinful spade
humble sonnet
#

${floor((Str-12)/2)}$

sinful spade
#

you are div by 2 after the rounding

glad bison
#

thx

sinful spade
#

there's not a function in CSB that lets me change the css class in advanced settings is there?

#

Like I cant put a formula in the css class section right?
${sameRow('reputationTier')}$ and just style the resulting .Neutral class?

#

didn't work ๐Ÿ˜ฆ

brittle moth
#

No, additional CSS classes are not formulas ^^"

brittle moth
sinful spade
#

correct, I've found the keys within the select -> options elements

#

what i'm stuck on is using that information to alter the meter in the same row.

#

if I just did say .reputationTier select option[1] {background-color: red;}
I'd have effectively changed the color of my dropdown menu and not the meter fill.

#

i have no clue how to uh...
.reputationTier select option[1] { sameRow(meter){ background-color: red;}} ??? lol

brittle moth
#

You can set a Key on your meter ๐Ÿ™‚
But indeed, you will Target every meter in the Dynamic table

sinful spade
#

if i just target the key, it will change the dropdown, not the meter.
how do i use the data from the options element to impact the meter-fill class

#

.reputationTier select option[value="1"]{
background-color: red !important;
}
like i said, selecting the key only changes the color of the dropdown menu (suprisngly not even if it is the selected item, just the item in the menu)

brittle moth
#

You won't be able to change the meter's color for each value using just CSS. You won't be able to target each value, you will be able to target the meter as a whole but that's it

sinful spade
#

so what im doing is impossible ?

brittle moth
#

There may be a way

If you know all the percentages the meter can take, you can target the colored part with .meterKey .custom-system-meter-fill[style*="30%"] (Example with 30% fill)

#

Then you can turn it red (for example) with background-color: red !important;

sinful spade
#

so at 25% or 75% the green bar should be red, untill it fills up and they are no longer in a blood fued then it's 0% for say... "hated" status and should be... orange?

brittle moth
#

oh, I didn't understand that, sorry ><
If you don't need more than 3 colors that may be doable. Otherwise no, this won't be possible in the current element, and you should maybe use a Label to create your own meter-like display ๐Ÿ™‚

sinful spade
#

is it possible to transition to the three colors based on distance from the key?
E.g. a gradient from red yellow green?

brittle moth
#

not with the basic meter component

sinful spade
#

is there a beter suited component then?
there's already a numberfield controling the meter's progress

#

${sameRow('reputationProgress')}$

brittle moth
#

Like I said, you can use a Label
Something like

<div class="custom-system-meter" style="width: 100px;">
<span class="custom-system-meter-fill" style="width: ${floor((sameRow('reputationProgress')*100)/6)}$%; background-color: ${switchCase(sameRow('reputationTier'), 0, 'red', 1, 'orange', 2, 'yellow', 3, 'green', 'blue')}$;"></span>
<span class="custom-system-meter-content">${floor((sameRow('reputationProgress')*100)/6)}$%</span>
</div>
#

This is assuming :

  • reputationProgress goes from 0 to 6
  • reputationTier goes from 0 to 4, 0 being the worst tier and 4 the best
#

You put this as your Label text and it should display correctly
Warning though : this won't automatically resize, you'll need to adjust the width parameter in the first div

sinful spade
#

hold on, you can inject html directly into a label?

#

i've done... so many workarounds...

brittle moth
#

Into label text, prefixes, suffixes and roll messages

#

Hell, you can even start an HTML string in a prefix, add to it in the text and close it in the suffix

sinful spade
#

i'm going to go cry in a corner

#

next question before i do

brittle moth
#

sorry

sinful spade
#

when i tried doing an array in a ${}$ earlier, it just output an error

#

before doing a dropdown i was trying to make buttons to control the selected value... but it would only output an error...
Why?

#

The code was SUPER simple
${const arrayName = ["value", "value2"];}$ and even that output an error

#

the logic was
${ const array
IndexedNumber = 1
currentRank = array[IndexedNumber]
}$
So the buttons could theoretically just changed the indext number condition...
but even removing everything but just the array was an error and i checked it with my dev friends for syntax errors.

brittle moth
#

That is because CSB language does not support arrays. You can do this in a Javascript script, by replacing the ${}$ with %{}%

Then inside the brackets, you write Javascript and must return a string, which will be outputted to the chat
Here is the doc for that :
https://gitlab.com/custom-system-builder/custom-system-builder#45-scripts

(You may have to search the section yourself, GitLab is janky with those links... The section is 4.5. Scripts)

sinful spade
#

yeah i read the scripts section i didn't understand what it meant by "outside the system"

#

i figured that was a usecase for accessing other module's api or something... didn't realize that it was just to use native JS

#

figured any native js would be compiled by math.js just fine

brittle moth
#

It's both ^^
And no, math.js is pretty picky

sinful spade
#

if you cant tell by now, i'm not a developer. i'm a power user lol

#

it's me, i'm the wetware problem

#

There appears to be an issue with the math logic though ๐Ÿค”
i tweaked what you sent from *100/6 to:
${(sameRow('reputationProgress')-1)*25}$%;
as its a scale of 1-5
so (1 - 1) * 25 = 0, and (5-1)*25 = 100.
Yet for some reason i'm getting odd incriments I've double checked the parenthesis and logic checks out yet i'm getting uhh

#

op there's a second span conflicting

brittle moth
#

The formula is in two places ^^

sinful spade
#

yeah i dindt read that low in the code yet ๐Ÿค”
trying to figure out what the second fromula is for

#

a content class? is that for the ceiling?

brittle moth
#

The first is the width of the colored part, the second is the text printed in the meter

sinful spade
#

oh that's an interesting approach

#

dude seriously thank you for your help

#

you're a lifesaver

#

it's god damn beautiful

sour egret
#

Hi, I literally downloaded the custom system builder today, and I'm checking the Deathwatch sheet. Does anyone know if there should be some kind of button here or something? Maybe I forgot to download something? Im very new to this and not sure what to fix if something is not ok

brittle moth
sour egret
#

i dont think it has any

brittle moth
#

You can go to Foundry Settings, under Custom System Builder and set "Roll Icon" to "dice-d20"
This should highlight all rolls in the sheet ๐Ÿ™‚

#

Beware though, the Deathwatch sheet is pretty old, it may be non functional with latest versions of CSB :/

sour egret
#

its here many thanks

crimson girder
#

so im trying to use this to create a working sheet for the fire emblem roleplaying game, but I could use a few pointers

#

so in the game, you can carry several weapons, but only one can be equipped, how can I tell the system which item is equipped for the purpose of it being factored into calculations of attack

copper glade
#

How might you use the refresh button's function (the one beside the template dropdown on actor sheet), from a macro? I update a lot of values on the sheet but it's not very responsive to update itself for the players.

formal goblet
# crimson girder so in the game, you can carry several weapons, but only one can be equipped, how...

You could use a Dropdown (with options-origin: Dynamic Table) to select which Weapon should be equipped. With that, you can either perform a lookup() on the Table or you use a little Script to fetch the value of the Item, which is not present on the Container: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Items#1-scripts-for-fetching-values-of-specific-items-in-an-actor

formal goblet
brave trench
#

I have math errors (I think? ERROR or NaN) all over my sheet after updating from 4.0 to 4.1.1, had no issues in 4.0. What changed?

formal goblet
brave trench
#

not the whole thing, and there are like 500 of them so not sure if all the same but I think they are.

formal goblet
brave trench
#

found another

formal goblet
#

fetchFromDynamicTable() doesn't exist anymore. It got renamed to lookup()

#

You might want to export your templates and replace all old functions with the new one (with search/replace)

brave trench
#

whats the best way to do that? Export then open where? I never edited sheet stuff anywhere but from CSB

#

or foundry i mean

formal goblet
sinful spade
brave trench
#

Well, that was easy. ^_^ Thank you.

sinful spade
#

suddently my sameRow functions seem to not want to work

#

I'm getting "cannot convert attributeValue to a number" but it just refernces adding modifiers to bonuses?

#

the codee for attributeValue:
${sameRow('attributeModifier', 0) + sameRow('attributeBonuses', 0)}$

#

there's also a new warning:

Error: The {{select}} handlebars helper is deprecated in favor of using the {{selectOptions}} helper or the foundry.applications.fields.createSelectInput, foundry.applications.fields.createMultiSelectElement, or foundry.applications.fields.prepareSelectOptionGroups methods.
Deprecated since Version 12
Backwards-compatible support will be removed in Version 14

#

@formal goblet sorry for the ping but i think CSB broke '-'

#

so far it appears that it can no longer get a number from a label? but i'm not even certain

formal goblet
sinful spade
#

other than errors in the console? it only seems to return the value of the Bonuses without the Modifer

#

whats weird was these exact cells were working for weeks lol

#

and all the sudden i realized their math was off because i tried to reference them later and the console threw a fit

#

deleted the new addition and now they're entirely broken

formal goblet
#

You can inspect the props with game.actors.getName('actorName').system.props in the console. Maybe there's something suspicious.

sinful spade
#

anthing i should be looking out for specifically?

formal goblet
#

undefined, 'ERROR', values that don't fit

sinful spade
#

nothign standing out

formal goblet
#

Where do you use the value of attributeValue?

sinful spade
#

attribute Value is the "total" column

#

notice it's wrong lol

formal goblet
sinful spade
#

running just the sameRow modifier gets all 0s

#

so - fallback i guess

formal goblet
#

Try without the fallback

sinful spade
#

removing the fallback gets the correct numbers BUT

#

Custom System Builder | Cannot convert "attributeTable.1.attributeValue" to a number Error: Cannot convert "attributeTable.1.attributeValue" to a number

#

this reappears in console

formal goblet
#

You're using sameRowRef() somewhere, right?

sinful spade
#

the code in the referenced cell works just fine -
no errors in console, correct output; just a label that converts into 5e modifers as a placeholder ${floor((sameRow('attributeBase')-10)/2)}$

sinful spade
formal goblet
#

But that string can only come from sameRowRef()

sinful spade
#

i mean - idk waht to tell you lol this is the code for attribute value currently, and it's outputting that error:

${sameRow('attributeModifier')}$

formal goblet
sinful spade
#

uh, I had it set to lookup earlier but did change this function to use lookupRef:

${lookupRef('attributeTable', 'attributeValue', 'attributeName', sameRow('abilityBaseAttribute'), "==")}$

formal goblet
sinful spade
#

i just changed that a while ago because it was sending errors related to that function that I hadn't touched since pre 4.1.1

#

and by a while ago i mean 20minutes or so lol, ๐Ÿค” but changing it back no errors are coming back... that's really... weird.

formal goblet
sinful spade
#

i wonder if the new things i added somehow broke that old cell...

#

even more weird is that table wasn't referenced at all

#

but either way for now there's no errors, thank you so much and again sorry for piniging

crimson girder
#

hmmm ok so heres a new problem

#

i need to import a variable from the enemy target

#

then i need to compare it to the roll

#

this is what i have so far but its not compiling

#

basically the result of the roll needs to be equal to or lower than the sum of the player's accuracy minus the enemy's dodge

#

i think i need a string to check the result?

static cargo
#

Do we no longer have those "mini-templates" that can be put into main templates?

brittle moth
brittle moth
charred spire
#

I was going somewhere else

crimson girder
#

from what i can see the syntax looks right

crimson girder
#

if it would be easier, i can dm you directly

brittle moth
crimson girder
#

lemme check

#

thats what it returned

brittle moth
crimson girder
#

I put the formula you posted

brittle moth
#

Ah damn, it's my bad, I brainfarted...

FoundryVTT's roll API does not do comparisons, so you need to do it outside the roll :

Hit: ${roll1:=[1d100] <= (Accuracy - fetchFromActor('target', 'Dge', 0))}$
Crit: ${roll2:=[1d100] <= (Crit - fetchFromActor('target', 'Avd', 0))}$
brave trench
#

Is the intent that only item rolls can drop onto the macro bar? Because on my sheet this is the case. Rolls from the sheet don't drop to the bar, but rolls from items do. Unless I'm doing something wrong. Looking for feature documentation currently but haven't found it yet.

brittle moth
#

Any roll with a key should be able to be dropped on the macro bar

#

Does your other roll have a key ? ๐Ÿ™‚

brave trench
#

ah, that might be the problem. let me check

#

yep, lol. Thanks!

worn iron
fallen coral
#

Can anyone help me? I'm using CSB and I have a dynamic table with a dropdown menu that retrieves all the items from an Item Displayer. I'm trying to access a field inside that item called item_effect and I want to display it in that dynamic table (not in the Item Displayer). I would like to know if it is possible to access that field directly only looking for the item name or id, without storing the field value in the item container and then using that value in the dynamic table, if it makes sense

silver lake
#

Heya! I have a problem with Griddy not being able to detect item quantity.

#

I'm using item.Quantity in the respective field, given the variable is named "Quantity", but it doesn't seem to work

silver lake
#

Yes

#

An Inventory module

formal goblet
#

Then you have to discover, how that module actually detects the quantity of an Item. I can only tell you, that all properties are stored under <context>.system.props. In case of an Item (with the variable name item), it would be item.system.props.quantity

silver lake
#

Oh, lemme try that

#

I always get lost in those

#

Nope, nothing..

#

I don't know how to find that out

formal goblet
#

Also make sure that the module does NOT DEPEND on specific systems. It must be system-independent

silver lake
#

Thanks!

charred spire
# worn iron Out of curiosity, what Pokemon System are you making?

Hello, I actually don't even know if I can call it a system lol
Basically and briefly, I took the original Gameboy attributes, did some calculations that made sense, and added some dice.
Coincidentally, I was typing his rules to put in the diary inside the Foundry, because almost everything is in my head lol

#

The initial calculations are
HP/2 + level
Attributes /10 + 1 per level in each one, that is, level 5 would have +1 in all (except HP) and then repeat the process.
2d6 + this value. There are other little things but in short this is it lol

worn iron
#

Oh, so it's more original than anything. Neat!

charred spire
brave trench
#

can anyone give me direction on this error?

normal ore
#

@formal goblet ,

This macro of yours:
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Active-Effects#4-world-script-for-adding-custom-status-effects-in-the-config

You mention that the macro should be added in the World Scripter Compendium.
I didnโ€™t understand that. Where should I add this script? I already have mine ready, but I donโ€™t know where to put it!

normal ore
wheat geyser
#

Hi! How can I make it so that the key value of a dynamic table shows the value of a numberfield?

#

The idea is to use a drop list set to dynamic table ti change the result of a formula. Currently I have it working with:
${ref('alqudl')+alqumod+alqubon+alqunvl}$
And the dynamic table has some integers at the key column. It works fine, but I need to change those int from key column to a ref for another numberfield... So far I haven't been able to do so

formal goblet
wheat geyser
#

I think so... Not completely sure if I get you by 'map numbers'

formal goblet
#

A simple input/output - example

wheat geyser
#

Ok... Right now I have some formulas to show the total value of the atributes. I need to get the final value of those labels into a dynamic table so the drop list changes the value it's using for another formula. The formula is working with this table, but I need the atrval values to mirror the value from a numberfield

wheat geyser
#

Does that work with the regular drop list?

wheat geyser
#

Oh boy... so simple XD

#

I'm pretty sure I did something like that, but messed up anyway somehow XD

#

Thanks a lot!

fallen coral
brave trench
#

@formal goblet did you see my error image a few posts above? I've never heard of that... ".replaceAll" It's not even on my sheet, and this is another new error when changing from 4.0.1 to 4.1.1

woeful skiff
#

As it states on the wiki you can uses data from an actor or item in userInputTemplates.

The template will be displayed using the actor or item data, if you want to use this data in Labels in the template. 

When I call an userinputtemplate in a label roll message of item container how do you reference something in item because item.[key] does not work.

formal goblet
formal goblet
woeful skiff
#

This is a reference from the actor ${strength_perm}$ and works

#

If I reference a key in the item use ${item.skill_specialty}$ I get

#

If i remove the item. I get.

formal goblet
#

We didn't include the properties of the linked entity (aka item). So you won't have a chance without a change in the system

woeful skiff
#

I setup a variable in the roll label message but I could not reference that in the userInputTemplate either.

formal goblet
#

And yeah, I know, dialogs could have some improvements

woeful skiff
brave trench
#

unless its an error in the roll message, that above formula is just the label.

${#?#{User Input Sheet}}$

${#bonus:= equalText(sameRow("operator"),'Auto') ?  autoPilot : fetchFromActor(sameRow("operator"),sameRow("attSelect"),0)}$

<table>
<tr>
<th>${sameRow('stationName')}$</th>
</tr>
<tr>
<td>Operator</td>
<td>${sameRow('operator')}$</td>
</tr>
<tr>
<td>Total</td>
<td>${Roll:=[:diceModSelect2:+:bonus:]}$</td>
</tr>
<tr>
<td>Buffer</td>
<td>${sameRow('buffer')}$</td>
</tr>
<tr>
<td>Limit</td>
<td>${sameRow('limit')}$</td>
</tr>
</table>
formal goblet
#

A wait, I see

#

What does your sameRow('attSelect') return?

woeful skiff
brave trench
#

@formal goblet

The actor is the "operator"

attSelect seems to work, I did a test field in the dynamic table, it returns the chosen attribute of the actor name plugged into the "operator" field.

brave trench
#

@formal goblet Also want to add that I had no problems up until this recent update. To 4.1. did something change on how actor data is accessed?

wheat geyser
#

Hi, is there a bug that makes some rolls not to roll? I've got a able with the same formula but diferent values and some just don't roll, no matter what I change

sonic vault
#

Hi guyss
How do I get the number of lines from a container item, without the items needing to have an attribute quantity = 1

brittle moth
brave trench
# brittle moth 4.1 actually removed the fetchFromDynamicTable and getRefFromDynamicTable which ...

I replaced all fetchfromdynamictable stuff via notepad, control+H/ find and replace all method, so I don't believe so.

I think I fixed this particular error though by telling it to just roll a label (which was a copy of the same formula and was working fine). I don't know why I didn't do this in the first place, I think there was an issue at some point rolling the label so I put the formula in the roll as well. Now it works this way and not the other. ๐Ÿค”

However.... I have another error that I found though. Many of my calculations on this sheet are looking for values on a dynamic table that may or may not have rows added. They calculate fine when there are no rows. when I add a row, they all come up with Error "uncomputeable token" undefined values. Then, when I change any field in the table, the sheet rights itself and all the errors go away. Any clue what is going on with that?

brittle moth
brave trench
# brittle moth I already have a bug report on that, default values in Dynamic Tables not being ...

Oh okay, and no work around for the bug at the moment?

There is an image that shows all attSelect is. This whole sheet is a vehicle sheet. this particular section is a dynamic table with combat stations. a player puts their character name into the "operator" field. the roll (or label now at this point) looks for the operator's attribute based on attSelect. As I said, I think that problem is solved via just rolling the lable. I'm not sure why the roll formula didn't work anymore but the label did but if it works it works lol.

brittle moth
#

Oh well if it's fixed then... Huzzah I guess ^^

timid roost
#

Hey guys, I managed to get my roll macro into CSB character sheet, however, besides the desired result, it also give me an undefined error. When executing the macro there is no error. Is there something wrong with the way I'm doing it? I just copied it from the documentation:
%{return game.macros.getName('rolagem_bl').execute()}%

brittle moth
#

Is there an error message in your browser console ? (F12)

timid roost
#

There is actually!
<span class="custom-system-roll" data-roll-data="{"raw":"undefined","result":"ERROR","parsed":"undefined","hasDice":false,"tokens":{"children":[]},"rolls":[],"hidden":false,"explanation":true}" data-roll-mode="publicroll" data-hidden="false"> <span>ERROR</span></span>

#

Maybe this makes it better to read lol

formal goblet
timid roost
#

%{return await game.macros.getName('macro').execute({name: '${str}$'})}%

Is this correct if I want to input my STR score into the macro before executing it?

formal goblet
timid roost
#

I see. Thanks!

ebon laurel
#

Similar to Guashnim's question, but I want to have my Roll Label fire off both a visible message including dice rolls and text, as well as IronMonk's /timer command (which I have set up as a chat macro since I can't seem to get it to work within the roll label directly). Since I can't just disable 'send roll message to chat', is there some other way I could work around it? Can I fake a return value in a chat macro?

formal goblet
serene helm
#

I've been poking around the internet trying to find an answer, but I suppose I'll just ask here directly:

So I have my own system, and I have a character sheet that goes with it. Is there any way to get CSB to work with that character sheet, like adding buttons/inputs to a PDF?

brittle moth
serene helm
#

Dang. So without some HTML/Java footwork, I won't be able to use the design

#

Righto, thanks ๐Ÿ‘

formal goblet
formal goblet
dusky mauve
# brittle moth Any roll with a key should be able to be dropped on the macro bar

Trying to add roll to macro bar
So my roll is in Dynamic Table. A have click right button on the roll, copy the chat message and put it to macro bar
/sheetRoll ic_combat_skill(@rowId=cs2ThWCX1HMmp90H).roll

when I have modify macro up to official doc - macro stops working
/sheetRoll ic_combat_skill(name=Eels).roll

Doc
To trigger dynamic table rolls, you must use a filter like the property reference, for example : /sheetRoll skill(name=Lock picking).score to trigger the roll associated with the label in the score column of the dynamic table skill, on the row which name is Lock picking.

Error

[Detected 1 package: system:custom-system-builder(4.1.1)]
    at mathInstance.SymbolNode.onUndefinedSymbol (Formula.js:435:27)
    at math.js:26377:89
    at math.js:24320:51
    at Object.evaluate (math.js:24162:45)
    at r.evaluate (math.js:24139:55)
    at Formula.computeStatic (Formula.js:439:27)
    at Formula.compute (Formula.js:366:21)
    at processFormulas (ComputablePhrase.js:103:35)
    at async ComputablePhrase.compute (ComputablePhrase.js:157:34)
    at async Label.js:480:13```
sinful spade
#

How can i use a math.js function on a CSB function?
i specifically want the math.sign(sameRow())
but wouldnt math.sign require %{ and sameRow ${

sinful spade
# dusky mauve Trying to add roll to macro bar So my roll is in Dynamic Table. A have click rig...

I think you need ${}$ as well..
in a later point in the wiki it mentions using a macro;

4.10. Do not include explanation in chat message
When using formulas in chat-messages, you can use the Formula's result as is, without it being enclosed in the clickable box with the explanations. This can be useful if you want to call a macro with parameters calculated from Formulas. To do so, prefix your formula with !, for example :
/myMacro ${!target - roll}$
You wont need the ! unless you want it silent but the example should apply

dusky mauve
sinful spade
#

๐Ÿค” i mean.. it sounds like foundry is having a hard time referencing a given name rather than a document ID.
have you tried it with the ${}$?

sinful spade
barren skiff
#

Hello, i'm new to Foundry and while trying to setup my homebrew (from scratch) system for my friend, i'm trying to setup something that would passive regen their mana and stamina every turn but can't seem to do it, i saw the active effect on the gitlab but can't seem to make it work, nor trigger it, could someone help ? Thanks

sinful spade
#

@barren skiff
if this is to be believed - you'll need some other macro, script, or module to handle that.
Though if it's some 5 hp per round healing... i'd just have people do it manually tbh

barren skiff
#

yeah it's something this easy but i'd like to automate this if possible, most of the player being very new to this, so i could try a macro or script but what i dont get is how would this work ? Should i use the macro every encounter ? I heard about world macro, could this be a thing ?

sinful spade
#

foundry has some built in APIs you could possibly hook with a JS macro that senses the end of a turn

#

something along the lines of...

on new turn
get combatant...
if combatant is player
regen 5hp

barren skiff
#

oh nice, i'll give a look, thanks ๐Ÿ˜„

sinful spade
#

ofc, but hang out for a minute and maybe one of the system devs will come along, they're fantastically helpful

barren skiff
#

well it's 3am here i was about to go to sleep, but sure thing tomorrow ! ๐Ÿ˜„

brittle moth
sinful spade
#

Link kind friend :I
is it possible to reference outside of a table using a sameRow name?
e.g.. to reference 'physicalBonus' and put it into the table as a label in the Physical row?

#

I've been playing with this concept to see if it'd work

${ref(${sameRow('attributeName')}$FlatBonus)}$

#

or, i guess the inverse would also be fine - have an empty label and use an item to modify the value based on the name?

sinful spade
#

I'm not sure if i'm explaining this in a way that makes sense lol

sinful spade
formal goblet
sinful spade
#

If I can get one of these working, I can extrapolate the rest of this table out pretty easily

sinful spade
formal goblet
formal goblet
#

Item modifier key: ${fetchFromActor('attached', "lookupRef('table', 'targetColumn', 'filterColumn', 'filterValue')")}$

sinful spade
#

sure, that'd let me modify their hit once it's rolled i suppose

#

i guess what i'm trying to do is map out the table the be inclusive of items and bonuses to impact generic modifiers in real time so that players can easily see totals and values in row based on skills.
The tricky bit is I'm using dynamic tables to do this all to be able to add skills mid game similar to a 'fudge' system

#

e.g. player declairs a skill he wants to be really good at, and I'd have no way to know in advance to just add it in... so this way he can click to add a new row and just... bam!

#

Am i potentially missing an intermittent step? Using a dynamic table to house all potential skills and port them outside of the table for items to modify?

brittle moth
sinful spade
#

oh, it was sameRow
%{math.sign(${sameRow()}$)}% wasn't working

brittle moth
sinful spade
#

oh, so I can drop the Math. as well since we're using that compiler. that was probably my issue

#

sorry i moved off that problem and am having trouble remembering what i was using that for at this time.

Currently trying to figure out how to let items modify a dynamic table

#

oh right, i was trying to modify the dice pool ...
I needed to separate the sign to notify the roll of KH or KL conditionals

brittle moth
# sinful spade sorry i moved off that problem and am having trouble remembering what i was usin...

@formal goblet was giving you the right answer for this ๐Ÿ™‚

In items (and active effects) you can define modifiers which will modify values on the actor sheet. The modifier is applied passively as soon as the item is added to the player.

The Key must be the Key of the value to modify. It can be a Label key, a Meter Key or an hidden attribute key. The Field can contain Formulas.
The operation defines the operation you want to do on the Field
The value defines the value of the operation. For example, if operation is - and value is 10, the modifier will decrease the field by 10.

Now to your specific issue, you need to target a cell in a Dynamic Table. To do do you need the lookupRef function, which will return the technical Key of a Field in a Dynamic Table.

sinful spade
#

i'm following so far.
I've been playing around with the functionality, and made a Ring that gives +5 to max HP.

but currently my attempt to make that ring give a +1 to physical bonus isn't going great lol

setPropertyInEntity('attached', 'lookupRef('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Physical')')

vagrant hollow
brittle moth
sinful spade
#

Omg... i figured since it was fetch it would just... get that information to be utilized elsewhere

#

what a misnomer โค๏ธ thank you so much

#

sorry for doubting you martin

brittle moth
# vagrant hollow Can this lead to foundry hanging for everyone? And maybe hanging becomes longer ...

This should not
Does it happen only when adding Dynamic Table rows or on every sheet update ?
I have two things in mind : I saw an object merge in the code that may cause issues, and a Foundry bugfix in v13 which can help, stating that the prepareData step was called multiple times on entities by mistake, which in CSB case can be very time consuming, and exponential depending on how many items an actor has.

brittle moth
sinful spade
#

i think i understand

#

can i use switchCase for conditional logic?
because I tried:

${switchCase(sameRow('attributeDiceMod')+sameRow('attributeDiceBonuses'), >0, test)}$
and it's throwing cannot convert "error" to number.
(both dicemod and dicebonuses are lables containing only number values)

vagrant hollow
# brittle moth This should not Does it happen only when adding Dynamic Table rows or on every ...

I didnโ€™t had much time to research the behaviour via the game seasion.
There where no error, but it seams foundry was recalculating every item and actor in existence and doing so once for every connected person. So in this situation multiplied by 5.

Happened only while adding/deleting a row. Every other change to the sheet reacted normally.

I will run updates now and test later if it still occurs.

brittle moth
brittle moth
sinful spade
#

even outside of the math.js functions

brittle moth
sinful spade
brittle moth
#

The values are also executed, so they can be conditional too..I recommend using parenthesis to ensure the order of execution ๐Ÿ™‚

sinful spade
formal goblet
sinful spade
#

i just want to say, as someone who doesn't develop things...
coding is like having an argument in a language i dont speak against a grammar ... enthusiast.

sinful spade
#

๐Ÿ˜‚ i'm currently in a 30 minute long argument about adding two strings

#

it keeps trying to convert to a number

#

got it! ๐Ÿ˜ฉ
well.. sorta

this is a csb question so:
If i modify my table value using the item method martin suggested earlier, is there a way to display a + sign if it's positive?

formal goblet
sinful spade
#

sbecause right now my output is
5d62 rather than 5d6+2

sinful spade
sinful spade
#

so another column converting it with conditionals?
Or is there a way to conditional the cell that's being modified without mucking it up?

brittle moth
sinful spade
#

i just want to say that you guys are absolutely wonderful and i appreciate all your patience with me

#

it (finally) works.

#

(just noticed my + didnt carry over... gime 2minutes lol)

#

okay no? my code is correct???

#

i think the built in string function uh... ate it?

sinful spade
#

okay i've been playing with the roll function for over an hour, am i missing something obvious?

This is my latest attempt:
{$[sameRow('attributeFinalDice')]}$

  • but I've tried pleanty others such as concatting in the additional ${}$ or ${/${/}$}$
brittle moth
#

(Confusing, I know, there is some rework needed there)

dusky mauve
brittle moth
dusky mauve
brittle moth
dusky mauve
#

And how to put ALT roll to the hotbar? or I need modify call directly in hotbar?

dusky mauve
#

@brittle moth So due to UNIQ id from itemDisplayer there now way use 1 button on HotBar for the SAME skill but different Tokens?

sinful spade
formal goblet
sinful spade
#

it's just like link posted:

${[:sameRow('attributeFinalDice'):]}$

#

the code it references is a little gnarly but the output should be ok

formal goblet
#

Test what samerow outputs

sinful spade
#

huuuuh

#

${sameRow('attributeFinalDice')}$
outputs .... squares?

#

wait im dumb

#

i left it in the role formula lol

#

here's the output of a regular label

#

its red because of some css styling i was trying to get the roller icon to be red

#

but it came out perfect

formal goblet
formal goblet
#

Yep, seems valid

#

What about just ${[5d6+2]}$?

sinful spade
#

yeah manual inputs work

#

rolls just fine

formal goblet
#

Then:

${#roll_formula:= sameRow(...)}$
${[:roll_formula:]}$
sinful spade
#

Uncaught (in promise) Error: Unresolved StringTerm 2
requested for evaluation
[No packages detected]

formal goblet
#

What the fuck?

sinful spade
#

๐Ÿคฃ im glad its not just me

formal goblet
#

consoleLog(sameRow(...))

sinful spade
#

Uncaught ReferenceError: consoleLog is not defined ?? eh

#

oh .

#

Uncaught ReferenceError: sameRow is not defined

sinful spade
#

was i not supposed to plug that into console?

formal goblet
#

Ah, no. It's literally a formula

#

But you get a log in the console

#

I suspect a suspicious character in it

sinful spade
#

do... i roll the consoleLog?

#

because if i use it as label text it's just 'error'

formal goblet
#

Do it in the Label Roll Message to be safe. You don't have to put it into a Roll Formula

sinful spade
#

${consoleLog(sameRow('attributeFinalDice'))}$

formal goblet
#

And what's the error?

sinful spade
#

Error: The {{select}} handlebars helper is deprecated in favor of using the {{selectOptions}} helper or the foundry.applications.fields.createSelectInput, foundry.applications.fields.createMultiSelectElement, or foundry.applications.fields.prepareSelectOptionGroups methods.
Deprecated since Version 12
Backwards-compatible support will be removed in Version 14

#

only a bunch of those

#

no red errors

formal goblet
#

It means you have an undefined return for some reason

#

And without an error message, it means it was able to find the column, but the value in it was undefined

sinful spade
#

? ๐Ÿค”

#

i mean

#

the cell we're referencing is a merger cell based on concats

#

but since it came out with sameRow ...?

formal goblet
#

Just to make sure...
Try out game.actors.getName('actorName').system.props.dynamicTableKey in the console

#

And check the props in the entries

sinful spade
#

Uncaught (in promise) TypeError: this.function is not a function
[No packages detected]

#

oops lol

#

do i need to put the table key somewhere in that?

formal goblet
#

Yep, replace the dynamicTableKey

#

And actorName

sinful spade
#

yeah i got actor name haa

#

attributeModifier: "ERROR"?

#

wait that's long been deleted.

#

attributeFinalDice: "1d6\n"

#

interesting there are \n at the end of them

formal goblet
#

HAAAA

#

You shouldn't use newlines in formulas ๐Ÿ˜…

sinful spade
#

whats weird is.... i dont think i did? '-'

#

i dindt put any formatting into it just incase either

#

so it's all one line

brittle moth
#

Did you add a newline after the Formula in the label text ?

sinful spade
#

I never really use \n - i prefer <br> lol

formal goblet
sinful spade
#

im gonna be honest i got no clue what im doing ๐Ÿคฃ

#

? the entire code is on one line tho.

brittle moth
sinful spade
#

no

#

but i just opened NP++ and ran the joinline function

#

no idea how or why but it appears to be working

#

.... so i just spent two hours tearing this apart for... an invisible bug that came from ...?

#

how you people became coders, i'll never know o3o

formal goblet
sinful spade
#

i dont even want to think about how many lines there are in this character sheet

#

it's kinda out of control

#

but again i'd have actually never figured this out

#

so thank you

sinful spade
brittle moth
barren skiff
#

Oh ok, thanks ! ๐Ÿ˜„

barren skiff
#

Is this possible to update a key value with a macro ? For exemple my player have 0 out of 10 mana, and with a macro i could run when need he get 2 mana to bring him at 2/10 ? When i run the macro, i don't manage to correctly update the key value and instead of going from 0 to 2, it goes to 02, then each time i hit the macro it add another 2 behind like 02222, any idea ? Thanks

formal goblet
barren skiff
#

ooooooh

#

it work ๐Ÿ˜„

#

Thanks ! ๐Ÿ˜„

sinful spade
#

Maybe it's sleep deprivation, but I can't for the life of me get dropdown filtering to work on a item containers.
I've got it to put out (object obj), error, and just blank lines lol

brittle moth
sinful spade
formal goblet
brittle moth
formal goblet
brittle moth
#

I don't have the code in front of me right now, I trust you ๐Ÿ™‚

formal goblet
#

Me neither, but that's what I have in my mind

brittle moth
sinful spade
half beacon
sinful spade
#

I think that the one that spat out error

fallen coral
#

I'm pretty sure I read this here but I can't seem to find it anymore. Is there a way to display the Label value of a dropdown menu instead of the key?

brittle moth
#

The Dynamic Table Key must be your Item Container key, option keys must be id and option label must be name, both all lowercases

brittle moth
fallen coral
brittle moth
sinful spade
brittle moth
#

Specifically in this configuration, no need ๐Ÿ™‚

sinful spade
#

๐Ÿ˜ฉ alright. i guess im glad its easier than i thought

#

well i say that

#

whats the synax for "column to use as option key"?

brittle moth
#

just the key of the column. This should be unique data, every row should have a unique value for this column. In your case, since you want to display items, you should use id, which will use the id of the item as a key

#

This is not something you're going to see on the sheet, it is technical data to remember which option was selected

sinful spade
#

ok, cause i only have the default name column in there right now and uh this configuration isn't working lol

#

you can see "the Duke" title in the bottom left as my test

#

no errors in console, just a blank dropdown

brittle moth
#

As I said

The Dynamic Table Key must be your Item Container key, option keys must be id and option label must be name, both all lowercases
You entered 'Name' with an uppercase N, it should be lowercase

sinful spade
#

then i changed it to Name to match how its displayed on the table as a test

#

my bad

#

changing it back and no go

brittle moth
#

is condPrestigeTitle the key of your Item Container ?

sinful spade
#

yes

#

do i need a component in the item?

#

because right now its just a blank template for testing

brittle moth
#

No, that's not necessary

#

Can you send a screenshot of your template ?

sinful spade
#

um sure, but they're both just blank like i said

brittle moth
#

No, I mean the actor template
And a screenshot of the character as well ๐Ÿ™‚

fallen coral
sinful spade
#

those are singles btw

sinful spade
brittle moth
sinful spade
#

not arround dropdown as well?

brittle moth
brittle moth
formal goblet
sinful spade
fallen coral
#

Thanks, I'll try to correct it

sinful spade
brittle moth
sinful spade
#

wait so you're saying for once it's not me? ๐Ÿ˜„

#

andd hey this is my second bug ๐Ÿ˜ฆ

brittle moth
sinful spade
#

yepppp ... adding a second column works

brittle moth
#

As a workaround, you can create a new column, give it a key and no text or anything, and it should work ^^"

brittle moth
sinful spade
#

... would you believe me if i tried everything i could think of for about 3 hours before even messaging y'all?

sinful spade
#

i messaged you and martin about it a couple days back

sinful spade
brittle moth
#

Well the Item Displayer issue will be fixed in the next version ๐Ÿ™‚

sinful spade
#

yeah haha i tagged you in it a bit after that,
martin had asked me to report it in gitlab but i havent had the willpower to break my fixation on this sheet to make an account haha ๐Ÿคฃ

formal goblet
sinful spade
#

y'all honestly have way too much on your plates with this ๐Ÿคฃ
I know its the last thing on your minds but cleaning up the wiki would seriously help the less technically inclined like myself stay outta your hair better.
I feel bad coming to you so much but after 3-5 hours on a problem that I can't find on the wiki or screening the past message is about all i can take haha.

#

if its easier, maybe updating that tutorial on youtube with the most common things would at least screen the common answers out

sinful spade
#

also the wiki button on gitlab appears to be broken, i stumbled into a whole new section that i couldnt click because i clicked on martin's link when searching for someone else having issues with dropdowns

#

annnd that's the second

#

๐Ÿคฃ

#

yeha i found that this morning / last night

formal goblet
#

Yeah, the REAL Wiki has a bit more details in some aspects ๐Ÿ˜…

sinful spade
#

yeah when i went looking specifically for that after your link sent me to it

#

i found it in the initial message, burried as a {here} link lol

#

but the wiki button on the side is broke so i had (when i read it the first time) assumed it was a link to the page i was already on

formal goblet
sinful spade
#

as of a few days ago it just sent a 404

#

it seems to work today tho ๐Ÿคฃ

formal goblet
#

Your net then

half beacon
sinful spade
half beacon
#

Also I have no idea how to use macros and I'm terrified of them. I run to javascript every time I think I might need macros.

formal goblet
#

Yeah, that one was from V8 or V9 with horrible UX, because Components weren't draggable ๐Ÿ˜…

sinful spade
formal goblet
half beacon
#

Is that m-macros!?

sinful spade
sinful spade
#

i cannot code in any language (yet)

half beacon
sinful spade
#

i've actually learned (what I feel is a lot but is probably nothing) just from working with CSB ๐Ÿ˜ฌ

my background is configuring minecraft servers lol i dont have a technical job, or degree this is just hobby

sinful spade
formal goblet
sinful spade
formal goblet
sinful spade
#

dont do this to me

formal goblet
#

An Array is a 1-dimensional Matrix

half beacon
#

To the devs, may I make a small request for a future update? Just to have Number Fields have an optional prefix so that using it for "Health: 5/10" doesn't require two or more components. I thought to do it myself, but got confused looking at the code for the Label and Number Field components when I wanted to use them as reference.

half beacon
#

It... does?

formal goblet
#

Yeah, Label

sinful spade
#

i thought so?

half beacon
#

Let me go make sure I'm not just blind, as usual

formal goblet
#

It's not called 'prefix' to be fair, just 'Label'

half beacon
#

I'm not blind, I'm just dumb.

#

*suffix

sinful spade
#

oh i see haha yeah
having lables after every num field to show max

#

i did it here:

formal goblet
#

Yeah, could be added

half beacon
#

Yeah. I use two Panels, one to align the Number Field to to right and the other to align the Label to the left.

sinful spade
#

i used tables for the same thing, since they're a bit more riged for dividing evenly ๐Ÿ˜›

half beacon
#

Obviously a very small and unimportant thing in the larger scope of the project

sinful spade
#

i love your css tho - very scifi

half beacon
#

Thank you! I think I spent a week or two learning CSS for my game? I don't remember.

sinful spade
half beacon
#

I've done more since then, but I posted a video of what I did a while back. This is what it was a couple months ago.

sinful spade
#

my playes (those masochists) specifically asked to see the breakdown of all the numbers so I unhid them all and just... css made the uhm "eye pathing"? visually intuative

sinful spade
formal goblet
half beacon
sinful spade
formal goblet
#

Oh boy, forensics...

half beacon
sinful spade
#

but with a big of css tomfoolery i got it easily legable without collapsing

sinful spade
half beacon
#

Oh that's so much easier on the eye than I expected!

sinful spade
#

lol thanks :p

half beacon
#

You guys are leagues ahead of me

sinful spade
#

dude ... jesus christ... what?
how even

half beacon
#

I thought that was a sarcastic response to single-digit math

sinful spade
# half beacon You guys are leagues ahead of me

oh dude if you think this is bad aha
that's the dumbed down version after i got tired of dealing with sig figs and standard diviation i made a formula that approximates the same critical areas but is just rooted in a base number instead.
it's wayyy less accurate but i feel it was worth the fact that without doing any kind of math you can just know when your next spike is coming

#

settling on a -100-100 normal distro with base 0 and +20 diviations is MUCH easier haha

sinful spade
sinful spade
# half beacon My brain stopped

sorry sorry haha i build those kinds of tests irl for work ๐Ÿคฃ
but seriously how did you get that automated system working, that's fantastic!

#

make that a YT tutorial ๐Ÿ˜ฉ

half beacon
#

CSB is extremely flexible, I love it, and this is not a sponsored message

sinful spade
#

so wait that's done IN the sheet?

half beacon
#

Yep

sinful spade
#

i figured it was a secondary template modifying the created sheet ๐Ÿ˜ฎ

half beacon
#

I believe that's possible, but no

#

I'm not that knowledgeable yet

sinful spade
#

yeah my "whiteboard" plan was going to be use inquiries

#

the ${? Name:
Popup prompts

half beacon
#

That'll work too!

sinful spade
#

i will say the one major downside of my system is that it's based heavily on GURPS and Fudge so i need a lot of real time modification to skills, attributes, bonuses etc as players declare and discover ways to express their characters so dynamic tables are my best friend - its just... man are they hard to use!

#

like tables based on data from tables and item modifications galore lol

half beacon
#

I'm not familiar with GURPS ๐Ÿ˜…

#

But I've heard of it

sinful spade
#

you ever played with FATE?

half beacon
#

Yes

sinful spade
#

gurps was what fate is based on

half beacon
#

๐Ÿ‘€ Oh! Hmm that kind of flexibility is hard to predict

sinful spade
#

which is exactly why i dont predict, i build systems that use player input to approximate what they want to do easily

#

and if one of them want to do something that's somehow way too far out of bounds... we add a new system lol

#

like in that last screen shot, you can really get good at any "ability" and just base is on any "attribute"
why not base your athletics on your dex mod if that's how your character wants to do it.
Never heard of a dancing skill but sure, base it on your dex lol

somber bay
#

When using fetchfromactor when no target is selected I get this error
Uncaught (in promise) Error: Entity "target"
is there a way to get it to 'keep going' despite the error? Sometimes my players are not really attacking a target, they just wanna get some damage for an object they are striking or whatever

somber bay
#

ah Ok so I have a fallback the first time it is called but not the second... let me try

#

if the fallback is a string is it in 'quotes' or "quotes" or alone? This is if it fails to grab a target's name

formal goblet
somber bay
formal goblet
somber bay
#

(thank you for walking me through this)

fallen coral
#

How do you check if a dropdown inside a dynamic table has any option selected, or if it has the blank option selected?

brittle moth
brittle moth
normal ore
#

Hey everyone, how's it going?
I would like to know if there's a way, either in a label roll or a macro, to have three rolls, and when executing it, the rolls wouldn't all happen at once. The result of the first roll would determine whether the second and third rolls continue. Is there a way to do this? If so, can you guide me?

#

I tried tweaking the settings of the Dice So Nice module. There was an option to uncheck simultaneous rolling, but it didnโ€™t seem to change anything!

brittle moth
#

Here is an example message :

${#roll1:=[1d6]}$
${#roll2Formula:= roll1 == 6 ? '1d6' : '0'}$
${#roll2:=[:roll2Formula:]}$
${#roll3Formula:= roll2 == 6 ? '1d6' : '0'}$
${#roll3:=[:roll3Formula:]}$
${roll1 + roll2 + roll3}$

This rolls at most three 6 sided dice, rolling a dice only if the previous one rolled a 6

normal ore
brittle moth
#

This macro "works"
You can see a delay between rolls, but everything is still pretty much too fast... You'd need to hook onto Dice So Nice's APIs to wait for a roll dice to end before making the next one, and before posting the last message

const chatMsg = "${[1d6]}$";

let lastResult = 6;
let rollSum = 0;

for(let count = 0 ; count < 3 && lastResult === 6; count++){
    let phrase = new ComputablePhrase(chatMsg);
    // Computing phrase
    await phrase.compute({});

    // Posting phrase to chat
    phrase.postMessage({});

console.log(phrase.result);
    lastResult = Number(phrase.result);
    rollSum += lastResult;
}

ChatMessage.create({content: 'Final result : ' + rollSum});
normal ore
#

It's still relatively fast, but I'll take a look at the Dice So Nice API.

normal ore
# brittle moth This macro "works" You can see a delay between rolls, but everything is still pr...

I found this macro in the Dice So Nice documentation that delays the rolls perfectly:

attack.dice[0].options.rollOrder = 1;

let directDamage = await new Roll("d6").evaluate({async:true});
directDamage.dice[0].options.rollOrder = 2;

let aoeDamage = await new Roll("d4").evaluate({async:true});
aoeDamage.dice[0].options.rollOrder = 2;

// Merge rolls
const rolls = [attack, directDamage, aoeDamage]; // array of Roll

// Post directly to chat or create your own ChatMessage
// Here we post directly to the chat
const pool = PoolTerm.fromRolls(rolls);
roll = Roll.fromTerms([pool]);

roll.toMessage();

I just donโ€™t know how I would put a CSB script inside each roll!

Iโ€™m trying to figure that out!

brittle moth
#

(The request on Gitlab is to make sure I don't forget it, since it stays logged in one place ๐Ÿ™‚ )

normal ore
#

Alright, I'll make the request there. Thank you very much!

#

I created it, but I apologize if I didnโ€™t follow the proper request layout or posted it in the wrong place. I donโ€™t understand English very well, and even with translations, I sometimes get a bit lost!

https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/401

spice sierra
#

Hi, this has probably been asked before but I've been going through some old messages here and couldn't really figure it out. Is there any way I can store a formula in a Dynamic Table field so I can just call that field elsewhere and get the result?
Exmple: I have this formula stored in a Value field in the dynamic table: ${10 + first(lookup('traits_dtable', 'attr_value', 'attr_key', 'attr_agility')) + first(lookup('traits_dtable', 'attr_bonus', 'attr_key', 'attr_agility_bonus'))}$
And then I want to get the result in a label: ${first(lookup('secondary_traits_dtable', 'attr_value', 'attr_key', 'attr_evasion'))}$
How can I store the formula and then call that field somewhere else?

formal goblet
last mirage
#

how do you change an item to only give benifits if it's "equipped" not just in the inventory?

formal goblet
#

Something like ${equipped ? weight : 0}$

spice sierra
last mirage
#

thanks for the help

formal goblet
#

How you define the state of 'equipped' is up to you.

For things, that have only 2 states (true or false), a checkbox is generally the best choice

last mirage
# formal goblet The state would usually be saved in the item.

ok, so if a weapon had a checkbox on the item such as "equipped_weapon" what would I have to do to make it so when its in the "bag container" it goesnt grant benifits, but when it is clicked to "equipped" via the checkbox it switches to the "weapon" item box and grants item benifits?

formal goblet
last mirage
#

ah ok, so there's no way to limit them to "equipped" then?

#

if so thats ok, is there a way to change item containners based on the component key?

formal goblet
#

You can still apply values conditionally. Your value formula in the item modifier has access to the properties of the item

last mirage
#

ok, so the "checkbox" would have to be modified in the item itself wether to grant benifits?

formal goblet
last mirage
#

so if the checkbox was "equipped_weapon" where and how would I implement this to apply item mod's only when the "equipped_weapon" is checked?

formal goblet
#

And you can configure filters for your Containers, so that they only show Items, that bypass the filter. So you could make it also dependent on the equip-state of the item

last mirage
#

and do you mind giving a quick example of how to format the "equipped_weapon" into the filter formula? Sorry I'm still very new to the syntax of all this.

formal goblet
formal goblet
last mirage
#

the "Equipment" item container has the item.weapon_equipped formula

#

nevermind, I found the error

#

it was just supposed to be "equipped_weapon" not "weapon_equipped"

last mirage
#

wait a second... it's working in reverse

#

it's granting the benifit to unequipped and not when equipped.

formal goblet
last mirage
#

ah ok, got it

#

thanks for the explanation. So I would make that 0 again. and where would I place the 5 so it was added only when equipped?

formal goblet
# last mirage thanks for the explanation. So I would make that 0 again. and where would I plac...
MDN Web Docs

The conditional (ternary) operator is the only JavaScript operator that takes three operands:
a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy.
This operator is frequently used as an alternative to an ...

last mirage
#

amazing, thanks, that's extremely helpful thxblob

#

and last question, I promise, to future proof the container with not(item.equipped_weapon) with other checkboxes, for example a equipped_armamanet for a different template, how would I add multiple options?

last mirage
formal goblet
last mirage
#

thanks again, you're the best

barren skiff
#

Hello, i'm still new to this so this may be a stupid question but, i'm trying to create an item (any, just to understand how it work), and by reading the gitlab i get that i have to create a template (same way it's create for the actor), then an item using this template, but when it come to the modifier i can't get it to work, i do a simple thing like that (screen), but the item when add to the actor didnt modify the value i want. I already try with this key and the same one with "actor." before but no luck, any help ? The value i want to modify is from a label and a number only, the number being on the "label text" thing. Thanks ๐Ÿ™‚

barren skiff
#

ok i get it it's was stupid

brittle moth
barren skiff
#

yeah i figured, thanks ! ๐Ÿ˜„

last mirage
#

is there a way to type icons into the rich text editor? such as "fa-solid fa-fire-flame-curved" If so whats the correct syntax?

charred spire
#

Did CSB update to version 12?

formal goblet
formal goblet
last mirage
formal goblet
barren skiff
#

i'm getting the grasp of item but now i'm stuck on trying to make an item a consummable for a one time use such as a potion, is there a way to make a item run a script for more complex use or i can only use the item modifier tab ? Or, how can i make a item not a passive thing once in the inventory but more like a "use" item my player have to activate to run a script ? Thanks

#

I also dont get how to link a quantity to an item once in the player inventory, i do have a "quantity" column but i dont know how to fill or empty it automatically through the item script or even manually

barren skiff
#

hummm, so i'm suppose to run the script inside the item in a label roll message as a formula ?

#

oh i got that, but i still dont understand how to define a quantity in the item container

low walrus
#

so how would i be able to display a roll in the item Displayer Columns. right now it only displays a error for the damage output on the sheet
the formula that is in the label text is "${item.RDamage}$"

#

this is supposed to be displaying 4d6

#

nevermind Figured it out, i had to put [] in the autocomplete formula of the item template

summer turtle
#

It's been a hot minute since I've touched the system, is it possible to have a value determined by a drop down key like this?
${psy_alpha ? 8 : psy_beta ? 6 : psy_gamma ? 4 : psy_delta ? 2 : psy_epsilon ? 2 : psy_none ? 0}$

#

Basically so if one of those is selected in a drop down another key (psy_rating in this case) would be one of those numbers?

fallen coral
#

Do we have a list of UI modules that are compatible with CSB?

low walrus
#

ok new question, why does the damage output as this instead of a roll?

#

i simply have "${item.RDamage}$" in both label text and label roll text with 4d6 as the value on the item

fallen coral
#

Perhaps translated isn't the better word to describe it... if anyone has a better definition, feel free to correct it ๐Ÿ˜

low walrus
#

got it outputting correctly thanks

raven raven
#

hi, what do I put here: to trigger one of my macros?

vagrant hollow
# brittle moth Looks like the Foundry issue tbh, but that's concerning :/

After updating foundry 12.331 and CSB 4.1.1 the messages of foundry recalculating items and actors are gone โ€“ but time delay is still the same.
I found this error when adding a new row:

Logger.js:33 Custom System Builder | Uncomputable token "lookup('treffer', 'trefferp', null, null, '===')" UncomputableError: Uncomputable token "lookup('treffer', 'trefferp', null, null, '===')" at lookup (FormulaFunctionImporter.js:84:27) at math.js:26523:52 at math.js:26516:66 at Object.evaluate (math.js:24162:45) at r.evaluate (math.js:24139:55) at Formula.computeStatic (Formula.js:439:27) at Formula.compute (Formula.js:366:21) at processFormulas (ComputablePhrase.js:103:35) at async ComputablePhrase.compute (ComputablePhrase.js:157:34) at async ComputablePhrase.computeMessage (ComputablePhrase.js:257:9) at async Label._getElement (Label.js:107:26) at async Label.render (Component.js:143:25) at async Tab.renderContents (Container.js:43:25) at async Tab._getElement (Tab.js:43:33) at async Tab.render (Component.js:143:25) at async TabbedPanel._getElement (TabbedPanel.js:56:36) at async TabbedPanel.render (Component.js:143:25) at async Panel.renderContents (Container.js:43:25) at async Panel._getElement (Panel.js:97:33) at async Panel.render (Component.js:143:25) at async TemplateSystem.getSheetData (templateSystem.js:337:41) at async CharacterSheet.getData (actor-sheet.js:49:19) at async CharacterSheet._render (foundry.js:5838:18) at async CharacterSheet._render (foundry.js:6572:5) at async CharacterSheet._render (foundry.js:7158:5)

โ€œtrefferโ€ is the dynamic table i added a row to and โ€œtrefferpโ€ is the only otherwise used value in this table. The other values in the table are just notes.
But anyway calculation of โ€œtrefferpโ€ works fine.
Is this the โ€œnot accepting the defaultโ€ bug?

brittle moth
vagrant hollow
fallen coral
#

How can I set a value to a field of an item that is already added to an item displayer?

formal goblet
fallen coral
formal goblet
fallen coral
formal goblet
fallen coral
raven raven
formal goblet
formal goblet
fallen coral
fallen coral
# formal goblet Should be fine. Labels also hold values

This was the previous failed attempt:
${setPropertyInEntity('${lookupRef('dynamicTable', 'fieldToBeAltered', 'Name', '${sameRow('Dropdown_with_name')}$')}$', 'fieldToBeAltered', "fieldToBeAltered - 1"}$
The value doesn't change... How would you achieve this if the field wasn't in the Item Displayer?

formal goblet
fallen coral
#

yes

fallen coral
#

but this didn't work either

formal goblet
#

You must call <Document>.update, otherwise changes won't persist

fallen coral
fallen coral
barren skiff
#

Hello, i've progress a bit since yesterday about the item creation process but i dont get how to run a script from an item because, the script should be in a label, but i obviously dont want to put the script in the template, so how does this work ? And once the script is in an item, i dont get how to run it from the item container, by reading the label key ? i miss something but i dont understand what, help would be appreciated, thanks !

fallen coral
barren skiff
#

yeah i get that but putting a script here would make every item use the same ? Shouldnt the script be in the item ?

fallen coral
barren skiff
#

Hum, but how do you deal when different item have different effect ? I could call "item_effect" for exemple in the item container and each item have it's own define of "item_effect" ?

formal goblet
barren skiff
#

like, i can put formula in the rich text area of my item and call those from the item container with this ? i though i had to use linkedEntity for that or anything from the item in the container

formal goblet
barren skiff
#

hum i'll have to look what it is, but i'll give a try with your way to begin with ๐Ÿ™‚

barren skiff
#

well i can't seem to make this work even for a basic function

#

i use setPropertyInEntity('attached', 'Vie', 20) in the rich text area of my item with %{${!item.richTextAreaKey}$}% in the item container of the character sheet (with the right key) but it dont work

#

i dont even try to use a "+" function for the value, i just want to set it to anything to understand how it work for now

formal goblet
barren skiff
#

oh

#

so i should input full script into the rich text area

formal goblet
#

Or actually... Try out ${${!item.richTextArea}$}$

barren skiff
#

doesnt seem to work, i'll look for a full script then ๐Ÿ™‚

#

Thanks anyways !

merry pendant
#

Greetings, good people of Custom System Builder Land. I have a puzzle I have spent entirely too long attempting to solve on my own. Perhaps you can help me. I'm trying to subtract the result of 1d6 from the value in a number field. It's a consumable resource called "Will." Whenever a 1 is rolled on a wound die (d6), another d6 must be rolled, the result of which should be subtracted from Will.

fallen coral
#

then you can use that "roll" to subtract or add or whatever, there seems to be no limit to how many variables you can asign

merry pendant
#

Roll formulas don't work in setPropertyinEntity, do they?

fallen coral
merry pendant
#

I'll give it a whack. I've tried so many different ways I don't remember if I've tried that one or not.

#

I've put my test character, Beef, through a lot. Dude's tired.

fallen coral
#

Just to add to the previous answer, I'd use a ternary to check the values and perform the operations needed

merry pendant
#

I've used ternaries before. It's kind of 50/50 whether the formula breaks if I add a ternary. What would you recommend?

fallen coral
#

roll and store the roll, check with the ternary if the value is 1, if it is roll again and store that number in a second variable, if it is not asign the value 0 to the same variable, then subtract that last variable from the Will

#

subtracting 0 should do no harm haha

merry pendant
#

I'm coming back here if my formula explodes. ๐Ÿ˜›

#

Seriously though, sounds good. Thanks for the assist.

fallen coral
#

has left the chat

summer turtle
formal goblet
fallen coral
sinful spade
fallen coral
sinful spade
#

or if that's not possible for what you're doing:
if none, 0, 'error'.

formal goblet
fallen coral
fallen coral
summer turtle
#

I assume you'd just make the else case the same as your last entry? Or would I cut the "psy_none" part entirely for 0?

sinful spade
#

i have a conditional that
if positive then add +, if not
if 0 then add '', if not
if negative then add -, if not 'error'

summer turtle
#

Nice, thank you

fallen coral
#

I guess what I'm asking is, how to check a condition without the else case or how to skip it if it falls under that case

formal goblet
fallen coral
sinful spade
#

is there any other possibility other than a, b, g, d, e, or none?

fallen coral
barren skiff
#

Hey, still me about the item, i cant understand why it dont work, i try to modify the health of my player, with this : %{${!item.effect}$}%being put in the label roll message of the button in the item container so they can use their item directly from their inventory, and this :

const currentHealth = getProperty('attached.Vie') || 0;
const maxHealth = getProperty('attached.viemax') || currentHealth;
const newHealth = Math.min(currentHealth + healAmount, maxHealth);

if (currentHealth < newHealth) {
    setPropertyInEntity('attached', 'Vie', newHealth);
    return `Vous avez รฉtรฉ soignรฉ de ${healAmount} PV.`;
} else {
    return "Vous รชtes dรฉjร  ร  vos PV maximum.";
}``` 
In the richtextarea of my (first) item (not the template) with "effect" as the key, any idea ? Thanks ๐Ÿ™‚
sinful spade
formal goblet
#

getProperty() is also not a known function

barren skiff
#

do you have any link about the document function please ? and ok i though as i see some comment talking about it

formal goblet
barren skiff
#

oh ok, thanks ๐Ÿ™‚

merry pendant
#

Evening! I need someone to tell me why the setPropertyinEntity formula at the bottom doesn't work. It just returns an error. My intentions are as follows:
Step 1: roll a number of d6 equal to the number of wounds a character has. Step 2: roll another d6 for each wound die that rolls a 1. Step 3: subtract the sum of step 2's wound dice from the character's will (a number field).

${woundroll:=[:wounds:d6cf=1]}$
${willdmgform:=[:woundroll:d6]}$
${setPropertyinEntity('self', 'will', "will - willdmgform")}$

summer turtle
#

I don't get an error anymore, but I'm also still not getting a number