#Custom System Builder

1 messages ยท Page 50 of 1

dense verge
#

It works! Thank you so much!

sinful spade
#

good eyes on the equal text

formal goblet
#

${ref(concat('pc_', sameRow('pc_attack_stats'), '_mods').toLowerCase())}$

sinful spade
#

damn, that's SO much cleaner

#

@dense verge ^^^

dense verge
sinful spade
#

yes

#

concat adds elements

#

pc_ + 'nameofrow' + _mods -> ensure it's lowercase

#

==
pc_might_mods is the output

#

best part is, it'll expand with your rows ๐Ÿ˜ฉ

dense verge
#

Wow thats great, thank you for explaining, this seems like a fantastic community. Thank you once again

late heart
#

Why did I get a ping from this chat?

sinful spade
late heart
sinful spade
#

Martin you beautiful man
concat(switchCase) is revolutionary. I just managed to condense 24 image labels into 2 (could even do one if i really wanted to)
and clean up several code blocks to a quarter of their size.

potent vine
#

What is the easiest way to reference a value from a (non-dynamic) table in a character sheet, for a separate item sheet?

formal goblet
#

Damn, you're fast...

potent vine
#

ah perfect thank you so much!

glossy hare
#

I'm having an issue with importing/exporting things with compendiums. When i export items, they lost their reference to the template, what should I do?

vocal sorrel
#

Hello everyone! I am trying to figure out a formula for handling options in two dropdowns. The idea is that they both have the same options but once one is selected, the other dropdown doesn't have the option to select it now and vice-versa.
The two dropdowns are called Icon_Attribute and Shiver_Attribute. It seemed to work when only one of them was a formula, but now that they are both formulas, it stopped working.
This is the formula for Icon_Attribute:
${concat('no-attribute',switchCase(Shiver_Attribute, 'att-nerve', '', ', att-nerve'),switchCase(Shiver_Attribute, 'att-motion', '', ', att-motion'),switchCase(Shiver_Attribute, 'att-control', '', ', att-control'),switchCase(Shiver_Attribute, 'att-sage', '', ', att-sage'),switchCase(Shiver_Attribute, 'att-temper', '', ', att-temper'),switchCase(Shiver_Attribute, 'att-insight', '', ', att-insight'))}$
This is the formula for Shiver_Attribute:
${concat('no-attribute',switchCase(Icon_Attribute, 'att-nerve', '', ', att-nerve'),switchCase(Icon_Attribute, 'att-motion', '', ', att-motion'),switchCase(Icon_Attribute, 'att-control', '', ', att-control'),switchCase(Icon_Attribute, 'att-sage', '', ', att-sage'),switchCase(Icon_Attribute, 'att-temper', '', ', att-temper'),switchCase(Icon_Attribute, 'att-insight', '', ', att-insight'))}$
Could really use your help, thanks in advance!

#

Nevermind... I figured out that I just needed to remove the space between the comma and the option name, I feel dumb.

formal goblet
eager pewter
#

I'm trying to get a label on an actor to update with a value from an item label roll message. Here is how I am currently attempting it:

#

I have also tried just passing in a number but that hasn't worked either.

formal goblet
eager pewter
#

Thanks!

#

Changed it to a number field and works perfectly!

potent vine
#

For item displayers, I have want my CSs to have one item displayer showing all items and one that shows all spells. Each spell will have an aspect value with the same key and each item will have a size value with the same key. But when I try to use the filter to specify that the one item displayer will only accept item.aspect_val, ${do item.size_val }$ and vice versa for the other, I wind up just getting a huge error and the sheet crashes. Am I using the item filter formula wrong; does it need to use a conditional modifer formula or something?

formal goblet
dense pine
#

can i display a horizontal rule with a text field or is this only possibly with a rich text area?

icy panther
dense pine
#

dont want to use rich text areas

icy panther
icy panther
# dense pine would you give me a simple example of how a css line could be done?

Unfortunately CSS in CSB is a bit of a dark art, as it is outside the scope of CSB

You can customize your sheets with your own CSS. You can add a CSS file in the system configuration. The path must lead to a CSS file, starting from Foundry's Data Directory.```
I have got so far as creating a file and making 1 override at the moment, my project is a long way from beautification, but this might help:
https://developer.mozilla.org/en-US/docs/Web/CSS/Class_selectors
MDN Web Docs

The CSS class selector matches elements based on the contents of their class attribute.

icy panther
#

I guess I know more than I thought ๐Ÿ˜„

floral crater
#

Hi!
I have a weapon that deals 2D6 points of damage. On a critical hit, I want it to deal the maximum possible damage, which is 2*6=12. How can I achieve this?

(I tried using a 'replace(damage, 'D', '')' method, but it doesn't perform the calculation as intended, instead it just displays 26 instead of 12.)

icy panther
#

crit ? 12 : 2d6

floral crater
#

The goal is to automatically calculate and apply the maximum possible damage for any dice expression used with weapons in combat (2d8, 3d4, 1d10+4,....)

icy panther
#

@floral crater query ? true : false is what you need

floral crater
# icy panther <@720664401539235881> ```query ? true : false``` is what you need

It's not what I want to do. Using query? true:false would require testing all possible dice values in the chat.
What I want to do is, starting from a damage input with a different dice value, I can have the maximum damage calculated automatically.
That's why I'm thinking of replacing the 'D' with a '' so that the calculation is done automatically. But apparently this produces a text result and not a mathematical one, so the calculation doesn't work.
examples: 2D6->2
6->12; 3d4+2->3*4+2->14.....

icy panther
#

@floral crater how are you determining if the dice rolls a crit?

#

once you get you have a crit, I would have 2 components, 1 for number of dice, and one for how many sides
using num for number of dice and sides for number of sides, it would then be
determine if crit ? num * sides : [:num:d:sides:]

floral crater
#

How to define whether or not a review does not correspond to my request, that I know how to do. ๐Ÿ˜† What I want to know is how to calculate the review when it appears.

icy panther
#

oh so you want to know how to determine a crit?

#

๐Ÿ™‚

#

3 different problems in 1 request

floral crater
#

no, just one, I don't think we can understand each other (I use an online translator).

icy panther
#

no probs

floral crater
#

I know how to use query?true:false. ๐Ÿ˜†
If I have a critic (i.e. true), I'll search the character sheet for the damage entry (2d6, 3d4+1, 1d10 for example).
From there, I want to be able to automatically calculate the maximum value of this entry (for the above examples, 12, 13 or 10).
To do this, you need to extract the 'd' from the input, so that you can multiply the number of dice by the value of the dice.
using your last query, how do you retrieve 'num' and 'sides' to perform the num*sides calculation?

icy panther
#

split your damage entry into 2 parts, so instead of dice = '2d6', have num = '2' and sides = '6'

#

have a 3rd for modifier, mod = '1'

#

determine if crit ? num * sides + mod: [:num:d:sides:+:mod:]

floral crater
#

it's counterproductive and adds extra entries that unnecessarily weigh down the character sheet. Thanks anyway for your help.๐Ÿ˜€

icy panther
#

if you don't wish to change the entries, you could use JS split()

floral crater
#

Failing that, make another entry with max damage (which I'll look for in case of criticism) but that seems redundant. There must be something better to do.

formal goblet
floral crater
verbal portal
#

Hello all ๐Ÿ‘‹๐Ÿผ can I store a roll formula in an hidden key and use after that key when I need the formula content?

Or when I put ${mykey}$ it will give to me only the results?

floral crater
icy panther
#

@formal goblet could you help me understand why the first formula doesn't work?

${fetchFromUuid(Assigned_Player, "lookup('Dynamic_Equipment_Table', 'mount_label', con, true)")}$```
when this does
```${fetchFromUuid(Assigned_Player, "lookup('Dynamic_Equipment_Table', 'mount_location', 'Mount_Heavy_Weapons', true)")}$```
i assume its lacking quotes
sinful spade
sinful spade
icy panther
#

still a dark art to me

sinful spade
formal goblet
icy panther
formal goblet
#

And Assigned_Player?

icy panther
#

the second formula returns the correct info, the first doesn't

#

both same except pulling from first and second column

formal goblet
icy panther
#

correct

formal goblet
#

Then do fromUuidSync('uuid').system.props.Dynamic_Equipment_Table in the console and validate the values.

icy panther
formal goblet
icy panther
formal goblet
icy panther
formal goblet
icy panther
#

the uuid of the item in the dynamic table that is calling the roll

formal goblet
icy panther
#

it's an item on an actor, referencing a dynamic table on an item on another actor

icy panther
formal goblet
#

Just not a Dynamic Table, but not an issue

icy panther
#

?

#

sorry, i been up over 36 hours

formal goblet
#

I need you to validate fetchFromUuid(sameRow('uuid'), 'Mount_Type'))

icy panther
#

disregard that

dense verge
#

Hi all! Is something like this possible to do as a roll?

${[lookup('pc_armour_displayer','melee_defence_armour', 'body_armour', 'Body Armour')+
lookup('pc_defence_stats_table','pc_total_defence_stats', 'pc_defence_stats', 'Vitality')]}$

The first lookup should be bringing the result 1d4, the second is simply a number. I thought in theory this would work when put into the label roll message. Am I missing something or can I not call 1d4 from a dynamic table? Thought I would ask before I pull my hair out trying to work on it. Thank you!

formal goblet
icy panther
#

I am so confused, I am literally using the same line in my debug, and it works just fine

#

oh, yours is different to mine sameRow('uuid', 'Mount_Type') versus (sameRow('uuid'), 'Mount_Type')

icy panther
#

np

dense verge
formal goblet
dense verge
dense verge
icy panther
dense verge
#

the code essentially reads 1d4+2 but for some reason it isn't working as a roll

icy panther
#

is there an error in the console?

#

and you encapsulated both lookups with ::? and de-encapsulated the +

dense verge
icy panther
#

I would try something like

${mod:= find(...)}$```
and if they show fine, then do
```${dice:= find(...)}$
${mod:= find(...)}$
${[:dice:+:mod:]}$```
dense verge
dense verge
sinful spade
#

helll yeah nosferato ^^

icy panther
#

@formal goblet I have narrowed it down to this,
this works as should and returns mount3,mount4,mount5,mount6
${fetchFromUuid(Assigned_Player, "lookup('Dynamic_Equipment_Table', 'mount_label', 'Mount_Heavy_Weapons', true)")}$
this does weird stuff, as it returns mount1,mount2,mount3,mount4,mount5,mount6,mount7,mount8 (all rows)

${fetchFromUuid(Assigned_Player, "lookup('Dynamic_Equipment_Table', 'mount_label', con, true)")}$```
this just errors
```${con:= 'Mount_Heavy_Weapons'}$
${fetchFromUuid(Assigned_Player, "lookup('Dynamic_Equipment_Table', 'mount_label', "con", true)")}$```
and this shows no errors or anything at all
```${con:= 'Mount_Heavy_Weapons'}$
${fetchFromUuid(Assigned_Player, "lookup('Dynamic_Equipment_Table', 'mount_label', 'con', true)")}$```
icy panther
formal goblet
#

Seems fine. Then idk

#

Ah, actually... Execution context

#

con is part of your current entity, not the entity you want to execute your formula on

icy panther
#

idk either, but am sort of glad it wasn't me going out of my mind, I have a goal in finishing this project, to bug martin as little as possible ๐Ÿ™‚

#

because i'm using a input template?

formal goblet
#

So this is the fix

${con:= 'Mount_Heavy_Weapons'}$
${fetchFromUuid(Assigned_Player, "lookup('Dynamic_Equipment_Table', 'mount_label', '${con}$', true)")}$
icy panther
#

omfg, it finally works

#

I would never have thought it would have been applicable when the code is literally next to each other

#

yes I know, in the backgound they are worlds apart

#

@formal goblet many thanks again, and now I can finally sleep

#

@formal goblet so quick question, I should try that first if I get errors with cross referencing items spread across actors?

formal goblet
icy panther
#

randomly trying stuff is unfortunately the way I learn

formal goblet
#

${fetchFromUuid('uuid', "name")}$ vs ${fetchFromUuid('uuid', "'${name}$'")}$

icy panther
#

thats going to be different within context of item/actor/child

#

if I understand correctly

formal goblet
#

You have to ask "Who executes which formula?"

icy panther
#

yes

#

interesting

#

brain melting just thinking about that

potent vine
sinful spade
#

Has anyone figured out how to edit the dice from [!1d6] yet?
I have more than one display type so editing the provided class's positioning...

sinful spade
#

i mean for this roll, i'd like the d6 to be in a dropdown panel with 1d6 > 4

#

but for say, this roll:

#

i'd like the dropdowns to be under motor and 1d4+3 respectively for the differnet roll results

icy panther
#

like this, then roll the selection?

sinful spade
#

huh?
I mean to edit the visual location of the display

#

๐Ÿคฃ i cant just edit the provided system generated classes - since it would edit ALL rolls. and i havent found a way to put different classes on the rolls yet

#

i cant say...
<span class="hi">[!1d6]</span>
and the hi class appear on the dice

icy panther
#

oh I see, nope not a clue

formal goblet
#

Same here

icy panther
#

that would be a core foundry thing I would assume

formal goblet
#

It isn't

sinful spade
#

kind of annoyingly, i tried exaclty my example, and the hi class appeared on the first d4 but not the second one in this image:

#

in this case since it's just one D6 i could style the first four to look like the second but doesnt help for pools

fringe silo
#

@formal goblet ${#dos=fetchFromParent(lastDOS)}$ is this how i would set a variable on an item, from a component on the sheet

formal goblet
fringe silo
#

so no number sign

#

or add a colon or both

sinful spade
#

you can tell by the html structure

icy panther
#

as per martin The current downside of this Script is, that the replaced value doesn't have an explanation (the clickable grey box around the value in the Chat Message). It might be possible with a different approach, but I'll skip that here. If someone comes up with a solution to this issue, you're free to share it with me, so I can adjust the example to include that.
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools

icy panther
#

ok

fringe silo
#

@formal goblet So this is the formula i have, ${dos:=fetchFromParent(lastDOS)}$
<table>
<th><tr> ${name}$ </th></tr>
<th> ${dos}$ Degree's of Success! - ${switchCase(abilityrank, '1', "Iron" , '2' , "Bronze" ,'3', "Silver" , '4' , "Gold" , '5' , "Diamond" , "None")}$ - ${item.abilitylv}$ </th>
<tr><td>Base Damage: ${!basedam:=damage_per_rank * abilityrank}$</td>
<tr><td>Total Damage: ${!((basedam + abilitylv) * dos)}$ ${!damagetypedrop}$ Damage</td>
${#setPropertyInEntity('item, 'cooldown_active', cooldowndrop)}$
</table>, and this is the error im gettin (see above)

#

err or brlow

formal goblet
fringe silo
#

@formal goblet it set to 10 on the parent sheet

formal goblet
fringe silo
#

@formal goblet like fetchFromParent('lastDOS')

formal goblet
#

Y

fringe silo
#

@formal goblet thank you

sinful spade
#

You've likely already thought about this martin, but how difficult would it be to make it where the dice pool inherits classes?

formal goblet
#

You'd have more success with Linked on that matter

sinful spade
fringe silo
#

@formal goblet so the first 10 im guessing is attached to this, ${dos:=fetchFromParent('lastDOS')}$, how do i get it not to show up

#

@formal goblet just want the name at the top

rich barn
#

So I have absolutely no idea about coding, but I've been getting a bit of help from a friend. I'm trying to have an Iten Displayer with a Meter have a Value and a Max taken from an Item. I have boxes on the item that show the item's durability. I just don't know how to get it to read from that and make it actually display the correct values. If anybody can help me figure this out I'd greatly appreciate it!

verbal portal
#

help! I can not open anymore my actors sheet modder aaaaargh

#

I put a lookup in a number field and then pufff my template broken

verbal portal
#

my template is broken....there is a way to recover some work ?

sinful spade
sinful spade
#

You'll need to wait till someone who knows more about javascript, console commands, and the behind the scenes of CSB is online.
The devs for this are not in the US, so you'll have better luck in 12 hours or so.

#

im shocked that the template wont open because of a broken component though, have you tried restarting the server its on?

#

or maybe duplicate the template and try and open the duplicate

formal goblet
# verbal portal my template is broken....there is a way to recover some work ?

Export the Template and edit the JSON until you find the faulty part. For that, you can delete certain Components, reimport the Template and check, if it opens again. If not, add the deleted part back and delete some other part. Repeat until you find the faulty part and the Template opens again.

You can even readd the faulty part and go deeper into the Component hirachy and repeat the steps above, until you find the actual culprit.

sinful spade
#

i've noticed invisible labels appearing in my sheet - not entirely sure when they're being created, but they're messing with the spacing and impossible to click - i have to drag everything out of the containing panel and delete that panel to get rid of them.
I've also noticed them in Shadoghast's sheet.

#

while the highlight seems small it's a good 10px of display padding.

verbal portal
#

Ok now I know ... Dramatically Save often and Save different ...

raven raven
#

hi, how do I edit the font size of all equipable items that belong under a cetain template. How do i create a macro for that?

#

I just need the command that allowes me to edit the ritch text area of the template

sinful spade
#

Second weird issue of the night:

#

yet all the images are loaded and displayed, but i occassionally get these errors poping up.

formal goblet
olive trellis
#

hello, is there a way to reference a roll formula in a dropdown for roll messages? (if it contains for example: 1d4,1d6,2d6) the square brackets dont roll and say cant convert to number.

olive trellis
#

thats what i get

formal goblet
olive trellis
olive trellis
formal goblet
# olive trellis

Ok, your issue is, that the content of your Dropdown is dm1, dm2 and so on and not the Rolls you're expecting

olive trellis
#

yeah but keys should be unique or not? i dont know much of coding as it is 10+ years past since i learned it a bit but if i remember correctly everything should be unique to prevent conflicts

formal goblet
olive trellis
#

ok good to know so how do i fix my problem then?

formal goblet
#

Just adjust the option keys to match your option labels

formal goblet
#

yep

olive trellis
median mirage
#

FYI there's a console.log always logging the previous value for the Rich Text Areas

median mirage
#

Having an issue where using ${sum(lookup("perks", "perk_points"))}$
For a dynamic list perks and number input perk_points causes the sheets to continuously recalc because it can't compute lookup for the table. It doesn't have issues when the table is empty, and the same string (replacing the field references) works for another dynamic list on the same sheet

#

No idea what it was, but deleting the dynamic table and recreating it fixed it :/

sinful spade
#

Side note I did a thing!

formal goblet
sinful spade
#

I don't want to remake all 24 invisible labels again

formal goblet
sinful spade
#

There are several of them and they are not just on my sheet

formal goblet
sinful spade
#

I sent a video of me inspecting the element

sinful spade
# formal goblet So they're also in the Template?

2 things if you dont mind making a note somewhere...

Sometimes i have labels that have no visable content, just divs and spans that are css styled.
since i style using the template preface- the template doesnt get styled (only the sheet) this makes it much easier to grab weirdly positioned elements to be edited.
However ๐Ÿ˜ฆ this means in the sheet they are labels with content that is not visable and thus cannot be clicked - they actually shrink to 0px and i have to f12 manually set a width in them. Really 100% my fault but a inconvenience. Could it be possible to get a checkbox or something that manually places that empty label market to be clicked in the template only overriding it's default only show if empty? (And before you ask -- no this is not the same issue as the invisible labels appearing on my sheet, those are not styled in any way and i have no idea how they're getting there. they have default css classes causing weird padding).

secondly, i finally figured out how to make progression clocks (as i showed in my earlier video!) im super happy with them and they're so useful. Would it be possible to have them added a native CSB elements? I'm sure other users would 100% get a use out of them.

civic furnace
#

Is there a way for me to roll a label using a macro ?

For example
I have a label with
Component key = atk

that has a Label roll message like
${[1d20+Agility]}$

How would i roll it using a normal foundry macro ?

Is there a way or would i have to rewrite it from scratch just to make it roll using a normal foundry macro ?

#

I wanted something like :

const componentKey = "atk ";
const actor = canvas.tokens.controlled[0]?.actor;

if (!actor) {
ui.notifications.warn("No character selected.");
return;
}

//Roll the thing

formal goblet
# sinful spade 2 things if you dont mind making a note somewhere... Sometimes i have labels th...
  1. We actually do that already for truly empty Labels with a clickable square. The thing is, that HTML is not considered as empty content, thus the square will not be shown. I had the same issue with <img> within Labels, but I couldn't find a satisfying solution for now. A min-width would solve the non-clickable area, but not the invisibility-issue.
  2. It would generally be possible, everybody is open to add or change stuff within the system. But it would raise a few questions/topics regarding how we should integrate it (own Component type vs. styling-type of a Number field or even a Meter, flexibility in terms of max-amount, color, etc...). I think the best way would be to open a ticket and we can discuss the specifics there
formal goblet
civic furnace
#

apparently it was very simple, i just had to do actor.roll();

const componentKey = "atk";
const actor = canvas.tokens.controlled[0]?.actor;

if (!actor) {
ui.notifications.warn("No character selected.");
return;
}

actor.roll(componentKey);

sinful spade
formal goblet
sinful spade
#

true enough, though - i can f12 and override the width and height so i can click it and engage that setting.

#

Rather than f12 force update every time i want to make a change

#

Though better solutions may help with the random invisible labels that are cropping up

formal goblet
#

We could make it to always display the square. Might look a bit weird in the Template, but that's just the Template

sinful spade
#

oh - what about a "all square" toggle in the GM settings near template refresh?

#

toggle it on when you have some annoying element to grab, toggle it off to not have constant visual clutter when you dont need it

sinful spade
undone tinsel
#

Hello!
I'm trying to automatically have all tokens made with a template have a health bar on the token.
I've been struggling to do so, has anyone else solved this?

daring thunder
#

Is there a way to call the "reload" button in an item? Or to reload all items using a macro?

#

I'm implementing a macro to create items and it works, but you have to reload the sheets to make their data appear

#

And would be nice to just have that be done at the end of the macro running

sinful spade
undone tinsel
#

Fair enough. Thank you very much!

undone tinsel
sinful spade
#

thrid button on the right

undone tinsel
#

Just updated everything and I see it now.
Thank you very much

honest forge
#

True/false: If I have a Label field with an integer as the Label text, I can use that integer as if it were a number in formulas?

sinful spade
#

you may have difficulty editing that number with formula tho.

#

so if it's only outbound you're clear.

undone tinsel
#

Next question, do you know how to add attribute bars so that they can be seen by the Default Token configuration?
Similar to how this is visible in 5e in that setting:

sinful spade
#

you make them there, and i assume they'll show up in the token list

undone tinsel
#

Sadly, that doesn't quite seem to work.

sinful spade
#

idk if the ${}$ are required or not

undone tinsel
#

I've done that as my attribute bars are defined like that in the template.
Sadly that doesn't seem to carry over to the wider selection.

sinful spade
#

choose the template option

#

it may just load from there

#

that'd make some sense

undone tinsel
#

Sadly, still no

sinful spade
#

i havent added bars to tokens yet so idk mate

undone tinsel
#

It happens.
I'll keep digging

honest forge
#

This feels like a dumb question, but is there a standard method to add newlines to a tooltip?

dense verge
#

How do I reference an actors key inside an item modifier? I have done it when the key was inside of a Dynamic Table using fetchFromActor but I can't figure out how to call it if it is not inside of a dynamic table? Surely this is as simple as it sounds with something like:

${fetchFromActor(pc_hp}$
or
$fetchFromParent(pc_hp)

I have also tried system.pc_hp , system.props.pc_hp as well as every ( & ' combination I can possible imagine...

What am I doing wrong as I know it must be relatively straight forward! Thank you!

formal goblet
formal goblet
dense verge
#

I can get it to work when adding the key into a dynamic table but not outside of one..is that the only way it'll work? I would ideally be able to target keys outside of a dynamic table

dense verge
#

Yes, that is what I thought however it doesn't work. Thank you for your time!

#

Omg I know why...I'm an idiot. The targeted key is a formula in itself and it doesn't override it when using =

Thank you again

ancient temple
#

is there a way to add more pictures to the character sheet?

sinful spade
#

or css background-image

verbal portal
#

Hello mates how are you?
Today I am in obsession with a drop-down. There is a way to taget a column from a dynamic table into the character templates and use the data inside the rows for make a drop-down into an item ? I tried with fetch from parent, lookup and lookup ref .. the best I had was the whole list o null ... Other ways every time ERROR

formal goblet
verbal portal
#

Yep but not 1 row with the whole list ahah I need a list to select

formal goblet
#

You can use the Dynamic Table option if you use the parent. prefix for the Dynamic table key. Otherwise the setup remains the same.

verbal portal
#

I will try ... Thanks so much

verbal portal
#

Nope still not work ... It is simpler create a new custom list or there is a way to resolve it? In the readme I haven't found anything that I could get to try by myself.

formal goblet
verbal portal
#

I am trying to do this

formal goblet
#

Oh dear lord, can you provide real screenshots pls? You can use the Snipping Tool for that, that comes with every windows install.

verbal portal
#

Yes .. I feel so dumd after 20 years without coding one moment

#

I hope this one is better

formal goblet
verbal portal
#

in foreground there is the item template... zona protetta should become my drop-down. Datas are in background in _Personaggio template and the key of the dynamic is targetprotection

#

dynamic table column*

#

I have tryed also with drop down item custom but I can not figure out the associated values of the custom drop down keys into the item display in the actor template

#

I solved it. I made it easier for myself in another way, for now it's enough for me. In the future I'll try again, when I'm better. Good night everyone and thanks for the support and patience. Peace โœŒ๏ธ

minor cove
#

How can I pass a variable from js to formula? For example:

%{
let x = "key_in_parent"
let result = ${fetchFromParent(x)}$
return result
}%

I'm trying to figure out how to make the ${fetchFromParent(x)}$ run, but to no avail

formal goblet
minor cove
#

Is it possible to make it work with more than one element?
This is the code that's giving me headaches, I'm trying to be able to parse formulas like 1d10+2+X+Y (where X and Y are keys to parent's labels) into 1d10+2+3+4.

%{
const dmgParts = "${item_dmg}$".split("+")
let dmgFormula = "";
for(const i in dmgParts){
 if(dmgParts[i].includes("d") || !isNaN(dmgParts[i])) {
    dmgFormula += dmgParts[i] " + ";
 } else {
   dmgFormula += "${fetchFromParent(dmgParts[i])}$ +"
 }
}
return dmgFormula
}%
formal goblet
#

It would be easier to fetch the value directly in JS instead of via a CSB-Formula with entity.entity.parent.system.props[dmgParts[i]]

minor cove
dense verge
#

I feel like I'm so close with this one:

${

equalText(sameRow('name'), "Escape Artist") ?

setPropertyInEntity('item', lookup('state_table','state_active','name','Stuck'), item.state_active ? 'false' : 'true' ) : ' '

}$

equalText works, the lookup brings in the correct checkbox...

I am just trying to make the checkbox go from true to false in the last part and I can't seem to get it working...what am i doing wrong? Thanks

icy panther
#

try lookupRef

dense verge
#

the lookup just brings back true, I know its so close haha

icy panther
#

here's my checkbox updater setPropertyInEntity('self', lookupRef('Dynamic_Equipment_Table', 'Mount_Medium_Weapons', 'mount_label', 'Turret Left'), true)

dense verge
#

${

equalText(sameRow('name'), "Escape Artist") ?

setPropertyInEntity('item', lookupRef('state_table','state_active','name','Stuck'), false ) : ' '

}$

this just returns false as the roll instead of updating the checkbox

icy panther
#

I just figured that issue out last night, the sheet isn't updating

#

reload the sheet and the checkbox should be false

dense verge
#

nope, it is still true

icy panther
#

then there is another issue

formal goblet
#

Try it with a minimalistic build

dense verge
formal goblet
dense verge
#

I've got another one which references only the table it is in and it is updating the checkbox, it looks like this:

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

this works fine

formal goblet
#

The former tries to update a Checkbox within a Dynamic Table, while the latter tries to update one at the top level

dense verge
#

how would i do the former with static values? Sorry I'm very much a newbie

formal goblet
#

setPropertyInEntity('item', 'state_table.0.state_active', false)

dense verge
formal goblet
formal goblet
dense verge
formal goblet
#

Which error

dense verge
#

syntax error unexpected operator

formal goblet
#

The full message

dense verge
#

Logger.js:33 Custom System Builder | Unexpected operator . (char 19) SyntaxError: Unexpected operator . (char 19)

formal goblet
#

You used whitespace. Probably somewhere between the dots or around it. You're not allowed to do that

dense verge
formal goblet
dense verge
#

yes just looked and it is saying that error is for that code

formal goblet
formal goblet
#

Expand the props and look the path up

formal goblet
#

Wait a sec, do you try to change the content of a Label with setProp?

#

Yeah, you do

dense verge
formal goblet
#

You have to change the state of the Checkbox of the actual Item

dense verge
#

I see, yes the checkbox is in the item, so my original code was only changing the checkbox label to false and not the actual checkbox...

I did try item.state_active ? 'false' : 'true'

and that only returns true

is it possible to reference the actual item itself in setProp?

formal goblet
dense verge
#

or only within that actor sheet?

formal goblet
dense verge
formal goblet
dense verge
formal goblet
#

Is the Component key of the Checkbox correct?

dense verge
#

yes component key is state_active

formal goblet
#

Try in the console fromUuidSync('uuid').system.props and prove that

formal goblet
dense verge
#

Apologies, the UUID inside of the character sheet will be unique as well which is where I got confused. Is there a way to automatically reference a UUID in setValues

#

I can use find for that maybe?

formal goblet
formal goblet
dense verge
#

so the new code:

${

equalText(sameRow('name'), "Escape Artist") ?

setValues(find('state_table','uuid', 'name','Stuck'), 'state_active', false) : ''

}$

now returns: Stuck => {"state_active":false:} in the roll

the console seems to have a problem with the label text as pictured

dense verge
#

I'm using this in the label text, just to make it a square checkbox which is green and red which works ok, this is conflicting with the set values?

<i class="fa-regular fa-${item.state_active ? 'square-check' : A'square'}$" style="color: ${item.state_active ? 'green' : 'red'}$; background-color: white;"></i>

formal goblet
#

The A is the issue

dense verge
#

It still only returns Stuck = > {"state_active":false}

#

no errors in the console though

formal goblet
dense verge
marble mural
#

I'm back with another weird one. Console not showing any errors. I'm trying to get a value in a Dynamic table (adice) to be reduced by 1 for each 6 rolled in a pool of d6s. Instead, it is zeroing out the value on any combined result of 6. I don't know if what I'm trying to do is even possible with a pool, I may just have to limit it to rolling 1 die at a time for the check. Here is what I have for the roll message:

?{armorroll:"Armor Dice"[number]}
)}$

<p style="font-family:'Title';font-size:30px;text-align:center">Armor Roll</p>

<p style="font-size:30px;text-align:center;weight:bold">${result:=[:armorroll:d6]}$</p>

${#result==6?setPropertyInEntity('self', lookupRef('armors','adice'), "min(first(lookup('armors','adice')) - 1, 0)"):0}$```
marble mural
#

Side note, can someone help me with this dice code? I'm trying to get it to roll 1d6 that explodes on 6s (with no limit) but also rerolls 1s (no limit). I can them both to work, but which ever is first only works once, in this case the exploding 6. If it rolls a 1 and then rerolls, it will continue to reroll ones but will no longer explode on a sixe. If I put the rr1 bit first, it will reroll 1s as normal, but if it rolls a 6 it will explode (as it should) but then if it rolls a 1 it will not reroll. Not sure what I'm doing wrong (or if I can make it work).

[1d6x6${equalText(edge,'Knack (Melee)')?'rr1':''}$]

icy panther
#

x=1 to explode 1's

marble mural
# icy panther [1d6x=1x=6]

Sorry I may have misspoke. I want the 1s to be rerolled (and thus replaced) not to explode, and that is working, though as I said only until the next argument happens.

icy panther
#

the cs>0 was just so I can roll a lot quickly and look for a min of 4 dice rolled

#

you just want the final result right? which would be 3

marble mural
# icy panther right

Ones should be rerolled and not counted, hence the rr rather than x. But the problem remains that if I have rr1x6, it will reroll ones (as it should) until it rolls a six (which will explode as it should) but then it will no longer reroll ones.

icy panther
#

or you want the 6 and 3?

marble mural
#

And no, I am still looking for the total of the roll.

icy panther
#

including the 1's?

marble mural
#

No, 1s are rerolled and not counted (hence the rr)

icy panther
#

tricky

marble mural
#

Agreed. As I said the formula I presented works, except one argument seems to supercede the other, in order, and I don't know how to make them both work without one superceding the other.

icy panther
icy panther
# marble mural Agreed. As I said the formula I presented works, except one argument seems to su...

heres the working code

(async () => {
    // Number of d6 dice to roll
    const numDice = 1;  // Change this as needed

    let rolls = [];
    let explosionQueue = Array(numDice).fill(0); // Queue to track exploding dice

    while (explosionQueue.length > 0) {
        let roll = new Roll(`${explosionQueue.length}d6`);
        await roll.evaluate();

        let results = roll.dice[0].results.map(r => r.result);
        rolls.push(...results);

        // Find exploding dice (1s and 6s)
        explosionQueue = results.filter(r => r === 1 || r === 6);
    }

    // Remove 1s from final sum
    let successfulRolls = rolls.filter(r => r > 1);
    let totalSuccess = successfulRolls.reduce((sum, r) => sum + r, 0);

    // Prepare a chat message with results
    let messageContent = `
        :game_die: <strong>Rolling ${numDice}d6 (Exploding on 1s & 6s)</strong><br>
        Rolls: ${rolls.join(", ")}<br>
        :white_check_mark: Successes ( > 1 ): ${successfulRolls.join(", ")}<br>
        :fire: <strong>Total Success Value: ${totalSuccess}</strong>
    `;

    // Send message to chat
    ChatMessage.create({
        content: messageContent,
        speaker: ChatMessage.getSpeaker(),
    });
})();
}%```
marble mural
#

Is the only way tp do it in a macro? I was hoping to make it native to a sheet in a label chat message.

rapid hare
#

Hello, I return with a question: Is CSB able to read Conditions from Triggler/Condition Lab and use them? I created a Condition using CL called "Strength", which is supposed to give players an option to increase damage by 50%. I made their weapons have a +50% damage button, but I want it to be only visible if the Strength condition is present. Is there a way to do it, or is CSB unable to see these conditions?

icy panther
vocal pagoda
#

Is there a way of adding items from the item tab to an item displayer automaticaly with scripts?

vocal pagoda
#

i managed!

#

They're all stored locally so just a matter of pulling them

#

now i'm getting an error related to "Uncomputable token"

slow oyster
#

I'm translating 3:16 Carnage to CSB. It has weapons with damage that change based on distance (Near, Close, Far).

Is there anyway to populate an Item Displayer with those values from an equipable item?

manic crypt
slow oyster
#

I'd love for it to show all 3 ranges, and display the corresponding values in the item sheet.

So, on the Item Displayer is it possible to show "Close" "Near" "Far"
But have the information populated byt the equippable item sheet?

I don't know if I asking this well๐Ÿ˜…

manic crypt
#

You can set up a label on the item displayed that calls the key from the item.

#

Use ${item.<your key>}$ as the label

#

Replace <your key> with the key for the dropdown on the item.

fair yoke
#

OK so not sure what I am doing wrong here, I want to roll 2d6 vs a target number that is a defined variable

#

${[!2d6>:BLDSV:]}$

icy panther
fair yoke
#

if foundry can count successes but doesn't have the simple functionality of comparing both dice added together to a target number, I'm going to be annoyed.

#

I'd rather not play fun and games with macros again

fair yoke
#

I mean battletech system rolling, 2d6, add them, compare to target number

icy panther
fair yoke
#

so yes

icy panther
#

I am unaware of a way to do what you want without using JS

formal goblet
fair yoke
#

excellent, thank you

#

just modified it to !2d6 so I get the individual dice results too

#

this saves me allot of frustration

#

also made it >=

ancient temple
#

Hi there! i'm back, still trying to port a system over to foundry using CSB lol so right now i have what might seem like a complex situation: currently I am attempting to get the character sheet to calculate bonuses received by what the equivalent of feats are to the system. For example: if the player marks their sheet as having the feat [Accelerate], their movement should get a +1. What I was thinking is having a drop down window where they can chose to grab the feat but i dont know how to proceed to have the dropdown window values be used to apply to their character's stats.

formal goblet
ancient temple
ancient temple
#

well, if thats the only way then thats the only way

formal goblet
#

It's not the only way, but probably the most feasable one

ancient temple
#

is there a way for me to edit a dynamic table's values from the template?

formal goblet
ancient temple
#

what are input components?

formal goblet
grave inlet
#

I saw a note saying the system doesn't/can't use compendiums. Is this going to be fixed in the future? I heavily use compendiums for my games and they use less space than in-world items.

formal goblet
ancient temple
#

okay so sorry if this seems like a silly question, but im trying to read through the gitlab documention and i do not understand the wording on some of the parts. for example, for the dynamic table it says "The +-button in the body of the table is used to create predefined lines. These lines will get added to the characters synchronized with the template. Each field can be filled with predefined data, which will be editable later by the players." Which pre defined data and from where?

grave inlet
#

K... bummer. Compendiums are so clutch. TY

formal goblet
ancient temple
#

okay, what about on the player's character sheet? when they add a line they arent able to add anything to the dynamic table

formal goblet
slow oyster
#

This is an item displayer, the data under "Close" and "Near" is being populated from the item sheet, which is perfect. But, I cannot figure out how to get it to roll when clicking the dice notation.

formal goblet
slow oyster
formal goblet
slow oyster
#

On the item sheet you mean?

formal goblet
#

In the Item Displayer

slow oyster
formal goblet
slow oyster
#

nearBasicDropdown is the dropdown menu that holds the dice notation.

#

Hot diggity damn, thank you.

verbal portal
#

Hello It Is me... If I have two dynamic table with the same Rows and I want to show inside the rows of the A) column (label) the text I wrote in the B) dynamic table?

I tried with the sameRow(lookup('tableBkey','columnBname')

And show me ALL the B column list in each A column field instead the list distributed row by row...

formal goblet
verbal portal
#

.. I would copy the intere list form a column of a dyn.table and show it to another...

formal goblet
verbal portal
#

and it works but not as I want lol

formal goblet
verbal portal
#

like if I have A) column with 1 2 3 .... 7 rows in a dyn.table and I want to fill it with the 7 things wrote row by row in the column of a B) table...

formal goblet
verbal portal
#

yes

formal goblet
#

And what about the case, where the size isn't equal?

verbal portal
#

with size you mean rows ? or all the structure?

formal goblet
#

The count of the rows

verbal portal
#

yes is the same

formal goblet
#

Is it guaranteed to be the same size?

#

E.g. players are not allowed to add or delete rows

verbal portal
#

yes I setted now

#

there were some differences but the problem remains

formal goblet
#

${lookup('DynamicTable', 'column', '$predefinedIdx', sameRowIndex())}$

verbal portal
#

empty .. in console it give logger js 33

formal goblet
#

Otherwise try out ${ref(concat('dynamicTable.', sameRowIndex(), '.columnKey'))}$

verbal portal
#

I tried sometimes and I have my result with this o.O

${ref(concat('ArmorTarget.', sameRowIndex()+7,'.HitArmorTarget'))}$

I had some fields empty and I tried like this to have my table filled

#

thanks so much as always

white hatch
#

Where I can see supported languages? Hope there are some improvments about it. Wanna check

white hatch
final mural
#

i have a bunch of tokens/actors that have undefined in place of several values that are used in the sheet to display currency and it causes a lot of errors to appear every time i reload the sheets after changes
can i somehow use the "Scene.epovfpnsCVTtMaSC.Token.Lm0wTtCoTjAW1yrr.Actor.LQfGhq92WVeWRIXQ" to set the values for the token/actor? i already have a script for changing stats and know the paths that need changing so adjusting the script to force all non numbers to 0 shouldn't be too difficult if i can figure out howto target the right thing

#

there are around 200 errors, ~10 per actor/token on every reload

final mural
#

either doesn't do what i need or i'm using it wrong

white hatch
#

Are there any video guide I can watch to understand how CSB works?

formal goblet
final mural
#

is there any way to force all tokens made from one actor to reload?

#

i have fixed the actors but there are bunch of guards that i would need to find andreloal manually to get them to stop errors

white hatch
white hatch
formal goblet
# white hatch One more question - what colors in that coding means? I guess some color you nee...

Syntax highlighting is a feature of text editors that is used for programming, scripting, or markup languages, such as HTML. The feature displays text, especially source code, in different colours and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup lan...

formal goblet
final mural
#

actor is not defined
can i please get more detiled instructions, i dont know foundry well

summer turtle
#

Is there a way to pull what elements have a certain key? I'm being told I can't use a key because I've already used it when as far as I'm aware this isn't the case

verbal portal
#

Hello there how are today?

${#A:=number(sum(lookup('ArmiCorpoACorpo','PesoArmaCAC')))}$${#B:=number(sum(lookup('ArmiAPortata','ADFPeso')))}$${A+B}$

I tried to hide in label (i saw I can declare only in chat message some local var) but there is a way to do it in a label without write the partial somewhere else ?

#

i tried also with html <div display:none (or block)> ...${A...}$....${B...}$ .... </div> but I only messed the thing XD

verbal portal
#

PROBLEM SOLVED: this way ${concat(sum(${A:=number(sum(lookup('ArmiCorpoACorpo','PesoArmaCAC')))}$,${B:=number(sum(lookup('ArmiAPortata','ADFPeso')))}$))}$

formal goblet
verbal portal
#

I tried but it gives me error...mmm one sec I try again with your formula

#

now it works..... maybe I wrote something wrong before

#

Thanks you so much

silver lake
#

Okay

#

I have a really big issue

#

and a session tomorrow.

#

I have updated from 3.0.0 a few weeks ago.

#

And the exported template from 3.0.0 does not import correctly into 4.4.2

#

And I don't mean the lookup changes and so forth

#

I have both of the versions of the system open here, and I'm going to show the problem since it's a bit hard to explain:

#

export imported onto v3.0.0:

#

This is correct

#

The problem is the two tabs. Debate and Combat

#

Where here they are separate things, as they should

#

This is in 4.4.2

#

In this version, it duplicates the Combat Tab over the Debate tab

#

but not only that, it duplicates the tabs within it.

#

Instead of deck1 2 and 3

#

we have deck3 deck2 and deck3

#

which will scramble all information

#

that was stored within those tabs too

formal goblet
silver lake
#

they've been duplicated

#

when exported into 4.4.2

#

so they have everything the same

#

which causes loads of errors

#

but exporting the same json of a template into 3.0.0, it exports correctly

formal goblet
#

I mean in the original version

silver lake
#

with the different tabs and different keys

formal goblet
#

Then try to rename the key of the Tab to something else. Maybe that helps

silver lake
#

All different keys, was just checking again to be sure

#

okay, I'll try

#

Same problem

#

re-keyed all tabs

formal goblet
silver lake
#

yes

formal goblet
#

huh...

silver lake
#

same name with a 2 in the end

#

super confusing

#

I looked at the json

#

and it does have two "CombatTab" keys in it

#

but it also has the "DebateTab"

formal goblet
#

How about increasing the version gradually instead of making such a huge jump? Or you fix the JSON manually and reimport that

silver lake
#

but all I did was 'find and replace' all of the specific changes.

#

like 'lookup' and such

#

and it worked for the other system

#

cause I had two

#

well, two that I migrated

#

very different systems, but the other one had absolutely no problems

#

this one on the other hand

#

I migrated it as well, and didn't worry cause I had already prepared the whole session before-hand

#

only to check now and see that all of the data is broken due to the key-duplication

silver lake
# silver lake

This Json I sent you here though is not fixed, cause I was trying to export again to test it.

#

So this is the fresh exported, working version

#

that only needs some of those find-and-replace

#

however, both have the same issue in 4.4.2

silver lake
#

first

#

Very interesting

#

I just tried to update it to 3.2.5

#

from 3.0.0

#

and already in 3.0.0 it already has the same issue

#

only when exported into 3.0.0 it exports correctly.

vocal sorrel
#

Hi everyone,
I am working on a project that involves a lot of "item-interaction", which means there will be a lot of items on the sheet. Do you all have any advice on how to handle items and such in a way which doesn't slow the game engine to a crawl? Particularly, if there are any work-arounds to having attached items at all, but still able to use "item-presets" or possibly way to somehow "un-attach" the item from the character sheet, but keep a reference to it so that it can be added back with a single click?
I'd love to hear your ideas and suggestions, because I am currently at my wit's end :D
Thanks in advance!

ancient temple
#

is there a way to make it so that when a player clicks a rollable button on the character sheet, a prompt shows up saying something along the lines of "any additional bonuses?" and then the prompt allows the player to input a number and add that number to the roll?

silver lake
#

I'm trying so hard to figure this out in time to rest before the session tomorrow

ancient temple
#

how do i use the lookup function in CSB? do i just type the code in the label text area of a component?

silver lake
# ancient temple how do i use the lookup function in CSB? do i just type the code in the label te...

I am rushing to troubleshoot something here so my brain is faltering for anything else, but I thought maybe this roll that has lookup in it might help you learn about it a bit:

${#concat(string(?{Act:'Actions?'[number]|(sameRow('ACost'))}), string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}), string(?{method:'METHOD/DETRIMENT?'[number]|0}), (?{Sphere:'Spheres?'[number]|0}), (?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$

${sameRow('ACN')}$

Roll

${RollResult:= [:Roll:]}$

Aspect

${#Aspect:= ref(AspectLocked)}$ ${#AspectDice:= equalText(Energy, 'CNothing') ? 0 : 1}$ ${AD:= [:AspectDice:d:Aspect:]}$

Method

${method}$ = DC-${method*5}$

TOTAL

${(floor((RollResult) + (((lookup('SkillList', 'SLevel', 'Skill', sameRow('ACS')))/10)*2))) + (floor(((ref(sameRow('ACCS')))/10)*2)) + (AD)}$

DC

${(sameRow('GT1GM')) - (Sphere*5) - (method*5)}$

Cost

AP

${Act}$ used out of ${setPropertyInEntity('self', 'Actions', Actions - Act)}$

${Energy}$

${setPropertyInEntity('self', Energy, "equalText(Energy, 'None') ? ref(Energy) : ref(Energy) - 1")}$

${sameRow('ACO')}$ย 

- ${Sphere}$ = ${setPropertyInEntity('self', (lookupRef('OddityTable', 'CSpheres', 'OddityName', sameRow('ACO'))), "first(lookup('OddityTable', 'CSpheres', 'OddityName', sameRow('ACO')), 0) - Sphere")}$

${CharName}$

${CharSurname}$
silver lake
#

I don't remember

#

I made this so long ago

ancient temple
#

lmao thank you still

silver lake
#

the # makes it so that that part of the roll in-chat

#

concat I believe is used for when you have both strings and not-strings in the thing

#

but don't quote me on that last one

silver lake
#

I have a system import issue here and a session with it tomorrow, and I'm so damned xD

ancient temple
#

what im trying to do is make a hidden dynamic table on the character sheet, and then reference it into a label that becomes visible when stat thresholds are met

silver lake
ancient temple
#

right

silver lake
#

In case there's any info there that helps you

ancient temple
#

do you happen to remember how the sameRow works? does it use whatever value you set in that row?

silver lake
ancient temple
#

this is gonna sound super silly since i know how to set the variable name for a column but how can that be done for a row?

silver lake
#

so, a label referring to a number field in the same row of its dynamic table needs not only to point to ${NumberFieldInQuestion}$, but ${sameRow('NumberFieldInQuestion')}$

silver lake
#

Each row does not have its own key, necessarily, but they can be referred to in dropdowns that specify table, column and row.

ancient temple
#

okay thats what i mean is can a key be applied to each row

silver lake
#

So that you can select a row from a dynamic table in a dropdown and then reference it. This is what happens in that roll over there. it's referencing a dropdown

silver lake
#

I'm not great at explaining this stuff, cause I'm dumb when it comes to it. But lemme add some visual representation to what I mean:

#

Then in the refernce in the roll I did this part:
first(lookup('OddityTable', 'CSpheres', 'OddityName', sameRow('ACO')), 0)

#

This was part of the automatic spendature, so I don't think you need first

#

lookup('OddityTable', 'CSpheres', 'OddityName', sameRow('ACO'))

#

This is what the table looks like:

#

The purpose here was to have the dropdown in the dynamic table, indicate a specific tab in the other dynamic table, so that when I roll it, it automatically deducts a number of points from CSpheres in that other dynamic table.

ancient temple
#

okay thats really awesome

formal goblet
silver lake
silver lake
#

oh wait

#

you mean as in

#

hmmm

#

I think I understand

#

being that the only parts that broke are Debate and Combat

#

I only have to export everything but that, then try to export just debate and combat separately, then just drag and drop the windows

#

but

#

I don't really know how to export just the debate and combat.

formal goblet
#

Create a new Template and export that

#

You just create multiple small Templates, export them all and merge them together afterwards

silver lake
formal goblet
#

You don't even have to go into the JSON. Just create a new Template and drag the content of the Tab in there

silver lake
#

Yeah, no issue

#

done.

#

Except for combat and debate

formal goblet
#

These can be carried over in separate Templates

ancient temple
#

is there a way to hide these lines from the right sheet? i have the values set to hide the text unless certain stat thresholds are reached, the left sheet being the template showing everything

silver lake
#

That one doesn't even export

#

neither does the deck1 tab

#

they get replaced by combat

formal goblet
silver lake
#

I'm dumb

#

yeah

#

that was a great idea

#

I'mma go to 3.0.0 and export just the working tabs

#

awesome, one moment

wraith topaz
#

Hello everyone, I have a problem when using the Custom System. I have already created the value_max_hp (where the character's maximum hp is calculated) and his current HP (represented by def_hp), both are recognized in the token's attribute bar, but I cannot edit the Current HP value (def_hp) on the token even when typing or trying to use macros, only if I go to the character's sheet and adjust the value there and update it. Could someone help me please? I'm trying very hard to learn how to make my own RPG system.

north quail
#

Hello @formal goblet and @brittle moth .
I have worked on the Nightrprowler 1ed (old french RPG) character sheet for a while and here is the latest version I made.
I would gladly give it to the project ๐Ÿ™‚
Thanks for your work !

fringe silo
#

so you cant alter values on targets you dont have control of but can you ref them

grand obsidian
#

Hello everyone. I'm working on my Supers! Revised Edition system for CSS and I have a small issue maybe related to my non-coding skills ^^ . I have a Mooks/Henchmen template who need to have an Initiative score equal to my RATING key and when the Mooks/Henchmen rating decrease, if I refresh the Mooks henchmen, the decrease should be the same

#

Now you can see a group of Mooks I created. At default the initiative value is at the same level as the rating

#

Let's say now I decrease the Rating to 1 and I refresh

#

The Initiative stays at 3 and I don't know what's wrong with the following formulae

#

Maximal value is ${:RATING:}$

#

Default value is also ${:RATING:}$

#

and Minimal is set ร  0 but I suppose I could let it blank

#

Can someone point me towards the right direction ? ๐Ÿ™‚

formal goblet
#

And once a value is set in an Input Component, it will not change automatically.

wraith topaz
#

@formal goblet @fringe silo Thanks for the help, I swear I'm trying to understand exactly what you're explaining to me. But I still haven't been able to understand the error exactly, from what I saw I should use the use number fields with max-values โ€‹โ€‹instead to be able to edit the hp value, but from what I saw I had already done this from the prints I sent both fields are Number Field and in Current Hp (def_hp) I put the maximum value ${ref('valor_hp_max')}$ (referencing the maximum Hp). I didn't understand, where did I go wrong?

formal goblet
wraith topaz
formal goblet
wraith topaz
formal goblet
#

Because these are all read-only

#

As soon as you define a number field with a max-value, the system creates one

wraith topaz
#

I think I understood, I followed the steps below:
1 - I deleted the attribute bars.
2 - In the Current HP, I left the component key: def_hp, the component type: Number Field and Maximum value: ref('max_hp_value').
3 - In the Maximum HP, I left the component key: max_hp_value, the component type: Number Field.
Did I do everything right up to this point?

formal goblet
#

You can also change ref('valor_max_hp') to valor_max_hp, but that's optional

wraith topaz
#

@formal goblet Great, it worked, my mistake was forgetting to use ${}$, both in ${max_hp_value}$ and ${def_hp}$. Thank you very much, now I'm going to try to find a way to make a macro to add and remove the hp value.

umbral wraith
#

Hello. I'm working on using CSB to create a setup for my party for the Iron Kingdoms RPG, figured I should ask here first: has anyone set up any templates for Iron Kingdoms before?

mighty laurel
#

Hi all I did a quick look at this thing and well got confused and confounded by it would really like help with putting together a system for Prowlers and Paragons if possible if Anyone would be interested in helping me out that would be great right now I am using a macro and PDF character sheets. But would like a custom system I could share with others. Thanx to any that would like to help.

summer turtle
#

I'm having an odd issue since updating to the latest version of of CSB, I can't make any text I add since have any alignment other than centre unless I edit it in the html editor. Has something changed that might cause this?
(Edit: This seems to be restricted to tables and bullet points (never mind, it's only SOME entries that it's doing this on...))

#

I also used to be able to add an indent to paragraphs (I just pressed space a few times, that seemed to be the only way) but now I have to copy and paste one from before the update, otherwise it'll be removed automatically.

dire socket
#

I'm trying everyhting, even just putting the key, it's been a while. What am I doing wrong?

summer turtle
#

(Edit: This seems to be restricted to tables and bullet points (never mind, it's only SOME entries that it's doing this on...))
Okay so it's still inconsistent which text boxes this happens with, but this is only an issue with Left and Centre alignment, Right and Justify seem to work correctly? This is very odd, and is making adding new entries a pain I will admit.

dire socket
#

Thank you thought I tried that whoops

summer turtle
#

Oh fun, Headings don't work this way, only paragraph text. This is a such a weird issue

formal goblet
summer turtle
#

Fair enough, what are we supposed to use/do instead now?

formal goblet
#

Dunno to be fair, I haven't really used the new one and I don't have an insight there, which behaviour should be intended and which not

summer turtle
#

So this might be a bug on Foundry's end then?

#

I would assume Left alignmet acting as Centre is not intended lol

shy stag
#

i seem to be misunderstanding how filters work, im trying to make it so this item display only shows items with the equipped1 checkbox checked, but its clearly not working becuase its not checked and its still there.

formal goblet
summer turtle
#

Yeah Justify actually aligns Left now and Left doesn't do anything

shy stag
#

im trying to figure out how to make this weapons stats be a referenceable number on the character sheet. not really sure what im doing wrong but this becomes litterally nothing on the character sheet

shy stag
#

still doenst show anything

formal goblet
#

What do you want to show from the Item?

shy stag
#

i just want its might stat to be a referenceable value from the item display

formal goblet
shy stag
#

like outside the display

formal goblet
shy stag
#

lookup is what im using though

formal goblet
shy stag
#

i mean heres the whole template not sure what else i can give you, as you can see the actual character sheet just has nothing there

#

and yes i reloaded it

formal goblet
shy stag
#

nvm im so stupid i renamed the item display table im sorry

spiral dome
#

Anyone has any tips on managing multiple worlds with the same system I build? I have two player groups that play the same system I build (they do not share a story). The world I build has the expected issues of a first build by a new builder :D, so I often have to make changes. It would save me a lot of time if I don't have to make every change twice.

formal goblet
verbal portal
#

Where can I find out the way to target a token (or multiple tokens like AoE effect) and interact with their keys/fields values like hp and the other things?

#

Good evening everyone ๐Ÿ’•

formal goblet
verbal portal
#

Oh ok... right. For example: on a good roll to hit in a fight, I throw dies damages with a label button from my actors/foes templates

marble mural
#

Anyone know if there is a way to make a dialog popup conditional?

${sameRow('explosive')==true?#concat(?#{npcdmgmods}):''}$

This is wrong, but hopefully it gets across what I'm trying to do.

formal goblet
formal goblet
verbal portal
marble mural
verbal portal
#

I am trying to automate the management of some labels/numeric fields... And as always I am very thankful for all the support

formal goblet
#

This process can only be automated with Javascript

verbal portal
#

But It will be possible with some row of coding inside the template with the %{}% or I have to add somewhere else inside some file of the CSB folder?

marble mural
#

Nice, got it working, thanks @formal goblet


${#pool:=${!sameRow('explosive')?ceil(sameRow('dice')*(short==true?'0.75':(medium==true?'0.5':(long==true?'0.25':'1'))))+(door==true?'-1':'0')+(slit==true?'-1':'0')+(enclosed==true?'1':'0')+(vacuum==true?'1':'0'):sameRow('dice')}$}$

<p style="font-family:'Title';font-size:24px;text-align:center">${sameRow('atk')}$</p>

<p style="font-size:24px;text-align:center;font-weight:bold">${roll:=([:pool:d6]+sameRow('pips'))}$ Damage</p>

<p style="font-size:14px;text-align:left;font-weight:bold">STR Roll > ${roll}$ target is Stunned<br>STR Roll โ‰ค ${roll}$ target is Wounded<br>STR Roll โ‰ค ${floor(roll/2)}$ target is Incapacitated<br>STR Roll โ‰ค ${floor(roll/3)}$ target is Mortally Wounded</p>```
formal goblet
verbal portal
#

Thanks Martin my question was just to know if it was possible. When will I get there, at that point, I will decide what to do. ๐Ÿ™

formal goblet
brittle moth
drowsy rune
#

Hey, maybe someone can point me in the right direction.

I have a template ready and have assigned it an avatar and a prototype token, however when I create a new character and I select my template once the character is created, the default token and avatar don't match.

Is there a way to switch to the template with the chosen avatar / token ?

formal goblet
drowsy rune
#

Oh

formal goblet
#

Wait, did I post in the wrong channel? whoops

ancient temple
#

is there a way to allow negative numbers in the number field?

ancient temple
#

nvm, its letting me go into negatives now

slow oyster
#

Hi all! I'm trying to figure out how to get a label to use a rollable table. I figured it would probably be a macro, but I wasn't sure how to then have the label activate the macro.

rocky sable
#

Hello. I'd like to add a Condition to an Item ('Test') which would apply a modifier to a weapon item displayed in an Item Displayer component.
I have the uuid of the weapon, which is stored in a field in the modifying Item, as attached (the Text Field containing the uuid has the key 'target').
How would I code a Condition to modify the attack % of the weapon corresponding to that uuid displayed in the item Displayer which has the key 'weapons'?
Is it even possible?

timid marten
#

Hi!

Can you get a dropdown's label and if so, how?

Right now I have a dropdown called "rarity" which goes like this:

#

If I create a label and I add inside it the following line:
${rarity}$

It will show the key and not the label

formal goblet
timid marten
#

Is there a way to get the label instead?

formal goblet
#

No

timid marten
#

Alright, thank you :(

formal goblet
#

Label is literally just for display, nothing else

formal goblet
formal goblet
# slow oyster Hi all! I'm trying to figure out how to get a label to use a rollable table. I f...
You can also use Roll Tables, using the syntax [#<rollTableName>]. Just put a # before your roll table name, inside brackets, and the system will roll its default formula and integrate the result in the message.

You can customize the Roll Table formula by adding a Roll formula in this syntax: [#<rollTableName>|<rollFormula>]. The formula must follow roll formula syntax, with :: to delimit the keys. This formula can be a Dice roll or a constant value, the latter will always draw the same result from the Roll Table.

https://gitlab.com/custom-system-builder/custom-system-builder/#46-add-rolls

timid marten
#

Is it possible to chain a query inside a query?

For example:

${blue == 1 ? ${yellow == 1 ? 'green' : 'blue'}$ : 'white'}$

slow oyster
sinful spade
sinful spade
timid marten
sinful spade
#

also i've found it far more readable if you

${ dropdownVal == 2 ? 'yellow' : ''}$```
sinful spade
timid marten
sinful spade
#

bc its gonna be
dropdownKey == 1 ? 'label1' : (dropdownKey == 2 ? 'label2' : (...

timid marten
#

it's fine, I just need an example on how I should type it

#

just do label1 label2 etc

sinful spade
#

i just gave you one?

#

if your key values are 1 2 3 4...

#

and you want their labewls label1 label2...

timid marten
# sinful spade and you want their labewls label1 label2...

so this?

${%{return game.user.role >= CONST.USER_ROLES.TRUSTED}% ? (item.rarity_choice == :star: ? '1:star:' : item.rarity_choice == :star::star: ? '2:star:' : item.rarity_choice == :star::star::star: ? '3:star:' : item.rarity_choice == :star::star::star::star: ? '4:star:' : '5:star:') : '???'}$

#

(looks better on my notepad)

#

or should I add a "(" for each rarity level?

sinful spade
#

idk if you can :star::star::star: since it may confuse csb logic of : else

#

how are you calling the star in csb?

#

and yes, yo uneed a ( for each new logic
cond ? if : ( cond ? if : else

formal goblet
timid marten
timid marten
formal goblet
timid marten
# formal goblet `${blue == 1 ? (yellow == 1 ? 'green' : 'blue') : 'white'}$`

I tried this and it returns an error
${%{return game.user.role >= CONST.USER_ROLES.TRUSTED}% ? (item.rarity_choice == :star: ? '1:star:' : item.rarity_choice == :star::star: ? '2:star:' : item.rarity_choice == :star::star::star: ? '3:star:' : item.rarity_choice == :star::star::star::star: ? '4:star:' : '5:star:') : '???'}$

#

should I redo the () for each iteration instead?

formal goblet
timid marten
#

it's not a star on my code side

#

it's just discord trying to convert it

formal goblet
#

Use equalText() instead of ==. == only works for numeric comparisions.

timid marten
#

oh right, it's a string

#

so uhm

#

item.rarity_choice == โญ

becomes

item.rarity_choice.equalText('โญ')

#

right ?

formal goblet
#

Or even switchCase(), which should be more comfortable for this example

timid marten
#

could you provide an example on how to use switchCase please?

#

I never used this

formal goblet
#

There are examples for each function

timid marten
#

on the gitlab?

formal goblet
#

Yeah

timid marten
#

nice

#

time to read

#

I tried this:
${%{return game.user.role >= CONST.USER_ROLES.TRUSTED}% ? switchCase(item.rarity_choice, ':star:', '1:star:', ':star::star:', '2:star:', ':star::star::star:', '3:star:', ':star::star::star::star:', '4:star:', '5:star:') : '???'}$

but it still returns an error

timid marten
#

nevermind I forgot a '

#

I'm dumb

#

works flawlessly

#

thank you so much!!

timid marten
#

Can we return the number of items stored inside an item or a character?

#

Like for example let's say I have a backpack with 2 swords inside a "weapon" item displayer and 1 apple inside a "food" item displayer

Inside the player's backpack item displayer labels, can I create a label called "items" and return the number of items stored inside the backpack? (which should be 3 in this case)

#

and if so, how?

#

all my items have a "quantity" value so I would just need to cumulate all the "quantity" value of each items inside the backpack's item displayers

#

I thought of a lookup for all item displayers one by one but that sounds tedious

formal goblet
timid marten
#

I created a label and set its label text as this:

%{
return entity.items
  .map(item => Number(item.system.props.Quantity))
  .reduce((acc, Quantity) => acc + Quantity);
}%
#

But it returns "NaN"

formal goblet
timid marten
#

fixed it

#

thank you!

timid marten
#

I found a bug with Item Piles:

If I create an item called "Backpack" and add items inside its Item Displayer, and then drop the backpack on the ground, the backpack item inside the item pile will have no items stored inside and they will be lost forever

austere lantern
#

is there a way to reference a choice in a roll message?

#

I have this

${#concat(
  ?{checkdifficulty: "Check Difficulty"[number]},
  ?{statchoice:'Which Stat'|MEstat,"Mind"|BEstat,"Body"|CEstat,"Community"}
)}$

and I what to display which stat a user chose in a roll message.

#

want*

austere lantern
#

for the sake of referencing rolls

elfin laurel
#

Trying to use the max() formula. It works fine on it's own, but when I try to assign it and call it later, it tells me that it can't calculate and the token is un-computable.

So this:

#

Works on it's own, if I don't reference KitBonus anywhere else.

#

But if I try to use it later, like this:

#

I get these errors

#

Thoughts why it works and then doesn't?

normal jolt
#

Is it possible to change the color of certain metes but not others? Not sure if there is a built in CSS class for it, to take advantage of that idea.

silver lake
#

So, I have a label in an ItemDisplay that is a button to roll from a label inside an item. The way I went about it was simply ${[item.Roll]}$, Roll being the key of the label inside the item. That, however, gives me an error. How am I supposed to write this? I clearly got it wrong.

inland hawk
#

I have been working on making my own system and been working on learning this stuff. I might just be tired, but I am trying to display a value. Specifically. I am tryin to get "${floor((STR - 10) / 2)}$" to work. I have a value, it's KEY is STR, it gives me a value of -5.

The component is a text field. I tried putting the value in "Default Value", "Autocomplete Formula" and even "Visibility Formula" I've also tried making the component a number field. Is the formula wrong? Did I mess something up?

I've never done anything like this before and I'm stumped. I can't figure out what I'm doing wrong. lol...

Please help.@formal goblet

trim oxide
#

Also, I joined the discord to get help on a problem with trying to set variables with the := command, specifically when combining it with component keys E.G.,

It works with:

${DMG:=[2d10]}$

But throws up an error with:

${DMG:=[(:Equip:+:XP:)d10]}$ (which gives 2d10 normally without the := formula)

I found this out while trying to get the following to work

${DMG:=floor([(:Equip:+:XP:)d10]/fetchFromActor('target', "Unit_Cohesion"))}$

${setPropertyInEntity('target', 'Unit_Strength', "target.Unit_Strength - DMG")}$

#

The idea was to automatically deduct the Strength of a Target by the amount calculated.

${floor([(:Equip:+:XP:)d10]/fetchFromActor('target', "Unit_Cohesion")) setPropertyInEntity('target', 'Unit_Strength', "target.Unit_Strength - 1")}$

Works perfectly, except with the last line (placeholder amount to be deducted is 1 in the example)

So if there's an easier and less convoluted way of doing this without setting a := variable I'm all ears!

manic crypt
#

The :<key>: is only true in a roll formula, not in label formulas.

trim oxide
#

Ah I see, I stand corrected!

manic crypt
trim oxide
#

I got the following working for my use case and it does exactly what I want it to do:

%{localVars.damage = ${floor([(:Equip:+:XP:)d10]/fetchFromActor('target', "Unit_Cohesion"))}$; return localVars.damage}% ${setPropertyInEntity('target', 'Unit_Strength', "target.Unit_Strength - %{return localVars.damage }%")}$

But the problem now is that doesn't display how the damage was calculated

manic crypt
#

Output on my test character:

manic crypt
manic crypt
#

So stuff like stat reductions and automatic damage application won't work unless you give players ownership.

#

If it's a GM-only button, then you're good. Just trying to forestall a bunch of work that you might put in that works fine for the GM only to have it break as soon as a player tries to use it.

trim oxide
#

That's really helpful, appreciated.

So how would I go about working towards automating combat for players, AKA like MQoL but for my custom systerm?
Or does it look like it's something that steer away from in CSB?

manic crypt
#

I personally mounted tracking damage as "Something I'll have to do" for a CSB game.

#

As a personal opinion only, I prefer that. We're simulating the tabletop experience in Foundry, not a video game. Not a condemnation of using those tools, just a personal preference.

pastel sluice
#

label

inland hawk
manic crypt
#

Just what you see in the pictures.

#

Do you mean the STRMod: part? That's typed in the Prefix field, I cut that out, sorry.

inland hawk
manic crypt
#

Yes, the STR field is a number field, that's what's shown in the first picture's config menu. I didn't bother with a default value, but I typed 10 in there.

#

I just tested it with a min, max and default value set in the number field config and it works fine.

formal goblet
manic crypt
#

Ah, yeah. I see what I didn't ask now.

manic crypt
# inland hawk Where are you putting the formula to get it to display like that?

In further explanation of it all, and what Martin was saying there, it's actually comprised of two different components, one is a number field (key STR) and the other is the label component where the calculation is done (key WillisSTRMod). So you input to STR, and then WillisSTRMod does the calculation and displays the value of the mod.

inland hawk
#

It works. I took out any spaces and no more issues. Can't remember exactly what I tried last night but I don't care cause it works now lol. Thank you

manic crypt
#

Good to hear, good luck with it!

inland hawk
#

Thanks!

formal goblet
formal goblet
formal goblet
civic finch
#

I'm trying to use the Drag Ruler module, and it's worked before but I accidentally deleted the formula for the Speed Attribute and can't seem to get it right again

formal goblet
civic finch
#

I guess? It worked just fine before, and the module is up to date with the core system, and I don't get any error notes

formal goblet
civic finch
#

I don't think that's going to work, I've tried to fix it more than 10 times. It asks for the speed Attribute and for my sheets it's "Speed_Total". Then it uses that to give walk/run/too far measurements, and I can only get it to register the too far distance

formal goblet
civic finch
#

does that help?

formal goblet
civic finch
#

aha! you're a genius! Thanks for the help ๐Ÿ˜

austere lantern
formal goblet
austere lantern
#

Thank you!

shy stag
#

was wondering if there was a way to automatically update attributes from targeted tokens on a character sheet, they pop up when i reload but i want them to just appear when a new token is targeted.

formal goblet
austere lantern
#

Does initializing a variable save the value? So if I want to do math with the MEstat could I do something like statnum:= statchoice then use switchCase for the lable and statnum for the value? Or is it just a reference?

formal goblet
dry burrow
#

Hey everyone, I hope it's okay to ask, but does anyone have a template for Prowlers & Paragons Ultimate Edition?

summer turtle
#

Quick question about formulas in number boxes, do component keys work with them? I can get, say, ${2+2}$ to work but something like ${strength+toughness}$ does not seem to.

summer turtle
#

Hmmm, not sure what I'm doing wrong then

#

Oh, if I have a key that changes value, should the number box change to reflect that? If I have a species modifier that defaults to 0 and then gets changed after the fact by adding a species item to the sheet, for instance?

formal goblet
summer turtle
#

Okay, so I take it that doesn't just apply to changing the template, but any changes at all

formal goblet
#

That's why it is called default value

summer turtle
#

Alight alight, I just interpreted it a bit differently, again I thought that applied to editing the template, not an inability to change it at all.

timid marten
formal goblet
#

Actually... @glad spade how ya doin'? ๐Ÿฑ

We've implemented nested Items in our system and I wanted to ask, how we're going to resolve it with Item Piles, because the module obviously doesn't have the knowledge to resolve that correctly for now. So creating Items into a Scene causes the Item to loose nested Items, because it doesn't resolve the references correctly.

inland hawk
#

I'm a bit stumped again. I made a table and want to grab from it. Basically, if a number in one place equals a number on this table, I want it to spit out the matching result in the other column of the table to a different label.

formal goblet
inland hawk
#

The table I am trying to grab from is a dynamic table. I have my stats in a regular table and want to grab the value of one stat, check for the matching number on the table, then spit out the result from the other column in the dynamic table to a spot on the original regular table.

Do both need to be dynamic tables or do I just need their keys for start and finish locations?

formal goblet
#

You probably want to use the find() or lookup()-function to peform searches in Dynamic Tables

inland hawk
#

I just don't know what formula to use. The following formula is the one that seemed to make sense to me, but again, brand new to this so I have no idea if this is the right one. Grabbed it from the github.

function lookupRange(
extensibleTableKey: string,
targetColumn: string,
lookupColumn: string,
value: number,
opts: {
orderBy: 'ASC' | 'DESC';
isSorted: boolean;
isInclusive: boolean;
} = {
orderBy: 'ASC',
isSorted: false,
isInclusive: true
}
): Primitive;

formal goblet
#

You can also read through the descriptions of the functions, they contain examples

glad spade
#

It depends, item piles has a way to deal with it, but it has been very 5e focused since no one has come forward with any other alternatives ๐Ÿ˜„

Here's how 5e is defined:
https://github.com/fantasycalendar/FoundryVTT-ItemPiles/blob/master/src/systems/dnd5e-4.0.0.js#L59

It's very specific and internal code to IP at the moment, but I could expose this in the API, but if everyone expects their specific CSB setup to work out of the box with different item types and different properties, that may be wishful thinking

GitHub

Contribute to fantasycalendar/FoundryVTT-ItemPiles development by creating an account on GitHub.

#

Referring to container type items, dunno why my reply @ disappeared

inland hawk
# formal goblet Depends. Do you try to do a lookup() with exact matches?

I did just try that.

lookupRange('pointstable', 'pointscosttable', 'abilityscoretable', str_points)

From my understanding, first one is the overall dynamic table. The second one is the value you're looking to gain, the third one is the value you're checking and the fourth is the destination?

formal goblet
formal goblet
inland hawk
umbral wraith
#

IDK if this has been asked already, what is the proper way to do something like adding one value from a dynamic table to another value from the same table, and then outputting to a label? Screenshot, I'm trying to add Core Stat and Skill Level and putting it into Total.

#

(my current formula that isn't working)

manic crypt
#

You don't need the math. part in csb. Sum(...) should work

umbral wraith
#

Well that does help some, it's returning 0 now instead of ERROR

manic crypt
#

Although you probably need to do a find() to return the specific values you're trying to add.

umbral wraith
manic crypt
#

You should probably take a look at the git wiki then.

umbral wraith
#

I have been but I'm struggling to interpret it

manic crypt
#

Ok, can you give me a screenshot of the table and the config for it then?

#

And then explain what you're trying to do with it?

umbral wraith
#

I'm making a list of skills in Iron Kingdoms, with number boxes for the base stat, the skill level and then a roll button that displays the final mod.

trim oxide
# formal goblet Can't tell you if you don't tell what you want to automate exactly

Thanks for the response! I've developed the system a bit more and here's what I'm trying to automate:

  1. Unit Creation. Have 2 tabs, one with radio buttons to select different Equipment that affects the number of d10s rolled and Troop Quality that affects the amount of Cohesion they have (wip but working with the help of an Update button and to change stats after picking the radio buttons)

  2. Calculating the Rolling of dice and damage done after mitigation. Xd10 damage Based on the selected Equipment. Divided by the Cohesion of THE ENEMY UNIT (works so far with fetchFromActor ('target'))

  3. Deduct the calculated damage from HP of THE ENEMY UNIT (this is the sticky part, since @manic crypt pointed out that setPropertyInEntity ('target',...) only works if a player has Ownership permissions on the target token)

manic crypt
#

do you need a hand with setting up the roll on the total column, or do you have a handle on that already?

umbral wraith
#

I think I got a handle on the roll but I'll be sure to ask if I need help, thank you very much!

umbral wraith
#

Ok so it turns out I actually do need some help with the roll command, this is recognized as a roll by the API but it doesn't return a sensible result.
${:sameRow('pc_skills_total',0):+[!2d6]}$

#

Here's a screenshot of the output

manic crypt
#

You don't need samerow on that roll, you can just use the key

#

so the format would probably be best represented by ${[2d6 + :pc_skills_total:]}$

umbral wraith
manic crypt
#

What error is it showing?

#

in the console

#

Oh, I see it now. Do you see how what you typed is different from what I typed in?

#

the closing bracket [] needs to be around the key you're calling for that format to work.

umbral wraith
#

So, when I tried that, then the roll button just does nothing

manic crypt
#

Does it throw a console error? It should be working.

umbral wraith
#

How do I access the console?

manic crypt
#

F12

umbral wraith
manic crypt
#

although.. yeah, I'm wrong on that one. BTW, I'm super iterative when it comes to code, so I sometimes give the wrong thing at first, because I spend a lot of time doing it wrong then figuring out what I'm doing. What I was wrong about in THIS instance is that you can't call the skill total directly.

#

give me a sec to give a proper reference for it.

umbral wraith
#

Hey, no worries about the iterative coding. That is how it be. You're still better at this than I am hehe

manic crypt
#

see if this code does what you want it to (I know, it's kind of extra..)

<th>Roll result for ${sameRow('pc_skills_name')}$</th>
<tr><td>Skill Total:</td><td>${sum(sameRow('pc_skills_stat'),sameRow('pc_skills_level))}$</td></tr>
<tr><td>Roll:</td><td>${roll:= [2d6]}$</td></tr>
<tr><td><strong>Total Result:</td><td>${sum(roll, pc_skills_total)}$</strong></td></tr>
</table>```
umbral wraith
#

And, just to confirm, I put this in the roll message box?

manic crypt
#

Roll message box for the total column, yeah. It kind of ignores the label in the same column in this case.

#

Because I've actually never tried to access the label of the same component in a roll message, so I just avoided the problem by repeating it in the roll message formula.

umbral wraith
#

Alright, now it's throwing this error. If it would be easier to have a new column for a roll button instead of just the total column, that's perfectly fine.

manic crypt
#

ah, missed that that was still there.

#
<th>Roll result for ${sameRow('pc_skills_name')}$</th>
<tr><td>Skill Total:</td><td>${total:= sum(sameRow('pc_skills_stat'),sameRow('pc_skills_level))}$</td></tr>
<tr><td>Roll:</td><td>${roll:= [2d6]}$</td></tr>
<tr><td><strong>Total Result:</td><td>${sum(roll, total)}$</strong></td></tr>
</table>```
umbral wraith
#

That works perfectly, thank you so much!

manic crypt
#

That looks like what I expected it to, is there anything you want to change?

umbral wraith
#

The one thing I wanted to change was to have the individual d6s shown (doubles are a crit in this system) and that was just adding an '!'

manic crypt
#

If you add a ! to the formulas you can get rid of the highlight boxes if you just want plain numbers there.

#

or to take it off the skill name in the header.

umbral wraith
#

I'm not 100% certain what you mean by that, apologies

manic crypt
#

so for line 2, instead of what's written, replace it with <th>Roll result for ${!sameRow('pc_skills_name')}$</th>. It should remove the white box around the word Greatsword.

#

er.. Great Weapon

umbral wraith
manic crypt
#

You can do the same thing for any of the formula results. I usually only leave it around the roll results, to sort of call those out.

umbral wraith
#

That doesn't seem to be removing the white boxes, but it's ok, I kinda like them.

trim oxide
#

Continuing work on getting my custom system working:

Saw the following example from the gitlab under Conditions:

You can directly use the key of a checkbox to test it is checked
Example : ${ checkboxKey ? 'Checked' : 'Not checked' }$

Does anyone know how the Radio Button version of this? Or a list I can refer to in future?

manic crypt
#

I do remember from reading through it that you can't have all the buttons of a radio button group unchecked, so if you want a "none" option you need another button with that value.

misty terrace
#

How can I retrieve the token image for players/targets to include in a label roll message? Can't quite get my head around if fetchFromActor() is the right path or if I need to use %{}% and return it via JS.

manic crypt
#

as far as returning it goes, you're probably going to have to go through JS, since the .img doesn't show up in props (although you could return it on the item sheet, I guess?). For displaying it you'll need some css in the roll message. (forgot to reply directly, @misty terrace )

misty terrace
#

if I'm doing a roll from a label roll message from a label with the component key "arcana", how can I reference that from within the label roll?

manic crypt
#

reference the label value (the value in the label bin on the container) in the roll message in the same component?

misty terrace
#

the component key of the same label that's running the roll message

#

like a me.key

#

So I can use a generic template for each skill

manic crypt
#

So this kind of setup

misty terrace
#

without having to manually code each one

manic crypt
#

Which outputs this in the roll message

misty terrace
#

But I cna't reuse that in a non arcana skill

#

Trying to template outputs

manic crypt
#

I see what you mean.

#

Umm.. I think that the best way to do that would be something nested in a dynamic table, so you can have the label set to sameRow() and reference the a name column.

#

That way the formula you set up for the roll label applies to the whole skill list

misty terrace
#

I see where you're going. It's probably faster and less confusing to just manually make a diffreent message for each skilll

#

I wish that I could reference a set of me.ATTRIBUTES from components

manic crypt
#

that sounds like more of a Martin question, tbh. I can't say for sure that something like that isn't possible, but I don't think it's going to fit into the core CSB without being a change to how they're handling the data. You can see the fields in actor._templatesystem._componentmap.<componentkey> and could maybe do something with JS in that realm, but it's beyond my depth.

#

arcana on my sheet for instance:

#

As for how I addressed it inside CSB, I have this DT:

#

with the roll column coded thus:

?{stat:'Attribute for roll '|STRMod,"STR"|DEXMod,"DEX"|CONMod,"CON"|INTMod,"INT"|WISMod,"WIS"|CHAMod,"CHA"},
?{modifier:'Skill Roll Modifier'[number]|0},
?{difficulty:'Difficulty of Check?'|6|8|10|12|14}
)}$
<table>
<tr>
<th>${!sameRow('Name')}$ Roll</th>
</tr>

<tr>
<td>Roll</td>
<td style="text-align: center; vertical-align: middle;">${roll:=[2d6]}$
</tr>

<tr>
<td><strong>Target:</td>
<td style="text-align: center; vertical-align: middle;"> ${!difficulty}$</td>
</tr>

<tr>
<td>Dice Mod:</td>
<td style="text-align: center; vertical-align: middle;">${!modifier}$</td>
</tr>

<tr>
<td>Stat Modifier:</td>
<td style="text-align: center; vertical-align: middle;">${!stat}$</td>
</tr>

<tr>
<td>Skill Rank:</td>
<td style="text-align: center; vertical-align: middle;">${!rank:=sameRow('Rank')}$</td>
</tr>

<tr>
<td><strong>Result</strong></td>
<td style="text-align: center; vertical-align: middle;"><strong>${result:= roll + modifier + stat +rank}$</strong></td>
</tr>

<tr>
<td><strong>${!roll == 12 ? 'Critical Success!' : roll == 2 ? 'Fumble!' : result >= difficulty ? '<br>Success!' : '<br>Fail!'}$
</tr>
</table>```
#

So it pulls the skill name from the DT

manic crypt
#

Oh, nice. There you go then.

shy stag
#

the minimum value on my meter is not working

formal goblet
shy stag
#

is there a way to actually set a nimimum/maximum value for a number?

formal goblet
#

Use the min() and max()-functions

formal goblet