#Custom System Builder
1 messages · Page 15 of 1
outside foundry, in practice how do you resolve an attack?
you roll an attack
and then
Then your target chooses if it want's to try to Parry or Evade.
It rolls for chosen action:
Parry
Rolls 2d6 + Dex + Shield/Weapon
Evade
Rolls 2d6 + Dex
If result < than attack roll, then attacker rolls for damage
Damage dealt is:
Weapon DD + Str - Armor (which can be modified by Piercing attribute, we'll omit that)
okay
i suggest you creating a button for barry and evade
instead of automatizing everything, it better for the "flow" of the game
I think that I will need to create them both for weapons, and parry button also for shield separately
can you parry with weapons?
Yup
yeah
But you can't evade with shield 😉
then you should create for weapons too
I think so, I'll reverse engineer attack ones ;P
:b
I'm just curious, why it gave that Sword item to both containers xd
because
the items containers
...
one minute
thinking in a good explanatino
it's because the itens in your sheet are inside of the same place. What the filters do is to change the display
the item container is just a display
so for example
you have a bow and a sword
and you put 2 containers, both with filters for ranged and melee
your sheet have both weapon inside the same space
the item containers, just hide the one that are refused by the filter
Hmm... Should I mess with it, or should I just remove second container and call it a feature...
k
well
just one
you can ask your players for fair play
and call it a day
All right, I'll catch you again when I finish those parry and evade buttons, and we'll start working on damage rolls, and then jump to ranged and throwing weapons
👍
You know what... Those rolls for attack didn't work... It was just me missclicking another button... They still have problem with that skillModifier switch
Cause I made rolling for Evasion (without that switch and skillModifier) and it rolls perfectly
@glossy hare
It knows that player object has OneHandedSkill... Something with switch?
click the update button
inside the waepon that you created
Still doesn't work
strange
because
it should be working
hmmmm
update the Miecz
and choose the weapon skill again
in the dropdwon list
Nothing, even removed and re-added it again to "PC"
I'm gonna try cunning actions now 😉
@formal goblet Could you take a look at it?
@glossy hare I also have this when it's kinda refreshing the window
how would i get the default value for a radio group by formula? this user input should have d4 selected by default
Okay, moved with it a bit. Now it rolls, just can't fetch Value of OneHandedSkill
Done it, for future reference if anyone digs to that spot:
Formula should be like:
${skillModifier:= switchCase(item.WeaponSkill,'1',OneHandedSkill,'2',HeavyWeaponsSkill,'3',SpearsSkill)}$
${[2d6]+skillModifier+PCAttrDEX}$
Make sure that variables to be sent as strings are in ' ', and ones to be changed to their values are without ' '.
What did i need to use to hide a formula from the text message ?
${ # FORMULA... }$
You need to do it for every block that you want to hide
thx
sorry for being absent
got problems here
but congrats
Now I have new question xD How do I make that "1d8" text from weapon Damage Dice to actuall "roll"?
I would need to get it as string and somehow convert to formula?
Or should I change the way it is "chosen"
So how should it look? Currently I have this, that gets 1d8 as string and tries to add PC STR. It's a matter of converting string to roll
Remove the white-space before :=
there any way to put a button into a roll message?
like a "click to take damage" thing? or would i just use a macro for that
Already figured it out by accident xd I didn't recall JS being so bi... about white spaces o.0
Well, this part comes from CSB, not really from JS 😅
The assignment operator in JS is just =
would it help userinputtemplates?
Now it makes sense 😂
Hmmm... Need to find an "easy to put everywhere" way to check if rolled 2d6 are both 1s or 6s...
Roll 1d6 twice, store their results and check for equality
Oooooorrrrr... Be a lazy little bitch and check if result of 2d6 is equal to 2 or 12?
😛
Well, that also works
If I wanted to make that IF inside inline roll, how should it be done?
${#basicDiceRoll:=[2d6]}$
${#basicDiceRoll==2 ? : }$ //notify('warn', 'Double ones')
${#basicDiceRoll==12 ? : }$ //notify('warn', 'Double sixes')
or, wait, user input templates embedded into the roll message should be what this is for, right?
With JS. The issue is that operations are executed regardless of the condition. It will just take the right result
just add the ! after ${
But shouldn't this work?
${#basicDiceRoll:=[2d6]}$
${#basicDiceRoll==2 ? notify('warn', 'Double ones') : }$
${#basicDiceRoll==12 ? notify('warn', 'Double sixes') : }$
Well, maybe I did understand that portion of documentation wrong or didn't understand syntax, but i thought it would work
Already did that damage 😉
okii
this is the roll i use in my system to highlight maximum/minimum results as a different color
<div style='color:${!Roll==12 ? 'green' : (Roll==2 ? 'red' : (''))}$'>```
nesting the ==12 and the ==2 into the same conditional might be better?
Stealing ;3
bless
The else-part is mandatory, you can´t leave it empty. And well, you can try to do that to see what I mean
aaa I found a bug! Not sure if it's been documented, but
if a number field is negative and set to allow relative modification, it treats it as a relative modification :c
which even updates if you simply hover over the number box without changing it
also side note uhh is there a way to set a dropdown menu through a roll message
${?{month:'What month are you born ?'|"January"|"February"|"March"|"April"|"May"|"June"|"July"|"August"|"September"|"October"|"November"|"December"}}$
I want to hide this formula in Hidden Attributes, but when I move it from Label Roll it stops working xd Any ideas?
${PCHealthPointsAct <= 5 ? [2d4] : PCHealthPointsAct <= 10 ? [1d6]+[1d4] : [2d6]}$
Does item support item container?
because I can't see it in the initial ADD menu.
BUT can find when replacing ANY other existed one (look like it's a bug)
Oh, sorry, I was unclear.
I meant a dropdown on a character sheet. Like, I want them to click a button, and it resets a dropdown menu to its default.
Is there a way to have audio play when a button is clicked?
you can have a roll formula activate a macro on click, so you'd just have to set that macro to play an audio file
Normally you would create a button that changes a different part of the character sheet when you click it. But I'm not sure if it works with dropdowns
This doesn't work. I ended up just scripting it.
speaking of so, though, uhh,,
input dialogs (i.e. ${#?{userInput|0}}$) are absolutely broken :c
allows for pretty easy arbitrary code execution.
ah okay thanks, is there somewhere I can find that would show me what script to put in said macro to have it do that? or do I drag the audio file over or...?
How should I send value of a field from equipped item to a label/number field to hold it as variable (and cheat sheet of current modifiers)? Let's say my PC equips "wooden shield" shield item in item container named "equippedShield" and I would like to store it's "parryBonus" in a field on character sheet outside of item container called "PCParryBonus"
That looks interesting.
How do I capture each row number in a dynamic table as exampled in the image? The goal is for the player to click a button which executes some JS based on field contents and then deletes that row. I am assuming that to programically delete a row, I need to reference its record position but I am open to better (aka easier) implementation ideas for programmed deletion.
https://www.youtube.com/watch?v=dgsVf-a0XNs
Hello everyone. Finally "finished" the module. Instructions to install are included in the description of the video and in project page. Special thanks to @blazing ibex @vagrant hollow @formal goblet ❤️
Character creation example for the Household module of Foundry VTT.
Check this other video on the channel if you want to know how to install and configure: https://youtu.be/AuR-Xm50Oiw
You can install the module from here: https://github.com/mordachai/household-csb
Manifest URL:
https://raw.githubusercontent.com/mordachai/household-csb/main/...
Chat cards looking good!
I am trying to hide a field in a dynamic table but without success based on comparing 2 number fields such as sameRow('curSerial') == sameRow('sn') in the visibility formula. I have also tried to use a third label for the comparison such as sameRow('compare') == true. I tried a number of variations with and without sameRow, among other things. Does anyone have a suggestion on what I am missing?
the visibility formula wants to hide the entire column, not a single field
what is the component of the field you are trying to hide? if it was a label you could add a conditional where it just outputs nothing
I have a button that I trying to hide for specific entries based on conditions
I guess I will do that
I think I´ve changed it in the upcoming version, so that it only hides the specific fields instead of all fields in the column
Heyo!
Stupid question...
How do you set/use chat cards?
Trying to 'beautify' my world, but got stuck on this subject.
I have such item container for melee weapons which allows players to add Melee Weapon items. It shows weapons name, damage dice, and roll for Attack, Damage, Parry and Evade actions. Now, I would need to make option for attacking with both weapons. It should basically be [DamageDice1]+[DamageDice2], but I have no idea how to get value of DamageDice from second weapon.
To make it easier I will make it as separate ROLL button.
Is there a way to have Item Containers as element in a Dropdown List? I saw that there is the Dynamic Table option now but not the Containers.
the dev said you need to make table from a formula
then call the item to the dropdown
Are all parts of a label accessible via ${}$ syntax? I'm thinking of the tooltip, for example.
I'll look into it, thanks.
I think so but I'm not sure if you would be able to change it in realtime
I just need to read it. Would it be something like ${labelKey.tooltip}$ or am I too hopeful?
You are very hopeful... I would catch it with a custom CSS class, I think there is JQuery in the %{}% scripts...
Maybe there is a way but I always saw only ways to get the values, not the actual control
Ah, it figures 😅
But the value would be enough. Any simple way to get it?
${ ref('key') }$ or my fav entity.system.props['key'] (it can be a variable)
Oh, the second one can be used in just the %{ }%
I'm sorry, I mean the tooltip value.
It seems there's no easy way to get it 😅
I'll find a workaround.
Thanks for the hints 😉
hey, dumb question but is there some kind of tutorial of sorts?
also, when i created a tabbed pannel, my tab's contents gets added to the side of the tab instead of below it, how do i fix this?
Don´t use tabs as the component key 😅
Can setPropertyInEntity() change a label's text?
Something like setPropertyInEntity('self','labelKey',"text") ?
oh, thanks
No, Labels are not Input Components
...and you said that tons of times, now that I come to think of it...sry, my bad 🤦🏻♂️
Continuing on the same line of work...
I'm trying to change a checkbox status using this:
${setPropertyInEntity('self','checkboxKey',${checkboxKey?false:true}$)}$
It does work only from false to true, not the opposite.
Where am I wrong?
EDIT: it works using 0,1 instead of false,true...
so I'm still new when it comes to coding but how would you should do a formula for a dyamic table?
What's the best way to re-use a roll formula for multiple ability scores where the only difference is one variable? I'd rather not copy paste it 10 times and change the ability score used.
I had a question:
If I had a table of items, and I wanted to grab the largest weight value of all of the items (that is, opposed to summing up the items), is there a good way to go about doing this?
Trying to think if there's a way to have item modifiers push onto an array, but don't seem to be having success with that. Anyone know anything I should look into?
It´s not really different to formulas in Labels, it´s just that you define a formula for a whole column instead of for every row. If you need information based on the current row, use the sameRow()-function: https://gitlab.com/custom-system-builder/custom-system-builder/#424-samerow
If you want reusability, then I´d adivce to use a Dynamic Table. In this case, you´d only need to define 1 formula for the whole column.
Yeah, aggregation is kinda meh with modifiers... So I´d do it with a script on the target-label instead, which reads entity.entity.items, filters these and then returns the max-value fmo the items, which are left.
Will that work even with a label though? I'm trying to have a label on the character sheet display the highest weighted item.
Well, the actor holds all items, so it´s easy to pull that information from the actor
How can I make it in chat message, for a roll which gets variable from player, to input a "button" in chat, which will show "character card" of NPC with that entered name?
Let's say I have ability "summon", I use it and enter name of summoned creature. Then this name should become visible and clickable in chat. When clicked, it should (?Open?) actor card with that name
Check the HTML of the Item Container. The first column contains a link to the item, so the functionality is quite the same.
Good morning,
I'm using Custom System Builder and I want to change the displayed message for initiative rolls.
Passed through a lot of files but didn't find it.
Any ideas where I can search for?
I actually find where this template is being prepared, but the message "rolls for initiative!" I can't find it.
Is there a problem with hidden components?
I'm trying to use a hidden checkbox in a conditional but the console says uncomputable token.
Then if I check/uncheck the box it starts working as intended.
@formal goblet Quick question. If I need to have "upgradeable" weapons, and want to do it by checkboxes, do I need to somehow make different items for that, or I can just edit that one that Actor has in its ItemContainer and its not gonna change those properties for all the other instances of it?
All item instances are copies, so you can safely edit an item without causing changes in other places
Great!
It's possible that hidden components are handled as if they have never existed, but I'll need a closer look at that. My guess would be, that there's an HTML-tag with the disabled-attribute (which disables all sorts of events...)
Oh, I see, thank you very much. I'll try and find another way to do what I want to. In the meantime I'll be looking forward to get news from you 👍🏻
You can use ref() with the fallback-option
Hey! Is there a way to variably disable a checkbox (or otherwise apply a class if circumstances are met)?
I wanted to hide it altogether, but it seems like the item doesn't initialize the value of the checkbox if it's hidden when created, resulting in some dumb undefined issues that I can't resolve with operators :c
like, on an equippable item, if checkbox of attribute my_attr has a "Visibility formula" that causes it to be hidden on creation, then:
my_attris set toundefinedregardless if "Checked by default" is true.my_attrin formulas behaves erratically.switchCase(my_attr, true, <code>, <code>)throws an error.and(my_attr, true)andor(my_attr, false)throw an error.my_attr ? <code> : <code>sometimes works but usually throws errors.- using
my_attras filters in item containers doesn't work, even when the previous solution works.
😅
whaaat?
why is it showing as undefined for me then?
tho tbf it's only sometimes? but it definitely says undefined for me.
Well, that´s only a test on a character sheet. I didn´t take into account the items
hello, is this where one goes to ask about custom character sheet questions?
kinda? 😅
i just have a weird question and cant seem to find the answer anywhere. if i wanted to take an existing character sheet (Dark heresy 2) and change some names for a custom setting, Ie: willpower to grit. how would i go about it and how difficult is it?
Only CSB-Sheets work with CSB. Sheets from other sources (e.g. PDF, Excel) do not work. You´d have to create a new one
so that's the thing. Dark heresy 2 has a foundry sheet and ive been looking through the code and making some changes but i realized i have no idea what to do once i'm finished or if its even possible
Well, it would need the same JSON-structure as CSB-Components. You can create a new sheet (with a template), export that and compare the structure
so I'm a little dumb. how do i check if something is JSON and/or CSB
Foundry and CSB export most of their things in the JSON-Format: https://www.freecodecamp.org/news/what-is-json-a-json-file-example/
Many software applications need to exchange data between a client and server. For a long time, XML was the preferred data format when it came to information exchange between the two points. Then in early 2000, JSON was introduced as an alternate data format for information exchange. In this
cool, and where do i plug this in to see if it works?
There is an import-button if you go the settings-tab of Foundry. You cna follow this example here: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
But I´m honest, transforming data from one sheet to another is a freaking tedious act. If your source-sheet is not small and you don´t know how to write a transformation-script, then you should probably forget about that. It would take less time to create a new one.
ill give it the old college try first
Well, I can´t stop you doing that
thanks for the assistance
@formal goblet Hi, can you help with this?
No, it doesn´t
Hey
so if I am using
%{return await game.macros.getName('YourMacro').execute({name: '${name}$'})}%
how would I alter it for a second argument?
I don't want them added
they are two totally separate things within the macro that I need to provide arguments for in the roll
Huh? What about the last example?
oh right down the bottom, OK
wasn't sure exactly what you were pointing me at on the page
ok thank you, got it working now
Dynamic tables seem to keep deleted items on the character sheet and just set the deleted: true. Do these actually get completed removed from the character sheet?
Also I have a JS macro that adds new items to the top of the Dynamic Table instead of the bottom when entered manually. I have since noticed this error TypeError: An error occurred while rendering CharacterSheet 32. Cannot read properties of undefined (reading 'predefinedIdx') but it is unclear whether this relates to my code. All occurrences of predefinedIdx are null, even manually entered entries. Does anyone have any ideas on this?
Hey y'all
First, I want to say to the dev team that they are awesome. I've been using this system for a couple days now and really I'm baffled by how much I can do, and how simple it is ! :)
Second, quick questions :
- Is it possible to add rows to dynamic tables using a formula?
- Is it possible to roll for initiative using a formula? (edit : from the sheet)
Hey, i'm not a dev... but I can help you with the initiative formula
I struggled a bit to get that working, but finally I did
this formula uses the "iniciativa" value for the selected token and rolls a number of d10 equals to that value. The x10 in the end is that for each critical dice (10) it rolls another d10.
depending on how complex the initiative you want to create, i believe this will cover
This is the system-code for adding new entries:
addButton.on('click', async () => {
if (entity.isTemplate) {
this.predefinedLines.push({
...sampleNewRow,
predefinedIdx: this.predefinedLines.length,
deletionDisabled: false
});
await this.save(entity);
} else {
let tableProps = foundry.utils.getProperty(entity.system.props, this.key) ?? {};
if (tableProps) {
tableProps[Object.keys(tableProps).length] = { ...sampleNewRow };
} else {
tableProps = {
0: { ...sampleNewRow }
};
}
foundry.utils.setProperty(entity.system.props, this.key, tableProps);
await entity.entity.update({
system: {
props: entity.system.props
}
});
}
});
Ah, sorry, my English is bad, and so I wasn't clear
I want to use this Initiative from the sheet, instead of only from the encounter tab
- Nope
- Nope
not sure if I got your question. You want to roll your initiative from your sheet and transfer it automattically to the encounter tab?
ok thanks!
The second one is completely unnecessary, but the first one could be a good feature in the future imo :)
yes :) but apparently it's not possible
you have some sort of different calculation on your sheet for the initiative?
not yet, but some systems do, and anyway it's just cool UX to be able to roll initiative from the initiative stat :)
All my stats on my CS are rollable when you click on the label, but the initiative one only display a message in chat currently, which is not super useful :p
makes sense
at least is not a big problem since every time you start a combat the encounter list will be there to roll
haha
what you can do is just improve the roll from encounter sheet to consider stats from your sheet
**encounter tab
yeah it's clearly not even a problem, I was just wondering if I missed something, but I'm fine with it not being available :p
isn't it what the "initiative formula" in settings does already?
yep, but you need to write down the info properly in there. otherwise it will not get the stats values from your sheet
I at least was struggling a bit to get that working properly the way I want haha
Yeah there is clearly a learning curve to CSB, as expected given the possibilities :)
yep, there is a lot of potential to do a lot of nice things in it
not sure if you use label icons for some reason on your sheet. But you can get the icons from font awesome if you don't already know that
to get something like this if you want
Ho, I didn't thought of using only the icon, that's a fun use case :)
i like it to keep less text for some stuff
these on the top are for resistances
also I use for some of the rolls that has different possibilities
only text would occupy a huge space
haha
Hello!
Is there a possibility to nest if queries? I could not find anything about this in the doc unfortunately.
My approach does not work here:
${equalText(key_dropdown_art, '1') ?
(numberfield_lpakt <= 20?-80 : numberfield_lpakt <= 50?-50 : numberfield_lpakt <= 80?-20) :
equalText(key_dropdown_art, '2') ?
(numberfield_lpakt <= 30?-70 : numberfield_lpakt <= 40?-50 : numberfield_lpakt <= 60?-20):0}$
Could someone tell me the correct syntax here?
Thanks a lot!
It seems correct. Check the console
You´re missing an else-part after numberfield_lpakt <= 80?-20
You can use a linter to spot syntax-errors: https://www.jslint.com/
JSLint, The JavaScript Code Quality and Coverage Tool.
This file allows JSLint to be run from a web browser.
It can accept a source program and analyze it
without sending it over the network.
How can i reload or partially reload after changing a value in a script?
example - in a label roll, ask for an amount of spell dice and remove an equal amount from the entity.
Reducing works except the UI doesn't update unless I reload it by opening/closing
<div style='display: none'>
${#?{sd:"Spell Dice"|1}}$
%{entity.system.props.spelldice = (parseInt(entity.system.props.spelldice) - sd.value).toString();}%
</div>
It works!
Thank you for your quick support!
Thanks.
<div style='display: none'>
${#?{sd:"Spell Dice"|1}}$
%{entity.entity.update({'system.props.spelldice': (parseInt(entity.system.props.spelldice) - sd.value).toString()})}%
</div>
This does what's expected
hi, how can i make a label reference the visible text of a dropdown list (label) instead of the key of the label?
and is a dropdownlist automatically a dynamic table?
You can only reference the value of the component (in this case: the option-key)
Uh, no? Completely different components 😅
is there a way to position the label atop of the text field instead of at the left of it?
maybe put them in a vertical panel? I wish you could put html in labels, hahah
"them" being the text field and a seperate label
can someone explain why this formula is returning as null?
doing ${[1d20 + :dex_at:]}$ like the wiki says also doesn't work
Then check if dex_at returns something
how do i do that?
Just create an additional formula in the label prefix.
dex_at is my component key for the stat in table
i'll try
ehr, sorry for being dumb but how should it look?
Just ${dex_at}$
Ok guys, I'm hitting a wall here and need some help.
I got this line:
${[{1d12,1d12,[:PCfatigue_physical: == false ? :PCstrength_die: : 0]}kh2]}$
The roll syntax is supposed to roll 3 dice. The first 2 are d12s, the third is either the PCstrength_die or no die (0) in case the PCfatigue_physical checkbox is checked.
What am I doing wrong?
Is comma even allowed in a roll-formula?
i've put a 1 there in the test sheet
I don't know. But I know that this works:
${[{1d12,1d12,:PCstrength_die:}kh2]}$ (it's a dice pool system)
Interesting. Well, the part with the conditional is faulty because the whole conditional expression is a CSB-Formula, not only the keys: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#322-dynamic-roll-formulas (last example)
Then ckeck the console
Yes, I've checked this already but I don't know what I'm doing wrong.
Console says:
Error: Unresolved StringTerm false,'false' ? d10 : 0 requested for evaluation
Surround the whole conditional with colons, not only the keys.
The whole conditional is a CSB-Formula, so you have to mark the whole one
Like this?
${[{1d12,1d12,::PCfatigue_physical: == 'false' ? :PCstrength_die: : 0:}kh2]}
Remove the ones around the keys
${[{1d12,1d12,:PCfatigue_physical == 'false' ? PCstrength_die : 0:}kh2]}?
Like that?
hey, how do i make a label based on a formula?
like, as an example making a lable that returns my STR bonus based on my STR ability score
also, thanks for the help above with the rolls, got it to work
I second that question.
You can write the formula in the label.
So I tried this and it didn't work:
${[{1d12,1d12,:PCfatigue_physical == 'false' ? PCstrength_die : 0:}kh2]}
Any more ideas?
PCfatigue_physical == 'false' comparison with strings should always be with equalText(). Besides that, the return type of a checkbox is a boolean, not a string, so you can just use PCfatigue_physical == false. Or even shorten it to PCfatigue_physical ? 0 : PCstrength_die.
I´m not sure if the colon in the conditional will give you problems. If so, you should construct the whole roll-formula beforehand:
${roll_formula:= concat('{1d12, 1d12', PCfatigue_physical ? '', concat(', ', string(PCstrength_die)), '}kh2')}$
${[:roll_formula:]}$
ok, is there a way to use that key in a reference once it has been referenced? a formula in a formula or something?
That´s what ref() does
Hey, just in case the error comes from my side
is it normal that this works (using a number field)
${setPropertyInEntity('item', 'active', "item.active>0?0:1")}$
But this doesn't? (using checkmark)
${setPropertyInEntity('item', 'active', "item.active?false:true")}$
Am I missing something?
Let´s say the system currently has a small caveat, which doesn´t allow to set the checkbox with booleans correctly 😅. So yeah, keep it with the number for the time
this is something that got me in the past while preparing my sheet haha. Any chance that this is in the sight to be worked on?
Good morning btw
Ok so I've tried both suggestions.
The first one results in this:
caught (in promise) Error: Unresolved StringTerm PCfatigue_physical ? 0 : PCstrength_die requested for evaluation
The second results in this:
caught (in promise) Error: Unresolved StringTerm ERROR requested for evaluation
Im getting this issue
more context pls 😅
I´ve corrected the later one (forgot the part with the kh2)
Sorry I was half asleep, its something thats been popping up more but
${Crit:=fetchFromDynamicTable('Roll_Table_Atk', 'Crit', 'Name', sameRow('Form_Ref'))-fetchFromDynamicTable('Roll_Table_Art', 'Crit_Mod', 'Name', sameRow('Art_Ref'))}$
${CritQ:=sameRow('RollStore')>=Crit?1:2}$
This is just the simplest example, the last part is just, not working and the error pops up
Wait, does equaText not work anymore? Most of my equalText things seem to be returning errors due to an unexpected arguemtn
fetchFromDynamicTable() always returns an array, so Crit becomes an array aswell. And because you use it in the conditional further down, it throws this error
I see, thank you. Anything about the equalText?
equalText?
Yeah it seems a lot of my formulas that use equalText just aren't working anymore. I'll post an example
why am I getting this error? The only values that equal "false" here are value_is_held and value_equipped, both which are in that or function
Stuff like this returns an error like
${equalText(sameRow('Dmg_Type'),'Pierce')?1:equalText(sameRow('Dmg_Type'),'Slash')?2:equalText(sameRow('Dmg_Type'),'Strike')?3:equalText(sameRow('Dmg_Type'),'Burn')?4:0}$
I could just switch to switchcase which seems to bypass the issue, but I at least want to know why it suddenly stopped working
is Dmg_Type a number?
also you can use switchCase to test different values of the same variable.
wait, why does it mention compareText()? That´s something different
Thats an awesome question, I've never used compareText() as far as I can remember
Interesting 😅
W H A T
it worked with booleans elsewhere, omg??
okay so apparently, the character sheet it was on was just... bugged????
cause I made a new sheet and its working perfectly fine
well, doing or(+value_is_held, +value_equipped) seems to work, thanks, ahahah
You can also just use the or-operator
No, just the or keyword
oh! lmao, I had no idea
Here´s the full list: https://mathjs.org/docs/expressions/syntax.html
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
it doesn't seem to accept booleans :c
wtf?
How can an or not accept booleans? 🤣
Well, I can only tell that this comes from mathjs, not CSB 😅
yeahhh that's fair, ahahah
I just wish mathjs had a way to handle "undefined". I'm still getting the issue where an attribute isn't initializing if it starts out hidden.
like, right now, the checkbox for value_equipped is hidden in this new item I created because the item cannot be equipped.
but this check fails because value_equipped is undefined.
You can use ref() with the fallback-option
did i do it wrong because i got that in my label
Thanks for the help, but I've pasted the updated code into the label roll message and I get this error:
Uncaught (in promise) Error: Unresolved StringTerm ERROR requested for evaluation
(I'm not a coder so I'm really bad a this stuff lol)
I was told there was no macro code to do the key part of "Update this item" (Refresh)
what did i do wrong?
I think you don't use colons unless it's in a roll formula.
${str_at - 5}$
nice
Is there a way to delete a specific entry in a dynamic table without using JS; specifically the first?
are you able to put a roll in the same label message that you have a simple input formula in? I'm trying to get a risk roll function working that lets you select 2d4 or 2d6, then rolls what you selected, but I can't seem to get the roll to actually happen after the initial input popup resolves no matter what I do.
${concat(?{Risk Die:"Risk Die"[check]|"4","d4"|"6","d6"},"Hi, this worked")}$
this is my current attempt to get any kind of message to post to chat after the input prompt resolves, and I tried a handful of things before this that didn't work either. The input prompt is working fine and does exactly what I want though
What does it result in? Any console message?
no result to the chat. I do get a console error though now that you mention it
[Detected 1 package: system:custom-system-builder]
at math.SymbolNode.onUndefinedSymbol (Formula.js:982:27)```
oh okay, I'm glad you told me to check the console
since my prompt was labeled Risk Die the system got mad that there was a space in the label and it just rejected everything
Problem was the Risk Die before the part in double quotes, right?
yes. It makes sense that the prompt label would follow the same rules of any other component key since they can be referenced, but I hadn't thought about it til now lol
Hello!
Is there a way to represent e.g. poisoning in a meaningful way, i.e. to distribute a damage over a period of time or possibly also over combat rounds? Of course I can regularly subtract life points - but maybe there is a clever alternative?
Hey there, is there a way to change the style of Tabbed Panel's tabs? Like making them bold or something?
CSS
Do I need a CSS file, or can I just add the relevant bits somewhere?
You can add a custom CSS file to the system or use 'Custom CSS' module. The latter works for me, at least. In both cases you'll have to find out what classes are assigned to the component you are modifying, using content explorer (F12, nesr the console).
thanks for the detailed answer!
Glad to help 😉
is there a way to enlarge the textfield downwards? I want a bigger textfield instead of having to stack 10 of them on top of one another...
Hi, I don't know if it's been asked before, but I couldn't find anything related, so I'd like to ask: is there any way to have a roll from the sheet present a query of how many boons/banes (for those unfamiliar with SotDL/Lancer/Icon or games with similar rolling mechanics, boons and banes are basically d6s rolled alongside the main d20 roll, adding the highest of the d6s in the case of boons and subtracting the highest in the case of banes, these dice cancel each other out, so for example if you would make a roll with 3 boons and 2 banes, you would just end up rolling with one boon) are applied to the roll, along with any flat number modifiers? (stuff like a flat +2 to the roll's total)
Hey again, it's said in the "Formula System" part of the wiki that you can do Arrays in CSB formulas. But I can't find a way to make one, they are always strings
I can make strings work as array with subset(), but it's not as convenient as regular arrays.
What is the way of declaring an array in a formula?
Is a rich text field an option?
You could have a look at the CSB GitHub and read the User Input section, might give you a hint.
Alright, thanks!
well only if i can use it on the character sheet and not only the template builder...
Rich text fields are fillable on the character sheet. But you won't be able to process information out of that field
ok, so I tried it out, there is an editing button on the character sheet. Do players also see that and are they able to use it? If so, my problem has been solved.
Yes they do.
Is it possible in the visibility formula to add two dropdownlist key's instead of just one?
The formula that works:
equalText(pc_entity_type, 'pc_entity_player_character')
The key I want to add
pc_entity_unique_character
Formula that doesn't work:
equalText(pc_entity_type, 'pc_entity_player_character, pc_entity_unique_character')
.
also how do you guys add these nice coding backgrounds to your codes to make it more readable??
equalText() only allows exactly 2 input parameters. You have to combine it with and() to make it work: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System, https://mathjs.org/docs/expressions/syntax.html
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
just google discord-formatting and you´ll find the answer
So like this or without the space in between?
equalText(pc_entity_type, 'pc_entity_player_character') and (pc_entity_type, 'pc_entity_unique_character')
found it.
I was looking for
'or'
'and' means both need to be true, which is not possible if you use 2 keys of the same dropdown list...
Btw, thank you for all the help! It is really appreciated!
I remember that I have seen a module for system agnostic realization of bleeding, back in the days of foundry V9.
But sadly, I don’t remember the name or if this still exist.
I know, not helpful but maybe a direction to search.
Hmm... I tried several - but unfortunately they don't work with CSB, but are rather designed for D&D (e.g. "Temporary Effects as Token Statuses", "Dynamic Active Effects" or "Times Up"...). So far I don't have a solution to implement such effects in a meaningful way.
Thanks for the info anyway...
If I have a field that is an array (generated from a custom formula)
Can I make other fields which have the behavior of customArray[0], for instance?
if we let customArray be defined by another custom formula as an array, then I've tried
return ${customArray}$[0]
}%
AND
%{
return ${customArray}$.split(',')[0];
}%
to no avail. I'm definitely doing something wrong. Anyone know what I should look into or have any ideas?
Injected CSB-Formula do not preserve their type. What you can do is to access the props dirtectly via entity.system.props
I was looking into that, but whenever I would do
%{
console.log(entity.system.props.[ANY VALUE]);
}%
It would return undefined.
Which is strange, because entity.system.props would return the entire property object.
(specifically, the console would return undefined in this case)
ok, strange
I mean, I can circumvent this completely and run 10 separate loops (one for each of the 10 stats of the system), but when I implemented this like that, the entire application lags pretty noticeably, especially when its more than me in the server.
Hello, bit of a CSS question, is there any way to limit the changes I make in my custom CSS to only the custom system builder sheet?
I'm noticing that when I make some changes it effects other things in foundry. For example, input boxes and the like.
I have such things implemented in my game (burn, bleed, poison,...). But be warned its not an easy task.
If you are ok with programming yourself in Javascript it can be done.
Things you need: a way to track the effect (usually an active effect, but could also be done in another way with flags). A way to apply the effect with the necessary Data (duration, damage, ...). Automating the damage application and effect removal would be most likely a world script.
All this can be done in CSB but you have to programm it yourself and tailor it to your system.
additional things to consider: the timing (start of turn, end of turn,...), are there other related mechanics (saves, damage reduction,...), are players able to apply this? and are they only applying to themself or are the also able to apply such effects on other (not owned!) actors (NPC / other player)
I had already thought something like that. Although I'm a bit out of practice, I'm going to try my hand at a JavaScript implementation.
In the first step I would like to keep it quite simple: Player, NPC or enemy get a negative (burns, poisons, bleeds...) or positive (healing potion, protection spell...) effect, which is valid for a certain time. Within this period of time the affected person has the possibility to remove the negative effect. I would then control this as a GM and let him roll the dice manually.
I.e., I would need three fields behind the individual relevant values, in which I indicate the (damage or bonus) value (positive or negative), the duration in seconds and the interval of the calculation in seconds.
That should be enough for the first throw... Anyway, that's my first thought... 😉
Good luck 🙂
my tip would be: use active effects (core settings expanded module for custom effects) and use flags on the applied effect to track your desired stats (every effect has a own id and its own flags which can be set differently)
Great idea... Thanks for the tip!
Please inform us about your results. I would be interested in an solution too.
Hey there, I think I'm missing something, or I found a strange bug
This formula :
${fetchFromActor('target',"fly_swatter_active")}$
${DEFTOTAL:=10 + (fetchFromActor('target',"fly_swatter_active")?5:0)}$
Should never be able to output this, right?
👍
Input boxes and other active elements of CSB can be set with an specific CSS label. But there is still a lot of stuff (like sheet background) where you have to go with the global foundry CSS label and will affect more than only the character sheet.
Hey, is the CSS label the f12 grab the existing CSS and modify it bit?
I don't know if you can tell, I'm a little new to CSS stuff but I'm eager to learn 🙂
${fetchFromActor('target',"fly_swatter_active")}$ // true or false, depending on fly_swatter_active
${and(fetchFromActor('target',"fly_swatter_active"), fetchFromActor('target',"fly_swatter_active"))}$ // ERROR: Cannot convert "true" (or "false", depending on fly_swatter_active) to a number
I'll make an issue
Im afraid you can only get pointers since a lot of the needed stats are system specific (e.g. Keys of your HP, damage, etc.)
Makeing Something Like this system agnostic is surely possible but way more effort.
You should familiarize yourself with the basics of CSS. There are numerous intro sites for this. However, in short, give a custom class name to a panel or tab that contains the item you are affecting and then add that name to your CSS so it proceeds your class or element.
.elementThatHoldsInput input{
<commands>
}```
In the picture provided, any panel or tab shown could have the indicated class name. It doesx not have to be the exact panel that input unless you have design reasons to do so.
small question regarding formula.
I know that dice is a random number generator, but is it possible to also write a number generator with the number '0' also being an option?
Instead of writing
/r 1d5
write:
choose at random (0,1,2,3,4,5) or something like that?
just add -1 after the roll?
CSB just uses the one that Foundry is offering and I don't think that Foundry has an option to include 0 (because there are no normal dices with 0s)
1d2-1 generates 0 or 1
Either you subtract 1 or you use the RNG from JS
ok, say its not numbers but words used at random.
One, two, three four or five.
How would I write that?
switchCase([1d2], 1, "zero", 2, "one")
This should work, I think?
also, this one doesn't work, not even the example described on the webpage:
math.pickRandom([3, 6, 12, 2])
I had issues declaring arrays in formulas, and your example does that, so I guess it's the same issue :p
Well, Arrays and Roll Formulas share the same delimiters, so... 😅
fair
I think the wiki says that we can use arrays, tho, so the team might want to change that :)
3.1.1 data types
Yeah, but usage is something different than declaration. fetchFromDynamicTable() e.g. returns an array and you can work with that without issues. But if you want to declare one, you have to look for workarounds.
Ok I found something for the numbers atleast.
randomInt(100)
It gives whole numbers including the number 0
And it works
another question, is it possible to use dice rolls in a mathematic equation in formulas?
and can we have some of these... ahem... workarounds? 👀 I'm in dire need of some arrays :p
Shouldn't be an issue. You can store the roll results in temporary variables within a Label Roll Message
I'd use pure JS if I need to work with arrays in a more complex manner
${roll:=[1d100]}$<br>
${!(roll==100?'crit fail':'')}$
a random simplified example from my character sheet
well, I just wanted to store an array of booleans, hardly complex
Missing closing parenthesis btw.
I meant more like:
${roll:=[2d6]-randomInt(0,2)}$
good eyes, I cut my formula and forgot to add all the closing characters :p
Should be doable
yeah, problem is it's not working so far...
Quick question: is ActiveEffect supported in the current version? Currently I get error messages here "Error: You are accessing the ActiveEffect#data object, which is no longer used. Since V10, the Document class and the DataModel it contains have been merged into a combined data structure. You should now refer directly to keys that were previously contained in the data object.". This message occurs when I try to activate an effect....
Did I miss something here?
Which version are you using (Foundry and CSB)?
Foundry: 11 Stable
CSB 3.0.0
If you mean the Active Effect Library, then there's no usage from CSB. It's only a planned feature to include it alongside the vanilla status effects
is there ever a ',' in roll formulas? That could be the difference between arrays and rolls in CSB formulas, maybe? Or add an "array(x, y, z [...])" function?
I'm just theorising, obviously I don't know much about the project yet, so maybe it doesn't make sense
Yeah, there can be commas in Roll Formulas. So the second approach would be better
btw, thanks for all your answers :)
Just because it's explicitly described here (https://foundryvtt.com/article/active-effects/ ) and doesn't address a specific system: is this analogous to the "Configure active effects" setting in the templates? Or does this refer to a separate module, which I have to install afterwards? Unfortunately I could not find a corresponding module...
The official website and community for Foundry Virtual Tabletop.
I remember that another system I use had to implement this feature, and the pf2e system doesn't have it, so I guess CSB would need to implement it?
but there is something similar already in CSB
when i talked about (active) effects i was talking about the foundry system for effects. you can look at them in the console with CONFIG.statusEffects and you can add new ones with the module "Core Expanded Settings"
you can also look at a single effect on an token like this:
select a token and with the button "Assign Status Effects" (right middle button near the token) put an effect on the token. when you have the console open (F12) you can see that there is an ActiveEffect with id xxxxxx in parent Actor xxxxx created.
you can then use the id of the actor and the id of the effect to look at it in the console with something like: game.actors.get("THE-ACTOR-ID-HERE").effects.get("THE-EFFECT-ID-HERE")
Item Modifiers in items does pretty much the same thing, but using CSB formulas
Except for the possibility of scheduling the modifications....
yeah if you want to for example add stats to an actor then use modifiers (use "configure active effects" in the actor template) like @slow tree just said
yeah for stuff like that you need javascript magic
scheduling, like toggling ON/OFF the effect?
e.g. x seconds, x laps or on/off
ah yeah, you are right for this
Whereas on/off is not the problem...
Yeah I don't think there is any "timing" feature in the system yet, you'd need to go into scripting
I think so
or maybe some modules
just to illustrate - my (programming noob) solution for stuff like burning was this (all programmed myself - no module or CSB for that)
please note that effects have a duration which is usable but not quite consistant if you have for example combatants joining or leaving the combat
as you can see i got readyToRemove and removeEffect as flags which are necessary for me to get the precise timing right
For timing, I found a module that allows me to schedule effects - in combat rounds. Ok... only one round or 10 rounds... but it's a start... 😉
Contribute to Goshagosha/status-effect-timer development by creating an account on GitHub.
🤷♂️ don't know if it works with CSB - you will have to try 😄
It works...
if you want to automate things like burning damage you will not get around applying the effect with some kind of macro - then you will have to integrate this module (if possible) or handle it in another way 😅
so as said before: bad news - this task requires javascript after all
Have look at: https://gitlab.com/tposney/times-up
It also works with CSB because it uses foundry basic functions.
Let's see... Maybe this solution is already enough for me... 😉
question,
When i use a checkbox value in a visibility formula
The visibility does not revert back once I uncheck the box...
How do I fix that?
Show me what you got
the code I use is:
equal(pc_npc_housing_check,'true')
Just use the key, nothing else
Fixed!
Quick Q.
Is there a way through CSB (or a module or etc) to drag an item from one actor to another?
Not through CSB
dang
Is there at least a way to drag items at all from an item container?
question, Is it possible to create multiple templates in the same world?
No
Yeah, sure
So technically, if created right, you can play multiple systems in the same world if you just create the template sheets for it?
Technically, yeah
I'll try it out in a different world to not screw up my work xD Thank you!
Another quick question. Is there a way to get the item's unique modifier through ${}$?
a label inside an item container has the label text ${item.stack}$, which is a number field. i want this label only to be displayed when this number is greater than 1, so i put item.stack > 1 in the visibility formula, but it doesnt work. what would be the correct visibility formula please'?'
I would give the label a key (i.e. "stack_display" or something) and make the visibility formula stack_display > 1
doesnt work either. now it shows nothing no matter what the number is
oh! shoot, sorry.
Is the label's text JUST the number?
yes
This will be possible with the next update, because the visibility formula currently hides all cells in a column instead of only the non-matching ones
👍
I have a series of items from the same template with unique names designated unique in containers that are added by dropping a folder onto the character sheet. If I delete one unique item , I cannot add it in as a single dropped item. If I re-drop the folder, one of the unique items duplicates, usually the last one in the container. I have to delete all items and re-drop the folder to solve the problem. Is this a bug or am I missing something?
I have also found that if I drop single unique items with different names onto empty container, I can only add a single unique item. Dropping a unique item with a different name is not added to the container. I hadn't noticed this previously as I was only dropping folders of test items. Now I am (hopefully) approaching completion and just discovered this problem.
Hey!
There's no way to use fetchFromDynamicTable() with two filtering columns, is there?
Or maybe use a logical combination of two columns as filter, like col1 and col2?
Hello!
I have an absolute beginner question (despite Doku), where I just do not get on:
I have two fields where I manage the current life points:
(1)
numberfield_lpakt_label (Type: Label) : Label text (numberfield_lpakt)
This field is displayed to the player in the character sheet.
(2)
numberfield_lpakt (type: Number field)
With this number field I can adjust the life points accordingly.
I now want to apply an effect, e.g. burn, to the character, whereby the damage should remain even after the effect has ended. For this I have entered the following values under "Configure modifiers":
Key: numberfield_lpakt_label
Op.: -
Value formula: ${setPropertyInEntity('self', 'numberfield_lpakt', "self.numberfield_lpakt - 20")}$
I have also tried "selected", unfortunately without success.
Probably I have here a basic understanding problem, whereby the professionals among you can help me surely easily.
Thanks a lot!
Just enter 20 into the value formula
Unfortunately, this does not work, because the value is then set back to the original value. The damage should already be permanent...
That´s not how modifiers work. Modifiers are always temporary, meaning that if you remove the item, the modifier is gone and the original value is restored
Hmm... ok... just so I understand it correctly: so it's not possible to change values permantently by the effects, correct?
yes
Ok... then I still don't really understand such effects that cause damage, like burning, bleeding, poisoned.... but, then that's how it is...
All right... Thanks for the quick reply!
These effects require more configuration parameter (e.g. start-duration, end-duration, tickrate, etc...)
I have a dynamic table where a delete button (macro) is only to appear in the first record (key 0). My current solution for this is to use JS to renumber a variable ("sn") to each time a macro adds a new record to the top of the table and a label (macro) wtih sameRow('sn') == 0 ? "Delete" : "" however this seems to be "always running" and causing problems with giving elements focus via mouse click. Is there a way better way to achieve this effect? Or do I have to wait for the next release?
Well, the thing is that formulas in the Label text are rerun on every change (including some fields with focus). And that is the intended behavior, so...
Do you have an ETA of when hiding individual elements in dynamic tables will be available or is this "farther off" on the release schedule?
Yeah but I dont have this problem with other lables, just ones in dynamic tables with ${}$
Should be the next one because the commit already exists for that
Hey guys, am I anywhere near the ballpark on this one?
Trying to put attribute numbers on the character sheet. I already used [ Configure attribute bars ] making both HP and EP.
Small tip: Don´t use complex attribute bars at all. Let the system generate the ones for you from number fields
so it'd work to make curHP, maxHP and tell the resource tab on the Token to use those for the bars?
Your number field needs a max-value, that´s all
So this is a lot closer then...?
Yeah, then you can select the corresponding attribute bar
And the max-value is not referencable btw
Ok. On the flip side of that though where it ought to show the max I could put the formula to get what it ought to be:
/ ${startingHealth + strengthConditioning}$
That'd work, right?
Yeah, a formula should work
In a way, it works even better... if, over the course of play curHP max is inappropriately set... this will show what it's supposed to reset to.
Thanks @formal goblet ... wait .. Martin as in the author of those exceptional CSB examples available for json importing?
Uh, yeah
Dude... I'm a visual learner and hardly anyone understands what that means, but, for me: Functioning, practical examples that I can pull apart, shatter to pieces and re-import are HUGE.
TYVM.
sure, np
Hey, I've got a fresh puzzle rotting my brain... When displayed as a label the formula in Green works flawlessly. Copy/Pasting to the Default Value field of a Text field, it becomes totally broken. (In the picture I mean for it to be 6 based on the numbers.
Can the Default Value control of a Text field take a calculated value?
Alternatively, if I give this Label a Component Key, can I access the value of Label (w/o the prefix & suffix)?
Yeah, the prefix / suffix won´t be referenced
Let´s say that formulas for default values don´t work
I'm starting to have lag issues with my game. I'm not exactly sure what changed.
Reloading the template/sheet writes 31.6k lines to the console and there's a good 3 seconds between every single change to the character sheet where only days ago it was instant.
I have 10 %{formulas}% on each actor sheet, so I wonder if those are the cause of this new lag, but it's honestly getting to the point where using this character sheet is unusable for character building with all this lag. Are there any tips anyone has for managing lag?
https://github.com/Chiefwiggy/3Hex-Foundry/blob/main/current_3hex_actor_tempalte.json (link to the aforementioned actor)
Why does the second line read the old item.armrEquip instead of the one set by the first line?
I just cannot see where I'm wrong...because I know I am!
Any idea?
Is there a good way to indirectly reference actor data in an item. I have an item (a Skill) that has a dropdown that selects a stat name (ie Brawn) and I have an object on the character sheet that matches the stat name. I would like to pull the data based on the dropdown value. Fetch From Actor and ref() dont seem to work or I am doing it wrong. I can do it with JS but non-attached skills throw DATA PREPARATION errors in console when try to access the items parent regardless of attempts to !PARENT.
Basically it´s doable. But I´d suggest to always define a fallback-value in cases an item is not attached to an actor.
Is sorting item containers by name a pending feature? If so, vague ETA on how far off?
Also the ability disable showing the default item name in item containers?
I have that already implemented, but I want to add it for Dynamic Tables as well.
Regardless, I can´t give you an estimate because it highly depends on Linked, because he also has some feature-tickets and he´s the one who´s doing the releases
Wasn´t planned, but I guess I can add that without much work
The reason for the request is to combine fields such as show name (other field) as a single entry instead of being stuck with the table structure adding extra space.
Oh, so you want to disable the whole column? Not just the name?
In retrospect, perhaps the ability to modify the displayed name of the item in the container, perhaps by formula instead of disabling or hiding, to include JS compatibility.
Heyo, I just noticed yesterday that the active effect modifiers I've had set up are no longer effecting actors. Was something updated that I need to change? Like a change in syntax or something? My modifiers are really simple, like adding and subtracting 2 or setting a stat to 0.
There was no update from us since a month
hmmm maybe something else updated that broke it then
Any modules loaded that can affect modifiers?
Monk's Little Details, but that hasn't been updated for 2 months
I'll do some digging. Was kinda hoping it was as simple as a syntax update, but its not, so I'll have to look deeper 🔍
Any hints in the console?
no errors
Meh, then idk
anyone know how to copy elements on a mac? On PC its Strg + Click/Drag but on Mac i cant find the right key. Should be "Command" but it isnt
Hello!
Is there a possibility to hide the text and show only the image?
In what kind of context?
I have a container that lists all the armor parts.
In parallel, I also have a schematic view of a person who can also pick up certain items on certain parts (head, body, arms...) when they are active.
With this view I only need the graphic, but no text...
Ok, I may not have delved too deep into this part of it yet, but from your first question, I had trouble even working out if you meant stuff on the canvas or the character sheet... Thank you for the clarifying detail...
I think with a CSS trick. Have a look here: https://discord.com/channels/170995199584108546/1154507115172466810
Hello, could I ask for a bit of help?
#warhammer message
I am trying to modify a char sheet and can't seem to be able to sort table entries properly
I mean, they group instead of swapping places
There is no swapping in tables, you need to remove the first label (put it anywhere else in the character sheet), then move the second in its place
afaik
fck...
You can create an additional row and move your stuff in empty slots. This way you don't have to delete components
This means I have to copy-paste all the formulas that are to the right of the damn label
Yeah, I made the input of what I needed but now I want to sort it alphabetically
Well, you gotta do it by hand 😅
<insert_bash_head_on_wall_emoji>
There's no autosort-function for normal Tables (and I don't think there will be one in the future)
_<... this will require a lot of whiskey.
When I try to pull the entries up into place, they group in a bubble instead of placing between...
That's why you need empty cells, so the moved component doesn't group with the target-cell. This way, the source-cell from where the componet got moved gets freed and you can move another component in it.
Ok, How do I put a blank row in the middle somewhere?
Ah...just more free rows...
testing...
Ah...this may work
Ok, now I have to play reverse-tetris for a few hours
Ok, do I have to do the same 'vertically' in columns?
Great! It works! Thanx a lot!
Phew, one table is done. Now for the worse one.
Unfortunately, the filters in the item containers do not work for me:
I have two checkboxes in the item template "Armor": Active and Type (head, body, legs...).
Now I want to collect the items with the template "Armor" in one container, which also works.
But now I want to collect only special items in the container if the checkbox Active = true and the respective checkbox of the type, e.g. Head = true.
For this I have entered the following in the filter:
Field key = item.key_item_armor_activ
Op. = is
Filter value = true
and
Field key = item.key_item_armor_head
Op. = is
Filter value = true
Now the corresponding items should actually end up in this container, right? Where is my error here?
Anyone have an idea?
Hab kein Mac 😅
I think those filters only take numbers.
Remove the item.-prefix
I was wrong, then 😅
Perfect! Thanx! 🙂
Is there a way to enable scrolling numbers to show characters damage with CSB?
I made an "item" as a toggle-able macro. How can I enable it for tokens a.k.a. give the item macro to players?
Hey, good afternoon!
Anyone using CUB with CSB?
I saw an earlier discussion, but dind't have the answer I was looking for.
I wish to increase/decrease an attribute when I active a determined effect.
Tried to use the @ attribute key and the straight attribute key with ${}$, but none worked.
Any tips?
CUB is not working with CSB. It will even cause a bug: https://gitlab.com/custom-system-builder/custom-system-builder/#313-conditional-modifier-list
I'm looking at this right now, to be able to use the modifier, I will create several items one for each condition and add them on a conditional modifier list on the character sheet.
But, the key that I will use for each condition needs to be already existant on the actor? If yes, what would be the best type field to create? On the instructions says that it should not be text/number.
Either Label or hidden Attribute
okay
they key needs any special formatting or can be used straight the key that is related to the hidden attribute?
straight the key
Errrg..are you asking how to give an item to a player?
Sort of. I created a macro that I would like to be an item.
But I have Foundry for like... less than 2 weeks and still struggling.
Lack of a defined system doesn't make it easier
If I cannot make it an item I'll just go with a macro.
You can not make a macro into an item.
But you can do any label call the macro. And the label can be in an item.
In a label roll message place:
%{return await game.macros.getName('your-macro-name').execute()}%
Like... on a character sheet?
Can be in character sheet or inside item. For the last one the player has to open the item.
I'm currently creating the char sheet
I my self made it so that the item container description is calling a makro form a textfield inside the item. So every item can have its one macro that can be called from the item container list.
Just make it that it knows its own state and invert that before you update it
I have zero idea what you just said...
Is there a way to count items in a specific item container. I have multiple containers that use the same template but with filters.
I know I need a JS course from scratch... I know
Nope. You cannot get any data from Item Containers. You have to work with the items directly
oof
Only if a second run of the macro resets to original settings.
The macro itself is currently perfect - is an on/off switch by itself
Then isn´t it enough?
Not exactly - I somehow need to enable this for the 'player' account when in session
and also construct a proper 'player' account
it all works fine from the GM account
Oh
I assume the item stores the parent container. I cannot locate that on the item. what is the path?
Well, you can use the entity-object and pass that to the macro: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#334-calling-macros
The Item Container doesn´t handle any storage-behavior, it only holds links of the items. Items are stored on the actor directly. Nothing inbetween
Hi, I have "working" damage dealing. I mean... it works when I test it. But when I give my players a chance to play with it, they get such messages:
That´s a Foundry thing. Players generally lack the permission to update actors they don´t own. Lookout for the module "Warpgate"
Can someone show me how to set-up a 'player' account where it has proper permissions to control all player tokens and use macros?
We are playing F2F so there will not be anything on-line.
only screen display
Just go to 'user configuration' under general setup panel, then you can create player accounts. Keep in mind that generally players cannot control tokens for actors not assigned to them. To assign an actor to a player, once you have users accounts you can r-click on the actor and in 'ownership' change settings as needed. You might assign a user as 'gm assistant' to give larger permissions.
I'm fiddling with that but it's confusing.
Also - when does the character sheet actually stop being 'buildable' and start being fillable like in creating an actual char?
Because right now I can only build tables and stuff
Please be more specific.
That´s the Template you´re working on. That acts like a blueprint, so you won´t be able to play with that. You have to create an actor and select the template, so that you get a real sheet.
The permissions you ppl talk about are NOT in the account permission list somehow
You can define roles there:
If you want more detailed permissions, go to "Configure Permissions"
I've been trying to figure this out for hours today.
Still does not work.
Actors are created - sheets are stiull 'buildable' not fillable
"Configure Permissions" seems to be almost useless
Important is that the type is "character", not "_template" when creating a new actor
Oh shi.... There we go! That's the problem, I believe
Ok, I'm re-doing actors from scratch now
Go through this tutorial of Foundry: https://foundryvtt.com/article/tutorial/
A basic GM-focused introduction to the layout of Foundry VTT, providing all of the beginning steps required for setting up a game for your players.
Yeah, it worked
Darn. I have several panels that hold item containers and other elements. I was hoping to hide the entire panel when the container was empty.
Well, you can still track the items an actor has and filter accordingly
Yessssss.... almost good
Ok... one last thing really but that's pretty much why I got Foundry.
I made rollable tables for critical damage effects from my core rulebook and I need to connect this to the char/NPC sheet via "Always HP"
What I mean is... I input damage done - press wound - Always HP subtracts this from Wounds on char sheet and the overflow goes into crit tables and the outcome appears in the 'critical damage section'.
Is that possible?
I will have to mod "Always HP" to add hit locations but that's another matter
One of the tables
Does anyone know IronMonk?
I am unclear on User Input Templates. I need to pass the results (a number) from an input template to a macro.
You can access it directly in the Label Roll Message after the User has confirmed the input.
From there you can pass it to the macro
I messaged the author of Always HP and maybe we'll figure out a version for my needs.
Is it possible to display more than just the name of the Item when displayed in an Item Container? If so, are there any good examples I can see. I've read through the GitLab docs on Item Containers twice now and it's just not clicking. I tend to do better when I can see a fully realized example that I can pick apart.
I'm a Visual Learner too @unreal wadi, I wouldn't mind knowing this myself. (watching in expectation)
Beautiful. Thank you!
how can I fetch information from items I made to actor sheet? what code do I execute with it?
Tried messing with it for a while, but I can't seem to find how to make my damage work through that.
As of now, my damage "is done" through this code:
${#setPropertyInEntity('target', 'PCHealthPointsAct', "target.PCHealthPointsAct - damageDealt")}$
Have you tried the Module Always HP?
Will it let me automatically change token's HP with a formula? I thought it only allows for manual changes
Mmm... sorry, it is a hud that takes user input on demand and hurts/heals manually. Didn't realize..
if you're looking for a code-based solution, have you asked in #macro-polo ?
Well... Found some example code for warpgate after digging through macro-polo, but i am too green to reverse engineer and use it:
const damage = actor.system.attributes.dmg.value;
for(const token of game.user.targets){
const hp = token.actor.system.attributes.Pv.value;
const newHP = Math.max(hp - damage, 0);
await warpgate.mutate(token.document, {actor: {"system.attributes.Pv.value": newHP}}, {}, {permanent: true});
}```
Speaking as one who's pretty green myself, just keep it respectful and the folks that watch Macro-Polo are typically happy to take simple as well as complex questions. I'd start off by showing very clearly what the script needs to do and then show off that little clipping you gave in the message I'm responding to.
Also, they'll really appreciate it if you wrap your code in backticks, like this:
```js
code
```
That triple backtick code block syntax colourizes the code.
${#setPropertyInEntity('target', 'PCHealthPointsAct', "target.PCHealthPointsAct - damageDealt")}$
Thanks for tips, gonna use them 😉
Jumping with question that arose in macro-polo for me: How do I execute macro in CSB?
Thanks, I'm still fighitng with that damage to targeted token
@formal goblet I've got macro code for dealing damage from guys at #macro-polo, and I am trying to set it up in the roll. Below is the macro, to which I need to send my damageDealt variable.
console.warn(damageDealt);
const damage = Number.isNumeric(damageDealt) ? Number(damageDealt) : null;
if(!damage) {
ui.notifications.warn("No damage was dealt.");
return null;
}
const target = game.user.targets.first()?.document;
if (!target) {
ui.notifications.warn("You have no target.");
return null;
}
const hp = target.actor.system.attributeBar.PCHealthPointsAct;
const value = Math.max(0, Number(hp.value || 0) - damage);
return warpgate.mutate(target, {
actor: {system: {attributeBar: {PCHealthPointsAct: {value: value}}}}
}, {}, {permanent: true});
I was trying to set it up in the same Roll button just passing it as ${damageDealt}$, which has this code for counting the damage:
Obrazenia:
${damageDealt:=[:MeleeWeaponFixedDamageDice:]+PCAttrSTR+PCWzmocnienieUpgrade+PCZwieCiezUpgrade+PCOstrzenieUpgrade+generalRollModifier}$
But it doesn't seem to send the value of damageDealt to macro code (OFC covered in %{}%) which is located just below that
Disregard. Got it to work!
For other people that might be looking for it, that's what I've got in Label Roll Message:
${damageDealt:=[:MeleeWeaponFixedDamageDice:]+PCAttrSTR+PCWzmocnienieUpgrade+PCZwieCiezUpgrade+PCOstrzenieUpgrade+generalRollModifier}$
%{PCDamageDealt=${#damageDealt}$;
console.warn(PCDamageDealt);
const damage = Number.isNumeric(PCDamageDealt) ? Number(PCDamageDealt) : null;
if(!damage) {
ui.notifications.warn("No damage was dealt.");
return null;
}
const target = game.user.targets.first()?.document;
if (!target) {
ui.notifications.warn("You have no target.");
return null;
}
const hp = target.actor.system.attributeBar.PCHealthPointsAct;
const value = Math.max(0, Number(hp.value || 0) - damage);
return warpgate.mutate(target, {
actor: {system: {attributeBar: {PCHealthPointsAct: {value: value}}}}
}, {}, {permanent: true});}%
I just need to figure out why that "object" shows up :/
warpgate.mutate() returns an object. And you´re returning that from your script, so that´s what you get 😅
If you want to hide that, just wrap it with ${#}$
return warpgate.mutate(target, {
actor: {system: {attributeBar: {PCHealthPointsAct: {value: value}}}}
}, {}, {permanent: true});
Which part of it should I hide? Tried closing all between return and ; but it just stopped working at all and threw error in the console xd
You shouldn´t modify your content of %{}%, that´s basically your whole script. What you should do instead is this here:
${#%{YourScriptContent}%}$
It works! Now I can go back to ground-level stuff! 😄
question, if the permission to see a component is set to game master, the player shouldn't see it or anything inside the component right?
Positive
To be fair, you can just test it for yourself real quick 😅
Ok, so the first panel is what I see, the second is what the player sees, but the world maker panel should be hidden to them, but isn't.
And for some reason, despite having the same permission, the show/hide panel button is hidden, but whatever is underneath isn't...
Is everything to be hidden inside the panel that has those permissions set?
I assumed it would, but even when I change permissions of the visible and invisible components, nothing changes...
In fact, It kinda already does that with some components and not with others...
Maybe there's something with the formula you use to make it disappear?
well no, the component the player doesn't see doesn't have a visibility formula. Only the role permission.
The worldmaker panel does have a formula, but i think the formula overwrites the role permision...
I just fixed it, by putting the entire panel inside the table that is hidden and doesn't have a visibility formula
Sorry to ask what is probably a stupid question, a bit of a beginner here. I'm having issues setting up attribute bars the way I'd like. For example: I'd like the max value of an HP bar to be the max value of a particular actor's maximum HP value, rather than a static value. I'm sure I'm just missing something obvious but critical lol
Nevermind lol. Still getting used to the formulas and stuff
Quick Question
I have a dynamic table with Dropdown lists. The key linked to the option of these dropdown list are actually hidden attributes that I need to fetch and sum in the same Row.
${sameRowRef('mana1', 0) + sameRowRef('mana2', 0) + sameRowRef('competence_liee', 0) + sameRow('Mod', 0) -2}$
mana1, mana2 and competence_liee are the keys of the columns containing my dropdown list. Mod is a number field.
Problem is the label is returning an error, am I doing somehtin wrong?
You're missing a ref() then, because you have 1 layer of indirection.
Ookay I see like this ?
${Ref(sameRowRef('mana1', 0)) + Ref(sameRowRef('mana2', 0)) + Ref(sameRowRef('competence_liee', 0)) + sameRow('Mod', 0) -2}$
Maybe not cause it's still showing up an error, I probably misunderstood what I had to do
Wait, why is it sameRowRef()? You only need sameRow(). And functions are always in lowercase
And you should move the fallback-value to ref()
You just reminded me that I should implement this formula in my own sheets xD Thank you!
OKay thanks!
hi, I've got a question about if it's possible to do something with CSB.
I'd like to create a dynamic table, but have one of the columns flip between being a drop down list or a number entry based on if a checkbox in the item is checked or not.
I'm trying to do that by putting a visibility formula in:
sameRow('vehicle_armor_fixed_magic',false)!=true
But it doesn't seem to update based on the changing value?
Martin's examples relating to an edit checkbox simply use edit and not(edit)... Have you tried:
not(sameRow('vehicle_armor_fixed_magic',false))
nope, also doesn't work
based on the name inside sameRow, the dropdown should be shown if the box is ticked?
States are:
- Checkbox ticked: show the number input
- Checkbox unticked: show the drop down
Ok, what about ...
...magic',true)
-- and --
...magic',false)
just has both of them show because it's apparently not getting the value from the attribute, it's just using the fallback value
The final display looks like this (with the drop down shown). Ideally would be able to swap between the drop down and a number input.
Where is this example?
It's a json you can import giving you tons of examples designed to work together. This is a clipping of the Practical Example.
A - checkbox named 'edit'
B - displayed when not checked
C - displayed when is checked
right, I think the part that is going wrong here is because it is in a dynamic table
cause, I had no problems doing conditional display in the non dynamic table stuff
That's what I was afraid of for you... Sorry I'm not even more experienced with CSB personally.
It's a pitty Foundry doesn't have something like a Combo Box (Dropdown list that can accept a typed out value)
I mean, that exists in basic html using an input with a list property and a datalist element
Not useful if you need to be able to translate the option text, but for this personal project, it'd work. But I don't think CSB has a way to do that.
... dang. Closer than I thought. 🙂
I think this is just a bug in how CSB works. Gonna submit a report and see what comes of it.
ok, setting aside the conditional display above for a bit.
How can I sum a dynamic table?
E.g. I want to get the total of all the sizes in my vehicle_armor_table and display it in a label.
sum(fetchFromDynamicTable('vehicle_armor_table', 'targetColumn')) for each column you want to sum
So, another question. Is there any way to do a multi-row dynamic table item? E.g., if I wanted to put the description for this item below the checkbox and inputs:
Could anyone help me, I want to setup a roll on the sheet where if a hidden stat comes out to 0 it will perform a different roll.
since this system I am working on gives bonus/takes penalty dice and if the number of dice would be 0 it instead rolls 2d6 with disadvantage
Use an IF? It is explained pretty good on git. Unfortunately I can't link it now
The following roll message lets me activate an effect of an item.
${
setPropertyInEntity('item', 'is_effect', "item.is_effect ? '' : 'true'")
equalText(item.hinweistext, '') ? '' : item.is_effect ? '' : notify('error', item.hinweistext)
}$
It creates a chat message but i dont want any message at all. How can i prevent his?
This is the message:
You can prevent it in the next patch
Personally, the solution is to not use table display, but instead use css grid. Figured out a solution for my use case by just switching the table to grid display, moving a lot of the internal bits to display: contents;, and then locating certain fields on different subrows
Now if I can just figure out a way to get conditional display to work in a dynamic row. Any ideas about that?
The visibility formula is probably missing the reference to the dynamic table, so...
I had a similar issue with Item Containers. But that one is fixed for the next patch
Yep, that's what it looks like to me. Reported it in this issue, which I just realized is slightly misnamed
*renamed issue to reflect that it doesn't work
Btw, ! is not usable as the not-operator 😅
Ah!
I'll probably hack together a work around using css based on the checkbox state (assuming that :has works in electron.
Dumb question probably but I can't put my hand on the Css Class for journal background with the inspecting tool, does anyone know what it is ? Also text while modifying a paragraph
I use white text cause my background is dark, but the background of journal is still light. Also when I modify a paragraph field the text turns black, and only become white again when I save text. Problem is, I can't see what I write
Hey, it seems that the code from this wiki page is not working anymore : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Conditional-text-color-formatting
```Doesn't work
Adding the ! at the start of the formula makes it work as expected :)
It still works. It was meant to be used for Label text, not the Label Roll Message. There you need the ! ofc
ho my bad, missed this! thanks
Has anyone tried to do a token-action-hud mod for CSB?
For some reason this isn't working for me in a macro I'm working on
<h4 class="dice-total" style="color:$!{concat(${outcome} === 'Fumble' ? 'red' : '', ${outcome} === 'Crit' ? 'green' : '', ${outcome} === 'Matched' ? 'blue' : '', ${outcome} === 'Normal' ? 'black' : '')}$";>${outcome}</h4>```
everything works mind, it's just not showing up with color per the conditional formatting
thanks
working on kind of a complex script/formula to total up a stat.
If the character is piloting their vehicle, then the defense needs to be calculated using the vehicle's armor stats. If they aren't, then it uses their value in a game stat + their armor's modifier. Here's what I've tried:
%{
const vehicleArmors = Object.values(actor.system.props.vehicle_armor_table).filter(armor =>
!armor.deleted &&
armor.active);
const inArmoredVehicle = actor.system.props.isPiloting && vehicleArmors.length;
if(!inArmoredVehicle){
return ${ref('ins_current')+ ref('skillmdef_mod')+ ref('mod_mdef') + sum(fetchFromDynamicTable('equipment_table', 'custom_weapon_mdef', 'is_equipped', true))}$;
}else{
const armorStat = vehicleArmors.find(armor => armor.armor_magic_attribute !== 'STATIC')?.armor_magic_attribute;
const stat = +(armorStat ?
actor.system.props[`${armorStat.toLowerCase()}_current`] :
0);
const mods = vehicleArmors.reduce((total,armor) => total += (+armor.armor_magic_bonus),0);
return ${
ref('mod_mdef') +
ref('skillmdef_mod') +
stat +
mods
}$
}
}%
But, that just winds up getting returned as a string in my test PC sheet
Other attempted code:
${
inArmoredVehicle := %{return actor.system.props.isPiloting &&
Object.values(actor.system.props.vehicle_armor_table).filter(armor =>
!armor.deleted &&
armor.active).length;}%
stat := %{
return +(Object.values(actor.system.props.vehicle_armor_table).filter(armor =>
!armor.deleted &&
armor.active).find(armor => armor.armor_magic_attribute !== 'STATIC')?.armor_magic_attribute ?
actor.system.props[`${armorStat.toLowerCase()}_current`] :
0);}%
mods := %{return Object.values(actor.system.props.vehicle_armor_table).filter(armor =>
!armor.deleted &&
armor.active).reduce((total,armor) => total += (+armor.armor_magic_bonus),0);}%
switchCase(inArmoredVehicle,
false,
ref('ins_current')+ ref('skillmdef_mod')+ ref('mod_mdef') + sum(fetchFromDynamicTable('equipment_table', 'custom_weapon_mdef', 'is_equipped', true))
true,
ref('mod_mdef') +
ref('skillmdef_mod') +
stat +
mods
)
}$
Is there a way to reload the sheet via a command? I have a macro that sets a number of fields on items but item.update([]) is performed after every update which is slow. If I can perform the 10 field updates and than do a single sheet update, response would be faster.
Well... It seems that it's still not doing damage to the target :/ And it's not sending any errors to the console o.0
Had a session yesterday and we found it out :/
How to Reroll Dices?
In my Roll Formula for TalentChecks i roll 3d20 and compare them to certain attributes like this:
Some Actors have abilities to reroll a Dice to alter the result of the Check.
How d i do that? Do i need Macros for this?
And the End of the Roll Formula i would like to have 3 Buttons. If i click Number 3 it would reroll the 3. Dice and update the value of "roll3", keep everything as it was and see the new result. Has anyone done this before?
Input prompts for rolls only appear before the roll is sent to chat I believe, and label roll messages I believe cannot pull the value of a roll from a previous message in CSB without probably using scripts.
What you might be able to do is set a hidden value on an actor sheet for each roll using setPropertyInEntity to have the actor track whatever each roll’s most recent value was, and then you can have a second “reroll” label on the sheet that rerolls one of those values and then adds it to the other two that were saved. You can also use this with the alternate shift+click roll feature if you want the reroll option on the same label. You can just make those values invisible with the visibility formula so it’s not ugly on the sheet
Is there an easy way to have the roll message look at a check box state? I want a skill roll to be "Roll 1d6, but if trained checked, roll 1d6+1d4"
Like this, I want to click the skill name and roll a 1d6. or a 1d6+1d4 if the checkbox is ticked
should be a simple boolean. Try ${<checkbox key> ? [1d6 + 1d4] : [1d6]}$ in the label roll message field of the skill name label component. Might need ' around the checkbox key I can't remember.
Thats enough to get me going I think. Thank you!
I'm not sure if I'm missing something here ... I tried to add an "Item Container" column to a dynamic table, to - in this case - have a place to "drop in" skill items so that they pre-configure stuff like name and attribute (turn them to labels instead of text/dropdown entries). But when I do so, the item appears in all the rows, not just the one I dropped it into.
Is there a way to get these numbers to Add?
The way you suggested @zinc verge worked but it would roll the number twice and I think my players would be irked to see when the "unskilled" roll was higher lol
So now Im trying to get it to roll each die seperately and then add. if the checkbox is not checked it adds 0
I'm using a "record the rolls, print them" approach most of the time. Example:
${#r1:=[1d6]}$${#r2:=[1d6]}$${#base:=sameRow("base")}$${#bonus:=ref(base) + sameRow("bonus")}$
<h2>${!sameRow("name")}$</h2>
<p style="font-size: 1.5rem;">🎲${!string(r1)}$+🎲${!string(r2)}$+${!string(sameRow("bonus"))}$+${!string(ref(base))}$ (${!string(%{return '${base}$'.toUpperCase();}%)}$) = <strong>${!r1 + r2 + bonus}$</strong></p>
it's rolling twice because your formula is telling it to roll a separate 1d12 in addition to the boolean I recommended. You'll want to format it differently for it to add, but I'm not entirely sure what the 1d12 is so I'm not immediately clear on how to advise you further
the 1d12 is replacing the 1d6 now, I changed the math of the game around a bit
so now its roll 1d12 and +1d4 if skilled
In your case, it would look something like this:
${#r1=[1d12]}$${#r2=(SkillTrainedResist ? [1d4] : 0)}$
🎲${!string(r1)}$${r2 > 0 ? concat("+🎲", string(r2)) : ""}$
when you set a parameter in a dynamic table, you're setting that parameter for an entire column. If you were to do this same thing with a dropdown, the exact same dropdown would appear for every additional row you created. I'm not sure dynamic tables are the way to achieve what you're going for. what I think you're trying to do though should be achievable by just using an item container by itself. You can set columns in an item container to display a given item's components as a label already
${SkillTrainedResist ? [1d6 + 1d4] : [1d12]}$ I believe is what you're looking for then
Yeah, I tried a plain item container, but I couldn't make it so that some columns of it (the rating, in particular) are editable. I might look into that more.
oh yeah they won't be editable from the item container listing itself.
See, and that's a problem, both for the skill listing and for the actual inventory (I'd very much prefer to not force my players to have 120 items in there just because they have 120 tons of FF armor spare).
for clarity, if you're trying to get the 1d12 and the 1d6 + 4 to both roll and add to each other, then Akjosch's formula is what you need. I was at the understanding you were wanting the formula to pick one of two rolls depending on whether or not the checkbox was checked though. If that's still what you're looking for, then my new formula should be what you need. If you change the math again just replace whatever the old number you had in there was with your new one
oh okay so you're trying to set up a quantity counter that's editable from the item container itself. Yeah unfortunately I don't know of a good method for that. In my game I have the quantity listed in the container but I still have my players open up the items to edit quantities. It's not beautiful, but it works. I'd love to know if you find a better alternative 🙏
sorry yea now its you always roll 1d12. but if you are skilled you add 1d4. the math worked out better changing the D6 to a D12 and shifting the DC up. So I want it to roll 1D12, and then add 1D4 if the box is checked. if it rolls the D12 twice my players will be upset when they see they would have succeeded if they had not been skilled etc lol
oh okay, that's just ${SkillTrainedResist ? [1d12 + 1d4] : [1d12]}$
That works technically, Im just trying to find a way to avoid this:
Where my player would see "If I had rolled unskilled I would have passed!"
if there was some way for that D12 to be the same in both
petty I know lol but I just see that being a frustration with a few people in the group
oh weird, it shouldn't be rolling both like that, but I think I know why it might be doing so. Okay, instead of having the boolean be in the roll message, have the boolean be a label within the table. You can set it to not be visible with the visibility formula. The formula should look like this. ${SkillTrainedResist ? 1d12 + 1d4 : 1d12}$ Then, take that label's key and make your new roll message just be ${[:<boolean key>:]}$
that should make it so your roll message is just referencing whatever the current option between 1d12 + 1d4 and 1d12 is, instead of rolling them both. Idk why but I think I've seen the devs here talk about booleans rolling both results in chat messages and I'd forgotten about that initially
Akjosch's solution also should work, though I think you'd need a : before the = for the roll keys. Should look like this
:game_die:${!string(r1)}$${r2 > 0 ? concat("+:game_die:", string(r2)) : ""}$```
I think I have a partial solution (with item container for the skills), which works for small values that don't change much. Essentially, I add three columns. The first is styled as a button, label content "<", label roll message:
${#setPropertyInEntity('item', 'rating', 'max(0, (item.rating ? item.rating : 0) - 1)')}$
The second is a plain label, component key rating, label text ...
+${item.rating ? item.rating : 0}$
The third is a button-styled ">" label, again with a label roll message:
${#setPropertyInEntity('item', 'rating', 'min(9, (item.rating ? item.rating : 0) + 1)')}$
This works since the items are copied into the item container, so the rating values don't cross-pollinate from one character to another.
Unfortunately no because this doesn’t have a key to be referenced by
Now I have to either style the roll message into something useful ("Player X raised/lowered the skill S to V") or get rid of it somehow.
At least, I don’t believe the name functions as a key 🤔 you might want to try it but I don’t think it’ll work
The annoying part is that the support for character-specific item attributes is clearly there, in the system, it's just not exposed to the UI nicely.
This is pretty clever lmao I like it. If you know how to script, you might be able to have the buttons function via a macro instead and just have the roll formula call the macro
That should kill the chat message
Thanks for the help! Wound up going with this formula and its exactly what I wanted:
${r1:=[1d12]}$ +
${r2:=(SkillTrainedResist? [1d4] : 0)}$ =
[[${!string(r1+r2)}$]]
Question about the replaceAll function. Can it accept regEx converted to string? e.g. /my\s+text/ => 'my\\s+text'?
I think I have what is probably a very basic question. How do you access any of the values in an Item Container from outside of that container? Like let's say a basic encumbrance system that needs to total up all the item's combined weights.
You can access them via JavaScript (https://gitlab.com/custom-system-builder/custom-system-builder#45-scripts) via entity.items. You get all of them as an EmbeddedCollection data structure (https://foundryvtt.com/api/classes/foundry.abstract.EmbeddedCollection.html), you need to filter for what you need yourself.
Oooh, I saw reference to Entities. Thank you!
Hello!
I have a problem where I unfortunately get nowhere:
Actually no big deal - at least I thought:
I just want to save or display the value I calculate via the cube button in the field "key_item_effect_active_value_label" (field is stored in the item template).
For this I have set on the button
${#effect_value:=[:item.key_item_effect_value_cube:]}$
${setPropertyInEntity('item', 'item.key_item_effect_active_value_label', ${effect_value}$)}$
entered. Meanwhile I tried everything possible: "self", "item", ${effect_value}$ without or with quotes/single quotes. Nothing worked...
Can someone help me and tell me where my mistake is?
Thanks a lot!
I wonder if this is similar to the issue I was having. Your initial attempt tp set the effect_value might not be getting anything from just item.stuff perhaps?
I'm still learning this, so it's really just a guess.
Above someone told me that in order to grab item.things I have to use javascript to get the actor's entity.item
2nd arg without item.-prefix
It worked! 😀 Thank you!
Hey there,
Is there any way to filter a fetchFromDynamicTable() depending on 2 columns?
Example : I want all rows that contains 'active == true' and 'stat === "strength"'
Would like to change the look of my primary ressources on the actors cheet. Right now they look like this:
Would like them to look like health bars. Has anyone done this with CSS perhaps?
Can visibility formula use something like && or and() to use multiple conditions as critieria such as checkbox && brawn < 5 ? 1,0
I havent been able to get this to work.
Try:
brawn < 5 && checkbox < 5
No idea if the and works, but in normal js, you need to put the comparison on both sides of the &&
Hi...
I actually thought I understood - but apparently not:
I copied the instructions from another field in the same item (where it works) and replaced only the variables. Still, unfortunately, it doesn't work.
${duration_value_new = item.key_effect_duration_label-1}$
${setPropertyInEntity('item', 'key_effect_duration_label', ${duration_value_new}$)}$
Can anyone tell me where the error is?
to use and (or or) ,use: and(arg1,arg2)
Trying to set a property on the sheet in response to a roll being made. The display of the property on the sheet is a series of radios. When I use the roll, the properties that calculate from the set property update correctly (indicating it is setting it), but the radios clear themselves. Any idea what's going?
${#setPropertyInEntity('self','brainwaveClock',"min(brainwaveClock + 1,4)")}$
Hmm, problem seems to be that it is setting the value to a number, while the radios are expecting string values.
so, is there a way to ensure that setPropertyInEntity sets the property as a string value instead of as a number?
or alternatively, a way to set the expected value of the radio to a number?
Something like this works in my test:
- Add number fields, key
le_curandle_max. - Add a label with the key
le_display. - Put the following in that label's test:
%{
setTimeout(() => {
var ac = document.getElementById('CharacterSheet-Actor-' + entity.entity.id);
var el = ac.getElementsByClassName('le_display')[0];
var bar = document.createElement('div');
var props = entity.system.props;
var perc = props.le_cur / props.le_max * 100;
bar.style.backgroundColor = 'rgba(127, 127, 127, 0.5)';
bar.style.height = '1em';
bar.style.width = '100%';
bar.innerHTML='<div style="background-color: red; height: 100%; width: '+perc+'%;"></div>'
el.replaceChildren(bar);
}, 10);
return '';
}%
As a side note, I with there was a simple "this is a bunch of HTML to render right here" component. Label is way too heavy and does too much stuff.
huge! defs gonna try this when I get home
Problem. In my template, I had a label called "availableSkills". It vanished. I had assumed I accidently deleted it. When I re-added it, it vanished again. I looked in the exported template and it was not here. More tinkering and now I can see it the export template JSON, but it does not show in the template itself. If I delete it from the JSON, import, add it manually, it disappears from view as soon as change the component name to "availableSkills" but continues to exist in the sheet object. Any ideas on what is causing this?
do you have a screenshot how this looks?
👍
The annoying part here is that a straight label text like this ...
<div style="background-color: rgba(127, 127, 127, 0.5); height: 1em; width: 100%;"><div style="background-color: red; height: 100%; width: ${le_cur/le_max*100}$%;"></div></div>
... needs CSS to be even visible (it's all wrapped in multiple layers of wrapper this laben doesn't even need) and becomes nearly invisible and non-interactable in the template for editing.
So I couldn't make it work without the JavaScript code above.
any ideas for this issue?
If you want to go this route, and are using custom CSS anyway, this is what you need to add for it to work:
.le_display .custom-system-label-root, .le_display .custom-system-label-label {
width: 100%;
}
Repeat (changing .le_display) for every such label which has only HTML structure as content.
Dir you try using string(min(brainwaveClock + 1,4))?
Yep, still sets it to a number
Then no clue, and it's time to use the good old "log everything to the console at every step" debugging technique.
think I'll just switch to raw javascript and set it manually
Does anyone have any ideas?
the value to set it to has to be passed as a string representation of the formula, so I think it should be:
${duration_value_new = item.key_effect_duration_label-1}$
${setPropertyInEntity('item', 'key_effect_duration_label', "duration_value_new")}$
Unfortunately does not work. I get the error message in the console:
Formula.js:853 Uncaught (in promise) Error: Uncomputable token duration_value_new
I have it both like this:
${setPropertyInEntity('item', 'key_effect_duration_label', "duration_value_new")}$
as well as like this:
${setPropertyInEntity('item', 'key_effect_duration_label', 'duration_value_new')}$
tried... Unfortunately without success...
oh, I think you just want it without the quotes:
${duration_value_new = item.key_effect_duration_label-1}$
${setPropertyInEntity('item',
'key_effect_duration_label', duration_value_new)}$
Didn't work that way either, unfortunately.
${setPropertyInEntity('item', 'key_effect_duration_label', duration_value_new)}$
Still the same error message....
I then tried it like this:
${setPropertyInEntity('item', 'key_effect_duration_label', item.duration_value_new)}$
...and in any case got no more error message.
However, the value key_effect_dauer_label was not set to the value dauer_wert_neu, but to 0. I have now tried this with various values and always the same result: key_effect_dauer_label = 0...
Do you have any other idea?
I meant the key
duration_value_new
🙂
I'm having issues with set as well, so not sure what else to try
Nevertheless, thank you very much for your help!
Hmm... unfortunately - despite wiki - I still haven't quite understood how it works exactly, because I get different results in this case despite the same syntax...
Should be ${setPropertyInEntity('item', 'key_effect_duration_label', "item.duration_value_new")}$ (given it is the Label Roll Message of an Item Container)
I will try...
Ok this works so far:
Any idea how to style to make it look this way?
Would like to round the grey borders and move LE_current Number field an LE_max Label over the bar like this
Ok, so I have this formula that goes into chat:
<table>
<tr>
<th>${string(item.name)}$</th>
</tr>
<tr>
<td>${string(item.power_overcast_text)}$</td>
</tr>
</table>
The string(item.name) works and prints out the name of the item.
However, power_overcast_text is a rich text area in the item and I want it to print what is written in it.
What's wrong here?
Nevermind, it works just had to re-add the item.
Are there any plans to incorporate Item Containers as a standard feature in Foundry. I have it install and it helps prevent players carrying more items than they can store in backpacks and sacks etc, but it would be great if this was a standard feature.
Check how those are doing it? But it should be mostly a combination of some nested HTML elements (potentially with various z-levels, and using position: relative; on the outer one and position: absolute; with the right positioning CSS for the inner), and ${le_cur}$ / ${le_max}$ as the content of one of the inner ones. The borders can be done with border-width, border-color and border-radius, and the colour with a gradient for background-image. I like to use https://cssgradient.io/ for creating those gradients.
And if you're heavy into CSS styling, see the simpler (code-wise) alternative I posted a bit later.
the second one didnt work 😕
Well, it did for me with the extra CSS.
An example for a structure for the "text inside" idea would be something like this:
<div style="position: relative; background-color: rgba(127, 127, 127, 0.5); height: 2em; width: 100%;"><div style="background-color: red; position: absolute; height: 100%; left: 0; width: ${le_cur/le_max*100}$%;"></div><div style="color: white; position: absolute; left: 0; right: 0; top: 0; bottom: 0; text-align: center; font-size: 150%; line-height: 2rem;"">${le_cur}$ / ${le_max}$</div></div>
Most of the CSS (besides width: ${le_cur/le_max*100}$%;) can also be moved into the custom CSS file.
Result on my side.
If you prefer to move as much into CSS as possible, the content becomes:
<bar-container><bar-fill style="width: ${le_cur/le_max*100}$%;"></bar-fill><bar-text>${le_cur}$ / ${le_max}$</bar-text></bar-container>
And the CSS:
.le_display .custom-system-label-root, .le_display .custom-system-label-label {
width: 100%;
}
.le_display bar-container {
displaY: block;
position: relative;
background-color: rgba(127, 127, 127, 0.5);
height: 2rem;
width: 100%;
}
.le_display bar-fill {
displaY: block;
background-color: red;
position: absolute;
height: 100%;
left: 0;
}
.le_display bar-text {
displaY: block;
color: white;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: center;
font-size: 150%;
line-height: 2rem;
}
... and don't forget to set the key for the label to exactly le_display.
If you don't mind telling Firefox users to enable the :has CSS feature manually, you can get by without the key, too:
.custom-system-label-root:has(bar-container), .custom-system-label-root:has(bar-container) .custom-system-label-label {
width: 100%;
}
bar-container {
displaY: block;
position: relative;
background-color: rgba(127, 127, 127, 0.5);
height: 2rem;
width: 100%;
}
bar-fill {
displaY: block;
background-color: red;
position: absolute;
height: 100%;
left: 0;
}
bar-text {
displaY: block;
color: white;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: center;
font-size: 150%;
line-height: 2rem;
}
See the browser compatibility at the bottom of https://developer.mozilla.org/en-US/docs/Web/CSS/:has
The functional :has() CSS pseudo-class represents an element if any of the relative selectors that are passed as an argument match at least one element when anchored against this element. This pseudo-class presents a way of selecting a parent element or a previous sibling element with respect to a reference element by taking a relative selector ...
Just wow! Thank you!!!
No problem. I'm still annoyed with the amount of wrappers (and white space in margins and paddings) that the default label throws your way, but you can deal with almost all of it eventually with modern CSS.
its not necessary to reference the class in the label right?
Depends on how reusable you want it to be. If it's a one-off thing, no point using CSS classes.
Hi, back with another question.
What is the formula to make something invisible when a checkbox has been checked?
nevermind,Found it!
not (insert_component_key)
hi I'm starting a project with csb and i had a question
is it possible to automatically change a number field current value to its maximum ?
It would be great if such topics as health bars could be collected here as tutorials! I think that many users would really benefit from this... 😀 @formal goblet
The FAQ page would be a great place for that... 😉
Hi, Question, what is the quickest way for players to close the richt text box without closing the entire character sheet? Without having to change something in the sheet to save it(which also closes the box)
Is it possible the change the name in the header of a user input or set the length or width of user input dialog window? Can the check mark on the "roll" button be changed to a different symbol. CSS classes appear to be too generic.
Is the control in the sheet of a type Rich Text, as opposed to a simple text or number input?
there must be a syntax error, but i dont get it:
RS_base is 5, wert1 is 3
Can i nest conditions like this?
Result is NaN
Have you tried using discord's js code colorization to see your work?
```js
paste your code here
```
those are the backtick character...
${is_effect ? RS_base >= ref('wert1') ? round(ref('wert1')/2) : RS_base < ref('wert1') ?
ref('wert1')-round(RS_base/2) : 0}$
The 'ternary operator' (?:) needs the same number of "?"'s as ":"'s for each use, but you seem to be short one ":"
This. How do you get out of this when you click on it?
One way is changing something and saving it,
the second is opting out of the sheet entirely.
But how do you get out of it without closing your sheet or changing anything?
is an item even able to read variables of its actor? for testing i tried this an get 0 as result even though RS_base has a different value
This is the "Save and close" button. It's currently greyed out and doesn't do anything because there's nothing new to save.
Literally just slap a space in there and the Save & Close button will work.
does anyone have an example for a dropdown list that changes options depending on what you selected from a different dropdown?
say dropdown #1 has values for A, B, C...
- if you pick A then dropdown #2 shows 1, 2, 3
- if you pick B then dropdown #2 shows 4, 5, 6, 7
well... in Martin's examples there's a checkbox called 'edit' and later on there are dynamic tables with a display rule of edit and 1 related dropdown each with a display rule of not(edit). Building on that it might work to have a 'master' list and then other dropdowns with display rules of things like master == 'opt1'
Thinking about your question a little more... if you chose Dialog Editor for the Style, then clicking the Rich Text Editor's Edit button will open a new window with a big ol' Close button in the title bar at the right hand end.
Not to mention a Save button and a Cancel button at the bottom.
Item modifiers are calculated with the context of the Item, not the Actor. If you need data from the Actor, use fetchFromActor()
Doable with setPropertyInEntity()
I'd say that it has a better place in the number field component instead of in a guide, so that users can use it without any setups.
i imagine it wouldn't work if i put it in the rollable text of a Label
what would be a good way to "activate" it ?
It actually would
so if i had a number field named 'exemple' and i wanted its value to go up by one, a label with this formula " ${setPropertyInEntity('self','example',+1}$ " shoud work or am i missing something ?
wait i found out why it didnt work i forgot one parenthesis
Almost. It should be ${setPropertyInEntity('self', 'example', "example + 1")}$ instead
thank you so much i have been scratching my head trying to figure how to make it work
by the way is there any "if" function that would let me check if a checkbox is true or false to for example:
if ture have the set-property increase a value by 1
if false heve it instead decreased by 1
You can use the ternary-operator for that: condition ? 'truthy' : 'falsy'
so if i understant, to use it i replace "condition" by the key of whatever checkbox i want to reference and replace "thruthy"/"falsy" by whatever formula i want to run?
Basically, yeah. But you shouldn't make the mistake to declare setPropertyInEntity() twice, because both will be executed regardless of the condition.
im a bit confused
so this way doesnt work ${ Checkbox_example ? 'setPropertyInEntity('self','example',"example + 1)' : 'setPropertyInEntity('self','example',"example - 3)' }$
but i dont understand how i coud make it work
Missing closing double-quotes
oh which ones?
Quotes are handled like parenthesis. If you have ( without ), it will result in a syntax error.
oky thank you a lot
@ruby frigate could use this to bypass that issue nicely though, right?
${setPropertyInEntity('self','example',
(check?example+1:example-3)}$
apologies, how do I assign integer values to some keys that is tied to dropdown list?
also how do I call items to actor sheet from each individual item I created?
like, if there is 2 different classes I made as an equippableItem, and I'm calling value such as skill_1 from an class item I made named Bard
what have you tried already, and how did it not meet your expectations?
i tried using something around the lines to try using a conditional to compare a key:
${terrain = 'ter2" ? 8 : 6}$
and what it feeds back is an 8, regardless of what dropdown item I choose in the actor sheet
im a total beginner so yep
Ok, a single '=' means "the variable on the left now has the value on the right. What you want there is a double '==' instead.
Also, it doesn't much matter if you start a string with ' or ", but it is vital to use the same to close that string.
= is an assignment. Comparisons are ==, but I'm not sure it will work with strings (no time to check right now though).
Can you take a screen clipping of what you have for us?
something like this
im like, trying to make the dropdown adds a value to terrain_val label next to the dropdown.
i'm just making an existing game system into Foundry
Ok, nice now can you show me how the terrain list is constructed?
because the terrains are grouped with certain values so im adding it
into same key groups
That grouping of identical keys works with (and is expected with) radio buttons. Dropdown lists though are going to break if the keys are not unique.
Also, in the first comparison of your code, you're trying to match the word "Highland" but the value of terrain comes from the Key column. The Label column is simply all about what's shown to the user and is not part of this.
... using "==" yes.
ok im going to try it now
(your screenshot still has one single "=" in there too.)
If you're testing several keys, you might want to try this instead:
switch(terrain) {
case "key1":
// code block
break;
case "key2":
// code block
break;
default:
// code block
}
switchcase?
That should work and is far tidier.
Think of it as a special "if else" but you can test one variable against practically unlimited values.
oh that works finally
Glad to help. 🙂
thank you very much, might come around to ask more later about calling item values
from created items
I might not be up much longer but others should be floating around here and there, including Martin1522, CSB's Developer.
ye but thanks a lot, still a lot to learn
question on this: I'm trying to get the display bar to have "HP" in the label prefix but it won't display. Do you know how to get this to show up before the bar or is it not possible?
i know you can make separate dropdown lists by entering equalText(DROPDOWN_A,'DROPDOWN_VALUE') into the visibility field
according to the documentation there might be an easier way of doing it https://gitlab.com/custom-system-builder/custom-system-builder#37-drop-down-list using a formula but it doesn't provide an example. so i was checking with ppl here
Depends on the method you use. I need to prep for our gaming session later, so can't really have the custom system running for testing, Here's an example label's content:
<bar-container><bar-fill style="width: ${le_cur/le_max*100}$%;"></bar-fill><bar-text>${le_cur}$ / ${le_max}$</bar-text></bar-container>
Then there's the same label's prefix:
LE:
Then the fill class le_display to either the key or the CSS class of it.
And that's the CSS that makes it all work (note: I'm using :has to simplify it a lot, Firefox users need to enable that):
.custom-system-label-root:has(bar-container) {
width: 100%;
}
.custom-system-label-label:has(bar-container) {
width: 100%;
display: grid;
grid-template-columns: min-content auto;
line-height: 2rem;
}
.le_display {
--bar-fill: red;
}
bar-container {
displaY: block;
position: relative;
background-color: rgba(127, 127, 127, 0.5);
height: 2rem;
width: 100%;
grid-column: 2;
}
bar-fill {
displaY: block;
background-color: var(--bar-fill);
position: absolute;
height: 100%;
left: 0;
}
bar-text {
displaY: block;
color: white;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: center;
font-size: 150%;
line-height: 2rem;
}
thank you!
hi does anyone know what component is equivalent to a hidden atrribute ?
Label
oh then which label (text,prefix,suffix) would be used if i wanted to reference the label key ?
Only the text one
Martin's suggestion definitely has it's applications, but I'd call the Label method a "Read Only" attribute. For a truly "Hidden" Attribute, I'd use any form element that's relevant but go into Advanced Settings, and use the Minimum Role control.
yeah i found out that worked i just needed something to store a formula so i could reuse it somewhere else
Then you're all set and that's the most important thing. Happy gaming bud.
thanks
though ill be going a little mad figuring items before i can game with friends XD
Do you have the json package of Martin's examples?
yeah i downloaded a bunch of the other systems to reference myself but since the system im working on is a little unorthodox ill still have to figure a bunch of things out
Other systems...? Maybe my question was unclear: Martin, creator of CSB, has made a bunch of functional examples and bundled them into a json file for importing into your Foundry. I've learned a LOT from looking at how they are coded and how they interconnect. Esp "items" (Which go into a sheet element called Item Container. You wouldn't believe how long it took me to realize that was in the list.)
If you want it, you can d/l it from here: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads
oh yeha they were super helpfull its just that what im doing is a little weird so it just takes me a while to figure out what parts of the example are applicable to what im doing
how do you call a key from specific items? i know it would be like item.skill from under ClassTemplate I made, but what if there multiple instances of items? Can I just call the name of item to use the key of that specific item?
Next thing to find out: How to put actors (pilots, gunners and other crew in my case) "inside" other actors (the machines they run), ideally with drag&drop too. Well, at least that's the next thing for me. 😄
Probably somewhat similar to making a party sheet, which I did by making an actor that has a dynamic table on it where the first column has me enter the name of an actor and the rest of the columns pull info from the associated actor’s sheet.
I don’t think drag and drop works atm because that would imply being able to physically put an actor into another actor, which just isn’t a thing, nor is it a thing for items (though the latter is currently scheduled to change in a future update)
Kinda. I plan on using the unique IDs though instead of actor names. And yeah, this means I have to implement my own drop target, but that's not too bad.
Quick question regarding item modifiers.
Is there a way to have this value formula use the actor's attributes rather than the item's?
FYI this doesn't seem to work; console shows it's returning the expected value (3 here), but it makes the modified attribute "NaN"
You can just use fetchFromActor()
well, that's at least giving me a new error
Also with a fallback-value?
noo it seems like the issue is I can't figure out the first variable here.
I assumed it would be entity.name or something, idk
OH! 'attached'
thanks!
hm, what's going on here? no fill?
Hi...
I am looking for a way to delete a item from a container when a value is 0.
My approach here:
${key_effect_duration_label >= 1 ? setPropertyInEntity('item', 'key_effect_duration_label', "item.key_effect_duration_label-1"): DELETE ITEM }$
The question now is: how do I delete the item from the container?
Thanks a lot!
Look at the last example: https://gitlab.com/custom-system-builder/custom-system-builder/#45-scripts
I had seen this before, but didn't really understand how to apply it.
Simply with item.delete() ?
It involves the usage of Script-Expressions (Javascript), so it´s not just a normal CSB-Formula
It works... Thanks!
@river sierra i changed background-color: var(--bar-fill); to background-color: red; and it started working. how do I adjust it to work without your LE: prefix?
I have an interesting effect that I can't explain:
Clicking on the dice initiates the effect and calculates the effect value and duration:
${#setPropertyInEntity('item', 'key_item_effect_active_value_label', ${effect_value}$)}$
${#setPropertyInEntity('item', 'key_effect_duration_label', ${duration_value}$)}$
These values are transferred to the item sheet.
However, only the effect value is displayed.
When I open the item, I see that both values have been entered.
After I have closed the item sheet again, the value for the duration is also transferred.
Can anyone tell me why this is happening and what I can do about it?
Thanks a lot!
If I click on calculate again, the previously calculated value is displayed at "Duration"...
Why not just
${#setPropertyInEntity('item', 'key_item_effect_active_value_label', "effect_value")}$
${#setPropertyInEntity('item', 'key_effect_duration_label', "duration_value")}$
?
Hm... i don't know... 😉 I will try it...