#Custom System Builder
1 messages ยท Page 13 of 1
What was the CSB-Version?
2.4.4 the latest
Meh, not again ๐
Can be a pita maintaining 2 versions ><
@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?
- Yeah, Items can have Label Roll Messages (like Actors)
- No, it is not. Items cannot add other Items or add entries to a Dynamic Table when dragged to an Actor.
And can I have reference to this label roll messages from a item container?
No
Humn... Ok, thank you
The Item Container can create Label Roll Messages on itยดs own and reference the stats of the corresponding Item
Would it be useful for you to have an item modify the visibility of, say, a panel or something that holds class-specific info?
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
I know. That was just a not-too-smart workaround ๐
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.
Ok! How can i do it? This sound good
Would require some Javascript-knowledge: https://gitlab.com/custom-system-builder/custom-system-builder/#45-scripts
I am afraid that what is the instruction to add item to an actor
But, thank you anyway
I've made a repository for my module, if you have the time (and the patience), maybe my mistake is visible for you. I'll keep debugging, anyway... https://github.com/duergar85/csb-white-wolf-health-component
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
This would be [5d6kh2]
Oh, maybe I misunderstood. You want to keep all the highest values, whatever number they may be ? In your example, keep all the 5s ?
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
I think that's the only way, I don't think Foundry has a built-in way to do it :/
What language does the scripts use? The ones between '%'? JavaScript?
Between %{}% is Javascript, between ${}$ is the CSB Formula syntax ๐
I wrote a Macro to count twice the 10s and once 7-9 for Exalted and I used exactly that method, with the foreach and everything
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 ^^
Oh, can you show it, please? Would be nice to have an example. Is it in this chat?
It's not here and I don't know how to send it in a clean way, is there a tag for "code"?
You can use three backticks to send code in Discord
``\`
Triple ` I think
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>`;
});```
Thank you very much ๐
sroll is the roll formula
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!!
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
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
As I don't know what to specifically ask, and I am reading the link I was provided above, I was told CSB "has some nifty ways to make that sheet you linked to". I am linking that sheet here, in hopes someone might point me to those nifty ways, or the keywords I can use to find things unknown to me! https://www.dropbox.com/scl/fi/kaypjmqwubkeu8ii7z39n/Character-Sheet-No-Spiral.pdf?rlkey=eabopj74rysgni0h6tmsyhdll&dl=1
Thanks, I'll check it out!
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.
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 ๐คฃ
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...
@brittle moth ^
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
I see. I'm gonna add a customSystemBuilderInit hook to help for this, it should do the trick ๐
Thanks, man...and thanks again for the System, it's VERY GOOD! ๐
If you want to add it yourself and have it ready before the next version comes, you should add this line
Hooks.callAll('customSystemBuilderInit');
in data/systems/custom-system-builder/modules/custom-system-builder.js line 194
Right after the initialization of all CSB's default components
Thanks! ๐
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
Use "Core Settings Expanded"-Module instead
Does this also allow active effect names to be changed?
Yeah, icon and name
Game changer!! Thanks yo!
CSS
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
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?
yes
Beautiful. Love CSB
just place a text editor field to your character sheet
drag and drop the journal pages, and save
So, I think this might actually be a workaround to the limitations of item containers then
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
?
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) ......)
Is there way to trigger a macro when an item is dropped on a character sheet?
Work around I used was a checkbox that didn't do anything but checking it or unchecking it refreshed the item sheet.
lol, that's what i did to refresh randbetween() in google sheets
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'))}$
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?
I imagine if nothing else you could do a setproperty formula for each row in the same label, as tedious as that sounds
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
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'))}$
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
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
adding ,2 to sum() would just be +2 https://mathjs.org/docs/reference/functions/sum.html
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
hm, let's see if that changes anything. already tried removing sum earlier to no effect
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
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
ex. when i tried ${count(fetchFromDynamicTable('roster','lit'))}$ it spat out ERROR
which column is lit is that the one that says "Burn"?
yea. and the values in my template don't look any different from the one used in the example template
and also what is the key for the column your player names are in?
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
oh that has nothing to do with anything. i was using it to test something unrelated
oh, so you just want the formula to add every number in the lit column entirely?
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
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?
latest. had to update because the previous one was super slow
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
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
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
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}$
aaaah okay, so it is just lacking a value
I wonder if putting the conditional inside a switchCase would fix that lmao
yeah conditionals are finnicky. They're one of the things I see create formula limitations most often, which, tbf, is kind of what they're supposed to do in a way
works ${partylit >= (partynum/2) ? 'Bright Light' : partylit > 0 ? 'Dim Light' : 'Darkness'}$
very nice
That can't change description though.
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 }$
You can do nested checks using ().
I'd grab an example from my test files since I remember the whole thing acting real finicky for me when I was trying to write one, but I'm away from my main computer.
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.
This works perfectly. Thank you very much! I had tried something like this myself, but it hadn't worked. I think I didn't put the parentheses around the second condition.
Perfect, happy to have been of help.
Yes, but you would need an extra world script. Cant be done (as far as i know) with only CSB
I am reading about the module Automated Animations, that I want in my custom game and I find the following:
https://github.com/otigon/automated-jb2a-animations/wiki/Adding-System-Support
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
});
}
});
});
}%
I have tried and i have fail...
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
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
Something like: https://foundryvtt.wiki/en/development/guides/SD-tutorial/SD16-Adding-macrobar-support-to-your-Items
In macro-polo Channel there is a Pin how to create world Script
Thanks
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? ๐ค
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.
...I could add something to display AFTER, tho... ๐ค
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
Oh, that's...even better, lol
Thanks
Wait, I can't print it, he expects a number or something... How would I do that?
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;
Ok, understood...
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)
Thanks a lot, it looks better already! ๐
๐ - no problem ๐
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?
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"
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
Use !important to override...
But the best option would be to assign a Class of your own creation
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
I feel like this might not be doing anything? I've isolated where this should work but nothing seems to happen. It could entirely be my lack of fully understanding the CSS fundamentals (my learning is very much a wip)
I used a set operator to have it manipulate a label but it remains blank even with the item in it
For Labels within Item Container, you can access Item props via item.key in a formula. No need to use Item Modifiers for this case.
okay what would an example formula look like for that? sorry im new to this system
${item.name}$ would be the most simple one
I read that the second item has to be a "brother" to the checkbox (same father)
So where would I put that formula? in the item itself? and where would I type what I want the text in the label to be?
This should go to the Label of the Item Container (Label text)
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
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).
AH I get it. Okay gotcha. Thank you so much for explaining more for me.
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... ๐คฃ
Sorry for the ping again (this is just to test the checkbox stuff, again, still learning), from what you said, my best attempt at understanding was that the checkbox needs to belong to the same parent as the background, which this should be working? Because the checkbox and the background belong to the table (parent), yet somehow I can't seem to make this work
Can you show me where you put the class in the checkbox?
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
I'm not sure how else I'd attach it to the checkbox
Good luck
is there some special way linkedEntity works in scripts?
linkedEntity.entityType does nothing
linkedEntity is only present in Labels of Item Containers. Otherwise it is a global object in Scripts.
rigged this together, it's just the headers hidden and the margins shortened to make it look like one table
how do i round down in a lable ?
${(dex_mod / 2)+Armor_prof}$
https://mathjs.org/docs/reference/functions/floor.html You can use most of the math-functions (without the math.-prefix) in CSB.
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
How would one update ForgeVTT to use this version? As on Forge, this version is a seperate "Beta" meaning it cannot be applied to existing worlds
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
Hi, How can I customize the chat card, I would like to disable this two parts: I know its CSS but witch file?
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.
How do I add my CSS to CSB?
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...
There is an option in Configure Settings
Deleting wonยดt do it. You have to actively hide it via CSS.
found it... i guess...
?
So I have to write a whole CSS file for this and upload it here...
Yeah
it would be real nice to know CSS ๐
meh... i will google it...
Any help on how to do this would be appreciated... ๐
It should be like this...
.dice-total, .dice-formula { display: none; }
If it doesn't work, use display: none !important;
Also, https://www.w3schools.com/css/ ๐
If you want to do only that...I think it's enough
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...
Upload it in the User Directory of Foundry, so that the file-picker can select it
at the moment it is here:
but
i still can not see it
(I assume by User Directory you mean User Data
)
Well, seems like you have to enter the path manually
in your file browser, copy the file path in your search bar and then manually add the name of your CSS file to the end
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.
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?
Nope, not with CSB-Formulas alone.
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?
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
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?
Hidden attributes are a solution for formulas that are identical for several labels, donโt fit in labels or values that donโt need to be changeable via sheet. They are only recalculated via otherwise triggered updates of the sheet (e.g. a change in a number field).
Tschuldigung, die Antwort ist wahrscheinlich nicht hilfreich.
I am not sure if I understand your example right.
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
Click the button "Clear Custom Effects" (I think that's what it's called---I'm away from my desk and can't check). Then you can enter whatever you want in the text boxes and icon image. Then save or whatever.
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?
This doesnโt work. For some reason that only seems to save into new slots instead of affecting the original ones Iโd selected. I put in an issue on the devโs GitLab
sum(fetchFromDynamicTable('equipment', 'weight'))
And to do the same in a item container?
It is not supported in Item Containers at the moment ๐
Ok, no problem! Thanks
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}$
there is currently no way to have a label formula display an actor sheet image, correct?
When Item Containers reference a dropdown, they return the key and not the label, is there a way around this?
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?
There is no way around this, you need to recompute the label yourself ๐
You can use the switchcase function for that ๐
The key is what's stored in the item data, the Label is just there for display
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
You can use conditionals for this case: https://gitlab.com/custom-system-builder/custom-system-builder#43-conditions
For example: ${strength < item.strength_requirement ? 'Weak' : 'Strong'}$
You can nest conditionals, like:
${strength<item.strenght_requirement?'Weak':strength>item.strenght_requirement?'Strong':'Normal'}$
This way Normal would be kind of a default.
Oh okay thanks great
No problem ๐
ifi want to use the atribute for HP so i can use hp bars how do i do so then ?
Create a number field with a max. Value defined. Then you can choose this for the HP bar
U are amazig thx โค๏ธ
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...
Thereยดs a typo item.atheltics_weapon_mastery_requirement
Btw, if youยดre unsure where the problem lies, you can break down the formula into smaller pieces and test these
ah okay god hahaha
it seems to work now, thank you so much
its always that one stupid thing you overlook
I received the next answer for my problem with the items
You need to use the hotbarDrop hook and create a macro that does what you want in that hook. Also return false (synchronously) from the hook to prevent the default behavior of creati by the macro that shows the item.
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?
Thereยดs no implementation in CSB concerning the hot bar
Ok, thanks. You guys have done a really good work.
Sorry if I ask for things that are not available
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
just doubling back on this question from before. I know it's been said in the past that they don't have a key; I'm just double-checking that there isn't some other way to reference them?
There isnยดt
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
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
Did you have CUB installed? If so, look here: https://gitlab.com/custom-system-builder/custom-system-builder#313-conditional-modifier-list
I don't have CUB installed, although I did install it a looooonggggg time ago.
would it leave residuals?
Did
ah, I see
I am getting this error in my console. Did I format something wrong, maybe?
You had one job ๐
I am, admittedly, a professional in QA for software development and I am ashamed of myself ๐
tbh, its my day off, but still.
Ah, so youยดre the guy I have to open the same pull request 3 times in the row ๐
lmao
To be fair, it was a ticket full of edge cases
it worked, so ty
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.
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.
I know for sure that dnd5e system does that. I don't remember if it always shows the damage button or not.
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
You should be able to add a second condition nested into the Result section, but you will need to adjust the actual Roll component itself for a die value check. If you want to check both dice specifically you'll need to give them individual tags. That's a fairly small changeup though, and you can make them both hidden in the message itself.
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.
Thaaaaaanks
It works, except the two first lines get printed in the chat message. How do you hide them ?
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.
It does !!! Thankyouuuuuuuu
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.
I guess it would be way easier If you just create the Chat Message with the foundry API and Not with CSB for this. I would do it this way, but maybe there are some tricks how you can do it with CSB.
To achive this with Automation i think Script Magic is necessary.
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?
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)
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 ๐
@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!
Open a ticket in Gitlab. Requests here go down too easily.
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
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?
Can you define a fallback value?
Oh my, I totally had forgotten about the fallback option. Thank you!
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)
A bit different to eliminate redundancy, but itยดs basically the same: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Conditional-text-color-formatting
You can adapt this example here if you want to have prompts before a roll: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Frequently-Asked-Questions#q-i-want-to-make-my-roll-messages-look-prettier
More information about user inputs for Label Roll Messages can be found here: https://gitlab.com/custom-system-builder/custom-system-builder#48-user-inputs
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]
still not working. I changed it to a <div> from a <td>, am still getting the same results.
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
Ah, donยดt forget to use !
where am I missing it?
that was it, thank you ๐ that's probably also the solution to my macro problem ๐
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 ?
https://gitlab.com/custom-system-builder/custom-system-builder/#82-add-complex-attribute-bars (especially the warning below)
OK, thanks. So it's not possible, then... ๐ข
You only need to create a number field with a max-value defined and select the auto-generated attribute bar in the token-config
Ooooh, OK, it works !!! Thanks
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...
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!
Oh I just found out how. Linked token to sheet is not checked by default...
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?
You can't put anything inside it, you mean?
Yep
Did you set columns inside the Container? With a formula like ${item.armormovementpenalty}$?
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
And you created an Item with that Template, right?
Yeah, i did
When i try droping the item on the sheet, nothing happens
This is the item using the template
Ok
Anything in the console of the browser? When it happened to me, I had a bad column
That's strange. But I'm happy it worked! ๐
No problem, I'm learning myself!
Is there a way to make an item container except for actors?
Is this fabula Ultima
You mean an Item Container for Items? We deactivated it for Items, because thereยดs currently no implementation for Items in Items (making Item Containers useless for Items)
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
The Rich Text Area-Component (in dialog-mode) can hold links to entities (be it an Actor, Item or a Journal Entry).
Does it show their portraits
No
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
Pulling an item in the Rich Text Area looks like this:
How can i show only the link itself?
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.
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.
Functions and such are executed regardless of conditions. That's a known issue, which is not easily fixable.
Everything's fine!
Doubt: can I fetch data from a character sheet template for an InputTemplate without using the formula https://gitlab.com/custom-system-builder/custom-system-builder#4210-fetchfromactor
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
There is a 10px margin on the class .custom-system-field-root that moves the bottom part on the right. You have to find the right combo to remove it only from there because if you remove it in all the sheet, it might give some align problems elsewhere. Hope it helps ๐
(I use F12 to get the CSS for all the sheet VERY often, that tool saved me multiple times ๐ )
Well, DevTools are build for that ๐
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.
Hello guys, is it normal if 'amacro' does not work in v.11 ?
Use the string()-function to wrap a user-input-prompt (which return non-strings) in the concat()-function. concat() is unable to coerce numbers/booleans (for whatever reason, ask the math.js-devs...)
So...string (?input) ๐ค
And if you want to use the result of a prompt in a Script, you should inject it via a CSB-Formula. For example %{let value = '${myPromptValueAsString}$'}%
Yeah, kinda
I'll try later, thanks!
There is no need for that anymore, you can use Scripts directly: https://gitlab.com/custom-system-builder/custom-system-builder#45-scripts
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;
}%```
Are there any tutorials/videos for getting started other than the git documentation?
Oh, yeah, I did it! Thanks, I can keep going, hehe
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?
So +1 by Item Modifier and -1 by Formula in the target Label?
Strangely, if I make the item increase the "concentration mod" by 2 (0 + 2 -1) it gives me 1.
correct
Show the formula
${0 + (demon_form_checkbox==1 ? 1 : 0)}$
${demon_form_checkbox ? 1 : 0}$
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}$
The checkbox-value is already a boolean, no need to check for equality additionally
Then show me the whole setup
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
Is concentration mod the exact component key?
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
(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...
Ok, it seems to be a bug...
Welp. Do you want me to write it up for you? Or you got it?
Iยดll do that
ty ty
I donยดt understand what you want. Do you want to replace the string from attributestrength to strength? -> ${replace('attributestrength', 'attribute', '')}$
No, I want to access the number value of attributestrength only by knowing the word strength. Maybe concat the string attribute and strength and then use that value to access the input.
(Not sure I was clear enough, sorry)
${ref(concat('attribute', 'strength'))}$
Oh, ref gives me the field? That's nice... And I need to read the documentation better, sorry to bother you
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 ๐ฆ
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/214 It shares the same issue
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...
does anyone have an example of the rollformula mentioned here?
[#<rollTableName>|<rollFormula>]
https://gitlab.com/custom-system-builder/custom-system-builder#46-add-rolls
i sure can't get it working
...
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? ๐ค
Is the value of attstr a valid component key?
It should be, yes. Is it possible that since the variable is defined outside the ${}$, it can't be used?
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)
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 ๐
attstr value is the right component key but it keeps telling me Error: Uncomputable token attstr...
it's currently not possible to create macros for roll formulas in item sheets right?
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 ?
I made a Macro to roll and I call it with await game.macros.getName('MacroName').execute({param: VAL}) passing the value. Hope it helps.
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.
this works
<h3 style="text-align: center;"><strong>${character_name}$ makes a Carry skill check: </strong>${(wow ? [2d20kh] : [2d10])+strength+endurance}$</h3>
but i wish it was two rolls of 2d10 instead of one roll of 2d20
Dynamic Tables and Item Containers do NOT work well together. And the item.-prefix only works within the Item Container
Extract the roll-formula into 1 single variable:
${roll_formula:= wow ? '2d20kh' : '2d10'}$
${roll:= [roll_formula]}$
...
Should be possible with enough knowledge with Javascript, CSB and the FoundryAPI
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?๐
Hi, making item container i have problem only show me key no the value
Good to Know thanks
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?
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?
My Macro
Also, this is the error message I get with the undefined message:
Can I use a conditional in the fetchFromActor ?
${fetchFromActor('self', 'kin_Bonus', "kin_Bonus ? 4 : 0")}$
Yeah, that's doable
Your macro probably doesn't return anything, that's why it shows undefined
But why 'self'? Is that even allowed? ๐
Oh it's not lol I'm dumb. I'm over thinking it.
My macro is still working fine though, like the rolls shows, advantage and disadvantage too etc...
Should I like add a line or somehting ?
No, there's currently no way to suppress Label Roll Messages (except with errors). https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/280
That's why you have 2 (1 from Macro, 1 from Label Roll Message)
Hi, is it possible to allow dragging Items from an item container to another actor, in order to pass inventory items around?
Not implemented
all right, thanks!
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.
You have to return if you want to use a value from a script in a formula
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.
Because pzs is only defined in the Script-context, the CSB-Formula doesnยดt know about it. You must return the string before you can continue with Formula-processing in CSB:
${ref('%{
let pzs = ...;
return pzs[0];
}%')}$
So I can put CSB-formula inside Scripts but also Scripts in CSB? ๐ฎ
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
Oh, well...it is... ๐
I learned something new ๐
Thanks a lot!
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
Now Im totally confused bcause of, well, abscence of the import button
Game Settings Tab
aaah
Im not only stupid but blind too :D
TY :D
And why doesn't it work when I put the script directly between %{}%
Is it because the macro is async() ?
How do I make it so an item container can only hold one item?
Hello !
Some news for you all ! https://ko-fi.com/post/Custom-System-Builder-3-1-0--Poll-Results-K3K0P4PC7
Collapsible panels, nice
How do I make "undifined" take a value? What shoudl I add in the macro to make it say somehting else than undifined
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!
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?
The issue is that you have to put '0' instead of 'false' for the checkbox to deactivate. I guess it is not that simple xD...
How do I make things a bigger font than the title label
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>```
add .big { font-size: XXpt; } to your CSS file and put big in your Additional CSS classes
okay thanks
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?
the example template has two containers you can place items into. i didn't check to see how it worked, though
im not sure if that answers my questions
I'm pretty sure it's the only way
Item containers have no limit of object you can put in them
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
oh you mean type of items without different item templates okay
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
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."
yeah i just dont know how to use the filters to achieve what I want
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
Create key in that will store the type of your item. Let's say it's called itemtype and it can be either 1 2 or 3. Make sure that all your item are labeled correctly then use the filter itemtype is 1 to display only type one etc...
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
If you have to fill it up it has to not be hidden, but you can make it hidden for non GM I beleive
Wait for Martin's answer, maybe I'm wrong
The key must be a valid key of the Item. And it should be changeable ideally, otherwise you wouldnยดt be able to select different target containers
yes gotcha
btw 
Your macro and Script should have a return if you want something else than undefined
okay thank you, man ๐ thanks for taking the time again
it works, thanks to both of you
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
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
this is what shows for me, but changing it does nothing
What part of it were you editing?
well first i try just disabling the checkbox to see if there's a change
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
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?
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)
I won't try to fix this (too big), I'll just give some advices.
- Check out the console for any errors. It is almost the best debugging-tool you have at hand.
- See if you can create a minimized example, which handles the button onClick-callback (opening a Dialog and creating the Chat Message).
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
The most simple one? checkboxKey
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?
Youยดd need to implement your own component (requires programming knowledge). Otherwise you have to live with the components CSB is offering.
Ah I see gotcha, all good
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?
how could I effectively made a giant 1d100 table that can be randomy rolled upon and the output put into the chat?
Can you make random tables, or is that not possible?
Random tables are a basic function of foundry.
Their output is by standard in chat.
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
You have to go into the system-settings and enter your formula there. Thereยดs no need for a Label
Ah, so I simply roll it straight from the turn order menu. That works
I was wondering, is there any plans to make a scrollable panel component? Is there any way to do it as of now?
You can make a div scrollable using CSS.
Well... That's the weird thing, there is no error message ๐ ๐ but thanks anyway, I'll probably figure it out
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
You have to attach the callback in the script by finding the button in the HTML
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
You have the most already done. Now you have to create the Item itself. Then you can drag it to an Actor.
I did it, it just doesnt add to the sheet
i dont know whats wrong
Show me the Item Container config
New Item (3) is a Template, not a real Item (thatยดs what the Item Container says).
but i am not even using item 3
i deleted it
ok, progress
it turns in a buttom
but doesnt give spread out descriptions
i wanted to do something like this
You probably forgot the item. prefix before every item-key in the formula.
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
You have to put it into the Label text: ${item.name}$
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!
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
pats head
Now to discover how to "if (item in the container) then (roll this much)"
Progress!
though i cant figure out where is this freaking red color ๐ข
As far as I remember its been something like:
a.content-link, a.inline-roll
Attention: This is a foundry css setting, changing it will most probably results in changes of your journals and more.
Thats what i was trying to do
but i couldnt change the background in the journal itself and this red color
Journal background is:
.journal-sheet
If the above suggestion does not work, I would need to search.
If you are using Monks enhanced journal โ this is overwriting any other css.
Modules are loaded after the game system.
Journal sheet does the 'window' of the journal, but not the journal itself
you can see here that i was digging though the colors
monks...?
let me look
Sorry, I am just trying to answer from my memory. I donโt have access to my codes right now.
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
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.
i will search though it
thanks for the tip
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
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
**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 ๐
@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
Are you in Foundry v11 ? I did not have issues with my instance...
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
What is the error when launching your world ?
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
yep, seems like a permission issue and foundry cannot reset the CSB folder ^^
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?
Itยดs just ui.notifications.[type]
thanks! saves me some %{}% on target checks
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
so if I wanted to have it reference say strength instead of 3 it'd be %{Draw draws = ${Strength}$;}%
?
Yeah kinda. But keep in mind, that you cannot define the type when declaring a variable in JS ๐
Check the examples on how to call a macro
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
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
so I'd alter the last bit to be execute({Draws: '${PWR}$'})}%
?
or what am I not getting here?
Yep. Just remove the quotes because you pass a number and not a string
If you want the value to be available under the name name in the macro, sure. Otherwise .execute({draws: ${PWR}$})
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
The Label Roll Message will always create a Message on its own. This can be disabled in the next patch.
@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
What does that mean? [#211] allow usage of [dice tags] in roll formula
With the Dice so Nice module for example, you can specify dice color with a tag on the roll code
Example : ${[1d10[black]]}$
cool
Is there a way to assign images or different fonts (with special characters) to Dice so Nice within CSB?
That should be doable in the Dice So Nice settings (regardless of CSB)
sorry to be a bug, but wanted to touch base with this question again. Are people just going into the CSB css files to find classes or is there some other way to identify them? I'm having trouble finding stuff for like text component input fields (i've found number component input fields just not text ones) and the nameplate input field
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.
ahhh okay bet tysm!
tooltip formulas working good ๐
oh that's very nice. I'd been wondering why so many people wanted formulas in tooltips but this makes total sense
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? ๐ค
"Added option to use formulas as options in dropdown-lists"
Coooooooool now we can have DataBase actor
๐ฅ
hm, what's going on there?
also, does anyone know how to add a space between fetch results?
${fetchFromDynamicTable('roster', 'member', 'scout', true) }$
Just to be sure: the ID thing between containers and warning messages in imported sheets and items was not sorted out, right? Dont know if any of the new features or fixes should have helped with that (I've update and still see the warnings)
No, this has not been fixed yet, sorry :/
It's in progress though, should be fixed in the next version ๐
Million thanks for all the work!
Vertical space between the table rows? I'd use a class on the Dynamic Table that adds padding-bottom...
no, a space between the names: Felix, Guildmaster Osen, etc.
currently it does first,second,third,etc
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?
A workaround could be adding a hidden value in the character sheet, default 0. Then you add a modifier to the item's template +1. If the hidden variable is greater than 0, show the field
But I'm pretty sure there has to be an easier way
Would require a Script, because it is straight up impossible to reference an Item Container in Formulas. Or you use the workaround mentioned above
Good idea, will try that ๐
Maybe a stupid question..
Any chance to link/reference a journal page in an actor?
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?
Rich-text-area with (important) style to dialog editor.
Within you can place a journal link like: @UUID[JournalEntry.UdJdggqKrJuBz8vV]{Charakter PDF}
Till now not as a whole module, cause foundry is rewriting the template and item keys.
IMAO best way is as a zip.
Reciever needs some work for importing, but it works.
Is that the literal string to put in the component? I tried, but it's not working.
That is one of my strings. Yours should look similar but with diverent key.
In your sheet open the richtextarea, head to jour journals, drag and drop one in the richtextarea, delete everything thats not look similar to mine.
Got this
EDIT: it worked. Ty ๐
Can I add buttons to the top of the Sheet?
These are the standard-boundaries. It might look different if you use your own CSS-rules
Got it, thanks!
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
setPropertyInEntity will be executed regardless of the condition. You have to restructure it a bit: ${#setPropertyInEntity('item', 'equipped', "not(item.equipped)")}$
<p style="color: ${item.equipped ? 'green' : ''}$;"><i class="fa-solid fa-bookmark"></i></p>
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
What about setting the color to black then?
No, now it seems to be even more bugged
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
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
item.equipped resolves to true / false. not(true) -> false, not(false) -> true
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?
Uh, no. The formula is for changing the equip-state of the item
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
Do you know how to toggle a boolean?
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
The logic in the formula is fine (in theory). It's just that the system behaves a bit unexpectedly when it comes to setPropertyInEntity() and checkboxes...
The fix would be setPropertyInEntity('item', 'equipped', "item.equipped ? '' : 'true'")
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?
A boolean has only 2 states, true and false. If you reassign the current state with the inverse of the current state, you have effectively created a toggle:
equipped = !equipped;
equipped = equipped ? false : true; //equivalent to above
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
A component key resolves to its value. That's why ${Strength}$ returns e.g. 5 and not Strength
And a key to a checkbox resolves to a boolean value
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
We're not setting any icon there ๐
oh we're not? I guess the keys don't actually line up now that I'm looking at it
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.
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
What happens is:
- The roll formula updates the value of
item.equippedwith its inverse (old formula is bugged, so it always resolves totrue) - The icon checks for the equip-state and sets its color-style accordingly
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
That's a piece of cake. You don't know how the real hell looks like ๐
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
That one should work because the empty string will be treated as a falsy value.
nice! I will probably test that tonight then
just tried it. Looks like the issue GakkunMoon was having still persists with the new formula. It will toggle the boolean to false once, then leave it at false on second click, and then on third click it resolves to an error
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
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.
Does anyone have issues getting GM visibility to work? my player logged in first time and they could totally read this
Maybe the "showgm" bit is overriding it? (shot in the dark, there)
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?
Related: is there any way to grant players the permission to refresh their actor/item sheets?
hm maybe. its the only part that works, lol
hi, have 3 problems.
-
Making radio buttons for first time, dont know how to configure formules. I wan that when player check button panel is visible.
-
Item container. How affect with css label the name that is for default, i cant see place for put label.
-
item container. I cant find the css label to modify the size of image near the name.
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.
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; }
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 ๐
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
this is how i made a button that rolls a bunch of D6s on a Exploration rollable table, uses the highest result, then removes extra dice from the pool:
<table><tr class="big"><td>Exploration</td>
<td class="right">${Event:=[(1 + :pos:)d6k]}$</td></tr></table>
<p>${![#Exploration|:Event:]}$</p>
${#setPropertyInEntity('self', 'negmod', 0)}$ ${#setPropertyInEntity('self', 'posmod', 0)}$
started messing with css grid
haven't figured out how to make it respect grid-areas yet but it looks okay
How to use radio buttons for the purposes of visibility?
WEAPON1_TYPE = WEAPON1_MELEE
WEAPON1_TYPE = MELEE
WEAPON1_TYPE = "MELEE"
Doesnt work
Yeah, comparing text with == is not doable
Ok, thanks
Did the hidden variables actually work? Wanting to try this for myself as well
Yes, for some reason booleans fail but a regular integer set to 0 or 1 works fine
Im not sure which parts of that code would pertain to what I am trying to do... Any help breaking it down?
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 any insight?
Something like that?
${#roll:= [1d20]}$
<div style="color: ${roll == 20 ? 'green' : roll == 1 ? 'red' : 'black'}$;">${roll}$</div>
${#setPropertyInEntity('self', 'stamina', "stamina - roll")}$
More details would be helpful.
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
Just create a number field for that, which defines this.
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?
Nope, you have to open the sheet for every update to update these
okay so to implement that into the code above, would I replace the '20' with the key for that?
Is there any plan to offer a function like that? With the updated CSB, the change from GetDataPropertyFromActor to FetchFromActor means we have to manually open/refresh hundreds of items across several games
Is it doable with a macro of some type do you know?
You define the number field in the Item. Then you check in the Roll Message, if your roll is greater equals to this value. Simple as that
There are currently no plans because there was no request for that
In the future, it would be very nice when a fundamental function is changing/deprecated to have some type of automated process to help with it. I'd make that request.
To be fair, it was deprecated a long time ago. And a migration script can be fairly complicated
Understood on the timing, We've had these items for a while and I guess were thinking there would be a way to auto-update items with their templates
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
how to refer to item title?
item.name
so for the last part, the 'self, 'stamina' and 'stamina - roll', what aspects are those the placeholders for in your mind for what I was describing if that makes sense?...
the stamina would obviously be the key for the enduance pool i mentioned..
but is that describing the stamina - the number of the roll?
I advise to read the description of the function. The necessary parameters are all described there (including some examples): https://gitlab.com/custom-system-builder/custom-system-builder#4211-setpropertyinentity
okay gotcha
Yep. Itยดs basically new stamina = old stamina - roll
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'?
yep
cool thank you so much
Just donยดt forget to use the item. prefix if youยดre referencing item-keys
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
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?
Try removing the parenthesis in the first d20 roll and move the d20 into the delimiters maybe?
${1d20+floor(virtuee_mind + agility_master_bonud)}$
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)
okay ill try that
Ok I figured out my problem.
If anyone in future runs into this, it looks like even though I'm no longer using CUB due to compatibility issues, I had to go into the JSON of the actor sheet and remove it manually, because CUB created an object inside the activeEffects list instead of an array.
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.
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?
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
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?
how do you reference the number result of a roll in a formula?
is the key just 'roll'
anyway to change or create new active effects ?
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
thanks. Now it's returning 0 successes every roll even though the AR on the item is listed as 2
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'
is the dropdown a <select> that I can make into a <select multiple>? Or is there another way to create a multi-select dropdown?
Does someone have the answer to this ?
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?)
Yes the keys are assigned values. Upon using a version of the macro where changes are fixed values, the values change correctly. It becomes tricky when you have to make the change a variable
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;)
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 ๐ฆ
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.
sameRow('symbol_name'), where symbol_name? ๐
In short: Nope ๐
is this just a syntax error? Or am I missing something else?
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.
that's p sick actually
Once a function is defined, it will be executed regardless of the condition. Thatยดs why this wonยดt work as youยดd expect (it will roll and notify)
ah ok so it won't stop the roll. I do have a different formula setup to where it won't stop the roll but since it errors out it doesn't subtract the damage given ERROR isn't a number. Is there a way to hide a button based on a number field AND notify players?
Well, nope. The issue is, that you only want to use notify() in a Label Roll Message. And hiding a button is part of a visibility-formula, not a Label Roll Message.
so the button to notify becomes hidden lol! Nice. Is there a way to execute other labels with CSB or the script functionality?
Just saw this, thank you so so much for looking into how to do this! I much appreciate it!
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
Are the elemental and slashing damage modifiers?
For foundry inline rolls the @ symbol is used to call keys from actor sheets.
[[d20+@STRMod+@DEXMod]]
i didn't know that, but thank
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
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.
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
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
It looks beautiful
like this
tbh
i used alot csb to make my homebrew system
i think i used almost all of it
So is it possible to let your players create items or have you run into a wall?
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)
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
it cant
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
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.
i think it will need to be implemented
or something like that
because i tested the same command in pf2e system
it doesn't display the brackets
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?
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
thanks for answers, it work
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?
i can teach you
i created a system literally like that
make it a module
i think it is the best IMO
Sounds good but how would it look like?
well i guess i can teach you by text lol
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?
From what I understand, I think so. Let me shoot you a pic of what it looks in the book
๐
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
do you have a sheet in foundry already?
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
so, let's start them ๐
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
So shooting at this, I have: One handed weapons, two handed weapons, spears (but I get that those can be hidden just under melee and just have set in them to use other skills), ranged weapons, throwing weapons, shields and armor.
Character can have on him at once two melee weapons, throwing weapon, ranged weapon, shield and armor
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?
Can't :/ Too much on head on top of working on it ๐
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
Think of Item Templates like Actor Templates, they are more or less the same.
You can also take a look at the example: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
tbh, to me a item sheet is a low budget actor that is inside the actor lol
more or less, but I agree with your point
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
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?
Nope, Iยดve never done module-dev and touched compendiums before ๐