Hey there. If i I assign a roll to a variable like this §{roll=: [5d6]}§ can i somehow later access the individual dice of that roll or just and only the evaluated sum? (Background: Im trying to check a roll for successes AND failures separately and apparently even vanilla foundry wont do /roll 5d6cs>4cf<2, it'll only count the failures in that case)
#Custom System Builder
1 messages · Page 2 of 1
Any idea how to combine two user inputs into one formula so you only get the one popup? I'm trying to do ${?{mod} + [:?{assistDie}:]}$ but it doesn't like it. Separating the two user inputs into their own formulas works but then there's two popups
assistDie input would be dice, i.e. "d4"
${roll:=[d:assistDie:]+mod}$```
You can save the input and insert it into a roll later
EDIT: I didn't read the entire thing. Changed so mod actually modifies
It works! But it outputs a bit of an ugly ERROR in the chat message, probably complaining about that first formula. Is there a way to hide that?
there shouldn't be an error :/
You can hide formulas by adding a # to the start of it, after the ${
Really? Okay I had modified it a bit for my use case. One moment
Okay copying and pasting I think it doesn't like the initial "d" in [d:assistDie:], but when I remove that I do get an ERROR
it needs the d to interpret it as a dice roll, so that "d:assistDie:" resolves to "d4" if assistDie=4
i am using an older version of foundry and csb
but I can't imagine they changed that stuff
but even if you remove the d there shouldn't be an error
may i see the formula ?
also this may be of help: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/2.0.0#47-user-inputs
Here you go -
${!sameRow('skill')}$ check: ${[2d10]+sameRow('skill_rank')+AttributeModifier+[:AssistDie:]}$```
I will try it again with the d
Here is the error I get with [d:AssistDie] - Uncaught (in promise) Error: A Die term must have a numeric number of faces.
Without it does work but outputs ERROR at the beginning
Yeah that was just here I missed it lol
It is there in foundry
[d:AssistDie:]
Oh wait
I'm having the user input "d4" rather than just "4"
i'm glad it's working then !
Hmm well I would kinda like to allow them to enter "d4" or any other roll syntax
But this is a decent workaround. Thanks
${(dice).replace('d','')}$```
this removes any occurences of the letter d
i'm not sure about type safety or whatever in javascript, so you might have to turn it back into a number after if it complains about numeric faces again
What I'd do:
${#?{AttributeModifier|0} ?{AssistDie|0}}$
${#roll:= [2d10 + :AssistDie:]}$
${!sameRow('skill')}$ check: ${roll + sameRow('skill_rank') + AttributeModifier }$
Anyone know how to get an item name in a roll result for that item (from the item's own sheet)? The item name seems to be outside the scope of the return when rolling from the item's own sheet.
hmm interesting it seems to work if it's actually on an actor, but not if it's a world item in the sidebar
Is there a way that I can can read what a key in a droplist is, and based on what it contain (it refers to hidden attributes), output different text? All I have achieved is that it outputs the name of the hidden attribute.
${ref(DropdownKey)}$
Yeah. But I want to output different things based on what that key is. For example if the key is diceRoll_str, I want it to output "Strength roll".
${concat(equalText(DropdownKey, 'diceRoll_str') ? 'Strength roll' : '')}$
thank you
apologies if this is a very broad question, what is an example of what I would enter in this field?
If you have a custom CSS file, you can enter your defined CSS-classes there.
You need a basic understanding of CSS before you can utilize this.
Ah gotcha, so its asking for the actual written out name like .glow or something like that- not a file path or anything. just wanted to make sure, thank you
Hello everyone, very new to this and hit a bit of a wall.
I’m looking to include a roll result of text imputed from a dynamic table. I have feeling it involves ref, and same row, but I can’t for the life of me put it together. I hope that made sense.
Is there a way I can export my compendiums as well as the json file for this system?
Exporting compendiums is best done (in any system) by putting the packs in a local module. See the top pin in #513918036919713802 for a tool that makes one.
Hello. I am looking for a code that ignores ones. Here is my set up.
You roll 1d6 (if you roll a one it fails) If the dropbox is selected which is based on a number of d4s. Those times in total what the 1d6 is. Now here is my dilemma. I want it to ignore when a 1 is rolled on a d4.
So for example it you roll 3d4 and two are 1s those get ignored.
I have it where it will roll those dice fine but I can't seem to find the proper code to get it to ignore certain numbers. Any help is appreciated. 🙂
If this helps at all this is my current code
${[1d6:ModWeapon:]}$
The ModWeapon is keyed to be *1d4 currently.
${sameRow(ColumnKey)}$ should be enough to let your text display in the Chat. And it's also possible to use multiple ${}$ inside Label Roll Messages.
Thank you! Not only did you help me with that, I was still having problems, and found the little ' ' advice you gave to someone else back in December and that was the last bit I needed. Finally!
How can I have two item containers and be able to move items between them? as it is now, it shows the items in both.
You can not. There is basically only one Item container per character. Just the output is diverted by the filters when using more than one.
Have a checkbox in the item template for “memorised” and use this as a true/false additional filter in each of the item containers
It wont accept a checkbox like that, because you can not set it on the item for some reason. So what I did was a dropdown list with (yes/no).
I did it. Check my templates. It doesn’t matter too much as long as the item has a key that can be used to filter the items.
I will check
Yes, you did it just the way I did it.
It had issues with it for me.
Ah
Is it not possible to use an item container inside another item for pieces of gear that are used to help carry other items(sacks, backpacks, etc)?
Drag and drop doesn't seem to work with this setup, despite what should be a match for the filters.
@raw terrace I have run into a problem that I hope you can help me with. The character has stopped updating information, and I cant find what is wrong.
Very strange, seems to have solved itself.
No, it is still not working.
Uncaught (in promise) TypeError: cannot use 'in' operator to search for "0" in "Open helmet"
Aha, a corrupted character caused it. Had Open Helmet as ability 😄
Glad I could help 🙂
Hello, I am trying to set up a template actor, but everytime I check the box it doesn't change anything and when I exit out of the actor and reload him the box is unchecked again. Any help?
Delete the checkbox and add it again. Maybe this helps
Does anyone know how to load the dev build?
Working on a formula. How do I grab the name of the actor an item has been attatched to?
${concat(item.parent.name, string(RollFeatureFlavortext), string(RollFeatureFormula), string(RollFeatureFormulaDamage))}$ This doesn't seem to work for a roll message.
It's just posting the formula code instead of a result
Does anyone here have the knowhow to help me unravel this? I'm not gonna be making any progress here until I can figure out how to slap this thing into functioning
I am trying to make a formula to put together a roll message
"No Form Element"?
Huh?
What does that mean, when I am trying to set something up in the rich text editor box and it tells me that?
the string()-function is not part of the math.js-lib https://mathjs.org/docs/reference/functions.html. Use format() instead.
Items cannot access data from actors. It only works vice versa.
So the tutorial stuff I read was misleading. I'm gonna be better off just going for the most rudimentary form of this possible.
It's supposed to be available in addition to math.js
be enclosed in the string() function to work correctly. For
example : concat('Deal ', string(strMod+dmgMod), ' damage to the target.').```
You can clone the project into the systems-folder (Foundry-User-Data) and switch branches throughout git
The thing is that you don´t have access to the global methods of Javascript (which string() is), because it´s not Javascript you´re using here. You can only use functions listed in math.js and in the README
Ok, wait a second. It´s actually supported probably (atleast with string()...)
Yes, that's the thing. Seems like string() should be specifically added in as valid code
Presumably it's specifically a CSB item
Oh, I think I found the issue. It should be item.name and not item.parent.name
Thanks for the effort. However, I think i've now determined that making an actually nice looking roll card in this system is beyond my mental capacity. By myself, at least.
The only way to make it work is to have a label, with a roll message reffing another rich text key
And something in there just breaks along the way no matter how I try it
Even a simple something doesn't seem to work.
nvmd, syntax, bleh
Ok no, do have a problem again.
Attack Roll: ${[1d20]}$ + Melee Bonus
This isn't making a roll. Why?
${ref('FeatAttackRoll')}$
${ref('FeatRoll2')}$```
Thank you, worked like a charm!
Is there a way to have a pop up come as an alternative click where you can pick advantage, disadvantage, and any modifiers?
Open question: is there really no better way to total bonuses from e.g. feats than to have an item table with a column for every possible bonus?
Or, maybe I can go "Name | Modifier Type | Modifier Value". But then I can't have an item modify more than one stat at a time.
?{<varRoll>|<2d6>}
<p>${[varRoll+:ACV:]}$</p>
The wiki really needs to put in examples for complex things like this lol
This is a guide for anyone interested in how to put macros in their character sheets
- Open the user data folder by right clicking the Foundry icon in your task bar and click Browse User Data
- Back up your data by copying the Data folder to a secure location or giving it a different name
- Install the dev build by cloning develop branch to (User Data)\FoundryVTT\Data\systems\custom-system-builder https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop
Or if you don't use git, download it and replace the (User Data)\FoundryVTT\Data\systems\custom-system-builder folder. Be sure the folder is named custom-system-builder https://gitlab.com/custom-system-builder/custom-system-builder/-/archive/develop/custom-system-builder-develop.zip
- Your game world should be unaffected by the system upgrade
- Install and activate the Advanced Macros module
- Add text to your sheet that will execute a macro when clicked by adding a label. In the Roll Message field, put
{{macro "Name of your macro"}}with quotes included
*Note that this only works with script macros
That’s very heavy depends on your gamesystem.
I am using mostly checkboxes and drop-down tables for bonuses to feats.
If you need to use items, you can place several modifiers in one item.
Has anyone used Active Effects in CSB yet?
can i adres item table some way?my items have only waight. i wanted to make carring capacity system
Is this system currently maintained?
Hello all! Noob here. First question: What is the formula to take the current total in the ‘slots’ column of the item container and put it in the ‘slots used’ box? It should be 6/18 in this pic. Is that something that can be done? Second question: Is it possible to change the words ‘true/false’ into a check box within the container for the player? It’s currently set up here that they’d have to click and open the item and check the ‘equipped’ box within it. I’m just trying to make it cleaner and less clicks. Thanks!
Also I just wanna say thank you to everyone in here for helping eachother. I have learned so much about coding and foundry and such just scrolling back.
Yeah, it is
Hey! sorry to disturb
You've done an amazing work with the custom system builder congrats ! I was just hoping to take a few seconds of your time to see if you can help me find the solution to a problem.
I've been working on a sheet, then, suddenly it won't open anymore. The original template is still there and seems functional to me (even tho it is obviously not, since my sheet doesn't open) but I didn't manage to locate the origin of the problem. I though that you might have been reached out for similar issues before and that you may have some clues to give me so I can look closer, because I spent hours trying to find the error, but since I don't know programming i can't read efficiently the console error message
(sorry LinkedFluuuush for the dm I just found the appropriate channel for it 😅 )
- You have to use Item Modifiers to achieve the wanted result, because Item Containers cannot be referenced for calculations. So every Item needs a modifier to modify 'slots used'.
- A simple ternary operation might help you there:
${equipped ? 'Checked' : 'Not Checked'}$
Hi 🙂 I'm trying to build a weapon table, using an item container. And I want to generate a label roll message that pulls the skill value from a dynamic table. The name of the skill is the same as the name of the weapon.
I'm trying to use fetchFromDynamicTable in the roll message of a label in the item container like this, but it's not working:
${fetchFromDynamicTable('skill_list', 'skill_score', 'skill_name', 'item.item_weapon_name')}$
Is it possible to use item.item_weapon_name in the fetchFromDynamicTable like this? If so, what am I doing wrong?
Thanks in advance for any help you can give!
Take some screenshots so I have a better view over what you did and what you want to achieve
Thank you! I hope this helps. Let me know if I can say anything else that will help.
One part I can already see is, that you´re using '' for item-item_weapon_name. What it will do is checking if one of your skill_name = item.item_weapon_name and not what the value of item.item_weapon_name is. So ${fetchFromDynamicTable('skill_list', 'skill_score', 'skill_name', item.item_weapon_name)}$ might work better
No change I'm afraid. The output of the roll in chat is an empty bubble of the kind that usually shows roll results
Try ${item.item_weapon_name}$ and see if you get the right name
Looks like nesting ${ }$ doesn't work
Well, why should you even nest them? 😅
ooh you mean using JUST that in order to see if that part works - i get you 🙂 One sec!
Ok, narrowing down on the cause now. It doesn't seem to want to get the value...
Wrong key name I guess. Check in your item template how the key name is
This is the key copied from the template: item_weapon_name
huh... Any errors in the console when you press F12?
And reload the Item in the Container just to be safe
Is this what you're looking for?
uhhhhh, that´s an error from another module if I have to guess
reloading the item hasn't helped. Nor did reloading FVTT
right, no other errors that I can see
the damage role with the following code works fine:
does ${[(:item.item_damage:d2-:item.item_damage:)+(:item.item_damage_modifier:)+(:modifier:d2-:modifier:)]}$ damage with their ${item.item_name}$
the complex roll formula is due to my house rules rolling. Essentially it's rolling 2 sided dice
That´s not an issue if it´s working.
Any thoughts why the item call would work in one roll and not the other?
I don´t know where the problem lies. I did a small example and it works without any issues
${fetchFromDynamicTable('Weapons', 'Value', 'Name', item.name)}$
hmmm odd. I might try disabling all mods except for CSB and see if I can replicate your test
Hey guys I'm really struggling figuring out the most basic stuff, I tried to read what was sent before but I didn't understand how to do it.
I can see in many of your examples that you manage to make information about the items appear in the character sheet. For example the Attribute it uses.
What are the keys that I have to match in order for them to appear ?
Like if I create a label in item container, I put a name to the colon 'Attribute' and it's key is 'att'. This value is supposed to be stored in a dropdown list in the item sheet that also uses the key 'att'. What am I missing to make this information appear ? Is it an issue if the dropdown list is stored in a regular table ?
Also how would this work for a text or number field ? for a roll ?
Well I gess it has to do with labels... using ${item.somthing}$ maybe.. but it doesn't seem to always function
It doesn´t matter how the Label in the Item Container is named or which key it has. The only thing you need to get a value from an Item is to use ${item.<Key>}$. The same applies for rolls.
I also recommend going through the README where the most stuff that can be done is covered: https://gitlab.com/custom-system-builder/custom-system-builder/
Is it an issue if the dropdown list is stored in a regular table? - It´s not. There is no difference if a Component is stored in a regular Table or not, you reference it the same way.
thanks 🫡
Thank you so much for the help! The equipped thing is as good as it’s gonna get, I tried to put a font-awesome check mark instead of ‘yes’ and it almost accepted it but not quite. As far as item slots, what am I doing wrong with this modifier thing? I add item 4 and it erases the Label text but doesn’t input the +3.
Label prefix (optional): SLOTS USED:
Label text (optional): 0
Apply these changes and it should work
Hello me again, sorry for bothering
I wanted to implement in my item container a roll for attack and for damage.
He is how I did it :
1- in my item sheet there is a drop downlist for the skill that you might want to chose for attack and their corresponding key. There is also a space to insert the dice formula and a Modifier calculated by the division of a skill and a given modifier.
A typical attack roll would be : 1d10 + Skill1 + OtherModifier
A typical damage roll would be : 1dX + (Skill2 / Y) + OherModifier
2- in the item container I have called all this information.
the dmg column has for label : ${item.dice}$ + (:${item.statmod}$: / ${item.moddiv}$) where dice is the damage roll, statmod is the skill modifier and moddiv is the the divider of the stat mod.
3- in the roll label of the item container the follow formulas are used :
<table style="width: 99.8878%; height: 100px; margin-left: auto; margin-right: auto;" border="1"><colgroup><col style="width: 35.493%;"><col style="width: 64.507%;"></colgroup>
<tbody>
<tr style="height: 30.8px;">
<td style="height: 30.8px;" colspan="2">
<h2 style="text-align: center;">${item.name}$</h2>
</td>
</tr>
<tr>
<td>Attaque + ${?{MOD1}}$</td>
<td>
<p>${[1d10 + ::item.stat:: + :MOD1:}$</p>
</td>
</tr>
<tr style="height: 33.6px;">
<td style="height: 33.6px;">Dégâts + ${?{MOD2}}$</td>
<td style="height: 33.6px;">
<p> ${[ref(sameRow(dmg)) + :MOD2:]}$</p>
</td>
</tr>
</tbody>
</table>
but, when I press the button, nothing happens, returning the following in the console :
Uncaught (in promise) Error: A Die term must have a numeric number of faces.
at new Die (foundry.js:11827:13)
at DiceTerm.fromMatch (foundry.js:11054:12)
at Roll._classifyStringTerm (foundry.js:9860:23)
at foundry.js:9476:22
at Array.map (<anonymous>)
at Roll.simplifyTerms (foundry.js:9474:29)
at Roll._evaluate (foundry.js:9288:35)
at Roll.evaluate (foundry.js:9256:25)
at ParentheticalTerm._evaluate (foundry.js:11339:28)
at ParentheticalTerm.evaluate (foundry.js:10233:25)
I just started messing with Custom System Builder and have been trying to make a basic item container that shows the name of the item and a short text description from a text field but I can't seem to get it to work in the slightest. any help would be greatly apricated.
I had the same problem few hours ago you, the way I understand is that you have to put in the label of your corresponding item container tab the following : ${item.<Key>}$
and <key> would be whatever key you're using for the description in you item template. Let's imagine the key of a text area you're using for the description is desc, then you would create a new column in your item container, in you actor template and put ${item.desc}$ in label text
Then when you drop an item in a sheet the name and the desc should appear
I have that set up but I have never even been able to get an item to appear in the container to know if it works.
You can't do it the template, you have to try it in a character sheet. You also have to create a item that is not a template
if it's not that then check your parameters for item container and be sure that the template of the item your trying is checked
if it's still not that then sorry I just got started yesterday x)
I found the Problem, It had something to do with there being some kind of hidden instance of the item or something bc when I made a new item it worked. Thank you for the help!
my pleasure, happy that you solved it
I see 2 problems there:
<p>${[1d10 + ::item.stat:: + :MOD1:}$</p>You have double-:atitem.stat, you should remove one layer 😅<p> ${[ref(sameRow(dmg)) + :MOD2:]}$</p>Your Label Roll Message cannot reference the Labels of your Item Container, so you have to reuse the formula fordmg. So it should look like this in the end:
${#dmg:= item.dice + (item.statmod / item.moddiv)}$
<p> ${[:dmg: + :MOD2:]}$</p>
I see, thanks gonna try this
Weird doesn't seem to work
console :
Uncaught (in promise) Error: Unresolved StringTerm ERROR requested for evaluation
at StringTerm.evaluate (foundry.js:11730:11)
at Roll._evaluate (foundry.js:9292:42)
at Roll.evaluate (foundry.js:9256:25)
at Formula.evaluateRoll (Formula.js:755:24)
at async Formula.compute (Formula.js:269:30)
at async ComputablePhrase.compute (ComputablePhrase.js:127:13)
at async HTMLAnchorElement.<anonymous> (Label.js:239:21)
Both formulas seems to be an issue, none of them work.
<table style="width: 99.8878%; height: 100px; margin-left: auto; margin-right: auto;" border="1"><colgroup><col style="width: 35.493%;"><col style="width: 64.507%;"></colgroup>
<tbody>
<tr style="height: 30.8px;">
<td style="height: 30.8px;" colspan="2">
<h2 style="text-align: center;">${item.name}$</h2>
</td>
</tr>
<tr>
<td>Attaque + ${?{MOD1}}$</td>
<td>
${#att_roll:= [1d10]}$
<p>${att_roll + item.stat + MOD1}$</p>
</td>
</tr>
<tr style="height: 33.6px;">
<td style="height: 33.6px;">Dégâts + ${?{MOD2}}$</td>
<td style="height: 33.6px;">
${#dmg_roll:= [:item.dice:]}$
<p> ${dmg_roll + (item.statmod / item.moddiv) + MOD2}$</p>
</td>
</tr>
</tbody>
</table>
Maybe this way?
Well, we're getting somewhere now 😂 but not there yet. The roll appears but its an error
There is also less error messages :
chat-enhancements.js:82 Uncaught (in promise) TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
at Function.from (<anonymous>)
at HTMLSpanElement.expandMfsRoll (chat-enhancements.js:82:28)
at HTMLDocument.dispatch (jquery.min.js:2:43064)
at y.handle (jquery.min.js:2:41048)
Atleast we got rid of FoundryAPI-issues
yeah I would have never reached that point alone xD
Remove the html-specialchars (orange-parts) and see what it gives to us
although... check if you get the desired results from the item-keys. You can use the Label prefix (or suffix) for that, so you don´t have to change the roll message
when I removed the special char I had clearer message error
Formula.js:680 Error: Cannot convert ":tch:" to a number
at convert (math.js:12242:57)
at Array.t (math.js:6552:67)
at Function.r (math.js:6691:72)
at Function.addScalar (math.js:6739:53)
at Function.oe (math.js:6724:82)
at add (math.js:6740:54)
at math.js:25781:48
at math.js:25781:50
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
Formula.js:680 Error: Cannot convert ":rfl:" to a number
at convert (math.js:12242:57)
at Array.t (math.js:6552:67)
at Function.r (math.js:6691:72)
at Function.oe (math.js:6724:82)
at divide (math.js:6740:54)
at math.js:25781:48
at math.js:25781:62
at math.js:25781:50
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
seems like my keys translating into numbers
uhhhh, wth is :tch: and :rfl:? 😅
this is how my dropdown list is set up, rlf is for REFLEX, dex for DEXTERITY ...
same goes for this one
ok, and I guess dex, cor, int are valid keys in your actor template?
ok, then remove all : and wrap your item.statmod with ref() -> ref(item.statmod) in your roll message
I'm still struggling with the variable input pop up thing. Nothing I've done is working. Is there any example someone has?
Trolling up I think I found what I was doing wrong. Had to dig through other code though. Experimenting a bit more.
That´s what I have;
<table>
<tr>
<th>Standartprobe</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[1d20]}$
<strong>${!Roll >= Krit ? '<br>Kritischer Erfolg' : Roll <= Patzer ? '<br>Patzer' : ''}$</strong></td>
</tr>
<tr>
<td>Würfelmod</td>
<td>${W_Mod:=?{Modifikator|0}}$</td>
</tr>
<tr>
<td><strong>Ergebnis</strong></td>
<td><strong>${Roll + W_Mod}$</strong></td>
</tr>
</table>
Yeah, this is the reason the README definitely needs examples of complex things like this lol I was trying to treat it like a regular variable where its outside the equation because it had the {} which in my mind is a separate piece.
Well, relatable 😅
perfect
works like a charm
I may just abandon this portion and tell my players to suck it up and type the damn equation in the chat at this point.
Maybe it's worth to try a bit more, ya never know
I am using the Year Zero Engine: Combat module for the game I am running, and it has the ability to duplicate an opponent in the turn order based on its speed stat. However, I can not find what works to type into the settings of the module to pick up the attribute speed from the character sheet. Any help would be welcome.
Huh, interesting! I am learning so much about the intricacies of code with this project. 😆 Thank you!
For a nurse with ZERO knowledge going in, I'm doing pretty ok I think.
Regarding the 'additional CSS classes' box, the documentation on Gitlab has a link saying "See 'here' for more information on CSS enhancing" but it doesn't actually lead anywhere. Where should it lead?
Also, how are ya'll making highlighted code boxes in the chat??
The links broke with a change of the repo. It should point you to this section: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop#84-use-your-own-css
That just takes me to the main page.
You can customize your sheets with your own CSS. You can add a CSS file in the system configuration. The path must lead to a CSS file, starting from Foundry's Data Directory.
oh nm sorry, I see.
OH WOW lol Literally learning HTML, JS, CSS, Markdown, JSON for this "little" project is OVERWHELMING!
Well, It has its´ advantages to learn these technologies 😅
True! It is the times we're in and I'm old 🤣
Hi all, I'm trying to add a URL to a rich text field and I'm getting this error:
Anyone know what it's about?
Do you get the same error with other systems?
Oh here's a question: The item in the character's container that they click on, there's a little grey fa-suitcase... Is that changeable? Is that a core foundry thing or a CSB thing? Where is that found if it's changeable?
I just tried Cairn, and it works there.
This is hardcoded, so it´s not changeable.
aw boo😊
I got it working without any errors. Can you explain it in more detail?
^ I see you are watching too 😉
Not sure why, but after changing nothing at all/following the same steps to take screenshots, it worked.
Thanks for the help anyway. I appreciate it!
Hey all, I've been having a great time using CSB to power my home system. However, I have been doing some things that can be described as horribly inefficient. My system uses one of the character's four attributes as their key attribute relating to combat (i.e. attack modifiers and damage modifiers). The way I've implemented this until now is to have four separate sheets that are written in such a way that the core attribute appears in the necessary places... As you can imagine, this means whenever I add a new feature to the sheet, I have to add it to the other three as well (hence the inefficiency). TLDR; is there a simple way to allow the players to choose their key ability on their sheet and have that be the key I use in most of my formulas (I undestand this is probably a really easy thing to do, I am just simply inept 😂 )
Something like ref(DropdownKey)?
I Think you paced number fields with the value of your attributes?
Set a dropdown list where the player can select his counting attribute with the keys of the number fields.
Use ${ref(your dopdown list key )}$ in your calculation.
Arrgg…Martin was faster..😜
Perfect, I think that is the step I was missing. So what I have right now is a table with 4 number field entries with the key listed as ACUMENSCORE, etc. Then in the drop-down menu I have 4 options that have the same key as the four number fields. So if I just use ref(KEYATTRIBUTEDROPDOWN), that should use whatever they choose from the list (if I'm following correctly)?
Exactly
In my system I do the characterclass dependent initiative roll on this way.
Haha, that may present an even more complex issue for me that I haven't even dared tackle yet. My iniative system allows the players to select one of four of their skills to roll initiative with. Might use the same method, create a drop down list and then just ref it.
Welcome to the club 🥸
For this I made one more step. Setting a label with a key and the label text ${ref(your dopdown list key)}$, also usable as a value control output for the player.
In the CSB settings initiative formula it looks [you-dice]+label-key
Works perfect for me, even with different combat helper modules.
Okay, I'm clearly doing this wrong. Let me just share the formula I've made for one of the defensive rolls. ${[2d10] + ${ref(:KEYABILITYPCDROPDOWN:}$ + ${:DEFENDMODIFIERPC:}$ , I've attached that to a label for the PCs to roll with. Is the error in that formula itself or have I gone wrong in the labeling of the Attributes/Dropdown List.
The minute I figure this one step out it really speeds up everything else I do so the help is really appreciated here ❤️
${[2d10] + ref(KEYABILITYPCDROPDOWN) + DEFENDMODIFIERPC}$
Try this for the roll
It really do be that simple sometimes.
Thank you
Your welcome
Okay, last stupid question for today (I feel bad now because I can probably spend way too much time figuring things out myself but you've been so helpful thus far I just can't help myself). I don't understand the items element of the system... I have a default item sheet that in theory should be usable to roll attacks and damage once it's equipped on the PC's sheet, but I can't for the life of me figure out how to drop them onto the sheets 😂 Again, I'm sure this is really simple and in the ReadMe (which I've read multiple times,but once again, I am a buffoon)
You don’t have to feel bad aobut this – I had the same problems just 1,5 month ago.😉
So you made a equippableItemTemplate and out of this a equippableItem ?
These equippableItem can than be placed in the charaktersheet in an Item Container.
Attention: there is virtually only ONE item container per charactersheet!
You HAVE TO select your equippableItemTemplate name in the item container to make the corresponding items shown!
But the item container can be placed several times in the sheet and separated by the Filter Items setting.
I am not sure if I got your problem right?
Items are tricky
Hmm, I see. I have got the items adding to the sheets now. Is there a more efficient way of doing this? Like am I supposed to just make a weapons template and then derive all instances of swords as different equippableitems or do I make seperate templates for each one?
The Item Template acts more or less like an Actor Template, so your Weapons should all derive from one Weapon Template
I made miself equippableItemTemplates for weapons, armor, herbs, gems, animals, stuff and than doing the swords, bows, hammers out of the weapon template.
Okay, well that opens up a whole can of worms that I'm sure I'll need to figure out next. How to differentiate damage die for certain weapons and what bonuses get applied by other equipment.
You have to place a label with key somewhere in your character sheet and place in Label text a 0 (zero).
In your Item use configure item modifiers, take the same key of the above label an place your formula.
Now this label key will be modified by items and can be used elsewhere in you charactersheet.
i was recommended to put my problem here, in hopes that the is a solution.
I am trying to program Pokerole into Custom sys, and the route I would like to go is making moves as items that call on the pokemon stats to roll accuracy and damage. The reason i want to do it like that is so I can save all the moves in a compendium to make the making of a pokemon easier. any thoughts on how i can achieve this? (alternatively if there is a way to make a table where it can duplicate itself multiple times based on a stat ill just do it like that?)
please DM if you think you know a solution
I´d say a normal Item Container with Labels for the roll should be all you need for your case if I haven´t missed something (I don´t know how Pokerole works). You can go more into detail if you need further help. I´m usually here all day and have some knowledge over the system.
so say a move needs to know the Strength of the pokemon to know how hard it hits..... i want to make it so the move (item Class) can Call on the pokemons strength that the item is attached to
You can do this in the Label of the Item Container. There you can access information from the actor and from the item.
https://gitlab.com/custom-system-builder/custom-system-builder/#311-item-containers Scroll a bit down to the example
sweet may i DM you a link to connect to me so you can show me?
Uh, well why not
Is there a way to access keys from the owning character on an Item? I am trying to create my spells as Items, to be placed in an Item Container. Is there a way to access, say, a character's Spellcasting Skill from within the Item owned by that character?
Nope, not possible. You can only access them together in Item Containers
That makes me sad. Oh, well. Thanks.
It would cause some weird behaviour, e.g. what should happen with the content of an Item which is not assigned to any character
Quick question - I have a dice roll triggered in the label message from a dynamic table for a basic skill roll. It asks the user for a modifier, adds that to a skill and rolls 2d6, adding the total of the modifier and skill value. All is good, that works fine:
${#target:=sameRow('skill_total')+?{Bonus|0}}$ ${roll:=[2d6 + :target:]}$
What I also need to do is detect whether or not the two dice rolled 1s, as rolling two 1s is a failure, regardless of the total result, but I can't figure out how to do this. Anyone want to point me in the right direction?
Can I request a feature here?
When it comes to initiative..... how do i define it? where do i define it?
also is there a way to refrance a target?
You can but best would be there: https://gitlab.com/custom-system-builder/custom-system-builder/-/issues
You can define it in the system settings. There is a part with Initiative
It will be part of the next update: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop#428-getpropertydatafromactor
I also got stuck with the problem to retrieve single dice values from a dice pool. What you can do is rolling the d6 separate and checking the value of each dice.
...
${roll_1:= [1d6]}$
${roll_2:= [1d6]}$
${and(roll_1 == 1, roll_2 == 1) ? 'Critical Failure' : 'Normal'}$
...
Thanks for that - I solved it by separating the 2d6 from the modifier and just looking for a roll of 2 or 12, as it's the same thing, but your solution looks like it would be handy as well.
Ah right, that would work aswell
Luckily, I'm looking at Troika! which is a very simple dice mechanic, but I have others that use dice pools, so this would be a very handy snippet to keep hold of.
The biggest challenge for Troika! is the initiative system, which involves putting chits into a bag and drawing randomly, not sure how to approach that yet!
Is there a way to easily use the rich text editor for roll messages without it breaking calculations?
Thanks!
Actually, I am going to post it here, because I am not permitted to create a feature request in Gitlab. (Not sure why.) It would be great if there was a way to sort item containers. I am using item containers for spellbooks, but spells are always listed in the order in which they were added, with no option to change this.
There is already a Request for this: https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/110
So it is. My mistake. Thanks.
Hello
Is it possible to show the item icon or image in an item container?
What is it that I need to do to get the user input to be recognized as a number or a dice roll? i.e. input = 2d6 for roll or 3 for a modifier. It seems to only see it as a string and I don't know what I'm doing wrong.
<p>Mod: ${varMod:= ?{Mod}}$</p>
<p>${[2d6+:ACV:+ :varMod:]}$</p>
I have tried it like this too; ${[2d6+:ACV:+ ?{Mod}]}$
Is there a way to reference the actor's name or id in a label? For instance ${id}$ would return OIp9IzCm4X66NbU5
There's currently no known way for this
Not that I'd know
You could put an image and add some conditionals to do a certain image based on category for instance
Dang, thanks Martin
Try this
<p>Mod: ${varMod:= ?{Mod|0}}$</p>
${#roll:= [2d6]}$
<p>${roll+ ACV + varMod}$</p>
I am having a problem where im trying to call on a stat that just will not be called... i have tried copy and pasteing it into a new box to test it and it just produces a blank, any Idea pls @ me
as it turns out all i had to do was delete it and remake it.... dumb but 🤷♂️
ok new question.... is there a point where the math just stops mathing? as i have this and it outputs blank? ${(Champion?14:equalText(Rank,'Beginner')?2:equalText(Rank,'Amatuer')?4:equalText(Rank,'Ace')?6:equalText(Rank,'Professional')?8:equalText(Rank,'Master')?14:0)-(Strength_Trained+Dexterity_Trained+Vitaity_Trained+Insight_Trained+Special_Trained)<=0?0:(Champion?14:equalText(Rank,'Beginner')?2:equalText(Rank,'Amatuer')?4:equalText(Rank,'Ace')?6:equalText(Rank,'Professional')?8:equalText(Rank,'Master')?14:0)-(Strength_Trained+Dexterity_Trained+Vitaity_Trained+Insight_Trained+Special_Trained)}$
Okay, I see. So everything needs to be determined before the final portion? You can't have the roll during the calculation
Now question becomes, is there a way to set a dropdown selection as the dice roll? Something like "Advantage" = 3d6dl1, "Disadvantage" = 3d6dh1, "Normal" = 2d6?
Hi all, have been playing around with CSB again and have come up with a simple system for TROIKA! - where would be the best place to post this if anyone is interested.
holy shit, what a cluster fuck 🤣 . I highly recommend to not nest too many ternary operations as they make your formula less readable with more values. ${sum(Champion ? 14 : 0, equalText(Rank, 'Beginner') ? 2 : 0)}$ scales much better with readability and troubleshooting than ${Champion ? 14 : equalText(Rank, 'Beginner') ? 2 : 0)}$
Sure, just make sure that the dices are the keys inside the dropdown list and reference it like you did in your previous attempt: ${[:DropdownKey:]}$
I think the missing default Value was the fault. The extraction of the roll is just a recommendation by me and Linked:
Roll operations can be defined inside the roll, or outside. In terms of pure result, ${[1d20 + 3]}$
and ${[1d20] + 3}$ are equivalent, but I would recommend using the latter.
We can publish templates made by players in the project. Either you open an Issue with the Template on GitLab (https://gitlab.com/custom-system-builder/custom-system-builder/-/issues) or DM LinkedFluuuush or me.
I put in the default and for some reason it errored out. Though I think it was more from the combination of the roll formula and a variable it already didn't like. I dunno. Sometimes this system is weird.
Is there a way to do a for loop in roll messages? I'm trying to have the user input the # of dice they want to roll without the rolls adding up, can't find anything other than forEach on the math.js function summary
I'll try that....
Thanks for finding this out and your Guide.
Did you try if there is a way to make the macro call editable for players?
Calling the macro via a variable set form a text field or rich text area?
So that every player can configure his/her own optical spell effect macro and call it from the character sheet?
I am just not sure if I want to open up a new pandora box 😵
Hello
Is it possible for an item modifier to call a value in the actor's sheet?
Example : an item which give the ability to add Strength to Intimidation Check.
Loops are not supported
Not really, you can only modify them but not get them for calculations on the Item
Actually it is not for calculation on the item but on the item modifier (maybe it is the same though...)
It´s basically the same
Okay Thanks 😊
Ok thanks for letting me know
Unfortunately, no. I haven't been able to get that to work. But hard coded arguments to the macros do work.
I'm throwing pandoras box wide open. I'm making another macro that will update all my actors and throw their Id into the roll message as a hardcoded argument. That way, I can reference that actor directly in the macro
Ok, i understand. Thank you very much.
Damit, i found a way to do it... 🤩
Only needs the advanced macro modul and actual CSB.
I placed ad the alternative roll message ${!sameRow('weap_mac')}$ wile weap_mac is the key of a rich text area with {{macro "EldritchBlast"}}
It just don't want to be done with a dice roll together.
Now I have to rework my templates…😖
I'm not able to recreate what you're seeing. But if you are able to get a macro running, you can throw a dice roll in the macro. Would that be enough?
I got it!!
Make the roll message /${!textField1}$ Where the value of textField1 is your macro name.
Alternatively, you can make the argument a variable /macro1 ${!textField2}$ where the value of textField2 is what you want to pass as an argument
I'm having a difficult time pulling the correct data from equipable items. If I have more than 1 item in an item container, and I have a column with the following expression: ${item.Description}$ Both items have the description from the first item. I would imagine each item would have its own description. Guidance on what I'm doing wrong?
Oh weird... so refreshing doesn't fix the issue, but if I go into Ability 2, change the description from what it was and save, then it changes in this window. Maybe a glitch? Seems refreshing both the item and the player sheet should keep this from happening?
Drat, not being able to pull the value from the character sheet is really hindering me. It'd be fine if we could add an input field to the item container rather than just a label. Any good work around for this? I'm trying to make it where a player can input how many points they want to spend toward an ability, but their maximum is based on their character level. Since I can't add an input field to container column, I tried to add it to the actual item, but that can't see the character's current level... :/
That's why I'm working on getting macros working in my character sheet. I've got a "Use Move" macro that will look at the character's items and the attributes of those items in order to track their moves. Macros don't have any trouble reading both an actor and it's items.
A more common work around is switching to a dynamic table though.
Yeah, I’m using a dynamic table for one mechanic, but it wasn’t a good fit for this one. And I’m trying to keep things more streamline than using macros. I use that in another game but they always feel a bit janky for simple things.
I’m enjoying this tool though, over all. But I am having other issues too where one item uses a d4, another a d6, and another with no die just a mod. Getting the roll to do an if else on the item ends up not properly generating a roll, syntactically it appears…
Nope, dice roll and calling macro still don’t want to work inside the same roll message.
Seams that advanced macro is not kicking in as long as there is something else inside the chat message.
Maybe because I am still on standard CSB and not the dev branch?
Anyway, after rethinking of what I wont to achieve, this is okay.
The dice roll is to test if something may work. After the GM agrees, it works. Then the player can start the optical effect.
So, having the macro inside the alternative shift roll is for the playing mechanic absolutely fine.
Hello, I am using the Custom CSS module and I was wondering if there was a way of referencing the CSS code in Custom CSS through into CSB?
I feel a complete & utter goober but I have a basic question. I'm doing up a character sheet so I can run Liminal. All is good except for two fields I want to calculate & display.
I have a field that is entered during character creation called Athletics_key and another drop downtable (Focus_key) in which a value of Tough has the key of (Tough_focus). If Tough is selected then the value of EnduBonus should be 4 and otherwise 0. I created a Panel for EnduBonus with the formula Focus_key == Determ_Focus ? 4 : 0
The formula for Endurance is 8 plus the value in the Athletics_key field plus the value of the EnduBonus (it will be either 0 or 4). Thus
${8+Athletics_key+EnduBonus}$
I can't get this value to display anywhere even if I put it into Label Box, a text box or whatever.
What the frik am I doing incorrectly, please?
tusen takk!
EnduBonus should be: ${equalText(Focus_key, 'Tough_focus') ? 4 : 0}$
Thank you
Is there a clever trick to get the item count in a dynamic table by chance?
Hi, so I think I missed something simple here. I am trying to reference a label key on the character sheet from a formula in a label on an Item added to the sheet. I get a blank label. When I reference a label key that exists on the item, from another label on the same item it works correctly. The same goes if both labels are on the sheet and an item is not involved. Code example: ${athletic}$
I have also tried: ${ref('athletic')}$
And: ${ref(athletic)}$
${count(fetchFromDynamicTable(<TableKey>, <TableColumnKey>))}$
Items cannot get values from an attached Actor (at least not with the functions of the system).
Ah, I see. Thanks.
Is there a way to associate as dice in a dice pool?
For example a melee weapon damage would be strength die + weapon die.
using ${ ref(dstr) + ref(weapon_damage) }$ hasn't seemed to work.
when using [ ] brackets, I got
Uncaught (in promise) Error: A Die term must have a numeric number of faces.
[Detected 1 package: system:custom-system-builder]
I've trieid originally with text box, then dropdown options
What I like to do when working with roll-formulas, is to separate CSB-formulas from Foundry-roll-formulas by using temporary variables:
${#rollFormula:= concat(ref(dstr), '+', ref(weapon_damage))}$
${[:rollFormula:]}$
What do the : : within the square brackets mean?
https://gitlab.com/custom-system-builder/custom-system-builder/#45-add-rolls
You can use rolls in your formulas. To do so, inside the formula markers, use brackets ([ and ]) to define your
rolls. In roll expressions, you can also use keys, but you must surround them with colons. Rolls are performed using
FoundryVTT Roll API.
For example, to roll for Shadowrun's Strength, you can define the following formula : ${[:STR:d6cs>=5]}$.
Roll operations can be defined inside the roll, or outside. In terms of pure result, ${[1d20 + 3]}$
and ${[1d20] + 3}$ are equivalent, but I would recommend using the latter.
OK I MISSED THE COLONS PART
Thank you for the answer!
This system has been really helpful!
Is there a way to hide an element (such as a panel) unless an option is chosen from a drop-down (thinking about actions that are specific to a class)?
This is part of the next update
Nice! I’ll look forward to that, thanks!
It´ll look like this. And you´ll find it on every component.
That looks just the ticket for what I had in mind
Hello
I think I saw something about this question, but I can't find it...
Is it possible to sort the different item in an item container, without having to remove them all and give them again in the correct order?
currently not
Ah! I figured it was something like this by syntax was way off. I’ll give that a try!
I was also trying to add dice images using the font feature, but it didn’t seem to recognize d4 dice, etc. just d20 and d6; the font website seems to show them though. Can I change that somehow?
Look at these: https://fontawesome.com/search?q=dice&o=r
d4 = dice-four
ok, dice-d4 is also included 😅
It seems to work for me, so it´s something on your side
Quick Question. If I have a variable defined (i.e. an attribute) called "Fighting" have can I roll a number of dice equal to the value of Fighting. eg Fighting = 4 so I want 4d6 ??
sure, ${[:Fighting:d6]}$ should do the trick
thanks, that works
Huh. I am still running fvtt 9.something so maybe I’m out of date 🤷🏻♂️
Uhm, the system is made for V10 😅
Haha, then I count myself lucky it works at all!
Hello! Is there a way to use a key from an actor inside an item's attributes? Like for example, equipping the item adds my strength to my defense
Actually, it seems like the answer is no
So followup question: Is there a known workaround for this?
Why not?
As with any labels, you can use formulas in the Label text and Roll Messages. The keys used in the formulas will
reference the parent keys, but you can use the item keys by adding item. in front of the key. For example, if a
weapon's damage value is based on the character's STRMod and an internal damage value, you can display it in the
item container with the formula ${STRMod + item.damage}$.
Wait, let me get this right. The value I'm trying to apply has the key 'resistance'. So to operate with this value when the item is equipped, I should write ${ref(valueRef : resistance)}$?
Maybe the reason it doesn't work is because "resistance" is the result of an operation and not a flat number?
Wait, are we talking about Item Containers or Items?
it's an item inside of an item container
I want that formula in the item modifiers, if that makes sense
Item Modifiers are modifying values of the Actor by using values of the Item.
Items & Item Modifiers cannot read values of an attached Actor.
Labels in Item Containers have access to both Item values and Actor values.
Yeah, it's that second line the one I have a problem with
I need one of the item modifiers to add an actor value to another actor value
Not doable with this system. Maybe a macro could help you there (scroll a bit up in the chat)
Damm. Welp, time to find a workaround
Or with this, but this feature is not released yet.
Linked is sitting on his last feature ticket and made good progress. So I guess it should be soon. But can´t say a specific date
Hopefully it will be out by the time I finish the system
Clunky workaround in case someone else needs to do something similar.
The objective is to add a value of "resistance" to a value of "stamina" which by default and without the item on should be 0.
I made a new hidden attribute ("ResStaminaON") with a default value of 0, and I swapped the default value of "stamina" from 0 to ${resistance * ResStaminaON}$. Since it's multiplying by 0, the result is 0.
Now I made it so the item modifier simply adds 1 to "ResStaminaON", essentially enabling stamina to scale with resistance.
I'm sure there is a better way, but this works for now.
Dang, I think I misspoke. I meant an Item Container, not a dynamic table. That still a thing I can do?
You need a different approach for Items. You just add an Item Modifier to every Item, which modify your Key on the Actor by 1.
Like a hidden attribute?
Nah, a bit different
Oh, I see, it's not in the master, it's in the individual items
Yep
So the key belongs to a Label not a number field (I find the labels update nicer than the number fields)
Yep, a Label with 0 as initial value
Ah! Now we're in business
related, can I have it modify the actor hidden attribute instead?
Should be possible
Nice, this is working well, thank you!
I'm also having difficulty checking if text fields are null. ${TextField == "" ? 0 : 1}$ doesn't seem to be working. Am I doing this wrong as well?
Wait... Took @formal goblet 's earlier suggestion and combined it. I believe ${count(TextField) == 0 ? 0 : 1}$ seems to do the trick!
I'm surprised that count() also counts the chars of a string 😅.
About the example earlier: You have to use equalText() for string-comparisons.
Huh, didn't know about equalText(), but I do recall that strings are just arrays of chars, so the backdoor solution works that way haha
I don't even know if js has a primitive of type char. But it is true in Java and C 😅
would anyone happen to know if it's possible/how one could display an item's icon in an item container?
Hi guys,
I want to roll dice with a bonus.
If I were using Dnd5e's bonus, it would be easy:
${floor((player_strength_value - 10) / 2)}$
I want to use D&D Basic's progression of modifiers instead.
3 = -3
4-5 = -2
6-8 = -1
9-12 = 0
13-15 = +1
16-17 = +2
18 = +3
I don't know how to make this into a formula like above.
The system doesn't offer this functionality
Thanks for the reply!
${sum(value == 3 ? -3 : 0, and(value >= 4, value <= 5) ? -2 : 0, and(value >= 6, value <= 8) ? -1 : 0, ...)}$
hmmm for some reason all my sheets are blank now and do not seem to be using my templates
if I delete and reinstall custom system builder it is fixed until I reload it again
Ok I think a module is breaking it which makes it no longer CSB's fault 😅
Hey y'all, I have a question. I'm trying to build out a sheet with a dropdown list for race and class. I want to have a text box appear and populate with abilities based on the chosen selection in the dropdown, but having trouble finding a solution. Is this possible?
From what I learned yesterday, a good workflow might be to create Hidden Attributes on the character sheet. In the formula, check if dropdown == value. For instance:raceConBonus: ${constitution + (raceDropdown == "Dwarf" ? 2 : (raceDropdown == "Elf ? -1 : (raceDropdown == "Human" ? 0 : 0)))}$ The final zero being the fallback number if nothing matches. (This assumes the key for Dwarf also is dwarf. But if you're using integers, just check for int equality instead.
Oh, I'm also realizing, perhaps a cleaner way might be instead of using a dropdown, perhaps utilizing a subTemplate from the items page. You could customize one for race, one for class, and then just drop those onto the character sheet? I haven't messed with those though, so might need to look at the docs for that.
Thanks for the tips, I'll look into it. Cheers.
Is there a way to click on a label and make another value deduct? Like click on "cast spell" and then deduct 1 from a hidden attribute?
Having this channel as a thread is really inconvenient for searching for answers
I’m wondering how to make an inventory?
You'll want to work with Item Containers. It takes bit to figure them out. I suggest make a test item, and then make the Item Container. Then you can make the container only contain specific type of items.
Something like "Action Buttons" are only doable with macros currently (no implementation from the system side)
Gotcha. I'll have to look into that more later than. Is that something I'd script into the label press?
You can attach macros to it via right click https://gitlab.com/custom-system-builder/custom-system-builder/#71-roll-context-menu
Hm, might not work on my v9 version, haha
@formal goblet Also, I added an item container to an item (Item is bow, Item Container on bow is Quiver). I tried adding arrows to the quiver container, but it doesn't seem to work. Is that a bug or can items not contain containers?
I think you can actually add Containers but the problem is that an Item cannot be attached to another Item 😅
Haha, fair enough I suppose. Dang. I wonder if I can hack that using subtemplates...?
Well... a subtemplate is also a kind of Item?? uhhh... Dunno
Tried, answer is no. Maybe I can make the Bow a subtemplate instead of an item... lol
What do I need to know to start making macros for rolling stats?
Hey, I just saw this and recalled there is a formula for the ability mods:
https://www.reddit.com/r/DnD/comments/5kzrpm/what_is_the_mathematical_formula_for_calculating/
Check this out! Not too sure if you can add this to CBS or not 🙂
reddit
3 votes and 11 comments so far on Reddit
Might work. You have access to all 3 rounding-functions from the math.js-lib (round(), floor(), ceil())
Is there a way for conditional rolls? If the player rolls x, make another separate roll (without adding). If player does not roll x, do not roll a separate roll?
I'm trying to make it so if player rolls evens on a 1d8, they will also roll a separate 1d4, but not if 1d8==odds, basically
Something like:
${roll:= [1d8]}$
${mod(roll, 2) == 0 ? [1d4] : 0 }$
Any way to make the 0 not show as a roll if 0 comes up?
I've got dice so nice running, so no matter what, it shows the d8 and d4 rolling. :/
Uhm, too messy... You have 3 options there:
The current approach where roll can be 0 (or any other default value with the roll icon and the white box)
An approach with using ! which will only show a normal text instead of roll icon and the white box
An approach with using # where you hide the roll result and assign it to a temporary variable, which can be used elsewhere in the formula
I think it will always roll the dice
Yeah, finding the same with all the permutations. Fair enough. I've hacked it together where a second rolling option appears on the char sheet only if they qualify to be able to roll twice, regardless of the outcomes of each
Yes, that’s for the new ability scores in 5th edition 😔
So... I am in a similar situation. I have a Weapon_Template item which is __equippableItemTemplate. I also have Ability_Template which is also of the equippableItemTemplate type... Does this mean that I cannot give my weapons abilities? @formal goblet (pinging you since you were involved in that discussion as well)
In short: nope. There is no elegant solution to this because you cannot attach Items to other Items
In the end, I went this route (see picture). Arrows can be manually added to the Longbow's Ammunition options as a dynamic table. The Equipped dropdown self-populates based on the option in the table. Still need to see if I can then use that data to populate the weapon item container columns with the ammo selected
In my situation I have actors that can have innate abilities... and I was also trying to allow their possessions to also have the same type of abilities be applied to them. I guess I'll have to do it this way though.
You could have a hidden attribute on the actor that is modified by an Ability field/dropdown, etc. Then apply that value to the rolls made using the items?
Okay thanks y'all.
How do I shrink the width of these text/number boxes?
or even just align the number to the center so the minus button isn't on top of it
Is that a 1-row table with 5 or so columns?
Yes it is
I managed to center it but I want to shrink it
I think there is a "Size" field for the Number Field component type.
Change it from Auto to Small or Smaller, etc.
You, sir, are a gentleman and a scholar. Thank you!
And now for something completely different... Can I make it so that objects dragged into rich text show up as like a link? I've seen this done in some systems
What am I doing wrong?
I want to make a slot-based encumbrance system
Ah, I just did something similar the other day. On the char sheet, make a hidden attribute for encumbrance. On each item, on the item modifiers, add the encumbrance key and add x to the value. You can then reference the limit in a label.
Mind sharing your formula for encumbrance?
I want to make the strength score be the maximum amount of slots allowed
Okay, so hidden attribute "encumbrance" (key) with formula: ${STR}$ (assuming that's the key of the attribute) then the item modifier can reference the encumbrance key with value formula ${-1}$ for example. On a label on the char sheet, for the text you can write ${encumbrance}$
Oh sorry. I think I misread and got it backwards 🤦🏻♂️
Yes, and I'm still confused
How do I assign the encumbrance value to an individual item first?
So Key = ${:encumbrance:}$ ?
In there you can just write encumbrance assuming that is the name of the hidden attribute
Op.: - and the Formula: 1 assuming the item takes one slot
So can I reference the Number field in the sheet?
Otherwise I'd have to change the hidden attribute within that menu for each
On the char sheet, in the encumbrance formula you can reference the Number field, yeah
Wait, the item templates don't even have item modifiers!
So I'd have to make it for each one!
Yes, each item will need to have its encumbrance value set in the item modifier unfortunately. It'd be nice to set some kind of override or default in the template, but that's not an option :/
An alternative (I don't think you can do this with items), is just referencing the count of objects in a dynamic table. That's something I was playing with the other day as well
Yes, but if you can't make an item be worth 0 items, that doesn't work.
What about using the Hidden Attributes in the template for the item?
Ah, perhaps so!
Now I'm getting confused on what I've done on my sheet, lol. I gotta look before I say anything else...
:/ I may not have enough context to be very helpful. I'm worried we might be talking about different things
I tried this in the Label text tab
${ref('slots')}$
and this
${slots}$
Maybe. I just want a value to show up on that column.
I don't know how to get any value to show up there
ok, so that is an item container, right? Where the column lives
Yes
cool. So if inside the item there is a key called "slots", you can try to reference ${item.slots}$
this took me forever to get right, myself. I kept trying ref() and sameRow(), but items.keyname worked for me
Still nothing. That slots is the name of the hidden attribute.
Okay WAIT
I got something to show up
That did the trick. I simplified what I want using and I'll post here.
In the template:
And ${slots}$ is working in the Label text
I've been referencing with ref() and ${:<value>:}$ lol
yeah, it takes some getting used to. Got it working tho?
Yes, now I need to find out how to add all of the item slot values up.
Is that possible?
It took away my slot number again after I tried sum(slots_using) (the column name) 💀
I've read through the manual & all of this string, but the solutions offered don't seem to address two of my problems. I have everything else done on my Liminal Project and am trying to apply finishing touches.
- I can't seem to link my Character sheet field to look-up an item field, what ever solution I attempt. I either end up with a complete blank or just ${MainLocale}$
- I can get dice to roll and hear a sound. However I can get nothing to display.
bros how did it just stop working
What's the formula to add a + before a number but a - if it's negative?
${ref('dexterity_score')}$ (+${[:dexterity_modifier:]}$)
That's what I have now
Right click on a roll command does nothing
🧢
Yes, you have to change in the rich text area the style on the bottom to "Dialog editor".
Only in this style journal or other links are interpreted.
${dexterity_score}$ (${dexterity_modifier >= 0 ? '+' : ''}$${dexterity_modifier}$)
Thanks!
Is there a way I can move things into tabbed panels without deleting stuff?
You could export the template, edit the JSON and import it back. There will be an easier way in the future, but right now you have to live with it
k thanks
I have almost completed my project for a Liminal module for use in my game but have run into two simple rubs that I can't resolve despite reading the documentation & scrolling through this entire chat & trying various solutions. I'm hoping the ever helpful @formal goblet , @brittle moth or someone might resolve these for me, please.
-
I can roll the dice but nothing shows up on screen (I get the dice roll sound though) and it yields this message
-
I seem to be unable to pull up a value from the items despite having created the sheet and and data items. I've tried via Hidden Attribute, Item Container, and direct using various suggestions I found in my scrolling of this chat
I don't know if it's the Cancer drugs muddling my thinking or what but it seems like this should be simple but I'm getting no where.
thank you
I see multiple things here:
- Your roll cannot work because the system doesn´t recognise it as a formula because you forgot to use
${}$. Your roll formula should look like this:
${#roll:= [2d6]}$
${roll + Athletics_key}$
or
${[2d6] + Athletics_key}$
or
${[2d6 + :Athletics_key:]}$
- You also don´t have to use
:as long as a variable is not inside[] - The Item reference column label doesn´t accept formulas. It is the name of the first column of the Item Container (so just leave it as
Nameas long as you don´t have another name for this column) - An Item Container cannot be referenced by other Components (different to a Dynamic Table), so
2ndTestcannot work - Item Modifiers can only set/modify values of the Actor, they cannot read them. So Item Modifiers can only use Item values for calculations
- If you want to use Item Data in your Actor Sheet, you can only do this via Item Modifiers or inside an Item Container (by using the
item.ItemKey-Syntax)
Thank you. That correction did work for the Roll. Much appreciated.
I don't quite follow the 2nd explanation though. Do you mean that if I want to reference something from data under the Items tab I must use an Item Container object from the Actor tab? Thus my Field Key is correct? But the Label I added is incorrect? If I understand you my original attempt was correct but it yielded a blank
My apologies for being dense.
You can leave the filters in your Item Container blank. These are only necessary if you want to conditionally display Items (e.g. you only want to display Items where the Key Equipped equals true.
This will not work because it is outside of an Item Container (item.ItemKey is not possible there)
I had already changed that
and still no go
Can you show the Item Template?
Press F12 and see if you get any errors
That was surprising
Uhm, that´s the wrong tab 😅 . Switch to 'Console'
You can ignore all white stuff. Only yellow and red are relevant. You can filter this list by configuring the log list. Just click on 'Default levels' and tick only warning and error.
But I can already tell that this looks pretty good so far
Thanks
So if I implement a bunch of sheets and macros to run a specific game using CSB, what's the best way to share it? Put everything in compendiums and export jsons to submit to the git repo?
Go to the settings-tab and you´ll find an export button there
I'm pretty new to Foundry, and I don't know how to code stuff, but I'm trying, and today's win was figuring out how to display the key value from a text field in another label (Maximum slots).
My question now is, is it possible to have it calculate a sum based on whether a column from a dynamic table is checkmarked or not? In this example, the Used slots should return 1. I'm assuming this is a problem a little more complex than I'm thinking.
sum(fetchFromDynamicTable('inv_table', 'inv_item_qty', 'inv_capacity', 'true'))
Ooh, lemme try that.
Close, but no dice.
Ok, it´s just true and not 'true'
Got it. Yes, thank you!
Sorry to bug you again, but can you tell me where I'm going wrong here? 12 is obviously way wrong.
Fixed it myself with parentheses in the right places. 🙂
So this game "Donjon" has an initiative system where you basically roll Xd20, where X is your level plus wisdom (they call it "discernment"). You don't add anything to the d20, and you don't add the X d20s to each other. Each individual d20 is a point in the initiative countdown that the character gets to take an action.... so the more initiative dice you have, the more actions you take in a round. I just finished making a macro that adds a character to the combat tracker X times, based on their stats. I love Foundry so very much.
All other checks are also based on rolling ungodly numbers of d20s and comparing them to the opposed d20s. I'm still working on that macro! lol
Does this grab macros as well? Or just the templates?
This is probably a dumb question, but does CSB not come with the health and power attributes built into actor tokens by default, the way Simple Worldbuilding does?
And if not, how do I make them?
Only Templates
The system generates Attribute Bars automatically from Number fields with max values. You just have to select them in the Token settings. If you need Custom Attribute Bars, then you can generate them in the Template. You have a button at the top of the Template for that.
Hi all! I was told that this is the best channel to ask a question about making a character sheet for a currently unsupported system. A caveat, I don't own Foundry yet, but I'm considering investing in it if it can help me with the game I'm trying to play.
So, the system I need a sheet for is Champions Now. The automation I’m seeking is absolutely minimal. I’m wondering about the effort (and skills) involved to make this happen in Foundry.
I’d only need the ability to:
- Roll 3d6 for ability checks and attack rolls and
- The ability to roll X number of d6 as effect dice.
The 3d6 roll only needs to give the total number rolled on the dice, so that’s already supported.
The effect dice need to give two values:
- The total amount rolled (no big deal there) and
- The “Core” rolled, where each result of 1 = 0, each result of 2 – 5 = 1, and each result of 6 = 2. (So rolling 4d6 and getting a 1, 3, 6, and 6 would yield 5 Core.)
Aside from that, everything else about the sheet is just a matter of laying out sections and text in a way that basically conforms to the attached sheet (without the need to conform to the two-column format).
So, can this be done in Foundry, and what would it take to do it?
I thought as much, but I can't find it, the category is empty.
You have to set a number field for the max Hitpoints.
Then make a second number field for the actual Hitpoints and in maximum value set ${key-of-your-max-hitpoit-number-field}$
Then you get a attribute bar.
That is one way to do it, but there are more possibilities.
Oh, I see. I was hoping I could get away with not showing the current value on the char sheet and keeping it on the token. But it seems I need to have it there to reference from. I'll see what I can do there. THanks.
You can change minimum role to see to GM.
I'm adding a GM-only-visible tab that contains current value number fields, gonna see if this works.
Looks like it works! Thanks so much for the help @vagrant hollow , all you guys are the best. 😄
Hello
Not sure if it is about the system or not but here my questions :
Is it possible to transfer an item attached to an actor sheet ot another actor?
And is it possible to display the image of an item attached to an actor sheet, like it is possible with the item non-attached, by right-clicking it?
Sadly nope to both.
only if you remove and put another
Okay ! And is it because of the system, or because of Foundry ?
Okay I see ! Thanks to both of you !
NP
What did I do wrong here?
${DropDown == Passive ? 2 : DropDown == Controlling ? -2 : 0}$
Try ${ref(DropDown) == Passive ? 2 : ref(DropDown) == Controlling ? -2 : 0}$
Use equalText() for string comparison
I should really check if operator overloading is doable in JS... overloading == for strings would be a blessing.
Sorry I'm late
when I tried that, it only outputed the value 2
I have a player setup. I have an NPC actor created. I have set the permissions on the actor so that the forementioned player has "Observer" permission. So the player sees the NPC actor in the actors list, but can't open the sheet. BUT.... on the sheet there are components that are set to "Observer" or lower minimums... Is this as expected, or is something being weird on my end here?
(I was trying to make it so that players can see some content on the NPC sheets)
Odd, I have a similar setup but it works as expected...
So would I format it like
${WavelengthShape.equalText("Passive") ? 2 : WavelengthShape.equalText("Controlling") ? -2 : 0}$
${equalText(WavelengthShape, 'Passive') ? 2 : equalText(WavelengthShape, 'Controlling') ? -2 : 0}$
It works! Thank you very much :)
So weird. I right-click=>Duplicated the NPC, and the dupe worked as expected. The original is still being wonky. 🤷 There's probably some corner case causing that, but the workaround is easy enough. Thanks for checking it for me.
I've used Custom System builder to do Champions (4th edition), which is very similar to Champions now. Setting up a sheet with the 3d6 rolls is straightforward, and setting up powers to roll Xd6 is also quite doable. I even have it modify the number of dice rolled for strength or other attributes as needed. Two things were a bit of a headache: rolls only have one output (I had to write a macro to get stun and body results from a single roll, for example), and the turn tracker is a single list, rather than the different phases for different speeds (I'll tell you how I got around that if you need it). In short, Foundry and CSB work pretty well for Champions.
Does Token Action HUD work with CSB?
Awesome, Thalsoval! That's very cool! Would you be able to share that macro that you used for Stun and Body? I'm not really planning on using the turn tracker, so that shouldn't be an issue. On a more general note, how much coding do I have to do to make the basic stuff work on Foundry? I'm not in any way a coder, so I'm wondering if the CSB is friendly to folks like me.
I'm in the same boat as you, no coding experience. I've found CSB to be pretty easy to work with. I wanted to automate a couple things, which is where I ran into trouble, but with some help from the fine folks here, I was able to get what I needed. But if you're just looking for a basic thing, yeah, this'll do it for ya.
Sure...I think I can also share the character sheet if you're interested. Let me look into that.
Awesome! Thanks for the info on the usability of CSB. Also, thanks for offering to share your 4th Edition sheet! I'd love to take a look at it. I plan to pick up Foundry later this week. (Maybe tomorrow.)
As you can see in the supported systems list of Token Action HUD it does not support CSB (cause everyone set in the template her/his own variable keys), but it can be done.
You can make your own setup for Token Action HUD.
You have to look in the descriptions of Token Action HUD.
Thank you.
Hello guys, I need some help. This is the formula I use in order to compute the damage of my weapon
${#dmg_roll:= [:item.dice:]}$
${floor(dmg_roll + (ref(item.statmod) / item.moddiv) + MOD2)}$
Usually, it works jsut fine. But, when I try to put a modifier that is a dice ( for example 1d10) it turns back an error. Note that when the modifier is null or equal to any given number, the formula works.
This is the console message error :
Formula.js:680 Error: Cannot convert "1d4" to a number
at convert (math.js:12242:57)
at Array.t (math.js:6552:67)
at Function.r (math.js:6691:72)
at Function.addScalar (math.js:6739:53)
at Function.oe (math.js:6724:82)
at add (math.js:6740:54)
at math.js:25781:48
at math.js:26516:66
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
computeStatic @ Formula.js:680
commons
How should I write it for the mod to be able to be replaced by an actual roll dice
The same way like your dmg_roll, where the result of the roll gets stored in a variable, so it can be used in your final formula.
weird question. Is there a way to specifically hide initiative rolls in fvtt or csb?
This the new roll formulas I have, they are usually displayed in a table (see below). The console is returning me some kind of syntax error, which is very frustrating cause it seems like I'm too blind to see it 😦
${?{MOD1}}$
${#att_roll:= [1d10]}$
${#att_mod:= [:MOD1:]}$
${att_roll + att_mod + ref(item.stat)}$
${?{MOD2}}$
${#dmg_roll:= [:item.dice:]}$
${#dmg_mod:= [:MOD2:]}$
${floor(dmg_roll + dmg_mod + (ref(item.statmod) / item.moddiv)}
=====================
<table style="width: 99.8878%; height: 100px; margin-left: auto; margin-right: auto;" border="1"><colgroup><col style="width: 35.7746%;"><col style="width: 64.2254%;"></colgroup>
<tbody>
<tr style="height: 30.8px;">
<td style="height: 30.8px;" colspan="2">
<h2 style="text-align: center;">${item.name}$</h2>
</td>
</tr>
<tr>
<td>Attaque + ${?{MOD1}}$</td>
<td>
<p>${#att_roll:= [1d10]}$</p>
<p>${#att<span class="hljs-attr">_mod</span>:= [:MOD1:]}$</p>
<p>${att_roll + att<span class="hljs-attr">_mod</span> + ref(item.stat)}$</p>
</td>
</tr>
<tr style="height: 33.6px;">
<td style="height: 33.6px;">Degats + ${?{MOD2}}$</td>
<td style="height: 33.6px;">
<p>${#dmg_roll:= [:item.dice:]}$</p>
<p>${#<span class="hljs-attr">dmg_mod</span>:= [:MOD2:]}$</p>
<p>${floor(dmg_roll + <span class="hljs-attr">dmg_mod</span> + (ref(item.statmod) / item.moddiv)}$</p>
</td>
</tr>
</tbody>
</table>
Try it with a default value: ${?{MOD1|0}}$
I remember i have read of a foundry module that change the combat encounter view for players to show only their personal stats.
But I can not find it again.
doesn't seem to work 😦
Wait, why do you have html-tags inside your formula <p>${#att<span class="hljs-attr">_mod</span>:= [:MOD1:]}$</p> ? I think removing them should do the trick 😅
actually... that's not what I'm trying to hide. The combat tracker's fine with the numbers. But I'm creating a system where each round, a player has a number of initiative slots... so the chat panel gets polluted with d20 rolls for initiative when combat starts.
I'm just trying to hide the initiative rolls in the Chat Messages panel...
nope x) even that did not do it
Can you post the new one and the error?
roll :
${?{MOD1|0}}$
${#att_roll:= [1d10]}$
${#att_mod:= [:MOD1:]}$
${att_roll + att_mod + ref(item.stat)}$
${?{MOD2|0}}$
${#dmg_roll:= [:item.dice:]}$
${#dmg_mod:= [:MOD2:]}$
${floor(dmg_roll + dmg_mod + (ref(item.statmod) / item.moddiv)}$
console :
Formula.js:680 SyntaxError: Parenthesis ) expected (char 61)
at pe (math.js:27324:37)
at se (math.js:27289:64)
at math.js:27143:64
at math.js:27260:49
at math.js:27261:45
at math.js:27266:41
at oe (math.js:27274:37)
at ae (math.js:27100:33)
at ie (math.js:27085:42)
at ne (math.js:27074:41)
here
The console says, that you´re missing a Parenthesis. I think it´s that one: ${floor(dmg_roll + dmg_mod + (ref(item.statmod) / item.moddiv))}$
Hello to the round!
I'm a complete newbie when it comes to CSB and I'm hoping someone here can help me out:
How do I integrate field values into dice rolls?
The key is item.key_item_weapon_damage_cube .
It is read and displayed in chat (${item.key_item_weapon_damage_cube}$) - unfortunately I can't manage to pack this
variable inside a dice roll.
In the field is "1d10".
Tried it out like this:
${'['}$.${item.key_item_weapon_damage_cube}$.${']'}$
which unfortunately does not work. 😦
Where is my error?
Thank you very much for your help!
Marc
In the label chat message put the following: ${[:item.key_item_weapon_damage_cube:]}$ this should make the label clickable and roll 1d10
If this is the effect you are after.
I still have one question: 😉
Is there a way to access character values from item values?
Background:
For example, I have a weapon with a damage value of 1d10. I want to assign this weapon to a character as an item. But the damage value should be adjusted dynamically depending on the strength of the character, e.g. "item.damage" + "char.str.".
You can only do this in Item Containers, not on the Item itself (yet).
Ok... I had not found a solution for this until now either... Thanks anyway!
Is the any way I can convert string values to dice rolls? I have strings listed like 2d6 and 1d10 but it does not let me roll them.
It should work. I have an example where the player can enter a roll formula, which then gets rolled:
<table>
<tr>
<th>Rollformula</th>
<th>${Roll:=?{Formula|'1d10'}}$</th>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>${[:Roll:]}$</strong></td>
</tr>
</table>
So is this is scripting?
No, this is a normal Label Roll Message (can be defined in every Label). Things like <table> or <tr> are just HTML-Tags (only some visual formatting). This example works perfectly fine without them
So if my dice string key is called DamageDie, I would copy and paste that, but replace 1d10 with DamageDie?
?{Formula|'1d10'} is a way to get user input, before the roll gets submitted. If you have the roll formula in a Component already, you don´t need this. Just ${[:DamageDie:]}$ would be enough
Alright TY :)
Hello! I'm a little burnt out and need some help with how to display a roll result. I just want to roll 1d20 and display the die result to chat with success/failure result displayed next to it. The scale I'm working with is 1 = critical failure, 2-5 = failure, 6-7 = penalty success, 8-14 = success, 15-19 = impressive success and 20 = critical success.
At the moment I'm just using ${roll:=[1d20]}$ for rolls.
Try this:
${roll == 1 ? "Critical Failure" : roll <= 5 ? "Failure" : roll <= 7 ? "Penalty Success" : roll <= 14 ? "Success" : roll <= 19 ? "Impressive Success" : "Critical Success" }$```
There might be a better way to do it, but this seems to work for me.
Obviously you can wrap this in html to display is better.
That's perfect! Thank you so much 😄
Hey guys, sorry, me again
${?{MOD|0}}$
${#skill_roll:= [1d10x10]}$ ${skill_roll}$
${#skill_mod:= [:MOD:]}$ ${[skill_roll + skill_mod + :cor:]}$
I'm using this formula for one of my roles, but it does not work. weird thing about it is that I use pretty similar things elsewhere and it's not a problem. but when I tried to use it for my skill rolls it gives me string errors :
console
Uncaught (in promise) Error: Unresolved StringTerm skill_roll requested for evaluation
at StringTerm.evaluate (foundry.js:11730:11)
at Roll._evaluate (foundry.js:9292:42)
at Roll.evaluate (foundry.js:9256:25)
at Formula.evaluateRoll (Formula.js:755:24)
at async Formula.compute (Formula.js:269:30)
at async ComputablePhrase.compute (ComputablePhrase.js:127:13)
at async HTMLAnchorElement.<anonymous> (Label.js:239:21)
Try using * instead of x for multiplication? 1d10*10 - I think
And you might need colons wrapping the skill_roll and skill_mod in the last formula as they need to be rolled?
${#skill_roll:= [1d10*10]}$ ${skill_roll}$
${#skill_mod:= [:MOD:]}$ ${[:skill_roll: + :skill_mod: + :cor:]}$```
What is cor?
If the last formula is just adding up the totals to display a number, you don't need the brackets or colons:
${skill_roll + skill_mod + cor}$
If cor is a value that needs to be rolled, just wrap that in the brackets and colon
${skill_roll + skill_mod + [:cor:]}$
I think that should work
Morning everyone. I'm just getting started with Custom System Builder. I hope this is the right place to come for expert opinions and best practices.
Well, we have an own designated channel, so chances are high that you´re right here
it's not for mutliplication, it's for make the dice explode on a 10, works just fine for other formulas
it might be this tho, let me try it
Hello
Is there a way to link iniitative between actors, for instance for companions or familiar?
I wrote it this way, now it shows up in the chat with an error (where it didn't even show before)
${?{MOD|0}}$ ${#skill_roll:= [1d10x10]}$ ${skill_roll}$ ${#skill_mod:= [:MOD:]}$ ${#skill_val:= [:cor:]}$ ${skill_roll + skill_mod + :skill_val}$
here cor is a hidden variable for one of my skills
console
Formula.js:680 SyntaxError: Value expected (char 26) (at math.js:27324:37)
at pe (math.js:27324:37)
at math.js:27252:85
at math.js:27253:77
at math.js:27254:73
at math.js:27255:69
at math.js:27256:65
at math.js:27257:61
at math.js:27258:57
at math.js:27259:53
at math.js:27260:49
You have an unnecessary colon at the end
Okay, that makes sense (I didn't realise that)
I hate it when it's only that, I'm so blind
thanks anyway 😂
I kept reading the formula again and again, and it never appeared to me
Ahoy ahoy.
Would there be any way to have a fully customisable sheet including icon and title placement?
If that is already possible, would someone be cool and run me through it.
Both doable with Labels. For a title, just select: Label style: Title. If you want to add an icon, you have to pick a valid Font-Awesome icon-name (like dice-d20) and enter it in Label icon https://fontawesome.com/icons
Sorry. Just noticed I didt make it very clear. I'm talking about the title and icon for the sheet as a whole. The ones that are placed automatically upon creation. Would I be able to move/customise those?
Uhhh, I´d say CSS might help you there
No worries. I have been dipping my toe into CSS so now I will need to dip my foot in 🙂
Oh, one more thing. Is there a way to limit the width of the window for a sheet?
Click on Configure sheet display and you´ll find a button to prevent resizing (yes, it´s not a max-limit, but it´s something)
I will use that for now cheers. It would be nice to be able to have min-max sizes for the window.
Well, CSS it is 😂
Haha, love it! I will see what I can figure out. Thanks for all the help, the system is amazing
My group loved what I was able to put together for them
Hi, is it possible to arrange dice roll results in ascending/descending order?
Not that I´d know
Sorry if I'm asking too many questions, but I'm trying to make a roll button that references a rich text field to paste the text to chat when pressed. This or any variety I've tried so far doesn't seem to be working.
${spec_abil_npc_text}$ should be enough.
Huh. I could've sworn when I tried that the first time about ten minutes ago, it wasn't pasting anything. Regardless, it worked this time. Must've been a typo. Thanks again, mate.
Hi again. Although the referenced text is pasting to chat correctly, any idea why it is pasting it twice, first as code, next correctly?
Uhh, dunno. Probably a bug because of the inline-rolls. Try it with !
Had to step away. You mean just to try the exclamation mark as the text? I'll do it when I get back and tag you.
I mean it this way: ${!spec_abil_npc_text}$
Oh, okay. Will try later. 👍
Nice to know it'll be fixed in the next release.
It seems to already be fixed but not released yet
Me again... 😉
Is there a way to show the images of the items in the item container as well and not only the name of the item?
Thanks a lot!
Nope
Very sad...
Thank you Martin!
Finally coming back around to this. I tried it with ! and it worked!
Hello
I am not sure if the Diagonal movement configuration is working... I have set the Alternating one (pathfinder style) but it is always equidistant one... I tried Euclidian, same thing...
Do & gates exist?
Uhh, yeah... although, they're not 'gates'. Gates are something commonly used in digital electronics and not in normal programming languages 🤣
I've to them as logic gates, anyway how do you use them?
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.
Hi. I have an item in an item container which references a skill to use it. The skill is a seperate equipable item. I want to call a field from the skill into the item container.
I.e. Weapon "gun" used the skill "handgun". The Skill "handgun" has a number field "assigned_points" containing the value 4. I want to pull the value in "assigned_points" into the item container to use in calculations against the weapons "gun" .
I've tried ${imported:=handgun.assigned_points}$ to get the value into a calcuation, but no joy.
Any tips please ?
To reference item keys, you have to use the item.key-syntax.
Sorry, can you expand, I thought I was using the item.key syntax with handgun.assigned_value
Got you. I understand, the item though is the weapons "gun" as this is the item in the container. The skill I'm calling is item.relevant_skill. This returns "firearms" and its from the skill "firearms" (a seperate equipable item) I want to call the assigned_value from.
Uh, show me a screenshot, it'll help to understand your problem
The top item container shows the skills and their fields, the second is the one where I want to put a value from the skill
Ok, I see. The problem is that interaction between multiple Item Containers is pretty limited, because you don't have access on Item Keys outside of the own Item Container.
Ah! That is what I'm trying to to do, as I was hoping to access the field from the skill directly
The sad thing is that Item Containers cannot be referenced like Dynamic Tables. The only way would be to use Item Modifiers, but that would be a rather 'dirty' approach
ok. But the Skills are in the datafile, so outside of the container, if I wanted to call the value from the field "assigned_value" fromteh skill, what is the syntax (i.e. if it was in a chat macro?
If you want to use macros, I´d first look at which data path the items lie (with game.actors.name() in the console or something else) and see if I could retrieve the values from the actor. There is a small section for macros in the README, but you´ll have to do the most part on your own for your specific needs: https://gitlab.com/custom-system-builder/custom-system-builder/#72-macro-api
Thanks. Not afraid of macros, just didn't want the hassle. But, heh ho, here I go
hello everyone. I have an item container that looks like the image. Is there a way to create a lable with a formula that returns the "wield" value of the first item specifically?
For what I am investigating, item containers cannot be easily referenced like you would a dynamic table, so my followup question in case this isn't possible is if I can make any kind of dynamic table that holds items in a convenient way, aka, not having to fill up 8 weapon stats manually
It's either Item Container or Dynamic Table, you'll have to choose one of the 2.
If you only need a value from 1 Item, you could just use an Item Modifier
well what I want is the item container to hold all of the weapons the player can use
but to only take into account the numbers of the first two of the list
but then again, you cannot reorder items within an item container
so I'm thinking the best way to do this is to add a checkbox of "equipped" within the item so that the item only applies the modifier if said checkbox is on
My approach would be to create a checkbox with the key equipped
That's exactly what I thought
Then that's what I will do
btw Martin you're always here and you know this system like you made it, thank you for all the help you give everyone
You're welcome. Well, I'm using this system heavely for our homebrew rule set, so I kinda have some exp with it. And I'm also a co-author (atleast what the system description in Foundry says 😅)
Oh, I didn't see that. Well, that explains it.
Still, many thanks
Can someone point me to where I need to look to get items drag&dropped onto sheets to roll from?
Thank ye kindly, friend.
Funnily enough, I was wondering earlier today how to use item containers. Heh
@brittle moth Two quick questions.
- What is the formula to update a separate field value with a label click? For example, I'm looking for a lablel's "Roll Message" formula to reduce a separate number field by 50 (with a component key of lets say "gp" and a current value of "100")?
- I created a Roll Table entitled "swap" that works fine when I click it directly, but when I put the formula "${[#<swap>]}$ " into a label's Roll Message it just shows "[#]" in the chat window. What am I doing wrong?
Muchas Gracias Amigo
@brittle moth BTW Of course I'm using the amazing Custom System Builder Module
- The system doesn´t have something like 'action buttons'. If you want one, you´ll need a macro.
- It should be
${[#swap]}$.<>are only there to indicate a replaceable value
For the dynamic table inv_table... is it not possible for new container items to be separate lines that can accept separate items in them?
Relatedly, what are the CSB best practices for dealing with items, sheets, and rolling directly from them?
I am currently trying to make it so equipping an item sets a hidden value as a literal text so I can use it as part of a formula on another calculation.
wProficiency here is set inside the item as "toughness", which is the key for a number within the actor, but it returns NaN.
in fact, when properly equipping the item, I can set up a label that shows its value turns from "0" to "toughness", but I can't use this word as part of another formula it seems
Ok, pretty niche, but if anyone has the same problem as me, you can use ref(value set to the word) to retrieve the actual value and use it for math, which seems to work without an issue.
Hey I am pretty new to foundry, and had a question about Custom system builder. How can we display the attributes on the character sheets?
my health is set to props.HP any clue how I could have it set to attributes.HP?
Hello, all. I'm not sure if this is the place to post this. Feel free to direct me somewhere else if it isn't. Am I right in assuming that CSB doesn't allow you to create a dynamic table with working Rich Text Areas? I can create the table with the Rich Text Areas, but I don't seem to be able to save content into those fields when working on a character sheet. (However, I am able to save content when working with Rich Text Areas embedded into a regular (non-dynamic) table. Is there a trick that I'm missing, or is that just the way it is?
Rich text areas work on my dynamic tables. Did you click the save button at the top of the writing prompt?
Hi. What is the name of the DIY system which I can just use for a bespoke system and mechanic.
Hi there! Thanks for the reply. I DID hit the save button at the top of the writing prompt. Many times. I get a little red circle with an arrow through it when I do, and it doesn't save the info. This has happened on two different projects now. I'll give it another go to see if I'm doing something wrong, but I don't think so ...
Try the save-button at the bottom and not at the top. I know that there is (was) a known bug with the save-button at the top
"Custom System Builder", "Sandbox" & "Simple Worldbuilding" are systems, which allow to create custom character sheets. You just have to decide which one you want to use. Here is a README-link for CSB: https://gitlab.com/custom-system-builder/custom-system-builder/
It´ll automatically set it to attributes.<Key> if the Component is a number field and has a max-value defined. Otherwise you´ll have to add an attribute bar (button on top of the template sheet).
Do you mean the values of the Components you have created? If yes, take a look at 'formulas': https://gitlab.com/custom-system-builder/custom-system-builder/#4-formulas
Ah! Thank you! The top button works for the regular tables. I didn't even notice that there was a bottom button, so I'll give that a shot. I really appreciate the support!
@formal goblet Is that not possible, as suspected?
nope, it isn´t. Dynamic Tables and Item Containers don´t work well together
Thanks.
The save button at the bottom worked, so I'm golden on that. One last question about dynamic tables: is there a way to have them generate a 1 row / two column table when player's add a row? In Champions Powers cost Endurance. I'd love to have each row look like this:
POWER [Rich Text Field] END [small text box]
I was going to do this by placing a 1 row/two column table in the dynamic table, but I guess I can't do that. Is there another way to accomplish this design?
I saw an example where someone added a table to a dynamic table via JSON-editing. Maybe you can accomplish something with this approach.
Thank you! I'll check it out. I was able to accomplish something close to what I want by using the Rich Text Field to add a table. It's almost perfect, except that the table has a background color that I can't get rid of. I removed the borders okay, but you can still see boxy discolorations nested in each line. Not pretty, but functional until I can figure out the other approach.
CSS might help out with your background color there
I don't know how to do CCS coding. 😦
I'll try to figure it out, though. Thank you. That gives me a place to explore. 🙂
CSS is pretty easy to learn, it´s not as complex as regular programming languages
Hello everyone here !
In case you're interested, I made a beta version of the system available, as well as an unstable version
The beta version will be updated a little bit before every official release, to allow you to test the new changes if you want, or allow you to get the latest features as soon as possible !
You can install it by using this manifest link : https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/main/raw/out/system.json?job=build-beta
The unstable version will be updated every time a change is made to the code : it has the most recent devs, but can also be quite buggy, and maybe break things. You can use it if you want to test out the latest changes and give your opinion about them 🙂
You can install it by using this manifest link : https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/develop/raw/out/system.json?job=build-unstable
Changelog for the new version is available here :
https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/main/CHANGELOG.md
README update and new documentation is being written 🙂
PS : the 2.2.0 version will likely be released during next week 🙂
A quick overview of the new features:
- You can hide all components based on formula conditions. This setting is in the 'Advanced configuration'-tab of every component
- The new function
getPropertyDataFromActor(actor, formula, [fallbackValue]), which allows to get data from other actors. You can also use this function to get actor data in an Item. https://gitlab.com/custom-system-builder/custom-system-builder#428-getpropertydatafromactor - The function
fetchFromDynamicTable(dynamicTableKey, targetColumn, [filterColumn], [filterValue], [comparisonOperator])now accepts an optional comparison operator (default is comparison by equality==) https://gitlab.com/custom-system-builder/custom-system-builder#421-fetchfromdynamictable - Components in the template can now be moved via Drag & Drop
In a formula, how do I reference a dropdown selection? The selection is a number in this case.
The key of the dropdown list is enough
Oh, sweet.
Hm, that doesn't seem to be calling the selection, just the key of the selection.
For reference, the formula I'm using is ${armor_dd}$ which is the key of the dropdown list.
and where does the 3 come from?
The dropdown list
Ahhhh. Ok, small hint. The key is the value you´ll get when you reference this dropdown. The Label is only the value, which gets displayed in the selection.
Key and Label can have equal values, so I recommend doing this
So the key can be just a number?
What about if I have another dropdown list, for a different game stat for example, and had numbers for those keys, would CSB know to keep them separate?
Keys of dropdown lists don´t have the same limitations like the Keys of Components. The value can contain any characters and the keys only have to be unique inside the dropdown list, not with other components
Here's an odd question. If you have a folder of items like here, is it possible to use these items to populate a dropdown list in a sheet?
uhm, nope 😅
Yeah, figured that was a stretch.
What would be the use case anyway?
The game I'm running (Broadsword) calculates encumbrance as unequipped items take up inventory slots, but equipped ones don't.
So I was thinking that if I can change the Item Name list in the dynamic table (with the checkboxes) to a dropdown, but have it populate with items, then a player could do something like this:
Equip a Dagger item by dragging from the folder to their sheet, then use the dropdown list to choose Greatsword to have unequipped, which would then be ticked to take up a slot.
I was hoping that if I later created new items in that folder, they could be added to the dropdown automagically by some reference coding of some sort.
Ultimately, it's a QoL improvement to make the players' lives a little easier. But honestly, now that I've said it out loud, having to write something down vs selecting from a dropdown is just as much work 🤣
I´d just create a checkbox in the Item to signal if the Item is equipped or not. Then I´d create an Item Modifier which would add encumbrance based on if the Item is equipped or not. 😅
Wouldn't that get wonky if multiple players take the item to their sheets?
Like, one character has it equipped, but another is just carrying it around.
The Items from the folder are getting copied, when they get dragged to a character sheet. So everybody would have their own items
Dang, okay. I'm sorry you have to suffer through my noob questions, just because I don't know how the system works well enough. 😅
All good 😂
Though, this does simplify things a fair bit. Thanks again.
https://gitlab.com/custom-system-builder/custom-system-builder/#5-items-
Item can be attributed to actors or other items by dragging and dropping them onto other sheets. Caution : This attribution process creates a clone of said item, so any changes to an item's values won't be reported on attributed versions of the item, and vice versa.
So I assume that the checkmark for Make item unique means that it doesn't get duped and only one person is allowed to have it?
It means that you cannot have 2 instances of the same Item at the same time on the same sheet.
I should've waited like 5 seconds to hit enter on that question, as I read the same thing on the link you gave.
Once I get around to changing all the stuff I can change, I'm probably gonna be back to ask you about the Item Modifiers, once I try a few times and inevitably end up not getting how it works or what formula I need to get it to work. XD
The formula will probably be something like ${equipped ? 0 : quantity}$
I gotta get to dinner, but I'll be back to this later tonight. Thanks so much for your help thus far, you are a champ.
Hey folks! I see the Additional CSS Classes option in the Edit component window in CSB. Is that where I would enter CSS code to lighten the color of an element on my sheet? If so, can anybody point me to a tutorial on how to use this function?
If it helps in guiding me, the specific thing I'm trying to remove is the color of the boxes enclosing the Powers on the list below. Those boxes were created by the fact that I had to embed tables within the Rich Text Areas of the character sheet to separate the Powers from their Endurance cost. It works great, but that discoloration is nagging at me.
I'm sure this is a simple question for you:
How can I assign dice values to variables without outputting the values directly in chat?
Background: I want to dynamically define in a template for a chest whether there are valuables in it or not.
roll_gold:=[1d2]
If roll_gold == 1, then roll the gold amount, if roll_gold == 2, then not.
Thanks a lot!
I think this is what you would need https://gitlab.com/custom-system-builder/custom-system-builder/#84-Use-your-own-CSS
If I wanted to use a label roll message to include an actor's or item's image, how do I find how to reference that?
Suggestion: Add an option for Manhattan movement under Diagonal Movement Rule in the system settings.
Hey all! How can I get my condition modifiers to math themselves together? Like instead of "-1 -1 -1", it says "-3". I just want the sheet to look cleaner, not like any character would still be alive with everything checked...🤣
Second question, I've stared at the "user input" section for 1000 hours and I have no idea what I'm looking at, how do I just get a box that has 3 buttons that say "advantage", "disadvantage", and "normal". Everything I've tried demands some input in a box.
I think ${(sum(${pc_hungry ? '-1' : ''}$) + (${pc_fright ? '-1' : ''}$) + (${pc_wound ? '-1' : ''}$))}$ should work. Double check that I got all the parentheses correct, though.
Anyone? 😕
It looked like all the symbols were right but...
${roll_gold:=[1d2]}$ for the variable
${!roll_gold==1?doStuff:''}$
or something like that should do it with doStuff being your new roll, e.g. [1d4] or similar
the ! in the message makes it a pure text message without showing the dice roll but also suppresses an empty output you would get without it if roll_gold = 2. if you want to suppress the output of roll_gold then prefix it with a #
Thank you very much!
I was missing the # to suppress the output....
Yeah, sorry. I have no idea why that isn't working. You'll have to wait for someone more knowledgeable than me to figure that one out. :/
use concat() as in
${concat(pc_hungry ? '-1' : '',pc_fright ? '-1' : '',pc_wound ? '-1' : '')}$
that should give you -1-1-1 or any kind of -1 chain
no problem! Thank you for trying 🙂
I think Tavinnea wanted the -1-1-1 to be -3 instead.
ah sry
I was just about to ask what concat is
are the conditions checkboxes or do they have a value? cannot quite see it on the image
this is all a severely new languaage to me 😛 They are checkboxes.
ok a moment please
in the image, I have all the checkboxes ticked so that all the potential modifiers show up next to their skill
${(pc_hungry?-1:0)+(pc_fright?-1:0)+(pc_wound?-1:0)}$
maybe that?
That should work 🙂
yeah the quotes make it a text instead of a number
The example above with the sum had some syntax errors. And concat is only useful for strings, not with mathematical stuff.
ooooh ok, thank you for the lesson!!
yeah i did some stupid stuff with numbers and concat in my sheet, it works but by god is it annoying
${sum(pc_hungry ? -1 : 0, pc_fright ? -1 : 0, pc_wound ? -1 : 0)}$ would be the right example with sum()
Blind leading the blind, my bad. Heh..
About the user input stuff: There is currently no other implementation for this, so you have to live with it right now.
ok, so now it shows a zero instead of being blank when there are no conditions so I just have to decide what I like better 😛
ah ok no problem
I'd like to circle back to this request please 🙂
(forgot to attach the reply, haha)
Images are not referencable in the current state
Fair enough.
Can you open an Issue for that? It's easy to add that but I need some details about it (and a place, where it's not getting lost 😅)
I'm sorry, I'm afraid I can barely navigate git to just read things; I'm hopeless when it comes to trying to add anything. I don't know how to open an Issue.
As far as details about it: https://en.wikipedia.org/wiki/Taxicab_geometry
A taxicab geometry or a Manhattan geometry is a geometry whose usual distance function or metric of Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the absolute differences of their Cartesian coordinates. The taxicab metric is also known as rectilinear distance, L1 distance, L1 distance or
...
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues just click on 'new issue'
I'm pretty sure we have that one already (although under an other name)
Hey there. I have a question. I'd like to include a drop-down parameter in a roll from my character sheet. Is there a way to have the parameter be an item in a list?
For example: ${#?{difficultyMod|0}}$ is my current parameter definition. I'd like the options to be a list of options instead of a type in field.
So far everything works... unfortunately I am still stuck at one point:
${roll_gold_jn == 1 ? "<p style='color:white; background:green; border:none; vertical-align: middle;'><img src='Objects/Gold_Icon.png' style='border:0;' width='40px' height='40px'>Found gold: </p>" roll_gold_value [1d20] : roll_gold_jn == 2 ? "<p style='color:red; background:black; border:none;'>No gold</p>" : "." }$
I want to output here (roll_gold_value [1d20]) after "Found gold" a d20 dice value.
Unfortunately, I always get an error displayed here. I had already tried it simply with [1d20] or {[1d20]}. But that did not work.
What would be the correct syntax here?
Thanks a lot for your help!
Try this?
${roll_gold_jn == 1 ? "<p style='color:white; background:green; border:none; vertical-align: middle;'><img src='Objects/Gold_Icon.png' style='border:0;' width='40px' height='40px'>Found gold: [1d20]</p>" : roll_gold_jn == 2 ? "<p style='color:red; background:black; border:none;'>No gold.</p>" : ""}$
I think the error was having the die roll outside of the quotation marks in the first part of the condition?
I should mention that I tested this and it works for me.
User input can only be a normal input field, because there is no other implementation for this.
Thanks.
The problem is that you have multiple things next to each other without operators or functions. Something like ${'some text' someKey [1d20]}$ is invalid because the program doesn't know what to do with these things (should it sum up everything or should it concatenate everything together?)
${concat('someText', someKey, [1d20])}$ this one would be a valid example.
Thank you!
I have a problem with items not updating a status checkbox.
I have ${weap_equipped_check ? 'Yes' : 'No' }$ for the Equipped column Label text. I drag an item onto the sheet, it populates the dropdown Attack Dice value correctly, even when I change the value. But if I check the Equipped? checkbox on the item, it doesn't change the No to a Yes on the sheet. ?
Is there any known way to implement custom active effects? Removing the default ones, adding in new ones with specific icons, names, and the ability to add modifiers to each? I have been using combat utility belt as a band-aid solution but it seems to break active effects entirely, so I was wondering if there was some way, any way to add in custom effects.
Did you prefix the key with item.?
Currently not, you can only add modifiers to existing effects.
Is there really no way? Not even digging through some of the code or whatever? I mean there has to be a way to at least change what the system uses to display it. Really really unfortunate, I was really hoping to get this to work, I hope this gets added in soon, seems like the only thing that you can't really change for some reason.
Regardless I'll keep trying to figure things out, shame theres no easy way. Just wish I knew what I was doing lol
It is atleast planned to add custom effects.
Yeah, but I don't know how long that'll take, been a while too. I don't want to rush the process of course, but I still intend on at least trying to figure out a way to hammer together a solution until then.
Knew about the request for a while, I'm glad I'm not the only one who's asked at the very least.
Appreciate the response though
Well, everyone is able to do merge requests, so technically everyone can add a solution to the codebase. Otherwise you'll have to wait for an implementation
True! Well I ended up figuring it out, but it's certainly not a solution that can be included in the module itself. Just glad I finally seem to got it working, just took some time to figure it out and get the changes done.
How can I change field values based on selections?
Background:
Based on the selection of a race, I want to give a bonus directly to certain base values.
I have recorded the available races in a dropdown box. On selection I would like to give e.g. a bonus or also a malus on "Strength".
How can I implement something like that?
Thanks for your help here on Discord! You have already helped me a lot! Thank you!
Sorry I have a question that's probably going to show how bad I am at programming
I am trying to click a label and have it roll a certain amount of dice based on the imputed value in a numbers box, but I don't want it to add the dice together, just give a string of values, hopefully getting to the point to say how many are above another number but that comes later.
currently I have a really simple, which will roll the dice, but it adds all of them together ${[(1*:Spell_Power:)d10]}$
how can I have it return a string of numbers instead of adding them together?
It seems I had forgotten this detail; added it and now it works flawlessly. Thanks.
But now I have the same problem of the user yesterday, where checkmarks aren't adding up. Even using the same sum syntax as yesterday, which, as you can see, is ${sum(item.armor_cap_check ? 1 : 0, item.weap_cap_check ? 1 : 0)}$ , it isn't adding up to any number output. Checked should = 1, unchecked should = 0.
Well, one of the issues seems to have been that item. *_cap_check needed to be placed in quotes, which did output a number finally, but it's not correct.
Can anyone point me at a post or tutorial on how to implement item containers? There is something I'm just not getting.
Is 'malus' even an english word? I only know it from german rulebooks.😅
Nethertheless, your Strength (or any other Key which needs this modifier) would ask your selection, if a specific race is selected to apply the modifier. It would look like this: ${equalText(dropdownKey, 'Orc') ? 1 : 0}$. This example would modify your Strength by 1 if Orc is selected.
https://gitlab.com/custom-system-builder/custom-system-builder#311-item-containers Read the sections about Item Containers and Items.
In English, I think it's an uncommonly used word - I've certainly haven't heard anyone use it in the past decade -but does mean various shades of unpleasant.
That doesn't seem right (except you've put this key into ref()). Check if you get values from every key (you can use Label prefix or suffix for that).
Well, it's quite common in german 😄
Oops... sorry... yes, you are right: it is a German word... I don't know if this term exists in English as well. 🙂
@spare sky
In German, Malus stands for "point deduction to compensate for a visible advantage", among other things.
If I change it to ref() a different stat, it does spit out the value for it, as that exact thing is done for "Maximum Slots." But there are no items dragged onto the sheet, yet it's counting 2 used.
Thank you very much! I will try it out...
The quotes shouldn't be there. Otherwise it will only check if your text (in this case 'item.armor_cap_check') is not empty 😅
And because the text isn't empty, it always returns a 1 (2 in this case because you have 2 checks)
Without any items dragged onto the sheet, it should return 0. When I take out the apostrophes, it doesn't return anything; it's blank. Even when I drop an item in with the checkmark ticked, it doesn't update to 1. I'm clearly missing something somewhere.
Enter ${item.armor_cap_check}$ in your Label prefix and see if you get something. If not, check your keys and your console (F12)
Wait a sec, where do you want to access your item data?
Because item.key only works inside Item Containers.
Basically, I want to be able to drop items onto the sheet into their respective item containers and for each item, if one ticks the checkbox for Inv Slot, the system should count that as 1, then sum up the total under Used Slots.
Is this where individual Item Modifiers comes into play, perhaps?
Yep, for everything, that is not directly used in Item Containers, you need Item Modifiers.
Is this right, then?
This doesn't solve for why Used Slots is not returning any numbers.
Edit: Even with nothing on the sheet, I should be seeing 0, at least.
What's the key of Used Slots?
cap_used_text
That should be the key of the modifier
The value formula and operator are good though? (I goofed and needed to swap the 0 and 1 so 1 is in the true spot)
operator should be '+', otherwise every Item would set a 1 or 0 and rewrite every old value.
Okay. So: armor_cap_check + ${cap_used_text ? 1 : 0}$
Prio: 0,
Key: cap_used_text,
Operator: +,
Value formula: ${armor_cap_check ? 1 : 0}$
Dangit, I had it backwards again.
And make sure that cap_used_text has an initial value of 0.
cap_used_text is a Label component. How do I give it a value of 0?
Ok, this is what I'm trying to do: Apply an "adjective" item to a species in an item container in a list. But I cannot drag the item into the character sheet. Can anyone give me some guidance? I read the info on the git page.
Hm... I think I'm still stuck here:
In which field can I put
${equalText(key_race, 'human') ? 1 : 0}$
in a number field "strength"?
Ich würde noch extra Spalten machen mit Modifikator und Gesamtwert. Könnte dann so ähnlich aussehen:
Ah... ich verstehe... gute Idee... und die Formel packe ich dann in das Label "Mod"?
Yup
Alles klar... Danke Dir!
Und Gesamt rechnet dann den Grundwert mit dem Mod zusammen
Label text (optional): 0
Habe ich die Möglichkeit, über eine Checkbox verschiedene Tabellen ein- bzw. auszublenden?
Ja, ist allerdings erst im kommenden Release möglich. #1037072885044477962 message
Sehr gut... 🙂 👍
Items cannot be attached to other Items, they can only be dragged to an Actor.
That's already where the formula is being put. Do you mean for me to append it with + 0 or some such?
huh, which formula? Anyway, just make sure, that there is a number. Be it with an initial value or with a formula.
Right now, it doesn't seem to matter what formula I try, because they are all returning a blank in the sheet. This is what I currently have.
Replace the formula with 0
Cool. But when I drag an item to the sheet and tick the checkbox, it doesn't add 1 to the sum.
You have it wrong again #1037072885044477962 message 🤣
Oh FFS
headdesk
Welp, thank you, that sure seemed to solve the problem. Sorry I'm an idiot
Hallo Martin,
leider funktioniert es immer noch nicht und ich habe auch schon einiges ausprobiert...:-/ Kannst Du mir sagen, wo mein Fehler liegt?
Dropdown:
Option-Key: key_rasse
Option-Label: Mensch
Mod-Formel in Tabelle:
${equalText(key_rasse, 'Mensch')?1:0}$
Die Keys in den Dropdowns sind das, was du als Wert zurückkriegst, wenn du das Dropdown-Feld referenzierst. ${key_dropdown_rasse}$ würde dir als Wert key_rasse liefern.
Macht also Sinn, den Keys den selben Namen zu geben wie deinen Labels
Ich dachte, die Keys müssen eindeutig sein...
Die Keys innerhalb des Dropdowns müssen nur einzigartig im jeweiligen Dropdown sein.
Ok... also so?
Mach einfach: Mensch - Mensch, Elf - Elf
Alles klar... scheint jetzt zu funktionieren. Nur für mein Verständnis: das bedeutet, dass ich in einem Dropdown immer die Keys gleich den Labels setzen muss, um auf diese zuzugreifen?
Ne, nicht zwingend. Key ist das, was du als Wert kriegst, wenn du dieses Dropdown referenzierst. Label ist das, was auf dem Dropdown angezeigt wird in der Auswahl (ist also nur ein rein visueller Wert).
Ok... Danke Dir! 🙂
Guys, is it normal that I cannot modify the attribute bars on the tokens ?
I mean I can set up them, but that I can't modify the current value for hp for example or things like this
Is the attribute bar set up with a formula or number field?
the current is a number field and the max is a formula
is it 2.1.0 ?
I'll install it and let you know
nope
maybe I'm doing it wrong tho
${pv}$ is the value of a number field
same for all the other values
The Maximum sends to a hidden attribute or a label
Ahh, I see where the problem lies. You should define a max value in your number field. As soon as a number field has a defined max value, it gets available automatically in the attribute bar selection.
What you did is using only formulas, so the current value cannot be altered by the token.
So I should set the max value in the number field and delete the keys I put in maximum ?
You don't need these at all if you can use number fields
Okay I see, but is there a way for me to set up a Max value through a hidden attribute
would this work ?
Sure. Hidden attributes are like normal Labels.
Now you should be able to find an attribute bar with the key en in your token settings.
exactly, the problem is that the max value doesn't update automatically
For example if I change the max hp in the sheet from 9 to 10 then it does not update on the token, in only update the current value
Is the token linked with an actor? If not, you should make sure, that you open the sheet of this token
the token is linked
seems like I can only set up the max manually here
It should update automatically... something is still not right
So to sum up how I did it
1- there is a number field with a max value equal to ${enm}$
2- I have a hidden attribute called enm that is equal to a bunch of other keys multiplied by 4. The key works find and is used to display the max value on the sheet.
3- I have a bar that has for attribute props.en
Found your issue: You should select attributeBar.en, not the prop 😅
nice perfect thanks
Sorry, does anyone know how to make it roll multiple dice but not add the dice together?
This is not possible at the moment, sorry. if you want the multiple results, you'll need to roll the dice separately, but if your dice number is dynamic you can't do that :/
hmmm alright. Thankyou for the response
Macros ... I'm currently working on implementing Donjon rpg using CSB. It uses d20 dice pools that are not supposed to be added up. I will put it all up in github soonish
@formal goblet Hi Martin! Kurze Frage: gibt es irgendwo ein Tutorial bzw. eine Anleitung, wie ich über den CSB den Charakterbogen gestalten kann/muss, um darüber auch Kämpfe durchführen zu können? Leider konnte ich dazu nichts finden. Danke Dir!
Du musst lediglich die Initiative in den Systemeinstellungen festlegen. Alles andere kommt von Foundry selbst
Hm... Die Initiative kann ich ja in dem "Begegnungs-Chat" für die Tokens auswürfeln lassen und auch die Lebenspunkte kann ich tracken. So weit so gut... Wie kann ich aber jetzt einen Angriffswurf über den Chat gegen den Gegner führen? Muss ich dafür die Keys der Skills besonders benennen, dass diese erkannt werden (z.B. Angriff mit Fernkampfwaffe)?
Wahrscheinlich habe ich das System auch noch nicht wirklich verstanden, da ich bisher das Kampfsystem von Foundry noch nicht genutzt hatte... 🙃
Dafür wirst du die Label Roll Messages brauchen (können in jedem Label definiert werden). Da legst du fest, welche Würfel gewürfelt werden und welcher Text zustande kommen soll: https://gitlab.com/custom-system-builder/custom-system-builder/#45-add-rolls
Super... Vielen Dank! Ich schaue mir das dann Mal näher an... 👍
Hier ein Beispiel, wie es aussehen kann (funktioniert ohne Werte):
<table>
<tr>
<th>Standartprobe</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[1d20]}$
<strong>${!Roll >= 20 ? '<br>Kritischer Erfolg' : Roll <= 1 ? '<br>Patzer' : ''}$</strong></td>
</tr>
<tr>
<td>Würfelmod</td>
<td>${W_Mod:=?{Modifikator|0}}$</td>
</tr>
<tr>
<td><strong>Ergebnis</strong></td>
<td><strong>${Roll + W_Mod}$</strong></td>
</tr>
</table>
OK... Soetwas habe ich im Bogen bereits an mehreren Stellen umgesetzt, z.B. bei jedem Skill eine Probe zu würfeln und auszugeben, ob die Probe erfolgreich war oder nicht bzw. einen kritischen Erfolg oder Patzer war... Das ist soweit bekannt.
Das, was ich noch nicht hinbekomme, ist halt die Verbindung gegen die Werte des markierten Gegners innerhalb des Kampf-Chats (heißt der wirklich so?) 😁
Ich schaue mir das aber heute Abend noch einmal näher an...
Ist ne Funktion, die mit dem kommenden Update kommt: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/main/README_BETA.md#428-getpropertydatafromactor
Alles klar... dann hätte ich ja lange suchen können... 😉
Vielen Dank für Dein schnelles Feedback! 👍
Is it possible to add a roll button to the actor sheet? to roll with some starts and modifiers? Also, is it possible to add a button to send test to the chat, for example an item description?
Define a Label Roll Message and the Label becomes clickable automatically
Ah, I was confused by the help text I think for the rolls. Thank you. Any thoughts on the option to send an item description to chat?
Define a Label on the Item. There you can create a normal Label Roll Message and reference the key of the description.
Thank you again, I am experimenting at the moment, can I use a reference from a dynamic table, so for example I am setting up per the attached image, the value in each row would be different, but the component key for each would be weapon_damage, can it take from it's own row each time, or does it need a static item to reference?
Hi, does someone know if I can reference the name of the actor on a formula?
Nope, not possible 😅 . Except you create an own input field with the name
Ah, that's a shame
Wait, how about an item name? can I reference it within the item or is it the same situation?
but I can't use it as an item modifier
well, that's fine, just annoying
I can make GM fields and fill them by hand
I am a patreon to several foundry artist and now recognised that their content can not be fully used in CSB.
Especially Bailywiki has a ton of actors (with token attacher combined prefabs) that dont work when imported to CSB.
As far as I found these artists set their actors in the compendiums as actor:type:npc.
But this actor type does not exist in CSB.
So when trying to import, foundry just takes the next best actor type – template.
And templates can not be placed on the map.
The actor type can not be changed after import and foundry does not offer a possibility to change the import acter type target.
With this all these artist prefabbed actors are useless in CSB at the moment. 😵💫 😭
What has to be done to get a actor:type:npc sheet to CSB to get these content working?
Do you import from a JSON? Then I'd say you should change it there
Importing from the artist compendiums.
Changing it there will be a very lot and would be necessary after an update again.
Also I am a bit confused that it seams that no one has stumbled over this problem bevor me.
Getting an actor:type:npc would solve the problem for everyone forever.
Well... I usually make my own actors 😅
Btw, I like that you used 'bevor' instead of 'before' 🤣
Ja, ja, der schnell tippende Deutsche der nicht ließt was er geschrieben hat🤣
But I am seeing here a bigger problem for CSB. It is a bit of locking of other artists work.
I don’t think that a general solution would be so much work.
Then you don’t know Bailywikis work? His prefab buildings with walls, lights and special effects that can be placed as actors just by drag and drop to a map are just a very big help if I need a fast map.
Actors are strongly linked to game systems in foundry, so I highly doubt this would work in any way. I will be taking a look in Baykiwiki's work, maybe there are some steps to integrate his compendiums regardless of the system, but I can't promise anything :/
I have found a solution just a minute bevor.
The problem is not done by foundry itself, it comes out of the import function of token attacher.
Just changed the order of “_template” and “character” in CSBs template.json
Now default is character and I had to run the import function of token attacher again.
Eh voilà, the artist actors work.
I would suggest to change this in the installation version.
Ah, yeah, I misread what you said, sorry
Well that's doable ^^
My first thought was doing an empty npc sheet for CSB, so you didn’t misread me here. 🥸
But while I had a look how it works in other systems, I thought the solution should be even more simple.
this should now work correctly in beta 2.2.0-rc7 🙂
First off, I think this is an awesome system.
Second, I'm struggling with the samerow function at the moment, when I attempt to use it it posts my formula to the chat instead of the data. Clearly user error, but I can't see what I am doing wrong.
If I move the last } before the $, which makes more sense, then it posts 1D6 into the chat rather than the dice roll
I'm new to CSB. I'm currently working on the inventory part of the character sheet I made. When using an Item Container for drag and drop weapons, the document says you can only use labels within the Item Container.
How would one tackle ammo? I can easily reference the maximum ammo capacity via Item Container, but since we can't use anything other than Label within it, how do we do an Ammo field?
My current solution is to just use a Horizontal Panel to separate the Item Container and the Current Ammo amount:
You might need to have a separate ammo Item?
Ah. I wanted it to be inline with the actual equipped weapon. If that's not possible, I'll try your solution.
Maybe add a "current ammo" field to the item template, so you can display it and the player clicks on the item name to keep this updated? You could even do some clever scripting perhaps to update this on the fly based on the action of firing the weapon (somehow, don't ask me how)?
I tried it, but then I'd need to update the ammo on the actual item entry because the Item Container doesnt accept anything but labels.
I reached the point that I think the sameRow argument does not support a calculation, it can only return the text in the field, so doing ${sameRow('weapon_damage', 0)}$ just returns 1D6 instead of the value 1-6. I tried removing the '', and replacing with either nothing, () or [], and in those cases the button just fails to fire. Any suggestions on how to make that work, or is it not possible at the moment?
Indeed, this is true. BUT ! This is a planned feature to have other fields in item containers, and have them modify the values on the item