#Custom System Builder
1 messages · Page 9 of 1
So if the number field the keys are trying to reference is for example <currentThing>
the keys in the dropdown should simply be <currentThing> and not ${currentThing}$ or [[currentThing]] or something?
yeah
Some explanations for ref(): #1037072885044477962 message
I will re-iterate about the bug where nothing inside a Table stays saved after a reload.
So, bud, you mentioned this being possible in the Beta before
To make a ?{input|<Dropdownlistkey>} in a formula.
How would I go around writing that?
making a dropdown list appear to set a value before a roll
Check the example with the month: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md#48-user-inputs
OH
So I didn't need to make that dropdownlist?
the values under quotations can be keys that have their own values?
I'll try
I tried, and even tried copying the example in the readme and running just that
but what I get is text/number input.
${#concat(
?{name:"Character name"[text]|"Your name"},
?{age[number]},
?{gender:"Character gender"[check]|"m","Male"|"f","Female"|"o","Other, or I don't want to say"},
?{month:'What month are you born ?'|"January"|"February"|"March"|"April"|"May"|"June"|"July"|"August"|"September"|"October"|"November"|"December"},
?{happy:"Are you happy ?"[check]}
)}$
Gives back nothing.
This is in a dynamic table btw.
But I just tried outside of a Dynamic table and still no dice
I will bring it up again that I am in the Unstable Version
I just tested it, and this code does not seem to work on the Beta Version either.
The unstable version has some issues at the moment which prevents Foundry from correctly updating it. You may be running an outdated unstable version :/
This Formula should work in the latest beta version (2.3.0-rc5). If it does not, something has gone wrong with your system installation, and you may need to uninstall and reinstall it. Doing so shouldn't cause trouble in your world data 🙂
Oh! Really? I'm so glad it's an easy fix. I'll be checking the version and trying an re-installation. Thank you
Do we think a roll command to delete or copy items will be possible? Would help with trading, stores, looting, etc since we cannot drag from character sheet
Could you please link me to an updated Unstable version? Cause the Unstable Version manifest URL I have access to seems fully updated (unstable-172-8c80f875).
@brittle moth
I have tried installing both from scratch.. even in new worlds. That example code you guys have still doesn't work.
The unstable version you have is the latest one. I tried the formula in a test world on the latest beta version, and it works flawlessly.
Can you try and reload your page while clearing your cache ? You can do it by reloading the page using Ctrl+Shift+R.
If the issue persists, do you have a publicly accessible server on which I could test this ? This bugs me a lot....
I've been using the app but I tested it on the browser too, going to try clearing the cache now
And yes I can make it public no issue, I'll just make this attempt first
This is the same issue I had a few days ago, and yeah un/reinstalling, clearing cache etc, none of it worked.
I was actually speaking to the Dev @brittle moth just now, and he just updated the system to fix that issue, dear. So, you shouldn't have that problem anymore. I can't wait to try it out in a bit.
It has been fixed on the unstable, but not on the beta version yet
So, this:
${?{CS:'Character Score?'|"Agility"|"Dexterity"|"Strength"|"Intellect"|"Perspective"|"Presence"}}$
${[2d10] + (sameRow('SLevel'))*2 +CS}$
The selections, even though they are the same name of the keys to the Number Fields, carry no value and cause an error message in the final result.
${?{CS:'Character Score?'|@props.Stats.Agility,"Agility"|@props.Stats.Dexterity,"Dexterity"|@props.Stats.Strength,"Strength"|@props.Stats.Intellect,"Intellect"|@props.Stats.Perspective,"Perspective"|@props.Stats.Presence,"Presence"}}$
${[2d10] + (sameRow('SLevel'))*2 +CS}$
Trying this now but it's not working yet.
THis should be :
${?{CS:'Character Score?'|"Agility"|"Dexterity"|"Strength"|"Intellect"|"Perspective"|"Presence"}}$
${[2d10] + (sameRow('SLevel'))*2 + ref(CS)}$
or
${?{CS:'Character Score?'|Agility,"Agility"|Dexterity,"Dexterity"|Strength,"Strength"|Intellect,"Intellect"|Perspective,"Perspective"|Presence,"Presence"}}$
${[2d10] + (sameRow('SLevel'))*2 + CS}$
should work as well
btw, @props is not even a valid syntax in Formulas 😅
I'm such a genious xD
Thank you and thank you!
With this I think I finally know enough to finish my system, you are all great! I hope I learned enough to assist over here too at some point or another.
I tried the first one, but it wouldn't work, but maybe I did something wrong. I'll mention if it all worked after I try these.
It works magnificently! I also figured out what I had done wrong before. Thank you again!
Any help here?
How do I even make configurable rolls at all? Like, using a contents of a rich text area as a roll message.
I don't believe you can make configurable rolls like that.
The way I do it is I have an established roll that pulls values from number fields the players can fill.
That's a bummer. While you can make configurable pretty much anything in a form, it feels unnatural that rolls have to be static
I mean, if your items have a particular formula to them, you can just have a number field with any of the variables, that you yourself can set.
The Idea was to create a generic "spell" item template, and spells can have really different formulas and effects to them.
I wish I could just make a hidden input for roll messages/formulas for that case
Well, you can pull from Macros for that
But in the way you are seeking I don't believe it to yet be possible. Although I hope to be wrong.
Can you please teach me how?
I'm sorry, but since I have not needed to tinker with Macros on my system, I haven't quite used that yet. But I know people do it from a thread where they also recommended having the Advanced Macros Module to better use that. I'll try to find that thread here.
Well, here it goes into some depth about that:
https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md#7-macro-support
I've seen that, but still have no idea what macros are in general. Are they like general FoundryVTT thing?
In case the stable version is a bit different and you are currently using it, here you go:
https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop#7-macro-support
Oh yes
very much so
That I can help you with then, although I do not know Java Script
may I DM you?
Sure, thanks!
Besides, for more advanced assistance with macros, you might wwant to check in with the nice folks of #macro-polo
They have helped me time and time again.
Heey, me again..
So, I don't know how to refer to keys as the values of Radio Buttons:
Cause no matter how I write that, evey time I refer to them in formulas, the result is not a value, it just brings me the same formula back:
Can Radio Buttons even have a formula as a value?
If it´s not specified in the README, then not. And there is also a distinction between Formulas ${}$ and Formulas with Roll Expressions ${[]}. Roll Expressions can only be used in Labels within the Label Roll Message.
And that is just wrong.
Oh noo! Formula values are the whole reason I needed Radio Buttons!
Oh well. Good to know that difference at least.
Oh really? I couldn't find it in the Readme, so I didn't think there was!
That would bee amazing.
Well, thank you for the info. I imagine this is a planned feature, and since I'll stick to the unstable I'll be doing tests on my end and reporting them if needed.
And if I'm not seeking assistance I'll be doing bug reports on Git-hub where I imagine it is preferable
Yeah, it´s the better place for bug reports and feature request.
btw, why would that need a formula? Why not just the key to whatever you want? You can always resolve a key to its value later on.
Oh, it's because each of the Radio Buttons would have as their value specific key related to one of 3 dices, the player can only lock into one of these 3 dices at a time which cost a point from a pool to switch between.
So if the player is locked into the left-most, when he rolls a dice he has the option to roll the extra dice that he is locked into.
Each of these dice only applies to a type of scenario.
I want the player to shift click their roll button if they want to make their roll while adding the Aspect Dice they are locked into.
So, if I was the character;
Today I feel like it's going to rain, so I'll lock into my Rain Aspect.
So when doing a roll, they can spend energy to add the roll of the specific aspect they marked to be locked in.
So it´s something like this?:
Radio Group key: AspectSelection
Radio Button values: AspectBonus1, AspectBonus2, AspectBonus3
AspectBonus1: 5
AspectBonus2: 7
AspectBonus3: 9
Label Roll Message (Alternative):
${#bonus_roll_dice:= ref(AspectSelection)}$
${bonus_roll:= [1d:bonus_roll_dice:]}$
The bonus roll would result to 1d5, 1d7 or 1d9 depending on which Radio Button is selected.
Yeah, but the number of the dice needs to be a number field the player can change
Sorry, I'm super tired and struggling to read this a bit. I'm trying to wrap my head around it
If AspectBonus1 is a key to a number field, then it is exactly that
oh, wait, the Value can be a key?
It can be treated as such with ref(). Or more like: I have a value, which needs to be treated as a key, so I can get the value from that key.
Okay, now I read it with my brain
So it can be a value!
I understood that you said it couldn't
Oh amazing
thank youu
Yeah I can work with that
RIGHT
It can't be formulas but it can be a key
that was my confusion
and you cleared it
I'll try to do this
In my head it couldn't be either
Well, every kind of text/value/whatever can be treated as a key.
Okay, phew!
It WORKS
Thank you very very much
This will solve A LOT of obstacles I had
Have a great night!
My problem wasn't with formatting, but rather with the inability to define roll msg/formula in particular item instead of item template.
But thank you, anyways
Ah, I see. Well, you can do that partially with the help of recalculate(). I'm not sure if it will also work with Roll Expressions, but you should be able to do some things with it.
That was the first thing I tried, but unfortunately it has few critical downsides:
- target/selected/self stops working
- the whole message becomes wrapped in a roll-box ruining appearance/formatting
Is there any way to make two Number Fields share a maximum? As in, both together can't surpass a certain value?
Does setting val1 to have a limit of max and val2 to have a limit of (max-val1) accomplish what you want?
not sure, I'll try!
Amazing, thank you. I was pretty sure the mathematical logic would be something like that, but I thought the coding had to be different for some reason. I'm glad it isn't!
I mean, of course val1 had to have a limit of max-val2 as well, but yeah.
glad to be helpful
I am trying to the copy macro script feature on the roll label in an item container but i realized that it doesnt work. right clicking doesnt show the context menu. Is this an expected behavior...or?
I am on the Unstable version, but it seems to work for me just fine. Does the label roll properly if you click it?
Also, a question (UNSTABLE VERSION); can dropdown list Option Keys be the Key of other Number Fields?
I want the players to be able to select an option in a dropdown inside a dynamic table, and for that value to be added to the value a label shows in the same row.
This dropdown would have the key of stat values from another tab.
Hey hello! I would appreciate an assist while I wait for an answer to the previous question.
So, why does this formula work:
${?{CS:'Character Score?'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"} ?{Sphere:"Spend Sphere?"[check]}}$◄ CS |
▼TOTAL▼
${floor([2d10] + (sameRow('SLevel'))*2 + CS + (Sphere)*2)}$
▲▲▲▲▲
————————
${CharName}$
And this one doesn't:
${?{CS:'Character Score?'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"} ?{Sphere:"Spend Sphere?"[check]}}$◄ CS | AD ►${#AD:= ref(AspectLocked)}$ ${Aspect:= [1d:AD:]}$
▼TOTAL▼
${floor([2d10] + (sameRow('SLevel'))*2 + CS + ((Sphere)*2) + AD)}$
▲▲▲▲▲
►SPEND ENERGY◄
————————
${CharName}$
The core difference is the one that works doesn't have this part:
${#AD:= ref(AspectLocked)}$
With the addition of the AD on the total formula.
Now, the one that doesn't work does function without this part:
?{Sphere:"Spend Sphere?"[check]}}$
it does but right clicking the label within an item container doesnt show the context menu. if you copy it, what is the macro script you get back? can you paste it? i can try running it.
I get a working macro script
I'll be on my PC again tomorrow if you need an assist
might be due version diff
but sure! just tag me when you post it
I have another thing to complain. It's quite big I think.
It seems like each entity you create copies its template in, instead of just referencing it. So, when you build a compendium, each item there contains copy of complete layout, formulas, tables e.t.c. That makes importing stuff a wild task.
I intended to just import my thousand items/spells/feats excel table but it seems I'm expected to input stuff manually. If that's the case, I'm not sure why I bothered implementing my system there at all.
Sorry, to be more precise, it does referece the template, but by ID instead of a name, which is still an obstacle.
That’s not a point auf CustomSystemBuilder.
Foundry is not designed to have import functions for Excel.
There are some modules that help with eg. Random tables, but items are very system specific and I don’t know of any module that helps with importing them for any system.
Well, it was never intended that stuff should be importable from other sources.
That’s not a point auf CustomSystemBuilder.
I thought it supposed to fascilate building custom systems. That kinda includes filling them with content
Foundry is not designed to have import functions for Excel.
It, however, has compendiums with import/export. Building a script for converting csv->json would be a 15min task if it had a sane format for entity.
Why couldn't item be just e.g. this:
{
"name": "TestSpell",
"type": "equippableItem",
"img": "icons/svg/item-bag.svg",
"system": {
"template": "BEZsPAq0O9diZJT2",
"props": {
"name": "TestSpell",
"LEVEL": "1",
"DISPLAY": "Parry",
"TARGET": "SELF",
"CAST": "4",
"DURATION": "TURN",
"REQUIREMENTS": "@martial",
"TAGS": "#martial",
"HOLD": "CON",
"DESCRIPTION": "<p class=\"p1\">When another creature damages you with a melee attack, you can reduce the damage by <em>PB</em>. Twice that, if you have <strong>@body[Dexterous]</strong></p>",
"TITLE": "1 lvl. 4 ap. Concentration."
},
"modifiers": [],
"unique": false
},
}
Instead of this: (doesn't fit a message)
Good question that I already asked myself.
But you will find the same problem with every game system in foundry.
Well, it was never intended that stuff should be importable from other sources.
Can it be made to though? Can I maybe help?
But you will find the same problem with every game system in foundry.
Is it really like that? How do they share those huge compendiums around the internet then? Don't tell me somebody sits down and inputs e.g. hundreds of dnd spells in foundry interface
We are always open for modifications to the system. It´s open source 😅
I guessed just that 🙂
What I was asking is if the feature I'm talking about is desirable and implementable. And if so, any guidance will be much appreciated
I imported myself a item compendium from dnd to my personal CSB system. It has taken me 2 weeks of editing the JSON to made it fitting.
So it can be done importing from excel to fit your personal item template.
Just there is no easy way.
Problem here is that the item settings of all gamesystems are different.
Yes, there are similarities but…
It has taken me 2 weeks of editing the JSON
Like, manually?
Just there is no easy way.
I think can still manage with scripts, It's just as I read I'll need to re-export the whole bunch of stuff under new format each time I change a template, which is suboptimal.
Problem here is that the item settings of all gamesystems are different.
Shifting keys around in json is not much of an issue though. And in my case, my system is already made to accomodate my stuff
- Desirable: Its not highly valued for us but we also have nothing against it
- Implementable: I´d need to take a closer look at the system for that. It might be easy if you can just copy the existing template and extend the values, or it might be way harder. I even think that the functionality of importing/exporting Actors/Items comes from Foundry itself and not from CSB. We only have a custom implementation for these 2
- You can check the custom-implementation here: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/exports.js
Yeah, I noticed CSB offers to import/export templates, while compendiums is a foundry feature.
How should I go about it? Mirror i/o feature for items also, or modify items representations for compendiums?
Good question... I´d probably mirror it. Or extend the current import/export-buttons, so that you can select, if you want Templates, Items or both. @brittle moth your opinion might be good here 😅
Anyhow, TYVM – I'll look into it during the weekend
Yes, manually.
But I have to ad that approximately one week was debugging the original compendium.
Bugs that didn’t bother dnd but let CSB crash.
@clever wyvern @formal goblet
I know the import / export functionality is not optimal. When I made it, I did not know how Compendium worked and did not think how much it would be a bother, especially for items. There is much room for improvement on this front, I agree. You should open issues on GitLab if you have any proposition, messages on the Discord get lost far too quickly 🙂
To answer on some questions :
-
Template structure is copied in each item / actor to avoid data loss. If the structure was only referenced from the template, you'd risk losing actor data on a wrong move on the template (like accidentally deleting a panel) with no possibility of recovering. Same thing if you are working on the template and moving stuff, you may need to delete and recreate things, having a simple reference to the template would be too risky. I'm aware this makes the actors and items json pretty heavy, but I can't think of another way to protect their structure while someone is working on the template 🙂
-
The reference to the template is used to refresh the template. It uses the templates ID, which is a wrong move, since on importing, it changes. This causes issues in item importing as well as in Item Containers, which lose their configuration after each import. This will be fixed at some point.
-
Nothing was made to import data from external sources and I don't plan to add something like this to the system. I truly believe the players importing their spell lists on other systems use custom scripts to transform their raw data into foundry-compatible data. The same can be made for data compatible with Custom System Builder, the internal format is not that complicated. You need to be a little tech-savvy though, I agree, but the issue lies with the templating system which makes it quite complicated to do an external import system tailored to every possible template.
I will drop the custom import export system for Compendiums in the v11 compatible versions, I think, because there is a simplified Compendium creation system in that version of Foundry 🙂
First, thank you for the most detailed answer I could hope for.
but I can't think of another way to protect their structure while someone is working on the template
When I initially picked up CSB I expected templates to behave like forms and concrete entities to be like filled data for said forms. Data loss could be prevented simply by retaining filled data in shapeless fashion. Basically, like how right now rows in dynamic tables retain values even for deleted columns (which might be a mis-feature tbh). However I think I can see the merit in both approaches.
It uses the templates ID, which is a wrong move, since on importing, it changes
This sounds critical. Does that mean I should not use current import/export feature while having any entities tied to reloaded templates?
Does that also mean implementing entity export separate from templates would not be possible as it is?
Nothing was made to import data from external sources and I don't plan to add something like this to the system
While I don't think/expect you should waste your time implementing rich/arbitrary format import, having simple json format for that would be immensely beneficial to users. I mean, they can figure to export json themselves, and most entities can be boiled down to a plain dictionary anyways.
Does that mean I should probably not touch anything and wait? I think you mentioned august as a time frame for v11 support somewhere
When I initially picked up CSB I expected templates to behave like forms and concrete entities to be like filled data for said forms. Data loss could be prevented simply by retaining filled data in shapeless fashion. Basically, like how right now rows in dynamic tables retain values even for deleted columns (which might be a mis-feature tbh). However I think I can see the merit in both approaches.
A data cleanup is made on sheet reload, because not cleaning the keys could lead to data corruption in some cases. It has been implemented this way because actual data corruption happened to someone in the past (it don't remember the details, but it was caused by a deleted field which retained its properties in entities). The way it works in dynamic tables does not satisfy me, but I never could make it work with how Foundry handles data deletion for this specific case ^^"
This sounds critical. Does that mean I should not use current import/export feature while having any entities tied to reloaded templates?
Does that also mean implementing entity export separate from templates would not be possible as it is?
Since structure data is stored in the entities, it does not cause issue to export only the entity without the template, as long as you do not try to reload it 🙂
Does that mean I should probably not touch anything and wait? I think you mentioned august as a time frame for v11 support somewhere
It's all up to you. I want to release the v11 compatible version by the end of August, but this will be just that : a compatible and tested version, no additional features. Next releases will include more features, including this one, but I can't give you an estimation of when it will be added 🙂
Since structure data is stored in the entities, it does not cause issue to export only the entity without the template, as long as you do not try to reload it
But I do want to reload %)
It's all up to you.
Understood, I'll see what I can do!
Again, thank you very much
The only thing that really breaks with a reload, if you do it on an imported entity, is that the Item Containers lose the links to the Item Templates. You have to re-set them again in the Container. Everything else maps correctly to the (basically new) template.
In this context, reloading means updating the template structure. If the template is not in the exported data, it seems obvious you won't be able to reload it 🙂
So it´s more precise to say, that you switch the templates and map the matching components to the new template? 😅
Yeah, I should be more precise : to reload, you need to either reselect the template in the dropdown if the template has been imported as well, or recreate a template and select this one 🙂
Well, I assumed the first case, that there is already a matching template (just with non-matching IDs).
This is a copied macro-script from my system:
let rollMessage = await actor.roll(
'SkillList(Skill1=Abstract Defense*).SRoll',
{ postMessage: false}
);
let speakerData = ChatMessage.getSpeaker({
actor: actor,
token: actor.getActiveTokens()?.[0]?.document,
scene: game.scenes.current
});
rollMessage.postMessage({speaker: speakerData});
This is a roll button added as a macro:
/sheetRoll SkillList(Skill1=Abstract Defense*).SRoll
Also I'll bump this cause I'm still seeking an answer:
'
Also, a question (UNSTABLE VERSION); can dropdown list Option Keys be the Key of other Number Fields?
I want the players to be able to select an option in a dropdown inside a dynamic table, and for that value to be added to the value a label shows in the same row.
'
Is there a way to execute such script-like macro from a sheet?
I don't think so. At least I haven't been able to.
Maybe with the module Advanced Macros. I think they mention something like that in the Readme
Maybe with the module Advanced Macros. I think they mention something like that in the Readme
I think advanced macros was only mentioned here in discord
If you´re using the beta: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md#45-scripts
Can dropdown lists have the option keys be the keys of number fields?
for the purposes stated in this question
Ofc, why shouldn´t they be? 😅
I'm on Unstable
haven't been able to make that work
when I refer to them it only brings the name of the key instead of the intended value
Then the issue lies within the formula, not with the dropdown
oh, wonderful
I'm glad it's possible then
Although I do not know how
should in the dropdown option the key be between ${}$?
You have to process the key. If you go through the example which I´ve posted (the one with ref()), you should see why.
No. Dropdowns don´t allow formulas.
Okay, lemme look into that.
I couldn't find it in the search bar, I'll try to set the key as 'ref(key)' in the dropdown, then?
I think I tried that already but maybe I enclosed it with a formul
You´re thinking in the completely wrong direction... Where do you want to have the result?
I apologize, my knowledge is very limited on this subject, I'm trying to study it in the little time I have but I cannot understand much of the readme given my ignorance of JS.
lemme do some screenshots
Red is dropdown.
Green pulls from a dynamic table.
Blue shows the total of them while making it so that every 5 points in them is 1 point in this label.
Dropdown
Dropdown dynamic
I can bring up the example with ref():
Let´s assume we have the following entries:
- strength: 1 (numberField)
- textInput: strength (textField)
${strength}$ -> 1
${textInput}$ -> strength
${ref('strength')}$ -> 1
${ref('textInput')}$ -> strength
And now the most important one:
${ref(textInput)}$ -> 1
The reason behind this is that before textInput is passed to the ref()-function, it will be processed and replaced by it´s value (in this case: strength). So ${ref(textInput)}$ becomes ${ref('strength')}$, which results to 1.
Result
Oh, that's what you meant! I read this in the readme, but I tried all of those options here I believe, I can try again though, maybe I forgot an <'>
Sorry, this is the code I was trying for this:
${ceil((10 + ((sameRow('ACCS', 0))*2) + ((sameRow('ACS', 0))*2))/5)}$
the one in the print was me just doing tests
That´s not it. You just entirely forgot to use ref(). sameRow('ACCS') will only retrieve the value of the column ACCS in the same row. And because the current selection is "Agi", it will return CAgility. But that is not enough. You have to tell the system, that it should handle the value as a key, that it retrieves the value from that. That´s why you have to use ref(sameRow('ACCS')). To break it up:
sameRow('ACCS')becomesCAgility->ref('CAgility')ref('Agility')becomes5(whatever the current number is) ->5
I see I see
so using ref(ACCS) should work then? I'm going to try
thank you very much for your patience
Check answer above
okay, I didn't know ref(samerow('')) was a thing, this opened a few windows for me. Thank you! I'll implement this here
You can nest functions into more functions. The underlying functions will be handled first and return their value before the upper functions get processed.
So if you have something like ref(sameRow(concat(fetchFromDynamicTable()))), the order of processing would be:
fetchFromDynamicTable(), then concat(), then sameRow() and finally ref()
I just didn't think those two could nestle together for some reason, I have done this with other functions before. Honestly I'm impressed I figured out some much more complex formulas before while knowing so little. Luck I guess.
Right yeah, I undertand that. But I thought that sameRow and ref were like, contradicting functions or something.
What is concat for?
I used it once before here, but I'm not sure what it does, while I do understand the others (I believe)
Actually, sorry, I shouldn't waste your time with something I can google
It´s part of the math.js-library: https://mathjs.org/docs/reference/functions.html
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
https://mathjs.org/docs/reference/functions/concat.html the last example would be the usual use case
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.
yeah, I took a while to figure out that I shouldn't add Math.<function> when reading from it to make formulas xD
in CSB I mean

thanks i tried that already
some how right clicking item container rolls doesnt show the context menu for copying roll as macro not sure why even on blank sheets it doesnt show
i already change over to dynamic tables instead and that works
@formal goblet is it a known bug/limitation or something ?
Hello 🙂
It is a missing feature ^^"
For now, getting a macro from a roll inside an item container is not possible, sorry
Is there a way to import item templates into the beta? I can't seem to get it to work. I only now noticed that all my templates are completely blank.
Check if you get any errors if you try to export them. And the same if you try to import them
Got it working, I guess I was just doing it wrong? I just exported the items alone via the template setting, not sure what caused them all to become blank but it's not an issue anymore.
See if you can reproduce it somehow. It´s important for me because I bugfixed this part, so that it shouldn´t happen anymore
I will, trying to replicate it rn
Okay so, while I can't seemt to replicate the issue with the item templates. I am reminder of another bug, which is: When a template is duplicated it'll be entirely blank until it is renamed. Not sure if you are aware of this issue, but it's usually not too big of an issue. Though once it had occurred every time I attempted to load the game up.
As for the item templates going blank, I believe that it happened sometime after I updated the Beta. I had only really checked the items a few times before (seeming fine) and only now have I acually checked on them.
Can confirm that one. But it´s too minor (you usually rename the duplicate anyway).
Yeah, it's not a big one really.
what's up with these wild decimals?
the formula is just "amount*weight" and "amount*value", and they only appear on certain multiples
when the amount is 11 it's fine, and so with 13, but 12 and 17 both do that
i went ahead and changed the inventory columns to round to 3 decimals, but i also use the item modifier system to total all of the carried weight like so
and these funky decimals are still showing up where i total it
any ideas?
I´d say that your modifiers should target a hidden value, so that you total-encumbrance-label can target the hidden value with a formula with round()
i was just about to post this solution myself! thank you, again, for all the work you do
Here the reason why this happens 😅 https://www.codemag.com/article/1811041/JavaScript-Corner-Math-and-the-Pitfalls-of-Floating-Point-Numbers
Numbers and arithmetic can be a challenge in any language, and John shows you how to deal with them in JavaScript.
So, when I modify a value on the Actor sheet that is passed to an Item sheet, the values don't seem to update correctly until I reload both the Actor and the Item sheets. Is there a way to fix this?
Normally the changes should propagate to the item. Are you using 'attached'?
I'm modifying a value on the base Actor sheet, which is then passed (using attached, yep) to the Item sheet as a hidden attribute.
And if you change something afterwards on the actor?
Nothing seems to happen?
And updating a value on the Item?
You can also check the console if you find anything suspicious like errors or uncomputed props.
Belatedly, updating a value on an item works normally. However, the item's values that it pulls from the sheet aren't updating unless I reload the sheet, the item, or (sometimes) both.
I'm encountering an issue: for some reason, the system hangs somewhere mid-process rendering ComputablePhrases. How do I debug that?
oh, huh, yeah, this makes total sense
and i guess letting us just handle the rounding is a way better solution than anything else
**Beta version 2.3.0-rc6 is now available, with the following changes : **
Features
- [#262] Added Radio Button components
- Added button style for Labels
- Added save on close for Rich Text Dialogs
- [#246] Added User Input Templates
Fixes
- Fixed issue with fields inside Tables
- Fixed issue preventing beta & unstable version from displaying the updated dialogs & windows
Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta
If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Please wait a little more for the definitive 2.3.0, and the following v11 supporting version 🙂
Good news!
New radio-buttons are kinda weird though
Hey there! Has anyone tried to add an item to an actor via macro (actor.createEmbeddedDocuments('item', [] )? I've been trying and i feel like the standard method isn't working as i get "item is not a valid embedded Document within the Actor Document". but when i look at the collections, the type should be 'item' ... or i'm just to dumb to do it right 😄
@brittle moth Seems like the update breaks columns in item-containers. Newly placed item-containers are fine though
Update: it seems any item-container becomes broken if you reopen the sheet (or are there any other conditions I can not pinpoint?)
It seems so indeed 🙂
Gonna fix that ^^
EDIT : Fixed in unstable, I'll release another beta version soon 🙂
TYVM!
Hey, with the Dark Heresy system for foundry is there a way i could build a simple sheet for a Vehicle?
The issue would be that stuff done in CSB is not usable by other systems.
ah so no go then?
Nope, nearly impossible.
hey, does CSB is foundryv10 compatible?
Uhm, yeah, it is V10-compatible.
Is it possible to reference Modules directly in Label Text? For instance, referencing SimpleCalendar.currentdaateTime() function as a 'label text' on a character sheet?
I tried: ${SimpleCalendar.api.currentDateTime().year}$ but nothing appeared
You can use the script-syntax %{}% if you´re on the beta-version.
If we're on the stable release version that's not doable?
Nope, not released there
Thank you!
OOO
I TYPED WRONG
i meant foundry11
😞
😅
me rn:
Noooo, ranger-dono, wake up!
yo
and i discovered if the CSB is v11 compatible
i updated foundry
thinking it was v11 compatible
LOL
gonna to have 2 foundries now
is there a way to use count success with a variable target rather than hardset? The player being able to enter the target.
${#?{targetValue}}$
${roll:=[({:focus_value:} + 4)d12cs>=targetValue]}$
If I replace targetValue with a number it works fine, but if I use target value it doesn't work, just shows blank in the formula even though outputting target value after set shows the correct number. All of the dice pool examples hard set the value as well in the dice modifiers article
I suppose just wrap targetValue in "::"? ${[(:focusValue:+4)d12cs>=:targetValue:]}$
I wonder why it wasn't just js all the way through in the first place instead of math.js and stuff.
I bet if contents of ${}$/%{}% was treated as lambda body with all the variables passed as captures the whole thing would look smooth and intuitive
welp, that did it. thank you lol. didnt realize you had to do that with variables declared in there
I'm getting "row is not iterable" at times when moving/adding a component to a table. Both beta and unstable. Is that known?
where is this template modifiers btw? can't find it. 🤔
Only available on beta version 🙂
2.3.0 has not been released yet 🙂
Is there a way for a macro run from a character sheet to know what order the character is in the initiative order?
Question: Is there a way to set the width of a dialog box in CSB?
hey so for CSB right now, the newest version
what version of foundry is compatible with it right now?
the most recent version of 10.xxx is good right?
yes, version 10
If any of you have an idea or example on how you could do item/condtion durations, could you enlighten me as to how you can (or can't) get it done?
I have personally haven't found anything that'd allow you to hook to the battle system.
If you allow me, I'd like to join your question: is there any way to make rolls invoke actions relative to the battlefield? E.g. placing down a shape template, apply status effects to selected tokens etc
There is currently no implementation for this in CSB. You'd need your own scripts.
I do this with the use of world Scripts.
I think in Others systems you can Set the duration of effects in an Interface. In csb we dont have that, but you can create effects with macros and add the duration there.
After all you only need some Kind of counter and a remove Logic 🤷♂️
Have a Look at Monks active tiles For this
Trueee, thank you
Maybe I should do that too, I'm going to want v11 badly so I can build Kineticists in pf2e, but I still need my CSB to work.
(that was in response to running 2 instances of Foundry)
have any of you tried the worldscript on this reddit post to get dice to show from rolling on the CSB character sheets? Nothing seems to be different when I try it https://www.reddit.com/r/FoundryVTT/comments/151h9do/custom_system_builder_show_each_die_result_by/
2 votes and 3 comments so far on Reddit
I’m stoked for the v11 supporting version! It’s actually why I bought foundry. Waiting patiently
maybe not exactly what you are looking for, but i am using this as output for my rolls (using the css from Froundry), i just have to change the upper parts and it will display the rolls like the normal rolls for Foundry. it is made for my own system, so you have to adept this for your own. But i works perfectly fine for me
${#check_type:='Körperkraft'}$
${#Art:='Schicksalsprobe'}$
${#modifier:=ref('KK')}$
${#?{Erschwernis|0}}$
${#roll1:=[1d10%10]}$
${#roll2:=[1d10%10]}$
<div class="message-content">
<h3>${!check_type}$ erschwert um ${!Erschwernis}$</h3>
<div class="dice-roll">
<div class="dice-result">
<div class="dice-formula">${! (equalText(ref('Art'), 'Probe')) ? '1d10' : '2d10' }$</div>
<div class="dice-tooltip">
<section class="tooltip-part">
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">${! (equalText(ref('Art'), 'Probe')) ? '1d10' : '2d10' }$</span>
<span class="part-total">${! (equalText(ref('Art'), 'Probe')) ? roll1 : roll1 + roll2 }$</span>
</header>
<ol class="dice-rolls">
Probe unter ${!modifier - Erschwernis}$ <br>
${!equalText(ref('Art'), 'Probe') ? concat('<li class=\"roll die d10\">', string(roll1), '</li>') : concat('<li class=\"roll die d10\">', string(roll1), '</li>', '<li class=\"roll die d10\">', string(roll2), '</li>')}$
</ol>
</div>
</section>
</div>
<h4 class="dice-total">${! (equalText(ref('Art'), 'Probe')) ? roll1 : roll1 + roll2 }$</h4>
</div>
</div>
${!(equalText(ref('Art'), 'Probe')) ? (roll1 <= (ref('modifier')- ref('Erschwernis')) ? '<p style=\"color: green; font-weight: bold; font-size: 2em; border-radius: 10px;\">Erfolg! </p>' : '<p style=\"color: red; font-weight: bold; font-size: 2em;\">Fehlschlag!</p>' ) : ''}$
${!(equalText(ref('Art'), 'Schicksalsprobe')) ? ((roll1 + roll2) <= (ref('modifier') - ref('Erschwernis')) ? '<p style=\"color: green; font-weight: bold; font-size: 2em;\">Erfolg! </p>' : '<p style=\"color: red; font-weight: bold; font-size: 2em;\">Fehlschlag!</p>' ) : ''}$
</div>```
you can turn dice rolls into macro and then hook the shape template script to the macro.
Is it possible to fire a macro when ticking a check box in a CSB sheet? The idea is when my players tick a check box for a specific status ailment, the token they control gets tagged with the same status icon.
I know you can use macro to update token with DAE just not sure if you can fire a macro from CSB
I think i would rather Set Up a world Script for that. Seems much more fail Proof.
Can do apply and remove with a world Script.
a world script? havent heard of it. i will look into it. do you have a sample of the apply and remove which i can refer to?
in macro-polo channel there is a pin which explains the setup.
after that it should be pretty simple
- hook into updateActor
- check the status of your checkbox
- depending on checked/unchecked apply or delete the effect (or toggle)
if you want to do it smart you might want to look into checking the "updateActor delta" first to see if any relevant checkbox was changed and return if not. might save some computation 🤷♂️
Thank you!
**Beta version 2.3.0-rc7 is now available, with the following changes : **
Features
- Added v11 compatibility !

Fixes
- Fixed issue with column edition in Item Containers
- [#201] Fixed dynamic table function usage in Number fields min & max values
- [#209] Fixed Dice Pool display exploding in chat message explanation
- [#270] Fixed issue with Table causing error when trying to add a component in a row after an empty row
- [#216] Fixed issues with default values not added to character from the initial reload
- Fixed issues with Right click on Labels
- Fixed issues with chat message visibility
- Fixed issues with actor & item data handling
Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta
If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Hey everyone !
As you may have seen right above, turns out v11 compatibility was not so much after all ! So I made it available for 2.3.0, in beta for now, but it will be in the final release
2.3.* will be available in v10 & v11, should any fix be made to the version
The version after will be 3.0.0, available only to v11. All deprecations currently in the system will be dropped in 3.0.0, so please make sure everything is fine before updating to 3.0.0 🙂
For v11 users out there, please tell me if you encounter unusual behaviour !
hey - i updated my foundry + CSB version (upgrade from 2.2.4 --> 2.2.7) and now i have a strange interaction.
entries in the compendium are blank. if i look at the compendium packs file the information is there.
if i import all entries they are blank. if i import one by hand (dragging into items or dragging on an actor) the item shows the right stats.
if i export the item back to the compendium it shows the right stats also in the compendium.
any of you maybe already got such an error? is there a way to fix this? dragging all items into the item folder and then exporting back into compendium is tedious...
here is an example screenshot (left is the item in the compendium and right is the item which was dragged into the items bar:
how can i change in a World the Modul from Custom System Builder to the Beta ?
This is a known thing fixed in 2.3. If you change the template in the drop-down and change it back the stuff comes back.
ah yeah right - didn't cross my mind that the issue i read some time ago was this one 😅
thank you
hello wanted to know if you can make collapsible tabs and panels with the checkboxs?
if so would ye be able to help or gib and example?
not sure what you mean exactly - but i guess you can make a checkbox and reference it in the show/hide css of the tabs/panels
I suggest you have already installed the beta.
First you have to shutdown your foundry and make a backup of your world data’s!
Head to your data/systems/custom-system-builder folder. Open system.json in editor, search “id” and change it to example “custom-system-builder-stable”. Change the folder name to exact the same as id.
Head to your data/systems/custom-system-builder-beta folder. Open system.json in editor, search “id” and change it to “custom-system-builder”. Change the folder name to exact the same as id.
Restart your foundry.
This worked for me but I don’t guarantee for any problems with your world datas.
So, backup before !!!
I’m still new to it so I’m learning everything.
Need to figure out how crafting items work in it.
When outputting a roll result to chat I'm trying to see if I can add a simple Failure, Success, or Special Success under the roll in chat depending on if the roll was higher than, lower than, or equal to an attribute key. I guess it's basically an if...else statement but I'm not sure if I can do that or what the proper way to do it is. I know I can reference the roll with := but I'm not sure how to output the result.
The second question, if the first is possible, can I change the color of the Failure and Special Success to red and green in that same statement?
you can do Success Level: ${roll<thresholdKey? 'Fail' : roll==thresholdKey? 'Special' : 'Success'}$ to get it to print the word, not sure about color but that's probably a css thing
Both is possible:
${roll:= [1d20]}$
${roll < targetValue ? 'Failure' : 'Success'}$
For the coloring part you'd need to use HTML together with CSS-styles.
I figured out how to add color to just the specific parts. This looks more like a true/false, I have a third option which is if it's equal to the target value, how would I add that in? Or does that require something more complex?
Hello guys... I have been using CSB for a while but... I am making a item template in which I need a intem container. But it doesnt work properly. when I create a item with this definition, I can't add the items... I mean is an item with an item list (is like a trait list for every item) maybe is super easy... but I don't know how to make it work... any help is needed
(Here an image with the definition)
Capacidad_tpl <-- Rasgo_tpl
(The item instance, with no capability to add traits in the item container)
${roll < targetValue ? 'Failure' : roll == targetValue ? 'Even' : 'Success'}$
And... a quick question. CSB isn't still V11 compatible , right?
Not yet. Only the beta is V11-compatible
Items in Items is not supported
You guys have been super helpful, I got almost everything to work but I have one last question. Is it possible to have a drop down selection user query for a normal roll, roll with advantage, and a roll with disadvantage?
I'm just using the regular version, is the beta stable enough to run a game on or should I just stick with the base version?
It's usually stable enough. But you should still make a backup just in case. We use the beta to detect and sort out bugs from new features, before they get shipped to the stable version.
Sounds great. Is there an ETA on a stable release?
The last beta-version will be released this week. Then it will only take a few days.
Hi all. I want to make sure I'm not overlooking something obvious. Using Monk's Enhanced Journal in a CSB world. I can't seem to drag items into the shop or person journals from an Actor sheet's Item Container object (trading functions of Ironmonk's journal). Double-checking that it's not supported in CSB?
I'm on V11 using CSB beta
You cannot drag item links from an Item Container (independent from the module).
Thanks for the quick response
Hi guys, good morning to all... Is there a way to display the item icon in a ItemContainer? Only for the looks.
Is already part of the beta
hey, im not sure if this issue is already known so here it goes: CSB-Beta, V10
i create items with a macro (which worked with 2.2.4).
now with the beta the items don't get updated properly. the stats/modifiers etc. is all there but the visuals are wrong/not present. also dragging into an actor places the item in there but it's not visible (since the template filter seems to not fit).
i think the problem is that there is no template - but i dont know why it doesnt work anymore 😐
does this code not work anymore with the beta version?
if (newItem.reloadTemplate) {
await newItem.reloadTemplate("DHQaHYIKz2WcKiSO");}
here are a few pictures:
We changed the structure of the templates quite a bit. That is probably the reason. Also, 234 modifiers... Heilige Maria 😅.
😅
So is there a full list of all Changes?
I'm struggling with navigating the git...
If you mean changes in the code-base... Yeah, that´s probably hopeless 😅 . We added and refactored way too much. If you only mean the feature-changes, here we go: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/CHANGELOG.md
Thanks maybe i find a solution in there. Else i need to get creative...
You probably have to modify it to: await newItem.templateSystem.reloadTemplate('DHQaHYIKz2WcKiSO');
using polyglot and it says,
If your system has languages set in actors data and aren't being loaded properly, it might be using another data path. Input the date path to the correct attribute (e.g. actor.system.languages or actor.system.speak).
actor.itemswould be the way to target the inventory, right? is there a way to target a specific item container?
You cannot target an Item Container. The reason behind this is that the Item Containers pull their data from actor.items and process them on their own. You cannot attach them Items by yourself. If you want to add Items, just append actor.items, the Item Containers will handle the rest.
okay, bless
it seems like its something else...
after reloading the application the item is correct
well it seems not quite right. the reloadtemplate doesnt work as i want it to
but reloading doesn't do anything until i reload foundry...
You can leave the ID out. Else... what about item.prepareDerivedData()?
Btw, these functions are not async
i think the bigger problem atm is that even if i create a new item and reload the new template by hand - it doesnt show anything until i reload foundry
ok so the issue is:
creating a new item and selecting a template + clicking reload doesn't reload the item properly. i have to ESC -> reload application / restart foundry for anything to show up.
there seems to be a similar problem with actors but not 100% the same.
it might have to do with "old version templates"?
i think i created one actor template with V2.2.7 - all other with 2.2.4
if i reload a old template it does nothing. if i change to the "new" one it loads properly. after i loaded the new one i can change to old templates.
i tried creating a new item template. i could load the new item but i cant reload to the older items.
after reload foundry all templates work.
i hope this is enough information for you to investigate? if you need anything else please ask.
is there any way that you can think of to turn a select few items into a targetable key? the module targets items named Language (X), but all of my languages are already in as just X, and renaming every language-item seems like a REAL headache (and mess of a naming scheme)
Have you tried looking at console?
I had basically the same isssues. Turns out, errors in formulas degrade performance quite a bit
yeah i have console always open - but no error messages at all
@brittle moth I'll forward this to you. I can't investigate it today.
I don't really understand the question. Do you want to rename all your items in your compendium to a specific pattern?
normally there would be a system key for languages (say, system.actor.languages) that you would add all the names of all the different languages an actor can speak to
i could maybe have it reference a text field in the actor sheet with the same key, but then my players would have to type in all of the languages manually (and that would probably be a disaster if they misspell, etc)
is there any way i could use an item modifier to add a value to a key to to get the same effect?
(like adding 'Dwarvish' to a key called 'languages'?)
or, something similar, so long as it would define a referrable key using specific items
Can you create an issue on gitlab, linking your templates & macro code ?
You would need scripts atleast. The issue is that item modifiers only target actor.system.props and not custom paths.
Nevermind... I'd been looking images for all my items (capabilities, skills, maneuvers and so) and I want to use and see them! lol 😄
i could change the path that polyglot looks for, if i could use the item modifiers to add a text value
Then the next issue. What format does it expect? CSV? Array? Both would be problematic because you cannot directly concat text from modifiers.
Atleast if you plan to use multiple language items. If it's just one per actor, it would be a bit easier (but still a bit messy)
ah, okay, then, I'll look into the module files and see what it expects, in that case
maybe i can just set the item-modifier key to language.dwarvish and have it =1, and set the module to look for actor.system.props.language
this does narrow it a lot down, so thank you
and i guess if all else fails i can just regex find and replace in the .db's
language.dwarvish would be invalid. You'd have to use language (the same key must be defined on the actor by a Label).
Item modifiers can only modify already existing keys in the actor-props.
ah, hell, i wonder, then
maybe i could cook something up using hidden modifiers in the actor sheet, then
It would be easier to use a script with the new script-syntax %{}% to be fair. But that's currently only in the beta.
oh, hmmm
I'll look into that, then
What's the best way to make a clickable journal entry link on a character sheet? Like as a label?
I am using “rich-text-area” with !important! style set to “dialog editor” for this.
hmm, ok so not on the template? mmmkay, I'll try something like that. Thank you!
Inside the template you can set a default value (your journal link).
But a bug prevents the default from being useable bevor a player makes any change to it.
@brittle moth @formal goblet
i created an issue in gitlab. i'm not sure if i did it correctly. if you need anything else please ask i'm happy to help with providing more stuff to solve this issue
YOU ARE A GOD THANK YOU
Oh wow, thanks, that message was from February 😂
Is there a term for referencing "own line" on a dynamic table? A "this" or some keyword like that ?
(Trying to make a dynamic table for skills+ rolling skills)
Hello all... Hope you can help me... I have a table (1row x 3cols) and panels in every column. How can I make a kind of "valing='top'" in my table row? I don´t need code if its too simple or complex, if you point some article or some... hint it would be great (or somewhere to understand the "additional css" field)
Thanks!!
i didn't understand what you want to do
you want to show the row if the var is true?
👍
I love to put all aligned top...
trying to emulate the Fading Suns 4 character sheet 😄
An image is worth a million words 🙂
That is 🙂 I am no english native so maybe my explanations are a bit clumsy
me neither
LMAO
i will test one thing
give me a minute
of course and thanks a lot for helping me!
Wooooo
sure (I am looking)
@outer marsh
later, send a printscreen for the elements
or you know how to make the css
Thanks a lot fot the help @glossy hare you are awesome man
Hope you are proud of me
Hey good night all... does anyone knows why do I get a "TypeError: Row is not iterable" when adding components in my actor template? (no code added not even the css code I asked before)
(This error appears saving wichever element I want to create or edit)
(Maybe I have to use it with V11 now I see it has been added in GitLab? Is it safe to update Foundry to v11 with other worlds using this system?)
It is an issue with Tables, it occurs when you add a component in a table's row without adding ne in every row before it. It will be fixed in the next version 🙂
V11 will be supported in the next version which is the 2.3.0. It is not yet live, although it is coming soon
It is in beta, however
**Version 2.3.0 is now generally available, with the following changes : **
Features
Added consoleLog and consoleTable functions
Added undo / redo buttons
Added new function: switchCase()
Added 'fetchFromActor()' ('getPropertyDataFromActor()' is now deprecated)
Added option to use formulas for keys in item modifiers
[#200] Added item template modifiers
[#126] Added ability to edit properties from Formulas
[#153] Added ability to apply modifiers to Dynamic Table Fields
[#166] Added predefined lines to Dynamic Tables
Updated chat commands library verified version
[#215] Added delete warning on component deletion
[#205] Added possibility to retrieve the name of Actors and Items with the key 'name'
[#233], [#242], [#251] Added possibility to include custom JavaScript
[#271] Added ability to reference actor's dynamic table in an item's dropdown list
[#170] Added more options to user inputs
Added item image display in item containers in place of the briefcase icon
[#262] Added Radio Button components
Added button style for Labels
Added save on close for Rich Text Dialogs
[#246] Added User Input Templates
Added v11 compatibility
Fixes
[#245] Fixed issue where fetchFromActor wouldn´t work in item modifiers
[#236] Fixed tabs error when pre-selected or first tab visibility is false
[#245] Fixed tabs error when pre-selected or first tab permission is not enough
[#264] Fixed import of Item Templates
[#201] Fixed dynamic table function usage in Number fields min & max values
[#209] Fixed Dice Pool display exploding in chat message explanation
[#270] Fixed issue with Table causing error when trying to add a component in a row after an empty row
[#216] Fixed issues with default values not added to character from the initial reload
Fixed issues with Right click on Labels
Fixed issues with chat message visibility
Fixed issues with actor & item data handling
Very thrilled to release this one, this is the biggest release to date, in terms of added features !
If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
I had to laugh so hard because this list filled my whole discord page as soon as you´ve posted it 🤣
Looking forward to put it to use in my system.
Thanks for all the great work!
can we update the system and then Foudry itself... and it would not change other installed worlds? or do we have to do something in order not to break previous games (I did Pendragon sheet and... I'll die if it brokes!!!)
It shouldn´t break, but it´s still very important that you do backups before you do a major update. Unexcepted things can happen everywhere. That´s why it´s common to say "No backup, no mercy".
Murphy's law anyone? 😂
2.3.0 version I get a lot of warnings for items which aren't visible in the sheet. "item template has been deleted". I guess this is normal but it's a new warning and I think I'd have to locate the items in .json export to get rid of them.
I've been wracking my brain trying to figure out how to do a drop down query in a roll for a normal roll, advantage, and disadvantage. I can get the query to pop up but all 3 options under the drop down say ERROR and it doesn't roll anything, I have a feeling I've got something in the wrong order but I can't figure out what.
${Roll:= ?{Type|[1d20]:'Normal'|[2d20kl]:'Disadvantage'|[2d20kh]:'Advantage'} + ?{Modifier|0} }$
Any ideas what or where I messed up?
That is a warning that is shown when an Actor has Items, that do not have a valid link to an Item Template.
It should be done this way:
${#concat(?{Type|'1d20','Normal'|'2d20kh','Advantage'|'2d20kl','Disadvantage'}, ?{Modifier|0})}$
${Roll:= [:Type:] + Modifier}$
is it safe to use built in foundry export/import json on a sheet template rather than the export buttons in the CSB settings?
Yeah, that is not an issue.
I have to say that I love you guys... I've updated foundry and CSB and... everything is running smooth!!! Thanks for your GREAT work and support!!!
Anyone able to spot what I'm doing wrong with this roll message? The console error log says I have a misplaced ( or ), but I can't find one. There's zero output to chat, not even an error message.
${[(ref(sameRow('rote_attribute', wit)) + sameRow('rote_bonus_dice', 0) + :magic_dice: + ref(concat(sameRow('rote_ability', metaphysics),'_dice')))d10x10cs>=sameRow('rote_dif', 6)]}$
Update: I think I added in the missing ) (added above), but the same error persists.
You should try to split your Label Roll Message into multiple parts by using temporary variables. Doing everything in 1 line is just bad.
And you should check this: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Frequently-Asked-Questions#q-when-do-i-use-in-a-label-roll-message
I don't know what a temporary variable even is, but I had a feeling I was screwing up the :s. I'll try working with those. Thanks.
You can do this:
${temporaryVariable:= prop1 + prop2}$
${temporaryVariable}$
The result of prop1 + prop2 will be saved in temporaryVariable, which can be used further downwards.
Huh. That's super handy. Does that work anywhere in the same roll message?
Yeah
I'll try that. That's really nice. Unfortunately, using :'s didnt' solve my problem, though.
However, cleaning it up with temporary variables seems to have done the trick. Thanks!
I may be missing this, but I can't figure it out. Is there an easy way to track how many items are entered into a dynamic table (i.e., how many lines are added to it)?
${count(fetchFromDynamicTable('tableKey', 'columnKey'))}$
Wow. I should have figured that out. But thank you!
im a bit new to Custom System Builder. Is there a way to use active effect to change the value of the check box in the actor sheet? For example, i want to add a Poisoned status effect to the token and it will change the value of isPoisoned in the actor sheet to true. isPoisoned is the component key of a checkbox in actor sheet
It would be easier to use active effect modifiers, which change the icon display of a Label instead of toggling the state of a checkbox.
i dont really understand what you mean by "change the icon display of a Label"?
You can use HTML in Labels. This way, it's also possible to display icons: <i class="fas fa-iconName"></i>. https://fontawesome.com/
You just need a checkbox-icon as default-value and a check-icon as a modifier value, which overrides the checkbox-icon.
Ah i think i got what u mean now. I will try it later. Tks for the help
I must be doing something really dumb, here, but can anyone tell me why ${capitalize(variable_name)}$ wouldn't work, where variable_name is a key that's set to a string?
the active effects doesnt seem to work for v 2.3.0 . i am on foundry v11
can anyone confirm if its working and its just error on my end?
just a very simple output to label but it doesnt seem to work even tho i double check that the key is correct after the status is applied (there is only 1 so no mistaking it for another status effect).
capitalize() doesn´t exist in CSB or in the math-js-library: https://mathjs.org/docs/reference/functions.html
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
You don´t need to put it in quotes if it is not in a Formula. Otherwise I´ll check it when I´m home.
sure thing i will wait for you to be back. tried without double quotes doesnt work either and even on safe mode (with all mods disabled)
hello,
since the system is updatet to v11, i was thinking in investing time again and improving my system 🙂
but i got the the console output. Someone know why?
i got it, there was missing a space in the math formula
Well, spaces usually don't matter in a Formula
i dont know why, but after i made a space by RS_Rumpf*5 into RS_Rumpf * 5 it works
That is probably not the issue. You can revert it and check it by yourself
hmm, yeah, i undo it and it still works 😄
I call it "Habs ja gesagt"
Vielleicht, weil ich mein System als Modul gespeichert habe mit allem in Compendiums. Und nach dem Import der iwas nicht lesen konnte, aber nach der Änderung und dem Speichern das dann hinbekommen hat
Es kann vorkommen, dass beim initialen Laden nicht alle Felder gesetzt werden. Da hilft i.d.R. einfach irgendein Feld zu verändern, um ein Reload anzustoßen.
Hello guys I was wondering if you can help me with little something. Is it possible to change the text color to something else for the items?
it turned orange at some point and I don't know why
That's not even the standard color 😅
HI. Is there a way of changing the background in the default character window ? I'd like to get away from teh grey, or even include a watermark type logo.
Maybe CSS-conflicts with other modules?
I don't even know how it happened 😂
Press F12 and use the "select element"-button to select the background. Then you should check which CSS-class is used for the background. If you have that, you can create a Custom-CSS file and override this class.
I'm not using any foundry theme modules, I think I have a couple Journal Improvement modules but it does not seem to be it
Then I have no clue. It's the first time I see this. Maybe you have some luck finding something with the Inspector (F12).
Is there a away to override it with a css class ?
Look few answers above
thanks
nächste frage: ich hab zuvor mit dem module advanced Makros gearbeitet. Da nun Macros unterstützt werden (und anscheinend auch etwas an macros geändert wurde in v11) wollte ich das natürlich nutzen.
Kann ich Parameter mitgeben?
Ja, Beispiele sind in der README
Das hab ich gefunden: %{return await game.macros.getName('YourMacro').execute()}%
Aber ich möchte nun dem Macro parameter mitgeben. Also im Macro soll der genutzt werden.
ich hatte %{return await game.macros.getName('YourMacro').execute(${KK}$, ${Körperkraft}$)}% probiert, was leider nicht funktionierte
- Name des Macros habe ich natürlich geändert
Wo wirds ausgeführt?
label roll message
Dann sollte das eigentlich passen. Irgendwelche Meldungen in der Konsole?
Kannst auch versuchsweise das in der Konsole mit aufgelösten Werten probieren.
ja ich prüfe gerade, bekomme uncomputable token, glaube da liegt dann der Fehler iwo im Makro. Hat sich vermutlich was geändert mit der Version, oder ich hab falsche Parameter mitgegeben
Kann ich mittlerweile mit einem label roll message ein anderes label verändern?
Kannst Eingabefelder manipulieren aber keine Labels (die sind eh readonly)
ich habe zuvor immer per Makro: await a.update({system: {props: {Wert: args[0], check_type: args[1]}}}); die labels geändert, werden die mittlerweile anders gespeichert?
Die nicht, aber das ganze Template-System 😅
okay, dann muss ich mich damit wohl nochmal etwas stärker auseinandersetzen wieder 😄
Funktioniert die übergabe von Parametern aus Dynamischen Tabellen? ja oder?
Wüsste nicht warum nicht.
Hi! Love the new update!
Good to hear 😄
So is there no way to capitalize a string, then?
Not with normal foundry formulas, but you can use script-expression together with toUpperCase() https://www.w3schools.com/jsref/jsref_touppercase.asp
Is it possible to remove the validation button from the new popup box, and have it close after choosing a roll? I have a popup that, instead of having a dropdown with advantage/disadvantage choices, simply has extra roll buttons to choose from. The buttons work, but then I need to X off the pop up or hit the validate button. Simply trying to reduce number of actions. No big deal either way, just curious.
Can I put that in, say, a Label? I have a very poor understanding of how to incorporate JS into the sheet, I'm afraid.
Yeah, you can: %{return ${variable_name}$.toUpperCase()}%
Thanks!
Hm. That doesn't seem to work, unfortunately. Is that for the new version only?
Yeah, only with version 2.3.0
Hello folks... I have a formula question:
ddlSkill is a dropdown list containing in the key field the id/key of other numberFields in the sheet.
- ${ fetchFromActor(name,ddlSkill) }$ <--- returns txtCharm, txtWhatever, that all are number fields
- ${ fetchFromActor(name,fetchFromActor(name,ddlSkill)) }$ <---- error
is there a way to do this "indirect" pointing to fields? Thanks!
Why the hell do you need fetchFromActor() twice? 😅
I'll try to explain
its fading suns.. Target Number for a roll = skill+characteristic . I have skills and characteristics in number fields in the sheet, and you can mix skills with characteristics "freely". So I got a "roll area" where the player selects the skill (dropdownList) and the characteristic (another dropDownList), then I need to get the numberField value selected in the skill dropDownList then the characteristic value selected in the other dropdown list and add those numbers to get my Target Number
Maybe I am making it overly complex 😦
It's kind of a pointer pointing a pointer
Then ref() is your friend: https://gitlab.com/custom-system-builder/custom-system-builder#426-ref
GOOOD
Thanks!!!!!!!!
That's EXACTLY I have missed that golden function... THANKS!!!!
recalculate() also works good with pointing at other components: https://gitlab.com/custom-system-builder/custom-system-builder#429-recalculate
If I want to install the new version, would that be the beta or the stable version?
Yesterday it was released as a stable
Thanks!
were you able to help me take a look on this?
Ah right, I´ll check that now
appreciate it!
It´s indeed broken...
So, for some reason, if I put %{return ${magic_ability}$.toUpperCase()}% in a label, all my labels in the entire sheet go blank. I upgraded.
("magic_ability" is a key on the sheet, a string, that's otherwise worked fine)
Try to surround it with quotes -> %{return '${magic_ability}$'.toUpperCase()}%. Otherwise the log might be helpful
That did it! Is there a way to only capitalize the first letter, though?
%{return '${magic_ability}$'[0].toUpperCase()}%
You can also experiment a bit in the console btw
I don't understand the function enough to do that, unfortunately. Adding the [0] it seems just truncates the string down to the first letter. How would I get the rest of the word?
Yeah, I just realized that 😅
don't you need to concat the rest of the string on the end with something like + '${magic_ability}$'.slice(1)?
oh, lol
Sorry, I'm definitely out of my depth, here. I'm used to having a simple function like capitalize() to do this sort of thing.
sadly JS isn't python
Can I just put that in a label or concat, or do I need to do something more complex to make it work?
I think that should go inside the script, giving you full line that looks something like %{return '${magic_ability}$'[0].toUpperCase() + '${magic_ability}$'.slice(1)}%
Okay, ${concat(%{return '${magic_ability}$'[0].toUpperCase()}%,'${magic_ability}$'.slice(1))}$ seems to work okay.
yeah the concat function should work too
Thanks!
I got the same colour problem. Within all gamesystems and worlds, even without any modules.
For me it seems that Foundry V11 overruns or changed class of all hyperlinks (items in container are hyperlinks).
Inside console I found “--color-text-hyperlink: #ff6400”.
But till now I didn’t found the corresponding “style.css” or actual used class.
oh rip. good to know its not me going crazy. thanks for confirming!
I have a small problem, in a label, I do a search in a dynamic table, I get the right result (a number) and if I add another number I get the right result.
However, as soon as I give a Component key to this label I don't get any results and if I add a number I get an error.
What is the problem?
I'd like to take this opportunity to thank you for your excellent work.
I'm not sure how to tell--is the new CSB version compatible with V.11 Foundry, or is that the next release?
It is already compatible: #1037072885044477962 message
Did you use first()? It´s important if you expect a single result because fetchFromDynamicTable() always returns a Matrix.
yes
Then I need more context
ERROR = with component key else without component key
I can´t see anything in the first picture 😅
A quick one (I hope) Why ${ ref(string(ddlDropDown)) }$ is ok but ${ numb:=ref(string(ddlDropDown)) }$ displays an error? (At least I made it with ref, as been adviced before)
Hi. Is it possible to add a script macro dice roll to the character sheet? Thanks for any help.
temporary variables are only allowed in Label Roll Messages (if this is the problem).
Sure. Just use the script-syntax %{}% to use Javascript (and to call macros over it): https://gitlab.com/custom-system-builder/custom-system-builder/#45-scripts
Thanks @formal goblet, I didn’t read the guide properly and only added the %%.
I am in a Label Roll Message (calculating)
Then see if the white space at the beginning causes an issue
Yes, the white space was the problem
Hi. With the lastest versión can upgrade to v.11 and use old templates, compendiums items?
Y
Sorry. Do I add to Label roll message (optional) %{ macro script }%? I’ve tried this and the full macro prints to chat.
Thank you. It’s been a long day 😴
Want to put a value in a NumberField of the character sheet (key: txtReservaVP) ... but I keep getting an error ${setPropertyInEntity(name,"txtReservaVP",6)}$
I tried 'self' instead of name and 'txtReservaVP' also... Thanks for your help, time and (above all) patience
THis is indeed broken, as Martin confirmed, and will be fixed quickly 🙂
Hi all. Trying to use setPropertyInEntity to adjust a resource quantity in an item in item container. ( just like the example.) Works fine on the roll message. Is there a way to silent the chat message entirely? I don't want the sound cue or chat clutter.
EDIT : v11. CSB beta
Error with component key else without
It should be ${setPropertyInEntity(name,'txtReservaVP', "6")}$ instead
Check the log with F12
I think we´re missing this feature, or am I wrong @brittle moth ?
By no means a problem, if it's not a feature. Down to the smallest details at this point. Love this system
Yeah, there is no way to silence the Chat message entirely for now, you're right :/
Then I´d advise to create a Feature Request 😅
Worked like a charm... thanks!!!
Really appreciate it. Thanks!
So how can i make something not visible if a checkbox is checked. I know how to make a sheet aspect visible with a checkbox but not the inverse.
not checkBoxKey
I do this, where the key cl_edit is the key for my checkbox
Ok, I want to ask if this is possible because the last time I tried it didn't work.
I have an actor that is fetching values from all of my player actor sheets and then evaluate what the highest number is among them. For example, I have one player with 1 Arcana and one with 5 Arcana. The actor I'm making is fetching the 1 and the 5, and then utilizes the 5 because it is a bigger number.
I need to do this for several different traits, which I have, but this now means that if I add a player, if a player changes their name, or if a player becomes a different character, I have to go through and manually change the template in EVERY SINGLE SPOT.
SO, what I'd like to do is have a dynamic table hold the values of all the player characters names and then fetch from that table. (So, if the table has the player name "anna", it would fetch the name "anna" and then use that to fetch anna's arcana trait). This would mean that to edit player names, I'd only need to change the table, BUT it didn't work when I set it up. Either I've done something wrong OR it isn't possible.
So before I spend a lot of time troubleshooting, is it possible to fetch a thing and use that fetched thing to fetch again?
Is anyone else having an issue since updating where sheets won't reload?
Hi! JS and Foundry noob here. I'm trying to create a formula that is dependent on a dropdown list component, where each key must return a specific value. Such as Aero returning 35, Airship returning 30. (Example keys provided below). How can I achieve this?
I made a fresh V11 installation and get through step by step.
It seems to be „Monk‘s Enhanced Journal” that caused this effect, and even keeps it up when I deactivate the module again…
What you basically want is a lookup-table, and that should be doable. You should be able to nest fetch-requests without an issue, so the problem most likely lies somewhere else.
That is known. The current fix is to edit the template and reload all the sheets.
You can directly use these numbers as keys, so that the dropdown directly returns these
I'd like to be able to reference the dropdown list for other fields as well in case I need them to return different values. Is there a way to refer to each individual key and have them return a specific value without changing the keys in the list? Like something conditional? 🙂
Then you can either use switchCase() or the ternary-operator
switch case gonna be real useful
Thank you! I've tried both methods, but I keep getting errors. I can't tell what's missing or wrong.
Ternary Operator
${equalText(chassis, 'aero') ? 35 : equalText(chassis, 'airship') ? 30 : equalText(chassis, 'hover') ? 25 : 0}$
SwitchCase
${switchCase(chassis, 'aero', 35, 'airship', 30, 'hover, 20, 0)}$
the last item "hover" is missing a '
Ah. That's embarrassing. I will now go and hide in a closet forever.
relax
we all have momentes like this
Thank you though, I don't suppose you know what the issue seems to be with the Ternary Operator?
i got from my bed like rn
idk what you were talking, just scrolled down
whats happening
if you can ping where you started talking about it
Yup yup!
what is the context for this dropdown list
The choice of chassis affects movement and a bunch of other resources, so I wanted a formula that could provide a specific value depending on the key selected. In this case, I was trying to set up the value for movement speed (35 for aero, 30 for airship, 25 for hover, etc).
The switchCase solves my issue, but I'd like to know what I did wrong with the ternary-operator just to learn 🙂
i can't see an apparent typo
probably a logic problem or a really small typo
Hi, i found two problems migrating to v.11
First is that i can import old templates and see, configure the sheet, objetc. But when i create a new item, foundry dont recognize template and show a blank.
Second. I have items from varios templates, weapon, ammon, magic, physic... I can create a compedium for the world, but when i import the compendium in other world, all items change the template for the first alphabatecally, in case arma(weapon)
if you are patient you can remake the templates, it solves the problem. You can copy the sheet to a new one.
so, how do i make a item filter filter by the selected dropdown option?
and i think the second is foundry itself
the selected option from the dropdown menu is what talking about. So if i select "Small (1)" from the dropdown menu the item container would filter by that.
i don't think CSB suport that
It doesn't
how do i do this? I'm remaking all the sheets by hand to resolve.
because i can't create new actors
Hello I have a question, now that we can use formulas into items modifier, I was wondering if, using a specific formula, it was possible to create modifier from a dynamic table.
For example if in a dynamic table I chose in dropdown lists "dexterity" "+" and "4", it would apply a +4 modifier to dex
Or is this still out of reach
Only items are able to create modifiers
Also, I've seen here that apparently we can drag and drop an item from a sheet to another, https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/274
but when I try it, I can't move the item
That's wrong 😅 You should take a closer look at which points I've answered
damn, mb
Hello again, I made a dynamic table that shows different attack modifiers for each Melee Form, and was wondering if there is a way to add the attack modifier to the label roll message? I've tried with switchCase but it either ends up breaking or the value doesn't get assigned to the roll, so I'm assuming I have to try a different method.
The sameRowRef() is probably the issue
i uh...2.3 seems to have done something to these item containers lol. any guesses why or a css fix for this?
Macro Calling Question: I had this solved until we upgraded to the new CSB/new Foundry and removed Advanced Macros module. I have an Item that gets added to an Actor sheet. You click a label on the item and run a macro that needs to know the item's name. What is the proper syntax for calling the macro shown in the label roll message below when I want to pass the item.name as a parameter? Do I enclose item.name with any symbols?
%{return game.macros.getName('TestMyMacro').execute({param1=item.name})}%
Maybe I'm doing it wrong? I tried to assign it to attackmod in the example below, and got the error 'Value Expected'.
${#attackmod:= switchCase(ref('meleeForm'),
'aegis', strength+capacity,
'aggressive', strength+endurance,
'attuned', strength+willpower,
'elegant', strength+discipline,
'precise', strength+agility)}$
${attack:=roll+attackMod}$```
attackmod has a typo
I'd need to take a look at FoundryAPI for how to pass args to the call. But I'm not home for the whole week 😅
That is not the default-style, so something overrides the CSB-defaults
interesting indeed. i'll find out whats up with no css styling (though i'm not styling those containers...)
Actually, I've found my old implementation 😅: https://gitlab.com/martin1522/custom-system-builder/-/blob/feature/macro-execution/module/formulas/Formula.js?ref_type=heads#L552
Ah, fixed! Thank you. Unfortunately the issue still remains and I'm not sure how else to fix it.. 😵💫 I continued digging into the console logs; the attackmod expects a value despite the switchCase, which leads to the attack formula breaking due to 'uncomputable token'.
this is with absolutely no css styling... could there be a bug with table density perhaps? other containers on the sheet dont do this
I might be able to reason it out is that available for me to look at easily?
I hope you're enjoying yourself somewhere fun and not too consumed with answering our questions 😄
**Version 2.3.1 is now generally available, with the following changes : **
**Fixes : **
Fixed issue with active effects not computing correctly
Fixed issue with dice so nice integration and chat messages display
[#275] Fixed issue with legacy templates not displaying correctly in new actors & items
Fixed issue when using Numbers inside setPropertyInEntity function
If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Thanks! I'm afraid I'm not sure what to do with this. In a label roll message could I do macro <MacroName> <arg1> <arg2> then? Or do I need to call it a special way? I tried using %{macro TestActionMacro}% but got an error
It definitely should go into the execute()-part. But that's all I can say for now.
Thank you. I just need to figure out the right format to send an item property key 😉
I'm getting a weird error at the end of macro call from a label roll message. The macro works fine but I get this error:
Uncaught (in promise) Error: Unresolved StringTerm object Object requested for evaluation
[Detected 1 package: system:custom-system-builder]
This is the last part of the macro where it seems to be happening:
if (rollOptionValues.cancel === false) { //ChatMessage.create(chatData, {}); return ChatMessage.create(chatData, {}); } else { return true; }
It displays the chat message correctly but I'm getting an error. Maybe the chat message is displaying because o the .create call and the return is having an issue
if anyone runs into this issue; for now dont put item containers in headers
any ideas on a "view source" sheet button that displays a list of an actor/item's keys and their values, akin to on roll20?
although i guess i could just use the export button
Ah. Please disregard. This worked
Would lovely to have the ReadMe in git updated with an example syntax or screenshot like this
You could take a look at the console (with game.actors.getName('actorName').system.props)
Not sure if this is a bug but i noticed that the item modifiers from the templates doesnt get 'inherited' by new items that are created. Am i using it wrongly or this is a bug? 🤔
You won't see them there
oh so they are not meant to prefill newly created items with item modifiers?
Nope. They will be applied directly to the actor without visualizing in the item.
i see. alright. thanks for the explanation. maybe i can try a feature request to have them being displayed.
its minor but i see value in it being shown. helps with troubleshooting in scenarios where you do not know where the mysterious value is coming from.
on a side note thanks for the fast fix on the active effect modifiers! 😄
oh wow, this is perfect, bless
@formal goblet setPropertyInEntity does not work for hidden attributes?
It should but I can imagine the bug-potential for that case... @brittle moth I beg you 😅
yeah it looks like it does not work correctly at least for me in v10. Do not know about v11 but should most likely not make a difference
I will create a bug report on gitlab for it
Good morning to all! I am in a continuing awe with this software, for real!
now, the question (the awe is real!!)
in a roll message i can write %{ game.journal.getName("entry name").sheet.render(true); }% and works perfectly
how can I do something like this? %{ game.journal.getName(${txtLinkItemJournal}$).sheet.render(true); }% (Being txtLinkItemJournal a text field with "entry name" value)
Thanks a lot!!!
Nevermind... just wrote the question and figured out the answer: %{ game.journal.getName("${txtLinkItemJournal}$").sheet.render(true); }% the quotes, just in case... thanks a lot for this software and your ongoing support!!!
Next Question, how do you get the values of a filled user input template in a roll message?
Nevermind, you just have to use keys in the input template corresponding to existing keys in the sheet using the roll
how would i go about adding to an array with item modifier scripts?
oh man
You can basically create your own pull-strategy if you really need this 😅
So in the formula it would be something like:
- get all items on the current actor
- filter by specified item template
- flatMap by item prop
- aggregate or concat values
i guess yeah i should probably do this on the character sheet itself rather than on the item
that makes much more sense
while experimenting i found that setting the key languages=dwarvish worked and i was wondering if there was an easier way to just combine multiple like that directly
Dynamic Table with dropdowns?
And the language-prop would contain a simple fetchFrom()
if all else fails
I'm just particularly attached to using items because i have all the descriptions and the xp cost of all of it written out there
maybe i can just go about all of this in a very roundabout way
if i can't get the scripting to work, i mean
I kinda feel like that I need some Wiki-entries for the scripting-part alone...
a list of commonly used commands would be REAL helpful honestly
Well, most of the common stuff can be done with Formulas alone. Scripting is there to have a way to extend common behaviour
so, i've cannibalized some code from the module itself
in theory, could i set a hidden attribute on the character sheet and define it as: ?
let customLanguages = new Array();
let templateID = "nd75dp1Vd1GTa1S1";
for (let item of game.actors.items) {
const template = item.template;
const name = item.name;
if (templateID.test(template)) customLanguages.concat(name);
}
return [customLanguages];
}%```
like, this would return an array of dwarvish,elvish,etc, if i set it up properly, right?
i'm not sure if i'm trying to fix something that can't be fixed or not
This is a comma-separated value (CSV), not an Array 😅. An Array looks like this: ['dwarvish', 'elvish', 'etc'].
So you should change the body of the if to this: customLanguages.add(name);
And I can't say if test() has an equality-check.
ok i see there are now also equipable items. so how i can i equip? or unequip but have? for example i planed for items to not impact waight by 0.5 of norm if equiped also only then i wanted modifiers to work
You can create a checkbox ('equipped') and a number field ('weight') in the item template and define a modifier there:
Prio: 1
Key: totalWeight
Operator: +
Formula: ${equipped ? weight : 0}$
thx, is there a way to prevent equiping like 10 armors?
Nope
How do you create something like this: with the current radio buttons?
I can see that you can only use radio buttons as "switches" or value replacements...
At the moment I can do this:
but the space between dots is huge
This is actually non-standardized (HTML) behaviour for radio groups, it is actually closer to Slider-behaviour than anything else. But yeah, currently not supported in CSB.
I think if you could just reduce the minimum space between dots that would solve the problem...
The way it is, radio buttons can not be used on character sheets as value indicators. They behave more like a switch on a One multiple-choice form.
I don't understand how the two screens are different apart from the radio buttons spacing :/
If it's just that, you can solve it by using custom CSS
I thought he wanted something like a bar, e.g. if the 3rd element gets selected, 1 & 2 get selected aswell (equivalent to a number field with max-value)
This one e.g.: https://codepen.io/jayx/pen/mWwBvw
anyone solved containers? for item to have items inside? if i want seperate bags?
It is not possible for now, but planned in the ROADMAP 🙂
hey @brittle moth thank you very much for fixing the item template bug with 2.3.1 🙂
by any chance do you know a working api command (for script macro) to reload a template?
item.reloadTemplate(); doesn't work 😦
i have red about adding css but i dont know where to add my custom css so it reads it
whoops wrong channel
@brittle moth
found the macro command 🙂
await newItem.templateSystem.reloadTemplate();
Game Settings – Custom System Builder Setting – CSS Style file
The filebrowser is not showing CSS files, so you just have to place the path to your file manually.
tried reading through the last few days of chat logs, curiuous if anyone could help regarding the item issues im having? I admit my code is quite bad and i have some pretty intense nested if statements (before switches were in here) and now if i open a character sheet that has like 3-4 items in it, the console displays all the computations for calculating everything within the items and it will go for about 5-6 minutes while task manager says firefox is using 50% cpu lol
basically almost breaks my pc lmfao
couldnt find anything specifically mentioning a lot of this
Is it possible to hide and display a component by clicking on a button (label) in csb? basically like furl and unfurl function for a specific section. I know you can control the visibility but I am mostly using that with check boxes and field values; not so much from the new buttons yet.
Right now, I have items that are guns, the guns are matched up with specific bullets of which those bullets have specific damages and specific weights to each bullet. I have 20+ bullets, all that is then added up and calculated when magazines are added on the item for players so that way weight and damage is always calculated depending on which bullet is within the magazine. And people can have up to like 10+ magazines. And then actor sheets sometimes have up to 3-5 items (the guns) on their character sheet within the item container.
Looks like when I boot up an actor sheet, foundry runs the code for every single bullet, magazine, and gun and it lags horrifically to the point where it takes 5+ minutes for the actor sheet to open along with the earlier mentioned performance issue where my CPU is working overtime. This was never an issue in previous versions.
Ill probably recreate this somewhat from scratch if I have to but im just so confused why the item containers and the items seem to be computed and then those computations seem to just break everything else
Yeah, but you'll need a second component to store the state. A button can dispatch actions, while the state must be managed somehow else.
how do you declare the value of a second component with a button click?
i think i know the logic. i can probably do a hidden label that changes value when a button is clicked and the visibility is based on the hidden label value
just not sure how the button dispatches actions
That would be it
Or you change the display (text) of the button, so you can take that to construct your predicate
That would need some further investigation. Can you open a new issue in GitLab and provide the following information?
- CSB - Version
- Foundry Version
- Browser Client
- Exports of the templates and actor
- Console logs (F12) (especially Errors and Warnings) while the world is getting loaded or a sheet gets updated
alright, i will try to get that when i can, im still doing some troubleshooting. IM genuinely getting thousands of console logs
im just glad my browsers havent crashed
This is normal depending on what Level you've configured. If you've set it to ALL, you'll see EVERY computation step. So yeah, many log entries.
You mean on like my console output? I have errors, warnings, and debug only showing i think
That's why I usually set it to 'error' and 'warning' only
but yeah, when my friend opens a sheet, it also bricks my cpu usage along with his own lol
yeah, i also had debug on, i can turn that off and only have error/warning on
I have found the main issue. I had a previous way of adding weight within an item container. It would call the total weight of an item (that involves checking which bullet is used in each magazine and then assigning the weight and then multiplying weight of each bullet by # of bullets in magazine using long nested if statements) and then it would modify an actor key. That's how I had it working from before I believe however this never fully worked and I had left it just sitting there
Upon updating to this, i figured item modifiers had to be an issue, we eventually were able to get through the lag and delete all previous item modifiers thereby finally fixing our issue. Something with our previous item modifiers had completely broken everything and was making it so that calculations would go on for 5-10 minutes straight.
What a struggle lol but I appreciate the help and I prob wont make an issue in gitlab now
This little snipet of a nested if statement....the culprit i believe
😍
Holy shit, satan has to come before I even try to debug this.
😘
Sorry man, but hey, alls well that ends well : D
the funny thing is...thats only one. I do that multiple times for bullet weight and bullet damage along with having to do that again for every magazine
...
Now, I admit that its awful code....its disgusting and i am ashamed to have done it (im also very lazy) BUT in my defense, IT WORKED BEFORE THIS RECENT VERSION IT WORKED FINE
and it actually works again now that i got rid of item modifiers lol
There must be a way to optimize it atleast tenfold
Yeah, im prob gonna redo all of this and make it much better and not be really lazy. I honestly wrote this in notepad++ and then just did a bunch of ctrl-f and replace and copy pasted it, so while its ugly as hell, I made that in maybe 2 minutes or less lol
But yeah... anyways, alls well that ends well and i appreciate input and responses : )
For that I'd need to know what you have and what you desire.
sorry, i meant i appreciated the inputs and respones from you. I think im good for now. Thank you
can i put field in tooltip? i tried ${}$ without succes i wanted to description be shown
What class should be used to apply css styling to the user input dialog box when making a roll?
Hi hi, is it possible to set some classes to only appear if you select a specific race when building a sheet?
@brittle moth, @formal goblet I just skimmed all the new features that came with 2. 3 and I have to say: you are among my favourite people now 🙂 awesome work and much appreciated!
Any known issues with items not saving changes when you edit them? Like, it'll seem to show the change has saved, but then when you close the item and re-open it, none of the information you entered is there anymore.
What are you changing? Numbers fields? Labels? Dropdown?....
Hi all! Can someone help direct me on how to have multiple attack options from a weapon in an item container? Example, an SMG with two attack options, single fire that rolls 1 attack and 1 damage dice, or full auto that rolls 1 attack and X damage dice.
I've read a lot of the how-to stuff but I'm no good at this and kind of need help getting started.
You can define the attack modes in the Item Template (Dropdown would fit). Then you just define the distinct parts in the Label Roll Message. E.g.:
${#damage_dice:= switchCase(attack_mode, 'single fire', '1', 'full auto', x)}$
Attack: ${[1d10]}$
Damage: ${[:damage_dice:d10]}$
Thank you Martin! How does the player choose between the two modes? Since only labels can be used in the container would they have to open up the item and use the drop down?
or maybe a pop up box instead? Since in full auto case, with X, the player would have to input the desired number of bullets fired.
Both doable (opening the item and changing it in it / asking for user-prompt), you decide what you need. An example with the pop-up can be found here: https://gitlab.com/custom-system-builder/custom-system-builder#48-user-inputs
Thank you!
I am super new to Foundry and am wanting to adapt a game I have written to the VTT. Can someone please tell me how to best get started?
The best would be to go through the Readme: https://gitlab.com/custom-system-builder/custom-system-builder
the king is online! can i put field in tooltip? i tried ${}$ without success i wanted to description be shown from the item
Tooltips don´t support formulas
It happened with rich text fields and text fields.
can you show your code?
Not just this moment, but the item just wasn't saving any information entered into it when it used to do so perfectly fine.
🤷♂️ without code no idea
I was asking if it's a known bug because this is bizarre, and I have a hard time believing that a basic set of fields would just magically stop holding information, even after a version change. I can grab the code when I get to my computer.
It's unknown
I'm going to reload the game and try again. Maybe there was some kind of connection issue that prevented saving last night.
going back to this formula, how do I get it to roll not xd10 but x separate d10s. 3 separate totals for damage?
how would i get the following / is it doable?:
color the background of an item container depending on the rarity key of the item in it.
for example if the first item in the item container has the key "itemrarity" (0 / 1 / 2) of 1 then the background should be blue.
is this doable?
Hello, I just ran into an issue when I updated to the lastest version, it appears to be one that was already mentioned previously where the number field box disappears when permissions for Observer is given to other players to view sheets. I reverted back to 1.7.3 and it seemed to fix the issue. Is there by any chance a newer version without the number field permission issue?
how can i use 2 attributes to derive a third value? phyvalue + mstvalue is what I want - but confused on the script to use. and where it would go.
Hello everyone. I am new here and have a couple of basic questions.
Is there any documentation for this module and if so, where can I find it?
Thanks!
Secondly, is it normal for the "Configure sheet display" to not pass changes for "Sheet Default width" and "Sheet default height"?
are you closing and reopening the sheet? I dont think the changes will immediately take effect, but they should the next time it is opened
and keep in mind, a template is not a sheet. the sheet display settings wont affect your template, only a sheet
Yeah, tried that. Gotcha! I work in software tech support, so closing an reopening is pretty standard. I just need to make those sorts of changes in the template and then should see them applied in the actual actor sheets!
correct!
and that concludes the amount of help I can give lol... I'm usually the one asking for help here.
10-4, I will save the more complex questions for later then 🙂
This should be applied on template reloading on character sheets
You can by using a grid panel layout, and adding in your component the custom classes grid-span-2 to grid-span-12, which spans elements over 2 to 12 columns
Is there a way to add an item to a dropdown menu based on the value of another? (Ex: choosing a specific race adds an extra class you can choose)
No, that is not possible
Okie dokie. Thanks
Can I use 2.3.1 on version 11?
You can create a Label with the default value ${phyvalue + mstvalue}$. The result can be used by other components, if you use the key of the Label.
You should read this section for more info: https://gitlab.com/custom-system-builder/custom-system-builder#4-formulas
Y
got it
You´d need a script for that tbh. It´s not that easy.
Any way yet, at least on Unstable, to make a Roll automatically deduct a point from a resource? Like, rolling something that spends stamina, and the roll automatically spends that stamina?
thanks - I did read it - and I apparently didn't understand it which is funny because I did make some custom dice for dice so nice. #824384589074137098 message
Not only is it on unstable, it is on the stable 2.3.1 version !
https://gitlab.com/custom-system-builder/custom-system-builder#4211-setpropertyinentity
Okay, I have a question about how this can work within a formula.
If I set a query in the roll message attributed to 2 different stats in a dropdown:
${?{Energy:'Energy Spent ='|CWill,"Willpower"|CStam,"Stamina"}}$
How do I then deduct from the selected stat?
This:
${setPropertyInEntity('self', 'Energy', ref('Energy') - 1)}$
Or without the Ref, only brings up howw much the stat would be if deducted, but doesn't actually deduct from it.
Anyy help would be appreciated!
Cause it seems I only know how to refer to the value within the formula.
Back with another script item. ${movetotal <= 10? @mvsqtest=2: @mvsqtest=3}$ works giving me either a 2 or a 3 However, I now need to add the rest in which is basically greater than ## or less than, ever 10 numbers up to 60 then switches to ever 20. . I tried using ||in the formula but comes up with an error. ${movetotal <= 10? @mvsqtest=2: movetotal =>11||<= 20? @mvsqtest=3}$ what might be a better way to formulate this.
I'm pretty sure the || operator requires a full statement on each side of it, so your conditional should look something like
movetotal => 11 || movetotal <= 20
although I'm not sure why you need the first half, as it should only reach that second if statement when the first is false, ie. movetotal > 10
still shows as an error
now that i'm reading the docs, I'm not sure if the OR operator is supported at all
oh and your second conditional needs something for when it evaluates to false (it should have a : somewhere)
are you trying to do an OR statement or an AND statement here?
yeah the or statement portion was on the false side, but tried otherwise around as well - pretty sure the or statement isn't gonna work. so now confused how I would nestle 10 different formulas to supply 10 diffrent answers based upon the total trait
more like an if else statement (x10)
If i'm understanding the docs correctly, an if else chain should be structured as
cond1?value1:cond2?value2:cond3?value3:...condN?valueN:default
that is, assuming a switch statement doesn't work for whatever reason
apparently in math.js you have to use the word or instead of ||
I tried this as yousuggested: ${movetotal <= 10? mvsqtest=2 : movetotal <= 30? mvsqtest=3 : movetotal <= 40? mvsqtest=4 : movetotal <= 50? mvsqtest=5 : movetotal <= 60? mvsqtest=6 : movetotal <= 80? mvsqtest=7 : movetotal <= 100? mvsqtest=8}$ but is an error.
you need one last value so it knows what to do if everything evaluates to false
how would that be written?
it should end with movetotal <= 100? mvsqtest=8 : mvsqtest=someValue
for whenever movetotal is greater than 100
I feel like there is a formula that would work for you but I forget my math statements
In my friends game modifier is basically (stat/20)+1 and no decimals and no weirdness happens due to rounding.
floor() gets rid of of decimals/truncates a number, if that is what you mean
Does anyone know an answer to this?
This should work, could be simplified as :
${setPropertyInEntity('self', 'Energy', Energy - 1)}$
This will only work if Energy is an editable field, not a label or an hidden attribute 🙂
It does not seem to work. I'm on Unstable.
When I use this formula, all that it does is subtract from the energy value within the roll message, but the Energy value of 'CWill' or 'CStam' in the sheet remains unchanged.
I'm going to need more info on your template to help you. Are you trying to substract from a field keyed 'Energy' ? is it a standard field or is it in a dynamic table ?
${?{Energy:'Energy Spent ='|CWill,"Willpower"|CStam,"Stamina"}}$
${setPropertyInEntity('self', 'Energy', ref('Energy') - 1)}$
This is the formula. The CWill and CStam are keys to text-fields in another tab. They're not in a dynamic table.
Sorry, I re-read your first message.
So you're trying to update the CWill or CStam field ? And your player needs to choose it in a user input ?
Yeah!
Your user input there sends back the value of the fields. They need to send back the key for the rest to work
${?{Energy:'Energy Spent ='|"CWill","Willpower"|"CStam","Stamina"}}$
${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
This should work
Be sure to use ref(Energy) when you want to use the value, and Energy when you want to get the name of the original field
Isn´t that actually equivalent if you use quotes in ref()?
EDIT - Removed quotes in the ref function
:P I'll try! thank you!
I could use some help on this one little project. I have a macro that rolls 2d6 with a prompt to add a static modifier (attached). How would I convert it into a button action on a character sheet? I have the die roll action but I haven't been able to figure out how to do the modifier prompt. Thanks!
have you read the user input docs?
https://gitlab.com/custom-system-builder/custom-system-builder#48-user-inputs
If this is even possible.... how do I go about having a button or roll that adjusts a value on multiple items at once?
So, a glitch that I was having since before the 2.30, and that is still present is that if a dropdown refers to a dynamic table, and I select an option which has a value equal to another option in the same dynamic table, it just defaults to the first one alphabetically with the same value. Which is far from ideal.
Pretty sure this will work for you: reuse formula results
https://gitlab.com/custom-system-builder/custom-system-builder#47-reuse-formula-results
Hi,
Can't understand how to use switchCase
${switchCase('combat_level', '0', 'novice', '1', 'base', '2', 'advanced', '3', 'expert', '4', 'master', '5', 'grand master', '6', 'god', 'UNEXPECTED')}$
is always show UNEXPECTED, but if I use
${combat_level==0?'novice':combat_level==1?'base':combat_level==2?'advanced':combat_level==3?'expert':combat_level==4?'master':combat_level==5?'grand master':combat_level==6?'god':'UNEXPECTED'}$
it is changing the value accordingly to combat_level value
Unquote the first parameter, then it should work.
My bad - thank you)
By the way is it possible store dynamic table for usage for items or actor
I mean globally and not hardcode values in templates - without using JS directly.
For example create rollTable and just get specific row by value
You mean something like a lookup-table? You could create a global actor, which holds the dynamic table and reference this actor with fetchFromActor()
yes - think about such variant. But for that i need create Specific template only for this 'Service Actor'
And the roll tables are already exist with such options.
Also they can be imported by compendium, same for actor
how to make double conditions? OR AND?${Glo AND PP ? pp : 0}$ I wanted for both checkboxes to be true
there might be a more elegant solution, but you can nest them like:
${Glo ? (PP ? pp : 0) : 0}$
Try this
${ and(Glo, PP) ? 'Success': 'Fail' }$
you can use https://mathjs.org/docs/reference/functions.html#logical-functions
by omitting the math. before function
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.
You can also use the keyword and (lowercase): ${(Glo and PP) ? pp : 0}$
so, i've written this (based on the code from the module itself) just to test the very basics:
const name1 = 'Elvish';
const name2 = 'Dwarvish';
customLanguages.add(name1.trim().toLowerCase());
customLanguages.add(name2.trim().toLowerCase());
return [Array.from(customLanguages.values())];}%```
but it throws up an error, and in the js playground i'm using, says `illegal return statement`
but, when i change `return [` to `console.log(`, it works just fine, and gives me `elvish,dwarvish`
is it something with the way i'm formatting it? the original module just uses return [customLanguages];, but that doesn't work, either
is the scripting more limited than i'm thinking, or is there something i'm missing?
Try it without the [] at the end.
You can also shorten it to this:
const customLanguages = [];
const name1 = 'Elvish';
const name2 = 'Dwarvish';
customLanguages.push(name1.trim().toLowerCase());
customLanguages.push(name2.trim().toLowerCase());
return customLanguages;
hmmm, neither of these work
the language-box says error, and testing it via game.actors.getName('TestingDummy').system.props.languages in the console says 'ERROR'
i'm typing this in to the Hidden Attributes section of the character sheet template, defining the key of "languages" exactly as i typed above
i'm hoping this isn't just a limitation of the character sheet scripting, but i would assume it's not
You can get more info from the error in the console (F12).
character 7 being the comma between elvish and dwarvish, below
but setting the languages key to elvish,dwarvish by itself works fine?
${roll<=(item.weapon_prof_current) ? setPropertyInEntity('selected','pc_damagevariable', "pc_damagevariable + dmg") : "No Damage"}$
Just curious if anyone had an idea about this. The pc_damagevariable ends up changing to what "dmg" is but it never adds it. When I roll and get another number, it just changes pc_damagevariable to whatever the dmg is, it doesnt add. Any ideas?
When I use this in ACTOR_ONE with FILTER VALUE from ACTOR_ONE key it's worked
Running from ACTOR_ONE:
${fetchFromActor('ACTOR_ONE', "getRefFromDynamicTable('<DYNAMIC TABLE KEY>', '<TARGET COLUMN KEY>', '<FILTER COLUMN>', '<FILTER VALUE ACTOR ONE>')")}$
But FILTER not work if it referenced to the key of ACTOR_TWO sheet
Running from ACTOR_TWO:
${fetchFromActor('ACTOR_ONE', "getRefFromDynamicTable('<DYNAMIC TABLE KEY>', '<TARGET COLUMN KEY>', '<FILTER COLUMN>', '<FILTER VALUE ACTOR TWO>')")}$
You can make it work if you construct the formula with concat() or nest another formula in it: ${fetchFromActor('ACTOR_ONE', "getRefFromDynamicTable('<DYNAMIC TABLE KEY>', '<TARGET COLUMN KEY>', '<FILTER COLUMN>', '${filterValue}$')")}$
Brilliant '${filterValue}$' is works now - so it is great improvement and now I can use it for like a DB for references table.
okay, so it was way simpler than i was thinking, the way the script is processed makes it think that elvish and dwarvish are both keys, so all i need to do is find a way to get quotes put around the end result
which i think might not be so simple
this works perfectly in a js playground:
const name1 = 'Elvish';
const name2 = 'Dwarvish';
customLanguages.push(name1.trim().toLowerCase());
customLanguages.push(name2.trim().toLowerCase());
let test = `\'${customLanguages}\'`;
console.log(test)```
but putting it in to csb doesn't work (it causes the script to break entirely and not just throw an error)
however, putting the console output of the above in directly works just fine:
```let test = 'elvish,dwarvish';
return (test)```
so i *know* it's just an issue with the formatting
@formal goblet do you have any idea how to fix this (hopefully) final issue?
I thought I read some where that scripts (well at least the more involved ones) in this system and dice so nice do not play well together- or am I wrong? or more probably it is me? this script works - but rolls every dice in the script not just the one requested . the keep success out puts correctly.....am I missing something? I have experemented with several ideas - but no luck. ${strvalue <= 4? [1d6cs>4] : strvalue <= 7? [2d6cs>4] : strvalue <= 10? [3d6cs>4] : strvalue <= 12? [4d6cs>4] : strvalue <= 14? [5d6cs>4] : strvalue <= 15? [6d6cs>4] : strvalue <= 16? [7d6cs>4]: strvalue <= 17? [8d6cs>4] : strvalue <= 18? [9d6cs>4] : strvalue <= 19? [10d6cs>4] : sotcstr= [11d6cs>4]}$
**Beta version 2.4.0-rc1 is now available, with the following changes : **
Features
- Added checked by default option to checkboxes
- Added control style option to number fields
- [#155] Added Conditional Modifiers
Fixes
- Fix NumberField hidden on uneditable, non-template actors
Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta
If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
GitLab
That is because once a roll-expression is created with [], it will always perform this roll. It doesn´t matter if it should execute logically or not. That´s why it´s better to construct the roll-formula before using a roll-expression.
Info about the new Conditional Modifier List: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md#313-conditional-modifier-list
I have a dynamic table for armor (i use layering armor that combines resistances into a total) that used this formula for different body parts ${sum(dotMultiply(fetchFromDynamicTable('armor_table','arms'), fetchFromDynamicTable('armor_table','resistance')))}$
Will this work using item containers instead? not sure what formula to use.
That section is confusing to me. so I can still use fetchFromDynamicTable? but I simply need to set Item Template modifiers for arms and resistance?
fetchFromDynamicTable() doesn´t work on Item Containers at all
right, I didn't think so. sorry I'm not very good at this lol.
${STR:=strvalue <= 4? '(1d6cs>4)' :.... }$ => replace all [ ] by '( )'
${[:STR:]}$
thanks - I understand better with examples, not as good with reading.
**Beta version 2.4.0-rc2 is now available, with the following changes : **
Fixes
- Fixed issue with Conditional Modifier List not displaying correctly on legacy sheets
Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta
If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Is it possible use dynamic filter field in ItemContainer?
As documentation said The value can not be a formula, it must be a fixed value.
So filter must be KEY inside the ItemContainer and Value it's a string and not any way to make reference for example to Dropdown List value. It will be good have interactive filter for such tables
The filter key in the Item Container has to be fixed, the value in the Item can be dynamic.
Let´s say we have Inventory-Items with a Dropdown, that indicates, where the Items are stored. We could create multiple Item Containers, with different filters. Each filter would check for the same key, but with a different value (depending on what options the dropdown has). This way you would be able to store your Item Links in different Item Containers.
works great again thanks - I do like the ease of this - made a few games with sandbox, but that isnt ready for foundry V11. this seems to be very good ! keep up the good work.
What the hell are these dices? 😅
custom dice - I added to Dice so Nice. well custom pips...from Siege of the Citadel game long ago. (they should be all 6 sided - but I couldn't get the additional d6's (I tried to add) to work in dice so nice. so I cooped the 8 and 12 since that had the same odds when scaled
So I need create few containers with different filter value?
for example Level
and can't just create an additional dropdown element with key filter_skill_level NOT in itemContainer and apply it to such big itemContainer for dynamic filtering depend on filter_skill_level value
Any known issue where when you setup a dropdown to pull from a dynamic table that the dropdown will just display...nothing at all?
Is this table on the same list? Actor or Item
Both are on the same actor
Hm didn't see such problem on my side.
I've never had the issue before. Just, suddenly this dropdown refuses to populate despite the table having items in it.
check for typos - maybe it is key mistake?
I've checked very thoroughly. I literally copy-pasted the key name to be sure.
Sorry, I have difficulties to comprehend your issue 😅 So I´ll just show what I have.
M_Aktiv is a key to a checkbox in an Item. If the checkbox in the Item is checked (M_Aktiv is true), it will be displayed in the Item Container. Otherwise it won´t be displayed there. The filter only determines if the Item should be displayed in this specific Item Container or not.
It's like the dynamic table just doesn't even exist or something. Bizarre.
Any errors?
Not that I can see related to the table. I have an error from an unfinished formula elsewhere on the sheet.
That is probably the issue. If something fails, it will stop computations at this cycle
Interesting. Let me put dummy numbers into the formula and see if it fixes.
Nope. The error is gone, but the dropdown is still blank.
You can validate it if you try to change other stuff in the sheet
Okay...it's that weird error again where default values don't do anything.
I have to physically click every field in the table before the dropdown will acknowledge them.
Is there any way around that? That's an enormously frustrating bug and will make this implementation impossible, since it's supposed to be a table that the user can't click.
Usually an update anywhere on the sheet is enough to fetch all missing values.
I've usually found that doesn't work. I usually have to click every field.
That´s... unusual
Every sheet I've built has that issue. Until I click or fill a field, it's like it doesn't exist.
Well, I cannot say why to be fair
If I create a new Actor, the initial load has like 80% of all values. And after I update some random field, it has every value set
Could it be isolated based on the panel it's in or something?
Nah, Panels don´t matter at all
Then I have no idea. It's a persistent issue, though, and very consistently so.
Are you using a Browser?
Yes. Firefox.
Well, same for me, when I´m actually playing
I run from Forge, so the browser is the only way I can access the game.
Well. I have no clue if there might be issues with Forge and it´s pretty hard to verify that.
Do you also have a Foundry-Client, where you can run a test-world?
I have the client installed, but I'm not sure what I have set up on it. I never use it at all.
Wanna join my world then it test it there?
If that would be helpful, sure
Check DM
can you fetch a dynamic table from an item from within an item container?
I tried to do that but it seems to not be working? No errors are thrown in console?
i get this output in the message log but it returns nothing even though that should work
originally I tried doing fetchFromDynamicTable('item.weapon_magazine_dyntable','item.weapon_magazine_ammo_current')
Because I understand this should return me a matrix of all the values within the column weapon_magazine_ammo_current and then I was going to do first() to get the first value. However, when I do that first line written above to get the matrix, it says uncomputable phrase
Can you show the log?
this?
Ah, I see. You only need the item.-prefix for the first parameter, target and filter-values do not need the prefix
I now have another question lol
So, getting the value worked. Now I have this issue:
${setPropertyInEntity('item', "getRefFromDynamicTable('item.weapon_magazine_dyntable','weapon_magazine_ammo_current','weapon_magazine_used','1')", "first(fetchFromDynamicTable('item.weapon_magazine_dyntable', 'weapon_magazine_ammo_current')) - 1")}$
In this, I am attempting to set a value within a dynamic table, essentially attempting to reduce ammo by 1. So, in this code, I have it so it looks into the item, it finds the reference of the dynamic table named 'weapon_magazine_dyntable' and then looks under column weapon_magazine_ammo_current and then finds the value where weapon_magazine_used (which is a checkbox) has a value of 1 meaning it is currently checked. Then, I fetch the value it currently is and deduct it by 1 in the next part.
Now, when I run this, it actually doesn't give me an error. In fact, the chat-log gives me the appropriate value where its clearly found the ammo value and deducts it by 1. However, it doesn't actually set the value to that new reduced number. I presume this means that my getRef code is not properly built
As while it's able to find the value I want it to change to, it's not finding the data path within the dynamic table and therefore not able to change the value
I did notice in the example given on GitLab setPropertyInEntity('self', getRefFromDynamicTable('Spells', 'Uses_left', 'Name', 'Fireball'), "min(first(fetchFromDynamicTable('Spells', 'Uses_left', 'Name', 'Fireball')) - 1, 0)")
when getRef is used, they don't put it in quotations. However, if I remove it from quotations, I'm actually getting the same error as before where it states it is not a computable phrase
I suppose a good question to ask just incase if this all sounds confusing as well is: if my filterColumn argument is a checkbox, what should I put for the filterValue argument? Should I put '1' or 1 or True or 'True'
in previous things I've done with fetchFromDynamicTable, I've done '1' and then done a filterOperator of '>='
Well, I put 'Checked' since that seems to be usable as well but unfortunately that still doesn't actually change the value of the cell I want
Should be true
hm alright ill try that
while that does roll fine and throws no errors in console, still doesn't change the value of the cell within the dynamic table
Hello, is it possible to utilize a formula to set all checkboxes to either a 'false' or 'true' state? In other words, I am interested in creating a button that will reset all currently checked checkboxes.
Hello there, does anyone play DSA with Custom System Builder?
Could you explain your goal and use case please?
is it possible to use setPropertyInEntity on multiple items in a container at once? or does that only work with dynamic tables?
Yes. I have sveral skills that when you succed a checkbox is marked for later leveling up (a la Call of Cthulhu). I use macros to check the checkboxes of the skills. I wander if it is posibble to make a label with a formula in the character sheet that uncheck all those checkboxes at a time once the leveling phase is over, instead of unchecking all one by one.
i'm not experienced with the new setPropertyInEntity method. maybe it could be done by this?
on the other hand would it be easier to write a short macro to set all the desired checkboxes by hand? i think i would write a macro which resets all the appropriate boxes of the selected character. you can even target all player characters and press the macro only once and you are done (of course if all level at the same time, etc...). for me personally i think it would not be worth creating a button in the character sheet.
I know how to do it in macros too, so I'll will do it by now. Thanks.
Quick question. Do conditional checks allow for compound checks? (so If X is true AND Y is true)?
Nope. If a group gets selected, all modifiers of the group get applied. You could do it indirectly via modifier formulas (if the check is on the same item) or on the actor sheet itself, where if 2 values are set, the third value will be applied
ah wait, you probably mean the ternary operator... Yeah, you can use the keywords and and or for that
I am prototyping a new system. It's a d100 roll-under model that features character improvement through skill/item use.
For example, the character can learn to use the Longsword, when they use it, they roll a d100 and compare to their current Skill with Longsword.
If they ROLL UNDER the skill, they "hit", if they roll JUST under the skill, not only do they hit, but the attribute that is associated with the skill/item (Might, for example) improves by 1%.
If they ROLL OVER the Skill, they miss/fail. But if that roll is JUST over the Skill then they learned something new and their Skill improves by 1.
I'm trying to automate the check and the Attribute or Skill change in code. So far, I've tried to do that in the Label roll message in an Item Container on the Character sheet. Where I just can't seem to get it right is coding the logic structure to compare the results. I've tried nested Ternary ?, I tried a switchCase, but I can't get anything to work. Am I doing this the right way in the right place, or is there a better place to put the code, or a better way to do this?
(sorry for the wall of text)
The Label Roll Message seems the right place for me, but I´d probably use the ternary operator instead of switchCase(), because this one only checks for equality, but you need range-checks aswell.
Trying to lay out the nested Ternary is diriving me nuts. Can you use arbitrary spacing?
Whitespaces are fine (in most cases). Newlines can cause issues
I took out the skill/attribute improve code, still can't get the Ternary to work. Getting a "False part of conditional expected" error.
${#roll:=[1d100]}$ ${#skillName:=item.name}$ ${#skill:=item.skill_score}$ ${#impScore:=round((skill*(100-skill)*.01)/2)}$ ${#attrImpBase:=skill-impScore}$ ${#skillImpCap:=skill+impScore}$ ${#attribute:=item.skill_attribute}$
<h3>${item.name}$ Test</h3>
<table>
<tbody>
<tr>
<td>Target score: ${skill}$</td>
</tr>
<tr>
<td>Result: ${roll < skill ? roll >= attrImpBase ? ' Attribute Increase!' : 'Success' : roll <= skillImpCap ? ' Skill Increase!' : 'Failure'}$</td>
</tr>
</tbody>
</table>
I'm missing something basic, I know it
Try to use brackets in the nested checks.
${roll < skill ? (roll >= attrImpBase ? 'Attribute Increase!' : 'Success') : roll <= skillImpCap ? 'Skill Increase!' : 'Failure'}$
I don´t think so. TDE is already a well-developed system, so you probably won´t find it here
Tried every logical combo of bracketing I could find, still getting same error
This example here works totally fine for me: ${setPropertyInEntity('self', getRefFromDynamicTable('Skills', 'Base', 'Skill', 'Fireball'), "first(fetchFromDynamicTable('Skills', 'Base', 'Skill', 'Fireball')) - 1")}$
Yep, would suggest that. Try to find the culprit in it
becuase that's and IF elseIF elseIF
easy to get crosseyed
hey, can I output HTML as part of a Ternary check?
(so only build the <TR> if an expression is true?
I think it gets sanitized
I was a coder 20 years ago. trying to remember some of the tricks from the first days of the web
I´m glad that nowadays it´s more convenient to build web-apps because we have powerful frameworks now 😅
I was curious if anyone here would be willing to host a short session to show how they use Custom System Builder to create their worlds? It would be great to actually see how others use FVTT in actual use.
No JCL and HEx dumps for me!
@formal goblet Can I run a setPropertyInEntity from within a Ternary? And can I run code and also return some text to the chat from within that Ternary?
Should be no problem if it´s within a Label Roll Message