#Custom System Builder
1 messages · Page 35 of 1
Hey all. I have (with your patient help) figured out how to apply CSS classes to components. This has been wonderful!
How do I go about applying them to the template or sheet as a whole? For example, if I wanted to change the background image or texture, or apply a particular font to the entire sheet. Thanks in advance 🙏
Having a bit of an issue with a conditions formula. Wiki states that >/< work but im getting an error output. Am trying to get the following to work which compares a pulled figure from target against a roll further up in the roll message. Both the call and the roll work fine. I can add the two together and that works.
${fetchFromActor('target', "PAC", 0)<roll?"Hit":"Miss"}$
I dont think the componants are the issue, but to check i did also try a simplified is field greater than arbitrary number (below) and that didnt work either so not sure where im going wrong here. does anyone have any insights?
${SkillLevel<10?"Hit":"Miss"}$
section 8.4 in the wiki states that this needs to be done in the settings by adding a css file to the server and telling it where to look in the settings.
Yes, I have a CSS file in place. (and it took me a while for it to make sense 🥲 ) In a component like a label or panel, I would put the class in the "Advanced Configuration" section; my question is where to put a CSS class so that the entire template will receive it.
Thanks for the reply btw
Oh, i would have assumed that assigning the file in the settings would have just overwritten the default file. I dont believe that there is a setting in the same way that there is with a label. but i might be wrong and just havnt come accross it yet.
Well, my entire file is just declared classes. I'll try adding some styles to it too and see how it goes!
Do you have an example of a style sheet youu've used for this purpose? I'd like to look at the formatting. I'm a complete novice, still learning the basics
Ive not dived into that aspect yet, still working on functionality, will get to pretty eventually....
The attatched is the default css file which you should also be able to find in your own file structure. Theres a few sections refering to sheets, using that as a guide would probably be a good place to start.
I did also send you a direct message with a link to the community wiki. it says its not been updated in a while so i havnt linked here as im not sure how relevant it still is, but as a starting point its probably ok.
Hi! I've been tweaking the character sheet for my system and I'm trying to do something with radio buttons.
I have a dynamic table with three columns: radio button, skill name, and skill modifier (player-inputted number). I'd like to:
- Let the player pick a skill with the radio button
- Add the skill modifier to the die roll (the button is elsewhere in the sheet)
- Be able to not have any radio buttons active
How would I go about this? I guess my two main questions are:
- How to get the relevant skill modifier the radio button
- How to "clear all" radio buttons
Radio Buttons do not work well with Dynamic Tables. And clearing them was also never a requirement:
Radio buttons are a common way to allow users to make a single selection from a list of options. Since only one radio button can be selected at a time (within the same group), each available choice must be its own item and label. In contrast, checkboxes may show a single label, with the checked/unchecked status of the item meaning opposite thing...
I know, I just didn't know if there was an option to have a button somewhere that would force all radio buttons to go back to their default off state
do you know how I could approach what I wanted to do? Even if it's not exactly in the same way I imagined?
I don't know if it works, but setPropertyInEntity() might help resetting the state of the group.
I'd use a Dropdown to select a Skill instead
hmm I'll play around with it
@formal goblet do you have any idea whats going on with this?
Having a bit of an issue with a conditions formula. Wiki states that >/< work but im getting an error output. Am trying to get the following to work which compares a pulled figure from target against a roll further up in the roll message. Both the call and the roll work fine. I can add the two together and that works. (below table in attached chat message shows condition output and + output)
${fetchFromActor('target', "PAC", 0)<roll?"Hit":"Miss"}$
I dont think the componants are the issue, but to check i did also try a simplified is field greater than arbitrary number (below) and that didnt work either so not sure where im going wrong here.
${SkillLevel<10?"Hit":"Miss"}$
Bedech posted a roll message the other [day ](#1037072885044477962 message) where similar uses of conditions were used so im fairly sure its possible with how i have it formatted.
Check the last line of the error message. The <> signs are converted to > or < whenever using the Rich Text Editor. Avoid the editor or correct the conversions and you should be fine.
ohh! damn I was looking at that and wondering what was going on. didnt consider Rich Text change. Thank you!
hi i need help moving my items, nothing matches and i jsut need some help please
im getting overloaded
Hi all! im newer to messing with the custom system builder system and i wanted to know if anyone knew of a solution to my problem, be it custom script or otherwise.
Essentially i want to make it so i can make a "Variable exploding dice". For example, I understand to make exploding dice you make something along the lines of [1d100x>=80] and then the dice will explode if you roll 80 and above. I have also figured out how to make it work with in table modifiers and such. But what i want to be able to do is have a comination of dice / modifers explode if they reach above a certain number. example:
[(1d100+1d20+str)x>=80] So if the player had a Stat called strength (variable name str) if they roll above 80 with the combined total of the d100+ their strength stat and a D20 roll the entire formula would roll again and increase the final total.
I don't know if there is built-in functionality for this, but it would be easy to make a script to do it. const explode = thresholdToExplode#Here; const result = Roll + str; if(result >= explode) {newRoll} would be the basic format either in %{}% or a macro, with Rolls being the reference to the result and then just printing a ChatMessage.create() with the content to display how you want.
${stand_checkbox(switchCase(speeddropdown, 'SpeedSRank', 9, 'SpeedARank', 5, 'SpeedBRank', 3, 'SpeedCRank', 1, 'SpeedDRank', -3, 'SpeedERank', -5)):0}$
so just got using the beta and these two formulas. The first is a hidden attribute.
the second is my attempt at a health roll.
${standcheckbox}$ ${#roll_formula:= stand_checkbox ? concat('+', switchCase(durabilitydropdown,'DurabilitySRank','4d6','DurabilityARank','3d6','DurabilityBRank','3d6k2','DurabilityCRank','2d6','DurabilityDRank','2d6k1','DurabilityERank','1d6')):''}$ ${[:brawnsmod:d6:roll_formula:]}$
Ok I will attempt this. Thanks for the help!
Getting this error on a new character sheet using v4
at Function.entries (<anonymous>)
at Object.selectOptions (foundry.js:8253:36)
at Object.c (handlebars.min.js:27:27865)
at eval (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:15:159)
at h (handlebars.min.js:27:25975)
at c (handlebars.min.js:27:6943)
at Object.<anonymous> (handlebars.min.js:27:7333)
at Object.c (handlebars.min.js:27:27865)
at Object.eval [as main] (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:25:49)
at c (handlebars.min.js:27:23534)```
I am attempting to edit a Dynamic Table called classlist. Creation worked fine however I cant edit it and will have to delete it before do any additional edits.
so uh @formal goblet just got the beta and this hidden attribute and the followig label roll message.
Still hoping someone can help me with my items :/
More details would help. It's very vague.
ok so we have a server on V9, we are trying to move to new server on current version,
the old items are in some .DB file, the new system doesnt seam to want to take this file?
so, we need to move the like, 400 items, armors, weapons and mics from the old systems .DB system, into the new system, somehow.. and this all hurts my head because theres no way to migrate then that i can see, and simply dropping files isnt working.
Can you put them all in a compendium and export that out?
how do i do this? im a a MK1 n00b
MK1?
create a compendium then open it up and drag and drop the items in it. You should be able to then export the compendium.
importing it should be similar
what is a compendium, and how do i make this? i litteraly need guidance, i dont know how any of this works
Go to Compendium Packs in the menu, click Create Compendium, name it, set the document type to item, open up, then drag and drop your items there.
I am really stuggling with the scripts thing. Can you or anyone else explain a little more how i would make something like this? i have minimal coding knowledge
we have a server on V9, we are trying to move to new server on current version
⚠️ Warning: The actual CSB stable version is not foundry V12 ready – only V11. ⚠️
the old items are in some .DB file, the new system doesnt seam to want to take this file?
Foundry stores everything in DB. If you would upgrade your server to a newer version, this would be automatically upgraded too. Copying this DB files from one server to an other is never possible cause the internal links get broken.
If you run in this kind of problems, it sounds like you are trying to set up a fresh new foundry install and just want to copy your games from the old V9?
so we have 1 game running, we are moving to new server and gaining a second...
so we need to move our items onto new server. and foundry isnt using .DB for items at the moment, and i dont knwo why...
Users should never fiddle with the db-file itself (if they don't know exactly what they're doing). As suggested above, copying your Items into a Compendium and moving that seems safer. You can find Compendia in the top right corner as a tab right next to the settings.
But still a small additional warning. V9 to V11 or even V12 is quite a distance between versions, so some things will probably break. It's fixable with effort but it will consume some time.
I suggest to read these articles:
Sure, give me a few more details and I can write it for you. Are you trying to use a label roll message or a macro? And is what you wrote at first exactly what you want it to do?
I want to be able to do it as a label roll message. Basically the system works as follows.
Each skills roll has a bonus based on what stat it falls under along with a variable number of advantages a player can earn.
the bonuses are static numbers that get added to each d100 roll while each advantage grants the roll a D20.
For sake of clarity lets call the bonuses variable X and the number of advantages ADV
Based on the players sheet i want the roll message to be able to input the X value and ADV value based on the character sheet and inquieries when the label is used (both of those aspects ive been able to successfully do. )
Basically the end result is if (1d100+x+ADVd20) => Crit#, dice explodes and rolls the whole thing again
post what you have now
I will when I get home. Thanks for all your help.
Sure. No problem, I will check later for it
I’ve been bsing a solution for now where essentially I turn the dice into a D whatever the total is. If there was a way I could give a dice a minimum result it would probably be as much as I need.
Example of you have 1 advantage and a +3 to the roll it would roll a d123. If I could make the dice have a minimum roll of 3 then statistically it would be the same.
Well, 5, but yea, it would be close-ish statistically. No worries, send it when you can and when I see it, I can write it to work properly in a few minutes tops.
Awesome.
Here is the text in the label itself
The area after Critical: is the one with my current solution
2 things I see there, which are not directly related to your issue:
nameis a reserved key, which can be used. Maybe you want to use that instead ofName_Enter.- You have opening but not closing HTML-tags. It will be rendered correctly by the browser, because it can fix it itself, but you shouldn't rely on that:
<p>That's how you shouldn't do
<p>That's how you should do</p>
Thanks!
Good evening everyone, I have some questions but first I would like to know if there is any way to search here, so as not to ask a question that has already been answered.
Where are these sorting options found within the item container configuration?
This is probably very simple, but I'm trying to make a dropdown list that a rollable macro would reference, which has all of the attributes on the character sheet. The idea is a player would select an attribute from the dropdown, and the macro would roll using that attribute as the modifier. How might I do this?
It looks good unless I am misreading something except you just need to change this [1d(100+:X:+(:EX_Advantages:*20))x>=(:CN:)] to get it to reroll the same dice as the first time, right?
I actually have an answer to this! It’s little time consuming, but you ran reference your label and perform an “equals text” function. In example I use a lot of is
Firstly let’s say the dropdown has the key STS for “Stats” and you have the 3 stats Strength,defense, speed.
You can either give each an applicable key (str,def,spd) or if this is the only time this will be referenced you can just number them 1,2,3.
Say you want to roll a check which is d20+the stats modifier.
1d20+MOD
//if giving each a key
${#MOD:= equal text(‘key’,’str’), str mod : equal text(‘key’,’def’), str mod : equal text(‘key’,’spd’), spd mod : }$
That’s not a very good explanation but hopefully it puts you down the right track. I’ll send my actual code example later.
If you do the numbered variant it’s a little bit easier of just
${sts=1? Str mod : sts=2? Def mod : sts=3? Spd mod : 0}$
Pretty much yeah that’s the only problem.
Like rather than adding those dice into 1 mega dice thing it needs to do 1d100+ADVd20+X and explode that whole thing.
Yea, man, that's really all you need to do ${[1d100] + [:ADV:d20] + X}$, you don't even need any scripting. Just switch that in, if the D20 resolves to zero, it just doesn't roll anything.
I swear I’ve tried that.
I don't know what the >=(:CN:) is supposed to be doing here though
It’s part of the system. Based on your stats and such you have a critical score. If all those dice and mods are to equal at or above your “critical number” you take all the dice, roll them again, and add that result to the first roll. Etc until you stop rolling at or above.
ahh, you want it to repeat indefinitely?
ok, that I wasn't understanding, this would only explode once.
Precisely.
Give me a moment.
Cool take your time.
Did you check through the dice coding to see if there was a built-in mechanic for re-exploding?
The mechanic I have currently works to continue exploding. It just only likes to do 1 dice.
Hence the d123 and such.
So, this would be a little more involved because apparently CSB doesn't like named functions in %{}% (unless I am doing something silly)... You would have to call a macro to fire and I am guessing x>= is a built-in exploding mechanic (probably in foundry) which is why you have a 1dice limit (just a guess though). I can write you up a macro call for a function that checks it's own result and repeats itself later tonight, but I am out of time at the moment.
If you can that would be amazing. My current fix is fine for now and I have freinds that do a lot of this stuff. I just wanted to see if it was something staring me in the face or not.
Thanks for all your help.
Couldn't you write some if statements to achieve this?
Sum of dice = x ? Do this : do that
yes but it would require me to set up like 10 in a row making new variables for each explosion and although i could do that and it would never be reasonable for it not to be enough, it also just wouldn't be super accurate.
By any chance is it possible to delay all instances of template reloads upon any changes to the character? there are cases where multiple changes happen rapidly in a row (i.e: macro that replaces up to four statuses at once meaning the template has to reload eight times in a row, four times to add new status and four times to remove statuses, causing the game to lag for 10s straight for everything to load)
OK I have question if its possible or if its not its great idea for feature. I have tried all npc generators and they suck ass.
Is there posibility in CSB to on ading to map make actor calculate fields (like roll for name from table, roll for stats.
In same way there is value on roll make a value on create actor.
make the value be made on adding to map. integrated npc generation
example in place
number field in place of default value write &{20+d10}&
text value like @UUID[RollTable.CtD6VzSGjiN5FGtk]{NAMES}+' '+@UUID[RollTable.CtD6VzSGjiN5FGtk]{SURENAME}
and so on.
activated if there conected actor is disabled in token settings
Any plans to port this to V12?
They have an unstable version that seems to be working on v12 so far. I'm curious when it will launch though.
On a somewhat related note, would anyone here be willing/interested to help/make a pretty simple system with/for me?
I'd gladly sit and learn asking and have this as now if a tutoring session to make it. But, I'm also not opposed to just commissioning someone to make it for me lol.
Basically what he said, my cute little Senko-san
Any idea when the stable release will drop? I'm currently planning to make the system myself unless someone is willing to help/take it as a commission, but I am currently on v12, and the unstable is the only one that works, and the notes say not to expect anything to copy over for the official v12 update, so I don't feel like spending all that time for no reason, you know?
Just trying to find out how long I should wait for v12, or if I should just get an older v11 version instead.
Wait a sec, migrating from V11 to V12 will be possible of course. So developing for V11 and then shipping to V12 as soon as it is ready should be fine
And well, estimations are rather hard. Depends on how many bugs we'll find and how hard they'll be to fix. And of course how much time we'll have
I for myself won't have time for 3 weeks (vacation), so Linked is basically alone for the next time
Gotcha. I do 99% of my foundry stuff on a hosted server that's v12 already. I installed a computer hosted v11 just to test the csb a bit before the v12 unstable was released. But, I guess I can just do it on that testing server and then copy it all over later when v12 is official.
I just wasn't planning to do it that way, but I can yeah.
Still struggling overall with figuring out what I need to do to get the functionality I need.
The better you explain here what you desire, the better is usually the answer. So knowing what you want helps a lot. There are many cases where users don't really know what they actually want 😅
Oh god, what have I done
Just didn't want to drop it here because it seemed a bit rude, but yeah. All good lol.
I am pretty confident in my ability to adapt existing things to work for my use-case, but the example module didn't work with the v12 one of course, so I was doing it all from scratch and just was waffling about.
Shouldn't that work? I mean that is the first thing I've imported into a V12 world and it seemed to work
Although...
The module itself doesn't appear in the founder browser for modules because it's not compatible with v12 officially, so it doesn't show up.
Yeah, I had to replace all occurances of fetchFromDynamicTable() with lookup(), I give you that point
AHHH
Yeah, I changed the module.json 😂
I can manually download it maybe and import it that way, but I haven't had the chance to try it
So yeah, I think realistically my best bet would be doing it on my v11 server and just later on improving the entire world into my v12 when it's available for the update.
But, I do about 90% of my foundry set up and prep work and stuff while at work in my downtime, but I only have access to my v12 server while there. So my v11 access is more limited lol. Just the oddness of my situation I guess.
I mean developing on V12 should also be fine, if it's new anyway...
Well, I would have to do it in the unstable release. So, wouldn't that cause issues when transferring to the full update?
That's what it says in the read me anyway
Not really
It is only an issue if you want to downgrade a version (e.g. from 4.0.0 unstable to 3.2.5 stable)
Is there posibility to roll field number on drop token? i dont like name stat generators. It would be cool to make
like label or other field ${@UUID[RollTable.CtD6VzSGjiN5FGtk]{NAMES}+' '+@UUID[RollTable.CtD6VzSGjiN5FGtk]{SURENAME}}$
or like 2d10+20 so to make generative tokens directly in CSB Is there way to achive it?
Uhm, do you mean, that stats are generated whenever a new Token is created?
Gotcha! Could you help me get the changes you mentioned here #1037072885044477962 message so I can get that going as well?
You'd need to change the maximum compatible version to 12 in the module.json
Gotcha, what about this?
Is that needed?
yup. (if the actor data in token is turned of). so there would be awesome to have generate stats, names proficiencies anything could be roled and fully agnostic. for names it would reference native roll tables for example)
You should change the Formulas in the Sheet to use lookup() instead of fetchFromDynamicTable(). You could import the Adventure from the Compendium, export all Templates, replace all occurances of fetchFromDynamicTable with lookup and import that back.
Gotcha, I'll give it a shot. Thank you!
That's something we probably won't do. If think that should be done by a module. You'd need a World Script, which listens to onTokenCreate-Hooks anyway
Too much work for too little gain, there are more important features that are pending
tried all modules and they eighder for dnd or they suck. sure i understand. WOuld there be posibility to comition of adding such feature?
Well, the project is open source, so everybody can add something to the system
But I think a module would fit better, because the functionality is system-independent.
for now all i found was for dnd only, so if i understand i would need to target all fields i want to randomised by hand?
Yeah of course. How should somebody know what you want to randomize without picking the fields?
I m not a programer so if im not sure i ask questions. as always its proved succesfull if not maybe little anoying to the one asked.:]
Don't worry too much, we're trained for all kinds of users 😂
Sorry this took me a bit, ended up being a little trickier in one spot and had some other stuff going on. The console.log and array is there so you can see the rolls individually with an F12 if you need to as I am not familiar enough to figure out how to get those to show up in the white box in the chat. In the for loop, the '10' is the maximum number of explosions. Should show all the visual dice when you roll it. Anything else, let me know.
${#?{EX_Advantages[number]}}$
${#R:=[1d100]}$
${#RT:= RTR? 0 : 1}$
${#X:= (RT*sameRow('ADV',0))+EX_Advantages}$
${#Mod:= sameRow('SKL_R',0) + sameRow('SKL_BNS',0)}$
${#CN:= sameRow('CR',0)}$
${!Name_Enter}$ performed a
${!sameRow('SKL_N',0)}$ Check <p>
Result: ${RES:=R+[:X:+:EX_Advantages:D20]}$ <p>
Critical: ${CRT:= R == 1 ? "Critical Fail" :
%{let cont = ${RES}$
let arr1 = []
let result = 0;
for (var i = 0; i < 10; i++) {
if(cont >= ${CN}$) {
const eRoll = await new Roll("1d100 + ${X}$ + ${EX_Advantages}$d20").roll();
arr = arr1.push(eRoll.total)
result = result + eRoll.total;
cont = eRoll.total;}
if(cont <= ${CN}$) break;
}
console.log(arr1);
return result}%
}$ <p>
Total: ${RES + Mod + (equalText('CRT','Critical Fail') ? 0 : CRT)}$```
Also, FYI, MOD isn't on the chat message here, so it looks like the total is off when you add the numbers.
I think that will work wonderfully thank you so much!
so i tried to tweak and update this formula, but for some reason i can't get a roll for a damn.
${roll_formula:= standcheckbox ? concat('+', switchCase(durabilitydropdown, 'DurabilitySRank', '4d6', 'DurabilityARank', '3d6', 'DurabilityBRank', '3d6k2', 'DurabilityCRank', '2d6', 'DurabilityDRank', '2d6k1', 'DurabilityERank', '1d6')):'0'}$ ${[:brawnsmod:d6+:roll_formula:]}$
just ${[:brawnsmod:d6]}$ was able to work but anything involving the roll formula makes it so i can press the button five billion times and i get no response.
@formal goblet
Show me the error message in the console
caught me off guard there, got my foundry down.
here
on the left is the formular in question, the right is the error message i got
the error is Formula.js:665 Uncaught (in promise) Error: Uncomputable token "durabilitydropdown" at mathInstance.SymbolNode.onUndefinedSymbol (Formula.js:665:27) at math.js:26377:89 at math.js:26529:60 at Array.map (<anonymous>) at math.js:26528:55 at math.js:26523:66 at math.js:24865:43 at Object.evaluate (math.js:24162:45) at r.evaluate (math.js:24139:55) at Formula.computeStatic (Formula.js:669:27)
okay figured it out, forgot an n
@formal goblet or anyone else know what is causing this error? The annoying thing about it is that it goes away when I refresh the sheet, or adjust any other field.
If it goes away when changing something or refreshing the sheet, then it probably expects a value, which is not loaded yet
Hey, a rollmessage is returning me an error and I cant figure out why. My formular:
${Target_VW == -1 ? 'No target selected' : Result >= Target_VW ? 'Attack would hit' : 'Attack would fail'}$
I checked several times, its always returning me ERROR in a rollmessage. Can somebody tell whats wrong?
All the other parts of the rollmessage work proper. Only this is not working
Show me the error in the console
changing the formula from fetchFromDynamicTable (worked fine in the older 3.0 version) to lookupRef fixed the error. I still don't understand though what lookupRef does. Lookup retrieves values, but lookupRef retrieves a datapath of a field? Can you explain what that means and how it fixed the error. (I'm assuming the old 3.0 fetchFromDT is somehow different than lookup, cuz lookup threw the same error while lookupRef fixed it)
How can i make an item's numerical key only be added to the character sheet's calculations if it is equipped using a checkbox to equip/doff the item?
I want all of those circled at the bottom to only be calculated in the column above when the equipped box is checked
currently, the box does nothing except turn from green to red
i'm sure there's some conditional thing i have to add to the formula, but i'm not sure what it would be.
create an item modifier (look for button on the item template), something like ${checkboxKey ? desiredValueKey : 0}$
I'll have to give it a shot later, decided to let my brain rest for a bit. made a hella lot of progress though!
Is there a step needed to make sure an attribute is updated before a script call happens? I'm trying to store a user input via a hidden number field (couldn't get hidden attribute to store the number properly) - doing it during the dice pool per this tutorial: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
I have the user input on the first label that's clicked, the label with script in the example, righta fter receiving the user input it sets the number input field to that value which updates. But then when it gets to the "label with the label roll message" block, it doesn't seem like the number field has updated. It will do the roll with the "old"/last value in the number field, then my next roll will be the correct value. So to me that seems like an order of operations thing, but i dont get why the one being clicked wouldnt be resolved before the one that is then called? Is there a step I might be missing to make sure that happens in order?
Hi all, I am experiencing the following issue: I am using a user-input-item to modify a roll. The user input has two different sets of radio buttons in it. with each set I define one of them as "checked by default". Works as intended the first time I have a character roll this. But any time after that, the second set of radio buttons seems to loose the "checked by default" which is producing an ERROR message in the chat if you don't notice this and check one radio button manually. Is this a known issue or did I find something new :-D. (Or, more probable, did produce a stupid mistake...?)
Can you show the setup of the Radio Buttons and the setup of the calling Template (if you have shared keys between Actor Template and User Input Template)
The Chat Message is created after the whole phrase was executed. And because a Script call is part of a phrase, the Script finishes first
This is the general layout
And about the update: setPropertyInEntity() will queue the updates and execute them in a batch right before the phrase finishes (after the last formula)
This is the radio-button that "forgets" it is pre-checked
Schick
And this is the roll message that is calling the user-input
Danke 🙂
What's the error message in the console?
Press F12, the error message in there is more useful for debugging
have to be afk for 1/2 hour but will do so right afterwards.
Good morning everyone, I'm using dynamic tables to make attack and damage rolls and so far everything is working perfectly. What I would like to do is that along with the ranged attack roll the ammunition is already reduced from the total amount. Does anyone have any idea how I can do this?
You can use a combination of sameRowRef() and setPropertyInEntity() to do that
Thank you very much, I will try as soon as possible!
Sorry for the delay. Back now. I am not 100% sure if this is what you meant by the error message?
Apart from that no Error message was created (or at least I could not find any).
Error messages are in red, you should see some if you create a chat message with errors
Would this go on the item as a toggle button, then I add that formula to the math for each item, or what's the correct method?
And, if that is the correct method, is there a way to do it so that it still shows the correct values in the table but just doesn't report them to the final result unless it's equipped? That way players can easily see what the items give them without having to equip them and unequip them if it's not the one they want.
They look like this, right? If so, no error message is created when I roll, just the messages I posted before are new.
Yep, that would be an error
Ok, then definitely no error message is produced. I can watch it "live" while rolling.
Which versions (CSB, Foundry) are you using?
These
Heh, all fine
You create a checkbox in the Item which indicates the equipped state and use a Formula in the Item Modifier, which checks for that state
Don't know if this helps but here is a screenshot when I roll for a 2nd (3rd, 4th,...) time. The button marked in red should be preselected but is not. If I select it manually, all works as intended. I already deleted the whole table and built it new but with the same effect.
Do you have the key aStat_Mod in the actor template?
You can send me the user input template and I'll have a look at it later
As a json-Export?
will do later, Thanks a lot in advance for you great and quick help!
Last addition on topic: It might have something to do with the character sheet and not the userinput: If I change something on the sheet-template and reload the character sheet, the radio button is preselected again. Roll a 2nd (and so on) time and it is not selected any more.
Hey guys!
Cam some one help me with item container lookup?
I have this item container named as invent, in this item container, one of the colums are peso_peso.
in the last line I created a label with the formula ${lookup('invent', 'peso_peso')}$ where I want to take the values of all the item container peso_peso colum. (peso_peso is the weight of my items, I want to put in the label the sum of all my weight)
When I try to see this value in my character sheet, its just an error.
Can some one help me?
Not 100% sure but try ${sum(lookup('invent', 'peso_peso'))}$
Didn't work T.T
What is the type of peso_peso? label? number field?
peso_peso is a colum of the item container 'invent'.
When I try to modify it, it is set automaticaly as a label,
Inside it I have an operation ${(item.Quantitem) * (item.Pesoitem)}$, that multiply the amount of an item by his weight. It is working well as you can see in the second image in the colum "peso"
To my knowledge the item container is purely a display. So what is type is peso_peso in the item template itself?
I have a problem i have in character sheet. item list with have columns that see certain values of items and present them with case values. So for example the higher the number its starts from new, than abused, need repair, destroyed. For some reason if i edit any value within item all those cases gets wild, and show vaue for "else" even if inside is stil corect number. anly if i edit them from outside with other on rolls those valuess ttay correct"
in my item template I have 2 values "quantidade' = amount of the item. "peso" = the weight of the item.
In this first image you can see I have 2 agua, and each agua weght 1.
in the second image, you can see, inside peso_peso I have the formula
${(item.Quantitem) * (item.Pesoitem)}$
where item.quantitem is a refrence to the component key of the amount of my item and item.pesoitem is a refrence to the weight of my item.
In the third image you can see my character sheet where the colum "peso" shows the result of the formula inside "peso_peso".
2 agua * 1 (weight of agua) = 2
hmmm is there a better way to pass user input from the first to the second label then? cause I think that would mean the second has already grabbed the value before the property changes
good question, but yesterday I was tryng to solve this question and I open the papers of CSB an search the exemple of lookup they used.
I've copy the code, the component key name, etc, and it still don't work
First image is the example gave on the CSB papaers.
Second image is the test with the exact same values
Which CSB-Version are you using?
3.0
Then you should consult the docs about 3.0.0 and not 3.2.5 😅
lookup() got released later
It worked! Thanks! Hahahaha
And sorry, I'm 1 newbie yet
I'm pretty new to CSB, and I'm making an attack roll button for a Fire Emblem system by modifying an example from the FAQ. Is there a way to combine these dialogs for Hit Bonus, Crit Bonus, and Atk Bonus into a single window? And furthermore, is there a means of adding checkboxes to that dialog window that apply common bonuses? (Ex: A set of two checkboxes that apply either +2 or -2 to Hit and Atk, which happens fairly often.)
<table> <tr> <th>Attack Roll</th> </tr> <tr> <td>Hit-Bonus?</td> <td>${?{Hit_Bonus|0}}$</td> </tr> <tr> <td>Crit-Bonus?</td> <td>${?{Crit_Bonus|0}}$</td> </tr> <tr> <td>Atk-Bonus?</td> <td>${?{Atk_Bonus|0}}$</td> </tr> <tr> <td><strong>Hit Total</strong></td> <td><strong>${Roll:=[1d20] + hit + Hit_Bonus}$</strong></td> </tr> <tr> <td><strong>Crit Total</strong></td> <td><strong>${Roll:=[1d20] + crit + Crit_Bonus}$</strong></td> </tr> <tr> <td><strong>Ph. Atk Total</strong></td> <td><strong>${atk + Atk_Bonus}$</strong></td> </tr> <tr> <td><strong>Mg. Atk Total</strong></td> <td><strong>${mg_atk + Atk_Bonus}$</strong></td> </tr> </table>
This example has all in a single window:
${#concat(
?{name:"Character name"[text]|"Your name"},
string(?{age[number]}),
string(?{gender:"Character gender"[check]|"m","Male"|"f","Female"|"o","Other, or I don't want to say"}),
string(?{month:'What month are you born ?'|"January"|"February"|"March"|"April"|"May"|"June"|"July"|"August"|"September"|"October"|"November"|"December"}),
?{happy:"Are you happy ?"[check]}
)}$
How can I make it so that I roll a 1d6+ModifierKey and if the result is higher than "6", it turns into "6"?
So, for example, 1d6+Str with a Str Mod of +3 so if the dice rolls a 4, 5 or 6, which would result in 7, 8 or 9 respectively, it would output as "6" instead?
${PlayerRoll:=[1d6+:Total_Combat_Strength:+:Total_Combat_Roll_Mod:]+?{Player_Modifier[number]|0}}$
That's what I have currently, and I have no idea how to make it work.
Specifically, I need the 1d6 to be added to the Total_Combat_Strength, then it needs to check if it is above "6" and if it is, result in "6" first, THEN add the Total_Combat_Roll_Mod and the Player_Modifier.
.
Also also, is it possible to make it so that an item made using the system can be turned directly into a card?
I'm adapting a card-based deck-builder into an online system, but the core gameplay mechanics still rely on the items and whatnot to be in "Decks" to distribute them randomly and whatnot, so I still want to follow that same format. I was wanting to make all the items as items using the templates, then upload images of the actual physical cards and apply those to a deck in foundry, then I want to make it so that the players can draw a card, have that card in their hand, and then drag that card to their character sheet to "Equip" the item that the card shows visually (and ideally hide all the raw item character sheet from the player side of things).
I'm currently working on just getting the character sheet to function how I want it to, but long-term goals would be to make the entire character sheet effectively function as a statblock at the top for your tracked resources, then a set of "spaces" that cards can be placed onto (since most item types you can only have one of), and then the rest of your items go into your hand to be sold, traded, or used later.
That's DEFINITELY a really late-term/never-gonna-happen goal, especially since the more I work on the character sheet, the more I'm thoroughly enjoying how it's turning out, but I still definitely want to get the items applied to cards, and keep the deck mechanics, as that's literally the most important, core mechanic of the game.
min(result, 6)
Nope, Items are simply not cards (and CSB has no implemented functionality for cards)
How would the best way to implement a randomly generated item being added to a player then? Maybe a custom roll table?
Script
I have a problem i have in character sheet. item list with have columns that see certain values of items and present them with case values. So for example the higher the number its starts from new, than abused, need repair, destroyed. For some reason if i edit any value within item all those cases gets wild, and show vaue for "else" even if inside is stil corect number. anly if i edit them from outside with other on rolls those valuess ttay correct"
Custom System Builder | Value expected (char 53) SyntaxError: Value expected (char 53)
<table> <tr> <th>Combat Roll</th> </tr> <tr> <td>Player's Combat Roll</td> <td>${PlayerRoll:=min([1d6+:Total_Combat_Roll_Mod:],6)+?{Player_Modifier[number]|0}}$</td> </tr> <tr> <td>Enemy's Combat Roll</td> <td>${EnemyRoll:=[1d6]}$</td> </tr> </table>
That seems to work no problem.
<table> <tr> <th>Combat Roll</th> </tr> <tr> <td>Player's Combat Roll</td> <td>${PlayerRoll:=min([1d6+:Total_Combat_Roll_Mod:],6)+:Total_Combat_Strength:}$</td> </tr> <tr> <td>Enemy's Combat Roll</td> <td>${EnemyRoll:=[1d6]}$</td> </tr> </table>
But that doesn't work. Any idea why?
The only difference is the substitution of the player modifier prompt for the static bonus that i'm using. I know that Key is correct, as I can place it in the location that the "Roll_Mod" is in and it functions, but when added there, it doesn't. Also, I can replace it with a simple "5" for example and it works fine.
I need the formula in the error message. You can find that at the bottom of the error message
Not sure but i did notice an additional "?" in the code after ,6)+ in the first one that is missing in the second one - is that important?
I'm having a bit of an issue with my CSS selectors if anyone can help me?
I am trying to get "total" column of the table to be emphasized (bolded font, border around the column, etc)
Yet any attempt to use the custom class doesn't appear to be working and the wiki is lacking on formating for the css within CSB.
How do I input it into the advanced config? Currently I am using "custom-total" without the quotes.
calling .custom-total in the css does not work.
I've tried all sorts of variations from ".custom-total" "custom-total," ".custom-total," etc
Calling the table's key works for the entire table - though borders still dont work for some reason.
To my knowledge, the "?" is required for the player-filled modifier prompt, but for static modifiers it shouldn't be necessary.
Update:
.At_Table tr td:nth-child(5)
works for the entire column, though it's not an idea solution, and also includes the header.
is there a better way I can do this without including the header?
Is there a way to apply styling modifiers to a roll card based on a variable?
the ExampleTemplate has
<strong>${!Roll >= Crit ? '<br>Critical Success' : Roll <= Fumble ? '<br>Fumble' : ''}$</strong>
with a line break in it, but the styling is outside,
I'd like to get it so if a player uses a paragon point (changing the roll from 2d6 to 3d6kh2, hence the 3/2), the color changes. I can get the whole color to change, but it breaks once I put it inside the formula
${!paragonuse = 3 ? '<p style="color:MediumSeaGreen;">Roll</p>' : paragonuse = 2 ? 'Roll'}$
is what I've got and I usually just get "ERROR" w/o color and a "non-whitespace character at position 19 (or whatever it was)" in the console
= is assignment, == is comparison
Oooh, lol. Good catch
Doesn't fix my problem, but proper syntax is always important 😅
Copy and paste the formula from the error message in the console. You can't be closer to the truth than there
:
"paragonuse == 3 ? '<p style=\"color:MediumSeaGreen;\">Roll</p>' : 'Roll'"
dropped the second comparator cause it seemed unnecessary, but the styling DOES work outside the formula... Just not within. Hmm
<br> works inside a formula, but not a styling
Ahh... may have found it, thanks for the console suggestion
I think it does not like the " around the color parameter. I know Foundry/CSB is very finnicky with it's ' and "
the \ in the console clued me in,
working formule:
<td>${!paragonuse == 3 ? '<strong><p style=color:MediumSeaGreen;>Roll</p></strong>' : 'Roll'}$</td>
Bump
Rookie question, but how can I make a formula for a meter's maximum value (HP) that can be modified by items (Race, Class, Magic Items)
You'll need a Label, that represents the max-hp. This will be your target for modifiers
Move your user input to a separate line and use the key of the user input in the formula instead
I'm not 100% sure, but it might be that user input tokens are replaced with empty strings after evaluation.
Hi everyone! Does anybody here use the Item Piles module? If so, do you know of any documentation on combining CSB with Item Piles? I'm struggling with getting it to work properly
Can I add items to an actor using a roll message? I assume with JS? And remove in the same sense?
Want to have a cleaner character setup with dropdowns and radial buttons, but still use items and item modifiers for classes, races etc so it’s not all stored in the character sheet
Yep, you'll need a Script for that
Object { formula: "Target_VW == -1 ? 'No target selected' : Result >= Target_VW ? 'Attack would hit' : 'Attack would fail'", props: {…} } formula: "Target_VW == -1 ? 'No target selected' : Result >= Target_VW ? 'Attack would hit' : 'Attack would fail'"
Hello there, is there any way for players to add an Item to an Item Container by themselves?
I believe if you give them ownership over the item or the folder containing the items, they should be able to drag them onto themselves. And if the item container is then set up to show that type of item, it should show up in the container.
Is there a way to apply certain changes to an actor (or maybe create a new actor from one existing actor) based on some form of "template"?
For example, I have a "Zombie" template, that I would like to apply to my Goblin Actor, my Human Warrior Actor, my owlbear actor etc. to create zombified versions of them. Since the Zombie template has specific rules on how to create a Zombie from a pre-existing creature, I'd like there to be an automated way of doing this.
Same thing would be interesting for items btw. for stuff like enchanted weapons
My guess would be to create a template creature, and then in a macro take the source creature and the template, create a new actor as a copy and set everything from the template creature in there? Or maybe develop the template itself into a macro?
Yep, just tested it myself. Note that you need to set the ownership of every single subfolder.
I think you got my issue backwards. The one with the user input works fine, the one where I remove the user input entirely and just use a static key is the one that's not working.
Does this work if the player is an observer instead of owner?
Ty 🙏🏻 can you help with where I should start? Is it some scripting that’s part of foundry for attaching items to an actor?
Does anyone know where I'm able to find these sorting options for item containers? I'd like to be able to move items "up and down" in the container, but I'm not seeing these options in the component editor.
For example, the "new item container" dialog in the documentation doesn't seem to have a location where sort-options are set.
> This one is your issue. Edit the formula without the Rich Text Editor and you should be fine
Yeah, that's core Foundry
Wrong CSB-Version. Sorting and Filtering came with 3.1.0 I think
Cache issues, I think. Looks like it's there now! Thanks for the heads-up.
yesterday i switched some fields of the sheet i'm working on from manual number field to lookup fields since item container fields can now be used as reference and it worked flawlessly... at first glance
turns out that, unless i fully reload the sheet each time, the total that consists of the sum of all fields (in the case of the system, 10 + dex modifier + armor + shield) does not automatically update when either a shield or armor is dragged into the sheet. Does anyone know a way to solve this?
to clarify: armor and shield does pull the intended field in the lookup formula( in this case, the armor class they provide), but the total remain static until i reload the sheet which isn't practical
Nope, known bug, where the source of the problem is unknown
Thank you very much for your help, unfortunately I am completely incompetent in programming logic, I made a few attempts but nothing came of it.
I am currently having a bit of an issue with the below formula.
${#setPropertyInEntity('self', 'SkillUses', "SkillUses+ 1")}$
It works fine, but, processing it takes 2-4 seconds which is a noticeable and fairly annoying delay. It is within an item setup as a "skill" that is attached to the actors. When used it appears to go through everything in the actor and every single item attached to it to check what it should be manipulating, resulting in about 32,000 checks being done. Console log attached but its not complaining about anything, its just going "yup that's fine" a lot.
All it needs to do is add 1 to the field which is being used to count of the skill it is in, is there a more efficient way of achieving this within an item?
This mass check is also done when adding an item to an actor, which is also annoying but i'm guessing that's just foundry and there's not a whole lot that can be done.
I can concur, changes to an item on an actor seem to directly affect every single item the actor has
I tried this in a desperate way to see if it would do anything.
<h2><b>Rolagem de Ataque à Distância:</h2>
<p>Acerto de ${sameRow('nome_armasdistancia', 0)}$</p>
<hr>
<p>Rolando ${var:=sameRow('armadistanciaatk_rolll', 0)}$ + Ajuste de Ataque ${var=sameRow('ajuste_armadistancia', 0)}$</p>
<hr>
<p>Resultado: ${[:var:] + sameRow('ajuste_armadistancia', 0)}$ <i>Dado(s) de ataque + Ajuste </b></i></p>
${setPropertyInEntity('tabela_armasdistancia', 'micacao', sameRow('micacao', 0) - 1)}$
tested different things but it seems that if you just refer to the** formula** (example: ${lookup('shld', 'armbon')}$) it works as intended, not if you refer to the result of that formula
CSB recalculates everything when a value changes. So it can take a while depending on the amount of fields in a sheet.
Changing 1 field can seem simple, but you have to think about dependencies. Other fields should maybe also change because they depend on this value. And then you get into the issue on how to detect dependencies.
You're missing sameRowRef(). And no, it's not the same as sameRow().
Well when I remove the richtext the roll message dont work at all, when I add it back it works but the error remains -.-
I guess I found out why
Nope...
<tr> <td><strong>Ergebnis</strong></td> <td><strong>${Result:= Roll + Skill + Weapon_Bonus + Modifiers + Dice_Modifier}$<br> ${Target_VW == -1 ? 'No target selected' : Result >= Target_VW ? 'Attack would hit' : 'Attack would fail'}$ </strong></td> </tr>
This doesnt work.
<tr> <td><strong>Ergebnis</strong></td> <td><strong>${Result:= Roll + Skill + Weapon_Bonus + Modifiers + Dice_Modifier}$<br>${Target_VW == -1 ? 'No target selected' : Result >= Target_VW ? 'Attack would hit' : 'Attack would fail'}$ </strong></td> </tr>
This works kinda fine execpt for the error.
It definitly belongs to this very last part of the formular. Any idea whats wrong here?
It seems like there is a problem with my value Target_VW as soon as I replace it with Target_Defense it works. But I dont know why.
I found out why.
If I'm bothering you, please let me know.
Now there's just one detail missing, using ${set Property Entity('self', 'tabela_armas distância.0.projetil', -1)}$ is changing the value to -1 instead of subtracting 1
You're not, but I'm basically on vacation, so my availability is pretty limited.
The 3rd operator simply sets the value, it's not a relative modification. So you have to grab the current value and subtract from that
I've updated to Foundry 12 and the CBS beta. Everything seems to be working fine, except for the DICE-SO-NICE module. When I make a roll from the character sheet, no dice are showing up. The result appears in the chat, but I can't see any dice rolling.
Hi! wasnt there a shortcut to copy field whole id structure? on click
Anyone know why I get issues with props not computed?
{uncomputedProps: {…}, scope: {…}}
scope
:
{nonlethal: '15', additional_HP_MAX: '0', isSlow: false, isDazed: false, isWeak: false, …}
uncomputedProps
:
Magic_Table.0.DC
:
{formula: '${spellDC + sameRow(dcMod)}$', options: {…}}
[[Prototype]]
:
Object
[[Prototype]]
:
Object```
I am computing the entire value of spellDC elsewhere and referencing to that that + a modifier in this section
it works if I remove the sameRow and add a numeric value
also is ref easier on the compute than calling the actual key?
Someone that uses 'Custom System Builder' have any idea how to get a value inside a dynamic table and roll it inside a label ? let me illustrate.
I am trying to migrate my system from roll20, and there my players could write their macros inside their abilities tab, that made me lose less time micromanaging this kind of stuff
I am trying to do "The same thing" here. but i don't understand how...
Set it up as a rollable label
This is the basic layout for a script %{}% to automatically add items to actors %{actor.createEmbeddedDocuments('Item', [game.items.getName('${Race}$').toObject(), game.items.getName('${Class}$').toObject()])}% Replace the ${}$ with the items you want, more comma separated for additional items, no [] or comma after toObject() if only 1 item. Wrap it in an if() {goes here} if you have conditions for it being added or not.
I dont have a component type named rollable label, only Label, is it a option inside a regular label ?
all labels are rollable. You just need to reference it properly. Have a text field, and call the key from the roll label. Players can edit the text field. Syntax may be an issue
It would be something like ${[${textFieldKey]}$
that you would put in the label in the label roll section.
Your missing some pieces but I am not in from of my pc to grab them.
Are you trying to call a macro? or just use a text field like in the picture?
I am trying to roll what the people wrote in the textfield as a macro
for exemple, if someone wrote [[2d20+2]] when they click the lable it should Say ( Rolled 15 )
It's not a macro, wrong terminology for Foundry/CSB. is the text field in a dynamic table or just a random textfield you created for that specific 'simplesmagic'?
Example
<tr>
<th>Combat Roll</th>
</tr>
<tr>
<td>Player's Combat Roll</td>
<td>${PlayerRoll:=min([1d6+:Total_Combat_Roll_Mod:],6)+?{Player_Modifier[number]|0}}$</td>
</tr>
<tr>
<td>Enemy's Combat Roll</td>
<td>${EnemyRoll:=[1d6]}$</td>
</tr>
</table>`
Pick that apart, found that above so would need to test it but
Macro is a textfield
Roll is a label
I want people to write their own rolls inside Macro so that when they click Roll it is sent to chat
Should be doable but may require some tinkering to get to work
Yea, Put this ${[${Macro}$]}$ in the Roll area, just tested it.
Basicly passing values to the script
You can surround that with any styling you want to get it to display in chat how you would like, but that will pass the value
yes, if 'simplemagic_macro' is the key of the Text Field.
Correct
Did not work, i belive there must be some kind of indexing inside a Dynamic table.
Well, that is why I asked.
Is it from a dynamic table?
it is
Ok call it using lookup(table,value) yadada
If it is in a dynamic table, you need to use a lookup. Should be ${[${lookup(tableKey, columnKey)}$]}$.
You might want to read this first before trying out the stuff you want to do:
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
Issue I see you having is the macro needa to have values pass into it. I use it all the time in rolling formula that reference different elements based on stats.
That would be fine if the text area would contain only a roll formula. If not, it will not work
Seemingly what he wanted.
I am reading as i am encountering problems... it would be great if i could have a youtube/tutorial too 😊 👍
You're fine. Lots of syntax to learn. That page Martin linked is amazing once you get going though.
Yeah it is..
Maybe i got to ambitious... i need to step down and reevaluate this character sheet...
If it's literally just that, then it's way easier:
${#roll_formula:= sameRow(...)}$
${[:roll_formula:]}$
Once I get home @civic furnace I can help more but on a phone I am limited
Make a mess. I have deleted about 90% of the original stuff I created on my sheets.
While youe here does anyone know why props don't calculate
Thank you ❤️ is it similar for deleting them? Say I press a button so it deletes the existing class 'item' and adds the newly selecte done
On the sheet? Not updating? Is a mystery at the moment.
Hahaha my sheet is on its 4th or 5th full recreate
I can pass recalculate in and it works but it's just strange
Its inside a Dynamic table, so maybe it needs to index the row in order to access the macro... i will look inside the documentation more to see what i can dig out.
deleteEmbeddedDocuments instead of create. Add whatever js logic for checks. I have mine set up as templates for race/class and then I filter for the template to see if one exists using .length.
That's what sameRow() does if you want to reference data in columns in the same row
did not work...
Yea, once I really understood items I ended up deleting so much off my sheet and now most of the workload is done in a separate module instead of calculating a massive sheet like I had at first.
is my structure wrong ?
Remove [[]] in the text field. Not needed
Still not working 🥲
Press F12 and check for errors
gger.js:33 Custom System Builder | Value expected (char 9) SyntaxError: Value expected (char 9) (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 {formula: ' sameRow(...)', props: {…}}
_logToConsole @ Logger.js:33
error @ Logger.js:37
computeStatic @ Formula.js:676
compute @ Formula.js:363
processFormulas @ ComputablePhrase.js:106
await in processFormulas (async)
compute @ ComputablePhrase.js:160
(anonymous) @ Label.js:586
(anonymous) @ Label.js:175
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:2
foundry.js:12750 Uncaught (in promise) Error: Unresolved StringTerm ERROR requested for evaluation
at StringTerm.evaluate (foundry.js:12750:11)
at Roll._evaluate (foundry.js:10286:42)
at Roll.evaluate (foundry.js:10250:25)
at Formula.evaluateRoll (Formula.js:742:24)
at async Formula.compute (Formula.js:349:30)
at async processFormulas (ComputablePhrase.js:106:21)
at async ComputablePhrase.compute (ComputablePhrase.js:160:34)
at async Label.js:586:13
e
If you can code a bit, (I can't, literally learning just for this), then you can have items do all sorts of things. I have auras and concentration effects set up to automatically fire in range. But I am automating my whole system, so it is a lot.
You have to fill in sameRow(). ... was just a placeholder. In this case, it expects a string for the column key
Ops... sorry
a string for the column key... would that be my Dynamic Table key ?
Nope, you already have the context of the Dynamic Table (because the source formula already resides in the Dynamic Table). So, only the column key of the same Dynamic Table
How do i get that ?
What keys did you use in your Dynamic Table? It's literally just them
You can also read through the description of lookup(), if that helps you.
That's just the Dynamic Table. The interesting ones are the Components created within this Table
I mean... they all have their Component keys
but i am still not sure what the sameRow('<colName>') is suppose to be...
The Component Key of your Macro Textfield is simplemagic_macro. So it means, it should look like this: sameRow('simplemagic_macro')
i think i found it, i found this :
${sameRow('base_value', 0) + sameRow('bonus_value', 0)}$ => 8
on github
YES !
IT WORKED
thx for the patience Martin, you rock man
🎊
No clue on CSS styles
try typing into the CSS Style file field, " /worlds/cbrpnk/CSBstuff/Visuals/(filename)"
For some reason you need to attach the file name at the end yourself, so "cbrpnk icons" or "style". Also, you've got to type that file path directly into the field (in my limited experience anyway)
Regarding CSS, I wonder if anyone can help me mess with the color scheme etc. of the some of the basic components. I haven't been able to change the text color of dropdowns, number fields, etc from black, which doesn't contrast well with the background colors I want to use. Any tips?
Are you viewing how it’s set currently with the console (F12)?
Someone can help me to set an item as an attack for macro sequencer??
hmmm, i'm not entirely sure how to do that! I can open the console just fine, but I don't really know what to do with it 😅
At the top left of the console there’s a button with a cursor icon that lets you hover over stuff in your sheet to see where they appear in the console, and if you look for the “styles” bit you can see where the colours are set up n stuff, if you change values there you can test how it looks
ok, the elements that I'm looking at are listed as "div.custom-system-component-contents.(the key of the component)"
can I declare ".custom-system-component-contents" and give it styles like I can with ".custom-system-actor"?
Hello, is it possible to create a pop-up window with roll message without creating User Input Templates?
What I am trying to achieve is a Action Confirm window that would show a few lines of text, some formula calculations and then below, like User Inputs usually have, a confirm button.
Something like this, but for this one I used a User Input Template:
I am aware of the Simple Prompt ( ?{...} ), however I couldn't get it to do what I want and seems to always display a Variable and Value, which is not something I need.
I am having some issues and I cant determine why
This should return a string but doesn't with no errors populating
${first(lookup('diceChart','diceSize','dicePos',sameRow('diceSteps')))}$
This should provide me with the string expected
${first(lookup('diceChart','diceSize','dicePos','9'))}$
This is a value that of diceSteps
${sum(first(lookup('diceChart','dicePos','diceSize',sameRow('wDice')))+div)}$
My intend is to create a step down/up chart based on a starting value,
Example, fist start with 1d4, if they have a high str I am increasing that value by x steps as their str increase, Str increase is 4 steps fist start at a 2 so 4+2 = 6, the new value would be 1d12...
Hellppp
Also, anytime I move my text boxes to lables it deletes the visable fields. prior versons didnt do that
I don't see diceSteps and wDice in the table.
And the sum() in the last formula is unnecessary
Either User Input Template or own Script. The regular user inputs in CSB are simple key-value-pairs, where the value-part is always an input field
Hey @formal goblet - Sorry I didnt provide you the requested area
Yep, I have been trying different combos to see why its not seeing anything
wNewDice is what I need to populate with the new value, and its ${first(lookup('diceChart','diceSize','dicePos',sameRow('diceSteps')))}$
I even attempted to look
return Object.values(entity.system.props.weapons)
.filter(row => !row.deleted)
.map(row => row.diceSteps)
}%```
but that is as far as I got with it lol
replacing sameRow('diceSteps') with a numeric value populates correctly ie '9' will populate the needed
Try out the 5th arg with the ==-operator in lookup instead of the default one
sure 1 second
${first(lookup('diceChart','diceSize','dicePos',sameRow('diceSteps'),'=='))}$
Nothing, I am getting some props were not computed, but I cant figure out how to fix thgat
NM I think I got it
Wow, they have you guys buried deep. IS it possible to have an image for a background on the character sheet? Even if just for temporary to use as a template.
If you mean to replace the standard parchment texture/color, you can do that with CSS.
Yep. I totally should have seen that coming. I already know most appearance features are HTML... Can I find where to do that in the documentation? I haven't made it very far into that, guess I got way ahead of myself as usual.
It won't be in the documentation (at least I'm pretty sure it isn't). Hit F12 to open the console, click in the top left where there's a little button with a box and an arrow pointer (top right corner of this screenshot), that will highlight areas of your surface that you can change. When you click where you want, the concole will tell you what section that's in. Looks like so:
Okay. I think I can figure it out from there. Also, let's say I set a whole system up in this. Compendiums, the works. Is there a way to export that to a stand-alone system, or will it always run in CSB?
If you're setting up the system in CSB, it's gonna stay in CSB.
👍 I assumed as much, but thought it was worth asking.
You can export it, so like other people can use it to play, but they will be running CSB
So it will export similar to a world, and CSB will be the system.
I think so? I don't want to say for sure as I've never attempted it myself. Either Martin or someone more knowledgeable than myself can answer
Okay. Thanks for your time.
Anyone got a quick and dirty NPC sheet? Something basic
Hi, is it possible to remove the delay in data registration when i change a stats?
For example: if i set my hp from 20 to 19, it takes 2 seconds to do it
Not that I am aware of
Is there a way for me to add an item from a compendium to an actor via a macro and have it keep the template, parameters, etc.?
Or should I first import the compendium to the world and then have the macro run off the imported copy? I can always blow up the folder and re-import each time I guess if the compendium ever gets modified...
I guess the latter is easy, and it's just as easy for me to delete and reimport the folder if there are updates. :p
Yep. You can also move everythings to compendia and let others use that. The example-module for CSB does that
I really should start doing this...
That should work however that might effect lots of things; if you test changing the style in the console, making sure that it only affects what you want it to, then copy out what you’ve changed with the ‘.class {style settings here} ;’ surrounding it, then put that in a css file or you can use a module like custom css to play around with it on the fly
Sorry for the late answer, was playing Satisfactory the whole weekend 😄
Yes, it works with "observer". That's what I tried it with.
By the way, I don't know if that's interesting for anyone or maybe for the wiki, but I was able to create a dropdown field in a character sheet. I'm using this for a function similar to how you can change the attribute of a skill in fantasygrounds 5e.
Basically, you create a select in the item container column:
<select id="%{return linkedEntity.uuid}%_skill_select">
<option value="str" ${switchCase(item.skill_attr, 'str', 'selected', '')}$>STR</option>
<option value="vit" ${switchCase(item.skill_attr, 'vit', 'selected', '')}$>VIT</option>
<option value="agi" ${switchCase(item.skill_attr, 'agi', 'selected', '')}$>AGI</option>
<option value="dex" ${switchCase(item.skill_attr, 'dex', 'selected', '')}$>DEX</option>
<option value="int" ${switchCase(item.skill_attr, 'int', 'selected', '')}$>INT</option>
<option value="per" ${switchCase(item.skill_attr, 'per', 'selected', '')}$>PER</option>
<option value="cha" ${switchCase(item.skill_attr, 'cha', 'selected', '')}$>CHA</option>
</select>
And then in the label roll message, you add this function:
%{
let val = document.getElementById(linkedEntity.uuid + "_skill_select").value;
linkedEntity.system.props.skill_attr = val;
}%
That way, the value inside the item itself (which is a dropdown list) is automatically updated to the value from the select.
I have yet to try this out with a regular text input to get something like an "amount" field for my inventory, but I'll probably try that out this week. Sadly, I don't think I'll be able to create the same effect as a number field, with the relative modifications and controls and whatnot.
I mean I MIGHT be able to get relative modifications working by just checking if the input starts with a "+" or a "-" 🤔
This is a small preview of what i'm cooking with custom system builder. The layout said "No you can't change me", but position: absolute said:
I have the following roll label:
<h1>${!item.name}$</h1>
${!item.desc_doujutsu}$
<br><br>
${!item.gif_doujutsu}$
<div style="display:none">
%{return await game.macros.getName('${item.macro_item}$').execute()}%
<div>
However, now it is showing an error in .execute(). Was there any change in CSB? I am on v3.2.5
Anyone know what causes this issue?
Dragging a token to the board and token doesnt populate
y: must be an integer
at DataModelValidationFailure.asError (foundry-esm.js:4710:14)
at CustomToken.validate (foundry-esm.js:10432:61)
at CustomToken.updateSource (foundry-esm.js:10502:12)
at CustomToken.updateSource (foundry-esm.js:16430:26)
at TokenLayer._onDropActorData (foundry.js:41882:8)```
Hi everyone!
In an item sheet, I once (successfully) implemented this switchCase snippet to calculate a modifier:
${switchCase(gov_skill, 'Survival', (floor(fetchFromActor('attached', "survival_net")/20)), 'Medicine', (floor(fetchFromActor('attached', "medicine_net")/10)), 'Repair', (floor(fetchFromActor('attached', "repair_net")/10)), 'None', '')}$
Unfortunately, this stopped working yesterday, even though I haven't made any changes to it. Image attached is the error that is thrown.
Am I missing something?
To clarify: gov_skill is a dropdown selection (None, Repair, Medicine, Survival). Depending on the selected value, the code above will then check the attached characters skill and calculate a modifier
Is it possible to click on a roll label and open a popout to type if there was a damage bonus, hit before the roll actually takes place?
This is caused by a ' " in a bio section I have but its worth making note of for future reference and could be a possible bug
Hey y'all. Is there a expectation for v12 upgrade?
@sudden storm - Yes, there is a beta build 4.0 that is compatible with 12.
I've done this with user inputs. Check out 4.8 here: https://gitlab.com/custom-system-builder/custom-system-builder#custom-system-builder
original post #1037072885044477962 message
Thanks a lot. I'll try to install it manually
Yep, thats what I did
Be aware that there have been some major changes so any character sheet that you created already may require some edits
Anyone have a standalone NPC sheet, not looking for complex just something to store information instead of a full sheet?
Oh, thanks. I have made a lot of sheets hahaha
Do a backup
create a new system and import in to see if it works
You SHOULD be able to just update but I am always wary of that
Yeah, me too. It's a lot of work put into it hahah
Yep
Meeee tooo
I wish I new CSS so I could make it fancy, right now its a bunch of fields that track stuff
I'm learning a little bit by using Development tools
I select the element I want, then I try to change it
I use the Google fonts
But I prefer using Custom CSS module. Is easier to set up and make modifications in real time. Rather than having to include a CSS file and pointing to it
Just copy and paste, and you see the modifications once you click to Update
It would be awesome if CSB had a CSS field like custom CSS hahah
?{bonusDano:"Bônus de Dano:"[number]|"0"},
?{gastoChakraAdicional:"Gasto/Redução Chakra:"[number]|"0"},
?{bonusAcerto:"Bônus de Acerto:"[number]|"0"},
?{bonusRoll:'Tipo Rolagem:'|"Normal"|"Vantagem"|"Desvantagem"}
)}$
${bonusRoll == 'Normal' ? 'x':
bonusRoll == 'Vantagem' ? 'xx':
bonusRoll == 'Desvantagem' ? 'xxx': ''
}$```
I have this code, I need the bonusRoll dropdown to "convert" the normal, advantage and disadvantage into a number, because I can't create a conditional to differentiate the type of roll it will make. I'm trying to make this bonusRoll distinguish between when it's a normal roll, with advantage and disadvantage.
Use equalText(), the comparison operator only works for numeric values
Check the return types of survival_net, medicine_net, repair_net. You can use typeOf() to do that
Yeah I just figured it out. The item that was throwing me errors had not yet been attached to an actor 🤦♂️
A fallback-value helps
That doesn't really seem that it's coming from CSB. Any modules running?
tks
No modules at all, just the sheet, and the bio was pulled from a sample sheet. Removing ' " out of that field fixed the problem so IDK
Is there a way to have a condition output as no value in a chat roll message?
I have the screenshot section in a roll message which is comparing the roll vs some preset values for condition percentage chance. i.e if roll>=20 it outputs 'Critical Hit'.
If it doesn't meet that criteria though id ideally like it to not output anything. Currently its outputting an empty value so a tiny value box remains. Have gone through various versions of null but with similar results.
Yes
Yes, I have something in for my critical hit function.
<td>${Roll:=[2d10]}$
<strong>${!Roll >= crit ? '<br>Critical Success' : Roll <= fumble ? '<br>Fumble' : ''}$</strong></td>```
fumble and crit are both in a setting page on my sheet FYI
That way I can control it
So, puta !Roll to your formula and it should fix it
Legend! thanks ❤️
Found a bug with 4.0 - Sort function throws errors and refuses to open panal after selection is made to auto
at Function.entries (<anonymous>)
at Object.selectOptions (foundry.js:8253:36)
at Object.c (handlebars.min.js:27:27865)
at eval (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:15:159)
at h (handlebars.min.js:27:25975)
at c (handlebars.min.js:27:6943)
at Object.<anonymous> (handlebars.min.js:27:7333)
at Object.c (handlebars.min.js:27:27865)
at Object.eval [as main] (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:25:49)
at c (handlebars.min.js:27:23534)```
Fix is you have to go into the json file, change the auto to manual and remove sorting criteria. Save then import
Is there a formula like setPropertyEntity to reduce the number of items in the inventory?
Like limit the number of items within the table?
has custom system builder got the update to vr 11?
Vs 11 works fine, v12 you will need the beta 4.0 build
ahh i see ill wait tell that fix thats can you have 2 foundry vers on pc to switch between to play certain games ?
Yes you can
You need to make sure you install them in different directors and use different foundry data folders
not easy but doable
Is there a way to move a panel to another tabbed panel without recreating it.
Ctrl
REQUEST: print a message to chat when you drag and (copy) an item from one sheet to another.
awesome, drag and copy is such a convenient feature so far
Hmmm, I'm wondering if it's possible to, essentially, set up the beginning of a template, then do the various menial stuff in an IDE where I can copy and paste and change the key-value pairs more easily, then import it back
since my system has 36 skills, each of which follow the same untrained/trained/specialized model, and 4 attributes, which each follow dice steps from d4 to d12
every time I write about this system I'm making I realize how janky it is, and that's surprisingly not making me feel bad about the design since it's still in the early stages
Yep, all JSON-based, so you can do that in an IDE
Nice
But CSB itself should still be faster in most scenarios, because you can drag an copy components however you like
The only thing an IDE has an advantage, would be mass-replacing fields
Is there a reason I have to update a character sheet for any changes to happen now when previously they were automatic?
All of my old work is broken now
Hi, new guy here who don't know shit about code !
I'm trying to make a Rogue Trader sheet (it's actually almost finished) and I want to add the damage dice to the attack dice of a weapon. I choosed simplicity and hardcoded the weapon (not a dynamic table because I don't know how to interact correctly with them) but when I want to make the roll, there is always somekind of error preventing the whole button to be used.
I tried : "Damage : ${!roll:=[(weapon2_ddice)d(weapon2_ddicetype)+(weapon2_ddicebonus)]}$" where ddice is a numberfield with the number of dice, ddicetype is the type of dice, and ddicebonus is the "+5". But there is obviously something wrong that I don't understand.
At first I tried to just use a single textfield (containing the whole dice "1d10+5" but always gave me an error)
Any idea ? I'm not trying to go too fancy, just need Damage to be rolled, and type and pen to show. Technically I also need to make a Rate of fire selector but no idea how to do it for now so not a priority.
When you're referencing a field in a roll, you need to surround it with ":", not "()".
So try [:weapon2_ddice":d:weapon2_ddicetype:+:weapon2_ddicebonus:]
Oooooooh, that worked ! Not exactly how I wanted though. The text part isn't showing, it just roll the dice. But it roll it correctly at least !
Can you give me a screenshot of how you configured the label? maybe I an help you.
regarding the topic of using a dynamic table, I actually solved that issue like this:
${name}$ deals ${sameRow('action_dmg')}$ with their ${sameRow('action_name')}$
with the action_dmg field being a text field, where the players can add their rolls with [[ ]] around it.
that does require some work on the players' part, but hey, it's not like they're idiots right? 🤣
About the label : You mean the roll button ? Didn't do much. Left it as it is and put the formula above in the roll message, that's all.
About the dynamic table : So that's THAT simple to use the dynamic table ? Man i'm probably gonna steal that xD ! And I suppose it would work with an itemcontainer too.
(By the way, I just removed the "!roll:=" and it fixed it.)
yeah, you can probably define a text field in the item, and then use sameRow again in the item container.
I'm actually thinking about doing that for weapons and spells as well, just haven't gotten around to it yet. The only issue is that many of my weapons and spells deal multiple types of damage, and I want to automate Damage Reductions and vulnerability/resistance as well. And since weapons have multiple actions in my system, that makes it more difficult 😅
Technically, you can make multiple item for the same weapon. That's what's i'm gonna do for weapon with distance and melee attack. Easier.
yeah that might be an idea, but I'd like the weapon to be an actual item as well, so I want it to show up in both the actions tab and the inventory once you drag it in.
Of course, I could just hard code like 3 or 5 actions into the template, since no weapon has more actions than that
then I could also do a dynamic table for the damage
but yeah, something like a "dynamic subtemplate list" would be great 😄
Tried with the item container, but I think I misunderstood something.
${[sameRow('weapon_damage')]}$
The formula is in a Label in the item container. (Roll, in "Label roll message")
The "Damage" column has "weapon_damage" as component Key and show the right text. (in this case 1d10+5)
Problem : Nothing happen.
NEVERMIND i'm just stupid. Forgot the ::
you should be able to do it without the [] and the :: if the text itself contains [[]]
i.e. instead of
${[:sameRow('weapon_damage'):]}$
and 1d10 + 5
you could just do
${sameRow('weapon_damage')}$
and [[1d10+5]]
That has the advantage of being able to contain other text in the damage column itself
New problem ! (Yeah again) I think I don't understand how the equivalent to if/else work.
${#char:=samerow('weapon_range') == 'Melee' ? WS_val : BS_val}$
${!roll:=[:sameRow('damage'):]}$ vs ${char+?{Modifier|0}}$<br>
<h2>${!roll<=char+Modifier ? 'Success' : 'Failure'}$</h2>
Degree of Success/Failure: ${!floor((char+Modifier-roll)/10)}$```
I'm trying to check the "weapon_range" column, to define which characteristic will be used. (If it's equal to Melee, then WS, otherwise it's BS.) But I get an error and I'm pretty sure I don't understand the 1st line
Note : weapon_range is a textfield in the item.
I'm good with no text in the damage actually. More appealing to the eye 😄
The "r" in the "sameRow" for weapon range has to be upper case.
That explain why the name was fucked up...
Seems there is still an error somewhere else tough.
what's that "char+?{Modifier|0}" supposed to do?
It's the first Error in the screen. Show the difficulty (Characteristic) + modifier
ok because I'm unsure what the Question mark is supposed to do
might be an idea to remove the # form the char calculation for now to check what the result there is.
Also, you could hit F12 to open up developer tools. In the console, you'll probably see some red text. Might be interesting to make a screenshot of those error messages there
Send a prompt to the user to input something.
(took me a minute to find the console on opera GX ^^', F12 sent me to google news for some reason)
This error appear multiple time, everytime the "char" variable is used
I don't really understand why it's trying to convert it to a number though, it's supposed to already be one. (WS_val and BS_val are numberfield)
So, my logic would say that it's ${#char:=sameRow('weapon_range') == 'Melee' ? WS_val : BS_val}$ that part that's being problematic. And I don't know why.
Basically took it from the deathwatch template and modified the variable. to match what I need. I use an equivalent for my skills roll.
In the sheet ? Nope, never used it
no I mean "char" is a keyword in programming languages, describing the "character" datatype, i.e. a single character of text (so for example char c = 'c')
The custom system builder uses ComputablePhrase as it's base for all formulas, which I THINK just calculates the value as if it was a javascript code.
try renaming the variable to something else, like chara or diff or ristic or whatever 😄
Tried changing to adv. Didn't change.
I did find another error that I didn't see before though !
And I think that the function that I use is actually made for number xD
Yep, that was it.
yes, the condition == value ? a : b thing only works with numbers in CSB
Is there a version for text ? (I'm not using the range in any formula so I don't care)
you can do "equalText(sameRow('weapon_range'), 'Melee') ? WS_val : BS_val" instead,
I always forget that CSB doesn't like text comparisons, had that issue a few times already 😄
Yep, that work ! Thanks for your help !
Just need to work on the Rate of Fire selection, but I'm probably just gonna do a dirty condition,that will work sufficiently xD
It's true that char is a reserved keyword in most languages, but not in JS. JS only knows strings.
We use Actor/Item -> TemplateSystem -> ComoutablePhrase -> Formula -> mathjs-lib. The mathjs-lib defines the syntax of the epressions. It's not JS per se.
Was just an idea anyways, the issue was the number thing
Regarding this in texts, I got that to work too.
The trick was onchange="this.click()"
to make sure that the value in the item updates when you enter text
So the label text is:
<input id="%{return linkedEntity.uuid + "_item_amount"}%" type="number" value ="${item.item_amount}$" onchange="this.click()" />
And the label roll message is:
%{ let val = document.getElementById(linkedEntity.uuid + "_item_amount").value; linkedEntity.system.props.item_amount= val; }%
Question by a noob :
Is it possible to do the SUM of the column of an item container ?
Let's say I have a column with the key "leftarm_armor", can I make the sum of the column and show it outside of the item container ?
And if yes, how ?
hoi, yes I have this set up for totalling the weight of the inventory, I plan to change this to use item modifiers instead but it works:
${sum(lookup('item_inventory','item_mass'))}$ / ${Capacity}$
where 'item_inventory' is the key of the item container and 'item_mass' is the column I wanted the total of. 'Capacity' is just the max value I determine by player stats. Evaluates to something like "50 / 150"
Good to see some familiar names here! Not here to ask for help. Just saying hello and hoping your games are going well!
Thanks !
I take it back, this does work to an extent, but it doesn't seem to save it unless I click the reference afterwards. If I recalculate the sheet, or close it and reopen it, it's not saved. If I open and close the reference, the new value is set and everything gets calculated...
You have to use Document#update to persist the changes. The Wiki should have some examples on how to do that
You're completely right, I had to do
linkedEntity.update({'system.props.item_amount': val});
Another question : (normally it should be the last for a while)
I have an item container, with a column "clip" (key) of type Meter. The Value of the meter is equal to "item.clip_current".
I would like to edit (reduce by one) clip_current on that item when I use a button in the item container.
I tried using setPropertyInEntity like this : ${#setPropertyInEntity('item','clip_current','clip_current'-1)}$
But I get the error "Cannot convert "clip_current" to a number." (Note : clip_current is a number field in the item sheet)
How can I do that ? / What did I do wrong ?
You're trying to subtract from a string, which won't work if the string is not a number.
Keep the -1 inside the quotes. This way it will be also treated as a string and passed as a whole expression to the function. After that the expression will be resolved and the value will be set
Like that ?
${#setPropertyInEntity('item','clip_current','clip_current-1')}$
Because now I get "Uncomputable token "clip_current"
It always computes with the props of the source-entity, not the target. But you can use the item. or target.-prefix to target the props of the target-entity.
AH. So the second "clip_current" is not located the same as the first one in the formula !
That's what I wasn't understanding !
Thank you ! Added item. and it worked perfectly ! ❤️
Has anyone done a dice pool system before?
Something where the number and type of dice increase - especially interested in mixed pools (e.g. xd4 xd6)
If so, how did you manage that?
Youll probably want to learn how to programmatically roll a dice via a macro
After that its a matter of changing your dice parameter in your macro depending in the condition you want
As for me Ive managed to make a dynamically increasing number of dice and keeping the highest dies the higher LUK player has
Conversely I increase the number of dice and keep lowest dies the more negative LUK player has
By curiosity, any one know if you can make a Panel 2/3 in size instead of equal ?
(Like two panel next to each other, one is 1/3 of the space and the other 2/3)
(I mean without making a giant item like a "Gigantic" Label in the panel)
Also, is it possible to use some kind of "sameRow" but in a normal Table ? Would simplify some formulas
Only if you use your own CSS-rules
Nope
hi guys. how to do those at once? seperatly they work: ${setPropertyInEntity('item', 'EQ', "item.EQ = false")}$ ${setPropertyInEntity('item', 'bag', "item.bag = false")}$ ${setPropertyInEntity('item', 'juki', "item.juki = false")}$ ${setPropertyInEntity('item', 'skrzynia', "item.skrzynia = false")}$
Sad, thx for the info though
A batch-update only works with a Script: https://github.com/GamerFlix/foundryvtt-api-guide/blob/main/macro_guide.md#batch-changes
than maybe can i target more than one field?
i dont have slighest idea how to convert it into a script are there examples on items somwhere? I dont know how to adress item
linkedEntity is the item-object. It's globally available in Script-Expressions when the Label is within an Item Container. If you need a multifield-update, you'll need to create an object with the differential data in it:
const diff = {
EQ: false,
bag: false,
juki: false,
skrzynia: false
};
await linkedEntity.update({'system.props': diff});
thank you will try it out
So I'm having lag issues when characters update their sheets. (I am running on Forge)
One thing we found that seemed to be causing lag was that I had not deleted tokens on other maps. After deleting tokens from other scenes the lag went down significantly for that character's sheet updates.
Are there any other tips for how we can reduce lag further? There can sometimes be a 3 second or so lag spike when someone updates their HP.
is the beta (not unstable) version v12 compatible?
Hi everyone, I just completed modding the Deathwatch sheet that was in the sheet library into one usable with Fantasy Flight Games Black Crusade. I am sending it here to add to the library!
Yeah
Thats absolutely normal for foundry and csb.
You have to keep in mind that every time someone changes one value, the browser sends the whole sheet to the server, the sever recalculates every vale on every sheet (cause maybe they are connected) and then sends the whole sheets to everyone who is connected to the game.
The bigger/complicated the sheet are, the more time the computers need to send and receive them via internet and the server needs more time to recalculate.
I personaly have sometimes peeks up to 17 seconds.
Would definitely be interesting to see if there's some way of optimizing this 🤔
Maybe when a value changes, the server checks which values changed and saves them in a list or something. Then after a while, you would have a map of value changes to values that depend on them.
Of course, you'd somehow have to account for scripts and IFs and whatnot, and if the template changes and the sheets are reloaded, the map for those sheets need to be redone.
Alternatively, would it be possible to have sending/receiving and calculating in its own thread, with workers?
Recalculations are done client-side, the server itself doesn't do much.
The issue with the dependency graph is that the dependencies are not static in some cases (e.g. ref()). Our strategy is currently to recalculate those expressions, that contain undefined values. This leads to multiple calculation steps before the whole sheet is resolved (check the code of TemplateSystem).
I don't know if distributing it to workers would enhance the performance, I haven't worked on this level so far. But I agree that CSB is not optimized for performance
Maybe I can have a crack at it in a few days. I'm mostly a backend Java dev, but have done quite a bit of optimization work. For now I gotta focus on getting my system going.
What's the policy on merge requests?
There's a CONTRIBUTING.md. Just check that, should be more or less up to date. Otherwise you can check the pending PRs I've made
How do you reference the value of a selected radio button in an input template.
Using the group name throws an error.
Errror: undefined. Uncomputable token "attk_multiplier"
I believe you have to check each individual button
One of radio buttons had the wrong group name.
Also just checked how I did it, the group name should be fine
I’m not too sure how to use csb is there a tutorial or link
CBS beta is not working with dice-so-nice module for me.... Has anyone a solution for this????🤔
There's this video: https://www.youtube.com/watch?v=yGVOj_iqiKg
The new Custom System Builder for Foundry VTT (was Modular System)
Custom System Builder: https://gitlab.com/linkedfluuuush/custom-system-builder
Sandbox: https://gitlab.com/rolnl/sandbox-system-builder/-/tree/master
Sandbox Video: https://www.youtube.com/watch?v=V9IXafKPK2I
GRPGA: https://gitlab.com/jbhuddleston/grpga
Using Foundry without a...
But it's already relatively old and honestly CSB is definitely very much a "try stuff and hack something together" thing, where you have to have some patience and willingness to try around, read documentation and have some basic understanding of software development, at least if you want to do more complicated stuff
But if you just want some generic fields where you can enter values and want NO automation, then you can do that very easily
what exactly is the problem? "doesn't work" is kind of vague
Is complicated stuff like “if x happens then apply a status affect” or rolling for advantage and disadvantage
Or is that easy to implement
advantage/disadvantage should be relatively easy, since CSB uses the dice system of foundry, and foundry has "kh" (keep highest) and "kl" (keep lowest)
So classical 5e advantage would be "[2d20kh]" AFAIK.
When it comes to status effects, no clue tbh.
Stuff like prone bleed etc
But there is an "active effect" implementation where you can use the predefined status effects of foundry to make modifiers (like -5 on perception when you're dazed or whatever). But I believe there's no "apply effect" thing and you have to do that manually via the token.
but might be wrong about that.
Is that easy to implement then
Here I created a "prone" status, that reduces the maximum agility of my characters (usually assigned by their type of armor they're wearing) by 10.
You can see that "Nachtigall", our resident agility fighter, has a maximum of 100 Agility wihtout it (i.e. basically "unlimited") and when I apply the status via the token, her maximum agility becomes 90.
Obviously, I'd actually reduce her "real" agility, but you get the gist.
Oh shit
One issue I have with this btw. is that I have levelled conditions in my system (i.e. drunk 1-3, from buzzed to black-out drunk) but foundry doesn't have levelled conditions, so I still gotta integrate a module to create my own conditions 😄
My last question is how easy it to add custom attributes the one I’m making is based off runescapes
Which mod did you use for that
what do you mean? I haven't found one yet 😄
Oh
basically everything you create in CSB is custom attributes. So it's really just - create an actor of the type "template"; open it up, click the big "plus" button, choose what type of component it is, and fill out the dialog.
then, create an actual actor, in the dropdown choose your template, and fill out the values
so you're basically creating a "form" for the char sheet. and attributes are everything.
Also, nice, Runescape sounds interesting for a TTRPG
can i dm you some stuff about the sheet
sure but why not here? I may not be online all the time and I've also used CSB for only maybe 2 weeks 😄
ah one sec then
my last question is for dnd when you click your weapon/spell on your character sheet it rolls the dice automatically and applies the bonuses to the roll. would that be easly to implement since the system uses 3d6 die
really depends on the nature of the bonus and whatnot.
I have something like that set up.
It's a label component, with "label style" = "Button"
Label text = %{ return ${str_base+str_species+str_increases+str_temp}$;}%
i.e. the sum of those different strength modifiers
And the "Label roll message" (i.e. what's sent to the chat if you click the label)
is
${name}$ makes a strength check and rolls a natural ${roll:=[1d20]}$ + ${lvlroll:=proficiency=='0' ? 0 : ref(concat('lvl_', gamemode))}$ lvl + ${profroll:=[:max(proficiency-1, 0):d4]}$ proficiency dice + ${str}$ attribute for a total of: ${roll+str+lvlroll+profroll}$
So that rolls 1d20 and saves that as "roll" and shows something like "XY makes a strength check and rolls a natural 12 + 2 lvl + 4 proficiency dice + 7 str attribute"
Because in my system, proficiency works like this: rank 1 means you add your level, and rank 2+ means you add 1d4 per proficiency rank.
So it's SOMEWHAT easy, you COULD just do ${[1d20+attribute]}$
But if you want there to be more complex information, and the attributes are a bit more nuanced, you'll introduce more complexity.
i mean could i make it make it roll 3d6s instead a 20d
that's easy, yes. CSB is system agnostic, so what you're rolling for checks is something you define for yourself
ok cool that about answers all my questions thank you so much
If you check the "Label roll message" i posted earlier, you'll see I defined the roll as ${roll:=[1d20]}$.
in this case, you'd just swap that to ${roll:=[3d6]}$, that's all
you have been such a help thanks man
you're welcome, hope you have a lot of fun with foundry!
And don't get discouraged if you're having trouble at first. Just read through the readme here: https://gitlab.com/custom-system-builder/custom-system-builder
And if you still have trouble, don't be shy to post in this chat
Hello... i was testing what i can do with Labels and i ended up getting lost on how to use JS scripts inside of it ( I know the code is a mess but the important part is the button )
${#number:=floor(1.5)}$.
<div style="border: 3px solid black; background-color: cyan; text-align: center; font-family: 'MedievalSharp', cursive; padding: 10px; border-radius: 10px;">
<p>${macro}$</p>
<p>${[1d20+:forca:+:number:]}$</p>
<img src="https://addons-media.operacdn.com/media/CACHE/images/themes/65/139065/1.0-rev1/images/db65a746-6e4a-4b40-b9a6-1f6167d2ba6e/37af93a3d18ae50033844ccfc17ed214.jpg" style="width: 240px; height: 120px; margin-top: 10px;">
<button id="colorButton" style="padding: 10px; font-size: 16px; background-color: blue; color: white; border-radius: 5px; border: none; cursor: pointer;"
onclick="this.style.backgroundColor = (this.style.backgroundColor === 'blue') ? 'red' : 'blue';">
Click to Change Color
</button>
The only thing not working is the button...
Interesting, because in playcode.io this 100% works...
Have you checked the console?
nothing there
and inspect element works? i.e. the onclick is in there?
nope
this might just be a sanity check, but you DID reaload the sheet right?
just checked, i did 🤣
and there weren't any errors in the console when reloading the sheet? because IIRC CSB basically "gives up" if there's any errors thrown when you reload a sheet
no errors
...then I gotta be honest, I'm stumped.
only thing I can really recommend is reload the page, restart the sever, export and then re-import the system as json, check the exported json if it contains the onclick, stuff llike that
Maybe that is not the way to do JS in Custom System Builder...
it worked for me though 😄
i didn't try that, but I have a "onchange="this.click()""thing
But if you want I can try it on my system
I would appreciate that👍
Alright, can't upload images at the moment
but it 100% works in my system
I JUST did the button though
component type Label
enter nothing else
Label text
<button id="colorButton" style="padding: 10px; font-size: 16px; background-color: blue; color: white; border-radius: 5px; border: none; cursor: pointer;" onclick="this.style.backgroundColor = (this.style.backgroundColor === 'blue') ? 'red' : 'blue';"> Click to Change Color </button>
Works like a charm
AHH
well I don't know about that one, one sec
Yeah no that doesn't work. I guess that's not something you can do
🥲
maybe in a macro?
I will try creating a pop up or something... but i realy wanted to do buttons on chat... damn 😩
https://foundryvtt.com/packages/requestor
'Maybe this module would be interesting for you?
Requestor, an Add-on Module for Foundry Virtual Tabletop
I could try that, but i also am thinking of something like prompts.... maybe ?
I am not sure how to use them though
don't know your use case, and honestly I don't even know enough about the foundry environment to really give you any good recommendations. I just started seriously using foundry 3 weeks ago 😄 This is just the first thing that came up when I googled "foundry chat button input"
Me too 🤣
Sorry one more thing the other game I’m I’m making uses the same roll system as call of chuthulu uses the % die what can I do to get an weapon to roll that or just roll % die in general since they aren’t in the dice tray
I believe that's /roll 1d100 in the chat or in texts/labels/whatever it should be [1d100]?
Wouldn’t that just roll a d100?
I will try using requestor... you cant write html inside prompts... ( I think )
Call of cuthulu rolls a tens die and 1d10 for the single number
what's the difference?
I think he wants to see the actual dice roll instead of rolling a d100
I’m not too sure tbh the game just says roll a tens dice and 1d10
Its the same thing
In that case it would be something like ${[1d10]*10 + [1d10]}$
But mathematically, the chance for each number is exactly the same as long as you have "true" dice, aka one where every number has the same chance
In real life you dont have a 1d100 ( Normal people dont ) So the game makes you roll 2d10 instead to simulate it
yeah, the game says that becaue there IS no real 1d100 widely available, so they use this method to get the same result, but with 2 dice that ARE widely available
Well it’s for advantage and disadvantage the games not out but I would assume if he had a role for either you would roll two dice and take the lowest number for the tens and single number place
But you could just roll 2 d100s I guess
but generally, in Pen and Paper circles, when you talk about 1d%, 1d100 and 1d10*10 + 1d10, everyone assumes you mean the same things
Keep in mind that if something has 30% chance of happening is usually better to consider 71 or above to be a success
because 100-30 = 70
I was just curious what the command was to roll a tens dice
I see... sorry...
If that's the concern, i.e. you roll the tens position with advantage AND the ones position with advantage, and then add together the higher singular rolls, you WILL need 1d10*10 + 1d10.
But as someone who designs for the tabletop first and then translates that to VTT, I kinda have to question: why would you do it like that?
I thought you were new to the system
So yeah, my suggestion is do 1d100, or do 1d10 * 10 + 1d10, whatever suits your needs better
ah wait sorry, it should be (1d10 - 1) * 10 + 1d10
( 1d10 * 10 + 1d10 ) wont work, you need a 0 instead of a 10
since you don't want numbers from 11 to 110, but numbers from 1 to 100
I’m just following what the game instructs since it was a game similar system to call of cuthulu
we realized that at the same time didn't we 😄
So it’s (1d10 * 0 + 1d10) to roll % die?
Any number times 0 will always be 0
no it's (1d10-1) * 10 + 1d10
basically on the tenner die, you treat 1 as 0, 2 as 10, 3 as 20 etc. and then you add a general 1-10 value on top of it.
The "regular" way would be to treat a 10 on the tenner d10 as a 0, and you could achieve that by doing (1d10%10)*10 + 1d10, but honestly that would take me some time to explain
Actually ! you need to do (1d10-1) * 10 + (1d10 - 1)
because the actuall dice uses 000 as 100
whait... am i wrong ? just a sec
yeah that creates values from 0 to 99
If you want to play them separatly you can do
[(1d10-1) * 10] [1d10 - 1]
to be more realistic with the rule set
if you want values from 1 to 100, (1d10-1) * 10 + 1d10 is the easiest way.
If you want to do it "like the dice" it would be
roll:=1d10%10 + 1d10%10
roll == 0 ? 100 : roll
like I said, that will create values from 0 to 99, is that wanted?
yep, the d100 uses 000 as 100
at least thats how i played call of cthulhu years ago...
i could be wrong
ok, so it's a conversion that has to happen in the player's mind. Then the most "real" and easiest roll would be
[1d10%10] [1d10%10], because that treats 10 as 0, and writes the two values next to each other.
basically simulating an "order" of dice or a color-code like "this is my tenner and this is my oner", just by how they're positioned inside the string
Wait... is it ? you need one dice to display 00 and the other to display 0... i think we got it wrong
that's if you have tenner dice (10, 20, 30, etc.) out of the box. Growing up, we basically had 2x 1d10, and "the red one is the tenner" basically.
but like earlier stated, mathematically, 1d100 or (1d10-1)+1d10 creates the same results without the player having to convert stuff.
So this is really just an exercise in how pedantic we can get tbh
🤣 right ?
Hi again ! Forgot the Psyker part of rogue trader and trying to make a Psychic Phenomena Check.
So the question : Can you compare a variable to an array ?
Like, i've got my roll result in the !roll variable, i would like to know if it's equal to any of these numbers : "11,22,33,44,55,66,77,88,99". How can I do that ?
I finally found the wiki (yeah took me a while...) but I don't understand how to do it.
And I would love to not have to make 9 "==" comparison...
I'd do that with a little Script:
%{return [11, 22, 33, ...].includes(localVars.roll);}%
or
const digits = localVars.roll.toString().split('');
return digits[0] == digits.at(1);
I'm surprised that I actually understood how to put that in my macro (never did script)
Anyway, thank you ! Saved me a headache
Can i change the value of a variable using setPropertyInEntity inside a onClick function using a html file ?
For exemple, i have this svg that once clicked needed to change a number in the character sheet to something... what i found out is that it kind of ignores the onClick event and sets it to the last command it finds.
<div>
<div id="data">Clique em uma parte do corpo</div>
<div class="human-body">
<svg
xmlns="http://www.w3.org/2000/svg"
width="259.22897"
height="350"
viewBox="0 0 68.587668 92.604164"
>
<!-- Head path -->
<path
data-position="Head"
style="opacity:1"
d="m 11.671635,6.3585449 -0.0482,-2.59085 4.20648,-2.46806 4.42769,2.95361 -0.0405,1.94408 0.24197,-3.34467 -2.03129,-2.31103004 -2.84508,-0.51629 -2.20423,0.52915 -1.9363,2.63077004 z"
onclick="document.getElementById('data').innerHTML='Head'; ${#setPropertyInEntity('self', 'selectedpart', 0)}$"
/>
<!-- Face path -->
<path
data-position="Face"
style="opacity:1"
d="m 19.748825,6.7034949 0.0203,-2.20747 -3.96689,-2.7637 -3.74099,2.23559 -0.006,2.63528 -0.60741,0.0403 0.27408,1.82447 0.97635,0.33932 0.44244,2.1802901 1.82222,2.06556 2.03518,-0.0607 1.79223,-1.94408 0.35957,-2.2406601 0.97616,-0.33932 0.25159,-1.78416 z"
onclick="document.getElementById('data').innerHTML='Face'; ${#setPropertyInEntity('self', 'selectedpart', 1)}$"
/>
<!-- Neck path -->
<path
data-position="Neck"
style="opacity:1"
d="m 13.304665,11.910505 1.64975,2.35202 0.74426,2.62159 -1.73486,-1.38354 -0.86649,-2.97104 z m 5.08047,0 -1.64975,2.35202 -0.74538,2.62234 1.73486,-1.38354 0.86649,-2.97104 z"
onclick="document.getElementById('data').innerHTML='Neck'; ${#setPropertyInEntity('self', 'selectedpart', 2)}$"
/>
</svg>
</div>
</div>
As a exemple my code can change the data id with a js command, but cant change the value of selectedpart, since the last command aways sets it to 2
Is there a way to put a Custom System Builder command inside a onClick ?
help🥲
Can't you do it in the form of multiple labels, and do the call in the message roll call?
otherwise this is kinda advanced stuff, might need to create your own component for it
I don't expect this to be answered right away if if at all, but I'm trying to find a way to filter out an item container if the items it shows are not equipped to the character. Any ideas on how to do that?
if the item has something liken "is_equipped" property, just filter that?
I just realised that I worded it a bit wrong. When I said equipped, I mean that the actor has an item with the appropriate template. For example, I want this container to only show if the character has an item that has an "exploit" template (pardon my bad layouts)
...then I don't understand the question, because that's exactly what item containers do
ah you mean if it is empty it shouldn't be displayed?
hm do you maybe have an old version of the system? Because there should be an option for that above "Display column names"
this is on version 3.2.5 (foundry 11)
Nope, ${}$ and %{}% will be resolved immediately. They don't care with what you surround it with.
I guess there's no other way to interact with the scripting system right? something like calling the CSB API from inside regular javascript in a component?
Some classes are exported to global, so they can be used (like ComputablePhrase, TemplateSystem, Formula)
hm so one could add a <script></script> or script macro with a function that creates and calls a ComputablePhrase, and then in the html call that on click for example? 🤔 Of course' you'd need to somehow provide static references to the entities you're manipulating
Actor context will be an issue if a static reference is not sufficient
You could return an UUID from %{}% and fetch the Document via the Foundry API
yeah that's what I was thinking
What you're looking for, you will need to install a different module for that
CSB has some support for status effects but nothing that automates conditionals
You'll want to look into Triggler function in the Condition Lab & Triggler module**
**) Only 70% of Condition Lab & Triggler module works with CSB, fortunately the one partial part that works flawlessly with CSB is the Triggler part of the module so you're good on that end
3D dice are not rolled and the default chat sound is played. It acts as if the module is not enabled.
I dont think i can use <script> inside Custom System Builder... i tried but it did not work, thats why i am only writing inline Javascript
I will look in to the Foundry API to see what i can do...
Thats... actually a good idea... i will try that too
thx for the tips guys 👌 😊 👍
Does anyone use CSB on forge?
I'm thinking of switching to forge, but I don't know how it'll work on the forge
Am I doing something wrong, or is there a reason why tags assigned in an actor template in the Prototype Token (using Tagger) doesn't get applied to actor sheets?
Is there a way to put a background image in a panel ?
Pretty sure you can assign custom css classes, that might work
If i were to use custom css classes where do i declare them ?
i tried writing the styles directly inside it but it did not work... so i assume a css file exist somewhere...
i think i found it
I am actually still struggling to make it work...
since the text said it cant upload a .css file i created a folder inside my ~/.local/share/FoundryVTT/Data folder named css and inside that folder i made a css.css with all my classes
so my file is located in the path ~/.local/share/FoundryVTT/Data/css/css.css
still.. i have no ideia what i am doing... this Upload is making me more and more confused the more i look at it
i enter the folder and i see a Selected thing... i tried writing css.css there thinking it would select my file but no luck on that...
😢
It says to upload manually to the server... i am not sure what that means either... maybe i misinterpreted it
Prototype Tokens are a construct of Foundry and are Actor-specific, not Template-specific. Your case would require an override by CSB, so basically a new feature
It's a bit unclear from us 😅. It means that the upload as well as the selection cannot be done via the file browser of Foundry. So you have to upload the file and enter the path to the file manually.
Yup, there. The base path is the User Data Folder
since the base path is User Data then it should be /css/css.css correct ?
Weird enough i cant use any of my css classes...
Reload your world
I am exploring dropdown menus and i think i got something wrong...
I tried to create a label that would change based on the selected option in the dropdown menu
<img src="${switchCase(typeofmagha,
'aura1', 'Aura1.png',
'aura2', 'Aura2.png',
'aura3', 'Aura3.png',
'aura4', 'Aura4.png',
'Aura1.png')}"
style="width: 400px; height: 400px;"/>
for some reason when i do <img src="Aura1.png"/> so the path cant be the issue....
i think i may have done this whole switchCase thing wrong
my console says
Hi again !
So, in a button roll, I make it roll Xd10 (where X is a value in the sheet), I need to get the total but also to check if each dice is equal to 9. The first is obviously easy, but how can I check every dice ?
Hi guys, i'm exploring the new function Conditional Modifier List but i'm not understanding how it works and what is it's purpose, somebody can help me?
Thank you all 🙂
you'll need to use a script, here's my solution for displaying the total but also counting the instances where each dice is equal to 6, and displaying a message if that's greater than 3. For you you would just edit it to check for each instance of 9 and change the text to display how you want it to https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/383#note_2053118136
Clearly didn't expect it to be so complicated !
Didn't understand half (well, maybe more) of it, but managed to convert it for my use.
Thanks !
Together I think we understand maybe 75% 😅
I wish to have a function that changes the active scene. I can't find anything of the sort in native Foundry but I might just have missed it solved in #core-how-to
I need help, I want to create a system to equip/unequip items. Saving the items in the saved_table table (and removing them to the armor_table, weapon_table, item_table. However, I also need items stored in parchment (these are items that are not 100% unequipped, but are stored in a parchment and do not take up inventory space).
I don't know how to build this mechanic, even looking at the CSB website as a reference, could someone help me?
This might be a stupid question and I am sorry if it is...how do I change the Custom System Builder from Metric to Imperial? 😛
I might be able to help with this. For my own game I made a system of items that the GM or players can equip/unequip, which then calculates how much inventory space is used. It takes great advantage of hidden attributes for the items that interacts with item containers in the actor sheet.
It's a little complicated, but I'm balls deep in a project right now, so I can't get into the details, sorry. I will check back tomorrow and follow up at that time. 🙂
I am still having trouble with this specific code… does anyone know what i am doing wrong ?
Hey, any help is welcome kkkk
I basically need 2 buttons:
1 to place on parchment, and it would take you to the tabela_itemselado table
2 to save, and this button would place the item in the tabela_guardados
and in these tables (tabela_itemselado table and tabela_guardados) a button to remove and return to the appropriate table (be it item, armor or weapon)
I don't think I'd be very helpful with buttons that can move items. I'm afraid that sort of functionality is outside my knowledge. I'm not even sure it's possible outside of scripts.
But anyway, I'll show you what I have tomorrow and hopefully you might be able to adjust it to what you need.
I also have the same question
Someone be a brother and answer this guy please t-t
Do you have the same problem ? To what extent do yours work ?
I see, dont try my code, it is not working
We will have to wait someone who know what to do
Keep in mind that your template will also try to resolve the image-source, which won't really work, because the Formula will be unresolved.
To get rid of that issue, I suggest to use concat() for the whole img-tag:
${concat('<', 'img src = "', switchCase(...), '"; style = "..."', '/>')}$
You'll need a Dropdown or a group of Radio Buttons in your Items to keep track of the state.
Then you'll need filters in your Item Containers, which only show the Items, which bypass the filter. So you should filter by the Item state.
And lastly, if you want to change the state of the Item, you can do that by directly accessing the Item and changing it there or via setPropertyInEntity()
Separate the opening and closing brackets of the html-tag in the concat
i don't understand... what do you mean by separate ?
Check the edit
like this ?
${concat('<', 'img src = "', switchCase(typeofmagha,
'aura1', 'Aura1.png',
'aura2', 'Aura2.png',
'aura3', 'Aura3.png',
'aura4', 'Aura4.png',
'Aura1.png'), '"; style = "width: 400px; height: 400px;"', '/>')}$
Still not working... maybe its because i am trying to do it in a label inside the sheet ?
That actually is correct for the template. Now show your actual Actor
What is a Actor ?
There are 2 different Actor types: Template and Character. Show me the Actor with the character-type, which uses this Template.
You're missing a dollar-sign at the end
Sorry for the naive question, how could I put the dropdown or radion buttons in the table label for this control? Is there any example more or less for me to follow?
The Example-module for CSB has an example on how to show Items in different Containers
${concat('<', 'img src = "', switchCase(typeofmagha,
'aura1', 'Aura1.png',
'aura2', 'Aura2.png',
'aura3', 'Aura3.png',
'aura4', 'Aura4.png',
'Aura1.png'), '"; style = "width: 400px; height: 400px;"', '/>')}$
Is it maybe the newlines? Try to remove them
${concat('<', 'img src = "', switchCase(typeofmagha,'aura1', 'Aura1.png','aura2', 'Aura2.png','aura3', 'Aura3.png','aura4','Aura4.png','Aura1.png'), '"; style = "width: 400px; height: 400px;"', '/>')}$
Same error...
Then idk. Hard to check from mobile. I'm away for the whole week.
thx for trying Martin, you are always very helpful 👍 i will try to find a way out 😁
I tried to add a variable here to leave it at zero and when I click on save item it changes the value, but apparently it is not even picking up the filter...
The value will stay at 0. Hidden Attributes act like Labels, thus cannot be changed by users
I changed the hidden attribute to a number field with a maximum of 1 and a minimum of 0, I left it as 0 and it shouldn't be appearing in the tabela_guardados
${item.item_guardado == 1 ? true : false}$
Would this filter be correct?
Filter formulas don't require ${}$ to be put.
yes, with "and" or "or"
In my system, abilities are often tied to an attribute. For example, the maneuver "Charge" needs Str 15. If Str gets debuffed below 15, this abilty (item) gets temporarily inactive. Im looking for a way to check my abilities on the character if these requirements are fulfilled and if not, visualize that they are inactive. So how do i do that? Did anyone achieve something similar?
Is the condition for temporary inactivity always the same (attribute below 15)?
I'm failing to find instructions how to make clicking a label roll dice.
I found some dice pool article, but it has no info at all how to actually roll the dice pool, but rather accesses some pre-rolled thing that I have no idea how to configure.
Basic label I mean I got it to show the label red probably from me failing to set it up right and print text to chat, but I'd like it to do actual roll.
Preferably clicking label of a number component, but I can make the number labelless to accomplish that too if it must be plain label.
Nope, can be 8 different attributes and different values from 10-18
So I guess inline rolls are the only option?
Are you maybe asking for a virtual 3D dice rolling over the canvas?
No, I'm asking for what you'd get with /r 3d6 in chatlog
That’s exactly the topic of Martins answer.
I don’t get what’s the difference you want.
The answer in the linked article gives inline rolls which are very different.
With pictures. This is what the linked article gives me.
This is what I'm asking for
Klick on the box with the dice.
That doesn't change the chat message
I'm not asking for info on the rolls, I'm asking for /r formula style chat message.
Apparently the answer was toggling off the send rol message to chat and
%{ui.chat.processMessage("/r (${str}$[Str])d6")}%
Was missing the %{}% in earlier attempts and there was no error or anything happening from that.
That's one way to do that. The other one would be this one (with disabled Chat Message creation):
%{await new Roll("1d6 + 5").toMessage();}%
does csb formula have anything like this?
nevermind, mathjs says they dont have a concept of null
Sorry to bother everyone again, I'm still scouring Google for the answer and failing. I'm despertely trying to change the Custom System Builder from Metric to Imperial. Can anyone help?
thats not a custom system builder thing, thats a foundry thing
you might have a better luck in #core-how-to
Isn't it literally in the settings?
What is it that's showing up as metric @thorn magnet
The rulers, templates, etc
I assumed it was a setting, but I for the life of me can't find it
Which exists the very possiblilty that I am blind
I can't find the setting anywhere in either the Core Foundry Settings or the Custom System Builder
Isn't that just a scene-setting?
I mean the suffix can be anything, be it m, km, ft or whatever
Oh it's by scene
That would explain why I've been pulling my hair out looking for it globally
Btw I agree that there should be a global setting that informs the default scene value. But yeah rulers are foundry native, not csm
The system defines the default scene scaling. And it can be altered at runtime.
Is there a way to copy a panel of components on a character sheet and repeat them, say like an attack calculator that I can copy to allow players to have multiple attacks on their sheet?
Holding down CTRL and moving components copies them.
In Custom System Builder, is there a way to "flip" an actor token from one image to another? (like say the front/back of a game piece) Also, is there a way to upload a pdf or image file and be able to mark it (like crossing off check boxes)
Is there any way to remove the comma from between results coming from ${lookup()}$? Or to otherwise manipulate the results, like adding newlines in between
lookup().join('\n')
You can natively change the image for a token. You could save in CSB the filepath for the front and the back and call that in a script
so I need to figure out the script and a command in CSB, ideally a right-click menu or key command
well, that's a start, thank you
I have something similar implemented but I won't be home/at my PC for 36 hours.
If you haven't done it yourself by then you can tag/dm me and I'll paste my version of the solution
thanks
This is something I'd do with Scripts and flags in the Token. CSB cannot really help you there.
That doesn't seem to be working.
Separately, is there any way to add a Checkbox to a column for an item container? Labels and Meters seem to be the only options.
Correction: It works to remove the commas, but the new line thing didn't seem to work.
But now it doesn't matter, since the text type changed to h3, so it automatically newlines it for me.
Hello kurze Frage. Was hab ich falsch gemacht in diesem Code, dass die Würfel nicht gerollt werden sondern nur direkt der Text kommt? Ob der Wurf Erfolgreich war oder nicht: // Funktion zum Würfeln eines d20 und Überprüfen des Ergebnisses
async function wuerfelnUndPruefen() {
// Einen d20 würfeln
let wurf = await new Roll("1d20").evaluate({ async: true });
// Überprüfung des Wurfs
if (wurf.total === 1) {
// Kritischer Erfolg
let schaden = await new Roll("1d4 + 1d8").evaluate({ async: true });
let nachricht = `Kritischer Erfolg! Fähigkeit XYZ ist gelungen. Effekt: Gegner ist Stun. Schaden: ${schaden.total}.`;
ChatMessage.create({ content: nachricht });
} else if (wurf.total === 20) {
// Kritischer Misserfolg
let nachricht = "Kritischer Misserfolg! Fähigkeit nicht gelungen.";
ChatMessage.create({ content: nachricht });
} else if (wurf.total <= 12) {
// Erfolgreicher Wurf
let schaden = await new Roll("1d4 + 1d8").evaluate({ async: true });
let nachricht = `Fähigkeit XYZ ist gelungen. Effekt: Gegner ist Stun. Schaden: ${schaden.total}.`;
ChatMessage.create({ content: nachricht });
} else {
// Misserfolg
let nachricht = "Fähigkeit nicht gelungen.";
ChatMessage.create({ content: nachricht });
}
}
// Funktion aufrufen
wuerfelnUndPruefen();
Hello, so I have a quick question/request. I've been looking for over a week how to make a CSS class that allows you to change the color of meters in CSB. It seems to me this has to do with the "custome-system-meter-fill" class. But no way to make something that works. So if anyone has an idea/has already done it, I'm interested. Thanks in advance 🙏🙏
(I found)
The Wiki has an example for that
Müsstest du mal bei macro-polo fragen, da das direkt mit der Foundry-API zusammenhängt und ich das gerade nicht aus dem Kopf weis. Alternativ kannst du auch in den Source-Code von CSB schauen, wie das geregelt wird.
Hi, I'm using Google Translate because I'm not fluent in English.
I am using system: Custom System Builder. Someone who knows how to use it. I tried reading the Gitlub documentation but it left me even more confused. Could you help me with something?
I'm trying to make items that give modifiers to attributes, for example: Ring that gives +1 strength and I wanted to do this automatically directly in the modifier
Hi Suning
You would do this by setting up the item modifiers inside of the item like this. The '10' is a label component inside of the actor where the label text is just the number 10. You can treat this as your default value. Make sure you give the label a component key, like 'strength'. And then inside the item modifiers, set the 'Key' to whatever the label's component key is.
If you are just doing a 'Ring that gives +1 strength', you just leave the operator as '+' and put 1 in the Value formula box. You can set up this inside of the item template or in individual items if it is different per item.
You can see from the images that when the Ring is added to the actor it increases the number inside the label by 1.
Thanks, I'll try now
Could you show the formula where label 10 is located please?
There's no formula there. He already stated
The '10' is a label component inside of the actor where the label text is just the number 10.
Is there any way for the checkbox on the item container to control a radio button selection within the item itself? In other words, if you checked equip on the actor sheet, can it change unequipped to equipped selected within the item without manually clicking it?
Yep, it can. setPropertyInEntity can change the value of every Input Component
What do I need to do?
The 3rd arg of setProp has to match the value of one of the group of the Radio Buttons.
Is there a way to make the UI elements on my character sheet scale up and down when the player resizes the sheet? Right now they all just overlay and cram together
Right, yeah, I know about rwd. But I'm new to CSB and so far I've just been following the Readme.md examples from the Gitlab page. Is there a way to make a component scale responsively?
You'd need to provide your own CSS-rules (either via a css-file or via the Custom CSS module). Defined CSS-classes can then be used by your Components
Perfect, that's what I was looking for. Thank you
Hi there, is there a way to have two separate item containers that contain different items without filtering item types?
The system I'm building differentiates what can be used in either hand based on which inventory is used, but the same items can go in either one.
currently if I drag an item onto the sheet it shows up in both.
As I understand it, if you have two different item containers that both have the same template filter, like you have, the only way to have them not show up in both containers is to use a filter formula for one or both.
I guess I could create copies of each template and then filter main vs sub that way, just would mean doubling the templates I have to work with
was hoping there was an easier way
What's wrong with using a filter formula?
idk how I would do that
I'm also not sure it would work, since you can equip the same item in both, but you do not have to
I have such a case I can show you as an example.
I have a list of items for skills, some are passive and some are active. In order for them to show up in their respective item containers, I put equalText(item.skill_type, 'Active'), where skill_type is a component key in the item template for a dropdown list, and the two selection options are active or passive.
Oh. If that's the case, then you might be better off doubling the templates needed.
could you show me what your skill item looks like?
So this works great, but looks like the default is checked, which messes things up and requires checking and unchecking a couple times before it is set correctly. Is there a way to make the default be unchecked?
What do you mean with "default is checked"?
The radio buttons for my items start unequipped by default - first image.
When you drag them to the actor sheet, the checkbox shows up as being checked and Takes a slot is set to Yes (unequipped) - second image.
I need to uncheck and recheck the box for the Takes a slot to reflect the checkbox being true and equipped - 3rd + 4th images.
I hope this makes sense.
IS CSB still incompatible with v12?
stable release yes, but there's a beta version with v12 compat
I am trying to make my players be able to write their own skills in their character sheet, but i am failing to give them the ability to reference their stats... Example :
My output :
I know i am referencing the stat correctly because i can roll it with ${forca}$ and it shows the actual value 30
But it only works if i write it inside the Label roll, not when the player write it in the Macro field
If I understand CSB correctly, you can't actually access the values outside of CSB. As in, if you want a macro to have that value you'd need to either send it to the macro or use it from within the CSB panels
If you want a "real" attribute value you'd need to edit the actual system instead of CSB.
Macros on the readme
However, to show my newbiness on CSB:
How does the example calculate total weight from an item container? I can't for the life of me find where there's any code! It's just a blank panel with a 0 that somehow calculates the weight of items 😵💫
the items will have a modifier in them that adds the item's weight to the key, which matches the component key from the label who's text is '0'. 0 is the default value and then each item adds it's weight on top of that
how would one go about getting status icons for custom status effects for tokens?
Template -> Active effects? If I understand the question
I would like to use a world script to prompt actors for a choice of buttons of which they can only pick one of. And each button is presented as a choice or not based on a formula. I have a vague idea on how to do it but I feel like I need some suggestions
I'm trying to get this but with a number to track the amount of said status
Running into an issue with setting up an item container that I can't wrap my head around.
I want the item container to hold equipped weapons and armor. I have a column that should display the Damage value if the item is a Weapon, or the Resistance values if the item is Armor.
I've tried doing this with this switchcase but it is Erroring because Weapons don't have Resist values and Armor doesn't have a Damage value, so those properties keep returning undefined.
${switchCase(item.Type, 'Weapon', ${item.Damage}$, 'Armor', "P" + ${item.Physical_Resist}$ + "/M" + ${item.Magic_Resist}$, 0)}$
Is there a way for me to define a Default Value to the item properties? I know how to do that in JS, but can't figure it out for CSB.
Sorry. I misunderstood then
is fine I no word good 🙂
Are you against giving the weapons an armor value of 0 and vice versa?
the Status Counter module handles this nicely
https://foundryvtt.com/packages/statuscounter
Status Icon Counters, an Add-on Module for Foundry Virtual Tabletop
Spiked armor could be at 1 damage, and parrying daggers could be at 1 armor
Is there a way to do this without having it as a visible field on the item?
Worst case I can do that 🙂 Thats actually how i figured out what was causing it.
OH, hidden attributes is definitely the answer. I forgot about them
Thanks
cheers
Have a look at the module status-icon-counters:
https://foundryvtt.com/packages/statuscounter
Status Icon Counters, an Add-on Module for Foundry Virtual Tabletop
How would I set a conditional CSS style? For example, if a modifier sets the max HP value to higher than its base calculated value, I want the max HP value label to be displayed bold and in blue; if it's below the base value, bold and in red; otherwise, I want it displayed normally.
hi! i've got a dynamic table for weapons. one of the columns is a dropdown menu for the weapon's type (4 in total). each type corresponds to a skill. i want to reference the matching skill's value in the weapon's attack button (d6 dice pool, count successes, skill value adds dice), but i'm stumped on how i use the dropdown menu's key to reference the skill's key. if it helps, the skill values are kept in a normal table, but i'll remake it as a dynamic table if need be.
i'm fairly new to CSB, so this might all be really simple, but any help would be appreciated! 🩷
(also more than happy to provide screenshots or further details, it's my first time asking for help in a public channel)
Thanks!
huh, not sure what i'm doing wrong here; i'll send a few screenshots to illustrate
so i've got weapon_type as a dropdown list; each key is the same as what's seen in weapon skills
i tried messing around with a switchCase at first, but it would always go to the default value
per your link, i tried ${ref(weapon_type, 0)}$, but to no avail (even without the default 0, i also tried renaming weapon_type to dropdown but no luck there either)
It's within a Dynamic Table, so you also have to use sameRow(), so that type_mr can pull the data of weapon_type
so something like ${sameRow(ref(weapon_type, 0))}$? just to make sure i've got the order right
Vice versa
And weapon_type needs to be quoted
oop-- okay, that got it working, thank you so much!
I'm trying to pass a value from an item in a container to a roll macro if anyone knows that could be done?
just to clarify I have an item container showing equipped weapons and say this item has a modifer like item.dmg, how do i pass the value stored there to my macro within the roll message?
yes! tyvm
Is there a way to make it so that when you click to scroll a hit, the CSB asks you to select the damage layout? (cone, straight, circular) and if it is possible to integrate this with the J2BA artworks. I have AA-Automation, but I don't know if it works, or how its integration with the system would work.
Integration with animations is currently not planned. So you'd have to do that on your own. But you should be able to do everything via your own Scripts
And to put the size layouts with scrolling, is there?
Example:
and also how to run a script in the label roll message?
And is this possible to do?
Doable, but I can't tell you how (because I've never worked with Placeables or the Canvas). You have to consult the Foundry-API and ask in the respective channels. I can only cover CSB-related topics.
Ohh ok
@formal goblet Are you still on vacation, and if so, when do you return?
I'm more or less back, taking it easy now
Just checking in and following up about this again to see if you had any thoughts on it. Did it make sense? Even if the default behavior of checkbox-being-checked can't be changed, that's fine too.
Hello! I know you already found a solution, but here is mine just in case. I've altered the JS file for Meter to add a Class for each state of the Meter and each color to be assigned to a CSS variable. They are:
- GOOD_VALUE: var(--color-meter-good)
- BAD_VALUE: var(--color-meter-bad)
- WORSE_VALUE: var(--color-meter-worse)
This way, you can not only change the color of it, but also make it a gradient if you'd like, you can also have it be different for different meters. The only thing you need to do is overwrite the Variable, like this:
.character .meter-element {
--color-meter-good: blue;
}
Here is the file, just overwrite the same file inside: "Data\systems\custom-system-builder\module\sheets\components"
Back with another question I just feel I am just missing a detail to get to the solution: I have an item template for weapons. I have a dropdown (on the right) that let's me pick the suitable skill for the weapon. I want my formula to get the value of the skill from the attached actor. I am not sure how to refer to the dropdown in my lookup:
${fetchFromActor('attached', "lookup('allskillstable', 'allSkillsTableSkillRanks', 'allSkillsSkillname', ${item.itemsWeaponsSkill}$)")}$
If I just enter the actual skill as string in the formula instead of item.itemsWeaponsSkill, it works. I have tried a number of variations with item.[x], but so far without any luck.
The item.-prefix is only available in Item Containers. Everywhere else is invalid
Check with game.actors.getName('actorName').system.props in the console, if the properties are correct
Ayop! I've got a few questions in regards to a Radial Health Bar I'm cooking up, those I wanted to make sure whether this will function or not.
1.) Is it possible to reference the Hitpoint Attribute Maximum on JS, my plan is to set the maximum on the SVG and re-render the SVG after a new weight is selected or HP is dropped down or up.
Below is the Code I'm using on the Label.
%{
const healthBarText = document.getElementById("healthBarText");
const healthBarInner = document.getElementById("healthBarInner");
let healthBarState = {
healthBarSectionGap: 4,
maxHealth: 16,
currentHealth: 14
};
renderHealthBar();
// Functions
function renderHealthBar() {
renderHealthBarSections(100 / healthBarState.maxHealth);
renderHealthBarText();
}
function renderHealthBarSections(percentage) {
healthBarInner.innerHTML = "";
const sectionTemplate = `<path class="health-bar__section" d="M0 0" fill="#fff" style="transform: rotate(10deg)" />`;
const radius = 100;
const angle = (percentage / 100) * 360 - healthBarState.healthBarSectionGap;
const radians = (angle - 180) * (Math.PI / 180);
const x = radius * Math.cos(radians);
const y = radius * Math.sin(radians);
const largeArc = percentage > 50 ? 1 : 0;
const d = `M0 0 -100 0 A${radius} ${radius} 0 ${largeArc} 1 ${x} ${y} Z`;
for (let i = 0; i < healthBarState.currentHealth; i++) {
const healthBarSection = createHealthBarSectionElement(i);
healthBarSection.setAttribute("d", d);
healthBarInner.appendChild(healthBarSection);
}
}
function createHealthBarSectionElement(index) {
const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
path.setAttribute("class", "health-bar__section");
path.setAttribute("fill", "#fff");
path.setAttribute("transform", `rotate(${getSectionRotation(index)}, 0, 0)`);
return path;
}
function getSectionRotation(index) {
return (360 / healthBarState.maxHealth) * index;
}
function renderHealthBarText() {
healthBarText.innerHTML = healthBarState.currentHealth;
}
}%
<style>
.health-bar {
position: relative;
display: block;
margin: auto;
max-width: 200px;
}
#healthBarText {
font-family: "Arial", sans;
font-weight: black;
margin: 0;
padding: 0;
color: white;
font-size: 3rem;
position: absolute;
top: 47%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<div class="health-bar">
<svg width="200" height="200" viewBox="0 0 200 200">
<g id="healthBarInner" transform="translate(100,100)">
<!-- health bar sections go here -->
</g>
<circle cx="100" cy="100" r="90" fill="#191c24" />
</svg>
<p id="healthBarText"></p>
</div>```
I tried it without the item.-prefix as well, no luck so far.
What's the error in the console?
You probably forgot the quotes around the inner ${}$
You can log the entity-object, which is available in every Script. Should be something like entity.system.attributeBars.key.max
Thanks fam, I'll see if I can get that setup.