#Custom System Builder

1 messages ยท Page 13 of 1

tiny hinge
#

Once he update to v11 it works

formal goblet
#

What was the CSB-Version?

tiny hinge
#

2.4.4 the latest

formal goblet
#

Meh, not again ๐Ÿ˜…

tiny hinge
#

Can be a pita maintaining 2 versions ><

oblique spear
#

@formal goblet yes, I understand.

I would like to know if is possible to create a item that roll itself and it is display in the chat.

Also, is possible to create a Class item? One that add skills when you level up?

formal goblet
oblique spear
#

And can I have reference to this label roll messages from a item container?

formal goblet
#

No

oblique spear
#

Humn... Ok, thank you

formal goblet
#

The Item Container can create Label Roll Messages on itยดs own and reference the stats of the corresponding Item

fierce harbor
oblique spear
#

I dont think that works. I have many class and if the item-class make visible a panel with the info, I will need many panels in the sheet...

#

I am thinking more in add other items or fill a table

fierce harbor
formal goblet
#

But it would be possible to create a Button in the Item, which has a Script, which copies Items from the Tab to the Actor.

oblique spear
#

Ok! How can i do it? This sound good

oblique spear
#

I am afraid that what is the instruction to add item to an actor

#

But, thank you anyway

rich glen
lament wadi
#

Can I somehow take the highest set in a dice pool roll and add the results?

For example, if I roll 5d6 -> 5, 3, 5, 1, 4 -> 5 + 5 -> 10

brittle moth
#

Oh, maybe I misunderstood. You want to keep all the highest values, whatever number they may be ? In your example, keep all the 5s ?

lament wadi
#

Keep the same set, if for the same roll the result is 5, 6, 3, 3, 1 -> Keep only the 6 since is the highest

#

I can imagine that a possible solution is turning the results into an array, pick the highest and then count the number of occurences (for each loop?), then highest * count = final result

brittle moth
#

I think that's the only way, I don't think Foundry has a built-in way to do it :/

lament wadi
#

What language does the scripts use? The ones between '%'? JavaScript?

brittle moth
#

Between %{}% is Javascript, between ${}$ is the CSB Formula syntax ๐Ÿ™‚

rich glen
brittle moth
#

2.4.4 was planned to be the final v10 compatible version, I don't think I'll fix this bug for v10, sorry. Since it's the last v10 version, feel free to dig in the code and fix it yourself if you want to, it won't be erased by another version ^^

lament wadi
rich glen
#

It's not here and I don't know how to send it in a clean way, is there a tag for "code"?

brittle moth
lament wadi
#

Triple ` I think

rich glen
#

let cont_one = 0;
let s = 0;
let results = ``;
roll.terms[0].results.forEach(function(dice) {
  results += `<li class="roll die d10`;
  if (dice.success) {
    results += ` success`;
    if (dice.result == 10) {
      results += ` exploded`;
      s+=2;
    }
    else {
      s++;
    }
  }
  if (dice.result == 1) {
    cont_one++;
    results += ` failure`;
  }
  results += `">` + dice.result + `</li>`;
});```
lament wadi
#

Thank you very much ๐Ÿ˜„

rich glen
#

sroll is the roll formula

sonic bone
#

I was directed here, and will be clear, I am in the "can I do this" stage, not active in development. I won't report this a third time, but I'll link to my Simple Worldbuilding post: #1037073983335563457 message

First, I'm not even sure the difference between CSB and SWB for development. Is there a link to an explanation? Second, how daunting is this? I am finding little (near none) information on how to use SW for development, and that that I do find is very outdated. Does CSB have an information, wiki, or "how to" page that is current?

Thanks!!

brittle moth
# sonic bone I was directed here, and will be clear, I am in the "can I do this" stage, not a...

I don't really know Simple Worldbuilding that much, to be honest. From what I've seen, SWB is more "barebones" than CSB. You create your sheet in a Rich Text Area, with references to a customizable Attributes list. (I maybe short-selling it here, but I really don't know much about it).

CSB allows you to craft more complex sheets with a fair bit of automation and predefined rolls. The official documentation is here : https://gitlab.com/custom-system-builder/custom-system-builder#custom-system-builder
And this channel is full of helping people ready to give advice and hints on how to achieve what you want (and again, thank you very much guys for the support and the help you're giving !)

In short, I'd say SWB is minimalist, gets the job done if you just want a way to show your stats, and CSB adds a real dose of automation and options to your games

#

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

Features

  • BREAKING - V11 compatibility - System is no longer compatible with v10
  • BREAKING - Deprecated formula syntax has been removed
  • Added function 'notify()'
  • Added formula-support for tooltips
  • Added option to use formulas as options in dropdown-lists
  • [#211] allow usage of [dice tags] in roll formula
  • [#313] Added comparison with match in fetchFromDynamicTable
  • [#314] Added option to hide empty ItemContainer
  • Added an option to display Item status in Item Containers for GM
  • Added the option to disable template filtering in Item Containers

Fixes

  • Fixed formula computing when using conditional modifier list in user input template
  • Fixed issue with undeletable predefined lines trasnferring their status to other lines on line movement

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

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

lament wadi
# lament wadi Can I somehow take the highest set in a dice pool roll and add the results? For...
let roll = await new Roll(sroll).roll();

let c = 0;
let m = 0;

roll.terms[0].results.forEach(function(dice) {
    if (c < dice.result) {
        c = dice.result;
    }
});

roll.terms[0].results.forEach(function(dice) {
    if (c == dice.result) {
        m++;
    }
});
console.log(c*m);

let total_roll = c * m

let results_html = `Result: <a class="inline-result"><i class="fas fa-dice-d10"></i> ${total_roll}</a>`

ChatMessage.create({
    user: game.user._id,
    speaker: ChatMessage.getSpeaker({token: actor}),
    content: results_html
});
#

In case anyone is interested in how I finished it

sonic bone
turbid schooner
#

Thanks, I'll check it out!

brave trench
# sonic bone As I don't know what to specifically ask, and I am reading the link I was provid...

Sheets are unique for each game so it is hard to give the exact advice you need to get started. If I were you I'd start up CSB and just start tinkering around. Start simple, try to use the link above to create a couple things, a lable, a roll button, a number field that adds a number to that lable/roll button, etc. You really need to ease your way into sheet building. If you just try to dive head first into the most complex things you will have a hard time and get frustrated.

When you have learned all of the different bits of syntax everything becomes easier because you will know how to solve the problems you run across.

rich glen
#

What I did for my sheet was breaking down what I wanted in the head part (always visible) and then I used the TabControl and a column based Panel to contain other Panels and so on...

#

It gets easier but be ready to scrap it all multiple times ๐Ÿคฃ

rich glen
#

I found the problem with my module that add a Component to CSB...

If I use the Hook on customSystemBuilderReady, my Component works BUT it gives me an error when CSB prepare the Sheets data because, at that time, my Module is not loaded yet. This means that the Templates are empty. The Actors are ok because they have the Refresh button that reload the template.

The solution (that I found) is using the Hook on init that fixes my entire problem but it leans on the HOPE that the ComponentFactory is correctly available at that time...

formal goblet
#

@brittle moth ^

blazing ibex
#

How do you auto-refresh values that come from fetchFromActor?

the value here is ${fetchFromActor(sameRow('member'),'health')}$ but it doesn't refresh whenever health changes, or even when you reload the sheet

the value only updates if you change the member name

brittle moth
rich glen
brittle moth
tiny hinge
#

is there anyway to add custom active effects descriptions? currently i dont think there is a way to do this right.

#

since CUB and its variants doesnt work on csb active effects

formal goblet
zinc verge
formal goblet
zinc verge
#

Game changer!! Thanks yo!

raven raven
#

How can I coustomize the chat card?

#

i would like to disabe this two parts

formal goblet
raven raven
#

thank you, but could you be a bit more specific? Im kind of a noob here... ๐Ÿ˜„

#

my educated guess was chat message

#

but could not find it there

zinc verge
#

Not at my computer atm so I canโ€™t check immediately but can you place journals or journal pages into an actor sheet by any means?

zinc verge
#

Beautiful. Love CSB

raven raven
#

just place a text editor field to your character sheet

#

drag and drop the journal pages, and save

zinc verge
#

So, I think this might actually be a workaround to the limitations of item containers then

raven raven
#

this is how it looks

#

Dunno if there is another method , i do it like this

zinc verge
#

With Monkโ€™s Journal Enhancements, you can place CSB items into a Loot journal and it wonโ€™t conform to the same categorical filters as item containers. You could effectively do this instead of using item containers if you wanted

#

Only issue is things like fetchFromActor(โ€˜attachedโ€™) might not work if youโ€™re trying to have items pull stats from the character holding them

#

So itโ€™d mainly work as a party loot function

raven raven
noble tendon
#

hi, with CSB can make nesting list?
drowlist1 (option a, b, c, d)

drowlist 2 show for a (a1, a2, a3), for b (b1, b2), for c (c1, c2, c3, c4, c5) ......)

latent sorrel
#

Is there way to trigger a macro when an item is dropped on a character sheet?

fading rover
blazing ibex
#

lol, that's what i did to refresh randbetween() in google sheets

blazing ibex
#

is it possible to pull the image from an actor?

#

also how would you count the number of entries in a dynamic table? in google sheets you would use COUNTA()

#

ah it seems to be ${count(fetchFromDynamicTable('roster','member'))}$

brave trench
#

Anyone know if it is possible to setproperty of an entire column in a dynamic table or can it only do 1 row at a time?

zinc verge
#

I imagine if nothing else you could do a setproperty formula for each row in the same label, as tedious as that sounds

zinc verge
# blazing ibex is it possible to pull the image from an actor?

I'd like to know this as well. I can't test it atm but the only thing I can really think of is to make a rich text document and try to drag and drop the image into it, or upload it directly, and then reference that text document. I'm not positive that will work though

blazing ibex
#

why does this work (from template) ${round(sum(fetchFromDynamicTable('Shopping_List', 'GC_Total')), 2)}$

and mine doesn't? (should return '3') ${sum(fetchFromDynamicTable('roster','lit'))}$

zinc verge
#

looks like you don't have anything being added for the sum formula. After the fetchFrom formula there's a , 2)}$ which appears to be getting added to the fetchFrom value. I think it might be reading as an incomplete formula for yours because you're telling it to add one value to nothing

blazing ibex
#

that's for round()

#

iirc

#

tells you to give it two decimal places

zinc verge
#

ah, word okay. try removing the sum then? It might just be unnecessary if there's only one value. I know that seems to be what the template is doing but couldn't hurt to try

blazing ibex
zinc verge
#

also could be that you have 3 columns named Felix, which might make it hard for the formula to tell which column it's looking at, unless you want it to add all of them together

blazing ibex
#

hm, let's see if that changes anything. already tried removing sum earlier to no effect

zinc verge
#

yeah the more I look at it the more I'm thinking it has to do with the multiple Felix's, and also that it doesn't look like you have the formula set to look for a specific row based on the member's name

blazing ibex
#

trying to add up the total amount of Burn

#

that column doesn't like being count()'d either

#

like its not a real number or something

blazing ibex
zinc verge
#

which column is lit is that the one that says "Burn"?

blazing ibex
#

yea. and the values in my template don't look any different from the one used in the example template

zinc verge
#

and also what is the key for the column your player names are in?

blazing ibex
zinc verge
#

bet you right. Lastly, what is the key for the dropdown menu you're pulling names from in the panel?

#

on the bottom left of the last screenshot

blazing ibex
#

oh that has nothing to do with anything. i was using it to test something unrelated

zinc verge
#

oh, so you just want the formula to add every number in the lit column entirely?

blazing ibex
#

yep

#

it's for a system where you count total amount of light against total amount of party

#

i was going to calc this automatically but first, was making sure each part worked individually

zinc verge
#

okay that makes sense. I didn't realize the member key wasn't important

#

the only thing I can think of is that either sum isn't the correct operator for this context (as in, the numbers pulled from the fetchFrom formula might return to the sum operator as a single value, so it doesn't understand to add them together,) or it's possible, albeit unlikely, that the formula simply isn't playing well with trying to add values together because all the values are labels, as opposed to number fields or text fields.

Out of curiosity, what version of CSB are you using?

blazing ibex
#

latest. had to update because the previous one was super slow

zinc verge
#

okay yeah, the label issue is pretty unlikely then as they just recently fixed a very similar issue pertaining to fetching label values.

I'm ultimately not the best with this stuff, but I think from here what I'd try to do is make a series of labels that pull the individual values of each row's "lit" column, and then have the final formula add all those keys together. It's definitely not elegant, but it's hard for me personally to say what exactly is causing this formula to fail

blazing ibex
#

seems to be failing because those Lit numbers are display only for whatever reason

#

the value of Lit is ${fetchFromActor(sameRow('member'),'burn') > 0 ? 1 : 0}$

#

ah, what if the Burn variable doesnt exist on the actor yet, because the number has no default value

zinc verge
#

that could be, but shouldn't be, because the else part of the boolean should cover the default value issue

#

but it could be the case

blazing ibex
#

yeah, no change.

#

"Copy" column should just straight up repeat whatever is in "Burn" column

#

and all it shows are blanks

#

nothing wrong with the copy code, it copies the other columns fine

#

okay so this is dumb. but fetch doesn't like being in a conditional?
Burn value is ${fetchFromActor(sameRow('member'),'burn')}$
Lit value is ${sameRow('burn') > 0 ? 1 : 0}$

zinc verge
#

aaaah okay, so it is just lacking a value

#

I wonder if putting the conditional inside a switchCase would fix that lmao

zinc verge
blazing ibex
#

works ${partylit >= (partynum/2) ? 'Bright Light' : partylit > 0 ? 'Dim Light' : 'Darkness'}$

zinc verge
#

very nice

tiny hinge
foggy oxide
#

I'm trying to combine two different conditions to get one output.
I will describe it with my words to explain it:

  • If [roll<=chance] then everything is fine (outcome 1).
  • If [roll>chance] and not [specialized] then it's bad (outcome 2).
  • If [roll>chance] and [specialized] then it's not so bad (outcome 3).

I have started with outcome1 and outcome2, but I'm crushing my head to get outcome3 into this:
${#result:= roll<=chance ? outcome1 : outcome2 }$

silk remnant
#

I think it'd be like
${#result:= roll<=chance ? outcome1 : (special != true ? outcome2 : outcome3)}$
But as I said, I remember this being really touchy trying to enter it so I don't remember if I had to do something a bit weirder. It does work though.

#

Also might not need the parenthesis, just scrolled up a bit and found a different one without it but I always got errors trying direct entry like that early on. Method may slightly vary.

foggy oxide
silk remnant
#

Perfect, happy to have been of help.

scarlet skiff
oblique spear
#

It seems that I need the items create a createChatMessage hook

#

If I add something like this in a label roll, it will work?

%{
Hooks.on("ready", function() {
// Add an event listener for when an item is used
Hooks.on("preUpdateOwnedItem", function(actor, item, updateData) {
// Check if the item has a "message" property
if (updateData.hasOwnProperty("data.message")) {
// Create a new chat message with the item's message
ChatMessage.create({
speaker: ChatMessage.getSpeaker({ actor: actor }),
content: updateData.data.message,
type: CHAT_MESSAGE_TYPES.IC
});
}
});
});
}%

oblique spear
#

I have tried and i have fail...

scarlet skiff
#

To me it seems that Something Like this has to go into a world Script. But i dont know this Module so ๐Ÿคทโ€โ™‚๏ธ

#

Usually you Put hooks into a world script

oblique spear
#

Yes... But i do not know how to do it neither what world script change to add it

#

Maybe I can change item.js to add rolleable function

scarlet skiff
#

In macro-polo Channel there is a Pin how to create world Script

oblique spear
#

Thanks

rich glen
#

I'm trying to call a Macro from the Label roll message with this formula:

%{await game.macros.getName('Ex2Roll').execute({n: ${?{dices[number]}}$})}%

It works correctly but print my message and then an 'undefined' object (see screenshot)

#

Is it because he tries to "roll" the value returned from my Macro? ๐Ÿค”

scarlet skiff
#

The undefined is from the Label Roll Message. Since you dont have any displayable content in your Label Roll Message it is undefined.
At the moment there is No way to hide it.

rich glen
scarlet skiff
#

yeah you could add a message which would be displayed there

#

or you could return something from the macro and print it with this message

#

e.g. return "Success" or "Fail" from the macro

rich glen
#

Thanks

rich glen
scarlet skiff
#

i'm no expert here because i havent used it myself really much. but i would start something like this: %{await game.macros.getName('Ex2Roll').execute({n: ${?{dices[number]}}$}); return "This is a test message";}%

#

see if this prints the test message.

#

next you can go await game.macros.getName('Ex2Roll').execute({n: ${?{dices[number]}}$}); let chatMessage = "This is a test message"; return chatMessage;

rich glen
#

Ok, understood...

scarlet skiff
#

if this works you have to make sure that your macro returns a string and you can do something like this:

console.log(chatMessage);
return chatMessage;``` 
the console.log is there (press F12) to see if the macro returns a string (or anything at all)
rich glen
#

Thanks a lot, it looks better already! ๐Ÿ™‚

scarlet skiff
#

๐Ÿ‘ - no problem ๐Ÿ™‚

low lotus
#

Hey all, I'm working on my character sheets, trying to make it so when a checkbox is clicked inside an item, the item container highlights the row it's in.
CSS isn't able to deal with conditionals, as I've been made aware, so I've been trying to go around this by adding in a JS script that adds a class to the table row whenever the checkbox value is true.
I'm stuck whenever I try to pull the linkedEntity data from the item, maybe I'm using it wrong, but I can never seem to get anything but either undefined in the box or simply an error message telling me I don't have the right properites in the box.
Is there a smarter way to go about this? Or any way for a CSS class to effect an item in an item container based on something like a checkboxes state?

rich glen
#

I'm not sure it works right now but google pointed me at this:

      mycss;
}```
#

It should be: "if the checkbox with myChecboxClass is checked, apply mycss to all elements with class myRowClass"

low lotus
#

spent some time finding what that myRowClass was, and figured out it's custom-system-dynamicRow, but now when I try to edit that background-color, something from the style.css sheet overrides it. Some kind of banded rows thing is preventing me from changing the bg color at all

#

all 3 should be light green

rich glen
#

Use !important to override...

#

But the best option would be to assign a Class of your own creation

boreal hull
#

I am trying to get an items modifiers to work when I drop it inot a pc sheet but it wont add anything to the labels within the item container

low lotus
boreal hull
#

I used a set operator to have it manipulate a label but it remains blank even with the item in it

formal goblet
boreal hull
#

okay what would an example formula look like for that? sorry im new to this system

formal goblet
#

${item.name}$ would be the most simple one

rich glen
boreal hull
formal goblet
boreal hull
#

Okay.. so i would have to make a seperate item conatiner for evey single item I want to put in it? each item can't input label data separately?

#

Because if i have to put the item name into the label then that excludes all other items right?

#

or does item.name signify all items? or is it a placeholder?

#

also I dont want the name in the label, I want specific text (1d10)

#

its a item container with many labels which will present the stats of the item, and I want the item to present that info to the item container when dropped in

formal goblet
# boreal hull Okay.. so i would have to make a seperate item conatiner for evey single item I ...

Think of the Item Container as a Table, where every Item in the Item Container has its own row. The first column will always be a link of the Item.

Now I want to display additional information of the Items in separate columns. E.g. the Level of each Item in the second column. For that, I create a new Label in the Item Container and enter ${item.Level}$ (the component with the key Level has to exist in the Item) into the Label text as a Formula. As a result, every Item will display its Level in an additional column (see screenshot).

boreal hull
rich glen
#

I used so much of those in my sheets that I need a 4k monitor to open my template or I can't see it all... Luckily the Actor sheet is more compact... ๐Ÿคฃ

low lotus
rich glen
#

By the way, you put the checkbox in a column so it doesn't have any brother in the same container so...I don't think it'll work anyway

low lotus
rich glen
#

That's right.

#

I'm not sure you can do it with the CSS, then... ๐Ÿ˜ฆ

low lotus
#

hrm

#

I'll keep hackin away at it and see what I can get to

rich glen
#

Good luck

low lotus
#

is there some special way linkedEntity works in scripts?

#

linkedEntity.entityType does nothing

formal goblet
low lotus
#

rigged this together, it's just the headers hidden and the margins shortened to make it look like one table

sharp grotto
#

how do i round down in a lable ?
${(dex_mod / 2)+Armor_prof}$

formal goblet
bright flume
bright flume
#

ooo

#

Got it

#

I manually uploaded it, but changed its ID to the normal one. So now Forge sees "Custom System Builder" as the 3.0.0 :D

raven raven
#

Hi, How can I customize the chat card, I would like to disable this two parts: I know its CSS but witch file?

rich glen
#

You can add your CSS to CSB and you can hide the parts with display: none. Bottom part has class dice-total and top has class dice-formula.

raven raven
#

I imagined that there is already an existing file witch defines this and all I need to do is find the file and delete that part...

rich glen
formal goblet
raven raven
#

found it... i guess...

#

?

#

So I have to write a whole CSS file for this and upload it here...

formal goblet
#

Yeah

raven raven
#

it would be real nice to know CSS ๐Ÿ˜„

#

meh... i will google it...

#

Any help on how to do this would be appreciated... ๐Ÿ˜„

rich glen
#

It should be like this...

.dice-total, .dice-formula { display: none; }

If it doesn't work, use display: none !important;

#
raven raven
#

so... the whole file looks like this:

#

?

rich glen
#

If you want to do only that...I think it's enough

raven raven
#

and in case if it does not work how do i remove it?

#

okay, so I can not select the file... probably because:

#

buti dont understand the "please upload it manually to the server before selecting"... the server runs on my PC.... so im the server... and that is exactly where the file is... so where should I upload this?

#

I must be missunderstanding something...

formal goblet
raven raven
#

at the moment it is here:

#

but

#

i still can not see it

#

(I assume by User Directory you mean User Data

#

)

formal goblet
#

Well, seems like you have to enter the path manually

zinc verge
#

the file picker in foundry can't read CSS files which is what that warning is for, so you get around that by manually inputting the file path, but you can still copy past the entire path except for the one file at the end that foundry isn't reading. You'll need to close and reopen your world to test if it's taken effect after doing this though

#

and in my experience sometimes it doesn't work after the first time.

normal ore
#

Regarding dynamic tables, I'm trying to create a line counter label, but I'm having trouble automating it. I would like that when adding the first line, the label property key returns the value "1," and when adding the second line, the key returns the value "2," and so on for each subsequent line.

Is it possible to achieve this?

formal goblet
latent sorrel
#

Is there a way to use JS, or other functionality, to set the default text of a text box so that it can then be manually (by the player) changed without being reset?

zinc verge
#

I tried that Core Settings Expanded thing that was suggested earlier. Turns out you can in fact not edit anything about core effects?? The options are all there, but a Status ID and Name are required to edit any core effects, and neither of these fields can be edited. They're just grayed out

#

I know this isn't expressly a CSB issue but the mod was recommended to me here so I'm curious if anyone else knows about this issue

foggy oxide
#

Can I find a description somewhere of how "hidden attributes" work? Or how can I use hidden attributes in label roll messages?
Can I store a roll message in a hidden attribute and then execute it via the roll message of a label?
What I want to do: I would like to define one single roll message (with user inputs) for all skills. The formula inside this roll message is pretty much the same for all skills, just skill name und value must be change. So my idea was to add 3 hidden attributes: skillName, skillValue and skillCalculate. The on the label roll message of every skill I would just have to set skillName, skillValue and then execute skillCalculate. Would this be possible?

vagrant hollow
oblique spear
#

Anyone knows how to do to put items in the hotbar and roll them?

I want, for example, put a spell in the hotbar, click it and roll the magic.

Currently, you only display the item

#

I add a function in item.js named roll() but doesnt work

topaz coyote
vague mountain
#

fetchFromDynamicTable('equipment', 'weight') : Will return a Matrix containing all the weights from the Dynamic Table
equipment, here : [50, 2, 30]

How to add all values โ€‹โ€‹of this array?

zinc verge
brittle moth
oblique spear
brittle moth
oblique spear
#

Ok, no problem! Thanks

sullen delta
#

Hello, sorry, I'm really a newbie, and would need help.
I'am trying to make the formula for my maximum HPs, they are depending on a VIGOR value (key = vig). What I did works, but then, the key of my maximum HP isn't recognized as a value in other formulas... Anyone can help ?
Here is my Max HP formula :

${vig > 21 ? 50 : vig > 20 ? 47 : vig > 17 ? 44 : vig > 14 ? 41 : vig > 11 ? 38 : 35}$

zinc verge
#

there is currently no way to have a label formula display an actor sheet image, correct?

low lotus
#

When Item Containers reference a dropdown, they return the key and not the label, is there a way around this?

zinc verge
#

That shouldn't be happening at all ๐Ÿค” I have dropdowns referenced in my item containers and they're certainly not doing that

are you making sure the label referencing the dropdown has the ${item.<key>}$ formatting?

low lotus
#

I've reloaded my sheet and disabled custom css to make sure it wasn't that

brittle moth
boreal hull
#

I was wondering if someone could help me figure out a complex problem I am having. What I want to achieve: I want an item in an item container to display text in one of the labels within said item container, but I want that text to dynamically change between 3 set pieces of text depending on whether or not certain requirements are met by specific stats (Number fields) within the character sheet that the said item is in. (For example, a sword with which has a strength requirement of 2 to wield is placed in a character sheet of a PC which has a strength of 1 so the wielding state of that character with that particular weapon then becomes the lowest of the three options ranging from (Strong, Normal, Weak) etc. If someone could help me try and tackle this that would be great, or lead me in the right direction to figure it out... if what I'm trying to achieve doesn't make sense then please let me know

boreal hull
#

Okay thanks!

#

can there more than two values?

#

or could I make a default of Normal?

fierce harbor
boreal hull
#

Oh okay thanks great

fierce harbor
sharp grotto
#

ifi want to use the atribute for HP so i can use hp bars how do i do so then ?

scarlet skiff
#

Create a number field with a max. Value defined. Then you can choose this for the HP bar

sharp grotto
boreal hull
# fierce harbor No problem ๐Ÿ˜‰

I input what I think are the correct keys into the formula you provided, but the label in the item container keeps reading ERROR: ${ athletics_mastery_bonus > item.atheltics_weapon_mastery_requirement ? 'Weak' : athletics_mastery_bonus < item.atheltics_weapon_mastery_requirement ? 'Strong' : 'Normal' }$ Not sure what I did wrong...

formal goblet
#

Btw, if youยดre unsure where the problem lies, you can break down the formula into smaller pieces and test these

boreal hull
#

ah okay god hahaha

#

it seems to work now, thank you so much

#

its always that one stupid thing you overlook

oblique spear
#

But i dont know how add this to the JavaScript of CSB. Are there a .js that manage the hotbar?

#

I see also that I can not put a rolleable label of a item container in the hotbar... Is it possible?

formal goblet
oblique spear
#

Ok, thanks. You guys have done a really good work.

#

Sorry if I ask for things that are not available

formal goblet
#

No worries. Most stuff, that is available, is written out in the Docs. If itยดs not there, itยดs highly likely, that itยดs not available

zinc verge
zinc verge
#

unfortunate. Is there a possibility of that being an added feature in the future? I could put in a feature request if there isn't already one

cinder rock
#

heyo, I'm trying to edit a character template of mine, and I'm getting this error whenever I click the '+' button to add a new section:

#

before I go writting a bug on this, I wanted to see if anyone had some ideas on getting rid of this error. So far, my attempts have lead no where

cinder rock
#

I don't have CUB installed, although I did install it a looooonggggg time ago.

#

would it leave residuals?

formal goblet
#

Did

cinder rock
#

ah, I see

#

I am getting this error in my console. Did I format something wrong, maybe?

formal goblet
cinder rock
#

I am, admittedly, a professional in QA for software development and I am ashamed of myself ๐Ÿ™ƒ
tbh, its my day off, but still.

formal goblet
#

Ah, so youยดre the guy I have to open the same pull request 3 times in the row ๐Ÿ˜‚

cinder rock
#

lmao

formal goblet
#

To be fair, it was a ticket full of edge cases

cinder rock
#

it worked, so ty

latent sorrel
#

I am trying to use this code to set a text box in an item with a button in same item: ${setPropertyInEntity('item', 'nmbRankofCS', 3)}$ but I am getting Formula.js:751 Uncaught (in promise) Error: No entity linked to the formula, could not update any property at setPropertyInEntity (Formula.js:751:43)
Does anyone have any suggestions on why might happening.

misty terrace
#

1 Step forward, 2 steps backwards. I'm working on a system for items rolls (for attacks and such) I have 2 macros, 1 called useSkill that does the "to hit" check and is called from the label roll message of the item. The second, called rollDamage, I'm trying to fire from a button that is visible in the chatMessage if the useSkill returns a "true" message.

#

My thinking was to build the <button onclick> dynamically in the label roll message

#

but I realize that the rollDamage is basically populating the button with "undefined"

#

I think this may be a known issue with doing what I'm trying to do. So I wanted to see if any of you had success in dynamically creating/showing a button in the Chat Message that does something else when clicked.

rich glen
#

I know for sure that dnd5e system does that. I don't remember if it always shows the damage button or not.

sullen delta
#

Can someone help me on how to show a fumble in the chat message. Sorry, I'm really not good at this, total beginner.
My label roll for the moment works fine :

TARGET : ${target:=vig}$<br>
ROLL : ${roll:=[2d12]}$<br>
<hr>
RESULT : ${roll <= target ? 'Success !' : 'Failure !'}$<br>

But I would like to add that if both dice were a 12, then it's a fumble, and I've tried many ways, none of which works ! Pleaaase heeeeelp ;=)

#

And not with roll = 24 because I will sometimes use a modifier on the roll. So it really needs to be somethin like D1=12 & D2=12 but I can't find a way to integrate it in the formula

silk remnant
#

I think it'd be something like

${!D2:=[1d12]}$
TARGET : ${target:=vig}$<br>
ROLL : ${roll:=D1+D2}$<br>
<hr>
RESULT : ${roll <= target ? 'Success !' : (D1+D2 == 24 ? 'Fumble !' : 'Failure !')}$<br>```Not at my main work computer so I can't compare my exact tags/syntax though.
#

This lets you target 'roll' for additional modifiers while keeping the dice values themselves independent.

#

You might also be able to do something like D1 && D2 == 12 as the check but I'm not totally certain that's written in the correct format.

sullen delta
silk remnant
#

Ah, they do? I may have gotten the prefix tag wrong, one sec.

#

Yeah, mixup, looks like it's # to hide and not !

#

Just switch that out and it should work.

sullen delta
foggy oxide
#

Can I execute the initiative roll from a label roll message? I would like to have a "roll label button" with "roll initiative" inside my character sheet.

scarlet skiff
scarlet skiff
tiny hinge
#

question, what's the use case for conditional modifier list feature? is it for players to be able to apply status effects from the sheet without DAE?

cosmic karma
#

Hello, I'm trying to wrap-up everything to "publish" the latest version of my Household CSB system and I'm having problems with the css file. Fonts and images are not loading, everything is copied and linked correctly (I think ๐Ÿ™‚ ). Any clues? Console is giving me 404's so maybe is the way that I'm using the URLs in the CSS?

#

(it works with the Custom CSS module)

cosmic karma
#

aaand solved. correct paths now should be "/household_csb/sheet..." the / at the beginning matters. it was not needed in Custom CSS. I'll let this here as reminder of my shame ๐Ÿ˜„

misty terrace
#

@formal goblet Can I make a feature request? It'd be awesome to be able to have more than one component box open at a time!

formal goblet
south marsh
#

Hello ! I'm trying to make something on CSB that, I must say, seems really easy... But I'm not a dev guy or a smart boy so... I'm struggling...
I just want to reproduce the DND5e system AbilityScore modifier.
I've a dynamictable with stats that you can modify then a label with "dynamic" prompting of your stat. So far, I've only got this : ${sameRow}$ (given by the Github tutorial) which display the value of the stats.
Did someone have any tip to help a poor soul ? ๐Ÿ™‚
Thank's in advance

foggy oxide
#

I want to get the max value of a column on a dynamic table:
${max(fetchFromDynamicTable('MyCybernetics','MyCyberneticsPsiHandicap'))}$
As long as there are rows in the table, this works without any problems. But when the table has no row I get an error. How can I fix this?

scarlet skiff
#

Can you define a fallback value?

foggy oxide
misty terrace
#

Trying to use Ternary to set the color of some text in a label roll message. I know I'm making 1 small typo somewhere. Can anyone spot it?
<td style="${(skillRoll <= targetScore) ? 'color: green;' : 'color: red;'}$">

#

I'm seeing color: green then a CRLF and the value between the <td> tags (not included here)

shy tendon
#

can you fetchFromActor something that is a string? When I do it, I get [Object object]

#

${setPropertyInEntity('selected', 'mu_unittype_enemy', "fetchFromActor('target','mu_unittype')")}$

Example of my code. The chat outputs the string but the setproperty just sets it as [Object object]

misty terrace
misty terrace
#

I'm sure its something basic and stupid that I'm doing wrong. In the Label Roll Message I have the following

${success:= targetScore - skillRoll}$
...more code...
<table class="tb">
   <tr> 
    <td style="background: #dbdace; width:66%; align: right"><b>Your roll:</b></td>
    <td><div style="color:${concat(success < 0 ? 'red' : '', success > 0 ? 'green' : '', success == 0 ? 'black' : '')}$";>${skillRoll}$</div></td>
  </tr>
</table>```

and what I'm seeing is
formal goblet
misty terrace
misty terrace
#

that was it, thank you ๐Ÿ™‚ that's probably also the solution to my macro problem ๐Ÿ™‚

sullen delta
#

Hi. Anyone knows why I can't change the value on a token's attribute bar when right clicking on it, as you normally can ? Maybe because I entered a key as the value : ${health_points}$ ? Is there a way to change this value directly on the token ?

sullen delta
formal goblet
sullen delta
#

I have another (and I hope last) problem : when I change values opening the character sheet double clicking on the token, they don't change on the original character sheet...

rich glen
#

I'm a bit confused with a part of the guide on GitLab. At one point, there is the example of prompts but if I use the example and execute it in a Label roll message, I get a Math error for the text fields. I'm trying to save the output of the window (which i REALLY hope it's a something separated string ๐Ÿ™‚ ) to use in my scripts. Thanks in advance!

sullen delta
#

Oh I just found out how. Linked token to sheet is not checked by default...

small bane
#

I have a sheet and an "Item Container" but for some reason i can't stuff to this Container, could someone hop on a call to aid me?

rich glen
#

You can't put anything inside it, you mean?

small bane
#

Yep

rich glen
#

Did you set columns inside the Container? With a formula like ${item.armormovementpenalty}$?

small bane
#

This is what i have currently, i'm using a template from a guy named fire, i've already made some sheets by myself, but i can't fix this issue haha

rich glen
#

And you created an Item with that Template, right?

small bane
#

Yeah, i did

#

When i try droping the item on the sheet, nothing happens

#

This is the item using the template

#

Ok

rich glen
#

Anything in the console of the browser? When it happened to me, I had a bad column

small bane
#

It worked

#

i dunno why

#

but i had to recreate the item template

rich glen
#

That's strange. But I'm happy it worked! ๐Ÿ˜„

small bane
#

yeah it is hahaha

#

Thnks for the help!

rich glen
#

No problem, I'm learning myself!

blazing ibex
#

Is there a way to make an item container except for actors?

blazing ibex
formal goblet
blazing ibex
#

Uhh I don't know, I just had another add-on that let you add faction pages to the journal and one of the section lets you drag actors over to it

#

So I was wondering if CSB let you do something similar

formal goblet
blazing ibex
#

Does it show their portraits

formal goblet
#

No

dusky parrot
#

I have a very large character sheet that has a bunch of modifiers in hidden panels for usability, but it causes values that depend on them to break. Is there a fix intended for that in the future?

To replicate the issue:

  • On your template, create a new panel with a number field inside of it, name the number field "ANumber".
  • On the panel's advanced options, have its visibility set to "ShowHiddenPanel"
  • Make a checkbox named "ShowHiddenPanel"
  • Make a label, sets it's value to some equation that utilizes "ANumber" such as "ANumber + 2"

Result - The label will display no value, once you open the panel and load a default value into "ANumber", then the label will get its value

blazing ibex
#

how do i make a roll message hidden in chat?

#

like, gm-only

dense pine
#

How can i show only the link itself?

normal ore
#

Hey there, how's it going?
So, I'm trying to introduce an InputTemplate within a condition. In other words, I would like to call the InputTemplate only if a certain condition is met.
I tried the formula below, but the InputTemplate is being called regardless of whether the condition is met or not.
Here's my formula:

${#item.cabeca ? setPropertyInEntity('item', 'cabeca', "") : equalText(ref(concat('job_', item.subgrupo)), 'true') ? setPropertyInEntity('item', 'cabeca', "true") : ${?#{naosabeequipar}}$}$

Note:
In this formula, my InputTemplate is named "naosabeequipar."
Note: I've tried using the InputTemplate without ${}$, just with ?#{}, but it didn't work.

cosmic karma
#

Hello all! I finally was able to release my Household project. With a manifest and all:

https://github.com/mordachai/household-csb

Manifest here: https://raw.githubusercontent.com/mordachai/household-csb/main/module.json

If anyone can test it and share how it goes for you, really appreciated.

You only need to follow the instructions on git to activate the correct css, other than that it should be pretty straightforward. Thanks for all the help, I'm really happy on how this panned out.

GitHub

Contribute to mordachai/household-csb development by creating an account on GitHub.

formal goblet
normal ore
dense pine
#

is there an issue with item item container headers not aligning horizontally with the rows of items?
It always looks like this, even when i double the width of the actors sheet, it doesnt change. Its always a bit off to the left

rich glen
#

(I use F12 to get the CSS for all the sheet VERY often, that tool saved me multiple times ๐Ÿ˜› )

formal goblet
#

Well, DevTools are build for that ๐Ÿ˜…

rich glen
#

That's true, lol
But not everyone knows about it ๐Ÿ˜›

#

I do have a question myself... How can I get the output of a User Prompt without having math errors? I used the example on GitLab (the concat one) but I can't seem to understand how to get the output (possibile separated with something) to use it in a script.

potent fossil
#

Hello guys, is it normal if 'amacro' does not work in v.11 ?

formal goblet
rich glen
#

So...string (?input) ๐Ÿค”

formal goblet
formal goblet
rich glen
#

I'll try later, thanks!

latent sorrel
#

I am trying to use the following code to insert html tags into the output but it generates an error. How might I replace text with HTML? Thanks

let a = '${idesc}$';
a = a.replaceAll("[ad]","<span class='advantage'></span>");
return a;
}%```
hard crypt
#

Are there any tutorials/videos for getting started other than the git documentation?

rich glen
cinder rock
#

Heyo, I'm having some calculation weirdness that I'm trying to understand.

I have an item that when it is on a character, it increase the character's "concentration mod" by 1.

If a character has a checkbox checked, the concentration mod subtracts 1.

so the formula should look something like this when they have the item and checkbox checked (where 0 is the base before any extra calculations):

0 + 1 - 1

Which should equal 0. BUT its giving me a -1 instead. What's going on with this calculation?

formal goblet
cinder rock
#

Strangely, if I make the item increase the "concentration mod" by 2 (0 + 2 -1) it gives me 1.

formal goblet
#

Show the formula

cinder rock
#

${0 + (demon_form_checkbox==1 ? 1 : 0)}$

formal goblet
#

${demon_form_checkbox ? 1 : 0}$

cinder rock
#

sorry, I typed it out wrong. That's a -1, not 1. BUT this is now what I have, and it didn't change anything: ${demon_form_checkbox==1 ? -1 : 0}$

formal goblet
#

The checkbox-value is already a boolean, no need to check for equality additionally

#

Then show me the whole setup

cinder rock
#

You right: ${demon_form_checkbox ? -1 : 0}$

#

Ok, so here's what we got:

concentration mod = ${demon_form_checkbox ? -1 : 0}$

the demon form checkbox = true

The item on the character has this modifier: concentration mod + 1

#

the value of concentration mod after all the calculation is -1 though, when i would expect it to be 0

formal goblet
cinder rock
#

yeah, I triple checked my compont keys, and just to be sure the item is sending info to the right spot, I changed it to a +3. When I do that, the concentration mod becomes 2, so it calculated it as expected

#

its just when I've got these darn 1s it gets weird

rich glen
#

(Sorry if I interrupt your conversation) I have a Number Field called attributestrength, is there a way to get it knowing the strength string part? I'm thinking Actor.get(fieldname + str) or something similar...

formal goblet
cinder rock
#

Welp. Do you want me to write it up for you? Or you got it?

formal goblet
#

Iยดll do that

cinder rock
#

ty ty

formal goblet
rich glen
#

(Not sure I was clear enough, sorry)

formal goblet
rich glen
#

Oh, ref gives me the field? That's nice... And I need to read the documentation better, sorry to bother you

cosmic karma
#

Ugh, got an annoying problem. I think that the templates Ids changes between save to compedium / importing as module / adventure. Is there a way to prevent that? Everytime I add an item or interact with I got these warnings ๐Ÿ˜ฆ

formal goblet
cosmic karma
#

And I was so happy with my module... Thanks @formal goblet . I can at least play on my copy for now, but it will not be possible to easily share...

blazing ibex
#

i sure can't get it working

rich glen
#
...
let attstr = concat('attribute', pzs[0]);
let attr_val = ${ref(attstr)}$;
...
}%```

I'm trying to use a variable inside a CSB formula but it always tell me **ReferenceError: attstr is not defined**. What am I missing? ๐Ÿค”
formal goblet
rich glen
#

It should be, yes. Is it possible that since the variable is defined outside the ${}$, it can't be used?

formal goblet
#

It should be usable. Don't forget to add quotes around it if you expect a string.

#

CSB-Formulas return unquoted strings (just like how they're displayed in the Sheet)

rich glen
#

It seems I have a problem with using concat in the script part...It should be javascript standard, tho...

#

I'll retry, thanks for the confirmation it should work ๐Ÿ™‚

rich glen
zinc verge
#

it's currently not possible to create macros for roll formulas in item sheets right?

weary imp
#

Hi I'm trying to use CBS (2.4.4) to put together a World/Ruleset for my system of 20+ years
So far I've managed to get the Stats tab prototyped (has the EINT Component Key defined) and I'm trying to create the Skills Tab
but I can't get the Skills tab to work correctly. I'm using a Dynamic Table for the skills.
Each Skill is built from the _equippableItemTemplate Skill and is of Type equippableItem using my
Skill template which has the Attribute with the Component Key "eqn"
My problems are :
1/ The table ROG column Label only ever appears once for the Item Container ?
even when multiple Skills are equipped. I was expecting 1 per Skill Equipped
2/ The Scripts in the ROG element do not appear to work as described in the documentation when using the "item" object.
${EINT}$ => 19 ( correct value for Character sheet
${item.eqn}$ => ERROR ( not sure why this causes error. Its a text field "EINT/20" )
${item}$ => " " ( Im guessing this means its undefined)

Any suggestions what I am doing wrong ?

rich glen
supple latch
#

I am trying to roll with advantage, but i am struggling with it, since this system uses 2d10 instead of 1d20

wow is a effect that grants advantage in carry skill checks. so-

<h3 style="text-align: center;"><strong>${character_name}$ makes a Carry skill check: </strong>${/roll (wow ? (need this piece) : 2d10 ) + strength + endurance}$</h3>

#

another issue that i have due to rolling 2d10 is that there are two effects that read the result if the dice.

so i need a code to read both dice individually and display a text if any of those are a 10
and i need a code to see if both dice rolled the same result.

supple latch
formal goblet
formal goblet
formal goblet
drifting raft
#

For some inexplicable reason, Number Fields inside a dynamic table are no longer able to read formulas in their minimum and default fields. One minute later they can, but now they cannot.
Any insights into why this might have occurred?๐Ÿ˜•

noble tendon
#

Hi, making item container i have problem only show me key no the value

cosmic karma
#

is there a way to set the value of the css in the settings automatically? I can get it by
game.settings.get('custom-system-builder','customStyle')
but what can I do from here?

potent fossil
#

Hello guys so I started redowing the rolls in my sheets that were using /amacro by using the new %{}% syntax.
My first try was:
%{return await game.macros.getName('YourMacro').execute()}%
It worked but it always come with a "undifined" text that shows in the chat. Which is a bit annoying. So i tryed puttin the Macro directly between %{}%. This time, it only rolled the macro as if it was text and didn't execute the script. Am I doing something Wrong?

#

Also, this is the error message I get with the undefined message:

quasi plume
#

Can I use a conditional in the fetchFromActor ?
${fetchFromActor('self', 'kin_Bonus', "kin_Bonus ? 4 : 0")}$

formal goblet
formal goblet
quasi plume
potent fossil
#

Should I like add a line or somehting ?

formal goblet
hollow wadi
#

Hi, is it possible to allow dragging Items from an item container to another actor, in order to pass inventory items around?

hollow wadi
#

all right, thanks!

rich glen
#

It seems that the variables defined in the script part are not usable in the CSB script. I sound like a broken record but I keep getting the "Uncomputable token" message.

formal goblet
rich glen
#

I'm reading the output of a window: let r = '${#concat(...)}$';
Then I split that variable in an array: let pzs = r.split('|');
When I try to do this, it gives me the Uncomputable token: let attr_val = ${ref(pzs[0])}$;
Same thing if I put the pzs[0] value in another string.

formal goblet
rich glen
formal goblet
#

You can nest them into each other

#

But I think it would be easier if you do it this way:

let r = '${#concat(...)}$';
let pzs = r.split('|');
let attr_val = entity.system.props[pzs];
#

We provide the entity-context to every Script

rich glen
#

Thanks a lot!

quaint python
#

This may be the dumb question, but I must ask it anyway
How to add a new template for custom system builder from json file? Found one I needed on Gitlab, but dont fully get how to install it

quaint python
#

Now Im totally confused bcause of, well, abscence of the import button

quaint python
#

aaah
Im not only stupid but blind too :D
TY :D

potent fossil
boreal hull
#

How do I make it so an item container can only hold one item?

brittle moth
blazing ibex
#

Collapsible panels, nice

potent fossil
south marsh
#

Hello, I'm really struggling with this code :
${(switchCase(Dropdownlist, 'A', 1, 0)) ? (setPropertyInEntity('self', 'Checkbox_A', true, false)) : (setPropertyInEntity('self', 'Checkbox_A', false))}$
The aim is to read the key of a dropdownlist then return a 1 if A is selected or a 0 for everything else. Then activate or deactivate a checkbox with the result. Problem, the checkbox stay active whatever is selected....
When I display the result, things works well, true when A is met, false when whatever is met. Is it a checkbox trick ?
Does anyone have any idea ?
Thank's!

boreal hull
#

how do I make it so certain items can only go into certain item containers without completely changing the item template that is used for them

#

is there any way to have the item container only filter specific items into it?

south marsh
zinc verge
#

yoooo these updates sound huge

#

legit can't wait

boreal hull
#

How do I make things a bigger font than the title label

zinc verge
#

put <p style="font-size: <value>;"> and </p> on either side of the text you're wanting to increase the size of. example below

<p style="font-size:150%;"> ${your formula or label value}$ </p>```
blazing ibex
#

add .big { font-size: XXpt; } to your CSS file and put big in your Additional CSS classes

boreal hull
#

okay thanks

boreal hull
#

is there another way than using a completely new template, and then (telling the item container not to use that temp), to filter which items can be placed into which item containers?

blazing ibex
#

the example template has two containers you can place items into. i didn't check to see how it worked, though

boreal hull
#

im not sure if that answers my questions

potent fossil
#

Item containers have no limit of object you can put in them

boreal hull
#

I meant to limit which types of items could go in each without having them each have unique templates

#

not how many, but the type

potent fossil
#

oh you mean type of items without different item templates okay

boreal hull
#

I just made a bunch of items which use the same template, so I dont want to change and make a new one since it would delete the text etc. in the items

potent fossil
#

You can do it with filter I think, if there is a key defining their item type

#

"Filter items

Select templates : You can select which item templates are eligible to be displayed in this container. This is a
first filter for the container.
Add filters : You can add more filters to the displayed items. For each filter, you must enter a component's key
present on the item, an operator and a value to check against. The value can not be a formula, it must be a fixed
value. The is operator can be used to check any value. For example, to filter on checked checkboxes, you would
use <key> is true."

formal goblet
boreal hull
#

yeah i just dont know how to use the filters to achieve what I want

formal goblet
#

Container: A key in the Item Template
==: Check for equality
Container_1: Value to check against
If the conditions are met, it will display the Item Link

potent fossil
boreal hull
#

ah okay yes... and can I make it a hidden label or does it have to be within the text of the item itself to work

potent fossil
boreal hull
#

okay yeah, thanks! hopefully that will work..

#

appreciate it!

potent fossil
#

Wait for Martin's answer, maybe I'm wrong

formal goblet
boreal hull
#

yes gotcha

formal goblet
potent fossil
#

okay thank you, man ๐Ÿ™‚ thanks for taking the time again

boreal hull
blazing ibex
#

does anyone know the css required to alter the red halo from buttons and other interactable elements? ive been inspecting but i can't find where its located

safe scaffold
# blazing ibex does anyone know the css required to alter the red halo from buttons and other i...

I'm new to using CSB and CSS, so I'm not sure if this is what you're looking for or if this is helpful at all, but using the F12 Menu in Foundry to inspect the pages, I searched for "Hover" and found some code on line 321 that starts with "a:hover" that seems to govern 90% of the hovering halo element in the menu pages.

If you are using the actual "Button" Label style, it has an additional halo around the box itself, this is controlled by separate code on line 1471 that starts with "button:focus"

#

~~Problem around reusing formulas within a roll message:

I'm trying to get 2 separate results from the same roll message. I can get it to work in a lot of ways, except for the one I actually need.

I'm rolling 2d6 and hiding the formula. I want 2 outputs: The full roll AND the roll dropping the higher number.
Example: 2d6 rolls 2 and 5. I want one result to be 7, and the other to be 2.

I can get the message to work up until I add anything related to trying to keep the lower number. Can anyone help?~~

#

Nevermind! I got it. If anyone else wants to do the same thing, here's what I did:
Separate the rolls into "roll1" and "roll2", each rolling 1d6 like normal.
Type ${roll1+roll2}$ for the total
And type ${[:min(roll1, roll2):]}$ to get the lower of the two

blazing ibex
safe scaffold
blazing ibex
#

well first i try just disabling the checkbox to see if there's a change

safe scaffold
#

Hmm, well yours looks a bit different than mine, but the part I was editing was the Root section at the bottom. I changed the px size and the color, and it worked for me, updating in real time. Not sure what might be different, and as I said before I'm not very familiar with all of this, so if that doesn't work I'm sorry but I don't have any more ideas

cerulean chasm
#

Quick question, sorry if I'm missing something obvious. I'm trying to do a conditional based on the value of a dropdown, like so ${ dropdown_name == dropdown_value_1 ? 'Result1' : 'Result2' }$ but every time I do I get "Error: Cannot convert "whatever the current dropdown_value is" to a number", is there a better way to do this?

potent fossil
#

Hello everyone, I'm trying to make a Macro in CSB to make an attack roll (so far so good). On this attack roll I put a button than is supposed to call a Defense macro pour defense roll. The button doesn't work. I also want to pass away to the Defense Macro the values of all the attack roll separated by a comma in list. The Defense Macro will have a button too that calls for a 'Compare Roll' macros (I didn't include this button yet in the code since the first one isn't working). Upon clicking this button, it will transfer the values of all the defense roll in a list and the attack rolls in a list to the 'Compare Roll' macro that will compare them and return results. All these macros are working on their own ('compare rolls' works when entering manually the values), the problem now is to make them work together. So my questions are :

  • Why my button isn't calling the Defense Macro properly?
  • How do I pass a list of values from a macro to another?
    (Also it's worth noting I'm pretty bad with coding and stuff so my code is probably messy or not optimized and I may not understand properly complex coding notions)
    Thanks in advance ๐Ÿ˜
    (Re-posting this here aswell maybe you guys can help me too)
formal goblet
boreal hull
#

how does the visibility formula work? what would an example look like?

#

trying to make it so a checkbox is the true/false value condition for the component in question

formal goblet
boreal hull
#

ah okay so it can literally just be that

#

cool

#

How do you get something like an xp bar or hp bar to show up on a sheet?

formal goblet
boreal hull
#

Ah I see gotcha, all good

dense pine
#

This is my item container. If i convert this red - sign into a button, would it be possibly to create a roll message with a formula that toggles the corresponding checkbox inside the item?

boreal hull
#

how could I effectively made a giant 1d100 table that can be randomy rolled upon and the output put into the chat?

boreal hull
#

Can you make random tables, or is that not possible?

vagrant hollow
thin leaf
#

Hi! Could someone walk me through the process of making a label that adds a character initiative to the turn order?
I already have the label made and the custom initiative formula configured, I just need to make it actually roll

formal goblet
thin leaf
#

Ah, so I simply roll it straight from the turn order menu. That works

lament wadi
#

I was wondering, is there any plans to make a scrollable panel component? Is there any way to do it as of now?

latent sorrel
#

You can make a div scrollable using CSS.

potent fossil
potent fossil
#

Also this is a simplified version of the Macro with only the button. Maybe it's easier to understand why it does not work

let messageContent = `
  <p>
    <button data-macro="Attaque" onClick="executeMacro(event)">Lancer la macro Attaque</button>
  </p>
`;

async function executeMacro(event) {
  let macroName = event.target.getAttribute('data-macro');
  let macro = game.macros.getName(macroName);
  if (macro) {
    macro.execute();
  } else {
    ui.notifications.warn(`La macro "${macroName}" n'a pas รฉtรฉ trouvรฉe.`);
  }
};

ChatMessage.create({
  content: messageContent,
  speaker: ChatMessage.getSpeaker(),
}, { render: true });
#

The button appears but uppon clicking nothing happens, no error message aswell

formal goblet
supple latch
#

Much progress was made
but i am sure my sheet still looks hideous for anyone that knows the bare minimum of coding

#

But for the love of me I don't know how these items work
reading through the gitlab I have no idea how to make them drag and drop into the sheet

formal goblet
supple latch
#

i dont know whats wrong

formal goblet
#

Show me the Item Container config

supple latch
formal goblet
#

New Item (3) is a Template, not a real Item (thatยดs what the Item Container says).

supple latch
#

but i am not even using item 3
i deleted it

#

ok, progress

#

it turns in a buttom

#

but doesnt give spread out descriptions

supple latch
formal goblet
supple latch
#

more like i didnt even knew it was supposed to add specific things to the name
flew over my head

#

not finding where to toss this prefix though

#

it doesnt allow me to put straight into the key

formal goblet
sharp prairie
# cosmic karma Hello all! I finally was able to release my Household project. With a manifest a...

Hello @cosmic karma! I DL'd your Household system, mostly to help teach myself how it was all done (ie CSS, formulas, hiding things, etc) and thank you 1000 times over for sharing so we with zero coding/programming understanding can wrap our heads around it. Yours is currently the most complete, in-depth CSB version of a full ready-to-play in existence that I'm aware of. (Besides of course @formal goblet example in the gitlab which has been extremely helpful!) Now of course the RPG itself has me intrigued that I want to add it to my list of things I might run in the future. I want to make sure I get the item container ID thing situated. I think I have most stuff checked correctly going where things should but I have some confusion. Can you DM me when you can, just so we don't gum up this channel? Thanks so much!

supple latch
formal goblet
# supple latch doesnt work, so i did something wrong

Because youยดre using a Dynamic Table in the Item Template, thatยดs why the component keys are not directly accessible (because you have to reference the Dynamic Table first). Iยดd suggest to use a Table instead

supple latch
#

IT WORKED \O/

#

finally

#

thank you very much for the hand holding help

formal goblet
#

pats head

supple latch
#

Now to discover how to "if (item in the container) then (roll this much)"

supple latch
#

Progress!
though i cant figure out where is this freaking red color ๐Ÿ’ข

vagrant hollow
supple latch
vagrant hollow
#

If you are using Monks enhanced journal โ€“ this is overwriting any other css.
Modules are loaded after the game system.

supple latch
supple latch
#

monks...?

#

let me look

vagrant hollow
#

Sorry, I am just trying to answer from my memory. I donโ€™t have access to my codes right now.

supple latch
#

no problem

#

i am 'speaking out loud' as well

#

any clue is a clue

#

yeap, i have monk's tile triggers, but not the journal one

vagrant hollow
#

I can not say anything about tile triggers.
One more idea about journal:
.sheet.journal-entry .journal-entry-content

For the red Roll-Message-Link search in your foundry css files.
foundry root/resources/app/public/css
There I found a lot of my solutions.

supple latch
zinc verge
#

Where do yโ€™all find these css classes? Opening up the css files from CSB in my main foundry file only gives me like a handful of actor and template components and a few other things

potent fossil
#

Hey guys I'm working in macro that update the values of attributes of the selected token and I'm basing my work on the already available macro in the wiki that does that. Altough the macro available only changes the values of ressources by a fix value, is there a way of lettin in be a variable

#

I have like a dialogue that asks the user to right all the operation separated by a comma and the these operation are summed for each attributes and sotred into the script, but when I try to put them inside the formuma as such :

/// ...
for (const a of actors) {
    // ***Define all needed keys here***
    const keys = ['pv', 'adr', 'en', 'con','pvmod','adrmod','enmod','conmod'];
    // ***Define all needed keys here***
    
    keys.forEach(key => currentProperties.set(key, a.system.props[key]));
    
    updateProperty(a, 'pv', '${pv + pvmod}$');
    updateProperty(a, 'adr', '${adr + adrmod}$');
    updateProperty(a, 'en', '${en + enmod}$');
    updateProperty(a, 'con', '${con + conmod}$');
/// ...

The macro fails to work returning an error message for an un defined pvmod whether I put it in the const keys or not

#

I've tried also other methodes using :

let modifications = {
    pv: html.find('#pv')[0].value || "0",
    en: html.find('#en')[0].value || "0",
    adr: html.find('#adr')[0].value || "0",
    cn: html.find('#cn')[0].value || "0"
};

let pvmod = modifications.pv.split(',').reduce((acc, val) => acc + parseFloat(val), 0);
let enmod = modifications.en.split(',').reduce((acc, val) => acc + parseFloat(val), 0);
let adrmod = modifications.adr.split(',').reduce((acc, val) => acc + parseFloat(val), 0);
let conmod = modifications.cn.split(',').reduce((acc, val) => acc + parseFloat(val), 0);

let mods = {pvmod, enmod, adrmod, conmod};

updateProperty(a, 'pv', '${pv + pvmod}$', mods);
updateProperty(a, 'adr', '${adr + adrmod}$', mods);
updateProperty(a, 'en', '${en + enmod}$', mods);
updateProperty(a, 'con', '${con + conmod}$', mods);

But that doesn't do it either

brittle moth
#

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

Features

  • BREAKING - V11 compatibility - System is no longer compatible with v10
  • BREAKING - Deprecated formula syntax has been removed
  • Added function 'notify()'
  • Added formula-support for tooltips
  • Added option to use formulas as options in dropdown-lists
  • [#211] allow usage of [dice tags] in roll formula
  • [#313] Added comparison with match in fetchFromDynamicTable
  • [#314] Added option to hide empty ItemContainer
  • Added an option to display Item status in Item Containers for GM
  • Added the option to disable template filtering in Item Containers
  • Added customSystemBuilderInit hook fired after initialization of CSB

Fixes

  • Fixed formula computing when using conditional modifier list in user input template
  • Fixed issue with undeletable predefined lines trasnferring their status to other lines on line movement
  • [#319] Fixed issue with modifiers when final computed value should be 0

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

#

For your information :
Disabling all temapltes in Item Containers will now display every item, regardless of their template (including item with deleted templates)
The new item status option additionnaly includes an icon ONLY FOR GMs showing if the item's template exists in the world or not. Click a valid icon will open the template as a bonus ๐Ÿ™‚
This should make item troubleshooting easier ๐Ÿ™‚

misty terrace
#

@brittle moth getting an underfined error in the update process. Saying 2.4.4.-->unknown

#

and "error custom-system-builder 100%" on the update bar

brittle moth
misty terrace
#

Hmmm, may be a me issue. got a brand new error message refering to a linked font

#

interesting

#

can't launch the world either. hmmm

brittle moth
#

What is the error when launching your world ?

misty terrace
#

I am using the CustomCSS module and that font set

#

amongst others, that happens to be the first, alphabetically

#

it also nuked my custom system builder system folder

#

hmmm

#

Think I got it

#

Unix permissions issue

#

Folder structure for foundry was done with root

#

I use a different admin account for day to day

brittle moth
#

yep, seems like a permission issue and foundry cannot reset the CSB folder ^^

misty terrace
#

and for some reason didn't inhert ther correct perms to that folder

#

sooo, while I have you...what does the new notify() function do?

formal goblet
misty terrace
#

thanks! saves me some %{}% on target checks

fair yoke
#

Hey, how do I get CSB to call on a script I have up in Foundry?

#

I can trigger it in chat with /macro Draw draws=3 but it doesn't seem to want to work from a roll command in a CSB sheet

fair yoke
#

so if I wanted to have it reference say strength instead of 3 it'd be %{Draw draws = ${Strength}$;}%

#

?

formal goblet
#

Check the examples on how to call a macro

fair yoke
#

OK, trying to wrap my head around it

#

I have the macro setup so I can trigger it in chat with /macro Draw draws=3

#

I just need to tell it to trigger the macro and use a stat defined in the character sheet, which I've set the key up for etc, as the variable number

#

so instead of draws=3 then Draws=PWR for instance

formal goblet
#

That is the closest example: %{return await game.macros.getName('YourMacro').execute({name: '${name}$'})}%: Will execute the macro with the
name YourMacro, pass name as an argument to the macro and return its result

fair yoke
#

so I'd alter the last bit to be execute({Draws: '${PWR}$'})}%

#

?

#

or what am I not getting here?

formal goblet
#

Yep. Just remove the quotes because you pass a number and not a string

fair yoke
#

so just .execute({name: ${PWR}$})}%

#

?

formal goblet
#

If you want the value to be available under the name name in the macro, sure. Otherwise .execute({draws: ${PWR}$})

fair yoke
#

yeah, system I am doing this for uses card draws instead of dice so, some weirdness involved in getting it running

#

got it working, after the macro message it flashes up 'undefined'

#

in a seperate message

#

not sure what that's about

formal goblet
#

The Label Roll Message will always create a Message on its own. This can be disabled in the next patch.

fair yoke
#

nice to know

#

so for now I just have to live with that?

fair yoke
#

@formal gobletOK, done, I want to test it out first but shortly I'll have another sheet to add to the pre-mades for the Exo System, complete with card drawing macro.

#

the Aether system will be next as it uses the same macro, but its sheets are considerably more complex

#

and probably a silhouette core one some time in the next month

normal ore
brittle moth
normal ore
#

cool

latent sorrel
#

Is there a way to assign images or different fonts (with special characters) to Dice so Nice within CSB?

formal goblet
zinc verge
formal goblet
# zinc verge sorry to be a bug, but wanted to touch base with this question again. Are people...

The thing is that there are several instances, which provide their own Styles (Foundry, CSB, Modules, Browser, etc...). To see which styles are provided, you should check them with the Browser DevTools (F12). https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Tools_and_setup/What_are_browser_developer_tools

Every modern web browser includes a powerful suite of developer tools. These tools do a range of things, from inspecting currently-loaded HTML, CSS and JavaScript to showing which assets the page has requested and how long they took to load. This article explains how to use the basic functions of your browser's devtools.

zinc verge
#

ahhh okay bet tysm!

blazing ibex
#

tooltip formulas working good ๐Ÿ˜€

zinc verge
#

oh that's very nice. I'd been wondering why so many people wanted formulas in tooltips but this makes total sense

rich glen
#

Hi all, here I am for more questions! Since I'm making a module for my game, can I put the Templates inside it and make them install themselves? ๐Ÿค”

dusky mauve
#

"Added option to use formulas as options in dropdown-lists"
Coooooooool now we can have DataBase actor

๐Ÿ”ฅ

blazing ibex
#

hm, what's going on there?

blazing ibex
#

also, does anyone know how to add a space between fetch results?
${fetchFromDynamicTable('roster', 'member', 'scout', true) }$

cosmic karma
brittle moth
cosmic karma
rich glen
blazing ibex
#

currently it does first,second,third,etc

dense pine
#

Visibility Formula: Can this formula perform a check it an item container is not empty? So the corresponding panel should only be visible it container has items in it. Is this possible?

lament wadi
#

But I'm pretty sure there has to be an easier way

formal goblet
dense pine
fierce harbor
#

Maybe a stupid question..
Any chance to link/reference a journal page in an actor?

void locust
#

Quick question, maybe more about the inner workings of foundry rather than CSB.

So after a lot of work I managed to finish up my Mekton Z system, is there any way I can export it?

vagrant hollow
vagrant hollow
fierce harbor
vagrant hollow
fierce harbor
rich glen
#

Can I add buttons to the top of the Sheet?

formal goblet
lament wadi
#

Can someone help me pinpoint what am I doing wrong?

I have a "equipped" checkbox in my armor items and I execute this from a rollable label in their item container:

${#item.equipped == true ? setPropertyInEntity('item', 'equipped', false) : setPropertyInEntity('item', 'equipped', true)}$```

My problem is that it works perfectly, but changes in the sheet (an icon swaps color depending if the armor is equipped or not) are only visible after I enter the item sheet
#
<p style="color:${concat(item.equipped == true ? 'green' : '')}$";}$"><i class="fa-solid fa-bookmark"></i></p>```

This is the code for the icon swapping color
formal goblet
formal goblet
lament wadi
#

It works but the error persists

If the item is equipped and I click the icon, item is unequipped and icon's color changes to normal

But if the item is unequipped and I click, the icon doesn't change unless I enter the item's sheet, which by the way shows that setPropertyInEntity has worked, because the checkbox is checked as true

formal goblet
lament wadi
zinc verge
#

nice item containers those look sick

#

also, if I'm not mistaken, that roll formula is straight up telling the icon to register as unequipped whenever you click it, and it's not doing anything else, right? Would that be the issue?

#

set the value of equipped in item to not(item.equipped) is how that's reading to me, which would explain why it unequips every time you click it

zinc verge
# lament wadi No, now it seems to be even more bugged

admittedly I don't fully understand what it is you're trying to do, but I think the checkmark you have in the item sheet itself should do the job of switching the icon color on its own, so having the added roll formula there isn't actually doing anything except telling the icon to register as unequipped whenever you click on it. Personally I'd just remove that roll formula and see if the color swap still functions without it

#

if you're trying to make it so you can change whether it's equipped or unequipped without actually opening the item sheet, I'm not sure what would be best for that other than adding the checkmark itself as a visible component on the item container, assuming that would work

formal goblet
zinc verge
#

right, I understand that.

#

that is my point actually

#

the roll formula is telling the icon to resolve to not(item.equipped) and therefor false every time it's clicked, no?

formal goblet
zinc verge
#

I may be confused. I don't understand how setting the property of not(item.equipped) to the entity item would change the state of the item if the item is already set to not(item.equipped, and the video shows evidently that that isn't what's happening

formal goblet
zinc verge
#

yeah, but is that a boolean? it looks like it's just a one-way command

#

hold on, we might be talking about different formulas

#

${#setPropertyInEntity('item','equipped',"not(item.equipped)")}$
specifically referring to what they currently have typed into their roll formula field in the video, this is what I've been saying was the issue

#

admittedly I don't know a ton about formulas so it's possible this is functioning as a boolean and I just don't know it, but as far as I understand them, I didn't think this was serving a binary function

#

like I get what it's supposed to do, but is it possible that the way the formula is written is stopping the boolean from ever re-equipping after it's unequipped? that was how it was reading to me

formal goblet
zinc verge
#

gotcha that makes sense

#

so wait maybe I didn't know about boolean toggling if that's how it works. Does that mean in theory I can just use setPropertyInEntity to have a boolean to resolve to either one of its results and the boolean will know to flip both ways?

#

or does it specifically have to tell it to toggle off for it to work that way normally?

formal goblet
zinc verge
#

oooooh I see what you're saying. So, for the setproperty formula they were using before, where 'equipped' is in the formula I don't think is referencing the state of a boolean, it's referencing a component key. That's why it's not toggling. It's not saying "set X component to the opposite of its current state" I think it's saying "set the component named 'Equipped' to the inverse of the component 'item.equipped" which would be false because the item they kept opening had the checkbox set at true consistently

formal goblet
#

And a key to a checkbox resolves to a boolean value

zinc verge
#

right, and the checkbox keyed item.equipped (which is what I'm assuming is the key of the item's checkbox) is set to true in the video, and the setPropertyInEntity formula is telling the icon keyed Equipped to set to the inverse value of item.equipped

formal goblet
zinc verge
#

oh we're not? I guess the keys don't actually line up now that I'm looking at it

formal goblet
#

The icon is trying to figure out which color to apply to its own styles. So it just checks for the equip-state, it doesn't modify anything.

zinc verge
#

I know, but what I was thinking was that the icon, based on the roll formula, was setting its color based on what the inverse value of the checkbox was, which would only manifest on click because it's in the roll formula presumably

formal goblet
#

What happens is:

  • The roll formula updates the value of item.equipped with its inverse (old formula is bugged, so it always resolves to true)
  • The icon checks for the equip-state and sets its color-style accordingly
zinc verge
#

oh I'm an idiot

#

I just realized I've been reading the keys wrong

#

item.equipped means the key named "equipped" on the associated item

#

yeah, that all makes sense then

#

I appreciate you suffering my smooth brain lmfao

formal goblet
#

That's a piece of cake. You don't know how the real hell looks like ๐Ÿ˜…

zinc verge
#

no I definitely don't. I can tell by how rarely I'm able to comprehend some of the struggles people post about lmao

#

that's a hype function though, so it can still currently work despite the bug with the setPropertyInEntity('item', 'equipped', "item.equipped ? '' : 'true'") formula? cause I definitely would love to try this as well

formal goblet
zinc verge
#

nice! I will probably test that tonight then

zinc verge
#

it looks like when it resolves to an error, the checkbox does actually toggle back on, but the connection between the checkbox and the actor sheet seems to break altogether

#

so like any formulas I had dependant on the equipped item break and the icon itself resolves to an error

pale tusk
#

Did the way CSB imports key data from actor sheets to item sheets change? Suddenly all my sheets are broken, but I don't even recall this happening after an update--it's just suddenly a thing tonight.

#

I'm getting a ton of errors: "Undefined function getPropertyDataFromActor"

#

Strike that. Just found out.

blazing ibex
#

Does anyone have issues getting GM visibility to work? my player logged in first time and they could totally read this

pale tusk
#

Maybe the "showgm" bit is overriding it? (shot in the dark, there)

hazy saffron
#

Is there a macro written that will iterate over all actors in a game and updated every item attached to the sheet regardless of the template?

pale tusk
#

Related: is there any way to grant players the permission to refresh their actor/item sheets?

blazing ibex
noble tendon
#

hi, have 3 problems.

  1. Making radio buttons for first time, dont know how to configure formules. I wan that when player check button panel is visible.

  2. Item container. How affect with css label the name that is for default, i cant see place for put label.

  3. item container. I cant find the css label to modify the size of image near the name.

zinc verge
#

just discovered something kind of interesting that might be a bug. When I move from my Gamemaster user to my Player user and I try to activate any button labels that the Player doesn't have ownership of, my entire Foundry just reloads as if I hit f5. If I take like an item that has the button on it and put it on my Player's actor sheet and then click the button, everything works perfectly fine, however.

blazing ibex
# noble tendon hi, have 3 problems. 1) Making radio buttons for first time, dont know how to co...

add/edit the CSS below, enter CUSTOMCLASSNAME into the Additional Classes field of your Item Container:

.CUSTOMCLASSNAME .custom-system-item-container-image {
  object-fit: contain;
  max-width: 36px;
  max-height: 36px;
  margin: 0px;
  vertical-align: middle;
  border: none;
  border-radius: 8px;
  background-color: rgba(0,0,0,0.05);
  transition: all .3s ease-in-out;
}

if you want to remove the item.name and enter it into another column:

.CUSTOMCLASSNAME a.content-link { background: none; border: none; font-size: 0; } 
lament wadi
#

Sorry I didn't answer yesterday @formal goblet @zinc verge because we probably have different timezones. none of the solutions seemed to work, so I ended up creating a hidden variable with values 0 and 1. I know it's basically the same way booleans work.

Still, thank you very much for your help and comments ๐Ÿ˜„

boreal hull
#

Hello, I am trying to make a roll command which will subtract a numbered amount from another "resource" label, while also making a roll. (An attack which drains stamina essentially) So how would I go about structuring it so it all works in one roll button?

#

Also how would I go about making the numbers red or green based on if they roll within a certain range of numbers, similar to a crit

blazing ibex
blazing ibex
#

started messing with css grid

#

haven't figured out how to make it respect grid-areas yet but it looks okay

potent sandal
#

How to use radio buttons for the purposes of visibility?

#

WEAPON1_TYPE = WEAPON1_MELEE
WEAPON1_TYPE = MELEE
WEAPON1_TYPE = "MELEE"
Doesnt work

potent sandal
#

Cool. And it doesnt have answer to my question thou

#

The equalText() one?

formal goblet
potent sandal
#

Ok, thanks

zinc verge
lament wadi
#

Yes, for some reason booleans fail but a regular integer set to 0 or 1 works fine

boreal hull
sharp grotto
#

Im trying to pull a 1d4 from a text box to an label to roll an attack. But get the error
Uncaught (in promise) Error: Unresolved StringTerm atk_dice1 requested for evaluation
The formular for the roll is the forlowing "${[atk_dice1]+atk_dmg}$"
Someone clever that can tell me what wrong?
Atk_dice1 is curently just "1d4" in a text box

formal goblet
boreal hull
#

Okay yeah, so thank you for helping! I can elaborate a bit: The player uses endurance points which have to be spent with each attack, so I need a roll button attached to each weapon in the item container where they are placed which does a few things: Subtracts from that endurance pool of points, (which is a number field), then also do the attack roll by adding the bonuses for that, along with the d20 that is the base for the roll, and if I can for aesthetic purposes find a way to color code the result if it falls within a certain range of a mechanic called a blood hit, which for example for a dagger is a roll of 18- or higher ... does that clarify more?

#

but each bloody hit range is different for each weapon, so if there is a way for the formula to find that info from a label on the item? idk

formal goblet
hazy saffron
#

Is there a function on an actor to update/refresh all item templates for items attached to the actor? or is there an item function to force an update on it's template?

formal goblet
boreal hull
hazy saffron
#

Is it doable with a macro of some type do you know?

formal goblet
formal goblet
hazy saffron
formal goblet
hazy saffron
#

There are likely in the low thousands of items in compendiums and on character sheets to do across multiple games.

#

Some type of function on items to update to the new template in code would be very helpful going forward

potent sandal
#

how to refer to item title?

formal goblet
boreal hull
#

the stamina would obviously be the key for the enduance pool i mentioned..

#

but is that describing the stamina - the number of the roll?

formal goblet
boreal hull
#

okay gotcha

formal goblet
boreal hull
#

okay so if I wanted it to instead subtract a certain number in a label on the item itself could I just put that label key instead of 'roll'?

boreal hull
#

cool thank you so much

formal goblet
#

Just donยดt forget to use the item. prefix if youยดre referencing item-keys

boreal hull
#

okay gotcha

#

Attack Roll: ย 
1d20 + (${floor(virtue_mind + agility_mastery_bonus)}$)

${[1d20+:virtue_body:+:agility_mastery_bonus:]}$

${#roll:= [1d20 + virtue_body + agility_mastery_bonus]}$

<div style="color: ${roll >= 20 ? 'green' : roll == 1 ? 'red' : 'black'}$;">${roll}$</div>

${#setPropertyInEntity('self', 'current_endurance', "current_endurance - item.weapon_endurance_expenditure_requirement")}$

#

So i put this into the roll text of the button I wanted to use, and it wont output anything into the chat?

#

maybe I did something dumb?

#

@formal goblet

tired onyx
#

Hey, I'm having an issue editing my character sheet template. This only started happing today:

Whenever I click on an element to edit, I receive the following error in the console:

ConditionalModifierList.js:516 Uncaught (in promise) TypeError: modifiers.filter is not a function
    at ConditionalModifierList.js:516:22
    at Array.forEach (<anonymous>)
    at ConditionalModifierList._getAvailableGroups (ConditionalModifierList.js:514:57)
    at ConditionalModifierList.getConfigForm (ConditionalModifierList.js:276:55)
    at Object.component (template-functions.js:145:54)

Has anyone else run into this error of not being able to edit their actor templates anymore?

#

I noticed something new on the Active Effects tab, a "group" field.
Is this a mandatory field?

quasi plume
tired onyx
# tired onyx Hey, I'm having an issue editing my character sheet template. This only started ...

When I go into the Source menu of the inspector and temporarily delete the following lines of code:

 static _getAvailableGroups(entity) {
        const availableGroups = new Set();

        game.items
            .map((item) => item.system.modifiers)
            .deepFlatten()
            .filter((modifier) => modifier?.conditionalGroup)
            .forEach((modifier) => {
                availableGroups.add(modifier.conditionalGroup);
            });

// DELETE FROM HERE
        if (entity.system.activeEffects) {
            Object.entries(entity.system.activeEffects).forEach(([effectName, modifiers]) => {
                modifiers
                    .filter((modifier) => modifier?.conditionalGroup)
                    .forEach((modifier) => {
                        availableGroups.add(modifier.conditionalGroup);
                    });
            });
        }
// TO HERE

        return Array.from(availableGroups);
    }

It works just fine, and on actor templates which I haven't touched the active effects menu, it works fine, but even deleting all the existing active effects from a character sheet returns the error above which prevents me from modifying things.

The error seems to be that modifiers does not exist.

Any ideas as to what I am doing wrong would be great.

(EDIT: Noticing that active effects no longer work when removing this code)

tired onyx
#

So simply go into the JSON of your actor sheet and remove the CUB helper code if you accidentally had cub installed at one point.

velvet crescent
#

Hello, apologies if this was fixed in an update -- I am using version 2.4.4 and still on foundry 10. When trying to use a conditional eg ${ X > Y ? 1 : 0} $ with rich text editor in a label, the symbol '>' is registering as '>' which produces a syntax error. is there a workaround I can use to get formatting with conditionals?

tired onyx
#

heh... well, I should've just read that lmao;
you'd think after 7 years of full stack development, I would've gone straight to the documentation haha

forest junco
#

Hey, I am trying to make my own attack rolls for a dynamic table for weapons. The attack rolls in my system are a dice pool based on your agility and attack stat and each die is checked for success against the accuracy (AR) of the weapon. I'm trying to do that using a ref function and a sameRow function. However, when I roll it it says null. Here's my code in the label roll: ${[:agi_score:d:attack_value:cs>ref(sameRow('AR'))]}$

what am I doing wrong?

boreal hull
#

how do you reference the number result of a roll in a formula?

#

is the key just 'roll'

sharp grotto
#

anyway to change or create new active effects ?

zinc verge
#

I believe that's being added in a future update. Poll info got released recently that had that on the list of upcoming changes to patch 3.1 I think

#

iirc it was low priority but fingers crossed. If not 3.1 it'll hopefully be a patch shortly after it

#

until then, there is theoretically the Core Rules Expanded module that advertises being able to add and remove active effects, but I actually tried it myself recently and it appears to simply not work, possibly because of v11 incompatibility. You can currently add new effects with that mod but old ones can't really be edited or removed

forest junco
boreal hull
#

How could I make a formula that would prohibit a PC from using a roll button with the 'condition' that they have enough endurance points needed to use it, and then at the same time 'use text' formula that would notify the PC of that fact as a 'notification'

misty terrace
#

is the dropdown a <select> that I can make into a <select multiple>? Or is there another way to create a multi-select dropdown?

potent fossil
misty terrace
#

Looking Wizi, not sure I can help, but reading your post.

#

Did you console.log the variables right before using them to make sure they're getting assigned a value (or the value you're expecting?)

potent fossil
misty terrace
#

I'm using the following to update a hidden attribute on the character sheet with a varaible that I declare at the start of the macro. Probably pretty obvious and not what you're looking for, but JiC there's something of value...

      await actor.update({ "system.props.actionCounter": actionCounter });
#

(actor is canvas.tokens.controlled[0].actor;)

small bane
#

Hey guys, i need some help, i have these parameters, and need to show them on the chat

#

I've done like this but it didn't worked


<p style="text-align:center;"><i class="fa-solid fa-scroll"><b> Description</b></i></p>

</hr>
<table>
  <tr>
    <td>${!string(sameRow('description'))}$</td>
  </tr>
</table>

<p style="text-align:right;"><i class="fa-solid fa-sack"><b> Cost: </b></i> 2 IP</p>
#

Not even showing the description on the chat ๐Ÿ˜ฆ

quasi plume
# boreal hull anyone could help? im stumped

Here's how I would do this,
Use the visibility option to display your button when they have the endurance.
"endurance_key">=1
I assume your endurance is a number field.
The button will disappear when it reaches 0.
Make a new label/text field to become visible when they run out of endurance using the visibility option.
'"endurance_key"<1'
If you want to notify your PCs they are out of endurance I haven't used the notify() function yet but I'll look into it when I have time.

formal goblet
forest junco
quasi plume
# boreal hull anyone could help? im stumped

ok I messed around with notify
${ap_Bar>=1 ? [d20] : notify('warn', 'out of mana')}$
let's assume your endurance bar is a number field.
then you make a button called attack
replace my ap_Bar with your endurance key and the out of mana with whatever you want. Replace the [d20] with the actual attack roll and it should work.
The only thing I can't figure out is how to disable the attack button BUT it will instead throw an error and notify your players that they are in fact OOM.

zinc verge
#

that's p sick actually

formal goblet
quasi plume
formal goblet
quasi plume
boreal hull
glossy hare
#

yoo

#

can someone help me? Why when i write the following inline roll:

[[/r (1d10+10)[slashing damage] + (2d6)[elemental damage]]]{damage}
```

foundry display like this:
#

and not like this:

#

i need to not display the brackets

quasi plume
glossy hare
#

elemental and slaslishing are just labels

#

to know damage types

#

my problem is because the roll can ocuppy a large portion of the line, thus becoming ugly to see

#

i was thinking inmaking a damage types for my rolls

#

i'm using inline rolls because it's a complex command lol

quasi plume
# glossy hare to know damage types

I would have to look up how to hide rolls in foundry inline but CSB has a nice roll message you can use.
The # at the beginning of the formula will hide the roll.
${#[d20] <i>am I strong dad?}$
This will only display the message and hide the d20 roll.

quasi plume
# glossy hare i'm using inline rolls because it's a complex command lol

CSB allows for crazy formulas like this
${ac:=fetchFromActor('target' , "ac")}$ ${hp:=fetchFromActor('target' , "hp_Current")}$ ${beast:=fetchFromActor('target' , "beast_Bonus")}$ ${kin:=fetchFromActor('target' , "kin_Bonus")}$ ${attack:=[d20+:backgroundSTRmod:+ceil((:backgroundBLTmod:+:backgroundARCmod:)/2)+:hc_Attack:]}$ ${damage:=[d6+:backgroundSTRmod:+ceil((:backgroundBLTmod:+:backgroundARCmod:)/2)+:buff:+(beast and :pc_Fp: ? 4 : beast and serrated:)]}$ ${crit:=damage+[d6]}$ ${chat:=ap_Bar<1 ? notify('warn', 'NO AP left!') : attack>=ac ? setPropertyInEntity('target', 'hp_Current', "hp - damage") : attack>=ac+10 ? setPropertyInEntity('target', 'hp_Current', "hp - (crit+damage)") : attack<ac ? setPropertyInEntity('target', 'hp_Current', "hp - floor(damage/2)") : 0}$ ${setPropertyInEntity('self', 'ap_Bar', "spam==1 ? ap_Bar - 4 : ap_Bar - 5")}$ <h1>${hp - chat}$ <br/ >Damage Dealt
All of that in a label button that will only display the damage and the words Damage Dealt

glossy hare
#

i know right

#

look at my roll command

#

real big

#

the reason i'm doing this

#

is because i want to my players be able to create they own items

quasi plume
#

It looks beautiful

glossy hare
#

like this

#

tbh

#

i used alot csb to make my homebrew system

#

i think i used almost all of it

quasi plume
#

So is it possible to let your players create items or have you run into a wall?

glossy hare
#

yes i can

#

the problem

#

is a really big small one

#

the backets

#

because its ugly

#

my roll display this:

#

( i can translate it if you need)

quasi plume
#

I get the jist, you don't like the look. Pretty cool you can allow your players to make items. I'm surprised CSS can't fix this problem albeit I'm not proficient in CSS

glossy hare
#

because the brackets are rendered

#

and if use div insinde inline rolls (those buttons)

#

it will break

#

because foundry doesn't know how to habdle a <div>

#

well

#

sad

quasi plume
#

I want to know the answer but I have no idea how to find it lol. It's fascinating. I wish you the best of luck and if you figure it please let me know. When Martin gets back on he's the guy.

glossy hare
#

or something like that

#

because i tested the same command in pf2e system

#

it doesn't display the brackets

tidal quiver
#

Hi, I'm trying to build interactive character sheet for polish game system "Sล‚owianie mitologiczna gra fabularna" and I've come to a problem of rolling initiative. I can make a button for that that does roll dice how I want, but how do I link it to the actuall initiative in combat tracker?

tidal quiver
#

Nevermind, just found on Git that it's basically undoable now. Another question: Does anyone have any good references/sources/guides for creating items and adding them to the players? I'm looking for something to learn how to make weapons, armors and shields, that my players could get. Might also need a way to implement upgrading them.

Tl;dr: Looking for sources on making weapons/armor in CSB and adding them to players

somber bay
#

Hey if I us CSB to build a mainstream system with the consent of the creator... what is the best way for me to distribute the 'world' I created? Should I make it a downloadable world for CSB? Is there a way to convert it into a system?

glossy hare
#

i created a system literally like that

glossy hare
#

i think it is the best IMO

tidal quiver
glossy hare
#

just gimme one minute

#

i will open foundry now

#

just to show if what i did is what you want

#

@tidal quiver

#

you want to create itens

#

like that right?

tidal quiver
#

From what I understand, I think so. Let me shoot you a pic of what it looks in the book

glossy hare
#

๐Ÿ‘

tidal quiver
#

So I basically have:
Item name | damage dice | requirements (unnecessary) | attributes (they actually change some things like add damage or give you -1 on evasion) | price (not needed) | availability in forts (not needed | availability in villages (not needed)

Last three columns are not needed at all

glossy hare
glossy hare
tidal quiver
#

I didn't touch items yet as I couldn't find where to start with them, but I have more or less something of a character sheet

glossy hare
#

first thing you need to think before making a item template

#

you want to make 3 different itens (weapons - shields - armor)

#

so you will need to make 3 items templates

#

for example

#

in my sheet. there are 3 categories melee weapons/ranged weapons/other itens

#

one thing you may want to do too, is to create a generic item template

#

that you change the type inside of it

#

for example

#

i did that

#

but the config sheet is like that:

#

really big big

tidal quiver
glossy hare
#

you can make a weapon template, and inside of it you can make a dropdown list, and you choose the weapon type.

#

want to go to VC?

tidal quiver
#

Can't :/ Too much on head on top of working on it ๐Ÿ˜›

glossy hare
#

don't worry

#

so

#

after you create a item template

#

you design it

#

making the fields and yadda yadda

#

to show them in sheet you will need to create a item container

formal goblet
#

Think of Item Templates like Actor Templates, they are more or less the same.

glossy hare
formal goblet
#

more or less, but I agree with your point

glossy hare
#

also martin

#

in wanted to talk to u

#

or the other dev

#

let me ask, what do i need to know to start contributing to CSB?

#

i know that foundry is made in JS and React

#

and i know both, but i not too deep in it

glossy hare
#

OKIIIIIII

#

thanks

#

and one more thing

#

i created my system with CSB, but it's to complex that i needed to create it as a compendium/module

#

do you know how do i can setup the download link with github?

formal goblet
#

Nope, Iยดve never done module-dev and touched compendiums before ๐Ÿ˜…

glossy hare
#

sad

#

i think i will need to ask foundry dev discord

#

well i look at the issues

#

if i can solve someone

#

A

#

YES