#Custom System Builder
1 messages ยท Page 38 of 1
You have a typo in the function
${[2d6] + max(_AGI, _INT)}$
Show me the formula and the keys of the Dropdown
Is there a workaround to prevent dice-so-nice from rolling the dices for both outcomes from a ternary operation?
Got it, it is because the innermost process. In roll cases we can create the roll formula. For formulas and scripts the idea is to avoid using ternaries to handle functions if possible then. Otherwise the same thing would happen, right? I was facing a problem when a field had a +1 and -1 simultaneously
Just to make sure, I can expect that same behavior from switchCase()?
The execution order in formulas is:
- Inner Formulas
${}$or Scripts%{}% #(hide result)!(hide explanation)- User input dialogs
- Roll Formulas
- Everything else (evaluation of the Formula, including conditionals)
Almost. switchCase() is not short-circuiting, so it will execute all input arguments (different to the ternary-operator)
I see, thanks! I certainly wasn't considering this, especially the execution order, to create the fields.
It would be cleaner if everything could be executed conditionally, but there's a limit in our core-parsing, which doesn't allow that (and fixing that is costly). So we have to resolve Input Dialogs and Rolls before we can resolve the rest of the Formula
I have no idea what core-parsing is, but I see there is a limitation and that should be enough ๐
system-internal stuff with CSB and the mathjs-parser
You won't see this stuff as a regular user
I see! Thanks
thank you so much
i see now, it was on math.js all along
@formal goblet, @ I just want to express my great appreciation for you and what you've done with custom system builder. It's amazing to be able to build my system in Foundry without needing much programming knowledge.
Ohh? 4.x.x is launched?
is there anything i need to do before migrating from v11 to v12?
(or should i give up on it :P)
Replace fetchFromDynamicTable() and getRefFromDynamicTable() with lookup() and lookupRef(). That's it. And backup ofc
hmmmm that should be everything
im more concerned of the modules ill need to replace but thats a bridge ill cross eventually
I'm using the fetchFromActor+lookup combo to pull stats from another item container associated with the same actor, but running into an issue where it is finding every value that has historically been held by the item container on that actor instead of what is currently being held by the container.
${recalculate(fetchFromActor('attached',"lookup('HeldWeapons','WeaponRange','WeaponType','${AbilityType}$')","Not attached"))}$
Any idea why the historical values are being held and can still be referenced, even from an item container where no items meet the reqs to be in it currently? All items have been scrubbed from the actor using a catch-all container to confirm there's no hidden items, and I've replicated it with a new actor from the same template as well
(I think this may be the same issue ElPainis had here(#1037072885044477962 message)
Sure thing:
Core Settings Expanded has no update for V12, so you'd have to drop that. But there's a workaround for that in the Wiki with a simple World Script. Besides that, I haven't seen more incompatibilities
I don't see you using the Dropdown in any Formula
These hidden values should be dropped if you rename the Container, but I can't say for sure if it also affects Containers with a Component config with the current system version
Is that not what this is...?
Nope, you don't reference the Dropdown there
You probably want to use switchCase(psy_rank, 'psy_alpha', 8, 'psy_beta', 6, ...)
Ah thanks for confirming that! I think this would come up pretty often since I'm marrying swappable held equipment with the abilities that rely on their characteristics. Swapping names and then back to the original to "clean" the data here would need to be done with a script outside of CSB, right?
If we're talking about a Script, then cleaning the data of the Item Container would be enough, because that is autogenerated anyway.
Like this? I've gone from a blank entry to an Error now ๐
If not I'm very lost on what I'm missing
Is that a dynamic Table?
That's the hidden attributes
Custom System Builder | Parenthesis ) expected (char 65) SyntaxError: Parenthesis ) expected (char 65)
So I've missed a parenthesis somewhere?
You're missing commas
I've changed it to this:
${switchCase(psy_rank, 'psy_alpha', 8, 'psy_beta', 6, 'psy_gamma', 4, 'psy_delta', 2, 'psy_epsilon', 2, 'psy_none', 0)}$
And now it's forcibly changing the dropdown to None and there's nothing displaying in the psy_rating label, nor am I getting an error?
Change the key of the hidden attribute. That is a duplicate key
Oh my god that was it lol, I kept getting psy_rating and psy_rank mixed up
Okay, it's working now! Thank you
Trying a different approach to link the item containers using helper values on the actor instead, and so using:
${fetchFromActor('attached', "switchCase(AbilityType, Melee, MeleeRange, Ranged, RangedRange, Magic, MagicRange,0)")}$
Where AbilityType and the drop-down options of Melee, Ranged, and Magic are on the item's drop-down list, while MeleeRange, etc. are on the actor. I've tried a bunch of permutations with AbilityType within ${}$ and without, and with different quotations for the comparators but can only seem to ever get it to match everything (ie. Magic == Melee) or nothing. Any chance I'm missing something that would make this work?
Is it possible to specify the color of a die in a dice formula?
I have radio buttons. They can not be unchecked by default on the character sheet. Why?
Because that's how Radio Buttons work by convention
What I want is to have some kind of check box, and if the check box is checked, then it sould give back a value and I want to sum all the values of all checked check boxes... but check boxes has no value, so thats why I tryed to use radio buttons
How should I do this?
They have one, and that is either true or false. That's enough to make a decision in a formula based on that.
Something like ${(checkBox1 ? 3 : 0) + (checkBox2 ? 5 : 0) + ...}$
what is 3 : 0? and 5 : 0? 5 and 3 are the values and 0 is unchecked state?
Yup.
Don't use newlines within a formula, this will cause unexpected results.
Is there a way to prevent players from deleting rows from dynamic tables? Or to vanish the trash bin button?
There's a config option for that, yeah
I don't know where it is... I see the option to prevent creation and the confirmation when deleting...
Oh is it the user permission?
Ah wait, it was only possible to do so with predefined rows. You have to do it per row, but it should remove the button (only for players)
Yes I have a number of pre existing rows in the dynamic table
Yeah, and each row has a button in the template to block deletion for players (gm will still be able to)
Found it thanks!
Hi, probably another obvious thing I'm not seeing. So I have a field in an item template called armor_slot that can have the value "head", "torso" and "legs" and I'm trying to use it in the filter option of the item container to get just the head armor:
item.armor_slot == "head"
This is giving me a "Cannot convert "head" to a number Error" though. Can anyone tell me what I'm doing wrong here?
Use equalText()
You cannot compare strings with ==
oh, thank you. I'm going through the documentation as I build it but sometimes I just get stuck thinking in javascript and forget somethings don't work the same XD
I made a Number Field as a bonus modifier for physical armor. Sometimes this can be a negative number. When it is, every time my mouse hovers over it, it multiplies itself by 2 going from -1 to -2... -4...-8... And it's only for this one number field.
Disable relative modification
Ah, so I won't be able to just type "-2" when something happens to decrease it more? That's fine.
Thanks
Is there a way to ensure labels are rounded? even if I put a formula in the label once it gets modified by invisible modifiers it goes 'nuts' with decimals that should not be there
Modify a different Label and your main label would just round that one
Thanks... while you are around... I'm a 'write to actor' addict... has the option to not have it display a chat message and roll effect been implemented yet? I do not see it in updates but obviusly the V12 update cleared out the roadmap.
Yeah, you can disable Chat Messages
So this is odd, I'm switching a roll card from a simple userinput to a template so I can use dynamictable stuff, and I got it all switched over and implemented, but somehow it's erroring a part of the card I didnt touch?
This is the end of the code that grabs the success tier from the result that's erroring:
<!--Regenerate a paragon point on failure (as long as roll didn't use a paragon point)-->
${#result <= 6 & paragonuse == 2 & player_paragon < player_paragonmax ? setPropertyInEntity('self', 'player_paragon', "player_paragon + 1")notify('info', 'You Regenerate a Paraon Point!') : '0'}$
The only thing that's changed in there is that skill1/skill2 is no longer using a "Userinput equalstext of skill? then Grab mod number of said skill" (referencing individual keys from a table) to now being a lookup of a dynamic table (which is much cleaner, lol).
But that lookup is early in the code and is working just fine in the roll calculation, displays the name and mod properly, and assigns to the "result" variable just fine for use elsewhere...
${#can_regenerate:= result <= 6 and paragonuse == 2 and player_paragon < player_paragonmax}$
${#can_regenerate ? setPropertyInEntity('self', 'player_paragon', "player_paragon + 1") : '0'}$
${#can_regenerate ? notify('info', 'You Regenerate a Paraon Point!') : 0}$
Seems like a cleaner way to juggle that, for sure
Still popping up the Array console errors and not actually regen'ing the point, though... Hmmm
lookup returns an array, even if I'm only grabbing one value and assigning it to the skill variable... maybe I need to use lookupref to grab a value to assign to just grab the specific data?
I'm kinda familiar with scripting, but I've learned in a very informal way and never needed to work with APIs are or learn how to read them. Can someone recommend a good place to start? I'd like to be able to make my own rules for dice. ๐
wrap lookup() with first()
Awesome!
Is that kinda like running a data[0] value extraction from an array?
haha nice, thanks for the insight!
Thank you so much! ๐
@earnest imp I think you'll like that one: https://gitlab.com/custom-system-builder/custom-system-builder/-/merge_requests/73
@formal goblet I'd like some assistance working on my system again.
This time, I'm working on the bread and butter Core of my system. The Techniques.
Most Techniques follow a simple enough format.
See the 1st example. In cases like this, all I'd need is to make a button that can read from the item sheet what skill to roll and the Target Number such a roll should be.
Where things get more complicated is when a combat technique requires referring to a number on the enemy you're targeting.
Right now I've the following component keys.
How I'm currently thinking of implementing things is...
- Use Technique
- Reference "tech_skill" and assemble dice pool
- Check "use_tech"
-
- If a defense skill (Parry, Evade, Hardiness, Stealth, Resove, or Wits) is selected in "use_tech" then search for Target number in the target's sheet.
- Set "skill_diff" as the target number for the roll
Does that make sense?
Hello,
First of all, sorry for my English; it's not my native language. For my custom system, I'm trying to create spell templates (items) that could trigger macros (for spell animations). I'm not sure if this is feasible. We can launch a macro using the formula in the template, but I havenโt found a way to do it from the instance of the object itself. If I want to do this, am I required to create a template for each spell?
Hello!
I am trying to make a bit of a user -friendlier interface.
Atm my item (let's say a sword) has an entry where you say what you're using to Attack (let's say "Strenght_Skill_Total") wihich then uses fetch from actor to get its value.
I would like to show a user friendly label "Strenght" and pair it to the actual attribute name so that my Players can work with the sheets without having to know code-like syntax.
My intuition tells me I need some sort of table to pair labels and attribute names but I was looking for suggestions
You can call a macro from an item (which is what a spell would be)
Maybe I don't understand something? I asked a few days ago in #macro-polo how to call macros from rolls
Hey!
Like people above me I'm going to start with a question. My custom system relies on choosing and stacking stats. I want to use a dropdown menu for every stat I stack. But I can't figure out how to take a key that has a number associated with it, and then once I select it, to get it's value displayed and then added.
For instance I have a variable 'Resolve_Total' which equals 4. I want to be able to select the variable from a drop down menu, and the assiciated number to be displayed in a cell right next to the menu, and also be able to take and sum this attribute along with other attributes I decide to stack along.
I'm currently using the Custom option of the dropdown menu. My instinct says that all of this has to be managed through a dynamic table. But I'm also trying to manage these attributes as individual units and not something I have to constantly use lookup() for. Just use ${Resolve_Total}$ to get the number. I managed to make everything else work, and only this dropdown menu holds me back from jumping from 50% feature complete to like 75%, and I can't really continue on without it, because all of the modifier calculations depend on this.
Hey guys, quick question here: Is there a way to always display the dice rolled? Like, if I roll 3d6 it always shows the result under the sum like "3, 4, 6"?
Use ref(dropdownKey)
Not without your own Script with your own format of the Roll results
You know, I've tried doing this through the ref() function, but it didn't work for me before, for some reason. Seems to be working right now, thanks!
It's probably me not understanding something; I'm not very familiar with the custom system or even FoundryโI just started using this software. On the left is my template, on the right is my object created from the template, and on the far left is my template label with the macro execution. The problem I'm having is that all my items created from my template will trigger the same macro, whereas I'd like to be able to change the macro triggered for each distinct item.
The getName()-part specifies, which Macro will be executed. If you feed that with a value of your input field, you'll be able to dynamically call the right Macro.
Okay, I thought of this solution; I was wondering if there was another way. Thanks for the information. When you say 'text field,' are you referring to the one at the top designating the item? Do you know what its key is to retrieve it? Otherwise, I can create another text field with a custom key. In any case, thank you for your time.
Hello there. Supposing i want to do a dynamic table like the AD&D exceptional strength table, how would i go around not having to put every single percentile strength value on the table and just using the lookup value easily? As an example, supposing i want to do a single row at strength 18 and 1 to 50 percentile strength, what should i put in the field? I'm very much a noob here.
Another question. I probably did it wrong by doing it a bunch of text fields, but how can i autofill these fields just by changing the key attribute?
i did create a table with each possible value (except percentile strength, as noted above), but how do i reference both the dynamic table AND the strength value?
@brittle moth @formal goblet just saw that there are two devs on this, sorry for the inconvenience of ping you both. I'd appreciate some help with this. As much as i hate GPT, i'm trying to create a formula for the lable that look up the values, but it's resulting in an error, currently.
${lookup('strtable', 'thitadj', 'str', 18, 'percentstr', percentstr) || lookup('strtable', 'thitadj', 'str', str)}$
Is there an opposite for equalText? I tried notEqualText and it didn't return anything. I'm trying to use a conditional formula where the variable is not empty
Only Labels and Meters can change their values depending on other Components
not(equalText())
The lookup()-function can only take a maximum of 5 arguments:
- The key of the table
- The column key of the table, from which you want the values
- (optional) The column key of the table you want to filter by
- The value, which should be considered for the filter
- The operator for the filter. Default-operator is
===, so it filters by equality
Having multiple filters in the same lookup is not possible, so you'd have to get the right value with a Script: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Dynamic-Tables#2-scripts-for-fetching-values-in-a-dynamic-table
Oh, i see! Thank you so much. How do i add a script?
thank you so much for this. Sorry for bothering you!
Is it possible to use a label in a lookup filter?
With the script, i mean
Sure
Alright, thanks!
Question about item modifiers: is it possible to set a (new) formula into a label?
In my testworld i have 3 labels: numberA, numberB, numberC, and a label with formula ${numberA+numberB}$
Is it possible to change that formula with an item modifier to make it 'numberB+numberC'
Nope
But you could override the value of the Label
I'm looking for a way to change formula's when talents/feats change the way skills are used (dexterity instead of strength for melee attacks for instance)
Not sure if i'm doing this correctly, i'm looking in the console looking for my hitadj label i created, but i can't find it.
Going through the beginner macro tutorial, that's where i'm at, but i'm a bit lost
Found it:
${fetchFromActor('attached',"numberB")+fetchFromActor('attached',"numberC")}$ fixed it.
Is the green success die and the red failure de a customazible thing in CSB? Like, can I set it that if a die ever gets result X or Y that ir red or green?
Also, If a label is a formula, in my case, ${(str)}$, would the value be fetchable by the script?
Yeah, but only with a save guard, because values can be undefined depending on the order of computation. To prevent issues with that, you have to check for undefined values and use throwUncomputableError(message: string, source: string = ''): void from TemplateSystem (aka entity.throwUncomputableError()) if you encounter one.
By doing that, your Script won't be removed by the computation queue and will resolve once the dependent value is not undefined anymore
I think i understand! This is my current script (not mine tbh, i hate using it but since i have little knowledge of coding i must depend on gpt most of the time).
If it would not bother you too much, could you help me with building the actual script or modifying it? Here's what i have right now:
const actor = game.actors.getName("pc");
// Obtain the value of str and percentstr
const strValue = actor.system.props.str; // Acesso ao valor da key str
const percentStrValue = actor.system.props.percentstr; // Acesso ao valor da key percentstr
// search for the value on thitadjust on strtable based on str
const hitadjBaseValue = Object.values(actor.system.props.strtable)
.find(row => !row.deleted && row.str === strValue)?.thitadj;
//If str is 18, adjust the value of hitadjBaseValue according to percentstr
let finalHitAdjValue;
if (strValue == 18) {
// Ajusta o valor com base no valor de percentstr
if (percentStrValue === 0) {
finalHitAdjValue = hitadjBaseValue; // Use o valor base se percentstr for 0
} else if (percentStrValue <= 50) {
finalHitAdjValue = hitadjBaseValue * 1; // 1x
} else if (percentStrValue <= 75) {
finalHitAdjValue = hitadjBaseValue * 1.5; // 1.5x
} else if (percentStrValue <= 90) {
finalHitAdjValue = hitadjBaseValue * 2; // 2x
} else if (percentStrValue <= 99) {
finalHitAdjValue = hitadjBaseValue * 2.5; // 2.5x
} else {
finalHitAdjValue = hitadjBaseValue * 3; // 3x
}
} else {
finalHitAdjValue = hitadjBaseValue; // Para valores de str de 1 a 17, use o valor base
}
// Update the label
await actor.update({'system.props.hitadj': finalHitAdjValue || 0}); // Define como 0 se nรฃo encontrar```
oops. Let me translate the portuguese.
Also, this is going to be a very dumb question, but i'm kind at a loss here, and tbh GPT is probably doing nothing useful atm, so i'll ask directly:
Here is my issue: I'm trying to populate this label called hitadj with a value from my table, strtable, in the thitadj column. So, what i want to do is, get the values from str (strength) and percentstr (percentile strength), which both vary from 1 to 25 and 0 to 100 respectivelly, and fetch the according value in strtable.
I was not sure if it was necessary, but i created tstr and tpercentstr just so i could have access to the according values at the table. That said, i have no freaking clue what to do.
oh wait, this is cursed. I'm dumb.
Ok, i made it more readable.
related pics
Also, sorry if i'm very slow at this, know that i appreciate very much you helping out
This should be used in your Label:
%{
const props = entity.system.props;
return Object.values(props.strtable)
.filter(row => !row.deleted && row.str == props.str)
.find(row => isValueInRange(row.tpercentstr, props.percentstr))?.thitadj;
function isValueInRange(range, value) {
const ranges = range.split('-');
return ranges.size === 1 ? true : value >= ranges[0] && value <= ranges[1];
}
}%
Okay let me try. Do i just throw it at the lable text?
Honestly it actually kind of worked, it has not come back as an "error", just undefined. Lemme try tinkering with the values.
Ok, ok, the formula itself is working, just not as intended! Thank you so much for this, once this is fixed, i'll be able to do the rest on my own. So, what is happening right now is, the value on str, being ${strs}$, doesn't seem to affect hitadj at all. percentstr does, though, although weirdly. If the value is 0, the result becomes undefined. If the value is 1 through 5, it's +1, weirdly, if the value is between 6 and 9, hitadj becomes +2, then comes back to +1 from 10 to 50. After that, hitadj seems to work normally, except on 100, then it becomes +1 again.
Oh yeah, not sure if it's relevant, but i'm on CSB 3.0.0, since i did not update to v12 yet
Anyhow, thank you so much for helping me out. I'll be sure to support you guys once i have the chance.
I actually forgot what the differences are between the current and the 3.0.0 version ๐
And 3.0.0 isn't the most recent V11 version, there should be 3.2.4 or so
it's okay, that's on me for not updating ๐
i think i gotta update manually, i'll try doing it
Updates are never automatic
Lemme get the link for the 3.2.4 version
It even goes up to 3.2.5
True, got it
Ok, i updated to 3.2.5, i can't update to v12 yet caus of my other games, but hopefully this will work
huh, weird, now that i updated, the formula you gave me is not working at all
Hey guys, is there any way I can configure the green and red dice effect for maximum and minimum value into the roll formula to color the result? Like critical hits and fumbles.
Only if you use the dice modifiers cf (count failure) and cs (count success): https://foundryvtt.com/article/dice-modifiers/
The official website and community for Foundry Virtual Tabletop.
oh yeah, i was looking at the code and noticed that the row there is being reffered to as str, i'm probably wrong but i also forgot to mention i think that the str value on the strtable is tstr, not sure if it changes anything but hey you never know
oh wait, it's not tstr, it's score
me big dum dum
yep, should be that
okay, lemme try changing it
const props = entity.system.props;
return Object.values(props.strtable)
.filter(row => !row.deleted && row.score == props.str)
.find(row => isValueInRange(row.tpercentstr, props.percentstr))?.thitadj;
function isValueInRange(range, value) {
const ranges = range.split('-');
return ranges.size === 1 ? true : value >= ranges[0] && value <= ranges[1];
}
}%```
Ok, it "works" again! That was it
but it came back to the original state with a few caveats (or whatever the hell it's spelled)
. Now, the STR stat does inffluence it, but only if it's 18. By that i mean, if the str label is anything other than 18, the result comes out blank. Same thing if it's 18 and percentstr is 0.
It should be ranges.length instead of ranges.size
Ok! Lemme try.
Alright, so, now, the str part is working correctly, however, the percentstr isn't working anymore.
Holy shit we made it work, thank you so much!!! I think i can do the rest on my own, chatgpt ended up being useful for once, here's the formula that worked for me:
const props = entity.system.props;
return Object.values(props.strtable)
.filter(row => !row.deleted && row.score == props.str)
.find(row => isValueInRange(row.tpercentstr, props.percentstr))?.thitadj;
function isValueInRange(range, value) {
const ranges = range.split('-');
if (ranges.length === 1) {
return value == ranges[0];
} else {
return value >= Number(ranges[0]) && value <= Number(ranges[1]);
}
}
}%```
thank you so much man. It's not much, but i would love to donate to you guys. Do yall have a kofi or something? If so, please link it to me
I don't have one, but Linked has: https://ko-fi.com/linkedfluuuush
Ok ok make sure he at least buys you a coffee
Maybe when I plan a trip to France ๐
Thank you so much! Handling the rest should be easier. Threw 2 euro at linked's face in your name lol
one last thing, @formal goblet, is there any way to hide the formula from the template sheet? I only have so much screen space ๐
hide or decrease the size, at least
Nope ๐
oh well, making it collapsable works well enough lol
Anyone know a method of counting doubles? In my system if you roll doubles on wound dice you collapse. Haven't been able to figure it out yet.
my guess is that would be a foundry native feature so #macro-polo / #core-how-to
Hey, me again. Is it possible for a lookup() from a dynamic table to sum up all the values in a column?
I'm trying to sum up all of the numbers in the Mod column.
Surround it with sum()
Perfect! Thanks a bunch!
quick question, if i have a text field that says +4 and i use it in a formula, can i do calculations with it? Like, if i put said text field + Y text or number field, and they're all numbers, will the calculations work or they gotta be number fields?
@formal goblet sorry to bother you so soon ๐ญ
oh nevermind i just checked it WORKS!!!!
Oh, i might need your help after all @formal goblet. Not with this, though. So, strength is the only stat that uses percentstr and the other ones only use the 1 to 25 scores. I'm now trying to fill the values below, but only initiative works.
Here's the formula i'm using:
const props = entity.system.props;
return Object.values(props.dextable)
.filter(row => !row.deleted && row.dexscore == props.dex)
.find(row => row.tinitmod)?.tinitmod;
}%```
Then i tried changing `.find(row => row.tinitmod)?.tinitmod;` to `.find(row => row.tmissileadj)?.tmissileadj;` but it did not work. the first one works perfectly, though, so i'm not sure what to do. Here's the formula that does not work:
```%{
const props = entity.system.props;
return Object.values(props.dextable)
.filter(row => !row.deleted && row.dexscore == props.dex)
.find(row => row.tmissileadj)?.tmissileadj;
}%```
Awesome! If you get one too, I'd love to show some support, Martin.
CSB has helped me play test my game so much, and the support here is invaluable!
I second this. Martin should get one for sure
Ok, i "fixed" it, more like, i forgot that sometimes i gotta recreate the test actor so the table values get updated.
@formal goblet @brittle moth i have a suggestion: It's a really niche and minor thing, but would be nice to have a way to collapse a panel without allowing that panel to be colapsable in the sheet itself.
Hello, any update on this feature? Is this available in the latest version?
Not yet, sorry
I'm working on it ๐
I don't really understand... You want it to be collapsible in the template only ?
exactly, its a very niche thing, its just that, uhm, look:
i ran out of screen space hehe
i'm basically done, it's just that it's cumbersome to look through
done with that part, i mean
what i did was set the panels to collapsable during editing only so i could manage it better, then once i was done, i just set it to normal
this is how it's looking
as i said, it's a very niche thing honestly, yall are doing god's work already
Iโll stop trying to make complicated item storage rules and let you cook ๐
what does the error "Key and Label-options are not of same length" mean I should fix?
That means that your Formulas in your Dropdown do not return results (Array) of the same length, so it cannot map a Label to each Key
You can have those fields referencing a Hidden panel/tab only GM can see
Thanks, I believe it is cause the dropdown gets the names from a dynamic table that is currently empty, right?
oh, smart! Thanks for the tip brazilian friend!
How can I prevent the error from appearing?
That shouldn't be the issue. No entries means a length of 0. If both return 0 results, it should be fine
Great, thanks!
Can we have boolean evaluation with formulas? Such as && || or equivalent? I remember I read this already but I can't find it anymore
Edit: here it was https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#314-functions
Any way to make a field conditionally appear in a list of variables in a dialogue box? I have an attack roll that pops up a dialogue box, but I want it to only ask if I want to consume ammo if a checkbox in the item indicates it uses ammo to begin with.
Nope
Although... maybe with nested Formulas
?
${${a < b ? c : d}$ + e}$
a - d are in a nested formula, which will be ecexuted before everything else
I'll try that.
Nope, that didn't work. Still showed the "Consume ammo" checkbox on a weapon that didn't use ammo.
I'll just have to forgo the option and have it automatically consume ammo if it uses and has any.
Hello again,
So, I'm trying to figure out how to implement Items and I'm unclear on how Item Modifiers work. In this instance, I decided to have a Trauma item, which should confer a penalty to stats. I want to be able to select a trait, then enter the penalty value and have it automatically implemented when I drag the item into an Item Holder in the character sheet.
You can have a hidden column retrieving that information directly from the item
I don't really know how to do that using the simple dialog box format.
In the item displayer/container create set up a column that holds the value item.uses_ammo and set its visibility to GM only or put 0 1 in the visibility formula. In the item template create a field named uses_ammo. Now that information is available all the time, you don't need a dialog box, unless you really want to use.
Oh. I don't know if that really serves the purpose I want, though. The purpose of the dialog box option is, if the weapon uses ammo, to allow the player to decide whether or not they want that attack to consume ammo.
I understand, I'm configuring the same thing. Would you agree with me there is not an alternative unless, in my case, the players decide to strike with a bow?
I suppose. I was just wondering because the dnd5e system has something like that set up, where if an item or feature is set up to use a resource, it shows a dialog box asking whether or not you want to consume that resource.
In any case, if you have that information available like I said, the dialog box have access to it as well.
Right. I just noticed that, whatever I tried, the checkbox always showed up in the dialog box, no matter the conditions I set up for making it appear (or not appear).
no way??? active effects feature is getting expansion on CSB??
also oh my god??????????
this is what i really need!
๐คฏ
Hello!
I have a goal: to make a button, when pressed, its text would change cyclically: " ", "/", "X", " ", "/", "X"...
How could I do this, preferably with an example code?
${setPropertyInEntity('self', 'key', "switchCase(key, ' ', '/', '/', 'X', ' ')")}$
An explanation of Item Modifiers will suffice. I just don't get how they work
I too am trying to understand the better way to go about Item Modifiers. Considering a system had multiple modifiers, none exclusive to a single item, is there a way to setup a template where if some conditions were met the modifier would trigger immediately or the way to do it is by adding the items with said effect already activated? Let's say you have a frozen condition, and a ring that if it remains equipped for 3+ turns it had a chance to apply the frozen condition
Hello! I could not find which CSS class applies for the styling of the component's tooltip. There is a way around using prefix label that is already documented but for checkbox or number field there is no such option. Thanks in advance!
Is there a clean way to have disparate Item Displayers that function like "slots" or "bags"
I'm running into needing to make each item their own template style so it doesnt show up in every item container. But I'd like a way to make say: a sword is displayed in the left hand, a shield in the right, but that could be swapped, or both can be moved to a bag, etc.
how would i make this into a roll?
The only job an Item Displayer has, is to display (the right) items. If different Items should be shown in different Displayers, you have to configure the Filters in them
Item Modifiers can modify the value of a Label/Meter in an attached Actor. For that, you have 4 mandatory configuration fields for each modifier:
- Priority: A numeric value representing a sort-order (from lowest to highest value), if multiple modifiers apply.
- Key: Specifies, which component should be modified on the Actor. If it contains a Formula, it will be computed with the properties of the Actor
- Operator: The operation, which should be performed
- Value: The value to modify by. If it contains a Formula, it will be computed with the properties of the Item
Yeah, that's what I was finding.
Was hoping there was a trick to get it to work more like a "Container" but even with the filters it seems like I'll have to have the same item with different templates so the filter can find them in the right container and only the right container.
what did I do wrong?
You should never use setProp in a Label text. It should only be part of a Label Roll Message
Hello. I have a Dropdown component from which the user can choose their character's profession. The Dropdown component's key is simply 'profession'.
I'd like to be able to assign a random profession too, using something like:
${setPropertyInEntity('self', 'profession', "pro_knight")}$, where 'pro_knight' is the key to the Label 'Knight', but that doesn't work.. Can somebody advise me of the correct the syntax, please?
The syntax is correct. You have to make sure, that the value you want to set is also present in one of the options, otherwise it defaults to the first or empty option
These are the options (attached), but the Label Roll Message doesn't produce a chat message or change the profession to 'Barbarian', so I am missing something...
Surround pro_barbarian with additional single-quotes
Thank you! That makes a lot of sense, which is why is probably eluded me, who lacks any sense at all ๐
If I understand it correctly, I need to fill the spaces of the Item Modifiers in the Configure Modifiers window with the modifier of the character sheet I want to modify (in my case it's the Resolve_Trauma_Val, and then drag it into an item holder, and it should work.
Like in the picture?
This is currently how I'm working on it, and when I add the item to the Test Character, it doesn't seem to affect the variable.
Remove Group, that one makes the modifier conditional and will only be applied, if it gets selected in a Conditional Modifier List
Ah okay... Like so? Because currently, it still doesn't work.
I tried this before, but it doesn't work
You're currently modifying the component with the key key
Is your target key a Label or a Meter?
Hmm... I just decided to use a different key, it's not attached to anything. Like a hidden attribute, I suppose.
Hidden Attribute would also work
Hey, now I set the hidden attribute, it does work.
But... if I use a Label instead, is there anything I should do? Like, write a 0 in the Label text or something?
Depends on the operation. If it is not =, then yeah
Thanks a lot, if I manage to figure it out completely I'd be pretty much feature complete for my system.
Hey, i'm trying to create races as a way to learn how to use items. Anyone has a good tutorial on that?
@formal goblet
The example module has one
Thanks!
is it possible to put an item inside another item? I guess not but doesn't hurt to ask, like a feature inside a race or something like that
Or at least "link" it to another item, so that X item is added to a sheet, it gets attached to the right spot automatically
Ahh, that's an ooold conversation about Item Containers,
No no, not at all!
Oh, so it's a feature in the works! Interesting, that's pretty baller to be honest. Can't wait for that
It's one that's been asked for and developed in varying stages for years now!
Hopefully with all the new big pushes it's something we'll see (again) soon!
It's probably not possible for now, but is it possible to, when an item is thrown into the sheet, it's sent to that item type's correct place automatically and not let other items of that type be added? (I did found the unique feature on the thingy doe)
I asked a similar question earlier today. Your best bet is to use the filter in the item container,
That's neat. It's not too bad having to add each feature manually, plus that means i'll already have the content ready for when that update eventually comes
Ok, i'll try learning to use it! Thank you so much for those replies
Basically, you need to give items different templates, then you can tell each Item Displayer to only show certain types
Not necessarily. You can define a filter formula addittionally, which filters by certain props
I see. So what it would do is not let items of the specific filter be added or am i understanding that wrong?
not of the specific filter*
Right, your filter is basically saying "only have items with THIS THING in this container"
That is exactly what i wanted. Thank you so much.,
The filter would only influence, in which displayer the Item will be displayed. It does NOT influence, how Items are added to sheets
Hmm, so it would be added, but it would not show?
Yeah
That's also technically true. Adding items to sheets basically puts them all in one "item bag"
But the filters let you sort and organize them visually into separate places.
And there's tons of stuff you can do with the props and code to play with that too
The Actor directly holds all Items. There's no additional nested structure
Yet
๐
Makes sense tbh!
We want our nested items inside items (inside items) Martin!! ๐
that would be sick
Alright, thanks for the tips fellas, i'll get to work tomorrow, now, off to bed ๐
Is there a good way to make a label default to a value if the formula (in this case a lookup) is blank? Rather than a "ERROR"?
for ref: this is the Label text I've got.
${ max(lookup('player_leveltable', 'player_leveltable_level')) }$
If the player level table is empty, would love it to be "0"
I feel like there's a simple : '0' I just need to put in there somewhere... Maybe a ? somewhere too... ๐ค
Wait... 0 + max(lookup? lol duh
you're using the max function which picks the biggest item in a list.
can you just add , 0?
so
max(lookup('player_leveltable', 'player_leveltable_level'), 0)
Hmm, that breaks the formula, but I think you're on the right answer
just need to get the right syntax
baring that you can use an if statement
${(max(lookup('player_leveltable', 'player_leveltable_level')))<0 ? doThis : elseDoThis }$
Yeah, that's the route I was angling toward initially, but I like the cleanliness of using "max" properly like you mentioned. I'll see if I can figure that out,
Thanks for the perspective!
wait did you set a fallback value within the table?
Nah, I'm trying to get it to be '0' when the Dynamic Table is empty
Yeah exactly my face! lol
Sure, yeah!
So the final output is the "Player Level"
but in this case, the level table is a dynamic table players add to when they level up cause they make some choices as to what to advance.
The check boxes sum() to their HP and Paragon Points, but the Player Level is a Label that uses that max() formula just to display their level with this:
${max(lookup('player_leveltable', 'player_leveltable_level'))}$
Level number is a
${sameRowIndex()+1}$
just to count up
Considering a system that has multiple modifiers, none exclusive to a single item, is there a way to setup a template where if some conditions were met the modifier would trigger immediately or the way to do it is by adding the items with said effect already activated? Let's say you have a frozen condition, and a ring that if it remains equipped for 3+ turns it had a chance to apply the frozen condition
so effectively, you are counting the number of checks that occur in a column?
Sadly, the max(0, (lookup()) doesn't work for the Level. Is it perhaps because player_leveltable_level returns an array?
I've tried nesting max(0, (max(lookup())) with that speculation but that doesnt seem to do it either.
I'm doing that elsewhere with: ${ 10 + sum(lookup('player_leveltable', 'player_leveltable_hp'))}$
Which works just fine! Starts at 10 and will go up with each checkbox
But level won't start at 0, its ERROR or 1,2,3 etc.
even with a 0+(max(lookup()) doesn't quite flick the switch
Create a hidden statistic that is a % of the effect occurring that all items can modify?
for example I have a label called hpBonus that all items can modify that is then summed directly into maxHP along side baseHP that comes from the player's attributes.
in your case you could have a label for each status effect occuring in this way (i'd use a dynamic table personally, and check for the row with a matching name).
That way you have the
'Freezing' row, with a label of 0 (suffix: %) and a ring that modifies that 0 to say 10.
๐ค
and what is the max there for exactly?
Because player_leveltable_level is a samerow() function down in the table, it just counts up each level added. The max() just grabs the highest level in the list to display in the label
oh so you're just trying to display the player's last gained level from the table?
I guess I could just change the label to a sum of the row count instead and bypass the math? Though, idk if that will fix my 0/error
Bingo!
That's the sheet, the label is in the top right, just grabbing the highest number from the table.
But I wonder if I can just sum the table row count ๐ค
Yes that would work, but it isn't treated as a condition right? The issue I'm trying to understand is what would be the best way to trigger those conditions. Having an item added to the character every time or is there any automation that could be done so it triggers automatically when certain conditions are met
alright and just to be sure, your level shows up fine with contents you're only having issues with the empty table?
Correct!
We go:
ERROR
1
2
etc
right ok no problem;
is there ever a case when you'd have a level 0 character?
Yes, actually. This sytem starts at lvl0, haha
We just started a new game tonight, which is when I discovered this problem! lol
and you cant have a row added to the dynamic table by default?
I... can. And I can start that row at 0
๐
That is a solution
right just removing the +1 from your index number would solve that
It's just, players dont get to choose an upgrade or skill at 0, I wouldnt want them thinking they get a checkbox at 0
Yeah, and adding a default
you could use CSS styling to select the first row and gray it out so that players can see that fairly intuitvely.
Fair
but if you're against that, you're stuck doing an if statement within the display label that cheks for 'error' and outputs 0
yeah, not as clean as getting max() to work for it, but sometimes that's just what you gotta do! Not like anyone is seeing the code anyway, haha.
Thanks for your input, and your troubleshooting. Sometimes it's good to just get a second look, even if only to confirm the answer youalready know! ๐คฃ
i'm saying do both man
${ (max(lookup('player_leveltable', 'player_leveltable_level')))=='Error' ? 0 : (max(lookup('player_leveltable', 'player_leveltable_level'))) }$
if my output is error output 0 instead, if not output normally
I think the first max() won't pull as "ERROR", but if I recursive the label itself instead, that works
${ player_level ==Error ? 0 : (max(lookup('player_leveltable', 'player_leveltable_level'))) }$
depends on what the triggering condition would be i suppose -
on turn start? on round?
ahh wait, I fucked up some of that syntax
No idea... I know you can trigger conditions by adding items and choosing from a list, but I don't know if it is possible to trigger it, or set it active, from formulas or scripts
I don't actually know haha
but if that's the error, create a first label with a visability condition of 0 so it's always hidden to players, then create a second one beside it with that if statement referecing the hidden one's key instead to check if it's an error
so have the first one be your max(lookup(
Then the secondone simply be
ref(hiddenValue == 'Error' ? 0 : refhiddenValue(
it may sound goofy as shit but i have an entire pannel setup like this with stuff i dont want to bother players with
Yeah, the man behind the curtain!
i was more so refering to if it's say, per-round of combat that's natively within foundry's api and a world macro could get that information and then call CSB function to fetch the % occurance in the table, roll a d100 and if that number is less than % then trigger the conditon
how to do that, I have nooo idea macros are way above my head
Maybe having a way to add and remove items to the actor depending on certain conditions?
I wish there was a way to tackle this on the fly idk. You could have an infinite number of poisoned or frozen statuses
not a problem i've gotten around to handling yet
i'm sitll fine-tuning what content i even want on my charactersheet
I made a label formatted as a button with the following label roll message:
${setPropertyInEntity('self', lookup('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental'), lookup('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental')+3)}$
why isn't it working? it should add three to the mental bonus cell
no error is happening and if output to chat the correct number shows up
Try out ${sum(lookup('player_leveltable', 'player_leveltable_level')) > 0 ? max(lookup('player_leveltable', 'player_leveltable_hp')) : 0}$
Btw, you can shorten the key names of your column, they don't have to be unique across the whole sheet.
You'd need an Active Effect and you'd need to listen to global events, so you'll probably need a World Script to achieve that.
So, thanks again for helping me with the Item Modifiers yesterday. It's great for some uses. I managed to get how to use the item. prefix for extracting data from the attached item. I'd like to be able to insert the item into an item holder and manually check if I want their effects implemented.
I used <input type="checkbox"/> to create the checkbox in the Item Holder table, but it doesn't maintain it's setting, and doesn't return true or false.
Any Idea how I can implement that?
Btw, the Equip Test here returns false by default, not related to the checkbox.
ooooh! perfect! thanks a lot!
Our Wiki has some nice tricks ๐ฑ
I just operate from the manual in the GitHub, but I'll make sure to check the Wiki out.
GitLAB. That's an important difference ๐
hehe, sorry. Don't want to offend GitLab gods or something
that's heresy!
Speaking of which, that Macro for updating Values wouldn't work for the condition automation I mentioned? Feasible with any previous set up from my end?
Not directly. You have to work with Hooks (like onTurnEnd), iterate through the (current) scene to fetch all Tokens (and their synthetic Actors) and then check for applied Active Effects, that should do something, when their conditions are met (or a different approach)
There are probably multiple ways to acomplish your task, but all of them involve scripting with the Foundry-API
I see... I should start reading that then.๐ Thanks
Ask in macro-polo. They might give you a better direction on where you need to go.
So, a small snag I'm having, I'm using an item filter formula item.Item_Type==<number> to choose between 3 item containers as shown in the picture, this is set by a dropdown menu inside the item entity. What I wanted to do, is to do is to be able to move an item from Weapon, Item, or Gear to the Bag Item Container.
So, what I tried to do is to use another property in the entity like so: ${setPropertyInEntity('item', 'Item_In_Bag', "item.Item_In_Bag == 1 ? 0 : 1")}$
I thought that using 1 or 0 would make it easier to use two formulas in the filter. But... although the item appears in the Bag Container, I didn't find a way to use a second logical test in the filter formula to make it disappear from the other containers.
Another thing I need is when I move an item from their container to the bag, I need the item to be unnequiped automatically. Again, the issue is that I can't figure out how to make the pack formula, that looks like so ${setPropertyInEntity('item', 'Item_In_Bag', "item.Item_In_Bag == 1 ? 0 : 1")}$ to do two things at one.
Ok ok, i think i'm figuring items out. So, i created a test race just to learn the item modifiers, i was looking at the example race but i got a bit confused. Supposing i want my race to add +1 to strength, but i did not create a dynamic table for the stats, only labels , what should i throw in "key"? The key to the strength stat is str.
I got the example from the sheet, here:
${fetchFromActor('attached', "getRefFromDynamicTable('Attributes', 'Min', 'Attribute', 'Strength')")}$
But it seems like it uses a formula to get from the dynamic table, so i'm uncertain how to change it to a specific label.
str
Yeah, it's that simple
just str? no ${ }$ or stuff? Oh
Interesting.... ok lemme try lol
so something like this?
or this?
ok ok, it's the second one
IT WORKS!!!
thank martin!! create a damn place so i can throw money at you
Question. when i pull item between character sheet they get copied. Is there a shortcut to move em not copy em?
Nope, but the module Item Piles has that implemented (I think?)
ok thanks
Reposting this one, still can't solve it ๐ฅฒ
Your issue is probably the 2nd argument of setPropertyInEntity(). That one expects a path (like 'strength' or 'inventory.3.weight'), just a value from the lookup() won't do in most cases. Use lookupRef() to retrieve a path.
I think I may have a misunderstanding of how you're using path - isn't that like a directory? But I'll try it real quick
Is it possible to put a formula on a text field inside an item and use it? In my case, i want my save against wands (savewand) to be lowered by 1 for every 3.5 con of the character, let's say a dwarf ability. I used this formula that i normally use for other cases, but it doesn't work:
min(1,(floor(con/3.5))
You can think of it as a directory if it helps you, there aren't many differences actually.
The working directory for all Formulas is entity.system.props with entity being the current entity-instance (an Actor or Item). In there, all user-defined keys are stored and can be accessed by every Formula. Container-Components like DynamicTables create their own Directory with entries. That's why you cannot access their data directly with a single key. You have to go deeper in this case (like having more Folders in a Folder)
Input Fields will not change their content automatically. That's a hard-restriction.
hmm, so i may be doing something wrong, i think i know what it is
But if it only contains a formula, you can use recalculate() on a Label
no, no i dont :thonk:
Where should i put recalculate() exactly?
This is what i'm looking at:
Yeah i'm still a bit lost, i guess i could just try to do separate items to change the specific fields, would probably be better
Ah, you're using Item modifiers...
In the modifier value: ${fetchFromActor('attached', "${wand}$")}$
Ooh! Ok ok, you mean inside the item modifier in "value" right?
Nope, didn't want to touch sheet logic, since that's different in every system
Ah, fair point
So, I can change value of text field (l3), but I can't change value of label (l2). Is it possible to change the label text at all?
The Label text can only change itself via Formulas (together with Item Modifiers). Users cannot directly change the content of a Label like an Input Field
setPropertyInEntity() has exactly the same limits a normal user would have
Ive updated only the first lookup to be lookupRef, only the second one, and both - none of these work
Then split the formula and verify, that each part returns a result. Divide and conquer
And the console might also help
I actually solved it using some math. Silly me.
running just the second:
lookupRef('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental')+3)
with or without the ref returns a cannot convert to number error
i can't just put it in single quotes can I?
lookupRef() returns a path, which is a string. Performing a numeric operation on that like +3 is kinda... trying to fit a square into a circle
right, i tried just lookup with that one as well
lookup() can return anything in the array (including numbers), so that can work
the current code is:
${setPropertyInEntity('self', lookupRef('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental'), lookup('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental')+3)}$ and returns nothing.
Console now shows some props were not computed...
I can try the remove \n again real quick but i dont think that's it.
Good to mention that lookup returns an array that can cause problems with some formulas (Me the last 3 days troubleshooting trying to learn how to work around this, lol)
but you can rip the integer out of lookup() with something like first(lookup(), which grabs the first entity in the array as a value (is "value" the right term? entity?)
yeah haha i remember talking about that with you yesterday
but i'm referincing a single cell with this one, and a similar computation within items works fine (using fetchFromActor though)
Even if there's only one output from the lookup, it'll be [1] instead of 1, which can cause some problems. Idk if its causing your problem, but I ran into a bunch of issues with props not defining as numbers or array.errors trying to do math on just lookup() outputs
He's right, it will always be an Array. It's just that mathjs tries to be smart with some operations. But not all will work ofc
And then I ran into issues with first() cause my table was looking up stuff that both had the same value of +1, so it was grabbing the first entry multiple times ๐
Had to swap the lookup from referencing the modifier to the skill-name and approach it from the other side, haha
So any time a player used two skills with the same modifier, (Skill1, Skill2) it'd just say:
"Skill 1: +1, Skill 1: +1" ๐คฃ
Which mathematically was fine, since same modifier... But lol we played the FIRST game in my system last night and the whole evening was me writing down all the bugfixes I noticed that I didn't find by myself. (playtesting always finds shit you never expect! lol)
yeah i have a playtest setup for tomorrow
which i guess means i should put the character builder functionality on hold and just make pre-made tempaltes, but i will need to know how to do this eventually
Haha, just ask Martin right?
A devs work is never done!
๐คฃ i mean......
yall are honestly speaking way above my level with this shit haha
i just know for some reason the button isnt working and im not getting errors
Oh shit it works!!!!
Thank you so much martin ๐ญ
Lol, I'm not a dev at all
just good at troubleshooting and understanding directions I find on the internet, haha
But In the last month alone I've pushed like 5 versions and updates and bugfixes to this damn CSB game I'm building for my table's homebrew system ๐
I didn't think I was signing up for THIS
๐ฌ same tho, same.
im just a simple script kiddy on my best of days
I last touched CSS in the MySpace days, lol. But now I know more about Javascript than I ever thought I'd care to! ๐คฃ
Hey all! I have not managed to find a way to count doubles using CSB (or native Foundry). Any ideas?
This one should almost fit for your case: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
Hello. How would you create a button label that deleted all items attached to the actor? - Edited: Now all sorted!
Hi, where i can find example how change Number Field value with Roll? i try make damage and change wound
but its notification,yes? it cant change Number field when i take damage,or can?
i mean than i took 1 wound the "current" value should decress by 1
maybe somebody have a template charactersheet with automatic calculation?
The scroll bar puts you in a different section, because the page loads all images afterwards, which missaligns the scroll position. I've linked the section about setPropertyInEntity() in 4.2.12
I read about entity but it must used with items and item container or dynamic tables?
By entity we mean it's either an Actor or Item
" setPropertyInEntity " I must write in ROLL button?
This should only be used in a Label Roll Message
Thanks, i try do something...
but maybe there is an example somewhere? Like Character template
The example-template actually has one
Custom System Builder - Example, an Add-on Module for Foundry Virtual Tabletop
OH! thanks! it has updated! You saved my day!
How do I know what is the ID of a status?
I'm messing with the world script and am getting an error saying the status id is invalid, which I wrote "Frozen" for testing, but I'm guessing that is not how it works
I noticed the example has stunned but I don't know how to find its id
CONFIG.statusEffects is just an Array of Objects, so you can look that up in the console and get all configured status effects
it works ๐ฉ
Thanks ๐
Guys, i need some help. I'm not a dev, i'm just a nosy DM trying to put 3D&T, a brazilian system, in the CSB, and i'm failing with the skills part. I'm trying to build two dropdowns in a dynamic table (so my players can add more rows), one [peresp] is for the skills (and gets the value from the periciasref dynamic table), the other one [esp] is for the specializations (and this one gets the value from the column peresp to select the correct column in the periciasesp dynamic table). The problem is: Everytime I try to write the formula to get the value from one dynamic table to the other, my sheets stop working. If I make it manually, it runs well, but I need to automate this or I will have a mountain of useless work. Prints of the components involved below. Thanks in advance and sorry for the bad english (and for the illiteracy in coding).
I know I can use in formulas "item.name" to pull a item name
But how can I pull the item image to the formula?
Use ${lookup('periciasesp','sameRow('peresp')')}$ for the formula inside esp. And you were missing the quotations for the second argument for lookup
The issue is that you are referencing perespand the system has no way to tell what is the value. Since one dropdown depends on the other, I'm assuming you want the value from the same row
Hi, question, why does csb leave so much space in between elements? It's making my sheet incredibly wide...
The size auto will take and share the whole available width. If you want smaller sizes, you can use the size-setting in each Component.
You can also use your own CSS-rules for finetuning
Yep๐ That was the problem! I had it on gigantic...
Considering I have an item Template with 2 dropdown menus: attribute and bonus, and both have keys that are equivalent to some character label (numeric) keys (i.e. value_str as the first option for the dropdown menu attribute ) is it correct to assume the following item modifier template will retrieve the correct character field from the item itself and apply the bonus to said field?
Yeah, i want to dive into this when i have more time, but as of now, I kinda have to make due with what I can finish!
Nope, your modifier values are computed with the properties of the Item before they are passed to the Actor
so ${attribute}$ won't become value_str? is it possible with ${string(attribute)}$?
also, I wrote it wrong, bonusis a numeric value from a dropdown๐
I'm trying to have a modifier template that changes dynamically when I change the value from a dropdown
Hi again, panel is set on vertical, but the text boxes are not put underneath one another... Their size is small, but that shouldn't matter right?
It will become 'value_str', which is fine for referencing the right key. And if the second Dropdown is just a numeric value, then that should also be fine.
Thanks!
Good question, maybe it actually does
May I send you a dm in a language I'm more capable?
sim
@formal goblet I wasn't able to help @noble ibex can you double check this syntax and help him please? Sorry for the ping
${lookup('periciasesp','sameRow('peresp')')}$
I'm thanking in advance
Should be corrected to ${lookup('periciasesp', sameRow('peresp'))}$, because you probably don't mean the column key 'sameRow('peresp')'
@noble ibex can you check this correction
in this case I was converting what was supposed to be the key formula to a string?
You actually have a syntax error, because your quotes are misplaced
It would read 'sameRow(' and then error out because of a missing operator
Oh, got it... it would evaluate the first pair
i will run this one, just a second
It worked
Holy cow, how could that we were so close to the solution? lol
Thank you Martin, Godspeed
And thank you again, my fellow brazilian, for the helpful intention
Now, my second and mostly aesthetical problem: The comas are generating new options in the dropdown, is there a way to prevent this?
Like "Montaria: Vocรช sabe montar cavalos e outros animais de montaria, como elefantes e camelos." should be one option, but in the dropdown it goes like this:
dieta estranha
Nope, because the comma is the separator character, which is currently not changeable
how about using - ?
Any other character would not separate
Perfect
Thank you guys, again. Soon will be letting people know that CSB now has 3D&T in the library
How do you make the item change information on the character sheet?
example: add a belt that automatically increases strength by +1 or a boot that adds +5 movement?
Item Modifiers, which are part of the Items
Guys, that solution you found for me worked for a while, but now it has returned to a state where I can't even open the sheet if I close it, and the mathematics are not working either. It shows this message right here
It seems like your second argument is completely missing
But I'm using that line you wrote, exactly in the way you wrote. If you want, I can export it and send it here
is there a way to make it so when you put put multiple of the same item into a container they stack with a "number of" collumn?
Probably with a world script or a macro you can achieve that, I'm no expert though
Doesn't the Item Piles module do this?
I've completed the character sheet and used it for a couple of games, worked out the bugs, and it's amazing. This level of automation and capability is better than I ever hoped I would have in a VTT. Thank you guys so much for building and maintaining it!
By the way, the vG system, which is the one I designed for my games, isn't a simple one, but this makes it simple. So, bravo. My players love it as well!
Folks, for creating a customs system based on a lot of Cairn and Into the Odd mechanics, is CSB enough?
are there any templates out there i could start with?
I can't estimate it because I don't know what you're talking about. But CSB can help you getting started with creating your own system.
We have the Example-Template and a Sheet-Library:
Custom System Builder - Example, an Add-on Module for Foundry Virtual Tabletop
Hey everyone, howโs it going?
Iโm working on a project to automate the FFRPG 3e. In this system, thereโs a mechanic in some attack abilities called Charge Time (CT).
Basically, itโs the channeling time of an ability. In practical terms, this means that the initiative of the actor channeling the ability is reduced by the CT value, and then their turn is passed to the next actor. When itโs their turn again, the channeling of the ability is completed, and the effect of the ability is applied.
Iโd like to take advantage of this amazing groupโs experience and ask how I could automate this mechanic in the Custom System Builder.
Hi there - just found your system and it seems very promising for our custom RPG we are building. Before I begin making sheet. I just want a bit of help to see if our basic roll formular can be made in the system. Hopefully you can help me create this formula as i'm no good at this.
So... I'm looking for a roll that rolls (STR + modifier + Fatigue counter)d6 and count the successes if it's >3, count the full successes if it's >5 and if there is more than one 6 then it should display a critical. Also if the number of dice roll is 0d6 then it should roll 2d6 and take the lowest and compare this again the success/full success.
I know this is a bit of a big ask, but i'm not going to be able to do this my self, so thanks in advance. ๐ ๐ฅณ
Iโm sure you can with some modifying but it does still have to be manually set up for this system.
Is there a specific way to implement math.format? ive got a calculation thats adding together several decimal numbers, which works but gives the Math.js round off output which isnt overly nice to look at. The screenshot is essentially the output of 0.1+0.2
have tried several iterations of the below based on the screenshot of the mathsjs description but it either does nothing or outputs an error
${math.format(item.acid+item.bludgeoning+item.cold+item.fire+item.force+item.lightning+item.necrotic+item.piercing+item.poison+item.psychic+item.radiant+item.slashing+item.sonic, {precision: 14})}$
Edit: worked it out, leaving up in case its useful to someone searching. its just format, not math.format
All math-js functions are available without the math.-prefix
Can you get a roll to match successes up against multiple criterias (cs>3, CS>5) ?
Thought i had it, but i think it need some serious help ๐คฃ
Basically the only option you have (or do it with your own Chat Messages via the Foundry-API): https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
CSB is okay to update to v12 now, right?
y
not sure i understand. But I definitely don't know how to use the API. ๐
but i will look at the wiki
just hoped that someone could help me kick it off a bit.
Hi, new to CSB and am trying to set the max HP based on the class that's been chosen from a dropdown box. I made hidden attributes for each class's HP but I don't know how to put that into the max HP.
Hi!
Since we can't have item containers inside of items, how could I make it so that my Guns have Magazine slots you can load into the guns? Considering guns and magazines are items
I have a text field in my item model with the key โExtraCode.โ
In the character sheet, within an item container, I have a Label button to โUseโ the item, with some rolling codes, etc. Iโm trying to include this Extra Code key within the Use button, but it doesnโt seem to be working. Can anyone help me?
Iโm using this line of code to retrieve the extra code I wrote in the itemโs Text Field: ${item.ExtraCode}$
However, nothing happens.
If Iโm going about this the wrong way, what would be the correct way to do it?
My intention is to create very specific items without having to make a new item model every time I add something extra. So, within a โUseโ button in the item containerโwhich is quite generic and could be a potion, weapon, ability, or other thingsโI would like this โextra codeโ text field to work so that I can customize it better.
**
**Oh, I got it. I just needed to add another set of braces to the code like this:
${${item.extracode}$}$
You probably want to look into switchCase, although depending on the specefics of the system you might want to have your classes be CSB items instead.
Hello again, I'm trying to create an adjust mode for the sheet, i.e. a button which would enable the user to see some panels that would otherwise be obscured, so that he can't change values unless the checkbox is ticked. I'm using a label with the following code: in the Label Text space I use
<i class="fa-regular fa-${self.Adjust_Mode ? 'square-check' : 'square'}$" style="color: ${self.Adjust_Mode ? 'green' : 'red'}$; background-color: white;"> </i>
And in the Label Roll message, use:
${setPropertyInEntity('self', 'Adjust_Mode', "self.Adjust_Mode ? false : true")}$
It seems not to work completely, not creating a property, not switching between false and true. It is worth noting that I'm using almost identical code for the Item Containers for 'equip' or 'unequip' functions and it works perfectly.
Remove the self.-prefix
here as well? ->${setPropertyInEntity('self', 'Adjust_Mode', "self.Adjust_Mode ? false : true")}$
Like so? ->${setPropertyInEntity('self', 'Adjust_Mode', "Adjust_Mode ? false : true")}$
Y
You simply don't, because having Items in Items is currently almost impossible.
Seems not to work, the same as before. I've set up a hidden attribute to check on Adjust_Mode and it's blank.
Why don't you use a normal Checkbox with the key Adjust_Mode? The example in the Wiki is only relevant for Item Containers, where the Checkbox is inside the Item, but you need to toggle it from the Actor.
Oh yeah! I can make it invisible with the filter and use that. I don't know why I didn't think of it.
CSB can't help you there. You have to work directly with the Foundry-API (manipulating combat round handling and deffering application of effecs).
Isnโt there workaround solutions?
I actually have the same challenge and don't have a concept for now
Itโs really sad, Iโm making a zombie apocalypse campain and this is something pretty important :(
Hi. I would like the Max Value field of a number component to be the value of another number component.
The ? suggests formulas work in that field, and the gitlab page supports that, but I can't work out what I would type in there. ${MaxHealth}$ throws up a text error. ${:MaxHealth:}$ also doesn't work.
Anyone know?
I called one of the columns of an Item Displayer key: displayer_quantity, set as Label with the initial value 0. It will be responsible to track each items quantity. Instead of having a field inside the items (item.item_quantity) themselves, I wanted to have that displayer_quantity label that would be altered by a simple pop-up once that default value 0 is clicked. What would be a good way to reference that value so this pop-up modify the correct field? I read the Regenerate example formula but it sets the value for unique fields (Life Points and Spirit Points)
The first one is correct. Can you show the error?
Labels cannot be changed by users, so all attempts changing that via a Label Roll Message will fail.
Value must be numeric.
Oh, and the object with the formula
Is it possible to think of a way to handle a numeric value from the Item Displayer instead of modifying an item individualy? For cases like item quantity etc?
Seems fine for me tho
The Item Displayer only contains derived values. It doesn't have any Input Fields. You have to save the state somewhere else (e.g. Item).
I see. Thanks
I think it was a component key conflict with the example module. I didn't consider that, I sort of assumed scope would prevent it.
Changing the key fixed it, as did deleting the example stuff and putting the key back how it was.
Thanks for your time ๐
There are actually scopes, but only for entities and rows of extensible tables (Dynamic Table, Item Displayer)
Hrm. I'm not sure I'm doing this current vs max hp correctly. Seem like it might be a pretty common thing to do, but the way I'm doing it, eh.
Ideally I would like:
[8]/[8]
Where the right-hand 'max' value is manually editable, while the left hand one is a value with controls. Feels like the controls should be around both the current/max fields
I don't understand how _RegenUserInput is being called considering it is an item and I don't see it added to the character. Do you mind explaining that concept to me @formal goblet ?
It is a User Input Template, not an equippable Item
Check the Label Roll Message of the Regenerate-Roll (should be under HP)
I see, thanks. Is there a way to reference a field one time instead of having it updating indefinitely?
Label A == 10
Label B == ${Label A}$
(somehow) Label B == 10 instead of Label B == Label A
Is it possible?
Labels will auto-update on every change (consistency-rule)
Is it possible to link data (like label variable) between two items that are stored inside an item container?
for example having a "pistol" item reading the value of "ammo" of a specific "pistol magazine" item, with both being inside an item container on a same character sheet
fetchFromActor('attached', "lookup('ammo_container', 'ammo', 'magazine_type', 'pistol')")
I'm trying to modify the field item_quantity of an item that is stored inside an item container, but the user input triggered by the column (that retrieves the quantity information from the item) seems not to have access to that information (item.item_quantity).
This is a label from the user input template which is set to ${item.item_quantity}$ and it displays the error message
Is it impossible to access that information using item.item_quantity inside an user input template? And should I use this approach instead?
I think the User Input Template lacks the functionality to retrieve the props of the linked Item and local variables
it seems possible to asign the value from the column though, using sameRow
These are props of the Actor, not the Item anymore
can I have the placeholder names that should be replaced for "ammo", "magazine_type" and "pistol"?
This is just an example. I don't know exactly, which search-logic you want to apply for the ammunition-table
I have an item called "Pistol magazine" inside an item container named "inv_ammo", and the value I want to fetch is called "AMMO"
Then first(lookup('inv_ammo', 'AMMO', 'name', 'Pistol magazine'))
Translated into SQL: SELECT AMMO from inv_ammo WHERE name = 'Pistol magazine'
Don't forget fetchFromActor() if you're working from different entities
so basically this?
${fetchFromActor('attached', "first(lookup('inv_munitions', 'AMMO', 'name', ammo_type),0)")}$
(ammo_type is a text field inside the gun item sheet that I can modify)
still returns an error :(
Then ${fetchFromActor('attached', "first(lookup('inv_munitions', 'AMMO', 'name', '${ammo_type}$'),0)")}$
๐ญ
Show console
undefined lookup()? Which CSB-Version are you running?
3.0.0 since 4.0.1 was completely broken on my side (all label edits had one edit of delay before updating)
and I can't update to V12 of foundry yet so no 4.1.1
Then fall back to fetchFromDynamicTable(). It got renamed in 4.0.0
That's uhm... something
items are properly attached
the value "AMMO" is not listed on the inv_ammo item container, is it why?
You need version 3.1.0 at least, otherwise you'll get no data from Item Containers: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/CHANGELOG.md?ref_type=heads#features-4
3.1.0 had the same update issue than 4.0.1 tho
Is everything working properly in 4.1.1? I might update everything to V12
I expect some things to break a bit, but most of them should be fixable. A jump from version 3.0.0 to 4.1.1 is quite huge
alright, I'll handle this when I have the time
updating this means updating all my modules too
And I use 222 modules on my campaign
Yeah, expect at least a day of work
atleast if we get item containers inside items one day, I'll just have to update CSB
Also, the issue with this workaround we are currently doing is that if I have two magazines with the same name, the system will get confused right?
However, it's usual to have multiple magazines of the same caliber
You can expect some bugs with non-unique entries
is there anyway to fix this beside renaming it?
The best would be to rely on the ID of the Item
yes but how can I get the ID?
Simpler, I have a value named "Loaded" on all my magazine items
Would it be possible to only read the item that have this value as true?
Only one at a time will be loaded
(issue would be if the player uses two guns with the same calibers tho)
so I guess ID is still a better option
Every Document has an id and uuid. So you can retreave it via a little Script: %{return entity.entity.id;}%. Besides that, every Item Displayer also contains a hidden column with the id -> ${item.id}$ (v4 and above)
oh nice
I'll add the ID as a GM info then
thank you!
do we have any ETA for the case #198 (https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/198) ?
Nope, estimations are basically impossible ๐
Can you aid me get to atribute bar in console? canvas.tokens.controlled[0].actor.system.props.attributeBar.Zdrowie does not get there
Remove .props
That sounds like a headache, and like it could get messy very quickly
Especially if it's an item with an Item Container within series of items with Item Containers
Without CSS, is there a way to have an Item Modifier change the color/style of a label?
Like if an Item gives +1 to player_mind is there a way to also make the mind label green or blue or somethin'? ๐ค
Oooh yup got it
Using = (Set) lets you use it like normal and add html styling, just gotta figure out how to make it work with the math
I am trying to make a "source" within my items.
I've tried dropdowns as well, currently experimenting with a label.
My issue is getting the source to show up within a item container on the sheet so we can quickly identify where items are coming from.
I've tried a few ways of displaying the source, but all of them come out blank.
e.g. ${ref(item.foundationSource)}$
Is there anyone here who speaks Portuguese who can help me?
not sure if this helps but Linked help me figure out something similar:
<div class="custom-system-meter" style="width: 100px;"> <span class="custom-system-meter-fill" style="width: ${(sameRow('reputationProgress')-1)*25}$%; background-color: ${switchCase(sameRow('reputationTableTier'), 1, '#700e0e', 2, '#B22222', 3, '#f5103e', 4, '#FF4500', 5, '#FF8C00', 6, '#F5F5DC', 7, '#87CEEB', 8, '#00CED1', 9, '#20B2AA', 10, '#2E8B57', 11, '#3CB371')}$;"></span> </div>
creates a meter and changes its fill color based on which value is selected from a dropdown list within the samerow of the dynamic table.
you can probably scrap that for parts-- but it does use CSS through the <style> tag
That makes sense, I think my difficulty is trying to put that on an item modifier so the item applies the styling.
I think I could probably come at it from another angle and have the label itself "go looking" for such modifiers and applying color, like the meter you posted. Might be more straightforward too, rather than having colors on item modifiers
this: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Conditional-text-color-formatting
is something similar to what you're mentioning, and it pointed me the right direction. But I guess my goal was to come at it from an "apply style to" rather than "match style to" parameters!
I meant you'll probably need to change the label Mind to have a switchcase found within the item
Yeah, exactly. I was coming at it from the opposite side
so instead of using a dropdown to as the housing for the switchcase condition, you'd have an item
you have any idea how to get items to populate information into a container?
Ohh yeah yeah, I think I know how I can get it to work from the label side, like you're suggesting.
I just like to make things harder for myself and gnaw on the wrong side of the problem to start ๐
Using = and <div style="color:blue">${fetchFromActor('attached' , 'player_levelmind') + item_bonus}$</div>
on the item is working, but it means that only one one item bonus will calculate at a time. Which is fine for my use case, especially since it'd be odd to have colors competing in addition to math competing, but I still wonder if there's a way to use the priorities to let + item_bonus exist independently in its own modifier without popping up an error or NaN
A second component (or hidden attribute) can contain the styles and your Label just fetches that
And you can use Label prefix
- suffix for the html-tags and the Label value for the raw number
Ohh can it? do you just drop your style in the hidden attribute formula? Or do you need to feed it a key as well?
It's just a string in a hidden attribute
I'm messin with it now, I see how it works, that's nifty!
I got it partially working, but I'm trying to figure out the exact way to get the prefix/suffix in the label to reference those hidden attributes in the item,
Ok think i need help ๐
// ${rollformula:= (athletics_num + athletics_mod - Chivalry_fatigue_num + chivalry_drive_num) < 1 ? '2d6kl1cs>3' : ':(athletics_num + athletics_mod - Chivalry_fatigue_num + chivalry_drive_num):d6cs>3}$ // //<h1 style="text-align: center;">${[:rollformula:]}$</h1>//
The 2d6 formula works, but can't seem to refer to a variable inside a string.
Please help ๐
repost ๐ฆ
: is generally not allowed, except:
- The assignment operator
:= - The ternary operator
... ? ... : ... - To mark variables or functions inside
[] - In strings
Just ${item.foundationSource}$ ?
it seems i've overcomplicated.
thank you
but how to i refer to a key inside a string, then?
'(athletics_num + athletics_mod - Chivalry_fatigue_num: + chivalry_drive_num)d6cs>3'
Either '${athletics}$d6' or concat(string(athletics), 'd6')
ah ok - i'll try that
Thanks
so like this '${athletics_num + athletics_mod - Chivalry_fatigue_num: + chivalry_drive_num}$d6cs>3'
whole thing is this - but cant't make it do the key calculation <h1>Successes</h1>
${rollformula:= (athletics_num + athletics_mod - Chivalry_fatigue_num + chivalry_drive_num) < 1 ? '2d6kl1cs>3' : '${athletics_num + athletics_mod - Chivalry_fatigue_num: + chivalry_drive_num}$d6cs>3'}$
<h1 style="text-align: center;">${[:rollformula:]}$</h1>
it worked!!! just had to remove the : that was in the way!! thanks man
The console is also helpful finding issues, so use that
Yea - i'm trying but i'm not so good at reading that code ๐ but i'm learning
Is there any way I can put images inside a character sheet?
In this example I'm using "label icons" but I wanted to use images
You can use HTML in Labels. Just google the <img>-tag
this works fine:
Rolling: ${sameRow('attributeName')}$ with ${sameRow('attributeFinalDice')}$ <br><br> <h2>Total: ${[:sameRow('attributeFinalDice'):]}$</h2>
but the minute i try to add situational bonusses within the alterantive roll:
Situational Bonuses: ${addMod:=?{sitBon:"Situational Bonuses"[number]}}$ Rolling: ${sameRow('attributeName')}$ with ${addMod}$ + ${sameRow('attributeFinalDice')}$ <br><br> <h2>Total: ${[:sameRow('attributeFinalDice'):]+addMod}$</h2>
it doesn't work and provides no error or output
You already have sitBon. Use that
but isn't addMod just = to sitBon's result?
sitBon is just the inquiry of how much the situational bonus is?
In this game I'm adding, weapons aren't just the values that form their primary attack, but also grant manoeuvers - alternate attacks which cost a resource.
I first thought to create these manoeuvers as separate template, and add those to the weapon template, but it isn't possible to place an item displayer object into an equippable item template.
Is there any advice around a strategy for implementing this game? I can:
- bake the manoeuvers into each item. There's not so many that any repetition will be too annoying
- possibly make people manually drag the manoeuvers in as separate items, but then if they lose the weapon they'd need to remember which manoeuvers to delete, unless they could auto-hide?
I'll probably just bake them in but I'd like to learn if there's a proper/good/recommended way to handle this kind of thing.
The input is saved in this variable, that's why addMod is useless
There are ways to make that clean, but that requires quite a bit of scripting with the FoundryAPI. There's no proper CSB-way atm.
Just starting to learn Custom System Builder and I had a few questions about Additional style classes.
-
I created a simple CSS file with styling for a class.
-
Since I am on the forge for my server, I added CSS to my assets library and copied the link.
-
I then set the configuration of CSB to that CSS file
-
I then went into the component and added that class to the Additional Class field of the component, but nothing seemed to happen.
Is there something I am missing? do I need to add the class with a specific syntax? Does this not just add a class for enabling a class selector to style the component?
Another Question:
I made custom icons for my dice rolls and macros. Is it possible to use one of those for my icon rather than using Font Awesome?
K, so I figured some of it out by just adding HTML to the label and then putting a style attribute in the element to add css to get some styling to apply.
one more question:
I have a label Formula that rolls x number of exploding dice and then compares them each to a target number to see if I get any success.
this is the current formula I am using:
%{return new Roll(`{${Array.fromRange(6).map(i => "1d6x").join(",")}}cs>=8`).toMessage();}%
This was just to get it running enough to test to see if it was working and it does, until I try to change the number to things on the sheet.
so I try to replace the 6 with my field that is keyed to body_value, and I can't get it to work anymore. It just stops doing anything.
I have tried
body_value
:body_value:
(body_value)
@body_value
${body_value}$
${body_value}
and almost everything in between.
I then loaded a dat moduel to check my path and found it to read @attributeBar.body_value.value and tried all the combinations with that and nothing.
I then decided to try in between and tried @body_value.value and everything I could think of for that and still nothing.
please help, I don't know what I am doing wrong but at this point I am calling it quits for the night.
You add the class names whitespace-separated as barewords (no dot).
If you're working within a script, you should use entity.system.props.body_value
Thank you so much that worked. I was pulling my hair out. lol
%{return new Roll(`{${Array.fromRange(entity.system.props.body_value).map(i => "1d6x").join(",")}}cs>=8`).toMessage();}%
Trying to implement Old-school Shadowrun dice has been a pain. ๐
now to work on the Target number prompt since it can vary.
but that is a future red's problem.
Thank you and good night all.
Hey, what kind of edition are you planning on running? I am looking to implement Shadowrun 4a 20A in Foundry vtt. I would be very happy for a joint venture on this!
Is there an expected correct way to restrict item amount based on the item template? (2 weapons , 4 potions)
Only with a script. Listen to the "preCreateEmbeddedDocuments" (or something similar)-Hook, filter by item-type, fetch the current item count by item type of the sheet and abort if the limit is reached.
Alright, thank you ๐
Would you say it's not worth suggesting as a system feature inside the item containers?
I'll store the max for each item template inside the character template so that the design is cleaner
Ah that's way broader but fits. Cheers
I am working on an implementation of 3rd edition, But 4a was a great system as well. I look forward to seeing what you come up with.
I have the german implementation of the 6th edition if you need some pieces of it
I also play 6th, so that would be cool to link to. The systems are pretty far apart with regards to many of the mechanics, but knowing how you implemented edge expenditures could help with Pool expenditures in 3rd.
I also need to figure out how to implement the initiative system, which I think for all editions of Shadowrun it was the same. That is after my next task which is to figure out how to do variable Target numbers in my success test sheet roll.
Hey I have a question
is there a way to pass on a information in item to macro that is launched through the sheet?
I want to create a macro to roll the damage of an item through a character sheet but I need to pass on to the macro values from the character sheet and the weapon item
Hi! im trying to force atribute bars to work with ripper carousel combat tracker. As i understand CSB dont have straight implementation of bars that would be able to find for HP or AP. I was eble to directly inject my atributebar, but it only shows there top value no current.
Question is. can i convert some way atribute bar from CSB into a regular foundry atribute bar so the module should see it. Its not a first module i meat such problem i cant pick atributes for CSB. Is there a chance to conver or duplicate them to norrmal ones?
I have a simple question I can't seem to figure out. How to I get the name of the targeted actor?
${fetchFromActor('target','name')}$
I was wondering what i am doing wrong in my macros, i used to write something so that people can roll their macros checking if they are tunned to a certain skill, meaning the skill will not get worse the more they are tired, it worked at first, but i am trying to do it inside a Configure Hidden Atribute Bar, so that my players can just write FatigaDeStamina and if the checkbox is checked it will work.
this is not working
now i will send in the one that is working
${#scale:=switchCase(sameRow('simplemagic_scaling'), 'forca', ${Forca}$, 'agilidade', ${Agilidade}$, 'constituicao', ${Constituicao}$, 'inteligencia', ${Inteligencia}$, 'sabedoria', ${Sabedoria}$, 'carisma', ${Carisma}$, 0)}$
${#name:= sameRow('simplemagic_name')}$
${#roll_hit:= sameRow('simplemagic_hitmacro')}$
${#roll_dano:= sameRow('simplemagic_damagemacro')}$
${#descricao:= sameRow('simplemagic_description')}$
${sameRow('simplemagic_istunned') ? concat(
'<div>',
'<h2>${name}$<h2/>',
'<h3>Acerto = ${[:roll_hit:+(:scale:/3)]}$<h3/>',
'<h3>Dano = ${[:roll_dano:+(:scale:/3)]}$<h3/>',
'<div/>'
) : concat(
'<div>',
'<h2>${name}$<h2/>',
'<h4>Nรฃo Afinado<h4/>',
'<h3>Acerto = ${[(:roll_hit:+(:scale:/3))(${Stamina}$/${StaminaMax}$)]}$<h3/>',
'<h3>Dano = ${[(:roll_dano:+(:scale:/3))(${Stamina}$/${StaminaMax}$)]}$<h3/>',
'<div/>'
)}$
${descricao}$
I wrote this one last month, and i changed multiple things such as moving much of the variables to the Configure Hidden Atribute Bar
${sameRow('istunned')}$ maybe? It's not closed
Then again, I know next to nothing about macros.
Nope, did not work
Check the console for errors
The inner formula is obsolete, so it can be removed
For some reason in a actual actor it is diferent
Is it obsolete as in v12 ? i am using v11 because some modules that i use have not updated yet
3.2.5 is my version
I mean the inner formula delimiters. You can rewrite it to ${sameRow('istunned') ? Stamina / StaminaMax : 0}$
However you like. These spaces don't matter in this case
it is still not rolling and giving this error inside console
Do things such as sameRow work inside a hidden atribute declaration ?
Ahh, yeah they don't.
Damn... can you think of a work around ?
If you want to use the data of the same row, then the Formula must be inside the Table.
Otherwise there's no context for the same row
it is being called inside of the table, but i asume it runs the computations before my Label is rooled when the actor is loaded
Hidden Attributes are handled like Label text
So yeah, computed on sheet-changes. Not when you're rolling
maybe I have already asked - is it possible return whole LINE of table instead of COLUMN
like lookup do for Dynamic table?
I tried soething diferent, i tried changing it to ${istunned ? FatigaDeStamina : 1}$, and now it works, but for some reason it is aways 1 and the value dont update when you click the checkmark
my ideia was to have one checkmark that a player needs to press before using a tunned magic
Did you misspell it maybe? Shouldn't it be isstunned?
i did misspell that... the word is actually tuned with 1 n
but i did the same mistake in the key
so cant be that
What does ${istunned}$ return?
false
when i check it it changes to true
and that is inside the hidden attribute thing
and ${typeOf(istunned)}$?
Wait, why do you use FatigaDeStamina in the Formula?
it translated to TiredBecauseOfStamina
it is used to reduce the amount of your bonus when you are low on Stamina
The more a battle goes on the more tired you get
Your key of the hidden attribute is the same. So you have a recursive dependency
and i want that if its a magic or a hability you use your whole life it does not impact the roll
i...
i am dumb
i should have writen ${istunned ? Stamina/StaminaMax: 1}$
it worked
thx Martin, sorry for the lack of eyesight
Can you change the value of a meter using a formula?
Y
I was trying to set up a Condition monitor-style damage tracker for my Shadowrun module.
So I set a label of "Stun Damage" and a meter to give a bar-like value similar to the condition track of 0-10.
Then I noticed there was no way to just adjust the meter without calling some sort of formula. so I clicked on the label to try and set the value with setPropertyInEntity, but it is just not working to set the value of the meter to display the damage.
I was using
${setPropertyInEntity('self', 'stun_damage_value', ?{adjustment[number]})}$
I was thinking that the user would click the label and then get a box to put in either a ply or minus number, and then it would adjust the value accordingly.
setPropertyInEntity() can only change the values of Input Components. Labels and Meters are not working with that, because they auto-refresh with every sheet-change.
then how is the meter adjusted by a player using the sheet?
The Meter can refer to Input Components, so the player should change that instead
is that set in the Value entry of the meter? and would I just list in that
:key:
to get that to work?
Ah I figured it out. thank you
hey peeps, I am trying to start using this system builder. Are there any more or less up-to-date videos on youtube that show me how to properly create dynamic tables etc.?
Probably not, you only have the Readme and Wiki in GitLab
Thank you. While the documentation is miles better than Sandbox System Builder's, if someone could produce a system where they slowly build a system the community could greatly benefit from that!
Currently trying to build a dynamic table to which I can add skills items. It's a lot of trial and error for now
In Sandbox builder, for example, I could first create a skills table with columns for Skill name, skill rating and a roll icon and leave that table empty. Then I would create one item per skill, give these items a skill name plus according attribute to roll. Then I would just drag and drop the item into the table in the player sheet for the skill to be added. Is this possible in CBS as well?
You should use an Item Displayer for this case. This is the only Component, that displays items
The Dynamic Table is just a normal Table, where you can add rows. It doesn't have any drag & drop-functionality
Ah, gotcha!
Within the documentation that is the item container, correct?
Yep
And where exactly do I configure
- which columns the table should display
- text fields for values like skill rating, which can later be changed on the player sheet?
Ideally, whenever I drag a skill over, it automatically converts into several fields like "skill name", "skill rating" and so on
You have the + - Button in the template. This will add a column
Thank you. Sorry for all these questions, this is still babysteps for me. And how can I refer to the values of my skill in the item displayer?
You use a formula like ${item.name}$ (or whatever your key is)
Like this? This yields no name in the table sadly
The prefix item. must exist
Otherwise it will try to find it in the props of the Actor
So if my skill name key in the skill item template is item_skill_skillname, then the correct value for the label would be ${item.item_skill_skillname}$? I am getting an error doing this.
It would be correct, yeah. Check the console with F12 for errors
Alright, then check the keys for typos. It means, that the result is undefined
I just saw that somehow after changing the name in the blueprint, the item was wihtout name, now it works. Thank you so much! Final question for now: any way to get rid of the item hovering next to the name in the table?
Wdym?
For me it's about aesthetics. If I can just ignore it using CSS later on that is fine as well.
Folks, can anyone recommend a d20 or osr based sheet I can use as starting point for the game I am putting together?
NVM, found the example module ๐
Say I want to create a skill item, with specialisation and skill rating customisable by the players within an item displayer. How can I do this? I attach an image of the item displayer table in the left window on the top, and a manual table underneath it. The manual table shows what I am trying to achieve. For example, the dropdown menu works in the manual table, because it can lookup the attribute value. But when using items, this is not possible, most probably so because the item itself does not know from which actor to fetch the attribute values
Yeah, you can use the parent. prefix when entering the Dynamic Table key in the Dropdown config (when using the Dynamic Table option)
I am trying my best to follow you, but this system is still new to me. Am I on the right path? Also, is there any programming language I should study to better understand the structure of CBS?
I see what you did there. Your Key options should be just the keys without any formula-delimiters (and make sure to leave no white-spaces) and the formula of your label options should be in this format: fetchFromActor('attached', "attribute_body", 'N/A')
For the programming language part, I suggest to read these here:
- https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
- https://mathjs.org/docs/reference/functions.html
In short: ${}$ uses mathjs (with some custom-behavior) and %{}% uses Javascript
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.
Could someone pin this?
Thank you for your continuous support! Unfortunately your porposition did not work (or I am messing it up).
I verified the key for Body attribute is attribute_body though
In your Item display, you have more than just the name of your skill. You also have the rating and stuff displayed. how did you get those to show? when you drag your skill item over to the sheet, does it pull the data from the items field and display them without the item button.
NVM just saw it, the plus button like a tabbed pane
yes, precisely
@echo veldt I am building Shadowrun 4e, in fact. If I remember well you are building SR3E? We might be able to help each other here and there
absolutely, many concepts are similar, even if the systems are different.
oh, speaking of Shadowrun, I made a dice icon to use for a button to click for rolls off of the sheet. If you are interested in it, I can send it over for you to use as well.
This isn't going to help right now, but my goal is to have a video uploaded in December. It'll cover the basics for people to get started, but the Wiki in GitLab and this Discord thread will have more information.
Is there a way to make items populate a drop down list?
In don't see the entries of your fields via my phone if your screenshot is covering the whole screen. Just the Dropdown config is enough right now, because that one has issues.
If you have them inside an Item Displayer, then using the Dynamic Table option in the Dropdown would be the easiest one.
Another question. I'm trying to get this conditional to work but its acting odd with the mix of text and code I put in there.
${Successes >= 0 ? 'You dodged! Take no Damage' :
'Roll to Soak 'Enemy_DMG-Successes ' Damage.'
}$
Error:
You have to use concat() for string-concatenation.
Yeah that's what I thought. I tried that before but looking back on it I misread how to implement it. Is there any way to that print as text or will it always come out in this format?
Use ! at the beginning of a formula
Hmm... I am trying to work on something based on the Dice Pool wiki entry,
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
And... even without messing with the code I can't get Foundry to spit anything out, just the error of a bad function.
Even trying Raddy's crit version un-modified gives me the same thing... ๐ค
I'll confess, I am new to scripts in Foundry
Guys, I tried all things, but nothing is helping me. I'm throwing the template I'm trying to use here to see if a good soul can save me. Thank you in advance
Hi, when I right-click a button in my sheet and select "add as a macro" it runs the button correctly, but it also prints to the chat the roll message when it shouldn't. Any way to stop that happening?
As you can see, clicking the button runs this code and it works perfectly in the sheet without printing anything to the chat
But when you run the macro in the hot bar (which looks like /sheetRoll lose_stamina_key ) it prints the following:
I see, getCustomRolls() got reworked to getCustomRoll(rollKey, options?)
Probably a bug ๐
ah damn
But you should be able to disable Chat Message Creation in the Macro itself
Oh that doesn't appear to be an option for me
Yes please!
Thank you, this is a lot of help already! I can definitely wait for a bit. I think it would be wonderful to do several videos, with one core function explained by video. Of course I understand that is entails a lot of work!
I am not entirely sure I understand. Are you saying that referring to the attributes of the attached actor from within a dropdown menu of an item is not possible as of this moment?
That's not what I meant. I only need need a screenshot of your entries of the Dropdown, ideally not the whole screen. Otherwise it's too tiny to read from the phone
ah, I see. right away. By the way, this is the error when pressing F12
foundry-esm.js:4621 Error: The {{select}} handlebars helper is deprecated in favor of using the {{selectOptions}} helper or the foundry.applications.fields.createSelectInput, foundry.applications.fields.createMultiSelectElement, or foundry.applications.fields.prepareSelectOptionGroups methods.
Deprecated since Version 12
Backwards-compatible support will be removed in Version 14
at Object.logCompatibilityWarning (foundry-esm.js:4609:19)
at Object.select (foundry.js:8349:19)
at Object.c (handlebars.min.js:27:27865)
at eval (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:13:129)
at Object.h [as fn] (handlebars.min.js:27:25975)
at Object.<anonymous> (handlebars.min.js:27:18211)
at Object.c (handlebars.min.js:27:27865)
at Object.eval [as main] (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:43:47)
at c (handlebars.min.js:27:23534)
at d (handlebars.min.js:27:23849)
logCompatibilityWarning @ foundry-esm.js:462
That is an unrelated warning
and this is my dropdown menu
I'm limited to what I can teach, since I don't know a lot. I know I can over a small scope (showing the components and what they do). Most likely not going to be a series of videos just because I don't want to accidentally give misinformation.
Replace Key-Options with attribute_body (no delimiters).
Like this? No change in the result I am afraid
Does CSB have functionality for multi-target? I could have sworn I saw someone ask this recently, but couldn't find the post.
I believe I saw something about that in the documentation
Nope. You need a script for multi-targeting
No, it's literally just attribute_body for Formula for Key-Options
I've tried that as well, I get the following
Alright, at least that works fine. Now add your Label Options
No change that I could perceive
Surround attribute_body with "" in Label Options
I tried that as well, no change
Alright, create a Label in your Item and insert the Formula of the Label Options into the Label text
That works! Now I really wanted to have a dropdown menu in order to make selecting the respective attribute easier for like.... 40 skills
I.e., hardcoding one of 10 attributes into the template is not going to work in my case
You have an Error in the Label.
Try out game.actors.getName('actorName').system.props.attribute_body in the console and replace actorName
this works
I do have an error in the label of the unattached item, but when dropping the item into the skill table, then it shows the correct values
You need a fallback-value for the unattached case
I just added , 'NA'.
But still, referencing from the label works, referencing from the dropdown using the same function does not.
I recently updated, and i had problems defining attribute bars.
What did I do wrong? (i was trying to make a resource bar on the token and it simply displays NaN
Here is a link to the folder of the Icon set I am slowly working on as I need icons for things in the system.
https://drive.google.com/drive/folders/1dDWptfiWDwqG6sk5Z3Ira4hoT_dWKgA5?usp=sharing
Check fisico and fisico_max
I mean their values ๐ . You can create a Label and try to reference those or check via the console
srry
Did you also update the actor? The 2nd screenshot doesn't align with your screenshot of your Attribute Bar config
Another question: Is it possible to leave certain columns/field in item displayers open for players to define? In this image for example, I would like to let the specialisation field per skill be an open text field that the players can write into. I have found no option to do this. The table underneath shows what I would like to achieve
yeah but same
Nope
The item table maybe its not the response.
But you could make a text field inside a configuration page, and make a label read the field
what? ok I've never heard of synthetic actors
its linked
Each Token has a synthetic Actor. If the Token is linked with an Actor, then the synthetic Actor has the same reference. If it is unlinked, then a copy of an Actor is created and the synthetic Actor references that instead
oh ok
Which version are you running?
4.1.1
Maybe we can avoid the issue. Where do the values come from?
not from a dynamic table
I tried it alone but apparently now after the update I need to make the attribute for resources to recognize it, right?
How about you configure the max-value in fisico and delete your custom attribute bar? Because the number field will create one for you as soon as it has a max-field
this?
Yep
now i dont have any attribute bars
Check the console for errors
nothing
Heh...
Try out game.actors.getName('actorName').system.attributeBar in the console
That's an error during computation. It's normal, that not all values are resolved during the computation loop. Show me the message
Alright. Try to find the faulty formula. You can find the content of the formula at the bottom of the error message
yeah but idk where it is haha
You could export the Actor or Template and try to find it in the file with a text-search
I don't have that many buttons
Wdym?
i will find it
I didn't find it, but I deleted all the formulas and it worked lol
thank you Martin
Could you help me with quick buttons on the sheet to change or reset values?
This is the function you're seeking: https://gitlab.com/custom-system-builder/custom-system-builder/#4212-setpropertyinentity
Is there a method for displaying every name from a column in a dynamic table onto an item container column?
use case:
In my system, a character can have multiple specialties in a skill. I have defined this as a dynamic table in a skill item.
On the actor, I have an item container to display the actor's skills and you can just drag new skills over to the actor as you want.
I would like this item container to display basic info on the skill like its specialties, but as those can be any number and I put them in a dynamic table how do I display them?
found it, it looks like I can use the looup function to get something.
Has anyone here had success automating Polyglot languages with CSB?
so I figured out a work around to do this.
-
In your item container create a column to hold a generic label to act as a button for a formula that is used to set the name of the specialty inside the item. You can use html here so if you want it to look like a generic + symbol or whatnot you can. This is done by using an <img> tag as the label text.
-
For this label you will add a formula in the "Label roll message" box and deselect "Send roll message to chat".
${setPropertyInEntity('item', 'test_name', '?{name:"Specialty Name: "[string]}')}$
This is the one I used to set the name of an item I had in the testing I did. you would change 'test_name' in your formula to the key of the item's value you wish to change. which would be the key to the specialty text field you have in your item.
Note: You do not add item.whatever or anything else just the key you entered for that item field.
This formula will prompt the user with a text box to enter the specialty name and then set that field in the item.
I suspect, I maybe stupid. I cannot figure out for the life of me how to make a numerical value appear below a token. just a graphical bar
Are there any example sheets that include inventory and items?
FYI: I managed to find a way to trigger the button by putting the component key into await actor.templateSystem.roll('insert_component_key_here', {postMessage: false}); within a macro that was set to "Script" and running it. It stopped the message from appearing in the chat which was perfect
Thank you for your help! Could you show me an example? Especially with the HTML part I cannot really imagine what you are referring to.
Hello all! Just noticed that today is the one year anniversary of me trying to figure out how to do opposed rolls in my Heavy Gear (Silhouette) system. ๐ฅณ
I put it on ice back then, but thought I'd give it another try now. How could I store an attack roll result, so that when the target rolls its defence it gets compared to the attack roll to give the difference as the final result?
I'm not great at scripting, but can cobble together workable macros given enough time.
Hmm... was thinking I might be able to use something like this, so when the target rolls evade it can use last_attack as a reference. But saw something about players not being able to edit non-owned actors.
${#setPropertyInEntity('target', 'last_attack', 'target.last_attack + attack_result')}$
That's correct. It's a Foundry-limit
Hmmm... ok, thanks. I've been looking at flags as well, but unsure of how those work.
Flags can be written to any Document, but they share the same limits with permissions
What you could try is to store the data in a data-attribute of a Button in the final Chat Message (the Button itself would execute a Script with the stored data as context).
Aha... like a "final result: 8. Click button to roll evade." button in the chat message, that would then trigger the defence roll?
Yup
Hadn't thought of that, but yeah, feels like a workable solution. Thanks!
Haven't done much with chat messages yet, so need to figure out buttons and stuff. But should be doable. ๐
Hey everyone! New to the csb so I am struggling quite a lot.
Is it possible to create attribute stats with a checkbox bar like this in the character sheet?
Nope, we don't provide this style
Okie, thank youu
This question may have an obvious answer I am missing, hopwever I can't seem ti find an answer: I have a working character template. From teh GM side it's working fine. When connecting as a player and they create a new character, the sheet they get is blank. How do I make the character template the default for a new, player created actor?
Been trying to figure out a way to do this myself. need to represent a 10 box health tracker similar to this and the best I've got so far is to have a meter. though the style does not match.
The best I came up with is possibly using a switch case to change the graphic to one properly filled out but I am afraid that the graphics will load too slowly for it to look good at all.
can you show us pictures of your created sheet and theres?
GM Sees
player sees
Just to clarify: when the character selects new actor, the only option they have is "character" and it's loading the default foundry template. No other choice is available.
doing some testing on my system. there is a setting in the Configure settings under the Custom system tab that sets the level for reloading a sheet and i wonder if that will let the player reload the template or not.
seems the default was set to assistant GM
Yeah It does, but I don't really want them to mess with being able to reload and select the NPC template ๐
Thanks anyway. I'll have to use the perms settings for now and scold them if they goof around i guess.
Or I can have them make the blank and force a reload once they make the initial sheet. Actually just tried it and it seems to work. I can do that for now.
could someone help me with a css class to change a panel width?
or idk a way to enlarge it.
please
No worries, I can walk you through what I did but yes it is basically what was listed here #1037072885044477962 message
I wish I had seen that earlier, lol.
so yeah I use HTML in labels all the time to do different things. I tend to use the <img> tag to display my custom die symbol, but I recently found that I can set the custom symbol in the global configuration so this may change the way I am doing things currently.
so to use img tag you need 1 attribute called "src" you set this with and = sign and then point it to your icon or graffic like this <img src="PATH">. you do not need to close this tag like most of HTML. to make it the correct size I set an inline style for it with the "style" attribute.
so my complete tag is this:
<img src="https://assets.forge-vtt.com/61806064e7f43b69e5a19e1a/Icons/Dice%20Icon.png" style="border:none;height:25px; weight:25px;">
this is what I use for the label of my column. I then put my formulas in the "Label roll Message boxes for regular and shift + clicks. I have "Send roll message to chat" checked because this specific script is to make a roll of the rating listed in the item, but for setting an item you would want this unselected.
the final result of my label is a small icon the player can click to make a roll of the skill.
The formula you want though is to set the attribute so it will have a different formula
${setPropertyInEntity('item', 'test_name', '?{name:"Specialty Name: "[string]}')}$
This allows you to create a clickable item in the item container that asks the user for a specialty Name and then sets the specialty field in your skill to that name.
the '?{name:"Specialty Name: "[string]}' is what bring up the dialogue box for the player
and the 'test_name' is the pointer to what to set.
do you mean the "Panel" component? Doesn't it resize with the window and fill the full width of the space?
this tabbed panel
Its taking a lot of space because this section only has two columns, I would like it to take up less space so that the other column has more space.
sorry that is out of my depth, but the dev should be able to help. the only way I know how to do it is to put the tabbed panel component inside another panel component and then set that panel component to 2-column grid. So the tabbed panel would be in the left column of the grid and the other thing would be in the right column of the grid.
another possible way would be to add a class in the Tabbed panel Component's "Additional CSS classes" box and then use styling on the class selector in your CSS to possibly set the width of the tabbed panel.
one of the devs would know more than me as I am just hacking my way through things at the moment.
idk, Martin could help me with this?
They would know more than I, for certain. I am just a junior web dev and not on this project. So, I know some coding and that is all, but personally, I would try adding a class to your tabbed panel and then styling that class in your CSS file.
If you don't know CSS though I would wait for a devs help and see if they can help you.
i did it
div.classe_arruma_ai{
display: flex;
justify-content: space-between;
}
div.spaco{
width: 70%;
}
this both classes are enough
random suggestion
a button on the template sheet to dupe components on click would be great.
you can drag components around the sheet by click dragging them. If you do so with the CRTL key held they are duplicated. you can drag things between sheets and into and out of panels.
found this two minutes ago and felt like I had found burried treasure. lol
if you do duplicate you do need to change keys and the like as they now have the "copy" added to them. so double check the setting in your duplicated components
thanks
Its suposed
to:
%{
let msrt = ${idk}$;
}%
Assign the ${}$ variable to a js variable.
Has the way this is done changed in the update?
${}$ returns a bareword in script-context, so you should add quotes when working with strings
idk its a number
Then it should be fine. That's a valid assignment
then why isn't
let mstr = ${mstr}$;
the or
In fact, I think I know why, wait
yeah, mb
Could you help me with that?
let efrt = (actor.flags.world?.tvaCounter ?? 0);
i dont remember how to define the actor, lol
done by a separate macro
Context is important. So, which Actor?
I already solved
thanks for the help
If I remember correctly, there is a way to do a simple conditional using ${}$
i want to make a simple if
<condition> ? <true> : <false>
This is the general syntax of the conditional statement.
thanks
I am trying to get multiple pieces of data from a user to use in a formula.
I need them to tell many how many dice they wish to roll and what the target number is.
I then use that to make the roll.
I know you can concat to create several querries on one dialogue and you can call a custom user interface template to do so as well.
What I want to know is how do I access the individual inputs to use the data the user provided?
I would liek to do this in one single dialogue, I can do it in several but I am having a hard time figuring out how to do it in one.
my formula is:
%{const tn = ${?{tn:"Target Number: "[number]}}$;
const rating = ${?{dice:"Number of Dice: "[number]}}$;
const formula = `{${Array.fromRange(rating).map(i => "1d6x").join(",")}}cs>=${tn}`;
return new Roll(formula).toMessage();}%
so this give me two different dialogue boxes and I would like just one.
maybe this?
yes that is the concat method, but what I need to know is how to use those variable that it collects in my javascript
ah
look at the mstr variable
And help me here lol
two buttons would work yeah, but i want just one.
That change the day to night.
just a silly example
the first condition works only when estado=true
idk what i did wrong but it doesnt change the property if "estado = false"
is estado a key for a component of something?
its a checkbox
