#Custom System Builder

1 messages · Page 15 of 1

tidal quiver
#

Hmmm... I think I should make another button for dealing damage... Cause I need to allow "target" to evade or parry

glossy hare
#

outside foundry, in practice how do you resolve an attack?

#

you roll an attack

#

and then

tidal quiver
#

Then your target chooses if it want's to try to Parry or Evade.
It rolls for chosen action:
Parry
Rolls 2d6 + Dex + Shield/Weapon
Evade
Rolls 2d6 + Dex

If result < than attack roll, then attacker rolls for damage
Damage dealt is:
Weapon DD + Str - Armor (which can be modified by Piercing attribute, we'll omit that)

glossy hare
#

okay

#

i suggest you creating a button for barry and evade

#

instead of automatizing everything, it better for the "flow" of the game

tidal quiver
tidal quiver
#

Yup

glossy hare
#

yeah

tidal quiver
#

But you can't evade with shield 😉

glossy hare
#

then you should create for weapons too

tidal quiver
glossy hare
#

okay

#

you think you can create those buttons

#

?

#

@tidal quiver

tidal quiver
#

I think so, I'll reverse engineer attack ones ;P

glossy hare
#

:b

tidal quiver
#

I'm just curious, why it gave that Sword item to both containers xd

glossy hare
#

because

#

the items containers

#

...

#

one minute

#

thinking in a good explanatino

#

it's because the itens in your sheet are inside of the same place. What the filters do is to change the display

#

the item container is just a display

#

so for example

#

you have a bow and a sword

#

and you put 2 containers, both with filters for ranged and melee

#

your sheet have both weapon inside the same space

#

the item containers, just hide the one that are refused by the filter

tidal quiver
#

Hmm... Should I mess with it, or should I just remove second container and call it a feature...

glossy hare
#

well

#

just one

#

you can ask your players for fair play

#

and call it a day

tidal quiver
#

All right, I'll catch you again when I finish those parry and evade buttons, and we'll start working on damage rolls, and then jump to ranged and throwing weapons

tidal quiver
#

You know what... Those rolls for attack didn't work... It was just me missclicking another button... They still have problem with that skillModifier switch

#

Cause I made rolling for Evasion (without that switch and skillModifier) and it rolls perfectly

#

@glossy hare

#

It knows that player object has OneHandedSkill... Something with switch?

glossy hare
#

inside the waepon that you created

tidal quiver
#

Still doesn't work

glossy hare
#

strange

#

because

#

it should be working

#

hmmmm

#

update the Miecz

#

and choose the weapon skill again

#

in the dropdwon list

tidal quiver
#

Nothing, even removed and re-added it again to "PC"

#

I'm gonna try cunning actions now 😉

#

@formal goblet Could you take a look at it?

#

@glossy hare I also have this when it's kinda refreshing the window

blazing ibex
#

how would i get the default value for a radio group by formula? this user input should have d4 selected by default

tidal quiver
tidal quiver
# tidal quiver

Done it, for future reference if anyone digs to that spot:
Formula should be like:

${skillModifier:= switchCase(item.WeaponSkill,'1',OneHandedSkill,'2',HeavyWeaponsSkill,'3',SpearsSkill)}$
${[2d6]+skillModifier+PCAttrDEX}$

Make sure that variables to be sent as strings are in ' ', and ones to be changed to their values are without ' '.

silk widget
#

What did i need to use to hide a formula from the text message ?

tidal quiver
#
${ # FORMULA... }$
silk widget
#

the number still show up

tidal quiver
#

You need to do it for every block that you want to hide

silk widget
#

thx

glossy hare
#

got problems here

#

but congrats

tidal quiver
#

I would need to get it as string and somehow convert to formula?

#

Or should I change the way it is "chosen"

glossy hare
#

you could put it inside an inline roll [[${yourCodeHere}$]]

#

remeber to use the !

tidal quiver
formal goblet
keen carbon
#

there any way to put a button into a roll message?

#

like a "click to take damage" thing? or would i just use a macro for that

tidal quiver
formal goblet
#

The assignment operator in JS is just =

blazing ibex
#

would it help userinputtemplates?

tidal quiver
formal goblet
tidal quiver
#

Oooooorrrrr... Be a lazy little bitch and check if result of 2d6 is equal to 2 or 12?

#

😛

formal goblet
#

Well, that also works

tidal quiver
#

If I wanted to make that IF inside inline roll, how should it be done?

${#basicDiceRoll:=[2d6]}$
${#basicDiceRoll==2 ?  : }$            //notify('warn', 'Double ones')
${#basicDiceRoll==12 ? : }$            //notify('warn', 'Double sixes')
keen carbon
formal goblet
tidal quiver
tidal quiver
glossy hare
keen carbon
#

nesting the ==12 and the ==2 into the same conditional might be better?

keen carbon
#

bless

formal goblet
tender jungle
#

aaa I found a bug! Not sure if it's been documented, but

#

if a number field is negative and set to allow relative modification, it treats it as a relative modification :c
which even updates if you simply hover over the number box without changing it

tender jungle
#

also side note uhh is there a way to set a dropdown menu through a roll message

blazing ibex
#

${?{month:'What month are you born ?'|"January"|"February"|"March"|"April"|"May"|"June"|"July"|"August"|"September"|"October"|"November"|"December"}}$

tidal quiver
#

I want to hide this formula in Hidden Attributes, but when I move it from Label Roll it stops working xd Any ideas?

${PCHealthPointsAct <= 5 ? [2d4] : PCHealthPointsAct <= 10 ? [1d6]+[1d4] : [2d6]}$
dusky mauve
#

Does item support item container?

because I can't see it in the initial ADD menu.
BUT can find when replacing ANY other existed one (look like it's a bug)

tender jungle
boreal hull
#

Is there a way to have audio play when a button is clicked?

zinc verge
blazing ibex
#

Normally you would create a button that changes a different part of the character sheet when you click it. But I'm not sure if it works with dropdowns

tender jungle
#

speaking of so, though, uhh,,

#

input dialogs (i.e. ${#?{userInput|0}}$) are absolutely broken :c

#

allows for pretty easy arbitrary code execution.

boreal hull
tidal quiver
#

How should I send value of a field from equipped item to a label/number field to hold it as variable (and cheat sheet of current modifiers)? Let's say my PC equips "wooden shield" shield item in item container named "equippedShield" and I would like to store it's "parryBonus" in a field on character sheet outside of item container called "PCParryBonus"

formal goblet
latent sorrel
#

How do I capture each row number in a dynamic table as exampled in the image? The goal is for the player to click a button which executes some JS based on field contents and then deletes that row. I am assuming that to programically delete a row, I need to reference its record position but I am open to better (aka easier) implementation ideas for programmed deletion.

cosmic karma
#

https://www.youtube.com/watch?v=dgsVf-a0XNs

Hello everyone. Finally "finished" the module. Instructions to install are included in the description of the video and in project page. Special thanks to @blazing ibex @vagrant hollow @formal goblet ❤️

Character creation example for the Household module of Foundry VTT.

Check this other video on the channel if you want to know how to install and configure: https://youtu.be/AuR-Xm50Oiw

You can install the module from here: https://github.com/mordachai/household-csb

Manifest URL:
https://raw.githubusercontent.com/mordachai/household-csb/main/...

▶ Play video
blazing ibex
#

Chat cards looking good!

latent sorrel
#

I am trying to hide a field in a dynamic table but without success based on comparing 2 number fields such as sameRow('curSerial') == sameRow('sn') in the visibility formula. I have also tried to use a third label for the comparison such as sameRow('compare') == true. I tried a number of variations with and without sameRow, among other things. Does anyone have a suggestion on what I am missing?

blazing ibex
#

what is the component of the field you are trying to hide? if it was a label you could add a conditional where it just outputs nothing

latent sorrel
#

I have a button that I trying to hide for specific entries based on conditions

formal goblet
fierce harbor
#

Heyo!
Stupid question...
How do you set/use chat cards?
Trying to 'beautify' my world, but got stuck on this subject.

tidal quiver
#

I have such item container for melee weapons which allows players to add Melee Weapon items. It shows weapons name, damage dice, and roll for Attack, Damage, Parry and Evade actions. Now, I would need to make option for attacking with both weapons. It should basically be [DamageDice1]+[DamageDice2], but I have no idea how to get value of DamageDice from second weapon.

To make it easier I will make it as separate ROLL button.

rich glen
#

Is there a way to have Item Containers as element in a Dropdown List? I saw that there is the Dynamic Table option now but not the Containers.

blazing island
#

the dev said you need to make table from a formula

#

then call the item to the dropdown

fierce harbor
#

Are all parts of a label accessible via ${}$ syntax? I'm thinking of the tooltip, for example.

rich glen
rich glen
fierce harbor
rich glen
#

Maybe there is a way but I always saw only ways to get the values, not the actual control

fierce harbor
rich glen
#

${ ref('key') }$ or my fav entity.system.props['key'] (it can be a variable)

#

Oh, the second one can be used in just the %{ }%

fierce harbor
brisk scaffold
#

hey, dumb question but is there some kind of tutorial of sorts?

also, when i created a tabbed pannel, my tab's contents gets added to the side of the tab instead of below it, how do i fix this?

formal goblet
fierce harbor
#

Can setPropertyInEntity() change a label's text?
Something like setPropertyInEntity('self','labelKey',"text") ?

brisk scaffold
formal goblet
fierce harbor
fierce harbor
#

Continuing on the same line of work...
I'm trying to change a checkbox status using this:
${setPropertyInEntity('self','checkboxKey',${checkboxKey?false:true}$)}$
It does work only from false to true, not the opposite.
Where am I wrong?

EDIT: it works using 0,1 instead of false,true...

queen wraith
#

so I'm still new when it comes to coding but how would you should do a formula for a dyamic table?

verbal mountain
#

What's the best way to re-use a roll formula for multiple ability scores where the only difference is one variable? I'd rather not copy paste it 10 times and change the ability score used.

tired onyx
#

I had a question:
If I had a table of items, and I wanted to grab the largest weight value of all of the items (that is, opposed to summing up the items), is there a good way to go about doing this?
Trying to think if there's a way to have item modifiers push onto an array, but don't seem to be having success with that. Anyone know anything I should look into?

formal goblet
formal goblet
formal goblet
tired onyx
#

Will that work even with a label though? I'm trying to have a label on the character sheet display the highest weighted item.

formal goblet
tidal quiver
#

How can I make it in chat message, for a roll which gets variable from player, to input a "button" in chat, which will show "character card" of NPC with that entered name?

#

Let's say I have ability "summon", I use it and enter name of summoned creature. Then this name should become visible and clickable in chat. When clicked, it should (?Open?) actor card with that name

formal goblet
warm flower
#

Good morning,

I'm using Custom System Builder and I want to change the displayed message for initiative rolls.
Passed through a lot of files but didn't find it.

Any ideas where I can search for?

I actually find where this template is being prepared, but the message "rolls for initiative!" I can't find it.

fierce harbor
#

Is there a problem with hidden components?
I'm trying to use a hidden checkbox in a conditional but the console says uncomputable token.
Then if I check/uncheck the box it starts working as intended.

tidal quiver
#

@formal goblet Quick question. If I need to have "upgradeable" weapons, and want to do it by checkboxes, do I need to somehow make different items for that, or I can just edit that one that Actor has in its ItemContainer and its not gonna change those properties for all the other instances of it?

formal goblet
formal goblet
fierce harbor
formal goblet
tender jungle
#

Hey! Is there a way to variably disable a checkbox (or otherwise apply a class if circumstances are met)?
I wanted to hide it altogether, but it seems like the item doesn't initialize the value of the checkbox if it's hidden when created, resulting in some dumb undefined issues that I can't resolve with operators :c

#

like, on an equippable item, if checkbox of attribute my_attr has a "Visibility formula" that causes it to be hidden on creation, then:

  • my_attr is set to undefined regardless if "Checked by default" is true.
  • my_attr in formulas behaves erratically.
  • switchCase(my_attr, true, <code>, <code>) throws an error.
  • and(my_attr, true) and or(my_attr, false) throw an error.
  • my_attr ? <code> : <code> sometimes works but usually throws errors.
  • using my_attr as filters in item containers doesn't work, even when the previous solution works.
tender jungle
#

whaaat?
why is it showing as undefined for me then?

#

tho tbf it's only sometimes? but it definitely says undefined for me.

formal goblet
#

Well, that´s only a test on a character sheet. I didn´t take into account the items

rough scaffold
#

hello, is this where one goes to ask about custom character sheet questions?

formal goblet
#

kinda? 😅

rough scaffold
#

i just have a weird question and cant seem to find the answer anywhere. if i wanted to take an existing character sheet (Dark heresy 2) and change some names for a custom setting, Ie: willpower to grit. how would i go about it and how difficult is it?

formal goblet
rough scaffold
formal goblet
rough scaffold
formal goblet
#

Foundry and CSB export most of their things in the JSON-Format: https://www.freecodecamp.org/news/what-is-json-a-json-file-example/

freeCodeCamp.org

Many software applications need to exchange data between a client and server. For a long time, XML was the preferred data format when it came to information exchange between the two points. Then in early 2000, JSON was introduced as an alternate data format for information exchange. In this

rough scaffold
formal goblet
#

But I´m honest, transforming data from one sheet to another is a freaking tedious act. If your source-sheet is not small and you don´t know how to write a transformation-script, then you should probably forget about that. It would take less time to create a new one.

rough scaffold
#

ill give it the old college try first

formal goblet
#

Well, I can´t stop you doing that

rough scaffold
#

thanks for the assistance

dusky mauve
formal goblet
fair yoke
#

Hey

#

so if I am using
%{return await game.macros.getName('YourMacro').execute({name: '${name}$'})}%

#

how would I alter it for a second argument?

fair yoke
#

I don't want them added

#

they are two totally separate things within the macro that I need to provide arguments for in the roll

formal goblet
fair yoke
#

oh right down the bottom, OK

#

wasn't sure exactly what you were pointing me at on the page

fair yoke
#

ok thank you, got it working now

latent sorrel
#

Dynamic tables seem to keep deleted items on the character sheet and just set the deleted: true. Do these actually get completed removed from the character sheet?
Also I have a JS macro that adds new items to the top of the Dynamic Table instead of the bottom when entered manually. I have since noticed this error TypeError: An error occurred while rendering CharacterSheet 32. Cannot read properties of undefined (reading 'predefinedIdx') but it is unclear whether this relates to my code. All occurrences of predefinedIdx are null, even manually entered entries. Does anyone have any ideas on this?

slow tree
#

Hey y'all

First, I want to say to the dev team that they are awesome. I've been using this system for a couple days now and really I'm baffled by how much I can do, and how simple it is ! :)

Second, quick questions :

  • Is it possible to add rows to dynamic tables using a formula?
  • Is it possible to roll for initiative using a formula? (edit : from the sheet)
warm flower
#

Hey, i'm not a dev... but I can help you with the initiative formula

#

I struggled a bit to get that working, but finally I did

#

this formula uses the "iniciativa" value for the selected token and rolls a number of d10 equals to that value. The x10 in the end is that for each critical dice (10) it rolls another d10.

#

depending on how complex the initiative you want to create, i believe this will cover

formal goblet
# latent sorrel Dynamic tables seem to keep deleted items on the character sheet and just set th...

This is the system-code for adding new entries:

            addButton.on('click', async () => {
                if (entity.isTemplate) {
                    this.predefinedLines.push({
                        ...sampleNewRow,
                        predefinedIdx: this.predefinedLines.length,
                        deletionDisabled: false
                    });
                    await this.save(entity);
                } else {
                    let tableProps = foundry.utils.getProperty(entity.system.props, this.key) ?? {};

                    if (tableProps) {
                        tableProps[Object.keys(tableProps).length] = { ...sampleNewRow };
                    } else {
                        tableProps = {
                            0: { ...sampleNewRow }
                        };
                    }

                    foundry.utils.setProperty(entity.system.props, this.key, tableProps);

                    await entity.entity.update({
                        system: {
                            props: entity.system.props
                        }
                    });
                }
            });
slow tree
warm flower
slow tree
slow tree
warm flower
#

you have some sort of different calculation on your sheet for the initiative?

slow tree
#

All my stats on my CS are rollable when you click on the label, but the initiative one only display a message in chat currently, which is not super useful :p

warm flower
#

makes sense

#

at least is not a big problem since every time you start a combat the encounter list will be there to roll

#

haha

#

what you can do is just improve the roll from encounter sheet to consider stats from your sheet

#

**encounter tab

slow tree
slow tree
warm flower
#

yep, but you need to write down the info properly in there. otherwise it will not get the stats values from your sheet

#

I at least was struggling a bit to get that working properly the way I want haha

slow tree
#

Yeah there is clearly a learning curve to CSB, as expected given the possibilities :)

warm flower
#

not sure if you use label icons for some reason on your sheet. But you can get the icons from font awesome if you don't already know that

#

to get something like this if you want

slow tree
#

Ho, I didn't thought of using only the icon, that's a fun use case :)

warm flower
#

i like it to keep less text for some stuff

#

these on the top are for resistances

#

also I use for some of the rolls that has different possibilities

#

only text would occupy a huge space

#

haha

spare sky
#

Hello!
Is there a possibility to nest if queries? I could not find anything about this in the doc unfortunately.

My approach does not work here:

${equalText(key_dropdown_art, '1') ?
(numberfield_lpakt <= 20?-80 : numberfield_lpakt <= 50?-50 : numberfield_lpakt <= 80?-20) :
equalText(key_dropdown_art, '2') ?
(numberfield_lpakt <= 30?-70 : numberfield_lpakt <= 40?-50 : numberfield_lpakt <= 60?-20):0}$

Could someone tell me the correct syntax here?

Thanks a lot!

formal goblet
#

You´re missing an else-part after numberfield_lpakt <= 80?-20

olive urchin
#

How can i reload or partially reload after changing a value in a script?
example - in a label roll, ask for an amount of spell dice and remove an equal amount from the entity.

Reducing works except the UI doesn't update unless I reload it by opening/closing

<div style='display: none'>
${#?{sd:"Spell Dice"|1}}$
%{entity.system.props.spelldice = (parseInt(entity.system.props.spelldice) - sd.value).toString();}%
</div>
spare sky
olive urchin
#

Thanks.

<div style='display: none'>
${#?{sd:"Spell Dice"|1}}$
%{entity.entity.update({'system.props.spelldice': (parseInt(entity.system.props.spelldice) - sd.value).toString()})}%
</div>

This does what's expected

celest prairie
#

hi, how can i make a label reference the visible text of a dropdown list (label) instead of the key of the label?

#

and is a dropdownlist automatically a dynamic table?

formal goblet
formal goblet
brisk scaffold
#

is there a way to position the label atop of the text field instead of at the left of it?

tender jungle
#

maybe put them in a vertical panel? I wish you could put html in labels, hahah

#

"them" being the text field and a seperate label

brisk scaffold
#

can someone explain why this formula is returning as null?

#

doing ${[1d20 + :dex_at:]}$ like the wiki says also doesn't work

formal goblet
#

Then check if dex_at returns something

brisk scaffold
#

how do i do that?

formal goblet
#

Just create an additional formula in the label prefix.

brisk scaffold
#

dex_at is my component key for the stat in table

brisk scaffold
#

ehr, sorry for being dumb but how should it look?

formal goblet
#

Just ${dex_at}$

brisk scaffold
#

nothing happens

#

my content keys aren't working?

formal goblet
#

Well, has your number field a value?

#

And you can also check the console with F12

main magnet
#

Ok guys, I'm hitting a wall here and need some help.

I got this line:
${[{1d12,1d12,[:PCfatigue_physical: == false ? :PCstrength_die: : 0]}kh2]}$

The roll syntax is supposed to roll 3 dice. The first 2 are d12s, the third is either the PCstrength_die or no die (0) in case the PCfatigue_physical checkbox is checked.

What am I doing wrong?

formal goblet
brisk scaffold
main magnet
formal goblet
main magnet
#

Console says:
Error: Unresolved StringTerm false,'false' ? d10 : 0 requested for evaluation

formal goblet
#

The whole conditional is a CSB-Formula, so you have to mark the whole one

main magnet
#

Like this?
${[{1d12,1d12,::PCfatigue_physical: == 'false' ? :PCstrength_die: : 0:}kh2]}

formal goblet
main magnet
#

${[{1d12,1d12,:PCfatigue_physical == 'false' ? PCstrength_die : 0:}kh2]}?

#

Like that?

brisk scaffold
#

hey, how do i make a label based on a formula?

like, as an example making a lable that returns my STR bonus based on my STR ability score

#

also, thanks for the help above with the rolls, got it to work

fierce harbor
main magnet
formal goblet
# main magnet So I tried this and it didn't work: `${[{1d12,1d12,:PCfatigue_physical == 'false...

PCfatigue_physical == 'false' comparison with strings should always be with equalText(). Besides that, the return type of a checkbox is a boolean, not a string, so you can just use PCfatigue_physical == false. Or even shorten it to PCfatigue_physical ? 0 : PCstrength_die.

I´m not sure if the colon in the conditional will give you problems. If so, you should construct the whole roll-formula beforehand:

${roll_formula:= concat('{1d12, 1d12', PCfatigue_physical ? '', concat(', ', string(PCstrength_die)), '}kh2')}$
${[:roll_formula:]}$
celest prairie
slow tree
#

Hey, just in case the error comes from my side

is it normal that this works (using a number field)

${setPropertyInEntity('item', 'active', "item.active>0?0:1")}$

But this doesn't? (using checkmark)

${setPropertyInEntity('item', 'active', "item.active?false:true")}$

Am I missing something?

formal goblet
warm flower
#

Good morning btw

main magnet
dire socket
#

Im getting this issue

formal goblet
formal goblet
dire socket
# formal goblet more context pls 😅

Sorry I was half asleep, its something thats been popping up more but

${Crit:=fetchFromDynamicTable('Roll_Table_Atk', 'Crit', 'Name', sameRow('Form_Ref'))-fetchFromDynamicTable('Roll_Table_Art', 'Crit_Mod', 'Name', sameRow('Art_Ref'))}$
${CritQ:=sameRow('RollStore')>=Crit?1:2}$

This is just the simplest example, the last part is just, not working and the error pops up

#

Wait, does equaText not work anymore? Most of my equalText things seem to be returning errors due to an unexpected arguemtn

formal goblet
dire socket
#

I see, thank you. Anything about the equalText?

formal goblet
#

equalText?

dire socket
#

Yeah it seems a lot of my formulas that use equalText just aren't working anymore. I'll post an example

tender jungle
#

why am I getting this error? The only values that equal "false" here are value_is_held and value_equipped, both which are in that or function

dire socket
# formal goblet equalText?

Stuff like this returns an error like

${equalText(sameRow('Dmg_Type'),'Pierce')?1:equalText(sameRow('Dmg_Type'),'Slash')?2:equalText(sameRow('Dmg_Type'),'Strike')?3:equalText(sameRow('Dmg_Type'),'Burn')?4:0}$

#

I could just switch to switchcase which seems to bypass the issue, but I at least want to know why it suddenly stopped working

tender jungle
formal goblet
dire socket
#

Thats an awesome question, I've never used compareText() as far as I can remember

tender jungle
#

W H A T
it worked with booleans elsewhere, omg??

dire socket
#

cause I made a new sheet and its working perfectly fine

tender jungle
formal goblet
tender jungle
#

like ||? it never worked for me

#

or wait, is it literally or

formal goblet
#

No, just the or keyword

tender jungle
#

oh! lmao, I had no idea

formal goblet
tender jungle
#

it doesn't seem to accept booleans :c

formal goblet
#

How can an or not accept booleans? 🤣

tender jungle
#

I wanna cry lmao

#

yeahh it's still being weird

formal goblet
#

Well, I can only tell that this comes from mathjs, not CSB 😅

tender jungle
#

yeahhh that's fair, ahahah

tender jungle
#

I just wish mathjs had a way to handle "undefined". I'm still getting the issue where an attribute isn't initializing if it starts out hidden.

#

like, right now, the checkbox for value_equipped is hidden in this new item I created because the item cannot be equipped.

#

but this check fails because value_equipped is undefined.

formal goblet
tender jungle
#

oh!!

#

OH MY GOD YES THANK YOU

#

my players can now no longer equip money, yay

brisk scaffold
main magnet
hazy saffron
#

I was told there was no macro code to do the key part of "Update this item" (Refresh)

brisk scaffold
quasi plume
# brisk scaffold

I think you don't use colons unless it's in a roll formula.
${str_at - 5}$

brisk scaffold
#

i'll try, thanks

#

it worked

quasi plume
#

nice

latent sorrel
#

Is there a way to delete a specific entry in a dynamic table without using JS; specifically the first?

zinc verge
#

are you able to put a roll in the same label message that you have a simple input formula in? I'm trying to get a risk roll function working that lets you select 2d4 or 2d6, then rolls what you selected, but I can't seem to get the roll to actually happen after the initial input popup resolves no matter what I do.

${concat(?{Risk Die:"Risk Die"[check]|"4","d4"|"6","d6"},"Hi, this worked")}$

this is my current attempt to get any kind of message to post to chat after the input prompt resolves, and I tried a handful of things before this that didn't work either. The input prompt is working fine and does exactly what I want though

fierce harbor
zinc verge
#

oh okay, I'm glad you told me to check the console

#

since my prompt was labeled Risk Die the system got mad that there was a space in the label and it just rejected everything

fierce harbor
zinc verge
#

yes. It makes sense that the prompt label would follow the same rules of any other component key since they can be referenced, but I hadn't thought about it til now lol

spare sky
#

Hello!
Is there a way to represent e.g. poisoning in a meaningful way, i.e. to distribute a damage over a period of time or possibly also over combat rounds? Of course I can regularly subtract life points - but maybe there is a clever alternative?

slow tree
#

Hey there, is there a way to change the style of Tabbed Panel's tabs? Like making them bold or something?

slow tree
#

Do I need a CSS file, or can I just add the relevant bits somewhere?

fierce harbor
slow tree
#

thanks for the detailed answer!

fierce harbor
celest prairie
#

is there a way to enlarge the textfield downwards? I want a bigger textfield instead of having to stack 10 of them on top of one another...

glossy remnant
#

Hi, I don't know if it's been asked before, but I couldn't find anything related, so I'd like to ask: is there any way to have a roll from the sheet present a query of how many boons/banes (for those unfamiliar with SotDL/Lancer/Icon or games with similar rolling mechanics, boons and banes are basically d6s rolled alongside the main d20 roll, adding the highest of the d6s in the case of boons and subtracting the highest in the case of banes, these dice cancel each other out, so for example if you would make a roll with 3 boons and 2 banes, you would just end up rolling with one boon) are applied to the roll, along with any flat number modifiers? (stuff like a flat +2 to the roll's total)

slow tree
#

Hey again, it's said in the "Formula System" part of the wiki that you can do Arrays in CSB formulas. But I can't find a way to make one, they are always strings
I can make strings work as array with subset(), but it's not as convenient as regular arrays.

What is the way of declaring an array in a formula?

fierce harbor
celest prairie
upper olive
celest prairie
celest prairie
#

Is it possible in the visibility formula to add two dropdownlist key's instead of just one?
The formula that works:
equalText(pc_entity_type, 'pc_entity_player_character')

The key I want to add
pc_entity_unique_character

Formula that doesn't work:
equalText(pc_entity_type, 'pc_entity_player_character, pc_entity_unique_character')

#

.
also how do you guys add these nice coding backgrounds to your codes to make it more readable??

formal goblet
# celest prairie Is it possible in the visibility formula to add two dropdownlist key's instead o...

equalText() only allows exactly 2 input parameters. You have to combine it with and() to make it work: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System, https://mathjs.org/docs/expressions/syntax.html

formal goblet
celest prairie
#

So like this or without the space in between?
equalText(pc_entity_type, 'pc_entity_player_character') and (pc_entity_type, 'pc_entity_unique_character')

#

found it.
I was looking for
'or'

#

'and' means both need to be true, which is not possible if you use 2 keys of the same dropdown list...

celest prairie
vagrant hollow
spare sky
#

Thanks for the info anyway...

tired onyx
#

If I have a field that is an array (generated from a custom formula)
Can I make other fields which have the behavior of customArray[0], for instance?

if we let customArray be defined by another custom formula as an array, then I've tried

  return ${customArray}$[0]
}%

AND

%{
  return ${customArray}$.split(',')[0];
}%

to no avail. I'm definitely doing something wrong. Anyone know what I should look into or have any ideas?

formal goblet
tired onyx
#

I was looking into that, but whenever I would do

%{
console.log(entity.system.props.[ANY VALUE]);
}%

It would return undefined.
Which is strange, because entity.system.props would return the entire property object.

#

(specifically, the console would return undefined in this case)

formal goblet
#

ok, strange

tired onyx
#

I mean, I can circumvent this completely and run 10 separate loops (one for each of the 10 stats of the system), but when I implemented this like that, the entire application lags pretty noticeably, especially when its more than me in the server.

mental mauve
#

Hello, bit of a CSS question, is there any way to limit the changes I make in my custom CSS to only the custom system builder sheet?

#

I'm noticing that when I make some changes it effects other things in foundry. For example, input boxes and the like.

scarlet skiff
# spare sky Hmm... I tried several - but unfortunately they don't work with CSB, but are rat...

I have such things implemented in my game (burn, bleed, poison,...). But be warned its not an easy task.
If you are ok with programming yourself in Javascript it can be done.
Things you need: a way to track the effect (usually an active effect, but could also be done in another way with flags). A way to apply the effect with the necessary Data (duration, damage, ...). Automating the damage application and effect removal would be most likely a world script.
All this can be done in CSB but you have to programm it yourself and tailor it to your system.

#

additional things to consider: the timing (start of turn, end of turn,...), are there other related mechanics (saves, damage reduction,...), are players able to apply this? and are they only applying to themself or are the also able to apply such effects on other (not owned!) actors (NPC / other player)

spare sky
# scarlet skiff I have such things implemented in my game (burn, bleed, poison,...). But be warn...

I had already thought something like that. Although I'm a bit out of practice, I'm going to try my hand at a JavaScript implementation.

In the first step I would like to keep it quite simple: Player, NPC or enemy get a negative (burns, poisons, bleeds...) or positive (healing potion, protection spell...) effect, which is valid for a certain time. Within this period of time the affected person has the possibility to remove the negative effect. I would then control this as a GM and let him roll the dice manually.

I.e., I would need three fields behind the individual relevant values, in which I indicate the (damage or bonus) value (positive or negative), the duration in seconds and the interval of the calculation in seconds.

That should be enough for the first throw... Anyway, that's my first thought... 😉

scarlet skiff
#

Good luck 🙂
my tip would be: use active effects (core settings expanded module for custom effects) and use flags on the applied effect to track your desired stats (every effect has a own id and its own flags which can be set differently)

vagrant hollow
slow tree
#

Hey there, I think I'm missing something, or I found a strange bug

This formula :

${fetchFromActor('target',"fly_swatter_active")}$
${DEFTOTAL:=10 + (fetchFromActor('target',"fly_swatter_active")?5:0)}$

Should never be able to output this, right?

vagrant hollow
mental mauve
slow tree
#

I'll make an issue

scarlet skiff
latent sorrel
# mental mauve Hello, bit of a CSS question, is there any way to limit the changes I make in my...

You should familiarize yourself with the basics of CSS. There are numerous intro sites for this. However, in short, give a custom class name to a panel or tab that contains the item you are affecting and then add that name to your CSS so it proceeds your class or element.

.elementThatHoldsInput input{
    <commands>
}```
In the picture provided, any panel or tab shown could have the indicated class name. It doesx not have to be the exact panel that input unless you have design reasons to do so.
celest prairie
#

small question regarding formula.
I know that dice is a random number generator, but is it possible to also write a number generator with the number '0' also being an option?
Instead of writing
/r 1d5
write:
choose at random (0,1,2,3,4,5) or something like that?

formal goblet
slow tree
#

1d2-1 generates 0 or 1

formal goblet
#

Either you subtract 1 or you use the RNG from JS

celest prairie
#

ok, say its not numbers but words used at random.
One, two, three four or five.
How would I write that?

slow tree
#
switchCase([1d2], 1, "zero", 2, "one")

This should work, I think?

celest prairie
#

also, this one doesn't work, not even the example described on the webpage:
math.pickRandom([3, 6, 12, 2])

slow tree
formal goblet
#

Well, Arrays and Roll Formulas share the same delimiters, so... 😅

slow tree
#

fair

I think the wiki says that we can use arrays, tho, so the team might want to change that :)

#

3.1.1 data types

formal goblet
#

Yeah, but usage is something different than declaration. fetchFromDynamicTable() e.g. returns an array and you can work with that without issues. But if you want to declare one, you have to look for workarounds.

celest prairie
#

Ok I found something for the numbers atleast.
randomInt(100)
It gives whole numbers including the number 0
And it works

#

another question, is it possible to use dice rolls in a mathematic equation in formulas?

slow tree
formal goblet
formal goblet
slow tree
slow tree
formal goblet
celest prairie
slow tree
formal goblet
celest prairie
spare sky
# scarlet skiff Good luck 🙂 my tip would be: use active effects (core settings expanded module ...

Quick question: is ActiveEffect supported in the current version? Currently I get error messages here "Error: You are accessing the ActiveEffect#data object, which is no longer used. Since V10, the Document class and the DataModel it contains have been merged into a combined data structure. You should now refer directly to keys that were previously contained in the data object.". This message occurs when I try to activate an effect....

Did I miss something here?

celest prairie
#

Wait it does

#

didn't test it enough

#

apologies

formal goblet
spare sky
#

Foundry: 11 Stable
CSB 3.0.0

formal goblet
#

If you mean the Active Effect Library, then there's no usage from CSB. It's only a planned feature to include it alongside the vanilla status effects

slow tree
formal goblet
slow tree
#

btw, thanks for all your answers :)

spare sky
#

Just because it's explicitly described here (https://foundryvtt.com/article/active-effects/ ) and doesn't address a specific system: is this analogous to the "Configure active effects" setting in the templates? Or does this refer to a separate module, which I have to install afterwards? Unfortunately I could not find a corresponding module...

slow tree
#

but there is something similar already in CSB

scarlet skiff
# spare sky Quick question: is ActiveEffect supported in the current version? Currently I ge...

when i talked about (active) effects i was talking about the foundry system for effects. you can look at them in the console with CONFIG.statusEffects and you can add new ones with the module "Core Expanded Settings"
you can also look at a single effect on an token like this:
select a token and with the button "Assign Status Effects" (right middle button near the token) put an effect on the token. when you have the console open (F12) you can see that there is an ActiveEffect with id xxxxxx in parent Actor xxxxx created.
you can then use the id of the actor and the id of the effect to look at it in the console with something like: game.actors.get("THE-ACTOR-ID-HERE").effects.get("THE-EFFECT-ID-HERE")

slow tree
spare sky
scarlet skiff
#

yeah if you want to for example add stats to an actor then use modifiers (use "configure active effects" in the actor template) like @slow tree just said

scarlet skiff
slow tree
spare sky
slow tree
#

ah yeah, you are right for this

spare sky
#

Whereas on/off is not the problem...

slow tree
#

Yeah I don't think there is any "timing" feature in the system yet, you'd need to go into scripting

slow tree
#

or maybe some modules

scarlet skiff
#

just to illustrate - my (programming noob) solution for stuff like burning was this (all programmed myself - no module or CSB for that)

#

please note that effects have a duration which is usable but not quite consistant if you have for example combatants joining or leaving the combat

#

as you can see i got readyToRemove and removeEffect as flags which are necessary for me to get the precise timing right

spare sky
#

For timing, I found a module that allows me to schedule effects - in combat rounds. Ok... only one round or 10 rounds... but it's a start... 😉

scarlet skiff
#

🤷‍♂️ don't know if it works with CSB - you will have to try 😄

scarlet skiff
#

if you want to automate things like burning damage you will not get around applying the effect with some kind of macro - then you will have to integrate this module (if possible) or handle it in another way 😅
so as said before: bad news - this task requires javascript after all

vagrant hollow
spare sky
celest prairie
#

question,
When i use a checkbox value in a visibility formula
The visibility does not revert back once I uncheck the box...
How do I fix that?

celest prairie
#

the code I use is:
equal(pc_npc_housing_check,'true')

formal goblet
#

Just use the key, nothing else

celest prairie
tender jungle
#

Quick Q.
Is there a way through CSB (or a module or etc) to drag an item from one actor to another?

tender jungle
#

dang

tender jungle
celest prairie
#

question, Is it possible to create multiple templates in the same world?

formal goblet
#

No

celest prairie
# formal goblet Yeah, sure

So technically, if created right, you can play multiple systems in the same world if you just create the template sheets for it?

celest prairie
#

I'll try it out in a different world to not screw up my work xD Thank you!

tender jungle
#

Another quick question. Is there a way to get the item's unique modifier through ${}$?

dense pine
#

a label inside an item container has the label text ${item.stack}$, which is a number field. i want this label only to be displayed when this number is greater than 1, so i put item.stack > 1 in the visibility formula, but it doesnt work. what would be the correct visibility formula please'?'

tender jungle
dense pine
tender jungle
#

oh! shoot, sorry.
Is the label's text JUST the number?

dense pine
#

yes

formal goblet
latent sorrel
#

I have a series of items from the same template with unique names designated unique in containers that are added by dropping a folder onto the character sheet. If I delete one unique item , I cannot add it in as a single dropped item. If I re-drop the folder, one of the unique items duplicates, usually the last one in the container. I have to delete all items and re-drop the folder to solve the problem. Is this a bug or am I missing something?

#

I have also found that if I drop single unique items with different names onto empty container, I can only add a single unique item. Dropping a unique item with a different name is not added to the container. I hadn't noticed this previously as I was only dropping folders of test items. Now I am (hopefully) approaching completion and just discovered this problem.

fierce harbor
#

Hey!
There's no way to use fetchFromDynamicTable() with two filtering columns, is there?
Or maybe use a logical combination of two columns as filter, like col1 and col2?

spare sky
#

Hello!
I have an absolute beginner question (despite Doku), where I just do not get on:

I have two fields where I manage the current life points:

(1)
numberfield_lpakt_label (Type: Label) : Label text (numberfield_lpakt)

This field is displayed to the player in the character sheet.

(2)
numberfield_lpakt (type: Number field)

With this number field I can adjust the life points accordingly.

I now want to apply an effect, e.g. burn, to the character, whereby the damage should remain even after the effect has ended. For this I have entered the following values under "Configure modifiers":

Key: numberfield_lpakt_label
Op.: -
Value formula: ${setPropertyInEntity('self', 'numberfield_lpakt', "self.numberfield_lpakt - 20")}$

I have also tried "selected", unfortunately without success.

Probably I have here a basic understanding problem, whereby the professionals among you can help me surely easily.

Thanks a lot!

formal goblet
spare sky
formal goblet
spare sky
formal goblet
#

yes

spare sky
# formal goblet yes

Ok... then I still don't really understand such effects that cause damage, like burning, bleeding, poisoned.... but, then that's how it is...

All right... Thanks for the quick reply!

formal goblet
latent sorrel
#

I have a dynamic table where a delete button (macro) is only to appear in the first record (key 0). My current solution for this is to use JS to renumber a variable ("sn") to each time a macro adds a new record to the top of the table and a label (macro) wtih sameRow('sn') == 0 ? "Delete" : "" however this seems to be "always running" and causing problems with giving elements focus via mouse click. Is there a way better way to achieve this effect? Or do I have to wait for the next release?

formal goblet
latent sorrel
#

Do you have an ETA of when hiding individual elements in dynamic tables will be available or is this "farther off" on the release schedule?

latent sorrel
formal goblet
static cargo
#

Hey guys, am I anywhere near the ballpark on this one?

#

Trying to put attribute numbers on the character sheet. I already used [ Configure attribute bars ] making both HP and EP.

formal goblet
static cargo
#

so it'd work to make curHP, maxHP and tell the resource tab on the Token to use those for the bars?

formal goblet
static cargo
formal goblet
#

And the max-value is not referencable btw

static cargo
#

Ok. On the flip side of that though where it ought to show the max I could put the formula to get what it ought to be:
/ ${startingHealth + strengthConditioning}$
That'd work, right?

static cargo
#

In a way, it works even better... if, over the course of play curHP max is inappropriately set... this will show what it's supposed to reset to.
Thanks @formal goblet ... wait .. Martin as in the author of those exceptional CSB examples available for json importing?

formal goblet
#

Uh, yeah

static cargo
#

Dude... I'm a visual learner and hardly anyone understands what that means, but, for me: Functioning, practical examples that I can pull apart, shatter to pieces and re-import are HUGE.

TYVM.

formal goblet
#

sure, np

static cargo
#

Hey, I've got a fresh puzzle rotting my brain... When displayed as a label the formula in Green works flawlessly. Copy/Pasting to the Default Value field of a Text field, it becomes totally broken. (In the picture I mean for it to be 6 based on the numbers.

Can the Default Value control of a Text field take a calculated value?

#

Alternatively, if I give this Label a Component Key, can I access the value of Label (w/o the prefix & suffix)?

formal goblet
formal goblet
tired onyx
#

I'm starting to have lag issues with my game. I'm not exactly sure what changed.
Reloading the template/sheet writes 31.6k lines to the console and there's a good 3 seconds between every single change to the character sheet where only days ago it was instant.
I have 10 %{formulas}% on each actor sheet, so I wonder if those are the cause of this new lag, but it's honestly getting to the point where using this character sheet is unusable for character building with all this lag. Are there any tips anyone has for managing lag?

fierce harbor
#

Why does the second line read the old item.armrEquip instead of the one set by the first line?
I just cannot see where I'm wrong...because I know I am!
Any idea?

latent sorrel
#

Is there a good way to indirectly reference actor data in an item. I have an item (a Skill) that has a dropdown that selects a stat name (ie Brawn) and I have an object on the character sheet that matches the stat name. I would like to pull the data based on the dropdown value. Fetch From Actor and ref() dont seem to work or I am doing it wrong. I can do it with JS but non-attached skills throw DATA PREPARATION errors in console when try to access the items parent regardless of attempts to !PARENT.

formal goblet
latent sorrel
#

Is sorting item containers by name a pending feature? If so, vague ETA on how far off?

#

Also the ability disable showing the default item name in item containers?

formal goblet
formal goblet
latent sorrel
#

The reason for the request is to combine fields such as show name (other field) as a single entry instead of being stuck with the table structure adding extra space.

formal goblet
#

Oh, so you want to disable the whole column? Not just the name?

latent sorrel
#

In retrospect, perhaps the ability to modify the displayed name of the item in the container, perhaps by formula instead of disabling or hiding, to include JS compatibility.

cinder rock
#

Heyo, I just noticed yesterday that the active effect modifiers I've had set up are no longer effecting actors. Was something updated that I need to change? Like a change in syntax or something? My modifiers are really simple, like adding and subtracting 2 or setting a stat to 0.

formal goblet
cinder rock
#

hmmm maybe something else updated that broke it then

formal goblet
#

Any modules loaded that can affect modifiers?

cinder rock
#

Monk's Little Details, but that hasn't been updated for 2 months

#

I'll do some digging. Was kinda hoping it was as simple as a syntax update, but its not, so I'll have to look deeper 🔍

formal goblet
#

Any hints in the console?

cinder rock
#

no errors

formal goblet
#

Meh, then idk

dense pine
#

anyone know how to copy elements on a mac? On PC its Strg + Click/Drag but on Mac i cant find the right key. Should be "Command" but it isnt

spare sky
#

Hello!
Is there a possibility to hide the text and show only the image?

static cargo
spare sky
# static cargo In what kind of context?

I have a container that lists all the armor parts.

In parallel, I also have a schematic view of a person who can also pick up certain items on certain parts (head, body, arms...) when they are active.

With this view I only need the graphic, but no text...

static cargo
#

Ok, I may not have delved too deep into this part of it yet, but from your first question, I had trouble even working out if you meant stuff on the canvas or the character sheet... Thank you for the clarifying detail...

turbid elbow
#

I am trying to modify a char sheet and can't seem to be able to sort table entries properly

#

I mean, they group instead of swapping places

slow tree
#

There is no swapping in tables, you need to remove the first label (put it anywhere else in the character sheet), then move the second in its place

#

afaik

turbid elbow
#

fck...

formal goblet
turbid elbow
#

This means I have to copy-paste all the formulas that are to the right of the damn label

#

Yeah, I made the input of what I needed but now I want to sort it alphabetically

formal goblet
#

Well, you gotta do it by hand 😅

turbid elbow
#

<insert_bash_head_on_wall_emoji>

formal goblet
#

There's no autosort-function for normal Tables (and I don't think there will be one in the future)

turbid elbow
#

_<... this will require a lot of whiskey.

#

When I try to pull the entries up into place, they group in a bubble instead of placing between...

formal goblet
turbid elbow
#

Ok, How do I put a blank row in the middle somewhere?

#

Ah...just more free rows...

#

testing...

#

Ah...this may work

#

Ok, now I have to play reverse-tetris for a few hours

turbid elbow
#

Ok, do I have to do the same 'vertically' in columns?

turbid elbow
#

Phew, one table is done. Now for the worse one.

spare sky
#

Unfortunately, the filters in the item containers do not work for me:

I have two checkboxes in the item template "Armor": Active and Type (head, body, legs...).

Now I want to collect the items with the template "Armor" in one container, which also works.
But now I want to collect only special items in the container if the checkbox Active = true and the respective checkbox of the type, e.g. Head = true.

For this I have entered the following in the filter:

Field key = item.key_item_armor_activ
Op. = is
Filter value = true

and

Field key = item.key_item_armor_head
Op. = is
Filter value = true

Now the corresponding items should actually end up in this container, right? Where is my error here?

formal goblet
fierce harbor
fierce harbor
#

I was wrong, then 😅

spare sky
pseudo topaz
#

Is there a way to enable scrolling numbers to show characters damage with CSB?

turbid elbow
#

I made an "item" as a toggle-able macro. How can I enable it for tokens a.k.a. give the item macro to players?

warm flower
#

Hey, good afternoon!
Anyone using CUB with CSB?
I saw an earlier discussion, but dind't have the answer I was looking for.

I wish to increase/decrease an attribute when I active a determined effect.
Tried to use the @ attribute key and the straight attribute key with ${}$, but none worked.

Any tips?

warm flower
#

ohhh, okay 😦

#

thanks anyway

warm flower
formal goblet
warm flower
#

they key needs any special formatting or can be used straight the key that is related to the hidden attribute?

vagrant hollow
turbid elbow
#

But I have Foundry for like... less than 2 weeks and still struggling.

#

Lack of a defined system doesn't make it easier

#

If I cannot make it an item I'll just go with a macro.

vagrant hollow
turbid elbow
#

Could you show me this somehow?

#

I have this for now...

vagrant hollow
turbid elbow
#

Like... on a character sheet?

vagrant hollow
turbid elbow
#

I'm currently creating the char sheet

vagrant hollow
#

I my self made it so that the item container description is calling a makro form a textfield inside the item. So every item can have its one macro that can be called from the item container list.

turbid elbow
#

Is there a way to make a On/Off swith for this?

#

when a char has it?

formal goblet
turbid elbow
latent sorrel
#

Is there a way to count items in a specific item container. I have multiple containers that use the same template but with filters.

turbid elbow
#

I know I need a JS course from scratch... I know

formal goblet
formal goblet
vagrant hollow
turbid elbow
#

The macro itself is currently perfect - is an on/off switch by itself

formal goblet
#

Then isn´t it enough?

turbid elbow
#

Not exactly - I somehow need to enable this for the 'player' account when in session

#

and also construct a proper 'player' account

#

it all works fine from the GM account

formal goblet
#

Oh

latent sorrel
formal goblet
tidal quiver
#

Hi, I have "working" damage dealing. I mean... it works when I test it. But when I give my players a chance to play with it, they get such messages:

formal goblet
turbid elbow
#

Can someone show me how to set-up a 'player' account where it has proper permissions to control all player tokens and use macros?

#

We are playing F2F so there will not be anything on-line.

#

only screen display

fierce harbor
turbid elbow
#

I'm fiddling with that but it's confusing.

#

Also - when does the character sheet actually stop being 'buildable' and start being fillable like in creating an actual char?
Because right now I can only build tables and stuff

fierce harbor
formal goblet
turbid elbow
#

The permissions you ppl talk about are NOT in the account permission list somehow

formal goblet
#

If you want more detailed permissions, go to "Configure Permissions"

turbid elbow
#

I've been trying to figure this out for hours today.
Still does not work.

#

Actors are created - sheets are stiull 'buildable' not fillable

#

"Configure Permissions" seems to be almost useless

formal goblet
turbid elbow
#

Oh shi.... There we go! That's the problem, I believe

#

Ok, I'm re-doing actors from scratch now

formal goblet
turbid elbow
#

Yeah, it worked

latent sorrel
formal goblet
turbid elbow
#

Yessssss.... almost good

#

Ok... one last thing really but that's pretty much why I got Foundry.
I made rollable tables for critical damage effects from my core rulebook and I need to connect this to the char/NPC sheet via "Always HP"
What I mean is... I input damage done - press wound - Always HP subtracts this from Wounds on char sheet and the overflow goes into crit tables and the outcome appears in the 'critical damage section'.
Is that possible?

#

I will have to mod "Always HP" to add hit locations but that's another matter

#

One of the tables

#

Does anyone know IronMonk?

latent sorrel
#

I am unclear on User Input Templates. I need to pass the results (a number) from an input template to a macro.

formal goblet
#

From there you can pass it to the macro

turbid elbow
#

I messaged the author of Always HP and maybe we'll figure out a version for my needs.

unreal wadi
#

Is it possible to display more than just the name of the Item when displayed in an Item Container? If so, are there any good examples I can see. I've read through the GitLab docs on Item Containers twice now and it's just not clicking. I tend to do better when I can see a fully realized example that I can pick apart.

static cargo
#

I'm a Visual Learner too @unreal wadi, I wouldn't mind knowing this myself. (watching in expectation)

unreal wadi
#

Beautiful. Thank you!

blazing island
#

how can I fetch information from items I made to actor sheet? what code do I execute with it?

tidal quiver
static cargo
tidal quiver
static cargo
#

Mmm... sorry, it is a hud that takes user input on demand and hurts/heals manually. Didn't realize..

static cargo
tidal quiver
# static cargo if you're looking for a code-based solution, have you asked in <#699750150674972...

Well... Found some example code for warpgate after digging through macro-polo, but i am too green to reverse engineer and use it:

const damage = actor.system.attributes.dmg.value;
for(const token of game.user.targets){
  const hp = token.actor.system.attributes.Pv.value;
  const newHP = Math.max(hp - damage, 0);
  await warpgate.mutate(token.document, {actor: {"system.attributes.Pv.value": newHP}}, {}, {permanent: true});
}```
static cargo
#

Also, they'll really appreciate it if you wrap your code in backticks, like this:
```js
code
```

#

That triple backtick code block syntax colourizes the code.

${#setPropertyInEntity('target', 'PCHealthPointsAct', "target.PCHealthPointsAct - damageDealt")}$
tidal quiver
#

Thanks for tips, gonna use them 😉

tidal quiver
#

Jumping with question that arose in macro-polo for me: How do I execute macro in CSB?

tidal quiver
tidal quiver
#

@formal goblet I've got macro code for dealing damage from guys at #macro-polo, and I am trying to set it up in the roll. Below is the macro, to which I need to send my damageDealt variable.

console.warn(damageDealt);

const damage = Number.isNumeric(damageDealt) ? Number(damageDealt) : null;
if(!damage) {
  ui.notifications.warn("No damage was dealt.");
  return null;
}

const target = game.user.targets.first()?.document;
if (!target) {
  ui.notifications.warn("You have no target.");
  return null;
}

const hp = target.actor.system.attributeBar.PCHealthPointsAct;
const value = Math.max(0, Number(hp.value || 0) - damage);
return warpgate.mutate(target, {
  actor: {system: {attributeBar: {PCHealthPointsAct: {value: value}}}}
}, {}, {permanent: true});

I was trying to set it up in the same Roll button just passing it as ${damageDealt}$, which has this code for counting the damage:

Obrazenia: 
${damageDealt:=[:MeleeWeaponFixedDamageDice:]+PCAttrSTR+PCWzmocnienieUpgrade+PCZwieCiezUpgrade+PCOstrzenieUpgrade+generalRollModifier}$

But it doesn't seem to send the value of damageDealt to macro code (OFC covered in %{}%) which is located just below that

tidal quiver
#

Disregard. Got it to work!
For other people that might be looking for it, that's what I've got in Label Roll Message:

${damageDealt:=[:MeleeWeaponFixedDamageDice:]+PCAttrSTR+PCWzmocnienieUpgrade+PCZwieCiezUpgrade+PCOstrzenieUpgrade+generalRollModifier}$

%{PCDamageDealt=${#damageDealt}$;

console.warn(PCDamageDealt);

const damage = Number.isNumeric(PCDamageDealt) ? Number(PCDamageDealt) : null;
if(!damage) {
  ui.notifications.warn("No damage was dealt.");
  return null;
}

const target = game.user.targets.first()?.document;
if (!target) {
  ui.notifications.warn("You have no target.");
  return null;
}

const hp = target.actor.system.attributeBar.PCHealthPointsAct;
const value = Math.max(0, Number(hp.value || 0) - damage);
return warpgate.mutate(target, {
  actor: {system: {attributeBar: {PCHealthPointsAct: {value: value}}}}
}, {}, {permanent: true});}%
#

I just need to figure out why that "object" shows up :/

formal goblet
#

If you want to hide that, just wrap it with ${#}$

tidal quiver
formal goblet
tidal quiver
celest prairie
#

question, if the permission to see a component is set to game master, the player shouldn't see it or anything inside the component right?

formal goblet
#

To be fair, you can just test it for yourself real quick 😅

celest prairie
#

Ok, so the first panel is what I see, the second is what the player sees, but the world maker panel should be hidden to them, but isn't.
And for some reason, despite having the same permission, the show/hide panel button is hidden, but whatever is underneath isn't...

tidal quiver
#

Is everything to be hidden inside the panel that has those permissions set?

celest prairie
#

In fact, It kinda already does that with some components and not with others...

tidal quiver
#

Maybe there's something with the formula you use to make it disappear?

celest prairie
#

well no, the component the player doesn't see doesn't have a visibility formula. Only the role permission.
The worldmaker panel does have a formula, but i think the formula overwrites the role permision...

#

I just fixed it, by putting the entire panel inside the table that is hidden and doesn't have a visibility formula

subtle jay
#

Sorry to ask what is probably a stupid question, a bit of a beginner here. I'm having issues setting up attribute bars the way I'd like. For example: I'd like the max value of an HP bar to be the max value of a particular actor's maximum HP value, rather than a static value. I'm sure I'm just missing something obvious but critical lol

#

Nevermind lol. Still getting used to the formulas and stuff

potent fossil
#

Quick Question
I have a dynamic table with Dropdown lists. The key linked to the option of these dropdown list are actually hidden attributes that I need to fetch and sum in the same Row.

${sameRowRef('mana1', 0) + sameRowRef('mana2', 0) + sameRowRef('competence_liee', 0) + sameRow('Mod', 0) -2}$

mana1, mana2 and competence_liee are the keys of the columns containing my dropdown list. Mod is a number field.

Problem is the label is returning an error, am I doing somehtin wrong?

formal goblet
potent fossil
#

Maybe not cause it's still showing up an error, I probably misunderstood what I had to do

formal goblet
#

And you should move the fallback-value to ref()

celest prairie
lusty crater
#

hi, I've got a question about if it's possible to do something with CSB.

I'd like to create a dynamic table, but have one of the columns flip between being a drop down list or a number entry based on if a checkbox in the item is checked or not.

lusty crater
#

I'm trying to do that by putting a visibility formula in:

sameRow('vehicle_armor_fixed_magic',false)!=true

But it doesn't seem to update based on the changing value?

static cargo
lusty crater
#

nope, also doesn't work

static cargo
#

based on the name inside sameRow, the dropdown should be shown if the box is ticked?

lusty crater
#

States are:

  • Checkbox ticked: show the number input
  • Checkbox unticked: show the drop down
static cargo
#

Ok, what about ...
...magic',true)
-- and --
...magic',false)

lusty crater
#

just has both of them show because it's apparently not getting the value from the attribute, it's just using the fallback value

#

The final display looks like this (with the drop down shown). Ideally would be able to swap between the drop down and a number input.

static cargo
#

A - checkbox named 'edit'
B - displayed when not checked
C - displayed when is checked

lusty crater
#

right, I think the part that is going wrong here is because it is in a dynamic table

#

cause, I had no problems doing conditional display in the non dynamic table stuff

static cargo
#

That's what I was afraid of for you... Sorry I'm not even more experienced with CSB personally.

#

It's a pitty Foundry doesn't have something like a Combo Box (Dropdown list that can accept a typed out value)

lusty crater
#

I mean, that exists in basic html using an input with a list property and a datalist element

#

Not useful if you need to be able to translate the option text, but for this personal project, it'd work. But I don't think CSB has a way to do that.

static cargo
#

... dang. Closer than I thought. 🙂

lusty crater
#

I think this is just a bug in how CSB works. Gonna submit a report and see what comes of it.

lusty crater
#

ok, setting aside the conditional display above for a bit.
How can I sum a dynamic table?
E.g. I want to get the total of all the sizes in my vehicle_armor_table and display it in a label.

formal goblet
lusty crater
#

Ah, ok, the math library isnt used as methods on math. Gotcha

#

Thanks!

lusty crater
#

So, another question. Is there any way to do a multi-row dynamic table item? E.g., if I wanted to put the description for this item below the checkbox and inputs:

fair yoke
#

Could anyone help me, I want to setup a roll on the sheet where if a hidden stat comes out to 0 it will perform a different roll.

#

since this system I am working on gives bonus/takes penalty dice and if the number of dice would be 0 it instead rolls 2d6 with disadvantage

tidal quiver
#

Use an IF? It is explained pretty good on git. Unfortunately I can't link it now

formal goblet
dense pine
#

The following roll message lets me activate an effect of an item.
${
setPropertyInEntity('item', 'is_effect', "item.is_effect ? '' : 'true'")
equalText(item.hinweistext, '') ? '' : item.is_effect ? '' : notify('error', item.hinweistext)
}$
It creates a chat message but i dont want any message at all. How can i prevent his?
This is the message:

formal goblet
lusty crater
lusty crater
formal goblet
#

I had a similar issue with Item Containers. But that one is fixed for the next patch

lusty crater
#

Yep, that's what it looks like to me. Reported it in this issue, which I just realized is slightly misnamed

#

*renamed issue to reflect that it doesn't work

formal goblet
#

Btw, ! is not usable as the not-operator 😅

lusty crater
#

Ah!

#

I'll probably hack together a work around using css based on the checkbox state (assuming that :has works in electron.

potent fossil
#

Dumb question probably but I can't put my hand on the Css Class for journal background with the inspecting tool, does anyone know what it is ? Also text while modifying a paragraph
I use white text cause my background is dark, but the background of journal is still light. Also when I modify a paragraph field the text turns black, and only become white again when I save text. Problem is, I can't see what I write

slow tree
formal goblet
slow tree
#

ho my bad, missed this! thanks

vagrant hollow
#

Has anyone tried to do a token-action-hud mod for CSB?

brave hornet
#

everything works mind, it's just not showing up with color per the conditional formatting

formal goblet
brave hornet
#

thanks

lusty crater
#

working on kind of a complex script/formula to total up a stat.
If the character is piloting their vehicle, then the defense needs to be calculated using the vehicle's armor stats. If they aren't, then it uses their value in a game stat + their armor's modifier. Here's what I've tried:

%{
  const vehicleArmors = Object.values(actor.system.props.vehicle_armor_table).filter(armor => 
    !armor.deleted &&
    armor.active);
  const inArmoredVehicle = actor.system.props.isPiloting && vehicleArmors.length;
  if(!inArmoredVehicle){
    return ${ref('ins_current')+ ref('skillmdef_mod')+ ref('mod_mdef') + sum(fetchFromDynamicTable('equipment_table', 'custom_weapon_mdef', 'is_equipped', true))}$;
  }else{
    const armorStat = vehicleArmors.find(armor => armor.armor_magic_attribute !== 'STATIC')?.armor_magic_attribute;
    const stat = +(armorStat ?
      actor.system.props[`${armorStat.toLowerCase()}_current`] :
      0);
    const mods = vehicleArmors.reduce((total,armor) => total += (+armor.armor_magic_bonus),0);
    return ${
      ref('mod_mdef') +
      ref('skillmdef_mod') +
      stat +
      mods
    }$
  }
}%
#

But, that just winds up getting returned as a string in my test PC sheet

lusty crater
#

Other attempted code:

${
  inArmoredVehicle := %{return actor.system.props.isPiloting &&
    Object.values(actor.system.props.vehicle_armor_table).filter(armor => 
      !armor.deleted &&
      armor.active).length;}%
  stat := %{
    return +(Object.values(actor.system.props.vehicle_armor_table).filter(armor => 
    !armor.deleted &&
    armor.active).find(armor => armor.armor_magic_attribute !== 'STATIC')?.armor_magic_attribute ?
      actor.system.props[`${armorStat.toLowerCase()}_current`] :
      0);}%
  mods := %{return Object.values(actor.system.props.vehicle_armor_table).filter(armor => 
    !armor.deleted &&
    armor.active).reduce((total,armor) => total += (+armor.armor_magic_bonus),0);}%
  switchCase(inArmoredVehicle,
    false,
      ref('ins_current')+ ref('skillmdef_mod')+ ref('mod_mdef') + sum(fetchFromDynamicTable('equipment_table', 'custom_weapon_mdef', 'is_equipped', true))
    true,
      ref('mod_mdef') +
      ref('skillmdef_mod') +
      stat +
      mods
      )
}$
latent sorrel
#

Is there a way to reload the sheet via a command? I have a macro that sets a number of fields on items but item.update([]) is performed after every update which is slow. If I can perform the 10 field updates and than do a single sheet update, response would be faster.

tidal quiver
#

Had a session yesterday and we found it out :/

dense pine
#

How to Reroll Dices?
In my Roll Formula for TalentChecks i roll 3d20 and compare them to certain attributes like this:
Some Actors have abilities to reroll a Dice to alter the result of the Check.
How d i do that? Do i need Macros for this?

#

And the End of the Roll Formula i would like to have 3 Buttons. If i click Number 3 it would reroll the 3. Dice and update the value of "roll3", keep everything as it was and see the new result. Has anyone done this before?

zinc verge
# dense pine And the End of the Roll Formula i would like to have 3 Buttons. If i click Numbe...

Input prompts for rolls only appear before the roll is sent to chat I believe, and label roll messages I believe cannot pull the value of a roll from a previous message in CSB without probably using scripts.

What you might be able to do is set a hidden value on an actor sheet for each roll using setPropertyInEntity to have the actor track whatever each roll’s most recent value was, and then you can have a second “reroll” label on the sheet that rerolls one of those values and then adds it to the other two that were saved. You can also use this with the alternate shift+click roll feature if you want the reroll option on the same label. You can just make those values invisible with the visibility formula so it’s not ugly on the sheet

runic condor
#

Is there an easy way to have the roll message look at a check box state? I want a skill roll to be "Roll 1d6, but if trained checked, roll 1d6+1d4"

#

Like this, I want to click the skill name and roll a 1d6. or a 1d6+1d4 if the checkbox is ticked

zinc verge
runic condor
#

Thats enough to get me going I think. Thank you!

river sierra
#

I'm not sure if I'm missing something here ... I tried to add an "Item Container" column to a dynamic table, to - in this case - have a place to "drop in" skill items so that they pre-configure stuff like name and attribute (turn them to labels instead of text/dropdown entries). But when I do so, the item appears in all the rows, not just the one I dropped it into.

runic condor
#

Is there a way to get these numbers to Add?

#

The way you suggested @zinc verge worked but it would roll the number twice and I think my players would be irked to see when the "unskilled" roll was higher lol

#

So now Im trying to get it to roll each die seperately and then add. if the checkbox is not checked it adds 0

river sierra
# runic condor Is there a way to get these numbers to Add?

I'm using a "record the rolls, print them" approach most of the time. Example:

${#r1:=[1d6]}$${#r2:=[1d6]}$${#base:=sameRow("base")}$${#bonus:=ref(base) + sameRow("bonus")}$
<h2>${!sameRow("name")}$</h2>
<p style="font-size: 1.5rem;">🎲${!string(r1)}$+🎲${!string(r2)}$+${!string(sameRow("bonus"))}$+${!string(ref(base))}$ (${!string(%{return '${base}$'.toUpperCase();}%)}$) = <strong>${!r1 + r2 + bonus}$</strong></p>
zinc verge
runic condor
#

the 1d12 is replacing the 1d6 now, I changed the math of the game around a bit

#

so now its roll 1d12 and +1d4 if skilled

river sierra
#

In your case, it would look something like this:

${#r1=[1d12]}$${#r2=(SkillTrainedResist ? [1d4] : 0)}$
🎲${!string(r1)}$${r2 > 0 ? concat("+🎲", string(r2)) : ""}$
zinc verge
# river sierra I'm not sure if I'm missing something here ... I tried to add an "Item Container...

when you set a parameter in a dynamic table, you're setting that parameter for an entire column. If you were to do this same thing with a dropdown, the exact same dropdown would appear for every additional row you created. I'm not sure dynamic tables are the way to achieve what you're going for. what I think you're trying to do though should be achievable by just using an item container by itself. You can set columns in an item container to display a given item's components as a label already

zinc verge
river sierra
zinc verge
#

oh yeah they won't be editable from the item container listing itself.

river sierra
#

See, and that's a problem, both for the skill listing and for the actual inventory (I'd very much prefer to not force my players to have 120 items in there just because they have 120 tons of FF armor spare).

zinc verge
# runic condor the 1d12 is replacing the 1d6 now, I changed the math of the game around a bit

for clarity, if you're trying to get the 1d12 and the 1d6 + 4 to both roll and add to each other, then Akjosch's formula is what you need. I was at the understanding you were wanting the formula to pick one of two rolls depending on whether or not the checkbox was checked though. If that's still what you're looking for, then my new formula should be what you need. If you change the math again just replace whatever the old number you had in there was with your new one

zinc verge
runic condor
#

sorry yea now its you always roll 1d12. but if you are skilled you add 1d4. the math worked out better changing the D6 to a D12 and shifting the DC up. So I want it to roll 1D12, and then add 1D4 if the box is checked. if it rolls the D12 twice my players will be upset when they see they would have succeeded if they had not been skilled etc lol

zinc verge
#

oh okay, that's just ${SkillTrainedResist ? [1d12 + 1d4] : [1d12]}$

runic condor
#

That works technically, Im just trying to find a way to avoid this:

#

Where my player would see "If I had rolled unskilled I would have passed!"

#

if there was some way for that D12 to be the same in both

#

petty I know lol but I just see that being a frustration with a few people in the group

zinc verge
#

oh weird, it shouldn't be rolling both like that, but I think I know why it might be doing so. Okay, instead of having the boolean be in the roll message, have the boolean be a label within the table. You can set it to not be visible with the visibility formula. The formula should look like this. ${SkillTrainedResist ? 1d12 + 1d4 : 1d12}$ Then, take that label's key and make your new roll message just be ${[:<boolean key>:]}$

#

that should make it so your roll message is just referencing whatever the current option between 1d12 + 1d4 and 1d12 is, instead of rolling them both. Idk why but I think I've seen the devs here talk about booleans rolling both results in chat messages and I'd forgotten about that initially

#

Akjosch's solution also should work, though I think you'd need a : before the = for the roll keys. Should look like this

:game_die:${!string(r1)}$${r2 > 0 ? concat("+:game_die:", string(r2)) : ""}$```
runic condor
#

can it go in the hidden attributes like this?

river sierra
# zinc verge oh okay so you're trying to set up a quantity counter that's editable from the i...

I think I have a partial solution (with item container for the skills), which works for small values that don't change much. Essentially, I add three columns. The first is styled as a button, label content "<", label roll message:

${#setPropertyInEntity('item', 'rating', 'max(0, (item.rating ? item.rating : 0) - 1)')}$

The second is a plain label, component key rating, label text ...

+${item.rating ? item.rating : 0}$

The third is a button-styled ">" label, again with a label roll message:

${#setPropertyInEntity('item', 'rating', 'min(9, (item.rating ? item.rating : 0) + 1)')}$

This works since the items are copied into the item container, so the rating values don't cross-pollinate from one character to another.

zinc verge
# runic condor

Unfortunately no because this doesn’t have a key to be referenced by

river sierra
#

Now I have to either style the roll message into something useful ("Player X raised/lowered the skill S to V") or get rid of it somehow.

zinc verge
river sierra
#

The annoying part is that the support for character-specific item attributes is clearly there, in the system, it's just not exposed to the UI nicely.

zinc verge
#

That should kill the chat message

runic condor
#

Thanks for the help! Wound up going with this formula and its exactly what I wanted:

${r1:=[1d12]}$ +
${r2:=(SkillTrainedResist? [1d4] : 0)}$ =
[[${!string(r1+r2)}$]]

lusty crater
#

Question about the replaceAll function. Can it accept regEx converted to string? e.g. /my\s+text/ => 'my\\s+text'?

half pilot
#

I think I have what is probably a very basic question. How do you access any of the values in an Item Container from outside of that container? Like let's say a basic encumbrance system that needs to total up all the item's combined weights.

river sierra
half pilot
#

Oooh, I saw reference to Entities. Thank you!

spare sky
#

Hello!
I have a problem where I unfortunately get nowhere:

Actually no big deal - at least I thought:
I just want to save or display the value I calculate via the cube button in the field "key_item_effect_active_value_label" (field is stored in the item template).

For this I have set on the button

${#effect_value:=[:item.key_item_effect_value_cube:]}$
${setPropertyInEntity('item', 'item.key_item_effect_active_value_label', ${effect_value}$)}$

entered. Meanwhile I tried everything possible: "self", "item", ${effect_value}$ without or with quotes/single quotes. Nothing worked...

Can someone help me and tell me where my mistake is?

Thanks a lot!

half pilot
#

I wonder if this is similar to the issue I was having. Your initial attempt tp set the effect_value might not be getting anything from just item.stuff perhaps?
I'm still learning this, so it's really just a guess.

#

Above someone told me that in order to grab item.things I have to use javascript to get the actor's entity.item

formal goblet
spare sky
slow tree
#

Hey there,

Is there any way to filter a fetchFromDynamicTable() depending on 2 columns?
Example : I want all rows that contains 'active == true' and 'stat === "strength"'

dense pine
#

Would like to change the look of my primary ressources on the actors cheet. Right now they look like this:

#

Would like them to look like health bars. Has anyone done this with CSS perhaps?

latent sorrel
#

Can visibility formula use something like && or and() to use multiple conditions as critieria such as checkbox && brawn < 5 ? 1,0
I havent been able to get this to work.

lusty crater
#

Try:

brawn < 5 && checkbox < 5

No idea if the and works, but in normal js, you need to put the comparison on both sides of the &&

spare sky
#

Hi...
I actually thought I understood - but apparently not:

I copied the instructions from another field in the same item (where it works) and replaced only the variables. Still, unfortunately, it doesn't work.

${duration_value_new = item.key_effect_duration_label-1}$
${setPropertyInEntity('item', 'key_effect_duration_label', ${duration_value_new}$)}$

Can anyone tell me where the error is?

floral crater
#

to use and (or or) ,use: and(arg1,arg2)

lusty crater
#

Trying to set a property on the sheet in response to a roll being made. The display of the property on the sheet is a series of radios. When I use the roll, the properties that calculate from the set property update correctly (indicating it is setting it), but the radios clear themselves. Any idea what's going?

${#setPropertyInEntity('self','brainwaveClock',"min(brainwaveClock + 1,4)")}$
#

Hmm, problem seems to be that it is setting the value to a number, while the radios are expecting string values.

#

so, is there a way to ensure that setPropertyInEntity sets the property as a string value instead of as a number?

#

or alternatively, a way to set the expected value of the radio to a number?

river sierra
# dense pine Would like them to look like health bars. Has anyone done this with CSS perhaps?

Something like this works in my test:

  1. Add number fields, key le_cur and le_max.
  2. Add a label with the key le_display.
  3. Put the following in that label's test:
%{
setTimeout(() => {
    var ac = document.getElementById('CharacterSheet-Actor-' + entity.entity.id);
    var el = ac.getElementsByClassName('le_display')[0];
    var bar = document.createElement('div');
    var props = entity.system.props;
    var perc = props.le_cur / props.le_max * 100;
    bar.style.backgroundColor = 'rgba(127, 127, 127, 0.5)';
    bar.style.height = '1em';
    bar.style.width = '100%';
    bar.innerHTML='<div style="background-color: red; height: 100%; width: '+perc+'%;"></div>'
    el.replaceChildren(bar);
}, 10);
return '';
}%
#

As a side note, I with there was a simple "this is a bunch of HTML to render right here" component. Label is way too heavy and does too much stuff.

zinc verge
latent sorrel
#

Problem. In my template, I had a label called "availableSkills". It vanished. I had assumed I accidently deleted it. When I re-added it, it vanished again. I looked in the exported template and it was not here. More tinkering and now I can see it the export template JSON, but it does not show in the template itself. If I delete it from the JSON, import, add it manually, it disappears from view as soon as change the component name to "availableSkills" but continues to exist in the sheet object. Any ideas on what is causing this?

dense pine
dense pine
#

👍

river sierra
#

The annoying part here is that a straight label text like this ...

<div style="background-color: rgba(127, 127, 127, 0.5); height: 1em; width: 100%;"><div style="background-color: red; height: 100%; width: ${le_cur/le_max*100}$%;"></div></div>

... needs CSS to be even visible (it's all wrapped in multiple layers of wrapper this laben doesn't even need) and becomes nearly invisible and non-interactable in the template for editing.

#

So I couldn't make it work without the JavaScript code above.

river sierra
river sierra
lusty crater
#

Yep, still sets it to a number

river sierra
#

Then no clue, and it's time to use the good old "log everything to the console at every step" debugging technique.

lusty crater
#

think I'll just switch to raw javascript and set it manually

lusty crater
#

or not ...

#

guess I'll just not do the automation

lusty crater
spare sky
# lusty crater the value to set it to has to be passed as a string representation of the formul...

Unfortunately does not work. I get the error message in the console:

Formula.js:853 Uncaught (in promise) Error: Uncomputable token duration_value_new

I have it both like this:

${setPropertyInEntity('item', 'key_effect_duration_label', "duration_value_new")}$

as well as like this:

${setPropertyInEntity('item', 'key_effect_duration_label', 'duration_value_new')}$

tried... Unfortunately without success...

lusty crater
spare sky
# lusty crater oh, I think you just want it without the quotes: ``` ${duration_value_new = item...

Didn't work that way either, unfortunately.

${setPropertyInEntity('item', 'key_effect_duration_label', duration_value_new)}$

Still the same error message....

I then tried it like this:

${setPropertyInEntity('item', 'key_effect_duration_label', item.duration_value_new)}$

...and in any case got no more error message.

However, the value key_effect_dauer_label was not set to the value dauer_wert_neu, but to 0. I have now tried this with various values and always the same result: key_effect_dauer_label = 0...

Do you have any other idea?

#

I meant the key

duration_value_new

🙂

lusty crater
#

I'm having issues with set as well, so not sure what else to try

spare sky
formal goblet
dense pine
#

Any idea how to style to make it look this way?

#

Would like to round the grey borders and move LE_current Number field an LE_max Label over the bar like this

main magnet
#

Ok, so I have this formula that goes into chat:
<table>
<tr>
<th>${string(item.name)}$</th>
</tr>
<tr>
<td>${string(item.power_overcast_text)}$</td>
</tr>
</table>

The string(item.name) works and prints out the name of the item.

However, power_overcast_text is a rich text area in the item and I want it to print what is written in it.

What's wrong here?

main magnet
#

Nevermind, it works just had to re-add the item.

rich nest
#

Are there any plans to incorporate Item Containers as a standard feature in Foundry. I have it install and it helps prevent players carrying more items than they can store in backpacks and sacks etc, but it would be great if this was a standard feature.

river sierra
# dense pine Any idea how to style to make it look this way?

Check how those are doing it? But it should be mostly a combination of some nested HTML elements (potentially with various z-levels, and using position: relative; on the outer one and position: absolute; with the right positioning CSS for the inner), and ${le_cur}$ / ${le_max}$ as the content of one of the inner ones. The borders can be done with border-width, border-color and border-radius, and the colour with a gradient for background-image. I like to use https://cssgradient.io/ for creating those gradients.

CSS Gradient

As a free css gradient generator tool, this website lets you create a colorful gradient background for your website, blog, or social media profile.

#

And if you're heavy into CSS styling, see the simpler (code-wise) alternative I posted a bit later.

river sierra
#

Well, it did for me with the extra CSS.

#

An example for a structure for the "text inside" idea would be something like this:

<div style="position: relative; background-color: rgba(127, 127, 127, 0.5); height: 2em; width: 100%;"><div style="background-color: red; position: absolute; height: 100%; left: 0; width: ${le_cur/le_max*100}$%;"></div><div style="color: white; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; font-size: 150%; line-height: 2rem;"">${le_cur}$ / ${le_max}$</div></div>

Most of the CSS (besides width: ${le_cur/le_max*100}$%;) can also be moved into the custom CSS file.

#

Result on my side.

#

If you prefer to move as much into CSS as possible, the content becomes:

<bar-container><bar-fill style="width: ${le_cur/le_max*100}$%;"></bar-fill><bar-text>${le_cur}$ / ${le_max}$</bar-text></bar-container>

And the CSS:

.le_display .custom-system-label-root, .le_display .custom-system-label-label {
        width: 100%;
}
.le_display bar-container {
        displaY: block;
        position: relative;
        background-color: rgba(127, 127, 127, 0.5);
        height: 2rem;
        width: 100%;
}
.le_display bar-fill {
        displaY: block;
        background-color: red;
        position: absolute;
        height: 100%;
        left: 0;
}
.le_display bar-text {
        displaY: block;
        color: white;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        text-align: center;
        font-size: 150%;
        line-height: 2rem;
}

... and don't forget to set the key for the label to exactly le_display.

#

If you don't mind telling Firefox users to enable the :has CSS feature manually, you can get by without the key, too:

.custom-system-label-root:has(bar-container), .custom-system-label-root:has(bar-container) .custom-system-label-label {
        width: 100%;
}
bar-container {
        displaY: block;
        position: relative;
        background-color: rgba(127, 127, 127, 0.5);
        height: 2rem;
        width: 100%;
}
bar-fill {
        displaY: block;
        background-color: red;
        position: absolute;
        height: 100%;
        left: 0;
}
bar-text {
        displaY: block;
        color: white;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        text-align: center;
        font-size: 150%;
        line-height: 2rem;
}
#

See the browser compatibility at the bottom of https://developer.mozilla.org/en-US/docs/Web/CSS/:has

The functional :has() CSS pseudo-class represents an element if any of the relative selectors that are passed as an argument match at least one element when anchored against this element. This pseudo-class presents a way of selecting a parent element or a previous sibling element with respect to a reference element by taking a relative selector ...

river sierra
# dense pine Just wow! Thank you!!!

No problem. I'm still annoyed with the amount of wrappers (and white space in margins and paddings) that the default label throws your way, but you can deal with almost all of it eventually with modern CSS.

dense pine
river sierra
#

Depends on how reusable you want it to be. If it's a one-off thing, no point using CSS classes.

celest prairie
#

Hi, back with another question.
What is the formula to make something invisible when a checkbox has been checked?

#

nevermind,Found it!
not (insert_component_key)

ruby frigate
#

hi I'm starting a project with csb and i had a question
is it possible to automatically change a number field current value to its maximum ?

spare sky
spare sky
celest prairie
#

Hi, Question, what is the quickest way for players to close the richt text box without closing the entire character sheet? Without having to change something in the sheet to save it(which also closes the box)

latent sorrel
#

Is it possible the change the name in the header of a user input or set the length or width of user input dialog window? Can the check mark on the "roll" button be changed to a different symbol. CSS classes appear to be too generic.

static cargo
dense pine
#

there must be a syntax error, but i dont get it:

#

RS_base is 5, wert1 is 3

#

Can i nest conditions like this?

#

Result is NaN

static cargo
#

Have you tried using discord's js code colorization to see your work?

#

```js
paste your code here
```

#

those are the backtick character...

dense pine
#
${is_effect ? RS_base >= ref('wert1') ? round(ref('wert1')/2) : RS_base < ref('wert1') ? 
ref('wert1')-round(RS_base/2) : 0}$
static cargo
#

The 'ternary operator' (?:) needs the same number of "?"'s as ":"'s for each use, but you seem to be short one ":"

celest prairie
dense pine
static cargo
#

Literally just slap a space in there and the Save & Close button will work.

blazing ibex
#

does anyone have an example for a dropdown list that changes options depending on what you selected from a different dropdown?

say dropdown #1 has values for A, B, C...

  • if you pick A then dropdown #2 shows 1, 2, 3
  • if you pick B then dropdown #2 shows 4, 5, 6, 7
static cargo
static cargo
static cargo
#

Not to mention a Save button and a Cancel button at the bottom.

formal goblet
formal goblet
formal goblet
ruby frigate
ruby frigate
#

so if i had a number field named 'exemple' and i wanted its value to go up by one, a label with this formula " ${setPropertyInEntity('self','example',+1}$ " shoud work or am i missing something ?

#

wait i found out why it didnt work i forgot one parenthesis

formal goblet
ruby frigate
#

thank you so much i have been scratching my head trying to figure how to make it work

#

by the way is there any "if" function that would let me check if a checkbox is true or false to for example:
if ture have the set-property increase a value by 1
if false heve it instead decreased by 1

formal goblet
ruby frigate
#

so if i understant, to use it i replace "condition" by the key of whatever checkbox i want to reference and replace "thruthy"/"falsy" by whatever formula i want to run?

formal goblet
ruby frigate
#

im a bit confused
so this way doesnt work ${ Checkbox_example ? 'setPropertyInEntity('self','example',"example + 1)' : 'setPropertyInEntity('self','example',"example - 3)' }$
but i dont understand how i coud make it work

formal goblet
ruby frigate
#

oh which ones?

formal goblet
#

Quotes are handled like parenthesis. If you have ( without ), it will result in a syntax error.

ruby frigate
#

oky thank you a lot

static cargo
blazing island
#

apologies, how do I assign integer values to some keys that is tied to dropdown list?

#

also how do I call items to actor sheet from each individual item I created?

#

like, if there is 2 different classes I made as an equippableItem, and I'm calling value such as skill_1 from an class item I made named Bard

static cargo
#

what have you tried already, and how did it not meet your expectations?

blazing island
#

i tried using something around the lines to try using a conditional to compare a key:
${terrain = 'ter2" ? 8 : 6}$

#

and what it feeds back is an 8, regardless of what dropdown item I choose in the actor sheet

#

im a total beginner so yep

static cargo
#

Ok, a single '=' means "the variable on the left now has the value on the right. What you want there is a double '==' instead.

#

Also, it doesn't much matter if you start a string with ' or ", but it is vital to use the same to close that string.

river sierra
#

= is an assignment. Comparisons are ==, but I'm not sure it will work with strings (no time to check right now though).

blazing island
#

nope

#

it just errors out

static cargo
#

Can you take a screen clipping of what you have for us?

blazing island
#

something like this

#

im like, trying to make the dropdown adds a value to terrain_val label next to the dropdown.

#

i'm just making an existing game system into Foundry

static cargo
#

Ok, nice now can you show me how the terrain list is constructed?

blazing island
#

because the terrains are grouped with certain values so im adding it

#

into same key groups

static cargo
#

That grouping of identical keys works with (and is expected with) radio buttons. Dropdown lists though are going to break if the keys are not unique.

#

Also, in the first comparison of your code, you're trying to match the word "Highland" but the value of terrain comes from the Key column. The Label column is simply all about what's shown to the user and is not part of this.

blazing island
#

so I need to compare it with the key of each dropdown item?

#

as a string

static cargo
#

... using "==" yes.

blazing island
#

ok im going to try it now

static cargo
#

(your screenshot still has one single "=" in there too.)

static cargo
# blazing island ok im going to try it now

If you're testing several keys, you might want to try this instead:

switch(terrain) {
  case "key1":
    // code block
    break;
  case "key2":
    // code block
    break;
  default:
    // code block
}
blazing island
#

switchcase?

static cargo
#

That should work and is far tidier.

#

Think of it as a special "if else" but you can test one variable against practically unlimited values.

blazing island
#

oh that works finally

static cargo
#

Glad to help. 🙂

blazing island
#

thank you very much, might come around to ask more later about calling item values

#

from created items

static cargo
#

I might not be up much longer but others should be floating around here and there, including Martin1522, CSB's Developer.

blazing island
#

ye but thanks a lot, still a lot to learn

zinc verge
# river sierra

question on this: I'm trying to get the display bar to have "HP" in the label prefix but it won't display. Do you know how to get this to show up before the bar or is it not possible?

blazing ibex
river sierra
# zinc verge question on this: I'm trying to get the display bar to have "HP" in the label pr...

Depends on the method you use. I need to prep for our gaming session later, so can't really have the custom system running for testing, Here's an example label's content:

<bar-container><bar-fill style="width: ${le_cur/le_max*100}$%;"></bar-fill><bar-text>${le_cur}$ / ${le_max}$</bar-text></bar-container>

Then there's the same label's prefix:

LE:

Then the fill class le_display to either the key or the CSS class of it.
And that's the CSS that makes it all work (note: I'm using :has to simplify it a lot, Firefox users need to enable that):

.custom-system-label-root:has(bar-container) {
        width: 100%;
}
.custom-system-label-label:has(bar-container) {
        width: 100%;
        display: grid;
        grid-template-columns: min-content auto;
        line-height: 2rem;
}
.le_display {
        --bar-fill: red;
}
bar-container {
        displaY: block;
        position: relative;
        background-color: rgba(127, 127, 127, 0.5);
        height: 2rem;
        width: 100%;
        grid-column: 2;
}
bar-fill {
        displaY: block;
        background-color: var(--bar-fill);
        position: absolute;
        height: 100%;
        left: 0;
}
bar-text {
        displaY: block;
        color: white;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        text-align: center;
        font-size: 150%;
        line-height: 2rem;
}
zinc verge
#

thank you!

ruby frigate
#

hi does anyone know what component is equivalent to a hidden atrribute ?

ruby frigate
#

oh then which label (text,prefix,suffix) would be used if i wanted to reference the label key ?

static cargo
ruby frigate
#

yeah i found out that worked i just needed something to store a formula so i could reuse it somewhere else

static cargo
#

Then you're all set and that's the most important thing. Happy gaming bud.

ruby frigate
#

thanks
though ill be going a little mad figuring items before i can game with friends XD

static cargo
#

Do you have the json package of Martin's examples?

ruby frigate
#

yeah i downloaded a bunch of the other systems to reference myself but since the system im working on is a little unorthodox ill still have to figure a bunch of things out

static cargo
# ruby frigate yeah i downloaded a bunch of the other systems to reference myself but since the...

Other systems...? Maybe my question was unclear: Martin, creator of CSB, has made a bunch of functional examples and bundled them into a json file for importing into your Foundry. I've learned a LOT from looking at how they are coded and how they interconnect. Esp "items" (Which go into a sheet element called Item Container. You wouldn't believe how long it took me to realize that was in the list.)

If you want it, you can d/l it from here: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads

ruby frigate
#

oh yeha they were super helpfull its just that what im doing is a little weird so it just takes me a while to figure out what parts of the example are applicable to what im doing

blazing island
#

how do you call a key from specific items? i know it would be like item.skill from under ClassTemplate I made, but what if there multiple instances of items? Can I just call the name of item to use the key of that specific item?

river sierra
zinc verge
# river sierra Next thing to find out: How to put *actors* (pilots, gunners and other crew in m...

Probably somewhat similar to making a party sheet, which I did by making an actor that has a dynamic table on it where the first column has me enter the name of an actor and the rest of the columns pull info from the associated actor’s sheet.

I don’t think drag and drop works atm because that would imply being able to physically put an actor into another actor, which just isn’t a thing, nor is it a thing for items (though the latter is currently scheduled to change in a future update)

river sierra
#

Kinda. I plan on using the unique IDs though instead of actor names. And yeah, this means I have to implement my own drop target, but that's not too bad.

tender jungle
#

Quick question regarding item modifiers.
Is there a way to have this value formula use the actor's attributes rather than the item's?

tender jungle
#

FYI this doesn't seem to work; console shows it's returning the expected value (3 here), but it makes the modified attribute "NaN"

formal goblet
tender jungle
#

well, that's at least giving me a new error

formal goblet
#

Also with a fallback-value?

tender jungle
#

noo it seems like the issue is I can't figure out the first variable here.

#

I assumed it would be entity.name or something, idk

#

OH! 'attached'

#

thanks!

blazing ibex
spare sky
#

Hi...
I am looking for a way to delete a item from a container when a value is 0.

My approach here:

${key_effect_duration_label >= 1 ? setPropertyInEntity('item', 'key_effect_duration_label', "item.key_effect_duration_label-1"): DELETE ITEM }$

The question now is: how do I delete the item from the container?

Thanks a lot!

spare sky
#

I had seen this before, but didn't really understand how to apply it.

Simply with item.delete() ?

formal goblet
spare sky
#

It works... Thanks!

blazing ibex
spare sky
#

I have an interesting effect that I can't explain:

Clicking on the dice initiates the effect and calculates the effect value and duration:

${#setPropertyInEntity('item', 'key_item_effect_active_value_label', ${effect_value}$)}$
${#setPropertyInEntity('item', 'key_effect_duration_label', ${duration_value}$)}$

These values are transferred to the item sheet.
However, only the effect value is displayed.

When I open the item, I see that both values have been entered.

After I have closed the item sheet again, the value for the duration is also transferred.

Can anyone tell me why this is happening and what I can do about it?

Thanks a lot!

spare sky
#

If I click on calculate again, the previously calculated value is displayed at "Duration"...

formal goblet
spare sky
#

Hm... i don't know... 😉 I will try it...