#Custom System Builder
1 messages · Page 23 of 1
kein Ding
Thats very helpful - maybe adding it to Wiki?
Probably better to integrate it directly
im using a macro for rolling stuff because of how dice work on my system and it works, but for some ungodly reason this second message keeps poping up
this is the formula
and this is the macro
Write %{throw "Done;"}% as last line of the macro.
My bad, last line of roll message 😅
ah
oki
%{await game.macros.getName('Dobles').execute({bonus: ${constitucionTo}$});}%
%{throw "Done;"}%
like this?
Yes, should work.
Hm, let me check my code
It is %{!throw "Done";}%, sorry.
%{await game.macros.getName('Dobles').execute({bonus: ${constitucionTo}$});}%
%{!throw "Done";}%
I've did it like this and still it doesnt work...
Well, it does work for me. 🤔
mmmm
I have
%{!throw "Done";}%
Did you deleted it out off the macro again?
It has to be ONLY in the roll message.
Okey sorry for the wait
I already did that
However
I erased by accident a little bit of the macro
I had a lot of headaches realising it
Now it works perfectly
Thanks
Glad to hear that 😉
by any chance, to the right of Minor Consequence text, can i combine three columns together into one column for a box of text?
They will look separated, unfortunately. You could maybe try to put one large Rich Text Area in the middle position and see what happens.
Hmmm gotcha
So another question, I'm in the process of making GM tool which just automates certain things for me, like reset player character attributes
So: Assuming all my player characters use the Template Player Character Template, is there any way for me to alter all Player Character's specific value, such as pc_current_hp, through a clickable link/button like in the pic?
Only thing that comes to mind is a macro that collects all actors and then goes through them changing what values are needed.
Can I use Fontawesome icons as Dropdown labels? Looks like it doesn't like that code...
I'm runnin' Mekton Zeta and trying to figure out how to write a function for dice rolls. They explode on a 10 and implode on a 1.
The exploding part is easy, but the imploding has me stumped. My first thought was to use a simple if-then, but say you roll a 10 then a 1, or vice versa, it doesn't work. I'm new at this, so I'm hoping I'm just missing an easy solution.
What do you mean by 'implode'? Never heard of it about dice rolls.
Opposite of exploding, just subtract instead of add.
So if you roll a 1 what exactly happens? I have to admit I'm confused...
It's just like exploding dice, but the other direction. If you roll a 1, roll again and subtract it from the total.
I see. So with a sequence of 10,1 you would just roll again and subtract the rest. It's much like the 10 never happened in the first place. Am I over-simplifying the matter?
Not quite. The ten is still part of the total. The third die could be a different number. So the math could go something like 10 + 1 - 5. And theoretically it can explode and implode infinitely, which is the problem I'm having.
Hm. Well, with a formula you should nest an infinite number of conditionals...which is impossible of course.
A macro is the solution, I think. Thus you could cycle until a number other than 1 or 10 comes up.
That's what I figured. I found a macro for mekton that someone else wrote, but I gotta tweak it and I didn't want to spend time figuring out how macros worked.
I feel you...
You can, anyway, ask in #macro-polo for advise...full of lovely people, just like this channel 😉
I had to do much the same for a Rolemaster open ended rolls, writing a macro, and calling it from the label formula was the only solution. Had a bit of trouble but did eventually get it working, and even got the returned result to work adding it to other variables.
Is there a way for a template for weapons to do something like
Weapon b gains 1d6+1d12 damage
But weapon c gains 1d4+6d2 damage?
Text Field where the player enters the damage?
The text field?
Text Field is one of the Input Components that is available. If you need variable damage Formulas for different weapons, then create a Text Field, that should contain the damage roll formula.
Oh didn't know you could do that
Anyone have advice on making a cooldown on an item that changes based on rounds passing? I'm not sure where to begin
You'd need a WorldScript for that, that reacts on round-changes and updates your items.
Sorry to bother, but has anyone any idea hiw to do this? Thanks in advance.
Don't think so
That is what I thought, but still hoped I could. Thank you very much!
Maybe via CSS?
Hm, I can look into it, thank you.
I've attempted, with no success, to add an icon to a Dropdown List with module CustomCSS using :before like this:
select:before {
display: inline-block;
width: 32px;
height: 32px;
background-image:url('https://fontawesome.com/icons/face-awesome?f=classic&s=solid');
background-repeat: no-repeat;
background-size: 50% 50%;
}
Any idea?
Nope, sorry mate
No problem, pal. I knew I would hit a brickwall trying to add this feature, still I tried 😅
how do I display specific information from an Item into the character sheet when said item is equiped? Like, for example, a weapon, how do I display its attack bonus or its damage once its equiped in the character sheet?
I've alredy made the colums in the item container for each pice of information, I just dont know what formula I have to use
Inside label of item-container ${item.yourkey}$
Okey im here with items again
I'm trying to make weapons, for context.
In my game, weapon damage works similar to DND, each weapon rols a specific die for damage and then adds a character ability like strenght to the damage. How do I make a weapon template that lets me set different damage dies for diferent weapons damage and also lets me add directly a character ability to the damage?
I just want that if a character has a longsword equipped it shows that their longsword makes 1d12+whatever they have in strenght damage
I suggest using a textfield inside the item where you fill the damage dice and use this textfield inside item-container as part of the roll together with the strength.
At last this the way others in this channel have done it…
okey sounds good
Hey everyone, all good?
I need some help!
The formula below is showing an error.
Formula:
${equalText(tipodanobase_hpalvo, 'armas_mundo') ? fetchFromActor('mundo', "fetchFromDynamicTable('armas_mundo', 'key_dado', 'key_atributo', atributodedano_hpalvo)") : "0, 6, 8, 10, 12"}$
Error: expected type of argument in function addScalar (expected: number or Complex or BigNumber or Fraction or Unit or string or boolean, actual: undefined, index: 0)
Could you let me know where I'm going wrong?
Note: "atributodedano_hpalvo" is a key from a spreadsheet list. I'll be showing in the screenshots.
Okey now i am trying to make the damage to be rolled automaticaly when cliked in the character sheet, is there a way to reference the player filled damage dice inside this formula?
if not i dont think it will be a big problem for my players to just roll damage manualy, but im still trying anyway
Are you using atributodedano_hpalvo in the Formula of the component itself? That's a circular dependency. And key_dado is not a key of a column of your shown Dynamic Table
im realy trying but I cant make it work
what am i doing wrong 😭?
What errors do you get?
i am not geting errors
Read the chapter above and you'll understand what is wrong 🙂
instead of procesing the 1d8 it gives me this message
okey 😭
omg
i
am
so
fucking
dumb
thank you
I READ THAT PAGE LIKE 20 TIMES I CANT BELIVE I MADE SUCH A DUMB MISTAKE I-
Im gonna cry
anybody have item or inventory template with weight in CSB? I found in CSB but this dont work,or work with errors
dw, it's easy to miss things at the first time
The example-template has an example with weight of Inventory-Items
i try install it but it make errors or idk. I have 2 containers and items doesnt appear in this, or i something missunderstand
Open the Item Container Config and reselect the corresponding Item Templates. They get lost after the import (that bug will be fixed with the next patch)
Right now, my sheet has a Key called lcHandtoHand that has the dice rolled for damage.
I want to use a Label Roll Message to roll the dice in that key.
What is the syntax?
I tried reading the doc (which are great BTW). But I either didn't understand it, or I missed it, sorry.
Thanks, I'll try that!
CSB have video tutorial or something like that?
Only outdates ones by other persons. No official video tutorials so far
What?
And this one is also relevant: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#315-conditions (see 3rd caveat)
thank you ^^
Hi, quick question, how can I run a Macro from a Label?
Assume the name of the macro is "Reset PC HP"
The idea is I click on this panel link and the macro runs
Thank you!
%{return await game.macros.getName('macroName').execute();}%
Okay so I understand the game.macros.getName('macroname').execute(); part, but what does return and await mean in this context?
(I'm a complete novice at Javascript)
I'd recommend to consult some online-documentations about Javascript:
return: That keyword is directly linked tofunctions, so you should check how functions work.await: That one is directly linked to asynchronous execution. You'll find more underasync / await.
Thanks again!
Hmmm okay so the macro does work nicely
But apparently the actor I binded the macro in is now posting whatever it could retrieve which turns out to be undefined
Will the Actor just post anything on the Label roll message no matter what?
Yeah, just add a %{throw 'Done';}% at the end of the Label Roll Message. The next patch will allow to suppress Chat Message Creation from Label Roll Messages itself.
kein Ding
Okey
thank godd
everything works
the character sheet works perfectly
now
is there a way to automace certain aspects of combat? Such as iniciative rolls, etc?
or is that a macro thing?
I believe that's when it dives into scripting
You can add initiative formula in the settings of CSB
Everything else is on your own
how can i make icon more bigger? in item container panel ?
You can use your own CSS and attach it to the specific item container.
For example
.custom-container-item img {
max-width: 40px;
max-height: 40px;
border-radius: 10px;
}```
How would I get the name of the target?
${#targetName:=fetchFromActor('target',<Name?>,'N/A')}$
Uuuh, its something like coding language?
Uhm... name? 😅
...I'd like to jump off the nearest cliff now thank you...
Lol i don't know why I didn't just try that first. Sorry!
daaamn, i just want make little bigger icons... How i loose moment than i start learning codings languages
anyway-thanks. for help, i try my best
You'll need to learn basic programming concepts anyway if you want to have some sort of automations in CSB. But well... CSS is a bit special, because that usually only defines some styling-rules (no real programming involved)
One last question. I was told that using the ! in front of a conditional formula will display nothing if the data is blank. Is there a way to conditionally write a new column (<tr></td>) or a new line (<br>)? Like I only want a new row in my table in the chat message to display if I'm targeting an individual.
I haven't found a way to do this
That's not accurate. ${!...}$ removes the grey box in the resulting Chat Message (basically removing a <span></span> with background-style or whatever it was).
Ah, so there isn't a way to conditionally add a row to the chat?
Hmmm. My guess would be no because of sanitization. Try out ${!'<br>'}$ and check what it displays.
I think that worked!
I'll have to check this out when I get back home but I think that might do it!
Maybe not!
No worries though. I thought it was a slim chance of working
No 'ifs' without 'else'
Noob help, please. I'm setting up a Number Field in an item template. I only want it visible (it's ranged weapon range) if the weapon is designated as Ranged. Trying to use Advanced configuration Visibility Formula option, but this is giving me some crazy results. "Component will be visible if this formula resolves to true." Trying 'true' or 'false' works fine. But using a key from the item (obbon) doesn't give me expected results. I've tried (no quotes) 'obbon=1', 'obbon===1', 'item.obbon=1', 'item.obbon===1', I've tried other item variables. Even tried ${}$ though it spec. says not to. I seem to be missing something simple.
Add: inputting '3===1' makes the component visible also. Doesn't make sense to me.
I got it to work! My only question is why is it no longer a box that you can click on to look at the formula results?
${!targetName ? '<td>' : ''}$
${!targetName ? 'Target' : ''}$
${!targetName ? '</td>' : ''}$
${!targetName ? '<td>' : ''}$
${!targetName ? targetName : ''}$
${!targetName ? '</td>' : ''}$
${!targetName ? '</tr>' : ''}$```
So I wanna be a bit fancy, when I change the content of the Action dropdown, can I use it to dynamically update the content of the Skill dropdown?
Or is that dipping into the scripting territory?
Try out with ==
Because of ! at the beginning.
You can use the formula-option of the dropdown
Ah! Okay. I'll take it!
Noted, will mess around with it 👀
Yes, that ('==') was it! (also, removed 'item.'). Thanks, Martin.
Hello. In a Dynamic Table, I am trying to hide a checkbox depending on the value of another field on the same raw. I tried a lot of possibilities in the Visibility formula, including sameRow('pC2') - pC2 is the key that should trigger the visibility without success. It is possible or should I forget this idea please ?
There's currently a bug that makes the usage of sameRow() in visibility formulas impossible. This is fixed with the next version.
ok, thank you Martin
do you have an idea of the release date ?
Following along in the FAQ, but still with problems trying to get total inventory weight. Component: Label, Key: Encumbrance, Label text: ${item.Weight}$. On inventory items, Item modifiers: Group: blank, Priority:0, Key: Encumbance, Op:+, Value form: ${Weight}$. I keep getting ERROR in the item component, even when I have no items on the actor.
Label text should be 0
I'm not scheduling the releases, so idk.
Hi guys, all good?
I wanted to make a checkbox ("pop-up") that, when checked, every time there was a roll on the form, the user input would appear. What would be the best way to do this?
I thought about putting a conditional on the rolls that depending on the box would call the input, but would this be a good way to do this?
I'm afraid I've not tried what you seem to be after in that way. when a roll with user options is about to be made, my focus has been to make a macro for it. If you're interested, I could pm you an example.
a macro that is always active?
I'm going to make a macro that makes a comparison with the checkbox?
hmm
Not really my approach... Let's consider someone's about to fire a bow. My macro, "Shoot Bow" would sit in the player's hotbar. They click it. The macro opens a dialog box asking: "Taking the Aim Action? [_]". They check or uncheck the box, and then Shoot Bow works out what the dice formula should be.
I hope I haven't made an incorrect assumption about your need.
I'm afraid I've hit my own brick wall. I've made an item called Kevlar Vest. It took me a min, but I found that the item's Conditional Modifier is limited to adjusting labels containing numeric values (previously tried to adjust a Numeric Input). It works great except I need to know how to apply the change only if it's Equipped checkbox is checked.
As it stands now, it applies just by posessing the item. It's better than nothing, but.....
I think I understand but I don't know if that would be my idea, it would be more "while the box is true, every time the player rolls a pop-up would appear" (it defines the number of advantages or disadvantages of that roll). and if the player "didn't want this pop up appearing all the time, he would uncheck it"
So that's what modifiers are for, interesting (still learning rs)
Sorry about misunderstanding your use-case, then.
no problem 🙂
Yeah, the Configure Modifiers dialogue is brought up by the Configure Item Modifiers button that just barely didn't make it into the top of my screen clipping. 🙂
I thought putting the id of the checkbox in the Group field would do something, but that doesn't seem to be what it's for. 😔
is there a way to do a simple if-else in the delimiter ${ }$?
something like if value x, type a, else b
i could use switchcase but
just wondering if theres alternative
There's no way to make it conditional. You either have an Input Dialog for every Roll or don't.
The ternary-operator: x ? a : b
ohhh neat, ty
You can use a Formula instead ${checkboxKey ? 5 : 0}$. That's why it's called "Value formula" 😅
Thanks Martin. I appreciate the solution.
Wait checking out console, somethings wrong
Um
So apparently, ${pc_luk_bonus > 0 ? '+'.pc_atk_bonus : ''}$ causes this error on the console, no property found
Nevermind, tried a thing
${pc_luk_bonus > 0 ? '+${pc_atk_bonus}$' : ''}$
Have to use another delimited for it to work
Changed the Label text to 0 (zero) but now I'm getting NaN on the character sheet when I add an item. Without the items, I get 0. The item weights show up correctly in a list of items, however.
Then your item modifier values are not numeric (NaN means "Not a number")
Thank you, I'll recheck.
how do you code in an initiative button? I'm trying to add a button on the CS to roll for initiative whenever the player needs to (system requires a roll for initiative each action)
For using the foundry combat round system?
https://gitlab.com/custom-system-builder/custom-system-builder#85-initiative-formula
Looks like this:
No for the character sheet.
There you can only do it like every other roll.
May be project is abandoned by author LinkedFluuuush?
and we need create a fork
because last update from his side was 5 month ago
also no news on ko-fi
Can an item using fetchFromActor() return a key to a dynamic tablel on the actor sheet that can then be referenced within the item using fetchFromDynamicTable()?
No. But you can fetch the entry from the Dynamic Table directly via fetchFromActor()
So would it be: fetchFromActor("attached", fetchFromDynamicTable('key_label_lookup', 'lookup_label', 'lookup_key', specified_key)) ?
You missed double-quotes around the 2nd arg, but yeah
Oh! Okay wasn't sure if the quotes would be needed! Thanks, I'll give it a try
You basically pass a string, which will be handled as a Formula
Thanks!
So @formal goblet how do i make a roll formula roll as a gmroll?
Can this be double-nested? In the item, there is a dynamic table with a dropdown, and when the user changes that dropdown, I want to lookup that dropdown key from the dynamic table lookup table on the actor.
The item-dynamic table is called 'effects and the dropdown column is 'effect_ability' and returns a 3-letter abbreviation such as 'str'. I want to take that and feed it into the actor dynamic table lookup table and pass it as the 'lookup_key' column and return the value in 'lookup_label'
${fetchFromActor("attached","fetchFromDynamicTable('key_label_lookup', 'lookup_label', 'lookup_key', fetchFromDynamicTable('effects', 'effect_ability', 'effect_title', effect_select))","None")}$
This is returning '0' to my display and not even the fallback "None"
You choose this above the Chat-Box, not within the Roll Formula
not sure what yoru getting at, but i suppose it has soemthing to do with the label roll message?
I really need an article about scopes and context...
No, I mean the Chat Box in the lower right corner of the Foundry Application.
If there is something that I can look at that will help, I'm happy to. I do struggle sometimes without concrete examples to go from
Usually Formulas are executed with the execution context of the current sheet. So a Formula in an Actor would normally be executed with the props the Actor.
Now comes the interesting part. Depending on the Formula, the execution-context might change (From Actor to Item and vice versa). An Example:
Imagine we have an Actor and an Item, which both have the property Weight. In the Label of the Item Container, we can either use ${Weight}$ or ${item.Weight}$. The first one returns the Weight-Value of the Actor while the second one returns the Weight-Value of the Item.
We do a similar thing with fetchFromActor(). Usually, formulas are executed with the context of the source-sheet. But in this case, the Formula passed to this function as string will be executed with the context of the target-sheet (the string-part is important, otherwise it would resolve the passed key/function with the context of the source-sheet and the result of it* would be passed and executed with the context of the target-sheet).
It will need some more examples to understand it in depth, but that's the gist.
Hello again. I'm stuck with something and hoping the answer is something easily corrected.
Actor Sheets have a Label with id initFormula.
initFormula contains "${init20s}$ + 1d${initSkill}$".
initFormula is named in the CSB Initiative Settings.
I can't get it to actually Roll.
► (Must be a finite number)
I've tried variations on initFormula(Label)'s content:
${init20s}$ + 1d${initSkill}$
[ ${init20s}$ + 1d${initSkill}$ ]
[[ ${init20s}$ + 1d${initSkill}$ ]]
Dice-so-Nice threw some dice for that last one, but the number wouldn't go into the combat tracker.
The Initiative Formula in the Settings should be [:initFormula:]
I've edited the Settings as shown, I'm also including the Console during the process of Deleting the last Combat, putting Coldtrail into combat mode, and clicking the initiative button.
Is there a known conflict with Combat Tracker Groups?
This makes sense and I've used item.var notation elsewhere. If I understand correctly, in the second 'nested' fetchFromDynamicTable, because that's getting executed by the actor sheet during the first fetchFromDynamicTable(), it needs to have 'item.effects' as the reference to the dynamic table and item.effect_select to reference the dropdown on the item?
${fetchFromActor("attached","fetchFromDynamicTable('key_label_lookup', 'lookup_label', 'lookup_key', fetchFromDynamicTable('item.effects', 'effect_ability', 'effect_title', item.effect_select))","None")}$
...I've also tried stripping the []'s off leaving :initFormula: and it did spaz, but it's error does show the content of initFormula.
(Context: in case of conflict, Combat Tracker Groups is deactivated.)
The content of initFormula should be ${init20s}$ + 1d${initSkill}$. The result should be a blank roll formula like 1d20, nothing more
Yep, sorry, ...leftover troubleshooting tests. The label in the actor template now looks like this, but the problem persists...
The item.-prefix is only available in Labels of Item Containers, so you cannot do this. But there's a little trick: CSB will resolve the innermost keys/functions first before going further to outer ones. And you're able to nest CSB-Formulas:
${fetchFromActor("attached","fetchFromDynamicTable('key_label_lookup', 'lookup_label', 'lookup_key', ${fetchFromDynamicTable('effects', 'effect_ability', 'effect_title', effect_select)}$)","None")}$
(PS: I shortened up the actual input ids for the sake of space and clarity.)
Thank you. I think I've used that before in a different context, so appreciate the reminder!
What do speedInitiative and ongoingInitiative contain?
Oh... you know what, it might not be what they contain, but init20s and speedInitiative get their text from the selected Key of Dropdown Lists. Could there be a Type Mismatch going on?
Not really, only the return value matters. What do they return?
This is where the player can set both speedInitiative and ongoingInitiative... (Skills tab of a Tabbed Panel)…
This is where the resulting content of initFormula is part of Coldtrail's character sheet. (GM tab)
Note, the ►◄'s are new and just for demonstration.
init20s comes from a dropdown that sets either 1d20, 2d20kh1, or 2d20kl1
I think it's faster if you show me the props in the error message. These contain the resolved values
little rusty with the console, tbh... sorry, but I'd select Coldtrails pog then........
Click on the arrow below, where {formula: ...} is
Seems fine for me. What is Combat Tracker Groups doings?
Nothing now that it's disengaged, but it "Folders Up" all the initiatives that are tied.
"► Tom, Dick, Harry ---- 10
► Larry, Moe, Curly ---- 7
Gordon ------------------ 5"
Should work
If it does work with a literal formula, those with different skill dice, or that have Edge, are screwed, but I can test it on mine to see....
It's just a little example. The label text can be anything of course, but the result should always be a blank Roll-Formula. And that seems to be the case in your props.
And the initiative formula in the settings?
Since I directly edited the initFormula label text, the settings are not changed.
A change of this nature shouldn't need a server restart, right?
nope. Do you get any errors when updating a value in the actor?
Through the character sheet or do you mean by macro script?
Just go to the Actor Sheet and change a random value
I can change values flawlessly editing the sheet. I'd need to slap together a macro to test that.
Doesn't matter which
Huh? Why? Go to a number field e.g. and change the number
And you watch the console if any errors pop up while changing something
That's good, but the console matters more
If it doesn't show more errors, that's fine
looks fine. Now the question why the initiative still doesn't resolve
And a very good question, at that.
Can I say I don't feel so bad now that we are confused, not just me? 😅
I hate having to do it, but I think the time has come to disable all mods, test, turn one back on, test again... (cringe)
Do you agree @formal goblet ?
You can try out creating a new blank template (with the init-formula) with a new actor and try out the init-roll with the new actor.
"Must be a finite number"...
Oh my... @formal goblet, you're going to love/hate this. I tried setting a literal formula 1d20 in the settings and this is what's produced in chat:
Wtf?
HOW!?
I wish I knew.... Turning off all mods... Back in a while...
Ok, that last screen clip was from the initiative setting being 1d20 instead of [1d20], that's one mystery solved. 🙂
Multi-dice initiative also checks out [1d20 + 1d4]...
Ok, @formal goblet, I've stayed in completely vanilla Foundry mode and tried the initFormula reference in the settings. Huzzah!!!
At least that works 😅
Time to turn things on slowly and see what mod is stabbing me in the face. When I find it, do you care to know which it is?
yep
My brain hurts now!! I disengaged all mods, turned on 2-4 at a time........ And I've now run out of mods to turn on! I even turned on a couple more that were dormant yesterday!
Weird question: does the key of a dropdown used in a dynamic put in some trailing spaces? I'm getting this to display for this code, where megaattribute returns a 3-4 letter key and no spaces in the actual field. I thought by adding first() that would eliminate any oddness with the array returning multiples)
${concat('m_', mega_attribute, '_mod')}$
This is displaying m_str _mod (With a space before the last _mod)
Where mega_attribute is this:
And 'effects' is a dynamic table with a column 'effect_attribute' that is a dropdown list, with keys that are just 3-4 letter words:
${fetchFromActor('attached','armor')}$
${setPropertyInEntity('attached','armor',('armor + defense'))}$
${#character_current_ap:=fetchFromActor('attached','AP')}$
<br>
Remaining AP: ${setPropertyInEntity('attached','AP','character_current_ap-basic_ap_cost < 0 ? character_current_ap : character_current_ap-basic_ap_cost')}$```
Well it's been a long day and my brain is off. I'm trying to make code for an item that increases armor by the inserted value. Not sure what isn't working
Alternatively I get some sleep and figure it out tomorrow
@formal goblet so i'm trying to set up something weird. so in a Dynamic Table i have a dropdown which is supposed to be referance in a roll formula so it can fetch the value of a given stat (brains, brawns, or bravery). I did not work. How do i make it work.
can i use monk journal and CSB to make custom money system?
Partly, Monks enhanced journal is not compatible with CSB items. And without items, in my opinion money system via monks makes no sense.
maybe i have alternatives for shops?
I sugest use item piles.
I sugest use item piles.
Woks fine for me.
With my own money system.
You have to use ref(sameRow('Stat'))
so something like ${#stat_formula:= ref(sameRow('Stat'))}$?
no, it doesn't add spaces. Check if your key in the dropdown has a space at the end
Through label roll message, how can i actually run a /roll in chat?
It has to be a CSB formula:
https://gitlab.com/custom-system-builder/custom-system-builder#46-add-rolls
ahhh okay
how you find atributes paths?
Hey guys, can I make it so that the following code doesn't display the variable in block?
<td>Roll (${pc_player_dice}$)</td>
I want the 2dfkh2 to be simple text and not a blocked result
I want to call a macro with the bonus from a type of weapon that i get from item.ataque, but it just does not work.
${!...}$
Put quotes around ${}$ where your bonus is
I’m not sure what you mean.
Maybe this?
Yeah First thing. i dont undestand how it work, i try make simple money system. How you found out this? props.gmptown as example or "Props", i saw something about "console" but i dont undestand anything
thanks!
One more question, how would I go around making something like this? An if clause that checks the value of skill_selection_value, and display the html segment inside if conditions are met? (and vice versa)
for use in the following example
Well... That's a tricky one. It's possible to have a final HTML as a result of a Formula, e.g. ${!'<br>'}$, but that would remove the Formula Explanation. Otherwise there are currently no block-level conditionals. But maybe I could add the option to let it resolve from Handlebars
Ahhh alright then I'll work with that constraint for now
I just don't wanna clutter up the roll table on chat with another HTML row that 99% of the time I know won't get used haha
I think I'll just modify my HTML bit so that I dont have to modify the overall HTML structure to use it
You can have full control if you create your own Chat Message from a Script, but that's costly.
I don't think it's worth the headache to do something that simple
I don't wanna overcomplicate my script as is since, last time i did that, I shot myself in the foot by commiting the classic crime of a saying
"If it takes all of your brainpower to develop something, you will not be able to maintain it, because maintaining a feature will always be harder than developing it"
First I defined a purse for the characters in the template sheet. Simple numberfields with keys (my keys mithril, gold,…). Then I placed a numberfield in any item where GM sets the basic price of the item (my key gmptown), which has to be your “Primary” currency so in the item piles settings I set my mark at Gold. Also I placed in every item a numberfield for the amount of pieces in a item stack (my key quantity).
For the right path the console can be used, but I personally find it easier to head to the resources tab of an actors configuration and open the dropdown for attributes. There you find any key of your template.
I basically learned all this from the Item Piles Wiki.
https://fantasycomputer.works/FoundryVTT-ItemPiles/#/
More question, so for this line of code:
<table>
<tbody>
<tr>
<th>Regeneration-Roll for</th>
<th>Life Points & Spirit Points</th>
</tr>
<tr>
<td>Roll for Life Points</td>
<td>${Roll_Life_Points:= [1d20]}$</td>
</tr>
<tr>
<td>Life Points Modifiers</td>
<td>${Life_Points_Dice_Mod + (HasBed ? 3 : 0)}$</td>
</tr>
<tr>
<td>Roll for Spirit Points</td>
<td>${Roll_Spirit_Points:= [1d20]}$</td>
</tr>
<tr>
<td>Spirit Points Modifiers</td>
<td>${Spirit_Points_Dice_Mod + (HasBed ? 3 : 0)}$</td>
</tr>
</tbody>
</table>
<p><strong>You have regenerated ${Life_Points_Total_Regen:= Roll_Life_Points + Life_Points_Dice_Mod}$ Life Points and ${Spirit_Points_Total_Regen:= Roll_Spirit_Points + Spirit_Points_Dice_Mod}$ Spirit Points</strong></p>
${#setPropertyInEntity('self', 'Life_Points_Total', "min(Life_Points_Total + Life_Points_Total_Regen, Life_Points_Max)")}$ ${#setPropertyInEntity('self', 'Spirit_Points_Total', "min(Spirit_Points_Total + Spirit_Points_Total_Regen, Spirit_Points_Max)")}$```
Can I put this example message in Macro format?
like so
how can I use the component Key of a column in an item container?
%{await game.macros.getName('Dobles').execute({bonus: ${ataq}$});}% %{!throw "Done";}%
I'm using it in this macro calling but it sais that it can't compute the key
You cannot reference Item Containers and their Labels currently
Javascript scripting it is LOL
More question, how do i concatenate the content of a variable with a string in the ${}$ delimiter?
e.g:
Before (works okay)
${aoe_flag == true ? fetchFromActor('GM Panel', "aoe_roll_penalty") : ''}$
After (error)
${aoe_flag == true ? '-' . fetchFromActor('GM Panel', "aoe_roll_penalty") . '%' : ''}$
In which language are strings concatenated with .? 😅
Use concat()
Hi folks, I am working on how to select an action out of an array. Using a little help from ChatGPT, along with some cleaning to match csb needs, I have this...
${die:=fetchFromDynamicTable('item.action_table','action_dice')}$
${rowcount:=count(action)}$
${actions:=action.join('|','')}$
${dies:=die.join('|','')}$
${?{actionselect:={"Select Action"|actions}}$
${selectedDie:=dies.split('|').at(action.indexOf(actionselect))}$
${roll:=Roll(selectedDie).roll()}
${!concat(name, ' scores ', roll.total,' hits!')}$```
However, It is not appropriately splitting the 'actions' string to make each action a separate value: it recognizes that there should be X items, but it lists the option as 'ERROR'... Any suggestions?
Try out ${?{actionselect|fetchFromDynamicTable('item.action', 'action_name')}}$
does this work with multiple items in the array? It seems to throw me an error...
This ends up with this prompt:
${#dice:=fetchFromDynamicTable('item.action_table','action_dice')}$
${#rowCount:=count(actions)}$
${#actionOptions:=actions.join('|')}$
${#?{actionSelect:"Select Action"|actionOptions}}$```
Where I'd rather it be a dropdown (i.e. Attack! , Stab!). .split only seems to make the actionOptions throw 2 error values, but appropraitely split (ERROR, ERROR)
@formal goblet Where do you define the dialog box _RegenUserInput in _Template please ?
Is it possible to have an item edit a value in a dynamic table in the attached players sheet?
You do not define it in _Template, it's a separate item-type, so you'd need to create an Item
For this case you use getRefFromDynamicTable() to get the corresponding key (without double-quotes).
Ok, i'll give it a shot. Thanks!
Do you mean like this?
${setPropertyInEntity('attached','getRefFromDynamicTable('status_table','status_number','status_effects','Corroded Armor')','2')}$
You do not surround the 2nd arg with quotes at all
Hmm, I'm not sure what I'm doing wrong now. It doesn't seem to want to work
${setPropertyInEntity('attached',getRefFromDynamicTable('status_table','status_number','status_effects','Corroded Armor'),'2')}$
NVM
Figured out the issue
Thank you so much!
heyo, perhaps this has an answer already but I can't seem to find it. is it not possible to reference attributes from my sheet in the hidden attributes page? here's a screenshot of what i'm working on
both the console logs and setting :level: to a fixed value instead of an attribute reference seems to indicate that this might be the case.
(console says:)
Try level, should work without : :.
But :str: and :dex: work, right?
neither work, even after removing the colons
Same error?
yeah
actually, ref_base gives a different error, which I hadn't noticed because I was focusing on \🆎 first
Take your time to read through this: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
Also, you're missing the delimiters ${}$.
ah, i hadn't found this page, thanks
adding the delimiters was the issue, actually. thanks!
yup, that fixed everything, actually. thanks for the quick and helpful responses everyone!
I thought that was a javascript default or PHP default lol, I tried both . and + but got it
spent a bit of time reading here and i've come to another impasse. the system I'm adapting (KryxRPG) uses 2d10 instead of 1d20, and for advantage/disadvantage, you add another d10 (which can stack to multiple more) and keep either the highest or the lowest two. I've got something here which has a dialogue and works, but with Dice So Nice enabled, it rolls twice the amount of dice, presumably because it's calculating both under the hood instead of only the equation that the switch statement selects. Is there a way around this without writing Javascript? I don't have any experience with that language
${aoe_flag == true ? '-'.concat(fetchFromActor('GM Panel', "aoe_roll_penalty"), '%') : ''}$
This is a bit messy, any neater way to do concat? 😅
Second question, how might I open a specific tab I want (pc_action_tab) when opening a character sheet? This is my code, it opens the character sheet with actor.sheet.render(true) but am lost in opening a specific tab
if (selectedTokens.length > 0) {
let actor = selectedTokens[0].actor;
if (actor) {
actor.sheet.render(true);
} else {
ui.notifications.error("No actor associated with the selected token.");
}
} else {
ui.notifications.error("No token selected.");
}```
Construct the expression of the Roll-Formula before you use it in []. e.g.:
${#roll_formula:= concat(string(2 + amount), 'd10', switchCase(style, 'a', 'kh2', 'kl2'))}$
${[:roll_formula:] + str}$
ahh, i was thinking i might try to do this but didn't know how to approach it. thanks so much!
man being able to evaluate things in :: before rolls gets processed is actually really awesome
I've never tried this before, but I think it's this way: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/sheets/components/TabbedPanel.js?ref_type=heads#L60
You can do concat('-', 'a', 'b', ...), but that's it, not really another way there besides using JS directly.
I have a problem, one of the variable is a fetchFromActor data that will return a number, so using concat() that way returns that error
My code:
${aoe_flag == true ? concat('-', fetchFromActor('GM Panel', "aoe_roll_penalty"), '%') : ''}$
surround with string()
not aoe_flag==true? but aoe_flag?
Thanks!
anybody have guide how make money system?
Item Piles, an Add-on Module for Foundry Virtual Tabletop
Here only on dnd?
No. A lot of systems.
Also can be fully adopted to the CSB
i cant find there information about settings money, or make interface in csb charsheets
can i find example or templates worlds?
Money can be seted as on screenshot. Also you need add variables with currency on your actors list
I have use post above as the base.
And it works
I have add Currency config in the module, and add the same env var to the char list to preserve currency amount. Which are can be accessible in module by path prefix system.props.
@brisk finch
So you are free to use only 1 or 3 or even 100 variations ) for you currencies
i try do as in the screenshots
Hello, I understand that this question comes a lot, but could anyone point me in a direction? How can I show the dice rolled (is a keep higher roll in this case) results in a "formatted way"?
can you show what exactly you write in this panels? or it item container?
Unfortunately using this example requires some functions from import Tab from './Tab.js'; which macro script doesn't have access to, any other ways I could open up character sheet and open up the specific tab I want?
how are you guys making features sections for your systems? I've yet to decide on an approach for myself, but i'm looking for a relatively simple implementation that won't require a ton of manual data entry to port over the hundreds of feats and traits from the system i'm adapting (this is just for one game I'm running, nothing I plan to publish at the moment). I was thinking about using item containers but it seems like you can't add them from the sheet, and I don't expect my players to be foundry-savvy enough to add their own features when they level up. any clever solutions?
Does item piles have a quantity? i mean can i make quantity in item not in item-pile config?
I was looking to a read only feature and came to this issue on Gitlab:
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/212
Is anyone working on this? How people are solving this problem for long campaigns?
can anybody give me template to custom economy?
where i can find a world on CSB? or maybe somebody can send it?
Hey guys! Since CSB apparently doesn't support Combat Utility Belt (and in extension CLT as its the forked variant), how does CSB handle custom status effects? I'd like to add lots of custom statuses.
Hi, I'm not sure if this is related to CSB, but for Core Expanded Settings, I'm not sure how I should disable the core Status Effects? I clicked the checkbox off but reopening the setting constantly leaves it checked
It containers work great for sorting things but I am unclear on what you mean by but it seems like you can't add them from the sheet. I am not sure if this answers your question but I have imported a lot of items using Datatool box module.
${roll:=[:dice:]}$
${result:=roll+ref(AcrobaticTrait)}$
Where AcrobaticsTrait is the name of the Pull down displaying "Str"
This assumes you strength number box is called "Str"
FYI - the roll and result are separate variables so you can add message stuff in the Chat
I managed to fix the problem, the code looks like this.
Thanks man. I got this figured out a long time ago.
Hi, there is a way to translate a module written for CSB ?
I guess what I was saying is that even beyond players, for the sake of quick editing and handling a lot of data. if I were to create a statblock and I wanted to add a feature to that monster that's specific to that monster, is it possible to create an item as a feature on that statblock without creating an entry in the compendium just for that one monster's ability? aside from feeling a bit out of the way, I think it might clog up my compendia a bit
why i cant sell or change coins in item coinainer? i want change 10 copper to 1 silver but traders dont do it. i try many things...
this is not straight forward. i was told this has to be done with a service function (for that you need to write a macro)
if i want sell/exchange things i need write a macro?
no this is just for currency conversion
so if you have e.g. silver and gold 10:1 -> you cant just exchange currency (as far as i understood) you need to setup a service for that and services need a macro
oh.ok than,can i sell 10 copper to buy 1 silver? and sell 1 silver to buy 10 copper?
i have this, but i dont have this as seller
with a service this should be possible
in the end all you have to do is:
- give the service a price (this will be reduced from the actor - e.g. "sell 1 silver buy 10 copper" = price of service = 1 silver)
- attach a macro to the service (here you have to do the logic to add the desired thing to the actor - e.g. increase copper quantity by 10)
it means i cant make item "copper coin" as currency ? traders cant buy coin and exchange it with another coin? i cant just sell 10 copper to buy 1 silver?
Hello everyone, I have an issue with the equalText() function while using the ternary operation (condition). As I was confused I have tried something very basic. But I don't understand the result:
it always show 'not equal' even with this simple example
Does someone could please explain me what I am doing wrong here ?
you can certainly try but as far as i know this wont work
have you tried adding == true or == false to your conditionals
i dont think CSB's delimiter automatically defaults a true variable to be true without a comparing operator
anyone know how i have to change "changeQuantity" for this to work?
%{let changeQuantity = isLightOn ? 0 : 1
${setPropertyInEntity('item','quantity',"item.quantity-changeQuantity ")}$}%
console says: Error: undefined. Uncomputable token changeQuantity
It has to be:
${equalText('yes', 'yes')?'equal':'nor equal'}$
The T in big is mandatory and the % are wrong.
Thank you for the answer. It is working without a comparing operator but I made a mistake in the function itself. @vagrant hollow just answered me and it works now
Great thank you very much !
Does custom system builder has any this() equivalent? For use below
I think there are two possibilities here. One is to just have a "abilities" rich text box where you can type in the monsters unique abilities. Alternately, you could have an item called "Generic Ability" that you drop on to the actor and then re-name it on the actor.
Hi again, I'm looking for a way to translate a module written for CSB. Any hint?
Substitute this for label's key.
You might want to look into localization section of FoundryVTT
Hello. The system I'm making allows the player to use multiple skills. Each skill adds a die to their dice pool depending on the skill's rank. Since there's a wide variety of skills, I thought I'd make them all into equippableItems that can be dragged and dropped into the character sheet. But I'm still fairly new to understanding how items work. I've made them and have been able to get them into the character sheet, but how would I go about checking which ones the player chooses to use?
Hi guys
I would like to do a check, depending on the marked value, I would get an id and change it.
I thought about the "radio button" but it could be a dropdown list, basically the character can be efficient(+20%(min +1)), deficient(-20%(min -1)) or normal in that skill.
How would be the better way to do that?
the former was something that I was originally gonna go for, but the latter is quite clever actually. I might use that instead, thanks a bunch!
is the nesting/syntax wrong here @formal goblet ?
A dropdown could be useful, setting labels to 'deficiente,normal,eficiente' and the keys to '-1,0,1' so that you can obtain the modofier buy just calling the dropdown key.
Yeah, the innermost Formula is always executed first. And you cannot pass variables with just a local definition and initialization. ${setPropertyInEntity('item','quantity',"item.quantity - (isLightOn ? 0 : 1)")}$ is probably enough for you
"Select 1 out of n options" should always be a Dropdown or Radio Button, because that's what they do
It does 😅. It even can check if something is truthy (truthy is not the same as true)
then I change the value using setPropertyInEntity()?
You have to click "Modify Custom" to save the changes.
What? Why? You can have the Label be dependent on the selection. A derived value is not the same as a persisted value
this is the whole thing:
%{let quantity = ${item.quantity}$;
if (quantity>0){let token = canvas.tokens.placeables.find(t => t.name === entity.entity.name);
let isLightOn = token.document.light.dim > 0 || token.document.light.bright > 0;
await token.document.update({
'light.dim': isLightOn ? 0 : 10,
'light.bright': isLightOn ? 0 : 5
});
${setPropertyInEntity('item','quantity',"item.quantity - (isLightOn ? 0 : 1)")}$};}%
%{throw 'Done';}%
this is the error: Error: undefined. Uncomputable token isLightOn
if this is not possible with CSB+JS i'll just have to do it in pure JS
With let you have to use :=, not =.
Well, yeah. Probably better better to update the prop in JS directly.
You're wrong. We're in the context of a Script
Oh my, you're right. My bad 😅
as i see from some testing i cant really get the item then? passing the item errors because its an object 🤔
aaa I think I understand, make this comparison within the bonus label, depending on the dropdown list
You know that linkedEntity is a thing?
what would be the difference between a derived and persistent value?
not until now 😮
did everything till now in JS 😅
this helps a lot 😄
- Derived value: In most cases a Formula. Derived values are dependent on other values (be it persisted or other derived values). These are calculated automatically and players cannot change the value manually.
- Persisted value: Can only be in Input Components such as NumberFields, TextFields, Checkboxes, Dropdowns, etc... These are values, which can be changed from players. They cannot contain Formulas.
well, yes, but I wanted to know if the module supports an equivalent of this(), just for neat code really 🙏
nope
alright, thanks for the clarification!
aaaah that explains a lot lol, thanks for the detailed explanation
Click on the status effect, deactivate it, save it
Ooooooh I see
So on the topic of modules right, I saw that Combat Utility Belt is noted to break when using CSB? I'm assuming that Condition Lab and Triggler also breaks when using with CSB since its a fork of CUB
Is there any plans in the future to make Condition Lab compatible with CSB?
Hard to say. We don't know in which direction we'll go with active effects
Hmmm alright in that case, if say I were to use Condition Lab & Triggler with CSB, is it just CSB's Conditional Modifier feature that will break or just about everything?
If that's too broad of a question that's ok, I'll test and try out things
It'll break recalculation of sheets, because the module directly modifies the statuses-collection. But you can install it and check the error by yourself.
The error itself is probably fixable, but Condition Lab wouldn't work redardless
Ah that explains why the value of character sheet just duplicates everytime I apply one status
In that case, what's CSB's local solution for custom status effects?
Or at the very least, an active effect module that may work with CSB
There's none currently.
That's Custom Settings Expanded
Ahhh hmmm alright then I'll start from there and see what I can do
These might also be helpful: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Scripts-for-Active-Effects
Thanks for the pointers! I'm also gonna download the Fabula Ultima sheet since IIRC the game system does have status effects in it
Maybe also toy around with Monk's Little Details...
Is there any way to modify a label, an id that is already a formula inside it? for example a buff that increases the strength attribute by 2
const {visionMode} = token.document.sight;
await token.document.updateVisionMode(visionMode === "basic" ? "lightAmplification": "basic")
await token.document.update({
sight:{
range: visionMode === "basic" ? 20: 0,
angle: visionMode === "basic" ? 60: 0
}
});
This is what I have representing night vision equipment and it works great.
How exactly do I change the effect to grainy monochrome to represent basic thermal sight?
Hey. Just wanna know if it's possible to do this with items.
I am not sure I get you question. Do you need a printout showing from witch item a modifier is coming from?
Yes its possible. I just finished (i think) setting up a Genesys sheet, which works the same way. The exact implementation will depend on your game.
I'm looking for a way to "select" the items so that when they're selected, they add to a variable. Here's an example I did without the items.
Are they rolling from the skill item or are they rolling from elsewhere on the character sheet? The locationof the "roll" button
They roll from somewhere else on the sheet. I'd like for them to be able to select the skill or skills they use. I think I can figure out how to add dice myself, but I'm not sure if adding a checkbox to item containers is possible.
Do the ranks add to the skill check (ie 1d20 + ranks in skill).
If you mean you want to dynamically add multiple values from one single table depending on which you checked, to one final variable, fetchFromDynamicTable() comes to mind
Not if their using items as skills
Unless you need to remove skills, a dynamic table might work best. Perhaps just set it up so that each skill in the table has its own roll button. Is there a reason this approach won't work? The only reason to have items as skills if you have to store a lot of information on the item or you need them to be temporary such in a universal system where skills may change to reflect setting flavor.
Speaking of skills, what format do you guys build a skill in in CSB
I've recently just finished developing the basic character variables, stats, bonuses and basic actions
Currently looking to build their abilities
Skills vary based on mechanics. It depends how how the skills affect the sheet. In some cases they work better as items and in some cases they work better in a dynamic table. What do you need to accomplish with your skills?
Think JRPG abilities I suppose
No regards to enemy positioning like in normal DnD
Just select a target and wham away with selected abilities
One ability for 1-2 type of actions only
I.e: singletarget or AoE
I am not familiar with JRPGs. What your describing is not skills, its combat. Skills (usually) affect dice rolls in some capacity, whether its an attack or a persuasion check. Combat relates to locations on the board and how important hex counting is.
Oh if that's the skill you meant I've also already developed em as a dynamic table complete with drop down and everything
I was responding to this, where you referenced skills. Were you meaning to reference token effects (stunned, paralyzed, bleeding, etc) or something else?
Hmm not exactly but let's go with that anyway since I'm curious, I'll tweak my question a bit
How do you handle custom token effects in CSB?
Let's say, Wet status
Or Hungry status
If you use a different module that's fine too
✋
In simplest form, I use a condition on the token to do that. If it adds a mechanical effect, I have items setup to modify skills and attributes, so I create an item called "Exhausted" with a -2 penalty to all skills and drop it on the actor. If you mean a more visual affect, such as actually appearing wet, there are modules that apply affects to tokens.
Send pics of your example?
I don't think I understand the whole "dropping on the actor thing", is that CSB specific or your homebrew system specific?
Either way could work. I just thought having them as drag-and-drop items would make it easier for them when they gain new skills.
I want to modify the strength modifier but outside of it, like plus some number for example
Simplest way is to simply add a + to your strength modifier with the number or variable you want, assuming if you are adding a variable, the variable is defaulted to 0, do you need something more specific?
Could I do this entirely from another label, like updating a variable, like mod_str = (new value), or mod_str.set(new value)?
You can put items on to actors, like a sword, armor, lock picks, etc. This is native to Foundry. Items in CSB can pass (only) numeric value to the actor. This means you can have a +2 sword that improves the combat skill.
Ooooh I didn't know that, I'm gonna mess around a bit with it
hmm so it would be by item, I haven't gotten to that part yet, I think I understand, thanks
If you mean your source of variable is from another label, then yes, CSB constantly checks and recalculate every sheets (to my knowledge) for every value change detected
CMIIW, I'm only a week into CSB
🤔
If the number of skills in your game is fixed, then perhaps having all skills on the character at one time would be easiest. This is especially true if they could have items that enhance a skill. Plus they may need to roll a skill they aren't trained in. Predefining all your skills makes defining an amulet of +1 perception much easier.
Question, can I make it so that one piece of equipment can only be used on one character? Atm I can use the same weapon on two characters
Not achievable via CSB, but I guess a WorldScript can help out
do inputs or buttons cause a jump to the top for anyone else or is this intended?
i have a long sheet, so when there are inputs on a field and one of my players or i add something in a text box, the value is taken but the sheet completely jumps to the very top.
I've got another question. Is it possible to get a string from a dynamic table? I tried this, but it didn't work out the way I thought it would. Nothing happens. tableText is a text field.
%{ const selectRandom = [${fetchFromDynamicTable('dynamicTable','tableText')}$];}%
Question for Item Modifier, can I use something like ${stat_to_modify}$ in the key section? I want to dynamically update which stat the item is boosting
Second question, does Item Modifier from template not get inherited to any new items? I've made a template complete with the item modifier and found that all the items ive made doesn't have the Item Modifier the template had
Not intended, but idk how to fix that
... = '${...}$'.split(',');
Y
Y. You just won't see them in the modifiers section of the item
Hi guys, Is there any way to complete this faster?
It's basically the same drop down list for the entire table (just changing the id)
CTRL + Drag
😮
ohhh thats why the modifiers got doubled, i had the modifier on both the item and the template
Third question, is there any trick for item modifier to draw from all contents of a dynamic table?
Like for example this is the content of the dynamic table (ignore that it looks like normal table)
is this bad? (the expected result happened)
I managed to correct it, it was what still needed to be filled in with the values
Yo what up lads, lasses, and whomever, I am back with another question.
Basically, how would one set the properties of multiple entities at the same time? Such as in an AOE spell.
Below is some code that applies damage:
${setPropertyInEntity('target','This_is_where_damage_goes','Damage_amount')}$
The problem I encounter, is that only the first actor targeted is applied the damage and it seems as if 'target' can only handle one target at a time. Anyone know a solution or workaround?
Thanks.
Heya! Only thing I can think of is a macro where you collect all targeted actors and then apply that bit of code to each of them, much like for each.
Nope
In the key, remove ${} $ from the key you are targeting on the sheet.
@formal goblet how do i set up a formular so it can have exploding die?
Roll-Formulas are passed directly to the Foundry Roll API: https://foundryvtt.com/article/dice-modifiers/
The official website and community for Foundry Virtual Tabletop.
A bit of a hardcoded table it is, thanks 🤔
${}$ is used to dynamically adjust what key the item modifier will modify the character sheet with, I specifically need that since it can just be any variable
That is a neat idea. That approach didn't occur me. I wish I could use that but my requirements are too complicated.
Hi there! Please excuse me, I'm pretty new to foundry and custom system builder. How can I create macros that interact with the character sheet in custom system builder? For example, how can I create a macro that allows to change the hit point value without opening the character sheet?
That will require javascript. The exact approach will depend on whether you want to affect an actor by name, perhaps from a dropdown in a dialog, or via the selected token on the canvas, or perhaps identify/target them in some other capacity.
Heres a question for you talented masterminds out there, Im working on my players character sheets and would like to add a wildshape page for my druid character. Is there a way i can make it so only she can see it? just so it doesnt clutter up players sheets who dont need it ? If not its not an issue. just thought it would be cool.
A Tab with a visibility formula then?
I'm unsure how to do a visibility formula, I tried setting the min permissions to see the tab but it didnt have the desired effect. Is that formula available on the doc ?
Can i just use " player_Name == Shyla " or is it more complex than that ?
Is there a way to get rid of the symbol in front?
If you want to set the name you could try ${setPropertyInEntity('selected','name','Shyla'}$
Not sure, but it won't hurt 😉
Nvm...did not read the full chat 🤦🏻♂️
What about just name==Shyla?
I'll give that a try. Thank you. i got it working by making a panel only the DM can see and i'm filling that up with check boxes and stuff to enable little options like this. but there are still some things i'd like to just have on by default based on who is who.
In the worst case you could set-up one role for each player and use that for visibility purposes.
Not sure you can set-up roles beyound those available.
That was my next path if i couldnt get it working! haha.
Heres another question, i have a button for long rest that refill players Hitdice based on a formula. it works. but it sometimes exceeds the max value set by the number field. if the field gets clicked on it corrects it but leaves it wrong until then. is there like a refresh command that i could run after my math so it makes sure it doesnt exceed ?
Something like min(resetVal,maxVal).
${setPropertyInEntity('self', 'VE_total', 'VE_Max - AttunementDrain_total')}$
${setPropertyInEntity('self', 'hd_Aval', 'hd_Aval + ((player_lvl +1 )/2)')}$
${setPropertyInEntity('self', 'Temp_Health', 0)}$
${setPropertyInEntity('self', 'hd_Aval', 'min(resetVal,maxVal)'}$
so something like this ?
Yup, should work.
No joy sadly, I tried doing a switch case but those are new to me( like all of this. haha. )
switchCase(hd_Aval, 'hd_Aval > player_lvl+1', player_lvl+1)
It works like this:
switchCase(parameter,firstPossibleValue,optionIfFirstPossibleValue,secondPossibleValue,optionIfSecondPossibleValue...and so on)
Example:
pVal can be 0,1,2 and you want rVal to change depending on pVal.
switchCase(pVal,'0','rVal1','1','rVal2','2','rVal3')
Ok, so i think that makes sense. parameter is what im checking, next is a possible returned value and the third is what to do if it is that value. then repeat ? So in mine im checking the value of hd_aval, seeing it its greater than player level +1 and if so changing its value to its max. I have it printing out the requested value but not changing it now.
Put the formula in setPropertyInEntity('self','hd_aval',formula) and it should work.
And the last param of the formula is without hd_aval=.
Are you familiar with the 1984 pop hit "Holding out for a Hero" by Bonnie Tyler ? You are the hero she sings about...
worked like a charm. Thank you for helping a dummy like me figure it out,
I know that song, but I'm no hero. I just like to help 😉
Glad to hear that, keep up the good work 👍🏻
Bedtime for me know...you all take care 😉
You too. Thanks again
Safe the roll in a variable and then reference the variable:
${roll:= [1d100]}$
${roll}$
Hello there! I want to add a checkbox that when checked will add a die to the roll, what's the best way to do this?
${dices:= 2 + (checkboxKey ? 1 : 0)}$
${[:dices:d10]}$
will that affect every roll, or do I need to enter that formula into every stat with a dice roll?
That has to be handled by every Formula
Well, there's no global setting for that
Because every Label Roll Message is handled individually.
that's what I thought, but I was hoping to be wrong
how would you have it subtract a die?
Any ideas on how I can make an active effect reduce actor HP every turn, like say, Poison? Current effect modifiers only changes character variable temporarily
I wrote a world script for that.
I dont think there is any other way to do this.
I am using the module active-token-effects an set the effect via a macro that is then triggered every round.
// Token selections, can select and apply effect on multiple tokens
let selected = canvas.tokens.controlled;
if (selected.length === 0) {
ui.notifications.warn("Markiere mindestens ein Token !");
} else {
selected.forEach(async token => {
// Effect settings
let effectData = {
name: "blutung",
icon: "icons/svg/blood.svg",
tint: "#FF0000",
disabled: false,
flags: { core: { statusId: "blutung" } }
};
// Apply the effect to tokens
let activeEffect = await token.actor.createEmbeddedDocuments("ActiveEffect", [effectData]);
// Script when the effect is created
ui.notifications.warn("Blutungseffect erzeugt");
// Special triggering script on specifics events (must have Effect Macro)
activeEffect.forEach(async effect => {
// Every turn end
effect.setFlag('effectmacro', 'onTurnStart.script', `
let currentPV = actor.system.props.TempHits;
let dropPV = token.actor.appliedEffects.find(e => e.name === 'blutung')?.flags.statuscounter.counter.value ?? 0;
let newPV = Math.max(currentPV - dropPV, 0);
token.actor.update({"system.props.TempHits": newPV});
let tokenName = token.name;
ui.notifications.info(dropPV + " Blutungen abgezogen von " + tokenName);
`);
});
});
}
Can you maybe please share your world script?
I am very interested in a better solution 🙏
I can get back to you later. But be warned implementation will be custom for your own system
Hello again, any way to tell this line of code to drop the decimal / only return an int
${setPropertyInEntity('self', 'hd_Aval', "min(hd_Aval + ((player_lvl +1 )/2), player_lvl +1)")}$
round() should do the trick, otherwise floor() round down or ceil() to round up
so like this
${setPropertyInEntity('self', 'hd_Aval', round("min(hd_Aval + ((player_lvl +1 )/2), player_lvl +1)"))}$
?
Should be. My memory is not that good 😅
You should add it within "", round() doesn't work with strings 😅
I’m confused. Are my “ in the wrong place ? I have them in round formula. Should I wrap “round()”
sent you a DM
Right
Alrighty. I’m on lunch break so I’ll try that when I get back.
Hello, I've read up on Item Modifiers a few times and I need a bit of help understanding.
Currently I have a dynamic table in the inventory tab that allows the player to customize their weapons
The in their main tab they have another dynamic table that lets them select a weapon from the drop down and uses that data to calculate the attack and damage.
I would love to use items for this but I was told that you can't actually get the information stored inside of the item. So If I setup fields that show the damage or the range I'm not able to reference that when calculating the attack or damage, correct?
Is there another way to leverage this? Can I create item modifiers that use the information inside the item (like damage and attack type)? Or is this not somethihng that's setup for this type of thing?
Uhm, I'll clarify a few things:
- Items are directly attached to Actors, so it's possible to access all Items of an Actor via
%{entity.items}%(only via Script-Expressions, not CSB-Formulas) - Item Containers (and their columns) on the other hand are not referenceable, because they don't have own props (like Dynamic Tables), so
fetchFromDynamicTable()doesn't work on Item Containers. - Item Containers have access to both Actor and Item data
- Item Modifiers are able to push information from an Item to the Actor (be it setting a Label to a specific value of an Item or doing simple math). So it's possible e.g. to accumulate the Weight of all Inventory Items in the Label of an Actor.
Hmmm if effect object is using the ActiveEffect object and you have Effect Macro installed, then Condition Lab & Triggler has surprisingly been very helpful for my purposes
The CSB incompatibility lists CUB which Condition Lab & Triggler is a fork of, but it doesnt exactly cause nuclear bomb on your game system
Oh, I see! So I might just be able to accomplish what I need with this information! Is there anywhere I can go to read up on %{entity.items}%?
I have managed to create custom statuses pretty fine, the macro for on-apply and on-remove runs pretty well
In the active effect screen you can adjust the status tooltip just fine, but you just cannot interact with anything that directly changes the character's parameters as it is in my experience, it wont break your game but the status will apply twice if you do that
And yes, that includes the Effect Macro option that gets added in CLT Active Effect screen, you cannot use this
However you can circumvent it by running a macro that applies the EffectMacro flags of the status effect to your own desire
Example content of what's inside the macro that flags the EffectMacro addition:
const dot_effect = token.actor.effects.find(effect => effect.name === "Burn");
dot_effect.setFlag('effectmacro', 'onRoundStart.script', 'ui.notifications.warn("onRoundStart")');```
So Condition Lab & Triggler (1.5.4) while is still incompatible with Custom System Builder (3.0.0), it's not a 100% nuke and there's a few workarounds and this is what I confirmed to be possible in the CLT UI:
- Creation of custom statuses (and an UI to manage it)
- Changing the tooltip of custom statuses
- Running a macro everytime a status is applied or not applied
- [Effect Macro] Scripts from EffectMacro can automatically be applied to any effects that gets applied via macro from 3), see #1037072885044477962 message for example
What you should not do
- Do not touch anything in CLT that directly tweaks player parameter, this will not work
- If you've already done 1), and if your Conditional Modifier List component breaks down, see https://gitlab.com/custom-system-builder/custom-system-builder/#313-conditional-modifier-list for how to fix it
What I haven't tried
- Triggler system, did not see the need to use this in my system, so I have not poked around with it
Thought I'd share my findings here 🙏
Okay perfect! I am still struggling to figure out how to use entity.items though. I get the overall concept but I'll need to use the name of the item, correct? Since I can't reference the Item container or the columns I'm not sure how to do this?
It depends where you need the information of the Item
@formal goblet Thanks for the pointers with this link btw https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Scripts-for-Active-Effects/

np
My idea is to use the attack button right here in the item container using the ```%{entity.item}%```` to get the information from the item for the damage and bonuses to attack. I'm assuming, however I'll have to dig through the character data to get to this and I'm assuming the name of the items is one of the things I'd need to levereage to get that information?
I'm I completely off base?
Item Container already has access on Item-props. Just use ${item.damage}$ or something like this
nah, you only need that outside of Item Containers, if you don't want to use Item Modifiers
But it's also not bad to know the internal data structure
Thank you so much. That was way simpler than I was making it out to be. I was able to get it going!
Sorry, one last question! I was able to get it to display the dice with ${item.blasterDamage}$ but when I tried to add [] inside it stopped working. Is there a way to get it to roll? Do I need to convert it to a number first?
You probably forgot :: around the key
[1d20] is valid, [Strength] is not
I did not have the :: around the key. It worked! Thank you!
Hey guys, so I'm running Effect Macros on status DoT, think there's a neater way to do this script?
const effect = token.actor.effects.find(effect => effect.name === "Burn");
effect.setFlag('effectmacro', 'onRoundStart.script', `
let burn_stacks = token.actor.appliedEffects.find(effect => effect.name === "Burn")?.duration.remaining ?? 0;
let fire_damage = Math.min(burn_stacks, 4);
fire_damage = fire_damage * token.actor.system.props.fire_multiplier * token.actor.system.props.magic_multiplier;
fire_damage = Math.round(fire_damage);
let current_hp = token.actor.system.props.hp_value;
let new_hp = current_hp - fire_damage;
new_hp = Math.min(new_hp, token.actor.system.props.hp_max);
token.actor.update({"system.props.hp_value": new_hp});
console.log("Burn Stacks: " + burn_stacks, "Burn Damage: " + fire_damage, "Current HP: " + current_hp, "New HP: " + new_hp);
`);```
The third parameter of the setFlag i can already tell is going to be unscalable since all of the formula is in the form of hard strings, so I was wondering if anyone has any idea can simplify the code?
Is there a way to show the maximum value along side a number field like this?
Probably doable with some CSS, but don't ask me how 😅
Ah I was afraid of that lol. I was trying to be lazy, thanks though lol.
Yeah, things are a bit different compared to Sandbox
Yeah, each has things I like. This is the first time I've used CSB, feels good so far.
Good to know. Well, it was designed to be a bit beginner-friendly without loosing the options for extensions
Dunno, maybe call a Macro in a Compendium and transfer the main-part in there? (If it's async, otherwise...)
I'm actually in the middle of working on a promising solution, will post my results later
👌
It's slightly gross but better than having a big logic be written on a hardstring
At least it's a string literal, normal string would be nightmare.
Oh yeah lol
I'd actually use an IDE and copy the code when finished
I already gave up on the normal macro text lol
Still WIP
Using a proper text editor for this one
Good boy
is there a way to write this to subtract a die? ${dices:= 2 + (checkboxKey ? 1 : 0)}$
${[:dices:d10]}$. I've tried to figure it out but haven't gotten it to work
Uhm, - instead of +? I mean, where's the issue?
Can you post the full Formula? Might be an issue somewhere else
for the original roll: ${[2d6+:poi_base+poi_bonus+wpn_skill+wpn_mod:]}$
additional dice: ${dices:= + (Dice_1 ? 1 : 0)}$
${[:dices:d6]}$
${dices:= + (Dice_2 ? 1 : 0)}$
${[:dices:d6]}$
${dices:= + (Dice_3 ? 1 : 0)}$
${[:dices:d6]}$
${dices:= + (Dice_4 ? 1 : 0)}$
${[:dices:d6]}$
and these work just fine
${-dices:= - (Dice_5 ? -1 : 0)}$
${[:dices:d6]}$
the one I can't get to work
- * - = +...
that was me just trying to figure out if I was putting it in wrong
${dices:= - (Dice_5 ? 1 : 0)}$
${[:dices:d6]}$ this way adds one
Well, idk if reassigning a local variable works how you're thinking. You should change it so that you have only 1 dices:= in the whole Formula.
even with 4 checkboxes for an additional die?
Yeah
how would that work with just one?
${dices:= (checkbox1 ? 1 : 0) + (checkbox2 ? 1 : 0) + ...}$
${dices:= (Dice_1 ? 1 : 0)+ (Dice_2 ? 1 : 0) + (Dice_3 ? 1 : 0) + (Dice_4 ? 1 : 0) - (Dice_5 ? 1 : 0)}$
${[:dices:d6]}$
Dice_5 still adds one
You sure about that? Are you using the right component key?
Dice_5 is the key for the checkbox
wait
so it shows the 3 dice in Dice So Nice! But subtracting the value of one of them
You should also have only one Roll-Formula [] at the end
Could someone show me a basic macro script that would work for rolling, say a 1d100 that triggers a Dice So Nice dice roll while printing to chat and console? ChatGPT keeps giving me answers that seem to reference now-defunct code.
How would I call on another actor for a dynamic table key?
I have the key and the column but I'm not sure how to target something not on the current PC's sheet
alright, bear with me I'm trying my best:
${[2d6+(poi_base+poi_bonus+wpn_skill+wpn_mod) +(cripagi ? -2 : 0) + dices:= (Dice_1 ? 1 : 0)+ (Dice_2 ? 1 : 0) + (Dice_3 ? 1 : 0) + (Dice_4 ? 1 : 0) - (Dice_5 ? 1 : 0) :dices:d6]}$
is this what you meant?
This should be the general structure
well I messed up somewhere, nothing works
This one, not your current one: #1037072885044477962 message. That should be your general structure
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
great, thanks so much for your assistance!
So I made a minimodule to help me with this LOL
Finally done
const dot_params = {
effect_name_applied: "Burn",
element_type: "fire",
damage_type: "magic",
damage_per_dot_stack: 1,
dot_damage_cap: 4
};
FTStatusHelper.countdownDotEffect(token, dot_params);```
The actual code in the minimodule
Basically turning a whole function into a string before feeding it into effect.setFlag()
It's still kinda messy code-wise but
I can just shove the code mess to my helper module and just adjust the parameter in the macro manually

all the boxes work, but this is what shows up after everything is rolled. Is there a way to get it to just show the final result?
@brittle moth @formal goblet Is there a way to put item quantity and a way to adding a generic value (for example a number for armor related to the item i put in the container) in the "Item Container"?
I wanted to put a quantity on the "Balisong" item but in the guide i didn't find something about it
Thank you.
In addition to this, are you able to use setPropertyEntity inside an item? I'm trying to track ammo but i'm not sure if I can
${#...}$ will hide the resulting Chat Message
You can reference the props of Items in Item Containers with ${item.key}$
Another question. Is it possible to make a script that adds a new row to a dynamic table and then auto-fill it with values?
With fetchFromActor() in the Formula-section.
Hmmmm so I've made Effect Macro work, but how did you resolve the problem of having two separate dot statuses?
Yeah, you can
I have two DoT statuses, burn and poison
I did
${#equalText(attackType,'Blasters') ? ${setPropertyInEntity('self',item.ammoCurrent,item.ammoCurrent -ammoExpended,0)}$ : 'N/A'}$
Problem is, if I apply both DoT status on a token, when the Effect Macro runs, they run async and one of the DoT status cannibalize each other
Await the update?
So instead of two DoT statuses adding up, they instead randomly caniballize each other
Await?
Yeah, await is a thing. Never heared of async/await?
I also tried ${setPropertyInEntity('self',item.ammoCurrent, -1,0)}$ with no luck
I've only recently gotten into JavaScript, I'm not too familiar with the async architecture
I just know they run independently
It's actually the simplest of all languages, because Javascript is single-threaded. You just write await at the start of an async-call. The programm will wait until the task is finished before going further.
Basically just await actor.update()
Hooooo I will attempt that then
${setPropertyInEntity('self', 'ammoCurrent', "ammoCurrent - 1")}$
Ohhh so does that mean await just forces everything to stop until the task is done?
Anche the quantity? For example 2 balisong in one entity? Now i Need to put 2 balisong in the item container
Just create a Number Field in the Item-Template with the key quantity. You basically handle quantity on your own.
Ehhh... I'd need a look at the implementation of the Dynamic Table Component 😅
Oh ok, i thought It could be made automatically, thank you. 👍👍
Should be similar to this (you can ignore the truthy if-part): https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/sheets/components/DynamicTable.js?ref_type=heads#L383
Oh my goodness it works, thanks!
Perfect, Thx!
I don't understand. Maybe this is too advanced for me. 😅
@formal goblet Any ways to dynamically change the name of the item title or is that not possible?
That's a Text Field. No derived values possible.
i don't quite get why you would use the regex conversion - can you please explain why this is necessary?
wouldn't somthing like this work for you (using ${} in your string)?
let effect_name_applied = "Burn";
let string = `"The effect name is: ${effect_name_applied}"`
Thank you! I figured it out! It was ${setPropertyInEntity('item', 'ammoCurrent', "item.ammoCurrent - 1")}$
trying to use some javascript to build a damage formula with dice so nice for some damage types, but I can't for the life of me get this to compile without some kind of error reading Unexpected Token '<literally anything I do>' followed by a traceback. The error seems to be around the first line of code, usually, and it's had all kinds of problems, throwing errors for const, or for adding a semicolon at the end of the first line.
Here is my code:
%{
const damage_bonus = ${ability_modifier}$
const damage_formulas = [${fetchFromDynamicTable('damage_table','damage_formula')}$];
const damage_types = [${fetchFromDynamicTable('damage_table','damage_type')}$];
let formattedDamage = '';
for (let i = 0; i < damage_formulas.length; i++) {
if (i > 0) {
formattedDamage += '+';
}
formattedDamage += damage_formulas[i] + '[' + damage_types[i].toLowerCase() + ']';
if (i == 0) {
formattedDamage += (damage_bonus>0?'+':'') + damage_bonus;
}
}
return formattedDamage;}%
i should state that I have programming experience but I've never worked with javascript before. am I doing something glaringly wrong?
You'll loose any type-information when using CSB-Formulas in Scripts. It doesn't matter for Booleans and Numbers, but Strings and Arrays can cause issues if not handled accordingly. So I guess your issue lies within the line of fetchFromDynamicTable(). What you can do instead is the following:
const damage_formulas = '${fetchFromDynamicTable('damage_table', 'damage_formula')}$'.split(',');
A semicolon at the end of a line shouldn't cause any issues. JS will implicitly add one anyway.
see, what i'm confused about is that the problem line so far seems to be the first one. having a semicolon after ${ability_modifier}$ nets me an Unexpected token ';' error in the console. When I remove it, I get an Unexpected token 'const' error.
What does ability_modifier contain?
i think you just found my bug lmao
it doesn't contain anything atm
(it's supposed to be an integer that's fetched from the character it's on, but I'm just testing this in a stray item)
putting it on a character sheet, it works fine without any other edits lmao. thanks for helping me out!
np. You also have global access to the object entity in Scripts, if you need that
i'll keep it in mind, though i'm not sure what I'd use it for. the problem is actually that ability_modifier is a hidden attribute on my items, which is what's responsible for fetching the correct number to use from the attached sheet. i think I'll just modify that attribute to have it return 0 if it can't come up with anything lmao
Not really an issue in my eyes so far. Items are directly attached to the entity:
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Script-for-updating-multiple-Items
well, i won't need it, because I got around the error for now by just adding in a quick check like so
const damage_bonus = ${ability_modifier==''?0:ability_modifier}$;
but i'll keep this in mind going forward, so thanks
Sin'ce youre building an object function first, variables declared outside the function cannot be passed inside unfortunately as they're not in the same scope, so the script itself has no access to let effect_name_applied variable. I worked around it by running the final script through a list of .replace() function
Tbh I just don't wanna be coding in a hardstring
Hmm. I'm still having issues with this one. It seems like fetchFromActor is returning the value instead of the path. I'm not sure how to go about this. Maybe I'm missing something?
Formula section of the Dropdown
That can only reference Dynamic Tables of the current Sheet or the parent-Sheet in case of an Item
Use Formula if you reference Dynamic Tables outside of these scopes
Okay, nice. I'm assuming I'll have to use fetchFromDynamicTable() as well?
yeah
When I use ${fetchFromActor('Tables', "proficiencyTable")}$ it is only returning 0 so I figured i'd have to do more to get the data in the table
oh, did you mean yes or why?
Sorry, I'm still having trouble with this. I've tried a few different combinations and I'm pretty sure I'm doing it wrong. I keep gettin uncaught typeerror.
${fetchFromActor('Tables', fetchFromDynamicTable('proficiencyTable','proficiency'))}$
Quotes around fetchFromDynamicTable(). You should try to be as close as possible to the examples of the documentation of the function
I did that too and all I got was 0
On the "Table" actor's sheet I did ${fetchFromDynamicTable('proficiencyTable','proficiency')}$ and I got 0,1,2,3 back as expected
But when I try to combine it with fetchFromActor it only returns 0
${fetchFromActor('Tables', tableInfo, 99)}$```
I tried that along with what you suggested with just adding the quotes and I just get 0
I put this in a chat message to troubleshoot btw.
${fetchFromActor('Tables', "fetchFromDynamicTable('proficiencyTable','proficiency')")}$
Ah you don't need to build a "single string" but instead convert the whole function ("multiple lines"). Yeah coding that as a string .......
I don't see any issues with the syntax with this one... Any errors in the console?
No errors that I see
I also changed the value of the dynamic table and I still only got 0 even though that was no longer one of the options
Yeah I refuse to be coding in a string LOL
I might as well use Notepad for that
I posted about this earlier, but I think I am getting closer to a solution... but I may be going about this entirely wrong. Is there a way to use a .for statement on the 'actions' to have it iterate through each row of the dynamic table? It currently seems to just output the entire array as a string, which is not intented.
${dice:=fetchFromDynamicTable('item.item_actions','action_dice')}$
${rowCount:=count(actions)}$
${#?{actionSelect: "Select Actions" |actions}}$ -- problem exists here: it comes up with "Select Action: Slice, Dice"```
I did try the suggested method of this
Nope, loops don't work in CSB-Formulas
Ah! That would be where I am stuck :P.Would it be possible to appropriately format it through a script %{}% and then run it? as in, get it to look like Slice|Dice and run it from there?
Might be doable, but can't verify that.
10-4. Off to GPT to see about jscript :P. By the way, for any folks using it, it actually can do some basic ideation around CSB coding, so long as you feed in the readme and the FAQ. It's not perfect, but it certainly helps take a complete newbie to asking questions regarding script coding 😛
We also have this one: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
Yep, adding that into the feed 🙂
Is there a way to have button roll different types of dye / number of dice? Like for instance if I set something like this up. Red being the button and green being the die outcome.
Sure, you can construct the Roll-Formula however you like before you pass it to []. Check this section: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#322-dynamic-roll-formulas
So how would I set it so the button would be the outcome of the dropdown? :Key_place_holder_text: doesn't seem to convert the roll formula from the drop down.
Show the whole solution.
I really really really need to track cooldown for my spells and abilites.... any advice on how to track that?
Scripting... A lot of it.
acheck box would be the best... but how to create a checkbox next to an ability
A wait, it shouldn't be automatic? Then... I guess? Whatever you like to track it visually.
Ohhh you make abilities/spell into item?
every time i want to modify the ability I have to open it
it is slow as hell
And it needs to be an item because I can just copy paste abilities from word
it is much easyer to work with abilities like this
it is easier to develope a system like this
Noted, i have just finished with my status functionality, trying to make abilities but not quite sure of the approach
Will keep in mind of using Item as abilities
and, i can send these to chat:
The example-template has something like a checkbox in an Item Container. It uses a small trick with conditional Icons and setPropertyInEntity()
${[:LIST_INSP:]}$ is what I'm currently trying to use. LIST_INSP being the dropdown key.
so i can introduce a new ability to palyers easyli and if the ability causes a status effect they can just drag and drop it from the chat to themselves
You ever tried to make a status effect that gets dispelled whenever the enemy HP changes or not?
Or is that something you handle manually?
I handle everything manually
Ooof, ok, thanks for the insight
mine is a relatively easy system
This does not really make sense to me, can you please explain in a bit more detailed way...
I don't really have anything to say else really, I just wanna share my progress with CSB cause I just wanna share it

is there a version requirement for this?
Minimum is 2.3.1
Looks legit. Might be one of my own sheets.
Ah ok I figured it out... I was using custom when I needed to be using formula.. lol
Thanks again
I did take a lot of reference from your example sheet 
this is where the magic happens tho
each character sheet is basically its own database of personal modifiers and multipliers
8D
this is not really what i need
yes it has check boxes, but i need the check box to be on the character sheet without haveing to open the ability
For "global variables" and "global tools" I even have a GM Panel that helps me do just that
Everytime i want system-wide things changed, I just go to this custom panel and tweak the parameters ❤️
It also has that. Either the Armor or the Weapon-Container has that feature.
can you please send me a screen shot?
Also in the middle of making a damage calculator to further help my life GMing 😊
Can't, PC is already off 😅
Oh I guess I should say this now since I haven't really said it before
CSB sheetbuilding capabilities are amazing

@earnest imp you have the example-sheet, right? Can you show him the section with the pseudo-checkbox in the Item Container?
That's not an Item Container
It was either Armor or Weapon. And you need to create an Item for those.
Still not. The checkbox should be already present on the Container when showing Items. Not on the Item itself.
Hmmm then i cant find it sorry
Can you create a Weapon and Armor and show the Container to me?
Drag these to the Character Sheet and navigate to the Combat-Tab
dragged
Ah, you might need to go to the template and reselect the Item Templates in the Item Containers...
How did you do this again? 😄
Just make sure to reselect the Item Templates in the Item Containers, the references are getting lost after an import. This will be fixed with the next version.
Txh btw, this is the right one
the problem is, i can not drag and drop the sword
so
i have imported the sword
it looks like this
then created an example character and applyed the "_Template"
I go to the combat tab
it looks like this
and when i drag this here:
then nothing happens
The sword has the wrong template selected
And you have to go into the configuration of the Item Container and reselect the correct template.
i have started over but still no luck
okay
i got the problem, _weapon was not selected here:
Now i have got this
but the problem is i still can not change the cooldown... so i can see the checkboxes, but i still have to open the weapon to edit the checkbox
Sidenote: the magick tab is not visible for some reason
Go to the actor-template and open the config of the Label of the Sting-Damage column. In the Label Roll Message enter the following:
${setPropertyInEntity('item', 'checkboxKey', "item.checkboxKey ? 0 : 1")}$
%{throw 'Done';}%
Replace checkboxKey with the key.
That's intended. It should only be visible if a specific Item is dropped.
Wait a sec, it's referring to a Dropdown... hehhhhhhh....
You know what, try to import this version: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads
This should definitly have the feature
i did
not the swords are gone and drag and drop does not work again
even if i check this:
Did you reload the Character Sheet?
nope,
i just relized this
OMG it works
this is so awesome
Just what i wanted
thenk you
np
you are my favourite human being at the moment
So +1 doggo?
to me it was a TREMENDOUS problem, my system suffered without this 😄
+1doggo?
Your profile picture 😅
🙂
appsoluteley
Not i only have to figure out how to create reroll some dice of my rolls...
The official website and community for Foundry Virtual Tabletop.
its not that simple, because i use a coustom dice
this is how it looks
and I would need to be able to select and rerol selected dices....
Heh, well I can't help you with that. This needs quite a bit of Scripting to achieve that
one last question: when i added the item container to my character sheet
skill and specialization is not visible. Why is that? ist it a weapon property?
its not a big issue but i could make use of this 2 filed
Yep, all stats shown on the Item Container are referencing Item-props
Check the Label of the Item Container
Actually... try to change the value of the Item
Is there a way to run this in Label Roll Message without creating a chat message?
${#item.equipped == 1 ? setPropertyInEntity('item', 'equipped', "0") : setPropertyInEntity('item', 'equipped', "1")}$
No, the Label column of the Item Container
Add %{throw 'Done';}%
Perfect! Thank you!
the Label column of the Item Container.... i cant find it....
Go to the actor-template, find the Item Container and click on one of the column-headers (except Name)
That's the Config Window of the Item Container, but I need the Config Window of the Label of the Item Container
Yeah
As you can see, it is trying to pull information from a Dynamic Table, which doesn't exist
Just put ${item.Skill}$ in it
okay, works
thank you
Last question: is ther any way to increase the size of this checkbox?
Not sure if this should go here since it's just overall help, but is it possible to put a spoiler message in Foundry's chat window ||like this?||
dunno
Styling --> CSS
thank you
Love how forward this was in a single word 😂
Thanks for all the help you've given, by the way!
@raven raven Oh my god? You figured out a way to change data FROM item container?
If you dont mind could you send me an example template and the character for that? I can share mine too if you want 😄
Is that a different example sheet than before? 🤔
Yeah. The one before is V2.3.1 This one is V3.0.0
Wait, so it IS possible to have checkboxes for items? How?
It's a Label, which shows Icons conditionally. The Label Roll Message changes the state of the Item. An example can be taken from here: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads
So clicking the checkbox won't actually change anything? I'd experiment with it myself, but for whatever reason, items didn't show up in the item containers (except in the Hidden tab) when I took a look at it last time... and just a moment ago too.
You have to reselect the Templates in the config of the Item Containers
Thank you so much!
Quick question (Which may lead to a longer one): Using a script macro is it possible to return a list of all items attached to the actor that are within a specific item container, if you know the key for the item container? If anyone has a reference page to help me ou tthat would be great if it's easier than typing it out.
I dont think you can by referencing the container but if you are using filters on the container, you can reference the filtering criteria. It also depends on what you want to return. Do you want a list of names, or you want the objects? If you put the following in a label, it will return the names as a comma separated list. Replace FIELDNAME with the name of your item that you are filtering on your container and replace "value" with the filtered value from the container. If you need a list of objects, remove the map method and modify the code as appropriate to process the objects as desired.
%{
return entity.entity.items.filter(item => item.system.props.FIELDNAME === "value").map(item => item.name).join(",");
}%
Will that work in a macro as well?
The ittem container does contain filters
It will require some modification, what exactly are you wanting to do once you have collected the objects? Just a list of names or something more?
So....in a nutshell, we have a blind player and I'm trying to make a dialog box thatt will put all the item names on his sheet into dropdowns by a specific category (Which I guess I can get via the filtering?) and once selected, it will find the item on the sheet and execute the 'roll' assigned to that item
Also, I'd like to be able to change values on an item from a macro
So I need the names to display then the abiilty to get a reference to the item that matches the name. I want to display the items on the dialog into multiple dropdowns (attacks, powers, etc)
There two ways to approach this. One option is to build a macro that creates a dialog that does all the things you mentioned. Its pretty complicated. Alternately you can create a special actor and you can use most of what is native to CSB to do this. It will still be fairly complicated, but I think it will require less javascript.
I already have the dialog built and it pulls in 'Dynamic Table' rolls, stat rolls, and skill rolls. I just need it to do item rolls now
You can put the following in a macro. the order of the function call is:Actor Name, field name containing value, value to compare. I hope this helps. It returns a common separated list of names.
let attacks = getList("Olaf the Lost","type","attack");
function getList(actorName,field,value){
const actor = game.actors.getName(actorName);
const names = actor.items.filter(item => item.system.props[field] == value).map(item => item.name).join(",");
return names;
}
Edited to fix code error
Okay when I'm able, I will try that and see how it works thank you!!
hold on, whats a getList? 🤔