#Custom System Builder
1 messages · Page 6 of 1
fetchFromDynamicTable('item.tableName', ...) is possible in an Item Container. Or do you mean something else?
Ah, unfortunate.
TY tho.
Why unfortunate? You could change the keys to have the same values like your Labels. That shouldn't be an issue. 😅
I guess you're right. ||my ocd keying scheme will suffer||
Huh. Your Label Roll Message looks exactly the same as mine (stylewise) 🤣
hm, ill try this when i get home
I think that thus far is looking good for my first attempt ever.
Just making sure, you can't have an Item reference an Actor property in the Item Modifier, right?
using the attached string on the getPropertyDataFromActor function.
Ej. getPropertyDataFromActor("attached", "Strength") gives you Strength from whoever it's attached to
"attached" doesn't seem to be working
If I reference the actor directly it works, but not with the attached string
Attaching an item just means dragging it onto an item container in the character sheet, right?
hey all, is there a way to reference an item's drop-down list entry (label, not the key) in an actor's itemContainer?
You can't reference the label, but you can make the key identical to the label
oh that's simple, thank you lol
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/245
Attached should still be working if you're using it on the Item instead of on the Item Modifier.
I'll have to retry tomorrow, but it didn't seem to work on the item itself either

Not really 😅
You can change the color of the suitcase via CSS.
would be cool if in a future update we could changer the icon
like at least the same way we can add ones in the sheet
Well, this icon is not set by CSB – it is a foundry basic setting.
Finally i am making the little details, but i have a problem with the css. I am editing a copy of character-display.css but i can't find where is the white row color of tables.
How in other systems they manage to change if tho ?
Is it the way item containers are built ?
it still doesnt seem to be working. I am trying to ref...(item.statmodifier, statname). The 'statname' column is for dropdown lists, if that would change anything
the item container accepts magic artifacts, and its second column spits out the name (or if i figure this out the names) of any stat it modifies
the statmodifier is a dynamic table named 'statmodifier' within the item itself with the columns 'statname' and 'statbonus'
good god, my man could you possibly teach me to make stuff that looks that great with css?
Any system which is being raw coded can do basically whatever it wants (limited only by their coders ability). CSB is for us coding plebians who can't just dive headfirst into all the raw javascript and CSS, it's essentially a translator between the regular foundry system and people who don't speak fluent code, CSB does an amazing job of making all this type of customising accessible for those people, but comes with some limitations that people who are able to code directly don't need to worry about.
Yeah, for sure I get this. I was more questioning the complexity of the potential integration of such a feature. I mean, obviously, me having to use CSB and to ask so often for help here tells a lot about my coding abilities, so I'm more trying to have some better understanding of why is it a limitation. Because CSB deals with some incredible other stuff that seems way more complex, I was wondering why is this still an issue. And, I do expect that I'm missing something about the process of integrating this feature that make it harder than what one would imagine, and I was hoping to have more insight on it
that one I can't answer directly, but here is a link to their release plan floating around somewhere which has a list of the feature requests in the order they are planned on being implemented https://ko-fi.com/post/Custom-System-Builder-2-3-0--Poll-Results-T6T8IYASM?ref=email_newpost
Weird question: When executing a token.document.update command in a script macro, is it possible to perform ternary operations within it? The reason I ask is there are 3 properties that I need to change on a token, Height, Width, and Texture.src. However I dont' always want to change all three. The ones that get updated are based upon 3 checkboxes (booleans). I know I can do this with a series of nested if-then-else statements but was hoping to avoid that for a cleaner method.
I forget what this is called, when you 'build' the command you want to execute as a string then execute it.
Can I make the item icon appear in the list of items?
Instead of the gray portfolio icon
I wonder if with the item update to allow for bags there will be a way to have the items in the bag not be equipped to the actor that has the bag
No, can not be done.
Hey all, I accidentally deleted a tab on a character sheet 😭 i do have a backup but wondering how i can copy that tab from the backup template sheet to the current version as i can't find the record in the database? would it be in items as that doesn't seem to include the character sheet in it? or is the other workaround to create a new world using the backup data export and then reinport to my current world?
ok, restored from backup by creating new world from old data - export then re import, phew!
that'll learn me!
so is there any way to have an elseif conditional?
Hello, How I can see card of the item in the chat window?
It called from 'item container' by formula "${item.name}$ ${[3d6]}$"
What do you mean with 'card of the item'?
I don’t get it either.
Do you want to OPEN the item from inside chat?
How to make sure that new initiative throws are thrown every round?
UDP - Problem is Done! This value can be set in the CUB settings
still cant figure this out lol
Well, that's not possible.
You have to specify the item-keys explicitly if you want to display the contained information of the Item in the chat.
You could also create a rich text area in the Item and drag the Item into this field. This would create a Link to the Item.
Post a screenshot
it is the first time ive used this function so i might just not be using it right
You just forgot the quotes.
i only needed the quotes the entire time
man you should add a disclaimer to that function on the wiki
"hey these quotes are needed"
Well, there is a section somewhere at the beginning of 'formulas' just about quotes 🤣
im not reading this thing top to bottom! Im skipping around trying to figure otu what I mispelled
also it still aint working so im tinkering
im assuming i do still need those item. prefixes
For the first arg, yeah. For the second probably not.
okay i needed it for the dynamic table
but not the column
:^) i remember AP computer science. all JS
i hated it then and I hate it now
C++! C++! My kingdom for C++!
Well, to be fair, it's not even JS, it's a custom language. It get's tokenized and interpreted in JS, but that's something the user won't see.
well now I need to ask that other guy who had a really good looking sheet
about CSS and how they managed to get all that extra splash
Sure, do your thing. I'm actually also not a fan of JS. I like TypeScript way more. Or Java if you want something for backend.
I want to get my Turbo Pascal back...
...but i didn't get it in the last 30 years...
rip
:^) hello friend could you describe how one would go about using CSS like that? I can see you have different colors and also those added red details. How would I go about trying to do that?
im like yeast, all i need is a starter
is there a basic guide for writing macros for CSB? i had to find out that you can't just use macros from other creators and learn with them.
for example it seems i can's use ChatMessage.create?
how do you reference properly the actor or the charactersheet?
so any help finding good learning material would be appreciated
I am making the css with help from other person. We made a copy of character-display.css in folder actor, inside system custom system builder.
Visual studio code free program can edit fast the css file.
In system configuration u add the path to the css. And now start editting.
In these css is the general configuration, the same for all labels, tables etc. If u wan configure all tables at the same time u must edit tables in the file. If u wan personalize u need create more tags in the css file and add to the template in advanced configuration.
For example a label for big title. Go to advanced configuration, create a tag name .title and in the css add the tag with all especifications do u want.
https://www.w3schools.com/css/
The GitHub has all the macros documented
How do I make it so that negative values can be written through a Token and not through a character sheet?
Yes
What does “written through a token” mean?
If I use a token to write -25 HP for a character with a maximum value of 20, then his HP will drop to 0 and should drop to -5. Because of this, I have to constantly go into the Character Sheet and manually write negative values there.
yikes - then this will be a bumpy road 😄 if this is all there is then i'm doing very basic things wrong
Did you make a min value in the character sheet?
Oh
But unfortunately, it is still impossible to put values below 0 through the token.
Sorry I don’t know how to solve. You should try out this mod called “always HP” though. It makes HP editing much easier
I tried to install it, for some reason it does not work. Does not see the HP key
Field is empty
props.HP
It work, thx!
Np
Thanks a lot - trick with text area is works
thank you, ill do my best
yep this is way beyond me. ill need a friend to help me out on this one
so for a basic macro - i managed to create a macro where the name of the character (not the token but the linked character sheet) of the selected token is output in the chat. (with actor.name)
how can i add other values from the character sheet? i tried actor.system."key" - but this results in "undefined"
thanks martin - i already looked at that and didn't quite understand it 😄
is there no short solution? for example if you take this and would just output "The Charakter has XXX Strength" would you need all this setup with "for" or is there other ways? if i look at other macros which are written for e.g. d&d 5e this seems to work a lot easier 😅
Well, this macro is more like a template, that can be reused for updating certain values.
If you just want to get a value, then actor.system.props.key it is.
thanks - this works - let's see if i can build some basic functions with this 🙂
with this example: is it possible to update the values with results from rolls. lets say i store the damage of an attack in "DMG". can i use this in the updateProperty function? altering values with plain numbers already works. and using keys from the actor also works.
to be clear: the attack "DMG" is a result of a script macro and not in the charactersheet
Should be fine if you pass this result in the update-function.
i tried:
updateProperty(a, 'current_life', '${current_life - DMG}$');
and
updateProperty(a, 'current_life', '${current_life - ${DMG}}$');
both dont work - which would be the right syntax?
Neither of both. ${}$ represents a formula within CSB. But because DMG is something outside of the system, you need to pass the right value without any formula computation., because these are computed within the actor-context.
So something like this should happen instead:
...
const result = currentProperties.get('current_life') - DMG;
updateProperty(a, 'current_life', result);
...
😦 seems its not that easy - can you use a value in this place? i'm not sure if ComputablePhrase(formula) can use a value instead of a formula?
Should be doable. The logic behind this is simple:
If it is a string, leave it as it is
If it is a key, replace it with its value
If it is a function, parse it
If if is an operator, handle it like a function and replace the values accordingly
If there´s nothing left to compute (no functions or operators), return.
Because you pass a number, the system things that there´s nothing left to compute and just returns this number.
if i put a number there it returns a error
for simplicity i changed it to
updateProperty(a, 'current_life', 15);
the error (might help?)
huh, interesting. I´ll test this out. But a string should work for sure.
yeah a string is fine - but then it writes a string in a number field
i just read in the computablephrase documentation (https://custom-system-builder.gitlab.io/custom-system-builder/ComputablePhrase.html) this:
ComputeStatic: Computes the phrase without any dynamic data such as rolls and user inputs. If rolls or user inputs syntax are present, will throw an error.
Might this be the problem?
No, this is only an issue if you´re using roll-syntax [] or user input-syntax ?${}
That´s not an issue because this happens inside the function:
const getNumberCastValue = (value) => {
if (typeof value === 'boolean') {
return value;
} else if (Number.isNaN(Number(value))) {
return value ?? defaultValue ?? null;
} else {
return Number(value);
}
};
ok - so it seems with converting the number into a string and passing the string into the formula it might work 😩
@formal goblet thank you very much - this seems to be the solution for now - do all calculations before and then convert the result to a string
hello, im using custom system builder to make an interactive system for wanderhome. I wanted to make a calendar that when clicked it displayed the item info about the season/month. I am using Monks Active Tiles to trigger the tile into running a macro. It works for the DM and it displays for the DM whenever anyone clicks it (permissions tested), but the item sheet isn't rendering for the player. 'Ive added the code below, but was wondering if im able to grab the players info on the click and then store it for the options parameters in sheet.render(true, options);
const months = ["Tillsoil", "Monsoon", "Bloommeadow", "Devildays", "Swarming", "Gateling", "Firetop", "Grasping", "Snowblanket", "Frostbite"];
const curmonth = window.pr.api.get('month');
game.items.getName(months[curmonth-1]).sheet.render(true);
if im in the wrong place to ask this, i apologize.
I'd say check the log for any errors. Otherwise... that's probably out of the Scope of CSB, so I can't really help there.
okie dokie, there are no errors unfortunatley. ill check some other forums to see what they say. I couldnt find anything in API documentation but i have a backup plan if this falls through as well. Ty for your time 🙂
Okay, let's say I finished a custom system using the tool and wish to make it into a standalone, for ease of use by the DM. How should I start this process?
The whole system is pretty much contained in a single Character Sheet, and i used some custom CSS for the looks.
i've seen some discussions earlier that it's possible, but didn't go into details.
user data > Data > systems > custom system builder > css > actor
wait
I missunderstood
nvm
that would be the path to pick the css for customization, that one i found earlier hehe'
could you show me how to start customizing stuff with css? :^)
i didn't really do a lot, just putting some backgrounds here and custom fonts there. But you could always pick something like this https://www.w3schools.com/cssref/sel_class.php
and your tool sounds interesting
I just use HTML for fonts and LiB themer for everthing else :P
yeah but i don't know the paths for anything in foundry
i want to clean up the character sheet a bit so that things line up just that much better
add some color and decoration in
but i just cant figure it out
<span style="color:hotpink">
turn the whole thing neon pink
nah text
i actually want it to be a light gray instead of the parchment texture that currently exists
im aiming for something more like the Pathfinder 2e system's art
try it
but that would only recolor my vtt, no?
no
its alright but not quite what im looking for
What don't you like?
@carmine escarp
What's the best way to create a loot chest? Is that an actor type?
is there a way to sort an item container or move them items around within it?
Looking to set up a condition statement to do the following: Change if it is a basic, advanatge, or disadvantage roll using a flag set elsewhere on the sheet.
I have the flag as roll_type using a dropdown, and it works to set visibility for panels and such. However, when I try to use it in a condition like the following, I either get an error or it rolls ALL the dice.
Here is what I have tried: ${roll_type == 2 ? [2d20kh] : [1d20]}$
I also tried embedding another level with: ${roll_type ==2 ? [2d20kh] : roll_type ==3 ? [2d20kl] : [1d20]}$
The variable using the dropdown for roll_type is 1=basic, 2=adv, 3= disadv
Thoughts?
I'd do the following:
${#roll_formula:= roll_type == 2 ? '2d20kh' : roll_type == 3 ? '2d20kl' : '1d20'}$
${[:roll_formula:]}$
Nope, currently not.
Thank you!
You can simulate it, I posted a while back how to move items to different containers using a dropbox in the item template
Yep, misread it as move from one container to another... it's late where I'm at, and I am getting revenge time in from too many work hours
Hello, I'm having some issues with the following field. The props are in spanish and I'd rather not modify the underlying data structure.
The thing is it's throwing "ERORR" and I'm not sure what is and isn't supported, because the ternary seems correct and other ternaries are used elsewhere that work correctly
Hey I found out that conditionals do not allow for strings, only numbers.
They do allow for strings as the fallback values though
For example they allow this:
${sens_class==0?'Backups':null}$```
but not this
```javascript
${sens_class=='Backups'?0:null}$```
may be use something like that
${baseitem:=item_base}$
${equalText('baseitem','CONS')?'Body': ....
Thanks, sorted 😄
thanks for the reply! i'll just be careful in the meantime.
hi !
I want to retrieve the name of my dropdownlist, but apparently this is impossible.
I was advised to take the key and process it.
So I remove the 'sk_' part and capitalize it.
The problem if with skill have several words :
so i want to give a doble replaceAll, but don't work
<p style='text-transform: capitalize;'>${replaceAll(replaceAll(dl_cpt, 'sk_', ''), '_', '')}$ ${int_cpt}$</p>
Just put your first replace all in brackets
Then that should work
Can we change the display?
No separation between Animalia and 3, or maybe not white framed?
Make an ! in the formula to remove the white
ok 😉
This better ^^
${#Victory_point:= Type_res == 1 or Type_res == 8 or Type_res == 99 ? 1 : 0}$
${#Victory_point:= Type_res == 1 or Type_res == 8 or Type_res == 99 ? string('You gain X VP.') : string('This action don't generate VP.')}$
The first formula work, the second no ... 😒
${#Victory_point:=(Type_res == 1 or Type_res == 8 or Type_res == 99 ? string('You gain X VP.') : string('This action don't generate VP.'))}$
Hey - is there a way to change the list of active effects? I know you can change them at the actor_template - but can i shorten the list and change the names of the ones i use?
i have error on this to
Combat utility belt allows you to do it.
Alright then idk. Double check your syntax
(CUB is a mod btw)
Thank you - i'll check that out.
This is not an issue because the key of a dropdown list has no character-limitations (white-spaces are allowed).
this might be outside the scope of what this language can do, but I have a question
English or java lol
I am making a sheet for NPC's and I don't want them to have the full skill list, as most of them would not be used. Instead I am making a dynamic table that I can manually add skills to, ignoring the ones they don't use. I want to have a label that rolls the skill I have added using a fetchFromDynamicTable call
my question is this: Is it possible for me to make a roll message that searches the dynamic table for items on that label's specific row?
Yep, just use user input for the button
i thought user inputs could not be used in labels
ah i think it would just be best if I leave in the whole skill list
as the gm i dont mind having extra info on the page honestly
Do you mean fetchFromDynamicTable(DynamicTableKey, ColumnKeyReturn, ColumnKeyFilter1, ColumnKeyFilter2)? This would return the value of the row, where filter1 equals filter2
i suppose
but i think i have changed my mind on how i will approach it
thanks for the help regardless
No
It the roll formula
${filter:=?{FilterInput}}$
Try that
i want to launch 2d20 if roll need advantage or disadvantage. i have a dropdownlist with this value
<h3>Result : ${Result1:=[1d20]}$ ${Result2:=(dl_type == 'r_advantage' or dl_type == 'r_disadvantage' ? [1d20] : '')}$</h3>
i have this code, but he give me an error, have you idea ?
Formula.js:740 Error: Cannot convert "r_normal" to a number
i try with ref, string, and i can't wotk it
i think its because == sets something to equal another thing
but thats old knowledge from a class with C++ so i am not certain
yes, he want number value and i have string value ...
I think you're supposed to use a different comparator for strings
equalValue(dl_type,'r_advantage') || equalValue(dl_type,'r_disadvantage')
how do I get my tokens to have bars displaying health or AC?
oh @formal goblet halp
Uh, just right click your token and go into the settings?
yes but in the display attribute bars I cant find anything
its all body.contents.xyz.xyz and so on
ive navigated and found what I have for health, but I cannot display its value for some reason
Do you have a number field with a defined max value?
i do not
because i do not know what i would set the max value to
its based on all sorts of things
Well, that´s the issue. No max value no attribute bar
@carmine escarp don't you have to configure the attribute bars first in the actor_template?
how do i set a scalable bar?
Not necessary (and not recommended) if you want changeable values on your token.
so how would I set a health maximum that scales off of other things?
via formula?
i can set a numberfield's maximum value to a formula?
Yeah
O_O - this is very helpful - thank you martin
"Give me a lever long enough and a fulcrum big enough and I shall move the world"
more like
"Give me a ref(concat( chain long enough and I shall automate the character sheet"
im trying to make a tab in a character sheet not visible unless you are a game master but the change never saves when I hit "save". any reason why that might be?
i try it but don't work, i continue searching
${equalValue(dl_type,'r_normal') ? 1 : 0}$
as I can not make the comparison with a character string, I will follow your example and put numbers in key of the types of dice roll
i am trying really hard to get this to work but for hte life of me I cannot. its ugly as hell and it keeps spitting an error
${concat(fetchFromDynamicTable('pcclass', 'class'), '_level')}$
ive tested the individual parts
the fetchFrom works just fine
ive tried adding a ref( to enclose the fetch request. ive shaken up the number of parenthesis. i cannot make it work
Can someone give me a hand. I feel like I'm learning quickly, but I've ran into two issues.
-
I'm trying to get the weight of my items to add together in a label and limit them to a total defined by their max carry weight.
My coding so far is.
${fetchFromDynamicTable(ITEMTAB, ITEM_WEIGHT_TAB)}$ in the label text area. -
I'm trying to use drop down boxes to determine a skills attribute modifier (easily just the attribute itself.) for the purpose of a coded roll.
I'm also wanting an if/then statement that will check to see if a checkbox is checked, and if so, add a line of code to the roll.
Currently, my coding is
${[SKILLATTRIBUTE1] + [1D20]}$
I had planned on working out the checkboxes after getting the initial stuff done.
I can see where my issue may be, but I don't know how to call for it. For example, the dropdowns component key would be "SKILLATTRIBUTE1" and the key for each drop down would be something like "STRSKILL". I assume I need "STRSKILL" to call for the characters "STR" key to get it's data, but I don't know how to call for it. I have tried changing the key to "${STR}$", but I'm unsure if a key can call for another key.
I can provide screenshots if need be.
-
Check this one out: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Frequently-Asked-Questions
-
I think you're looking for this function then: https://gitlab.com/custom-system-builder/custom-system-builder#424-ref
Btw, don't forget to use : for keys inside roll-formulas (everything inside []) -> ${[:ref(SKILLATTRIBUTE):] + [1D20]}$
Oddball question.. can I change a dropdown menu using a roll command? For example, to clear a modifier or to set a roll back to a Basic roll instead of Adv/Dis Adv ? More of a quality of life feature for some of my less tech savy players than anything.
You should keep in mind that fetchFromDynamicTable() returns a matrix, not a string or number.
It should be equalText(), not equalValue() 😅
Check this conversation: #1037072885044477962 message
You'd need a macro if you want to change values automatically.
i have configure the bar but no number display
It's better if you let the system generate the attribute bars for you. So delete your attribute bars and define max-values for your number fields. This is the condition to let the system generate the bars for you.
ok, i delete personal bar, and configure maximum field :
it's fine, but, if i change HP on token, my sheet don't change ... normal ?
Is the token linked to an actor or not? If not, double-click the token to get the sheet of the token.
how to link actor and token ?
Token-settings
I need two pairs of glasses.... sry, now i have a good option checked
now, i'm testing launch 2 dice for fading suns v4 system. use d20 but is not a same advantage and disadvantage like d20 system d&d
for win a roll, we need to get a value egal or low to the goal. The goal is skill + characteristic + modifier.
the problem with advantage, we need to get under the goal value, but the better result. so i can't just use 2d20kl or 2d20kh
I'm assuming for 1, you're referencing the first question asked on the FAQ, but I'm afraid I'm not sure how to utilize it based on the faq's example.
I need to first check what the key is from the dropdown box options. If it is "STRSKILL" then I need it to get the attribute labeled "STR" value and use it in the formula.
I guess the portion of the FAQ part I don't understand is the part where is says " ? 1 : 0}$ " I'm unfamiliar with the meaning of these functions?
It's actually the second point in the FAQ 😅
oh, thats for the weight, I was ment my second question
This is a simple ternary operator (condition ? statement1 : statement2 -> if/then/else)
So what you want is this, I guess: ${ref(equalText(SKILLATTRIBUTE, 'STRSKILL') ? 'STR' : 'DEX')}$
It can be simplified if your options in your dropdown list match the keys of your attributes: ${ref(SKILLATTRIBUTE)}$
OH! So keys are unique across everything. Thats awesome!! I'll simplify as much as I can then. Thank you so much!!!
why doesnt drag ruler work with this?
It does, you need to change the speed provider
im just trying to get it to add a new waypoint on right click and it wasnt updating
Any way to use font-awesome icons in Labels or Rolls other than the designated spot on the form for a single leading icon?
You can use HTML in your Labels and Rolls: <i style="fas fa-check"></i>
do i have to change some settings so players can access the char sheet properly? i'm testing with a second pc and i gave the ownership of a actor to player 2 - but there is nothing in the sheet. in the sheet the content is set like in the picture. if i access the character from my "gm-pc" it shows everything but not from a second pc?
This is just a Problem with MAC 🤮
Thank you for the point in the right direction. After some fiddling, it turns out to be <i class='fa-solid fa-check'></i> but awesome advise!! Thank you again.
I have managed to get my total weight set up with the item container. Does anyone know how to stop it from allowing the total weight to go over a defined max weight?
I want to be able to have a max weight of X, and allow the players to go above that weight by 10. However, when they are above their max weight, I want it to decrease their speed, or modify other things, which I believe I can figure out using the If/Than "?" operator. The main question is, how can I keep it from letting them add items to the item container once a value has been reached?
You cannot prevent a player from adding more items than intended.
That what I was assuming. I assume there is a way to apply a condition (Think exahustion or something along those lines) if they go above their max weight?
Thank you again @formal goblet You're an absolute lifesaver when it comes to learning about this.
Yeah, that's not an issue if you use formulas with conditions.
Cool. I'll play around with that and see what I can figure out. Wasn't sure if that would be overly complicated.
That's exactly how I handled it, characters have an encumbrance penalty that is multiplied by number of multiples they exceed their carrying capacity by.
@brittle moth hi, loving the CSB so far. Is there a way to get checkbox true/false from a formula? ie ${myfield.checked}$ ?
Also how do I show an item key value in a itemlist column? I have "gear_location" as item field. I can filter on it but can't show it in column
Another one. Is it possible to set a value via a roll formula? I'd like to have a click toggler that also sends info to the chat, or just a way to monitor change on field values and log to chat would be better. So that accidental clicks are more obvious and logged for important features.
checkboxes return true or 1 when checked, so you can use the conditional ${chechboxkey ? 'when checked' : 'when unchecked'}$
It's only true/false, but yeah.
I thought it was also 1, such that you could do things like ${key * checkboxkey}$ to return 1 x whatever
I may just not understand how that's working, but that is working in my sheet
Type coercion is the automatic or implicit conversion of values from one data type to another (such as strings to numbers). Type conversion is similar to type coercion because they both convert values from one data type to another with one key difference — type coercion is implicit whereas type conversion can be either implicit or explicit.
In the item container, you can reference item values with ${item.key}$
Use ${item.key}$ as formula in your Label in your Item Container.
Currently only with the help of macros.
oops I was overthinking it, so easy.
I see, I was trying to match key names with column names or putting it in visibility formula like a doofus.
Is there a way to make the Key in an Item Modifier reference another Key?
can a dropdown be populated by a list of other PCs? or mabye I'd make special table for that and just manually input?
Intrusive thoughts wondering if I should do JB2A implementation
I think using ref(key) or ref('key') will do that, it's in the main page on github
I'll check!
I don't see anything about that. To be clear, I'm trying to figure out a way to let the user define the Key to be modified--the part in my image that's the xxxxxx--via a dropdown instead of having to enter formula codes in the Item Modifiers.
not sure it's what you're after - https://gitlab.com/custom-system-builder/custom-system-builder#42-additional-functions
Nope, the key is currently static
I'll see if I can think of a workaround. Thanks for the reply!
Is there any way to export all my templates so that their identifiers, etc., will stay the same and transfer them between games? I want to be able to use shared compendia between my games, but whenever I do the links between items/sheets and their templates get broken.
I just worked this out, might be similar?.
${ref(concat('contacts_',ref('playbook'),'_hold'))}$
playbook is a dropdown, one of the values is bruiser
Which does ref(contacts_bruiser_hold), which has a value of 1 and in the front end shows the value.
i'm using it for almost generic text blocks so I don't need so many duplicates... well until a playbook is weird.
I figured out a workaround using a dynamic table and some creative alternatives. 🤣
At the moment, no. This is a basic foundry problem. Every gameworld wants its one reference keys. Maybe it will become better with V11, cause they rework the compendium system.
Why not? This is a macro related question for yourself, not a CSB related on.
I am using JB2A from within character sheets and everything is working as expected.
Hello, I was messing around with dynamic tables and after removing the dynamic table from the template character sheet, I am unable to create new characters using this template.
I duplicated the template, and tried to troubleshoot by removing elements one at a time, from bottom to top (most recent changes to oldest) until the console stopped reporting errors. It only stopped reporting errors when rendering the character sheet after all elements in the sheet were removed. I tried again, this time removing elements from top to bottom in the sheet, but the errors did not go away in the console until after all elements were removed.
Here is a screenshot of the console error when I try to create or open character sheets with my template.
I'll recreate the sheet from scratch if I have to, but was hoping someone has any insight as to what I may have done wrong with my template to cause this.
The error is caused by a Label, but that´s the only thing I can tell from this error message.
You could also export the template and try to find any irregularities inside the JSON. I was able to rescue some templates over this way.
can I call a macro from a roll formula? or how do I define my own custom javascript formulas?
Do item modifiers need to be done for each individual item or can they be set for the entire template?
I think currently they need to be done for individual items, but if you have a bunch that are the same you can copy paste one that you've done and then change the other bits if that's easier
So how do you do this? Is it just absolutely impossible to have a central game compendium to share between the same system?
The possibility for entire template will come with next CSB update.
There is a module “my shared compendia”, till foundry v9 this could be used for sharing between game worlds.
Since the more restrict system settings of foundry v10, the developer changed the module to D&D only.
But I think with a bit work the module could be changed to CSB only.
But even with this I am afraid that the inter-links will get broken.
Anyone know an answer for this one?
That is my current solution so far: #1037072885044477962 message
nvm, it's working now
Hello all, I'm really new to this and am not sure where to head next to figure this out:
I'm hoping to make it so a dropdown will be able to pick which weapon to refer to when using its stats to calculate combat stats with, am I going about this the right way?
Thanks!
Am I right to be using an item container? Or should I be using a dynamic table somehow to display these?
I recommend making buttons on the weapons for rolls
Would this work for showing players previews with the specific weapon they have equipped? The reason being that I'm hoping to make an FE clone and being able to see the enemy's current dodge and accuracy totals and compare them to your current ones are rather important
Oh I see what you mean. So you want to change stats based on the item equipped and have a dropdown to select items?
In that case a dropdown field will be much easier
Gimme a sec
Thank you so much!
I think the tl;dr of what I am hoping to do is in the bottom left have the items, their Hit Mt, Crit, Wt, Uses remaining etc there, and then be able to pick one to be used for Combat stats in the top right, and have that be what is referred to when targetted by someone else.
I hopefully can figure out most of that, but I'm stuckon this with the dynamic table requirement
- Make a dynamic table with number fields all the stat modifiers you want. For this example, we call the key for the attribute ItemHitBonus and the the table WeaponTable, as well as the text field for the name of the item WeaponName.
- For dropdown lists set the mode to dynamic table and insert the key of it. We will call the Key equipWeapon. Set it to WeaponName.
- Go to hidden attributes and create one. We will call it TotalHitScore
- In TotalHitScore’s formula field, do ${first(fetchFromDynamicTable(‘WeaponTable’, ‘ItemHitBonus’, ‘WeaponName’, recalculate(equipWeapon)))}$
Sorry if I made a mistake in the syntax, GTG now
Thank you so much! This is really helpful!
Hello fellow CSB users 🙂
I'm giving some news, since there has been some time I didn't do so, and there are unsolved bugs in the last CSB release, the one available right now.
Some of you may remember, the last release was made with quite a bit of bugs, annoying bugs (you know like... not being able to open sheets or not being able to edit components). To not let this happen again, I have begun a process of automating some tests, to ensure the quality of each release. Aaaaand this takes time. Much time. But ! It is useful, as I tackled down some more bugs thanks to it, so... I think it's worth the wait for everyone.
So TL;DR, no worries everyone, I'm still working on the system, it has not been abandoned ! I'll be back soon with more and more features 🙂
Thank you for your patience !
And some special thanks to every one in this channel offering their time to give support to everyone, this is an incredible help !
Unfortunately do not quite seem to have it down, but making progress. Will update with what I've tried and am trying soon!
I just realized made a mistake. Recalculate is unnecessary. Just do equipWeapon.
What isn’t working?
Well, I've put ${first(fetchFromDynamicTable(‘ActiveInventoryTable’, ‘ItemHit’, ‘Equipped_Weapon’)))}$ under a Hidden attribute, but it doesn't seem to be referrable for the formula I've put into my Accracy, which is currently ${(SKL*2)+LUK}$
I'm hoping to add the weapon's Hit to that, and have the drop down switch between selected weapons
I suspect I have severely gotten this wrong
Try this
${(SKL*2)+LUK+(first(fetchFromDynamicTable(‘ActiveInventoryItemTable’, ‘ItemHit’, ‘Name’, Equipped_Weapon)))}$
You forgot to ref the name
And you set Equipped_Weapon as a string
ah, yes, i see
Right, so I've done that, and fixed the bits I should have, and ended up with:
${(SKL*2)+LUK+(first(fetchFromDynamicTable(‘ActiveInventoryTable’, ‘ItemHit’, ‘ItemName’, Equipped_Weapon)))}$
However, it seems to still be returning an error :/
Can you provide a screenshot for what you´ve done so far?
🤔
More than happy to, one moment
nvm
The table name is wrong.
Should be ActiveInventoryTable instead of ActiveInventoryItemTable
Yes, but if it doesn’t work on the accuracy either then it shouldn’t change the error
Hmmm, I've fixed that, I think, but still getting the error message, yeah
What does the console say?
Are you using some special characters as quotes? You should only use '.
OH i see
So I misstyped
${(SKL*2)+LUK+(first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemHit', 'ItemName', Equipped_Weapon)))}$
So sorry 🙇♂️
No apologies necessary, you got me a lot closer than I would have been!
Alright
Btw something you should know since you are new to CSB:
You can use HTML in labels
It can be used for styling, font-awesome, and images
The Wiki also has some stuff: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/home
That is both excellent to know, thank you!
I will admit I kept reading the bit about fetching and just couldn't get my head around it, but seeing a directly applied example on my table has helped a lot
tell me if you need any more help setting up your system.
Maybe it can help to remember this pseudo-sql in conjunction with the fetch-function: SELECT <TARGETCOLUMN> FROM <DYNAMICTABLE> WHERE <COLUMN1> EQUALS <COLUMN2> / fetchFromDynamicTable(DYNAMICTABLE, TARGETCOLUMN, COLUMN1, COLUMN2)
That does help, thank you!
hi all - i'm struggeling with the syntax in the item container. i got ${item.itembase==(24 or 25 or 27 or 29 or 31 or 35)?item.itembase:0}$ but this shows the base everytime and not only for the ones i want to. can't i use logical or here / how do i use logical or there?
Well... you cannot do this item.itembase == 24 or 25..., you have to do this instead for every entry: item.itembase == 24 or item.itembase == 25...
So if I wish to make it so that the weapon's damage is calculated either as Mt+STR or Mt+MAG based on whether or not it is magical, do I have it right that I'd want to add a drop down thing to the dynamic chart for physical or magical, then write something like this?
${STR+(first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemMt', 'ItemName', Equipped_Weapon)))}$
At least, I know this would be correct for physical, but how would I change it to MAG for a 'magical' weapon that has magical as its dropdown option?
I keep staring at the wiki and feel like I'm looking in the wrong places lmao
ah ok - well its better than writing one if-statement after the other 😄 - thanks @formal goblet
A checkbox would also be enough because you have only 2 options: first(fetchFromDynamicTable('ActiveInventoryTable', 'IsMagical', 'ItemName', Equipped_Weapon)) ? MAG : STR
Ah, perfect, thank you
Why not item.itembase <= 24 and item.itembase >= 35
It would be possible if there wouldn´t be gaps.
Wait missread
And it´s vice versa btw
Oops
I just realized that lol
yeah 😅 there are gaps 😄
another question - how do i properly pull this information out of the itemcontainer? lets say i have this container which only shows a number with the prober itembase (what we just did). if i want to access that data do i have to reference the item container? just referencing the key "weapontype" with weapontype!=0?1:0 makes the label go blank
uhm - so its not possible for me - i think i cant assign a modifier
i don't have "static items" but a "base-item" which can be everything - or can i somehow get a dynamic item modifier output?
for reference here a screenshot to better describe my "base-item"
UI, willste das nicht aufsplitten auf eigene Item-Templates? z.B. auf Rüstung, Waffen, Inventar?
naja ich kann mir vorstellen, dass es vielleicht nicht die beste lösung ist. ich denke ich muss mir noch überlegen, ob es mir wichtig ist, dass eine "automatische kontrolle" eingebaut ist - ansonsten müssten meine spieler ein bisschen mehr eigenarbeit leisten. ich könnte natürlich die modifier-liste entsprechend erweitern, aktuell sieht die auch schon "etwas größer" aus... siehe screenshot
ich hab es eigentlich so gelöst, weil fast jeder stat auf jedem item rollen kann und deshalb ein universales item mir als beste lösung erschien
Yep, bye bye Übersicht 😅
geht mit excel eigentlich ganz gut 😉
One more syntax question for this evening I swear 😅
I want to make it so that a sum goes as SPD-(WT-CON), but I only want to actually have it as SPD-(WT-CON at least 0), so I don't accidentally give people a speed boost for being stronger than the weight of the weapon they are carrying.
Right now I've got to ${SPD-(first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemWt', 'ItemName', Equipped_Weapon))-CON)}$
But of course, this just creates that issue of adding to the Speed 😅
I'm just not sure what the conditional modifier should look like
Have a look at the math.js-library. There are some useful functions (in your case: min() / max()): https://mathjs.org/docs/reference/functions.html
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.
Ah, so would I put it as ${SPD-(first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemWt', 'ItemName', Equipped_Weapon))-CON max(0))}$ ?
Nope, your max-function needs at least 2 numbers.
Hmm, back to the drawing board to figure this out then 😅
Example: Sum up STR and DEX, but the result cannot be bigger than 5: ${min(STR + DEX, 5)}$.
min(): will return the lowest number from the given parameters.
wouldn't ||${SPD-max((first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemWt', 'ItemName', Equipped_Weapon))-CON, 0))}$|| solve your problem? i think martin wants you to figure it out yourself so i added the spoiler
Ah, okay okay!
So, like this?
${SPD-max((first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemWt', 'ItemName', Equipped_Weapon))-CON), 0)}$
I didn't look at the spoiler as I do want to learn
as someone who has
very little coding experience 😭
@scarlet skiff FYI: https://gitlab.com/custom-system-builder/custom-system-builder/-/merge_requests/14
yeah this would be another way to handle my "item-problem" but i guess until integration it will be a while
i just realised that item modifiers wouldn't really fix my problem since item modifiers apply in every item container (do they?) - and then any item in any itemslot would add the modifier to it - to fix this i already did this:
${itemslot==0?0:(itembase==33?1:0)}$ where itemslot 0 = the backpack - so i would have to add this for every type and every slot - which is way to much (atm 35 bases and 10 different item slots...)
Well, actually, every Item has its own modifier.
maybe to understand it better - i wanted to implement some kind of "fail-safe" so players can't equip a 2-hand weapon at the same time with one-hand weapons
i guess i should just settle with the system i got since it's working pretty good - and everything else will be "trust the player"
and the other thing i wanted to automate was getting the weapon type which is equiped to reference it in other formulas - but i guess i'll just do a dropdown "which weapon is equiped" - is way easier on my end 😅
Yeah, that´s basically impossible. There are almost no possibilities to prevent a player to attach certain Items to his Actor.
Yeah, getting information FROM Items is way harder than letting the Item (or Item Container) handle the logic
hmm - maybe the solution is script macros? i'm not quite sure how to pull information out of the item - but for a start it should be possible with a script macro to check if the item container contains any items?
Ah, well. Item Containers do NOT hold Items. 😅
The Actor is actually the real Item holder. The Item Container is only there to display them.
Thank you so much to @formal goblet and @shut harness both for the help - progress made today with next to no proper scripting experience, likely gonna spend tomorrow learning how to make it so players can target enemies and get the sums for attacking an enemy displaying it on their sheet as a combat 'forecaster calculator'
ahhh so there is no way to get items since you cant distinguish between "carried" and "equipped" items
At least not without workarounds (or if the information is not only needed in the Item Container).
Then you´ll need this one: https://gitlab.com/custom-system-builder/custom-system-builder#428-getpropertydatafromactor
interessting - so you could use this to get the propertydata of the target (e.g. target-AC) and use it for roll-formulars inside the char sheet right?
i'm just digging through the actor data - already found the item props and modifiers (FYI my universal item got 168 modifiers atm 😅 ) - any idea if the containers could be found there? if you go by the .json there are the container named etc. so shouldn't you be able to pull this information with a script macro?
Probably, but I don´t know under which path it is available.
found it
it really helps if you just look at your .json and follow the path there - its the same in foundry
just follow the system -> body -> content -> content etc. path you need
i might celebrated to early ... the item is not placed there so this will not help
#1037072885044477962 message Déjà-vu
can you trigger a macro from a roll formula? like ${mymacro}$ ?
There´s a whole discussion just about this: #1037072885044477962 message
I'm not getting it, is handlebars a module? doing /amacro or {{macro 'xx'}} doesn't work
thanks, now we're cookin'
how do I pass the current actor to a macro from roll formula ? I'm trying something like this to work make a generic roller so I can add modifiers from the sheet later without editing all the formulas on the sheet.
/amacro "gameroll" ${!actor}$ ${!stat_face}$
This has to be handled by the macro and cannot be done with csb-formulas.
There's an example in the Wiki
Here is a place to start. Recommend saving all stats as hidden attributes to make it easier. Not deep into FE so sorry if I did anything wrong.
Make a label for your attack button, and set this as your roll formula
${accuracyRoll:=([1d100])}$
${(accuracyRoll + accuracyBonus) >= getPropertyDataFromActor("target", "Dodge") ? (accuracyRoll >= (100-CritRate) ? “Critical” : “Normal Hit”) : “Miss”}$
Is it possible to add conditions to the modifier list?
Sorry, to be specific. The modifiers on character sheets. Not item modifiers. Things like "dead" "unconcious" "asleep" that whole list
Yes
I can't seem to find it listed anywhere in the wiki or faq. I assume it's going to be in a text file somewhere rather than addable in the system on foundary itself.
I still can't work this out, actor is undefined
{{macro "gameroll" actor "test"}}
this comes out as string "actor"
/amacro gameroll actor "test"
I feel like I'm missing something basic, but I can't seem to get roll table results to work right. My formula is ${[#Random Ancestry]}$ but when I click on the label to make the roll, it shows up like the top message, versus the bottom message which is a roll directly from the roll table.
I'm trying to make a dynamic table for character's available attacks, I have a drop down for the character to select the appropriate stat. How do I fetch the stat's value stored in the stat name?
In the column Accuracy: level + mod
level is an int
column "mod" is the dropdown to choose strength, dexterity, etc, using the exact variable names
strength, dexterity, etc are integers
I'm guessing its something close to
ref(sameRow('mod'))
but am at a loss
Hello. Can you pin the url to the gitlab in this channel ?
It's because I was referencing a Compendium in the Roll Table, rather than text. When I use text it works fine. Not how I'd like to use it, but it'll do.
So, I've began my attempts, and I want to start with a helpful 'combat calculator' for my players that will display their chance to hit, crit, and whether either side is fast enough than the other to get an extra attack. I'm hoping to integrate this onto the main character sheet, so that when the player targets an enemy and looks at their sheet, it will update the calculator values appropriately, and otherwise indicate that no enemy is targeted.
To start with, I'm hoping to get the calculator to show it knows who is targeted.
This was what I attempted for this:
${getPropertyDataFromActor('target', 'name')}$
However, when I attempted to target an opposing actor, and open the character sheet for the token with this line of code, I get the following error:
Error: An error occurred while rendering CharacterSheet 69. Uncomputable token name
I'm assuming this is my bad somehow, but what am I missing? Thank you!
Can you try using it in a roll formula?
Just want to see it it works
Sure thing, one moment!
Hmm, nope, this error comes up:
Uncaught (in promise) Error: undefined. Uncomputable token name
Interestingly the following does work as a roll formula:
${accuracyRoll:=([1d100])}$ ${(accuracyRoll)>=ACC-getPropertyDataFromActor('target', 'DODGE')? 'Miss' : 'Hit'}$
So I imagine I need to add a separate name, perhaps?
I'm trying to get the name of the token being targeted, so the latter, I think?
Ah, the names of tokens can get buggy when interacted with.
Ah, so I'd be better off making an in-sheet property with the name in probably?
Likely yes
Is it possible to Replace a value with another value using the replace function from an Item?
e.g. if the stat Critical was calculated as: (SKL/2)+WeaponCrit - could I add an Item as a skill that replaces SKL with SPD?
Wait, I think I've figured it out, hopefully.
Hmm, nope.
So, I tried putting this as the set (=) function for the skill;
${(getPropertyDataFromActor(attached, SPD)/2)+(first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemCrit', 'ItemName', Equipped_Weapon)))}$
I've also tried:
${(getPropertyDataFromActor(attached, SPD/2))+(first(fetchFromDynamicTable('ActiveInventoryTable', 'ItemCrit', 'ItemName', Equipped_Weapon)))}$
I'm pretty sure I'm missing something silly here 😅
I´d do something completely different:
- Create a hidden attribute:
isSpeedbased: ${}$ - Change your formula to:
${(isSpeedbased ? SPD : SKL) / 2 + WeaponCrit}$ - Create the Item Modifier with the following options:
- priority: 0
- key: isSpeedbased
- operator: set
- formula: true
Okay, awesome, thank you.
A lot of the other skills and such in the game are often based around this kind of thing, will it be productive to try and account for them in the main formula like this in all cases?
So you want to say that Items can change how the points of a skill are calculated?
Ah, yes apoloiges.
Some skills can cause that, while others can add onto attribute values, the latter of which I am pretty sure will be much easier to implement
Well, if a Item just does "Add 2 points to Skill A", then it´s just a simple Item Modifier for that Skill. If Items can change the formula of a skill, then it might be worth to note the formula in a different place (e.g. hidden attribute) and apply that formula with recalculate().
This way your Items can just override the formula-text of that hidden attribute.
Beginning to see why it was advised to do things as Hidden Attributes by m!ke above, gosh.
Example: Apply alternativeSkillFormula if present. If not, use the normal formula
- skill:
${alternativeSkillFormula ? recalculate(concat('$', '{', alternativeSkillFormula, '}', '$')) : SKL / 2 + WeaponCrit}$ - alternativeSkillFormula:
${}$
OR
- skill:
${recalculate(concat('$', '{', skillFormula, '}', '$'))}$ - skillFormula:
SKL / 2 + WeaponCrit
Oh that is awesome
Thank you so much for putting up with me showing up out of no where with a million questions 😅
I asked yesterday, hoping I can get a little more info today. How can I create new active effects on a character sheet. Such as "asleep" "stunned" etc etc,
So is there any way to change an item's ID? I'm desperately trying to create compatibility across different games with the same custom system (so I can have working links to items, etc, without having to uniquely set them up in each individual game), and I have had no success at all. Is this just impossible?
Combat Utility belt lets you
In the actor_template there is a Button with active effects. But i'm Not Sure how recommend it is to use them.
Hi so this time i wanted to ask in advance if/how this might be possible 😅
I want to add spells to my game. So this are items with a new item_template just for them e.g. spell_template. On the item i want to have the name of the spell (which is there by default at the top) and add a few features (e.g. feature1/2/3). The goal is to have a script macro pull the propertys of the spell and or the actor and combine them for the spell attack.
Now my problem is similar to my last one. If i want to call the spell properties from the actor i would need to add item_modifiers for each spell. If i have more than one spell this would break since the properties should be seperate (not like weigth). So has anyone done something like this and a possible solution for it?
I'm leaning to call the actor props to the item and then with a script macro calling all items of the actor. Maybe i can filter this item list by the item_template?
After that i should be able to access the item props for the calculation.
For example i would call the damage bonus of the actor and add it to the damage of the spell. with this spell damage i would run the macro.
So im not sure if this would work properly?
Also calling macros from the sheet is a problem which was discussed above so im not sure if putting macros in the sheet would do anything good.
What are features of a spell?
Properties of the actor and the current item can be combined in the Item Container (if you only want to combine them). Otherwise the actor doesn´t have direct access to the Items, so you´re right that you either have to pull the actor data in the item or you have to use item modifiers. If neither of both is possible, it´ll get really tricky.
You can currently do the following things with macros:
Call a macro from a Label Roll Message (without any formula-computations or messages). Works without problems with \amacro (macroName)
Call a macro from a Label Roll Message with input-parameters. Problem: Will leave the macro-command in chat (ugly) {{macro (macroName) (inputParams)}}.
You cannot do this:
Call a macro from a Label (or any other formula). Problem: The macro-call should happen on every sheet-update, not just once.
I was working on a macro-function, which can call a macro (both for Labels and Label Roll Messages), but there´re some obstacles, so I need some feedback before I can continue.
From the top of my head the important parts i need to input into the macro would be: spellname (=string), and a whole lot of different numbers for the damage calculation (i prepared basically all "features" as numbers e.g. 1=true | 0=false so i can use them in formulas if needed and they can be processed by item modifiers).
spells overlap with the actor props mostly with WAM, damage, BCD, mana_cost (and some more i would need to look up every spell) which should all be numbers (=int). so for example the actor got 5 damage, the spell ads 3 damage -> so when the player uses the macro and chooses the spell it should calculate with (5+3)= 8 damage
i'm not sure if i answered your question with this?
realistically i think i will handle all rolls with script macros since the calculations are pretty wild for stuffing it all into the actor or item sheet. so the only thing i might do is add buttons which call the right macro --> \amacro (macroName) should work (if not its not a big deal)
on a side note: your problem with {{macro (macroName) (inputParams)}} (=ugly chat) should be solvable with world scripts? if the message in chat always starts with {{macro ( you could hook the script on the chat message and show/hide the message based on the content of the message? i use something similar to only show an "apply-damage" button to the actor who got targeted (for everyone else the button is hidden)
The thing is that this macro-call can be anywhere inside a Label Roll Message, not only at the beginning of the message (e.g. if you need to pass the roll-result to the macro).
How did you do that with the button?
I'll provide you the code later.
From a gereral point of view i think it should not matter where the message is. You just need to have a "marker" the world script can identify.
I learned (in the macro-polo channel) that chat messages are handled for every user. So if you want to change the chat for all users you need a world script. Otherwise only the one who uses the macro will be affected.
Can anyone help me figure out why this formula isn't working as a label in an item container?
Roll ${item.dice_pool>0 ? concat(item.dice_pool, 'D+') : ' '}$
The true condition works, but the false condition is returning an error.
(What I'm trying to do is have the label be blank if the dice pool isn't greater than 0, otherwise display the roll text and dice pool.)
What does the log say?
Unexpected type of argument in function larger (expected: Array or DenseMatrix or SparseMatrix or Matrix, actual: number, index: 1)
try ${typeOf(item.dice_pool)}$ and tell me what you get
In most cases, 'undefined.' In one case, 'string.'
Uh, that´s bad. That means that your item.dice_pool is already faulty.
I see. It seems to work correctly in rolls and in the item, though.
What´s the formula of it?
${ref(attribute) + ref(concat(ability,'_dice'))}$
attribute and ability are also keys of the item?
Yes, they're set via dropdown lists.
Show the template (and the dropdown list)
They're set in this item
And I hope, that you know, that if you have attribute: strength and strength: 42, ref(attribute) will return 42 and not strength.
Right. That's what it's meant to do. 🙂
That´s a big item... Btw, AFAIK, you don´t need \", you can use " directly.
Ah wait, might be just in the export. That would make sense
Try out typeOf() for every key in your Item, which you use for the formula and see if you get unusual results somewhere (e.g. matrix or array instead of number).
Doing so. I should check even keys that aren't related to dice_pool?
Everything seems to come up as string with no errors, so far.
You basically check every dependency. If dice_pool is dependent on attribute and that is dependent strength, you first check dice_pool, then attribute and then strength, and so on...
🤷
But it does seem like something that should be possible, right?
You are saying above that the true condition works? So error is a result of a emptiy field?
@formal goblet i wrote you for the button-problem
The true condition does work, yes. So that seems possible?
The formula is syntactical correct
Maybe test placing just a letter instead the space?
I've tried letters, numbers, keys...
What I really wanted to do was hide the label entirely if the condition was false, but that didn't seem to want to work, either.
So better separate this. Place the dont-show condition in the "advanced configuration" of the label and only the show in the roll message.
I initially tried that, but I couldn't get it to work.
damit
One thing that confuses me is that when I display dice_pool on the item, it returns the right value (a sum or 0). When I then reference it from the actor, if it should be 0 it returns as a blank instead.
The blank possibly seems to be the issue?
wrap dice_pool with number() maybe?
Okay, that returns either the right value or ERROR
So, if it would be 0, I get ERROR. Otherwise, it returns the right value.
Okay, I may have found something. It seems like a problem I've had many times before. It seems...default values don't actually work.
I have to go in and physically enter values for the dropdowns on the other items, and suddenly it works.
I was assuming the default values would take, but they don't.
Sound like the same error i got with rich-text-fields. They show up but are not useabale in a rollmessage.
Yeah, exactly that.
Once you enter a value, even a space, then it recognizes the field.
Yeah, EXACTLY.
Okay, if I use it as a conditional under advanced configuration, it affects the entire column on the item container at once, so that won't work. Wish I could make the label icon conditional as well.
Should be doable if you use plain HTML
I didn't know HTML could even do conditionals. Huh.
Well, the conditional part can be handled by formulas. The result will just return the right thing for your HTML.
Hm. Doesn't seem to work, but I'm probably doing it wrong? ${item.dice_pool>0 ? 'dice-d10' : ' '}$
Like I said, plain HTML. That´s not HTML, that´s just text 😛
What do you mean by plain HTML? I'm not trying to attach any markup.
Example: <i class="fa-regular fa-${item.R_Aktiv ? 'check' : 'xmark'}$"></i>
I don't recognize a lot of that. 'fa-'?
Neat. I've never used this before!
And I can just pass the formula with fa-${}$?
Apparently not. <i class="fa-regular fa-${item.dice_pool>0 ? 'dice-d10' : ' '}$"></i> doesn't do anything. Apparently the FA stuff is complicated.
Okay, it works if I don't put it in the roll icon field but instead put it in the roll text, itself.
Very cool.
does anyone know if you can use formulas in number field labels? the description just says: "Label : If set, will display this label next to the field on the sheet"
No
Just make a label before a number field
ok thanks
Is it possible to make some kind of a link or button or the like in a roll that would allow one to show/hide something like a detailed text description?
Ye, just use html
Can you do that without JS?
@pale tusk I believe m!ke is referring to the 'hidden' attribute for HTML
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
My HTML is fairly low-level. I don't understand how this would help me show/hide information, only hide it.
Ah I see, you want to hide and show.
I thought you simply wanted to hide info.
Did you look through the doc I linked@pale tusk ?
I'm not 100% sure but it may be a start to what you want. Sorry I can't be of more help
I did. I'm familiar with making an HTML element hidden, but I don't know how to toggle that. Every method I've seen uses JS.
html is not js...
@pale tusk
<a href="url">link text</a>
That doesn't help with what I was asking about.
Just making a link won't toggle a hidden section in any way that I'm aware of.
Is there a way to do multiple operations off of one dice roll?, if my roll is Xd8s, can I get both the sum and the number of 8s?
I'm pretty Sure Your Question is world script related. At least If you want hide IT based on the individual Player. I guess If you Just want to Show/hide for all the Same then you should be possible to do it without world script
Are item keys and character sheet keys nonexclusive? I know you can use item.X to call for a key off an item sheet. I'm trying to add a roll button to my item container and have it call to the items damage but no combination of code I've tried has worked. Currently just using ${ [1D20] + item.DMGATT }$ I've tried using : surrounding the key with them inside the roll bracket area and without. Once I put them in the brackets the roll button doesn't work at all. My current code will roll, but comes up with an error each time.
I think I see it. 4.2.8 getPropertyDataFromActor. I'll give this a try
I thought it might be something like that. Beyond my ability for now, it seems. Thanks for the reply!
Okay, have a question after all. Using the "attached" special value for getPropertyDataFromActor. When is an item considered attached? I have the item in my test characters item container. I have tested the code by using the characters name instead and it worked. However, when I change the code to "attached" the code goes blank on the sheet.
did you open the right actor? if you open the actor with the token and the token is not linked it's two different things?
Yes, use dice modifiers. 5d8cs=8
Look up foundry dice modifiers for more info
I know how to do that much, im asking if there is a way to get
sum:= 5d8
and
hits:= 5d8cs8
using the same set of dice results and not rolling twice
gimme a sec
I can’t find any on the documentation. I will ask in core
Ty
You’ll need a macro for it
Gotcha. Im guessing I can tie that to something on the sheet to call?
You have to use JS to put it on the sheet
But it can get props from the sheet
Is there a way to link to items from rich text fields, such as @UUID[]{} would do?
You can just drag the Item in there to create the link
No, that doesn't work.
I drag the item in, and it produces the UUID string, but there's no actual link.
Can someone breakdown the attached operator for getPropertyDataFromActor. What constitutes for an item to be linked to an actor? Is this the only way to use a key on an actor from an item as well?
At the bottom of the rich-text component you have to set “Style” to “Dialog editor”.
Than it works
Still nope...
Okay, it was acting weird but now it works. Not sure what that was. Okay, good to know it works with the Dialog Editor. Thanks.
I'm still at a loss on how getPropertyDataFromActor with the attached operator works. I assumed dragging an item into an item container would "link" the item to the actor. But still no luck on it pulling any values from the character sheet.
Can you show what you did?
Just to see if it was working, I wrote that code out as a label. It's supposed to go where the attribute section is of the weapon, but I think I'm going to have to do some redesigning to make that work. I wanted to be able to select the weapons roll attribute bonus with a drop down, and have it be used in a roll on the character sheet on an item container
Seems normal to me so far.
Update a value on the item sheet and check the console for any errors.
Only error is "Specified value "ITEM NAME" cannot be parsed. I've removed the Default Value in the item name text field. No changes.
What version are you using?
Version 10, CSB 2.2.4
If I change is from attached to "test" which is the actors name. it pulls the info
So the code should be working. I just don't know what constitutes an item being linked/attached/
Try out the following: ${getPropertyDataFromActor('attached', "5", 0)}$
It's linked as soon as the Item is dragged to the actor.
Well, at least the fallback-value works.
lol. Yep. Not sure whats going on with it then
Looking at that code. Now that I think about it. I don't think that will test if the attached operator is working. Since we're giving it a value rather than a string to search for on the character sheet.
@formal goblet https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/245 Looks like this is a known bug. I've never used github before, so I hadn't thought of digging through the buglist
I would kill for an undo option right now lmfao. I just accidentally deleted an entire tab while trying to edit it.
I am considering making a Trinity Continuum sheet using CSB, but I have kind of run into a problem.
How would I create dicepools using any attribute and any skill?
which is to say, how do I make it so I can add any two stats together to create a dicepool out of the combined numbers and be able to adjust things on the fly?
Not familiar with the system. Can you explain it?
For Custom System Builder I cant find a way to make two columns add up a total
Example , item 1 and item 2's weights adding up to a total at the bottom:
https://gyazo.com/a345b04099f3bbf7e33fd3d20508084c
Sorry Im still new to this
i dont fully understand the fetchFromDynamicTable('name') command
you make rolls by adding one of your Attributes and one of your Skills.
You then roll a number of d10s equal to your attribute score and skill score, with anything 8 or higher being a success
you then count how many successes you roll, then add automatic successes (but only if you roll any successes at all)
the trick to this is that one can roll any combination of Attribute and Skill if they have the right justification.
According to my players, they're unable to view dropdown items from the compendia. Is there a way to enable them to do so?
Hi, my Sheet ist getting bigger and bigger. There are a Lot of simple calculations in it. Now i worry that when im finished Performance will be really Bad. In the console every time i Update a value a Long list appears and the Update already Takes Like a second.
Can this Happen? How can i improve Performance? Are Hidden Attributes less Ressource intensive?
Something like this in the roll text of a label should do it: ${[(:attributekey + skillkey + modifierkey:)d10cs>=8]}$
I solve this part in my sheet by having a drop down column with all my attributes in it in my skills (dynamic) table, so that the player can select which attribute is currently associated with each skill each time they roll it
this section of the documentation covers that: https://gitlab.com/custom-system-builder/custom-system-builder#421-fetchfromdynamictable
I did that once (luckily early) and have since stopped using tabs and stuff entirely until I've finished everything and am ready to format, so while I'm building and regularly changing everything I can't accidentally wipe out a whole chunk of sheet at once.
i found a problem testing.
${sum((armor_box1==false ? 0:armor_mov1),(armor_box2==false ? 0:armor_mov2),(armor_box3==false ? 0:armor_mov3))}$
Formule work if select any checkbox but creating a actor, value is blank, i need show a 0 because show empty and the derivated calcules dont work.
I tried following that, that's why I came here for a solution. I tried multiple things but currently "fetchFromDynamicTable('invetory','wgt')" which I think should be right, into the Visibility formula box. The guide is very vague and doesn't use plain speak for fetching.
I'm just trying to understand why I can't add a total of numbers from a dynamic table despite trying what the guide tells me to do.
Should be ${sum(fetchFromDynamicTable('inventory', 'wgt'))}$
For your roll formula ${[:attributeScore:d10cs>=8]}$
oh wait alex already answered that. sorry
continuing to work on this. How do I make rolls from a dynamic table?
There are 2 different ways:
You create a Label inside the Dynamic Table, which will have a Label Roll Message. There you can reference the attributes of the same row with ${sameRow('ColumnKey')}$
You create a Label outside the Dynamic Table, which will have a Label Roll Message. There you can reference the attributes of the row you want to have (selected by a dropdown list) with ${fetchFromDynamicTable('DynamicTableKey', 'TargetColumnKey', 'FilterColumnKey', DropdownKey)}$
I ended up with something like this, it is not working
Rolling ${sameRow([:saved_dicepool:d10cs>=8], 0) + sameRow(:saved_roll_enhancement:, 0)$}
Should be:
${#roll_dices:= sameRow('saved_dicepool', 0)}$
${#roll:= [:roll_dices:d10cs>=8]}$
Rolling ${roll + sameRow('saved_roll_enhancement', 0)}$
is there some way to make it so the D10s can be seen?
wdym?
Just remove the #
works, thank you!
saved me a whole lot of beating my head against code!
hi, anyone know if the module "effect macro" works with CSB?
Is there a way to recreate the ability system from roll20?
https://gyazo.com/fbf6fdd0325f735ffac2fccd59c07cff
being able to add multiple slots (dynamic table?), type in a macro (rich text area?), and be able to roll the macro/hotkey it (label roll message?)
Ive made some progress - Im able to reference a command from a button in a specific row!
But I cant get it to actually do the macro for some reason.
https://gyazo.com/3438d0e69245ffe1a92b4a4eddd2bb5b
Using ${sameRow('macrocommand')}$ I get the above effect.
Ive tried ${ref(sameRow('macrocommand'))}$ <- but that doesnt do anything.
I believe so. If it doesn’t work you can try combat utility belt.
how does the initiative formula work? I can't get it to add 2d6 to the roll
i installed it but there seems no way to access it.
i installed combat utility belt now - but it seems active effects don't work there too? or how do i have to set them up so they work? for example (picture) i set this up but it doesnt change the props on the actor like it does with the normal active effects
I seem to be having a similar issue, I can add effects, but they can't be edited in a way that impacts the sheet the same way that the other conditions are via the in system character sheet, nor can it seem to modify it from within the CUB.
Tried system.props.[attribute] also, but that doesn't seem to cooperate here (unlike with Illandril's tooltips, which can interact with this, it's odd. May need something like recalculate involved?)
Use the active effects modifiers in your character sheet template.
this is strange. the "old" active effects are still there but do nothing. the new ones are present but there is no button to add modifiers
any ideas @shut harness ?
@agile ibex @scarlet skiff @shut harness Combat Utility Belt is not integrated into the system. The only 2 modules, which are integrated into CSB are _chatcommands and Bar Brawl. We cannot guarantee for other modules to work with this system.
I did some tests with CUB and can say that it doesn´t work like intended. You can add custom effects but you´ll get into trouble adding modifiers to it. I´ll need some more insights to identify where the issue lies, but that´s what I can say for now.
alright my apologies. I knew it did not have native but I thought it would work correctly.
ok then there is maybe another solution to my use-case ?@formal goblet @shut harness
i can add active effects with a script macro as a result of an attack (this already works) . now i want to automatically remove the active effect at the end of it's duration (for example after 1 combat round). have you done something like that or any idea how i would do this?
Sorry, never worked with that
Hey guys, I want to modify this macro so that it corresponds to the value of the skill the player is rolling. Here, I just put 5 as to test it. How does I make it go and get the proper value ?
(async () => {
let competence = 5; // replace 5 with the skill
const promptMode = `
<form>
<div class="form-group">
<label>Mode de lancer:</label>
<select id="mode" name="mode">
<option value="normal">Normal</option>
<option value="avantage">Avantage</option>
<option value="desavantage">Désavantage</option>
</select>
</div>
<div class="form-group">
<label>Modificateurs (séparés par des virgules):</label>
<input id="modificateurs" name="modificateurs" type="text" value="" placeholder="0" />
</div>
</form>`;
let dialog = new Dialog({
title: "Options de lancer",
content: promptMode,
buttons: {
ok: {
label: "Lancer",
callback: async (html) => {
let mode = html.find("#mode")[0].value;
let modificateursString = html.find("#modificateurs")[0].value || "0";
let modificateurs = modificateursString.split(',').map(mod => parseInt(mod.trim())).filter(mod => !isNaN(mod));
let totalModificateurs = modificateurs.reduce((acc, mod) => acc + mod, 0) + competence;
let rollFormula = (mode === "avantage") ? "2d10kh" : (mode === "desavantage") ? "2d10kl" : "1d10";
let jet = new Roll(rollFormula);
await jet.evaluate({ async: true });
let baseRoll = jet.terms[0].results.find(r => !r.discarded).result;
let resultat = baseRoll + totalModificateurs;
if (baseRoll === 10) {
let jetSupplementaire = new Roll(`1d10`);
await jetSupplementaire.evaluate({ async: true });
resultat += jetSupplementaire.total;
} else if (baseRoll === 1) {
let jetSupplementaire = new Roll(`1d10`);
await jetSupplementaire.evaluate({ async: true });
resultat -= jetSupplementaire.total;
}
let rollTable = `
<table>
<tr>
<th>Jet</th>
<th>Comp.</th>
<th>Mod.</th>
<th>Tot.</th>
</tr>
<tr>
<td>${baseRoll}</td>
<td>${competence}</td>
<td>${modificateurs.join(', ')}</td>
<td>${resultat}</td>
</tr>
</table>
`;
jet.toMessage({
speaker: ChatMessage.getSpeaker(),
flavor: `Lance un ${rollFormula} en mode ${mode} avec la compétence (${competence}) et les modificateurs [${modificateurs}]`,
content: rollTable
});
}
},
cancel: {
label: "Annuler"
}
},
default: "ok"
});
dialog.render(true);
})();
@agile ibex @scarlet skiff Found out settings extender works as a alternative. Doesn't do the duration thing like @scarlet skiff hoped but does allow custom status effects
Great to know, thank you so much!!
so first time being here, how do i'm using a tabbed panel system so how do i make it so you can only veiw one of the tabs by checking a checkbox?
i am new to making a system in this sub system
there is a custom CSS visibility field, but its so beyond my ability that I cannot help you beyond that
I figured something for this using parseInt(actor.data.system.props.key)
but I still can't quite figure out how to I use the macro as a roll in the sheet
Thank you i'll Check it out. Maybe duration can be a world script thing
As a quick q, how would I go about using Settings Extender for this exactly?
Is there a good resource for figuring this out possdily? 👀
Just look at the gitlab
Hello, I'm horrible with code, there is a simple way to use custom sheet from the Sheet Template Library?
No code required! Download and import the json.
how to import the json?
With the import templates button
find, tnx
NP
i'm still fairy new to the custom system builder, is there a way to write a formula for character speed/movement based off the character size? like tiny would give a speed of 20 feet, small 25 feet, medium 30 feet, large 35 feet, gargantuan 40 feet. i have tried using conditionals and maybe i'm screwing it up. i have the character size selectable from a dropdown list so i don't know if that has something to do with it and each has their own unique key. creature_size is the name of the drop down list and then its creature_tiny, creature_small, creature_medium, creature_large, creature_gargantuan.
Yes, you can use dropDowns and equal text
This one? As I am reading it and I'm not sure how it interacts with the active effects at all.
ah, meant to put a link in then
https://gitlab.com/foundry-azzurite/settings-extender
there we are
yeah, I keep reading this and I think I'm totally misunderstanding what it does
pls 
You can’t use macros in sheets other than sheet rolls without mods or JS modifications
And how would this work ?
Which?
Okay thank. Another thing, is it a way to filter find the template name of an object ?
in one of my macro I wanted to make player roll for the weapons they use. But, to do so, I need to filter by template name so that the macro would show a list of the weapons linked to an actor
The easiest would be to type game.actors into the console to find the right property for yourself.
I'm not sure I see how I can I find the key to use in order to filter by template by doing so, I might need some more explanation if that's fine with you
is it possible to call a class.function() from within a ${}$ call? eg ${myclass.myfunc('something')}$ ?
or some other way to get text from a module function into a character sheet label in CSB
Nope, these functions are limited to those which are listed in CSB and in the math.js-library.
When you type game.actors in the console, you´ll get a Map of Actors. If you click on it, you´ll see a List of all Actors. You can click on one of them to get more information about a specific Actor (pic 3).
There we see an entry with the name items (Type: Map). If we click on it, we see, that this Actor has 2 Items in it (pic 4). And now if we want to see the information of 1 specific Item, we just click on that (pic 5).
Our goal is to filter the Items by a specific Item Template, so we have to find the template name in this structure. But we cannot see it right now, so we have to check the underlying paths (e.g. system). And there it is. Under system there is a field called template (pic 5).
But wait, that´s not the name of the Item Template, it´s just a random string. And yeah, you´re right. It´s not the name of the Item Template, but it might be a unique id of the Item Template. So, how do we check that? Well, we just need to check the data structure of the Item Template. And how do we get them? Well, there´s something like game.items, which lists all Items in the Tab, including our Item Templates. And what do we see? There is an entry with the same id we had in our Item (pic 6). The ID is also under the field id.
Because we want to filter by the Item Template Name, we have to check the data structure of the Item Template. And well, it´s actually under the name, very convenient (pic 7).
Let´s summarize what we have:
game.actors lists all actors
Each Actor has the items-field, where all items of an Actor are listed
The Template-ID of an Item is under system.template
One of the entries in game.items matches with the Template-ID of the Item (ID is also under the field id)
The name of the Item Template is under the field name
So how do we apply what we got? We do it the following way:
const actor; //We assume that we already have the Actor
const itemTemplateName = '_Weapon' //Must be given
const itemTemplate = game.items.find(item => item.name === itemTemplateName) //Find the Item Template by the given name
const filteredItems = actor.items.filter(item => item.sytem.template === itemTemplate.id); //Filter Actor Items by the Item Template ID
hello, when i create a component, can i create duplicates of it to speed up my workflow? for example: i want to use a dropdown list to choose skill proficiency levels, but i have 20 skills, and i don't want to do the exact same thing for all of them
You can paste the json data or add all skills to a dynamic table and use that for the dropdown
how do i "use that for the dropdown"?
oh, i see, but this would then require the players to input all 20 skills themselves, wouldn't it?
i need a specific table with specific skill names and copy paste dropdown menus for the skill ranks
i need a table where the circled parts are all the exact same dropdown menu
and the selected value of those determines the bonus to rolling when clicking the labels on their left
CTRL + Drag solves that problem
ah, thank you!
i would like to make clicking Might roll a 1d20 + X where X is determined by the dropdown list's value
i can see that making Might a Label lets me write a chat message and i can output both a 1d20+5 roll and the list's value with that, but i can't seem to write a function that rolls 1d20+0 if Untrained, 1d20+4 if Novice, etc, what am I missing?
Fetch From dynamic table
does that work on normal tables too though?
@agile ibex @scarlet skiff https://foundryvtt.com/packages/core-settings-expanded I am so sorry. I fed you both the wrong mod
Core Settings Expanded, an Add-on Module for Foundry Virtual Tabletop
Oh wait, nvm use sameRow
I was wondering! Thank you very much!
but doesn't that just retrieve the value? which would then be Untrained? i can already retrieve that, i just need to convert that string into a number somehow
Lines of conditions baby! ${equalText(sameRow(columName), ‘novice’) ? 4 : equalText(sameRow(columName), ‘trained’) ? 5 : 0}$
ah, it's essentially IF(value == Novice) 4, Else IF(value = Trained) 5, Else... until i get through it all? sweet!
that's exactly what i needed then!
Out of curiosity, how much referencing can you do with Items/ItemContainers?
Specifically, can I set it up in such a way that an (alternate) formula for a damage roll (originating from an item) can check if a checkbox is marked?
i was looking at them but they kept giving me errors, i just assumed after a while that they expected numbers only
equaltext doesn'T seem to return anything but an error, even with a simple ${equalText('Novice', ‘Novice’) ? 4 : 0}$
To explain this, what I am hoping to do is make it so an item only applies its alternate formulas if a checkbox is marked inside the item.
Don’t copy paste from me. I am on my phone
I put ‘ in the end cuz I don’t have the proper thing on my keyboard
oooooh i didn't even notice that ' difference
Ye sorry should have said
okay, now it works, thank you!
✅
can i make the resulting roll display both the rolled die and the total in the chat message?
just so there is no need to keep clicking the roll total output
You can have the key be the value you want and the Label be the displayed string
I.E., the key for Novice is 4, Trained is 5
If you have two with the same value, you can get sneaky and make the key a math equation that gets evaluated, like 18-1 for 17
to feedback on this, it works perfectly, incredible, thank you!
if only i read this before making the whole thing... 😅
My solution for this is -> Export Template -> Excel Magic (concat etc.) -> import
So for example i had to do a Table with ~300 individual values (Labels all with the Same structure) and with this Method its done in no time
Thank you for the follow up, i'll Check it out as soon as possible
i am not yet aware of this workflow, but i'll look it up if i'll need it again
Is there a way to have an attribute bar use a value from a field on the character sheet? Basically like putting an hp bar on a token so changing it on a token also changes it on the character sheet and vice versa
there are limits to how it works from what I understand but if you add a number or formula to the 'max' section of the HP label, it will auto create an attribute bar to add to the token, then you need to make sure the token is attached/assigned to the character sheet.
Thanks! I’ll try it out next time I’m doing stuff with custom system builder
cool! do i have to do it for every single roll label though or is there a way to make it the default way rolls display?
You have to do it for every Label Roll Message
damn
can a formula get the current actor id?
or some way to read actor values into a label? kind want the actor ID.
Or is there a hook to edit value on field read? Like onGet(field, dothing(){})
Formulas are limited to CSB-functions and the math.js-library (excluding loops and arrow-functions).
And no, no hooks
ok is there a way to take a number generated from a roll and post it to the character sheet, for example im using a focus point system which is very similar to the age roller system that generates stunt dice. i have the formula listed below to generate the focus points but how do i reference these to show up on the character sheet. I have them known as FP in the formula below. I basically want to take the results and show them on the character sheet. however these will be replaced constantly as each roll generates new focus aka stunt points.
<table>
<tr>
<th>Agility Task Roll</th>
</tr>
<tr>
<td>Modifiers</td>
<td>${agi_value}$
</tr>
<tr>
<td>Rolls</td>
<td>${roll_1:=[1d6]}$ ${roll_2:= [1d6]}$ <span style="color: red">${roll_3:= [1d6]}$</span></td>
</tr>
<tr>
<td>Total</td>
<td>${agi_value + roll_1 + roll_2 + roll_3}$</td>
</tr>
<tr>
<td>Focus-Points</td>
<td><strong>${FP := (roll_1 == roll_2 and roll_2 == roll_3) ? roll_3 * 2 : (roll_1 == roll_2 or roll_2 == roll_3 or roll_1 == roll_3) ? roll_3 : 0}$</strong></td>
</tr>
</table>
You have to use macros for this kind of logic, because the system doesn´t offer a way to automatically set values on the character sheet.
ok well ill see if i can find anything
Hi!
All this is new to me, but I can;t seem to get this syntax right:
${if (eMARCH = "eControl") {Control} else if (eMARCH = "eHealth") {Health} else {Marksmanship}}$
Where eMARCH is the Key for a dropdown
eControl is a Key from the dropdown content
and Control is the Key to a number field.
I have tried all kinds of variations, what am I doing wrong?
I got this one to work, so I know it can take if, else if, else...
${Readiness < 5 ? Readiness : 4)}$
Java/C# user I see… anyway here is the syntax. Replace the quotes with semi quotas since I am on my phone and cannot type them
${equalText(eMARCH, “eControl”) ? Health : Marksmanship}$
Ok, thanks!
Ok, I tried this:
${(eMARCH = 'eControl') ? (Control) : ((eMARCH = 'eHealth') ? (Health) : (Marksmanship))}$
And it always returns the value in Control.
Any suggestions?
Ok, I finally figured out why you used equal text instead of "=" and it is working, thanks!
= only for ints/floats
Good to know, thanks!
I am trying to filter the die roll results on a Label Roll Message macro. When I assign a roll to a variable, it only saves the sum, not the individual rolls.
What am I doing wrong?
Show
Plz
I haven't gotten very far. But when I use this code, it shows the die roll and then displays the die total:
${Roll=[:eAtkAcc:d10];Roll}$
I have a lote more to do, but I am stuck in the water until it gives me the die results to filter...
Hi, i an triying configure addons work with CSB. My first problem is the path to hp. I dont know the exact syntaxis.
Open the console and copy path i obten attributeBar.vida, but dont work. ¿Need i any more word before?
actor.data.attributeBar.vida ???
data.actor.attributeBar.vida ???
Should be ${Roll:= [:eAtkAcc:d10]}$
actor.system.attributeBar.vida
I hope you didn't used "configure attribute bars" for your vida!?
No, i am using a number value with maximun other cell.
i try that u write and don't work.
can i set a default grid measurement instead of 2 meters per square?
or do i have to change it in every map?
👍
I don't use boss bar myself, so...😅
The above works for health estimate.
In always HP it should be just props.vida
So maybe try this.
boss bar work with props.vida / props.vida_max.
Very thanks, the next is splatter.
I have 2 questions.
When i make a new actor, there are field with formules wich depends checkbox conditions. The initial state is null and the sum dont work. When activate the checkbox for first time, all work. I try to use null in the conditions without success.
original
${sum((armor_box1==false ? 0:armor_mov1),(armor_box2==false ? 0:armor_mov2),(armor_box3==false ? 0:armor_mov3))}$
My try with null
${sum((armor_box1==null ? 0 :(armor_box1==false ? 0:armor_mov1)),(armor_box2==null ? 0: (armor_box2==false ? 0:armor_mov2)),(armor_box3==null ? 0: (armor_box3==false ? 0:armor_mov3)))}$
can i make a 3rd bar somehow?
Barbrawl mod
thanks!
I am still learning, what is the difference between "=", "==" and ":="?
== is a comparison operator. IDK what = does in csb. := is for setting formula variables.
Thanks!
= does nothing in CSB
Hey guys, do you know of anyway I can make a item give modifier depending of a dropdown list in a dynamic table ?
the objective would be to have a dynamic table that would ask what modifier this item applies and to what statistic does this modifier relates. Meaning a number field that corresponds to the value of the mod and a dropdown list correspond to the statistic the modifier should apply to.
Then the modifiers in the items would be ones that are made in function of whatever is put in these fields
Does this make sense ?
I got exactly the same problem. My solution for this was a list of 150+ modifiers.
If you or anyone else has a better Idea please let me know.
hey guys I have been using a formula listed below for a homebrew d6 system. This formula is currently used for all roll types, including attacks, ability checks, saving throws, etc. It basically is a 3d6 that generates Focus Points (similar to the AGE gaming stunt points). Anyways I'm trying to figure out a way to perform advantage and disadvantage. I need it basically to do a 4d6kh3 and 4d6kl3. the stunt die may be excluded if it is the lowest on disadvantage or vice versa. But being new to csb and no knowledge really of coding. I'd figured I'd ask you guys if there is a way to either rewrite the base formula and still generate the focus points or can is there a way to reuse this formula to include the advantage or disadvantage.
<table>
<tr>
<th>Rolling for (whatever)</th>
</tr>
<tr>
<td>Rolls</td>
<td>${roll_1:= [1d6]}$ ${roll_2:= [1d6]}$ <span style="color: red">${roll_3:= [1d6]}$</span></td>
</tr>
<tr>
<td>Total</td>
<td>${roll_1 + roll_2 + roll_3}$</td>
</tr>
<tr>
<td>Focus Points</td>
<td><strong>${(roll_1 == roll_2 and roll_2 == roll_3) ? roll_3 * 2 : (roll_1 == roll_2 or roll_2 == roll_3 or roll_1 == roll_3) ? roll_3 : 0}$</strong></td>
</tr>
</table>
[6:54 PM]
What are the correct ways to read from and write to a hidden attribute on an item? When the item is instantiated, there is an array of hidden items, each with a 'name' and 'value' but they are all listed was 0-23. Is there a way to get a value of one of the hidden attributes?
anyone got insight how i can reduce the amount of computation foundry does? what are best practices for CSB you found to keep the game running smoothly?
is it possible / has anyone already implemented label roll message with a blind roll?
for example i want to do the skillcheck with click as open message. and with shift+click it should do the same but as blind roll. is this possible in CSB?
How would I use an item modifier to increase one of its equipper's stats by one of the item's variable values?
E.g. my character has a stat with a key of stat_ACV, and I want to give him an "item" that has an att_Rank value of 2, and an item modifer that increases the character's stat_ACV by the value of the "item's" att_Rank value. But no matter what I try to get the value of att_Rank, it always makes stat_ACV NaN.
Just put formula fields in the attribute modifiers
How can I get the name of the target?
I try these: ${[1d100+100]}$ contra ${getPropertyDataFromActor('target', 'name')}$ but dont work. Work if use any key that i create.
Getting names in CSB is kinda janky. Recommend you make a key (call it “actorName” or something) and access it that way
i dont know how.
i try ${name}$
…How to what?
CSB doesn't have a name-field, so you have to create your own component with the name in it.
Yes
The type of roll must be selected in the chat box of Foundry, it cannot be defined in the Label Roll Message.
target name solved, thanks.
The other problen that i have is checkbox has three states at create actor. Null, unchecked, cheked. Because initial state is null, turn formula, atack formulas are blank. ¿How can i change the null state?
you can make a dropdown or another checkbox
Dont see how.
I have 4 checkbox for armors. (in ABF system can wear 3 layers of armor and helmet) If any is checked, rest turn.
Formule for final turn is blank, because checkbox are nulls when create actor.
hey @formal goblet or @brittle moth in the tips and tricks section of gitlab there is the "tooltip on hover" that I cannot make work. Could you explain it to me?
Anyone know if ternary operators can be used in a formula ${ }$ expression within a rich text field on an item?
This is the Option ${(rank>2)?'A':'B'}$ that you can use
is a string I put into a text field description. Just using ${rank}$ works elsewhere but I get an ERROR when I try the ternary operator.
'rank' is the name of a field on the item and is a number field
Related question: can the function getPropertyFromActor() be used in a rich text field or text field in a formula (${ }$)?

btw also, I don't feel like this feature is working :
7. Macro support
7.1. Roll context menu
When right-clicking on a roll on a Character sheet, a context menu will appear, with options regarding macros. Three
options are available :
Add as macro
This will show a dialog to create the new macro, asking for its name and place in the macro hotbar. When created,
the macro configuration window will open for more configuration.
Copy chat command
This will copy the /sheetRoll command for this roll into your clipboard, allowing you to reuse it later.
Copy macro script
This will copy a basic script into your clipboard to use the roll in a script-type macro. This script is
customizable to your needs.
This menu is only available on Labels which have keys.
btw, can this feature work for labels in item container, because I feel like it's not
Can math be used in a text field formula? ${ var }$ accurately displays the value of 'var' but ${ var+1 }$ gives an ERROR
I don't understand. I wasn't talking about any kind of roll message.
Ooops. Should be the answer for the question above.
That´s not possible because the Item Modifier Key must be static (cannot contain any formulas). This might change with the next update.
But even with the change it wouldn´t be possible because you cannot pass an array of modifiers.
Correction: It´s possible if you are selecting 1 modifier from many (in your case: selection via Dropdown List from a Dynamic Table)
okay thanks, I'm just also experiancing another problem with the macros. I red the thread you send my way with the '/macro macroname' but it seems like even if it at somepoint it worked now when I roll macro fromm the sheet the command does not compute
is there something I'm missins ?
There´s a limit if you´re using a command in a Label Roll Message. The command must be the only thing in the Label Roll Message
I believe it is
Thanks! Looking this over now.
EDIT: Thank you! This is exactly what I was looking for! It even solved the issue of not being able to figure out how to sum up specific values of the entire collection of items!
Figured this out. You need to use string(var+1) inside the formula
Still unsure why you can't use a ternary operator for if-then-else inside the Rich Text Field or Text Fields but can use math operations
Okay figured this out (Sort of). conditional ternary operators work but the < and > symbols get replaced by > and < in the HTML so I need to figure out how to keep the symbols from getting encoded
Do have any idea of something else that can break it?
it's literrally just : /macro MARCONAME
Hi
I am currently working on the CSS for my world.
I would like to have a css for my character sheet that is different from the one for the items. It seems that both sheets use custom-system-actor to be manipulated.
Is it possible to have on my css a character sheet and an item sheet with different customization? if yes how?
You can create you own CSS-file and use your own classes instead.
I know this and already use it. 🙂
But how do I get a different background between the two? I have a large character sheet (1300x1000) with images in the background in a specific colour, and I don't want any more images (or maybe other) in the default colour or other.
I'd be more comfortable to have an .actor and an .item on a css level :p
Ah. Well... I know that you can define classes on component-level, but it's a different thing if we're talking about sheet-level...
is there a bug with tab visibility? i'm trying to set up a "Spells" tab that only appears if a player can cast spells, but
every time i add the "is_spellcaster true" visibility rule, it refuses to save
and every time i add it to the tab itself, it causes the name in the tab switcher menu to become blank and doesn't let me rename it
i've got a panel that works with this visibility rule already, but the tab itself just refuses
Try to readd the tab
i have multiple times, but it worked when i tried it again just now, for some reason
weird
i wonder what i did
Yeah, Tabs are currently bugged
Does the function getPropertyDataFromActor() work in a text field or rich text field on an item?
Can these components even parse formulas? There´s no hint for that in the Readme
I've had good luck having text fields and rich text fields being able to parse formulas in ${ }$ but you have to be careful since the rich fields parse into HTML so you can't use < or > in formulas
but concat() and string() work so was hoping getPropertyDataFromActor() would also
Probably because of htmlspecialchars
Yeah it changes them to < and > which doesn't work
however you can sort of use boolean combinations of ==
so that works for my purposes
the getPropertyDataFromActor() isn't returning an error, just empty
I see, you did some hacky workarounds
The context should be the same so I don´t think that it should behave different to Labels
hehe not sure it's hacky but definitely a workaround
That was my hope, but it's not returning anything. I'm not sure how to debug it
Hmmmm. Maybe the double-quotes are a problem.
I tried single quotes, same result
😅
The funny thing is, when looking at the HTML of the rich text the " "'s aren't being converted
I will see aboug decode() function
Well, you won´t have access to that because it´s not a CSB-function
oh, hmm fair
I´m not even sure if JS has that because that´s the doc for PHP 😅
Oh! Thought that was a CSB doc somewhere
The HTMl looks clean
<p><strong>• </strong>Total Athletics Pool: ${getPropertyDataFromActor("attached","athletics") }$</p>
It surely does... Does a fallback-value work?
Oh good call. Yes, it does display the fallback value
so I wonder if my reference to the propery needs a full path
like system.props.athletics or something
Nope. The function does that for you by getting the right context on its´ own
Oh...hmmm
Interesting, it works if I use "selected" and select the character token
so it's something with attached
You could check if the Item has a parentActor when attached to the actor. That´s what the function is referencing
How do I do that? games.items or games.actors and find the item?
The later
So the item (on the actor) has a parent Object wwhich is the character
I dont' see a parentActor variable yet
item modifiers created on the item do work so it must be referencing the parent correctly in that way
I wonder if the function getProperty() uses a different method
Well, Item Modifiers work quite different 😅
The actor pulls them from the Items and computes them
Oh okay. So I don't see a 'parentActor' property on the item at all, just parent: which has an Object reference to the actor object
Might also be just parent, but not 100% sure
the code says if 'attached' then actor = parentActor so I assume that is a defined property on an item?
or could that code be wrong? (Doesn't seem likely)
it´s a field in the options-object, which gets passed to the computeStatic()-function
Oh yeah I see that now, and the default value is null;
Which makes sense if it´s not attached
I don't know enough programming to know when that is called or if it's not being called with the right options
But this item is attached, it was added to an item container
Well, you add it to the actor, not to the container, but yeah
I'm not sure what else to check
So the function is working
just seems the parentActor is getting null
How is your RTA configured?
I'm not the DM so I'm not sure. I spoke with the DM and he told me I can access the fields I needed directly without using getProperty function so I got my specific case working.
Still not sure why the function didnt' work though
Any clue with why ref() is uncomputable ?
${#dmg_roll:=[:item.dice:]}$${dmg_roll}$ + ${#stat_mod:=[:ref(item.statmod):]}$${stat_mod}$ + ${?{Mod_Neutre|0}}$ + ${[#sublimation:=[:(:degsub:)d6:]}$
${#mag_qte:= [:item.jetintnat:]}$${#mag_mod:= [:ref(item.typemag):]}$${#mag_deg:=[(:mag_qte:)d(:mag_mod:)]}$${mag_deg}$ + ${?{Mod_Magique|0}}$ + ${#sub_qte:= [:bensub:]}$${#sub_mod:= [:typebensub:]}$${#mag_degsub:=[(:sub_qte:)d(:sub_mod:)]}$${mag_degsub}$
${#dmg_mod:= [:Mod_Neutre:]}$ ${#dmg_neutre:=[:dmg_roll: + :dmg_mod: + :stat_mod:]}$${#dmg_neutre}$
${#dmg_elem:=[:mag_degsub: + :mag_deg: + :Mod_Magique:]}$${#dmg_elem}$
Uncaught (in promise) Error: undefined. Uncomputable token ref()
[Detected 1 package: system:custom-system-builder]
at ref (Formula.js:459:31)
at math.js:26516:56
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:728:27)
at Formula.compute (Formula.js:292:21)
at ComputablePhrase.compute (ComputablePhrase.js:128:27)
at computeRollPhrase (Formula.js:784:29)
at Formula.evaluateRoll (Formula.js:798:35)
at Formula.compute (Formula.js:270:41)
at ComputablePhrase.compute (ComputablePhrase.js:128:27)
at async HTMLAnchorElement.<anonymous> (Label.js:247:21)
Maybe because one of the inputs results to null/empty string? Check out which one behaves wrong first (you can set fallback-values for ref())
right, it's seem to be it, but now I think I have a syntax error, I'll comback if I don't the error 😅
Btw any chance that your figured out what is blocking my macros from computing from the roll option of the sheet ?
Maybe it's only possible with /amacro, but don't pin me down on that.
Is there a way to link to a journal entry in a character sheet?
Set a rich-text-area with (important): “style” at the bottom of the area set to “dialog editor”.
Now players can drag the wanted journals in and it makes a in-foundry link to them.
Looks like: @UUID[JournalEntry.UdJdggqKrJuBz8vV]{Charakter PDF}
You can set a default if you want, but there is a bug, so that the default needs to be touched (altered in any way) on every sheet.
Thanks so much. I thought that was how it worked but wasn’t having any luck. Changing it to dialog editor seems to have done the trick. I appreciate it.
Hi guys - Ii'm trying to build character sheet for 'Eyes beyond the torchlight' and and I wonder how to show all the rolls along with the summary score.
I'm very beginner level (still seems generous to call myself beginner), so forgive me my ignorance
${[1d20]}$+${[:stats_agi_dd:]}$+ ${[:stats_agi_bonus:]}$ gives me all the rolls, but doesn't show the summary. How can I summarize it?
Don’t put the stats in the [: :] formula
Unless it is something like SWADE.
Try this
${roll:=[1d20]}$+${stats_agi_dd}$+${stats_agi_bonus}$ = ${roll+ stats_agi_dd+stats_agi_bonus}$
It is like SWADE, so the part after '=' was giving me error. However it gave me this idea:
${roll:=[1d20]}$+${rollstats:=[:stats_agi_dd:]}$+${stats_agi_bonus}$ = ${roll+rollstats+stats_agi_bonus}$
works like a charm and I am, sir, grateful for your help
is there a way to set the field (for example text or number) to show value based on other fields? for example +2 AC if shield checkbox i checked
I recommend using hidden attributes for all your stats
${armourBase + (hasSheild ? 2 : 0)}$
Then put that in a text
But you can’t mod fields with formulas
Any particular reason for this?
The only benefit is that you can perform hidden calculations there. That´s it.
You can’t apply modifiers to fields
Does anyone know how to set a roll within a Label Roll Message to be a "Private" roll?
There´s no way. You´d do that above the chat box of Foundry.
Thanks
Is there a way to put a components visibility as "this formula OR if you're the gamemaster"?
So a user has to fulfill the formula requirements, but the gamemaster always sees it
There is a visibility formula for every component under the advanced tab
Yes, that's what I'm talking about, it normally is just the formula, is there a way for it to check if the user is a gamemaster as an alternative
I'm pretty sure that if you're a gamemaster you can always see it.
there's no hiding stuff from the gamemasters
Nope, if you're using the visibility formula you can't see it if the formula is false, even as a gamemaster
On a player that is, templates are always visible
welp, then I think not, although I don't use the hiding features very much.
For now I'm just using GM only checkboxes
Anyhow, I also came here to ask a question. Has anyone tried to get Custom System builder to work with Combat Utility Belt's Enhanced Conditions? I'd kinda like to customize the status effects and automate a few things.
I'm also open to alternatives to CUB. I'm only using it for the enhanced conditions
You will want this module instead
Core Settings Expanded, an Add-on Module for Foundry Virtual Tabletop
Issue with the CUB is that you can't remove effects and the ones you add don't cooperate with the CSB framework, this one changes the effects at the backend, meaning CSB interacts with them in the same way as built in status effects
Yes this is right and worked for me @cinder rock
Is there any explanation/documentation on how to use it?
Not that I recall, but I can whip something basic up real quick, one moment.
(This will, of course, be based on my rather basic understanding of the System and Module, I'm rather much an amateur still!)
So, I'm going to use my Foundry Fire Emblem system on Custom System Builder for this (with Sprites from the amazing Retrograde). I'm gonna show how I removed the basic conditions, and then how I added the infuse condition, and how I had it influence the sheet directly.
First, with the Core Settings Expanded module installed and enabled, you want to head to Core Expanded Settings, on the right here, below where Configure Settings usually lives.
firstly, to get rid of the base Active Effects, click on one of them in this menu, and then uncheck the Status Effect Active box - don't change anything else, then click Update Status Effect. You'll know you've done this right as the effect icon will now be faded.
To create a new one, just close the menu and open it again, and then fill in the blanks with the information you want I'm gonna fill this in with a 'Vantage' Status Effect, which is a skill in Fire Emblem.
The Status ID will be what you want to be referring to it as in your code in CSB (Custom System Builder), while the Display Name is just that, same with the Status Effect Icon, it's just where you want the icon you want to use from.
Then, you just hit Modify Custom, and it will be added to the list, like so.
Then you can go to your Configure Active Effects menu on your template, and adjust them as you usually would in CSB
Hope this helps @vagrant hollow and @cinder rock!
WOW 😍
Thank you very much!!!
This helps a lot!
Thank @shut harness honestly 😅 I'm just passing on the great help they and Martin have given me 😅
Haha, I just suggested the mod. Don’t credit me for that
honestly though I suspect people can do really clever things with this, my code for this system has become rather much a mess to me
A lovely peak
If you think it is messy on your side you can use hidden attributes
Yeah, I have ended up using a few, I think at this point I am gradually hitting that point where I am thinking to myself "hmmm, if I do too much reconfiguring, how much am I going to break..."
At some point I may well restart with the knowledge I have to do it much more cleanly and logically, at least in theory
Btw, minor nitpick but I recommend separating labels from fields so you get better control of alignment and spacing
Oh totally fair nitpick - I tried solving that with a table for the attributes but to no avail
I think it was you who mentioned before that I can do formatting to make it look more pretty - how do I go about that? Is there a guide for it? I was to see how far I can go in making it look like a GBA game 😂
I recommend using a panel
You can use CSS with labels to style them
Ohhhh, time to go learn about CSS, then!
Btw unrelated to formatting, I found a crt filter mod
👀
It can give you some gameboy scanlines
Ohhh, that sounds rather useful for my Lancer game, oddly enough
