#Custom System Builder
1 messages · Page 41 of 1
I did that (I had "[1d20] + agility" for instance) and it didn't seem to work.
wait, that does seem to work actually
thanks
maybe not, oops
(don't worry, when I was testing it just there, I did the same thing ;D)
(Forgot to save )
now better question - let's say I have two stats that I'd want to influence initiative, but only take the higher one. Is there a way to do that?
max(x, y)
Or that
ah, so for example: [1d20] + max(athleticism, agility) works?
If athleticism and agility are both numbers, yeah
rad, thanks!
this system rules, man
It definitely does :D
soo many options
If I wanted to use Illandril's tooltips with this, what should I put at the start at the bottom?
The path is correct if the component key is totalhp
I have it as a attribute bar
system.attributeBar.totalhp.value
I'm back again with another question! xD
I'm trying to make this Label sum all of the value fields of a Dynamic Table ONLY IF they are marked with the correct dropdown:
Ascendant:${sum(fetchFromDynamicTable('CCResTable', 'ResTier', 'Ascendant', Reduction))}$
The idea is that every entry of the dynamic table is a source of armor, and each has a dropdown saying what type of resistance it is.
I want all of the resistance of each type to be picked up by labels above the table showing the total resistance of each type that a character has.
If I do: Ascendant:${sum(fetchFromDynamicTable('CCResTable', 'ResTier', Reduction))}$
the label simply sums all of the values of each entry, despite the type of resistance, of course. I don't know how to specify the dropdown as a filter.
Do you have an example-row of a table with column-keys?
Or actually, are ResTier and Ascendant column keys?
ResTier is the value
Ascendant is supposed to be the displayed resistance that this label is grabbing.
So, are ResTier and Ascendant column keys of the Dynamic Table?
Ascendant is the key I want it to pull from the Dropdown
${sum(fetchFromDynamicTable('CCResTable', 'ResTier', Reduction))}$
Which is why I did this first, but of course, with no specification it will just sum all of the entries
But I don't know how to do the specification to filter by dropdown selection
so I added Ascendant to it just to see what happened.
Because you haven't specified, after which column you want to filter
So I add the column name of the dropdown?
Of the Dynamic Table
Right, and you have to define one of those column by giving the column key
Column Name (optional) is the column key? Or are you talking about Resistance
Which is the key of the dropdown
When you create a Component in a column, the column key equals the Component key
So this?
${sum(fetchFromDynamicTable('CCResTable', 'Resistance', 'Ascendant', Reduction))}$
Resistance is the dropdown key, Ascendant the component key of the dropdown which I want it to pull from, Reduction the value.
If I want to sum the weight of all rows, which have location == 'Backpack', the formula would be sum(fetchFromDynamicTable('Inventory', 'weight', 'location', 'Backpack'))
oh, okay, so the order is wrong
${sum(fetchFromDynamicTable('CCResTable', 'Reduction', 'Resistance', 'Ascendant'))}$
Got an error. I'm trying to see if there are any mistakes.
There is
I was using another table key that I was using this for before by accident
Beautiful
It was just the order then
I understand how the order is meant to be now
Thank you!
If there's anything I can do for you just tell me! You help folk plenty here.
Yeah, because you can have only 2 args in this function, which would take all values within the column
That's why the second arg is always the target column
Okay, I'll note it down here.
So I don't forget
Just mentioning
Is the a way to create a label roll that copies a content to the clipboard?
Thanks
I've got it. Beware, it's technical, long and I have 3 workarounds
The issue is that Foundry tries to re-render the sheet on every item update, but cancels rendering when another rendering is already taking place. The values in the items are correct, the values in the actor data are correct as well, but since multiple items are being updated sequentially and rapidly, when the last render triggers, the one with all the right values, another one is in progress and the last render fails.
Now you have three options :
-
(Potentially slow, but clean) Update every item without rendering, wait for all updates to be done, then re-render the actor AND all the items
-
(Might be faster, but a little dirty) Trick Foundry into thinking the actor is rendering to prevent it from being rendered, then reset the value and trigger a manual render
-
(Cleanest, and I think fastest, but complex due to document deletion) Update all documents in your actor at once, to trigger only one re-render
This is the code for solution 1 :
${#setPropertyInEntity('self', 'THP', 0)}$
${#%{
const promises = [];
const itemToReRender = [];
const itemTemplateName = 'Ability Template';
const itemTemplateId = game.items.getName(itemTemplateName)?.id;
if(itemTemplateId){
entity.items
.filter(item => item.system.template === itemTemplateId)
.forEach((item) => {
const newCd = Math.max(item.system.props.readyIn - 1, 0);
itemToReRender.push(item.id);
promises.push(item.update({'system.props.readyIn': newCd}, {render: false}));
});
}
const statusTemplateName = 'Status Effect Template';
const statusTemplateId = game.items.getName(statusTemplateName)?.id;
if(statusTemplateId){
entity.items
.filter(item => item.system.template === statusTemplateId)
.forEach((item) => {
if (item.system.props.duration == 'Turns') {
itemToReRender.push(item.id);
const newCd = Math.max(item.system.props.turnsLeft - 1, 0);
if (newCd === 0) {
promises.push(item.delete({render: false}));
} else {
promises.push(item.update({'system.props.turnsLeft': newCd}, {render: false}));
}
}
});
}
await Promise.allSettled(promises);
entity.render();
entity.items
.filter(item => itemToReRender.includes(item.id))
.forEach((item) => item.render());
return '';
}%}$
Character Activated
This is the code for solution 2 :
${#setPropertyInEntity('self', 'THP', 0)}$
${#%{
const promises = [];
entity.entity.sheet._state = 1;
const itemTemplateName = 'Ability Template';
const itemTemplateId = game.items.getName(itemTemplateName)?.id;
if(itemTemplateId){
entity.items
.filter(item => item.system.template === itemTemplateId)
.forEach((item) => {
const newCd = Math.max(item.system.props.readyIn - 1, 0);
promises.push(item.update({'system.props.readyIn': newCd}));
});
}
const statusTemplateName = 'Status Effect Template';
const statusTemplateId = game.items.getName(statusTemplateName)?.id;
if(statusTemplateId){
entity.items
.filter(item => item.system.template === statusTemplateId)
.forEach((item) => {
if (item.system.props.duration == 'Turns') {
const newCd = Math.max(item.system.props.turnsLeft - 1, 0);
if (newCd === 0) {
promises.push(item.delete());
} else {
promises.push(item.update({'system.props.turnsLeft': newCd}));
}
}
});
}
await Promise.all(promises);
entity.entity.sheet._state = 2;
entity.entity.render();
return '';
}%}$
Character Activated
This is the code for solution 3 :
${#setPropertyInEntity('self', 'THP', 0)}$
${#%{
const toUpdate = [];
const toDelete = [];
const itemTemplateName = 'Ability Template';
const itemTemplateId = game.items.getName(itemTemplateName)?.id;
if(itemTemplateId){
entity.items
.filter(item => item.system.template === itemTemplateId)
.forEach((item) => {
const newCd = Math.max(item.system.props.readyIn - 1, 0);
toUpdate.push({_id: item.id, 'system.props.readyIn': newCd}):
});
}
const statusTemplateName = 'Status Effect Template';
const statusTemplateId = game.items.getName(statusTemplateName)?.id;
if(statusTemplateId){
entity.items
.filter(item => item.system.template === statusTemplateId)
.forEach((item) => {
if (item.system.props.duration == 'Turns') {
const newCd = Math.max(item.system.props.turnsLeft - 1, 0);
if (newCd === 0) {
toDelete.push(item.id);
} else {
toUpdate.push({_id: item.id, 'system.props.turnsLeft': newCd}):
}
}
});
}
let deleteTriggerRender = false;
if(toUpdate.length === 0){
deleteTriggerRender = true;
}
await entity.entity.deleteEmbeddedDocuments("Item", toDelete, {render: deleteTriggerRender});
await entity.entity.updateEmbeddedDocuments("Item", toUpdate);
return '';
}%}$
Character Activated
This works great! Thank you. I didn't want to try solution 3 since I have triggers on deleting items that would need to be suppresed, but 2 works correctly
I would have never managed this on my own
@brittle moth if you don't mind, I'd like to ask you if there is a way to understand why while we refresh a character or an item it takes multiple times to compute them, even when they say it was computed successfully every time and how I can prevent or avoid this if possible
I believe the problem is probably on my end, but it doesn't hurt to ask 😅
this
I also used the await Promise.all(promises); tech in my module code and it's working correctly. Can't thank you enough.
Be careful with solution 2, if there is any issue, the sheet's state will remain modified and the sheet will no longer render ever, except when reloading the page. I would really recommend solution 1 if you can't use solution 3
Hello 🙂
This is Foundry's inner workings, I don't control how often items and actors are recomputed. They announced an optimization for this in v13, but this will stay like this in the meantime, sorry :/
As for the why, I think every time you update an actor, it refreshes its items since their values may depend on the actor, then the actor again to take all the new values of the items into account.
Thanks for replying! I may not have expressed myself correctly 😅 is there known practices that trigger this type of behavior? I mean, should I avoid anything in particular?
Cause this "number of loops to compute" and how often they appear/repeat seems to vary a lot from user to user.
Thanks for taking the time 🙂
Ah :
The "number of loops" in the message is an indicator of the optimization of your sheet. The less it is the better, more means the system needed to circle back to some formulas because everything was not computed in order. The base idea to reduce this is to avoid using computation results in other formulas (i.e. avoid computing a label, and using that label in another formula).
I have some ideas to optimize this, but it is not easy ^^"
The number of times the line triggers is due to foundry, and I don't know how to reduce it 🙂
Good to know. In terms of performance, is there any recommendation regarding using one type of field instead of another? Like, for example... Labels have a lot of functionalities in comparison to the text field. Does this type of choice have a noticeable impact in performance?
Not really
You should avoid giving a key to your labels when possible, that way they are only computed at render time, but it also means you can't use the label's value elsewhere
Apart from that, the gain is negligible
Seem to have lost the interactible points for the blank Labels in the row between Race and Hair... any ideas how to get them back?
I'm very confused. Trying to set up a equip/unequip option on an equipped items panel and a carried items panel (and keep talents and such from showing up in a general carried items panel). I am having a hard time setting the filters on the specific containers. Found a reddit post, but the UI for specific item filters/operators has changed. How do I enter them now?
In other words how do I enter an Item Filter Formula with a Field Key, Operator, and Filter Value?
You now do it with regular formulas (e.g. item.equipped if equipped is a checkbox in the Item, or equalText(item.state, 'Worn'))
Oh it's that simple? Thanks.
Is there a way to set a false entry, so the checkbox in the item can be for equipped?
Sorry I'm not really a coder, and I'm new to all this.
not(item.equipped)
Awesome! Thank you so much, I think I've figured it out!
And...well, one more question. How do I use the not(item.equpped) with multiple things, like not(item.armorequip) not(item.weaponequp) not(item.talent) etc.
I have tried and and or and neither seem to work with a list of filters.
Nevermind I think I've figured it out.
Oh, didn't know that! Nice! thanks!
Hey there. I've been looking for a way to build a custom sheet and stumbled upon this system. I basically need a sheet with a meter/clock/bar/whatever you may call it that can only be increased/decreased by the player via buttons (+1/-1 for instance) and every change gets logged in the game chat (not the total, just the change. Like "player X has increased Stat Y by 1"). Is there a way to do something like that with this system or should I look elsewhere?
It's doable with a bit of effort, but you'll need more than only 1 Component. Probably 1 Number Field and 2 Labels
That's fine. As long as it's doable. I'll try to figure it out or GPT my way through it. Thanks!
GPT won't help much because of missing context. It might only help with pure JS without any or small dependencies to the API
Then it's looking like I might just have to try making an independent system. I just need this one mechanic, so maybe it shouldn't be too hard to GPT it.
I have this to do "+1" of quantity when I click inside an item's quantity in an item displayer, but could I make it a popup to enter a value and this would replace the value?
+${item.name}$${setPropertyInEntity('item', 'Quantity', "item.Quantity + 1")}$
I would need a "when click => popup => enter value => replace previous value with entered value"
hey what's the function that replaced fetchFromDynamicTable?
amazing, thanks!
lookup()
bet ty
another question, this is set as GM only, why is my player able to see the component's name?
they can't see the value ofc, but I don't want them to see the title either
Because you hide the rows, not the actual whole column
These are 2 different things
is there a way to hide this?
Nope
😭
It's simply not implemented 😅
it's quite bothersome tho, if I wanna hide a value named "rarity" for an item and only let a player that has crafting skills see it, everyone will see the "rarity" empty tab :(
I think I need some help
I just updated my CSB and I'm trying to translate my old fetchFromDynamicTable formulas to lookup, and from what I'm seeing on the gitlab it looks like the formulas should function pretty much the same as they used to, but I'm still getting errors
current formula ${lookup('ARCANA_table','ARCANA_combat','ARCANA_name',ARCANA)}$
the attached image is the ARCANA_table, and directly above said table is a dropdown menu keyed ARCANA
this formula did work once upon a time, and all I've changed about it since updating is the function name itself
What kind of error is shown?
it literally just says error in all caps on the actor sheet. Or are you asking about the console?
Yeah, console
one sec
Because only the console contains the explanation
I'm actually not seeing an error related to this in my console
I'll hide it through CSS ig then
that's just extra work to make everything at its correct place
welp
not a solution
because it hides the data that's already hidden
not the row title
💀
yeah I'm at a loss here. I can't figure out what isn't working. Triple-checked all the spelling and I'm not seeing a console error
huh, I may have found the problem. I deleted the label component that was using the lookup function altogether and when I updated the actor sheet, the slot where that component was was still there and still said error. Might have a corrupted actor
yep that was the problem
How can I check a user's role? Like for example :
if (player_role == "Trusted_user") { return 0; } else return 1;
game.user.role >= CONST.USER_ROLES.TRUSTED
${game.user.role >= CONST.USER_ROLES.TRUSTED ? item.rarity_choice : '???'}$
I tried this and it sent errors everywhere
Because that's Javascript, CSB Formulas don't know anything about roles
then should it be like this?
${%{game.user.role >= CONST.USER_ROLES.TRUSTED}% ? item.rarity_choice : '???'}$
You forgot a return, but yeah
the return is at the end tho
I tried to apply a css in prefix for specific roles, but it returns an error :(
${%{game.user.role >= CONST.USER_ROLES.USER}% ? <div style="font-size:1em";> : <div style="font-size:0.7em";>}$<div style="margin-top:-10px";><div style="margin-left:-10px";>
That one %{game.user.role >= CONST.USER_ROLES.USER}% still doesn't return anything. It is as effective as this function here:
sum(a, b) {
a + b;
}
const result = sum(3, 7) // returns undefined
What you actually want:
sum(a, b) {
return a + b;
}
const result = sum(3, 7) // returns 10
${%{game.user.role >= CONST.USER_ROLES.USER {return true;} else return false;}% ? <div style="font-size:1em";> : <div style="font-size:0.7em";>}$<div style="margin-top:-10px";><div style="margin-left:-10px";>
with Active Effect Displayers, when I put in the attribute key, that can just be the key to a label I'm using to display a stat score, yeah? and then the effect value should apply to that label automatically?
like this?
A bit careful with that, because Active Effects affect the data of the whole actor. So you need to prefix your key with system.props. to work properly
${%{if (game.user.role >= CONST.USER_ROLES.USER) {return true;} else return false;}% ? <div style="font-size:1em";> : <div style="font-size:0.7em";>}$<div style="margin-top:-10px";><div style="margin-left:-10px";> *
corrected
Rather this:
%{return game.user.role >= CONST.USER_ROLES.USER}% // returns either true or false
oh
Comparison operators already return a boolean
bet ty. Is there a way to store active effects so I can drag and drop them onto actors instead of writing them out each time?
Not really, besides on other Actors maybe
sadly, this works:
${%{return game.user.role >= CONST.USER_ROLES.TRUSTED}% ? item.rarity_choice : '???'}$
but this doesn't work:
${%{return game.user.role >= CONST.USER_ROLES.TRUSTED}% ? <div style="font-size:0.7em";> : <div style="font-size:1em";>}$ <div style="margin-top:-10px";><div style="margin-left:-10px";>
Let's say I have a dropdown menu with it's name in the label. Would it be possible to determine the space between those elements of the dropdown menu?
Hello, is there any way to clone objects within the sheet template?
Thank you so very much.
In the mean time I managed to get stuck on trying to make a roll under formula.
My goal is to make a 1d100 roll + a modifier and check if it's lower or equal than a value or not and based on that write out that the roll succeeded or failed but so far no way I tried worked.
Okay why do I get "undefined" from this?
${string(item.id)}$
This one works fine but I am unable to get the items id into text 🙃
${item.name}$
"item.id" gives error btb
(Doing this to get Automated Animations working btw, they activate on the items id in a chat message)
quick question but does anyone know what the %{}% equivalent of ${setPropertyInEntity()}$ is?
Because the id is not within the item props (only in the column of the Item Displayer). ${sameRow('id')}$
${[1d100] + mod <= value ? 'Success' : 'Failure'}$
Because your div and style are treated as variables, not as strings. You forgot quotes around them
bless ive been looking for a guide like this
Followup question, whats the equivalent ref for ${item.key}$ when using %{}% in an itemdisplay?
linkedEntity.system.props.key (there's also the entity-object): https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#33-script-expressions
I am unsure how an item can have an id but it not being a part of said item but that works. Thank you!
Because formulas are scoped at item.system.props, but the id is at item.id, so it's out of scope. The Item Displayer on the other hand contains the id in the column-data
I'm assuming that's CSB specific and not a part of standard foundry, or?
Might be a silly question but is there a method similar to update which is a getter that uses a string id? I ask because I am using a bunch of props that follow the same pattern [stat_name]_exp. My solution rn is to used a bunch of parallel arrays but id really like to do something along the lines of
key = "system.props.".concat(stats[i], "_exp) entity.entity.get(key)
instead of this horrendous
Right
foundry.utils.getProperty()
This is exactly one of the things I tried but my dumb ass put in double quotes instead of single quotes. 🥲 Thank you very much for your help. 🫀
Double quotes are also valid
Then I have absolutely no idea what was different because I think it was identical... Maybe there was a typo I'm too clueless to notice. 🤔
do you know if this is more or less performant than just using eval()?
I don't know the details, but I think it's faster, because eval() takes quite some time
is this the correct usage of this? Im getting NaN now where I was getting the proper result with eval()
same with this
Is there some way how it would be possible to use the same roll multiple times in the output? If I just input the roll again in the second spot it simply rolls again and gives a different result.
${var:=[roll]}$
creates a localVariable with the value stored in var
Thank you so much. Me sticking in @ in places I think it might go without knowing what it properly does isn't really paying off. 🥲
If I receive an error in chat from a Formula I created, is there some way to view what the error is? Some kind of a debugger of sorts?
f12 -> console
dont worry i didnt know this for the longest time either. it was a nightmare
Hopefully now I can bug people less with absolutely primitive questions. 😅 Thanks again.
Im so confused. I have the following code inside a %{}% to start replenish actor's resources when the hooks fail. However, Im getting this error. Does the return value have to be a string or something? Why is it trying to cast my return as a number?
I have other buttons that return strings and they work perfectly fine
dwbi, I didnt know this until I asked this discord. Im just sharing the knowledge Dx
Probably the unescaped quote (see formula in error message)
Concat it twice? It doesn't like the Text "It's" you have at the start of result. Yeah nevermind, apparently it's interacting a double quote with a single quote or something since it only references It and not It's
Just to quickly bugtest remove 's from both sides and see if it works.
yeah it does
You escaped it in JS, but not in the final output 😅
Can you post the working version? I'm curious.
i had to escape those \ in order to type it🤦♂️
oh yeah that makes sense
theres no actual issue with the ' in the js
@formal goblet Any idea why this doesnt work? The foundryvtt api doc is pretty barren, and either of these 2 feel like the correct use case - neither of them work (both return NaN)
Asking in the system-dev chat as well
I'd say try experiment in the console
I don't see an issue there aswell
I probably have another simlpe thing, but I can't quite figure it out.
I have an itemDisplayer set up. I have a list of Keywords that exist as a Text Field .
When I try to pull from the text field to slap it into the table, I only get ERROR in the display, though.
The item text field is keyed as weapon_keys_list
The itemDisplayer column draws data from it:
${item.weapon_keys_list}$
I literally draw another key in the next column with exactly the same code but somehow it does not like the keys list 😦
Anyone got a clue?
is it blank?
At least one entry being referenced has content in it.
Do the keys match exactly (no typos)?
I copied it over, but lemme try again to be sure
I have no idea how or why but it seems to work now 👀
I copied it over before and all. Checked four times to be safe. 🤦♂️
How can I suppress formulas so that they give no output?
I want to make the roll and put it in a variable which I can show later without the original roll output being shown.
Prefix it with #
${#roll:= [1d100]}$
${#myRoll:= [1d100] + 2*STR}$
Didn't seem to work. Still outputs the roll at the start in chat.
Then it's because of your settings. Or you forgot to update your sheet
My settings?
Yeah, you can show hidden messages as GM
This was actually the case. I'm dumb. 😅 Thank you very much for your prompt help!
I don't know if it's a bug but it seems that if your original formula contains the character < and you turn on Rich text editor that character will be changed to < which breaks the formula.
Yes and no. It does what you'd expect it to do, but not in the way you'd like
Because the RTE works with HTML and < is a html-specialchar, so it has to escape that
Alright, glad that it's known to everyone and me too now. 😅
That's one of the edge-cases without a real solution
Would scanning the entire text and replacing < for < break something? I'm not sure if it's used somewhere in HTML because in the rich text editor it seems to be parsed correctly. The issue only occurs when the rich text goes back to the regular text editor.
What is the correct approach to packaging CSB templates and Actors/Items based on those templates into a module compendium?
I noticed that when exporting templates as json, some properties are not saved: filters on item displayers, sheet display.
When importing an item based on a template from a compendium I must first reselect the correct template after importing for it to work properly.
Is CSB only meant to be setup on one world? I would like to create a module that contains all information relevant for my custom system in the module's compendium and import it on module load into a new world with CSB.
This seems like a thing someone may have already done (some script maybe?)
Hi all, anyone know how I can make initiative query the player rolling it for what die they want to use? Kind of like in hackmaster where different initiative die are used. Giving them the option to choose between a number of die, then roll that with their initiative modifier added on?
this still gives out errors:
${%{return game.user.role >= CONST.USER_ROLES.TRUSTED}% ? '<div style="font-size:0.7em";>' : '<div style="font-size:1em";>'}$ <div style="margin-top:-10px";><div style="margin-left:-10px";>
Which one?
Can you replace the script with a boolean for testing?
I just fixed it by doing the condition inside a hidden label and using this label inside the div
<div style="font-size:${finitionaspect}$em";><div style="margin-top:-10px";><div style="margin-left:-10px";>
and then the label is set at the bottom, hidden as gm only:
${%{return game.user.role >= CONST.USER_ROLES.TRUSTED}% ? '0.7' : '1'}$
I can give a few advices:
- Separate Templates from concrete entities. I've packed Templates into an Adventure pack, containing 2 packs (Actor Templates and Item Templates). The import order should be ItemTemplates > ActorTemplates
- All concrete entities are packed into their corresponding pack (Actors to Actor-packs and Items to Item-packs)
With this strategy, I didn't have any issues with imports into new worlds.
Just curious, like a year ago I remember there being a feature poll where being able to put items inside of other items scored pretty highly. Is that still on the docket for development or is that feature no longer in the works?
pogging right now
Is there any way to make an actor sheet non unique? Like for example have three "Chest" actor in the scene, with three different tokens, each opening a different version of the original "Chest" actor sheet, just like items do
I'm missing something here and I simply cannot identify it 😩 . This script returns 20-1 instead of 19 which breaks the numeric field of the item (NaN). I need help to correct this please:
%{ const itemID = '${sameRow('id')}$'; const item = entity.items.find(item => item.id === itemID); const value = Number('${sinal_proj}$'); if (item) { item.system.props.item_qtd += value; await item.update({ 'system.props.item_qtd': item.system.props.item_qtd}); } else { console.log('Item not found'); } return item?.system.props.item_qtd ?? ''; }%
Context: This is being triggered as label roll from an Item Displayer
Prototype Token => Remove Link Actor Data
You can skip the first 2 steps by using linkedEntity
What contains value?
It's being declared only in that instance of the script. sinal_proj is located in the character sheet
And what does that contain?
A label that switches from 1 to - 1 depending on a check
${check_proj_gasta ? 1 : -1}$
So value is either 1 or -1
Yes, at least for now
Make sure to cast item_qtd to a number aswell
Hey Everyone, small question about Custom System builder: does anyone know how to make sure that my item displayers don't all display the same thing? As in I have 10 item displayers and when I put a test item in 1, all of them are displaying it and when I romove it from one, it gets removed from all of them as if they're the same displayer
Setup filters in the Displayer, so they don't show all the same Item
In what way should I set it up? Like is there a specific formula I should put in?
That depends on what criteria you want your Items to show
You can begin by checking the Template Filters, so only Items of the corresponding templates will be shown. The formula below is an additional option to finetune your predicate
I'll show what I mean:
I have my own ttrpg that I'm gonna test. It has different level point actions, so what I want to do is to add different actions to each item displayer. Sadly enough, when I add it, they all show up. Same with deleting. Is there something specific I can do or do I need to make a template for each and every type of point action?
Not necessary. If you create a field in the item with the type, you'll be able to filter by that type by using an item filter formula.
Is it possible to make something that players can mark like favorite so it shows up in a different item displayer?
Thanks! That solved it
Yeah. You can have multiple criterias. All we care is, if the formula resolves to true or false at the end. true for display and false for no display.
in this case linkedEntity.system.props.item_qtd wouldn't require me to find the item before
is it possible to access every prop using this? const item = linkedEntity.system.props would work to target every other prop if I need?
Log it and see it for yourself
Is it somehow possible for a formula to adjust values within the character sheet? For example when I make a roll if the roll is bigger than some value I would add +1 to a number field?
setPropertyInEntity() can do that
Hm... Ok, I'll try to figure that one out. 👀
That was easier than I expected. 😅
Now while I'm here I started thinking ahead a bit:
I'm planning on making several tables worth of skills with 4 collumns for each skill (Roll button, Name, Value, Checkbox)
I am currently intending to just manually fill out all of the fields with the appropriate names and everything but is there a smarter way which might allow me to for example copy the roll button and it would automatically check the appropriate row it's in (The one where the roll button was pressed) and then just digs out the information it needs from there? (To avoid having to do it all manually with explicit names and codes and everything.)
This is somewhat also touching on relative table navigation because with the checkbox collumn, that's intended to be a learning checkmark similar to games like Call of Cthulhu, where if you fail a skill, you may attempt to train it after the session to increase the value.. Since I would like to have a single button to trigger all checkboxed entities and run them through an automated leveling up script, which direction should I look for this kind of data management if it's possible?
Get in touch with Dynamic Tables, sameRow() and lookup()
It's not supposed to be a dynamic table though. It's meant to be static. The amount of skills won't change throughout the entire game. It's just a list where values will change around.
At least I THINK that means it's not a dynamic table.
You can setup predefined rows and block adding/deleting for players
Is there a benefit to using Dynamic Tables here because the list I'm imagining is not intended to be changed. Just the value of the third collumn for each skill. 🤔
There are multiple benefits:
- All formulas are defined only once per column
- You don't need to define a multitude of keys
- You can get data of neighbouring columns easily
- You can perform lookups on that Table
Hmmm... Ok that does sound useful but if all formulas are defined only once per column I need to add an extra column there. 🤔 You convinced me, I'll look into it. Thank you!
Is there a way to use a different css class for the panel tab? Because right now it uses the same as the token panel tab and this is quite troublesome..
https://gyazo.com/20b0aa58c8f6f511413637666839afc0.mp4
.sheet-tabs .active {}
or maybe .sheet-tabs a:hover {}
Those are the only two I've used so far, to avoid messing with the control panel
is there any "If" check?
Like Google Spreadsheet:
IF(blablabla;1;1)
Also, is there any way to "ctrl + c" "ctrl + v" to quick paste same elements?
i need to fill all those.
the best way i found is to make a subtemplate, put it in there and then move from subtemplate into template
Quick question for anyone who knows how to use the additional CSS styling / any front end devs. How do I add a simple border to panel? I thought it would be something like this but I legit have 0 clue in this regard
Only classes are allowed there, you cannot insert CSS-Properties.
To define your own classes, you need either the CustomCSS module or provide your own file and reference it in the game settings
Is there anyway to change the Resource Bar icon? like adding an shield icon for a Armor Class bar and etc?
I am so close to finishing my project, all I now need is Jb2a.
I am able to activate the animations by adding their ID manually like this:
<div data-item-id="wxfmcsewxxBgWeix"> </div>
However, all my attempts to automate the recognition has failed like this:
<div data-item-id=${string(sameRow('id'))}$> </div>
printing:
wxfmcsewxxBgWeix> to chat
Any idea how I could add the value into the div? Wether direct or indirect
<div data-item-id="${!sameRow('id')}$"></div>
I was missing a "!" ??
What the heck does a ! do??
Also, thank you so much 💜
Is there any way to check variables?
like in this test, i want to my Total skillcheck changes the totalvalue based on the atribute i change
So if its "Força" (STR) it will calculate with the strmod
so if its "Destreza" (DEX) it will calculate with the dexmod (atribute modifier key)
ref(concat(toLowerCase(dropdownKey), 'mod'))
Replace toLowerCase() with whatever the mathjs-library suggests (I don't know the function name out of my head)
kinda confusing for me but i am gonna try it there
Actually, what are your keys in the Dropdown?
Why the prefix with mod?
to identify as modifier
And the target components are strmod, dexmod, etc...?
yep
You have modfor and strmod? 😅
both needs to be the same?
It would make everything easier, because you would be able to do ref(dropdownKey)
Otherwise you'll need additional mapping-rules
this question might be dumb, does the command goes on label?
Wherever you need the value to where your Dropdown directs to. And replace the old formula of mine, because that is probably invalid.
ok
Hello, good evening!
Is it possible to create an itemDisplayer and leave it with the option for players to register their own items directly on the form?
If not, I have to leave all types of items pre-created.
Nope. But you can give your players the permission to create their own Items in the Directory
Absolutely apropos of nothing: I recently found a group of players interested in playing Ryuutama. The game seems seriously unrepresented in terms of Foundry, so I went and threw together a super basic character sheet for it. I more or less just copied the sheet in the book, there's no automation at all, it's all just text entry. But, now it exists, so if anyone else also randomly wants to play Ryuutama using Foundry... Here you go
I'm def going to tinker with it until the game starts, so... Yeah
Once I figure out how to do formulas in the V12 update
My very fancy Break!! sheet's (made in V11) automation is completely broken ><
Can i use a label button to modify the value of other labels?
E.g. make a rest button that increases HP by 5, or a level up button that increases your level by 1
I have this currently, and it's just spitting out the new value to the chat or if send to chat is disabled it does nothing - no errors:
${xpValue>=requiredXP ? (milestoneValue>=requiredMilestones ? setPropertyInEntity('self', levelValue, levelValue+1) : notify('info', 'You Do Not Have Enough Milestones')) : notify('info', 'You Do Not Have Enough XP')}$
setPropertyInEntity() only works with Input Components, so Labels are out.
What is the component ActiveEffectsContainer? I could not find its documentation.
You can display / edit / create Active Effects. That's it. Everything else is Foundry standard and should be taken from the knowledge base.
If I want to pass a skill value to a macro for it to use a Target Number would the following allow me to do so
${# %{return await game.macros.getName('COPS Roller6').execute({ skillPath: "system.props.Melee_Score" });}%}$
%{throw "Done";}%
I am getting an uncaught promise error and the TN is not updating (everything else works)
If there a way to implement an easy if/else within the system formulas?
Thanks! Hadnt found that one, my bad! 🙂
Well, you passed a string to the Macro, but that's it. Correct would be ...execute({targetValue: entity.system.props.Melee_Score});
And the thing causing an error is your last part with the throw.
While you are looking in here, I got another quick question since I am not quite understanding it.
If I have a dropdown list, how do I look up which is the currently selected one?
Like... I need to reference a key based on which is selected but I can't seem to figure out how to get the data
Do the option keys of the Dropdown match your component keys?
This is the dropdown - not sure what you mean with matching the component keys? 😬
What do you wan to do, if e.g. type_static is selected?
Concrete example of what I want to do:
A weapon has a specific key that does less damage if the target has type_hv_vehicle
So I need to query what type is currently selected and return that, so I can then use the ternary operator you just linked me to set the yes/no on whether I have to change the attack formula
The dropdown returns the selected option key. That's the default behavior.
So fetchFromActor('unit_type') will return, say, type_hv_vehicle ?
Yeah
is there another function I should use?
or maybe a different data storage method?
Labels are unchangeable by players regardless of the method you use
So yeah, store it in an Input Component
Guys, how do I create a dynamic table with a roll to chat button and use a value from the table itself in that button?
alright, i'll hide a number field and have it displayed in the label :I
Is it possible to prohibit players from edit text fields in items added to their sheet? If not, is there an alternative to solve that problem, like changing the permission to observer for items added to owned sheet or something similar?
Items added to Actors share the same permissions as the Actor. That's how Foundry handles it.
The only solution would be to display only Labels to players and everything else to GM only
You use sameRow() to fetch data from the same row
Unfortunately that adds computing steps sometimes loops 😕
Yeah, but the dependency depth is only 1, so it's not much
One for each field in each item for each player ... That's how I solved that huge list of computing loops, exposing everything
Let's consider another approach, a dynamic table that has @uuid[item] in a rich text input column
Is it possible (how) to reference that item if that's the only thing written in that column-cell?
Only via Scripts, because CSB doesn't offer anything to fetch something from the directory
How complex would that be?
Too bad I probably lack fundamental knowledge to deal with that... Got myself in an endless loop trying to await a synchronous function 😮💨 geez
The amount of issues surging from that wth
hey, folks! how do I change font for header type text labels?
is it me or number field can't handle negatives?
everytime I hover the mouse it duplicates the current value
Disable relative modification if you expect negative values
oh
ok, thank you!
there is no easier way to create sheets on csb is there? like a graphical-based interface?
even duplicating items would work for me 😄
It has already many graphical elements to create one 😅
CTRL + Drag lets you copy Components
WHat is the recommended way to create ininventory element for players who'll write items manually?
like
i don't have an items list
this is my current solution
I guess it does it
i've been tweaking the formula but i'm getting errors.
I've changed levelValue to a number field, and here's the adjusted code:
${xpValue >= requiredXP ? (levelValue == (ceil(ref('levelValue')/5)*5) ? (milestoneValue >= requiredMilestones ? notify('info', 'Congratulations! You have leveled up.') setPropertyInEntity('self', levelValue, levelValue + 1) : notify('info', 'You do not have enough Milestones to level at this time.')) : notify('info', 'Congratulations! You have leveled up.') setPropertyInEntity('self', levelValue, levelValue + 1)) : notify('info', 'You do not have enough XP to level at this time.')}$
Yet, I get errors to do with converting levelValue and 'Congratulations! You have leveled up.' to numbers regardless of how I place the 's.
I think maybe it's another error not showing in console but have no idea how to trace that
It's about this here. This constellation is not allowed.
The only things allowed if you have 2 values x and v:
- Function arguments:
sum(x, y) - Operands
x + y
This here x y doesn't specify, what you want to do with these 2 values.
Hi there ! I'm beginning with the system and trying to add attack rolls to my character sheet 🙂
I'm actually struggling to get the roll to be made against the target's evasion. I got my roll up to something like that:
${[1d20+${rollModifier}$]}$
However, as soon as I try to add a cs clause to the roll, it stops working. I've tried something like this:
${[1d20+${rollModifier}$cs>=${targetEvasion}$]}$ but then my roll doesn't work anymore.
Any idea on what I'm doing wrong there ? 😅
I got an idea of why it doesn't work. The formula 1d20+2cs>=10 actually doesn't work in foundry, as it considers that the cs command is part of the modifier, so it doesn't recognize it...
If I find a way around it, I'll keep you guys posted 🙂
Is there a way to update the current selection of a drop down? When setting the key using setPropertyInEntity, it doesn't seem to update properly on the sheet, showing the first option selected instead of the updated key being selected.
Only works with non-numeric option keys
Besides that, it should work
Ah, well I'm using numeric options keys. An easy change! Thanks!
Is it possible to change the name of an actor using setPropertyInEntity (or any other way)?
Only with a little Script, because the name is stored in actor.name. actor.system.props.name is just a auto-generated copy.
I actually get an "UncomputableToken" error when I try to set the dropdown key with setPropertyInEntity with the formula being non-numeric.
${setPropertyInEntity('self', 'colorDropdown', 'green')}$
results in
Uncaught (in promise) Error: Uncomputable token "green"
whereas something like
${setPropertyInEntity('self', 'colorDropdown', 3)}$
Works in that the property gets updated but doesn't update the dropdown selection and upon closing the sheet the value is reverted to whatever the first key is.
Thank you! It worked with a script.
Do I understand it correctly that a regular table can't be searched through by rows/collumns, only Dynamic Tables?
Apart from that it seems that a Label in a Dynamic table can't really be edited in any way. Just says "Label" there.
You have to double-quote the last one, because it will be reinterpreted by the formula system:
${setPropertyInEntity('self', 'colorDropdown', "'green'")}$
- Yep
- Also yep, because Labels are always automatically adjusted through Formulas
Damn... Guess I'll have to stick to doing stuff manually via a regular table.
Just when I think I'm starting to get a handle on things. Simple mistakes always there to humble me! lol
Is it somehow possible to make a success/failure roll condition where Success would be green and Failure would be red?
I currently have:
<h1 style="text-align: center;"><strong>${ myRoll <= Punching_Value ? 'Success' : 'Failure' }$</strong></h1>
which works correctly and everything, but is without color. Since chat is HTML I got a red failure HTML code:
<p><strong><span style="color: #ff0000;">Failure</span></strong></p>
However every time I plop it in place of 'Failure' I always get an error which just says Value expected and I don't really understand (Screenshot)
I even tried putting in the colored Failure with just the span and span end and it still didn't work but when I plopped it into Foundry chat, it displays a nice red Failure just how I wanted.
Make sure, that your formula begins with !, otherwise the whole Formula result will be wrapped in a span or div
The blank HTML shouldn't fail whatsoever
Not sure I understand even with the documentation on Git...
I'm supposed to put ! just after ${? Or do I need to put it before the second snippet I posted or somewhere else entirely?
i'm not sure that i'm understanding what you're saying exactly.
are you saying because I have two functions in the "if" line?
I tried noti() + setProp() as well as && and still get
Custom System Builder | Cannot convert "Congratulations! You have leveled up." to a number Error: Cannot convert "Congratulations! You have leveled up." to a number
and if I delete the notify function within that statement so it only notifies you on failure;
then it stops generating errors but also doesn't do anything.
Okay, I managed to sort the version without the notification - i needed to use the ref function to avoid recursion.
weridly enough just adding a null if condition worked.
${!...}$
Does anyone know how I can change the name and status icons?
is it possibly to delete the default status effects with this script?
Yeah, you override them
If I want to print different results when a player rolls for if they rolled a 1-6, 7-9, or 10-12 on a 2d6 roll, how would I go about that? I tried the following code but clearly I just don't know how to do or conditions in if statements in this language that aren't just two options.
Here's the code I tried: Accuracy: ${accRoll <=6 ? 'Failure!' : accRoll >6 || accRoll <=9 ? 'Mixed Success!' : accRoll >9 ? 'Complete Success!'}$
Never mind, fixed it myself with this: Accuracy: ${accRoll > 9 ? 'Complete Success!' : accRoll < 7 ? 'Failure!' : 'Mixed Success!'}$
On Mac it doesn't seem to work for me either using CMD drag or CTRL drag. With CMD drag, I see the drag outline but when I release nothing is copied.
Foundry Virtual Tabletop: Version 12 Stable, 12.331
Game System: custom-system-builder, 4.2.0
OS: macOS 15.1.1 arm (64-bit)
Client: Brave/131.0.0.0
It's the keyword or
oops lol, classic me overthinking. Thanks
That's the first thing I originally did when you replied and after I looked into documentation but it seems to give the same error.
I even copied your example at the bottom and it works
Wait, you mean this:?
<p><strong><span style="color: #ff0000;">Failure</span></strong></p>
y
Yeah, posting that in chat does post Failure in nice bold red. But I wanted it to do that when the roll said failure. I plopped the entirety of this bit into the first one instead of 'Failure' and got:
<h1 style="text-align: center;"><strong>${ myRoll <= Punching_Value ? 'Success' : <p><strong><span style="color: #ff0000;">Failure</span></strong></p> }$</strong></h1>
This didn't work even if I added the ! in front of myRoll.
Because the else-part is not a string
${#isSuccess:= myRoll <= Punching_Value}$
<h1 style="text-align: center; color: ${!isSuccess ? 'green' : 'red'}$"><strong>${!isSuccess ? 'Success' : 'Failure'}$</strong></h1>
I did try putting in something similar in the mean time but the syntax was a bit off so it didn't work but yes, this seems to be exactly what I needed. Thank you very, very, VERY much! 🫀
Is there any way to have input requested only when a certain value is met. The way that i am doing it currently seems to just display the input request any time the value is updated.
${attrDamageCurrent == attrDamageMax ? ?#{_damage_threshold} : 0}$
Hello, hello!
This one's- probably simple, I think. Apologies that I can't really provide much ground to work off of, I'm pretty new to this stuff.
I'm attempting to do a sort of thing wherein items in a player character's inventory can be accessed, used, and then automatically removed from the inventory upon use, and I'm missing some key understandings on how to do this- I'm not even sure how to run macros from an item, nor if that's possible or needed.
Something ala Pokemon-ish, like:
Player opens their sheet
Clicks into item Potion in their inventory
Preferably, uses it through a simple method like a button (Unfortunately, I don't trust my friends to comprehend much beyond clicking on a big red button, lmao)
Button runs macro to simulate effect of item (etc, updating the currenthp value of the current token by adding 20 and sends flavor text to chat)
Macro then removes item from inventory
Is there any advice I could get on making this possible?
I've recently transferred a world to a new computer
and mostly things work but
any time I try to place a token I get thrown this expeption
which is a problem
these are the modules i'm using
not sure if i've tried turning off all of the ones with compatability risks and seeing what happens but it doesn't fix anything
i'm not certain weather or not this is a custom system builder issue but
Is there any way to display an item displayer in a horizontal format? The items are currently represented in a list that goes down indefinitely. However, I would like to present them as if they were in a grid table, with one item next to the other.
The way the items are currently displayed in the item container, depending on the inventory, it becomes very large, and players have to scroll down a lot.
So, is there any way to display an item container in a table/grid format?
So I accidentally messed up and deleted a hidden attribute
and I have no idea what it had but it completely destroyed everything
is there a way to undo that?
the undo feature just alters changes to the visible stuff
${#${!attrDamageCurrent == attrDamageMax ? concat('?', '#{_damage_threshold}') : 0}$}$
You'll probably want a Rich Text Area, which contains the Label Roll Message for each individual Item.
In the Label of the Item, you want to run this Script here:
const phrase = await ComputablePhrase.computeMessage(entity.system.props.textAreaKey, entity.system.props, {triggerEntity: entity});
const speaker = ChatMessage.getSpeaker({
actor: entity.entity,
token: entity.entity.getActiveTokens()?.[0]?.document ?? null,
scene: game.scenes.current
});
phrase.postMessage({speaker});
return '';
Don't think so, because the Item Displayer is already a Table with varying column-count. You'd need your own Component (or maybe just CustomCSS, but dunno if that's enough)
Thats sounds like the error one get if using an older CSB 3.x.x version on new foundry 12.x version.
Check your version numbers on the old and new install.
CSB 3.x.x is only compatible with foundry 11.x
In the Example actor sheet of the CSB Example module, how is the total armor values being added when the only label formulas seem to be ${round(Armor_Protection_Standard/6)}$?
They are added through Item Template Modifiers of the Armor Template
Thank you!
Unfortunatly hidden attributes are ignorded by undo/redo
That is unfortunate, alas, I did manage to fix it
I just kind of reverse engineer what I did
Sorry to bother folks but I'm just not getting Item Modifiers. I'm trying to give a weapon a bonus to it's attack value calculated in a label on the same row of the item displayer (which is tied to a roll button on the item displayer) but apparently that doesn't work?
If your Formula is already in an Item Displayer, then you don't even need Item Modifiers, because this Label has already access to all properties of the item (e.g. item.name)
Oh, yeah, I guess I could just mod the item. I was thinking along the lines of adding an attachment to an item (a scope on a crossbow), but I can just give the 'scoped crossbow' a bonus. I'll add a GM visible only option to add attachments, that should work.
Do user input dialogs not update base or am I missing something? I have a label that should display the total points selected but the value stays 0 and never updates.
User Input Dialogs do not perform updates on entities by themselfs. They only pass values to the Label Roll Message
And they don't update on change, yeah
Ah Damn, alright thanks
Is there a way to add a new row to a dynamic table via script, cant find any reference to it in the documentation?
let tableProps = foundry.utils.getProperty(entity.system.props, this.key) ?? {};
if (Object.keys(tableProps).length) {
const newIdx = Math.max(...Object.keys(tableProps).map((key) => Number(key))) + 1;
tableProps[newIdx] = { ...sampleNewRow };
} else {
tableProps = {
0: { ...sampleNewRow }
};
}
foundry.utils.setProperty(entity.system.props, this.key, tableProps);
await entity.entity.update({
system: {
props: entity.system.props
}
});
hi after update this formula started generating me errors. anyone know why? and(equalText(item.typ,'Ubiór'),item.EQ)
its formula for item visibility on list
What does item.EQ return?
its a boleen
it works correctly but i have this error message in logs
Make sure with typeOf(item.EQ) and typeOf(item.typ)
how? i dont understand
Just check it in a new Formula
Hello. I need to do a system but I have few questions about this builder
- can it add auto damage or auto healing for tokens while rolling?
- can it count amount of items in inventory/other types of tablets?
- can it change one list property's value automatically when another one's is changed?
- can I create items which are affect character's stats in it?
- can I add min 0 value or remove it from list property so it can get -5 -10 and lower?
Ah. One important too. Is it nessesary know programming for working here and do all that algorithms and scripts sh*t?
- Self-Healing is fine. But If your players want to change stats of a Token they don't own, they'll run into permission-issues, because they are simply not allowed to do that. So you have to handle that via a Script, which passes a request to the GM
- Yeah, that one is easy with
count(lookup()) - Yeah, the Formula system allows that
- Yeah, Item Modifiers can do that (and also Active Effects)
- Can you rephrase that question? I didn't understand that point
It depends on how complex your calculations should be, but you'll need to learn some basic concepts of programming (like Variables, Operators, Functions and Types). Just go through this Wiki page: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
5 one - is like my mana can't spent lower that 0 but HP can. Can I regulate it here?
You can define a min and max-cap for number fields
I'm failing miserably trying to accomplish a very simple thing which is to increase a roll's (from a label roll formula, with !) font size. How can I do it?
This isn't working:
Resultado: <span style=\"font-weight: bold;font-size: 26px;\">${!roll}$</span>
For reasons unknow I wrote \ twice omg
Can anyone help me with why this isn't working?
<p style="text-align: center;font-size: 24px"><strong>Administer</strong> ${[2d6]+admin+(admin==0?'-1':admin)+(att)}$</p>```
include what you are trying to do in your question to help others spot your issue
That's a fair point. So it is a skill check roll button, where you get to select your attribute modifier depending on situation rather than it being static, so I want a simple dialog to pick modifier (which is working in the above formula) and then for the dice roll (the second part) to add the modifier to the roll.
From what I am reading this should(could?) work, as the label "att" should be returning "strmod" or other based on choice, which is a key on the player sheet.
Yeah, the variable att returns the value 'strmod', which is not numeric. To reinterpret it as a variable, use ref(att)
Amazing thank you!
what is the difference (generally speaking, not only for this case) between ref(variable) and ${${variable}$}$ besides the error proneness of that gorgeous thing😅
Not much. Almost identical
I would like to create either a sliding counter or a checkbox "track" of 10 boxes that could be ticked from both ends.
The idea is to create a "stamina" bar, lets say from 0-10 where a starting character has around 4 points that he can use to boost actions.
Now the trick is that when he gets fatigued, the same track gets "eaten" from the right side, meaning his maximum possible stamina gets lower and lower until it is zero.
Is there any way to model this or should I just stick with 2 attributes and explain the mechanic to players?
If you don't want to craft your own solution, sticking to 2 attribute bars is the simplest one
Devs.
I know that chances are probably 0, but would be nice if CSB could have Russian language translation. It would help a lot to navigate nicely through basic stuff for better own system creation. For me, for example, its not like impossible wall. But it whats stop me from trying this system more freely.
Well... I can barely read russian, not to meantion write it, so it would need somebody else to do that
Well, maybe there are some people in community who can help. Or you can hire a translator (Im not sure how project is valuable for you guys). Or maybe even I can help. I already did translations for similar things. But personally now I cant promise myself anything, cause Ive a lot on my plate.
This line returns an error inside an item sheet:
${(Weight + sum(lookup('test', 'weightfield'))) * poids_variante}$
Weightis a label set on the sheet, works perfectlypoids_varianteis a hidden attribute on the sheet, works perfectly
According to the console, the error originates from the lookup method, so the weightfield data
The ERROR:
Logger.js:33 Custom System Builder | Uncomputable token "lookup('test', 'weightfield', null, null, '===')" Error: Uncomputable token "lookup('test', 'weightfield', null, null, '===')"
Thing is, the dynamic table this line pulls from is perfectly set:
(on the real sheet, it looks like that)
And here is the number it's supposed to get from the actor sheet called "Sac d'écolier"
As we can see, the "weightfield" returns blank on the dynamic table
Any idea why?
Here's the weightfield:
${fetchFromActor(sameRow('namefield'),'KG_fixed')}$
And here's "KG_fixed" on the actor sheet:
${round(round(KGBP *10) /10)*0.4}$
The project is open source, so everybody can contribute to it. I can't do much if there's nobody willing to do so
The issue is somwhere there
should I replace "fetchfromactor" with lookup?
Oh. True, true.
But Im not pro giuhubber and better to know some inner information about different things. So, help appretiated.
But you are right. Good catch here. I forgot how github works.
It's correct to use fetchFromActor(), because you fetch information from a different Actor
Try it out with a static name in the function
I'll try
Still returns the same error and the result is blank
if I do anything else than this actor it returns an error on the line, so it reads the actor
but instead of returning the value (0), it returns a blank
and the reason is the error
🤔
Any ideas why?
So before I go beating my head against the wall, is there an easy way (just with the base functionality, I'm not ready to dive into css and scripts) for me to have a GM visible only checkbox on a character sheet that is toggled by the presence of an Item (a Feat say) in an Item Container?
If not I can just check it manually on the character's sheet of course.
yes it is, you use find() to check the name or id of the desired item and use it as a condition. Edit: this is not how actual checkboxes work but there is a workaround
Now if you really need it to be a checkbox, perhaps not... But I assume the "core" functionality can be achieved regardless
Yeah, I already know how to do this. Sadly I'm trying to target a checkbox in the sheet using an item on the table, as it seems like some of the lookups that I want to use only use the Dynamic Table and not the Item Container. Figuring out functionality between item in container and sheet as a whole is driving me a bit mad if I'm honest, and what's worst is I don't seem to be able to find answers or examples anywhere. Thank for the help though!
I can't seem to work out how to get math functions in the sheet as a whole to target specific entries in the item container. And I have no idea how to use Dynamic Tables.
Hey y'all, how do I change label font?
Click advanced or use html prompts
actually I realize I probably need a CSS style sheet so that I don't need to custmize EVERY damn item by hand
is that possible?
also, thanks for the reply
on another question: in the system I got, there are status effects that are temporary and reduce stats sometimes
should I make them items? do i use the _weakness template if so?
nvm! figured it oud 😄
in a situation lik ethis, how do I make it so that the reult adds all dice and bonuses like
1d8+1d2+3
hmmm
can't disable this
i I uncheck the option to let players add rolls, the + sign still remains
and I would like to remove the ability of players to delete rows too
You still see the '+' because you're in edit mode. If you can try entering the game as player to check the result.
Thank you!
Finally, when adding tokens to the initiative tracker, I don't know how it will let me choose the stats I want for hp and so on. I can't figure that out.
Lookups work on Item Displayers aswell if you use the current version of CSB
Hey folks, I spent about an hour banging my head against a brick wall last night, and was hoping someone could help me- how do you call a value in radio button value?
Specifically, I have a radio button called "Analyse_radio", and when checked need it to call the value in "Analyse_Value", a Number Field. All I seem to get back is literally what's written in the radio value field, ie, the string of the formula.
It's possibly my test button is actually set up wrong, but assuming it isn't at the moment, what would you put in the formula box to call that value?
Use the group-key of the Radio Button to access the value of the Radio Button of the Group, which is currently selected
Hmmm...I thought I was. I'll try again and post what I have.
If I remember correctly it is in the Resources tab of the token, then you scroll through the list and choose what you need.
Yes, sorry, I understand how to reference the group, but not how to reference a variable value in each individual button's value. For example, an attribute value on a character sheet.
Button A needs to read the value from Number box B. Roll message references Group C, checking which Button (A) is selected. I can't however get Button A to then report the associated value from Number Box B
Im using the Radio Button to allow a task roller to select which attribute is going to be rolled. But for that to work, it needs to read the character sheet value, and not just a static value in the template
If the Radio Button contains the key to a Component, you can simply use ref(radioButtonGroupKey) in your target-formula.
Do we have while?🤔
No loops in normal formulas
Ok
Is it possible to achieve similar behavior setting a label as undefined on purpose until some condition is met?
Nope
Hm k
Scripts is the only way
That would work as expected even inside a label?
Yeah, Scripts can be used everywhere, where normal Formulas are used
Wouldn't it mess with any sync/async promise or whatever and break the game would it?
No?
You can use asynchronous calls everywhere, but you can't await the result in a synchronous context, but that's it. All Labels with a key are called synchronous (those without are async).
What is it?
The script with while
A while-loop is not a asynchronous operation, so you can use that without concerns
Oh k
Too much hassle to implement such functionality in formulas?
I don't think allowing loops would be good in normal Formulas, because users could create an infinite loop without a proper break-condition
And we already have Scripts, so we can also cover advanced stuff for users, who know what they do (mostly)
I still don't think this is solving what I'm asking, but the disconnect is making me think even more that maybe it was my test button that was the problem
It worked! I created a simple loop to calculate the level of a character, which requires the same amount of experience of the current level +50%. In my case the required experience is 110. I was not sure how to pull this off using math, the while loop did the trick 🙃
I'll leave this here in case anyone needs something similar, although this isn't anything too complex to achieve😅 :
%{
let base_exp = 110;
let cur_exp = ${exp_atual}$;
let level = 0;
while(true) {
if (cur_exp < base_exp){
break;
}
cur_exp -= base_exp;
base_exp *= 1.5;
level += 1;
}
return level;
}%
(Use this with caution, always make backups before creating scripts)
base_exp is the required experience to reach the first level, cur_exp is the actual experience number (mine is pointing to a label ${exp_atual}$) and level is the starting level (in case your game starts in level 1, simply replace the 0)
Honestly don't mean this to come off as patronising or anything, but I don't know how else to clear this up. I can't get the red box to read the blue number, and I'm not sure why.
Analyse radio = Analyse_Radio
Blue Number = Analyse_Value
Ah, I've spotted a little bug in the code 😅 . But still, you want to make sure, that all values within the Radio Buttons within a single group stay distinct from each other at all times, which is not given for your case, if you use ${numberFieldKey}$ in the value-fields of your Radio Buttons.
That's why, use only static keys in the Value-fields (e.g. Analyse_Value) and use ref(radioButtonGroup) wherever you reference the Radio Button Group
Is it possible for auto-hp roll?
So like, i select a class that have d10 hp per level and my character is lvl 3, is it possible for when i roll the d10 hp it insert at HP?
You mean the max hp? If it is a number field, sure
this one?
In this example, if you have an Input field with the key HP, it will be set to 20
I'm sorry, I'm just now seeing the 4.2.0 patch notes and
Added function find(), which does the same as first(lookup(...))
???
Amazing! I know it's a tiny tiny change, but with how much I struggled to remember how many damn parenthesis to have using lookup, this will help me 🤣
But here's an odd question I think I know the answer too ("there's a way to use a script to do it")
Is there a way to collect inputs from multiple players when a player makes a roll?
For instance, player clicks roll, their user input dialogue pops up and they choose some options, then it pops up for the GM(s) for them to add some stuff (usually complications or whatever) THEN the roll executes with all the parameters?
With my system I don't really want it to go through automated status-checks of various things and would prefer the GM get their manual input each roll.
It's pretty complex even with scripts
Probably beyond my capabilities then, especially because I'm still a n00b with scripts, haha
whats wrong with this?
I want to roll an dice with advantage
${conmod+(vantvida?[1d:dadovida:]:[2d:dadovida:])}$
checkbox to confirm advantage
${#dices:= vantvida ? 1 : 2}$
${[:dices:d:dadovida:] + conmod}$
Hi there ! Is there any way to use @{actor|property} calls inside a ${}$ formula ? I'd like to compare a roll result to a value on the current player's target, but I get syntax errors every time... :/
I Finally got this working, thank you for your help
Okay so here we go, I'm trying to use the following formula
${lookup('edges','name')='On Target'?18/2:str/2}$
to check an item container (edges) for an Edge named On Target, which if true will use 18/2 as a value rather than str/2. What am I doing wrong? How do I target the name column of the item container, and how di I identify the name of the item?
As added info, thie item container is in a different tabbed panel than the place I am trying to use this formula, if that matters.
${#rollFormula:= concat(vantvida ? '1d' : '2d', string(dadovida), vantvida ? '' : 'kh')}$
${[:rollFormula:] + conmod}$
That's the old syntax and only works outside of formulas. The new one just uses the function fetchFromActor()
${lookup('edges', 'name', 'name', 'On Target') ? 9 : str / 2}$
Damn, i have alot to learn
But thank you
Appreciate the help you giving me man
Oh, thanks ! Didn't get that from the docs 😅
Still returning an error. Is it because the Name column has the draggable item button and that can't be targeted?
Here is how I have it now with your support:
${lookup('foci','name','name','Strong Back')?18/2:str/2}$
Realised I was using the wrong names, but even with the correct ones it isn't working.
Is foci the name of the Item Displayer?
And 18/2 is 9 btw
Yes, that is the correct displayer that the Strong Back Item is in.
What's the error in the console?
lol, yeah I guess I could just put in 9.
Okay, so I found the console, and the error at the bottom isas follows:
at math.js:24863:47
at math.js:24864:39
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:439:27)
at Formula.compute (Formula.js:366:21)
at processFormulas (ComputablePhrase.js:103:35)
at async ComputablePhrase.compute (ComputablePhrase.js:157:34)
at async ComputablePhrase.computeMessage (ComputablePhrase.js:257:9)
at async Label._getElement (Label.js:107:26) Object```
No idea if that is correct error...scrolling up I more than a few.
Yeah, that is correct. Just wrap lookup() with first()
Oh, okay, one sec.
same error
Show how you did it
${first(lookup('foci','name','name','Strong Back')?9:str/2)}$
The closing parens is missplaced. You shouldn't include the part outside of lookup()
Oh, just wrap lookup, not the whole dang formula, duh.
Yep that got it. Now I need to figure out why my attack button that was working yesterday suddenly isn't. Something about a samerow ref. Glad you pointed me at the console though, that at least gives me more information that I had before, even if I won't be able to use it as adroitly.
According to the console 'atkcalc' in the same row as the label button I'm using isn't targeting the column correctly? The values in that column are only numbers (negative currently, but that shouldn't matter right?)
${[1d20]+sameRow('atkcalc')}$
I entered a default value and it would indeed role, but still wouldn't calculate using 'atkcalc'. Any thoughts anyone?
Whats strange is that it was working yesterday, and I haven't changed anything with that table.
And what's the message?
at sameRow (FormulaFunctionImporter.js:15:27)
at math.js:26516:56
at math.js:25781:62
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:439:27)
at Formula.compute (Formula.js:366:21)
at async processFormulas (ComputablePhrase.js:103:21)
at async ComputablePhrase.compute (ComputablePhrase.js:157:34)
at async Label.js:480:13```
And the column-key is correct.
Try this one out and check the console: %{console.warn(options.reference)}%
Do I just add that to the formula?
Replace
I don't know that I'm doing it right, but this is what I got back
eval @ VM2064:3```
There should be a yellow message somewhere
VM2064:3 attacks.pLg718JaTHyX6F1C
Alright, and now %{console.warn(entity.system.props.attacks['pLg718JaTHyX6F1C'])}%
{name: 'Knife', id: 'pLg718JaTHyX6F1C', trained: '<i class="fa-regular fa-square "</i>', attack: '0', damage: '1d4+1', …}
You can expand that
I see, it says 'atkcalc' is undefined. But it isn't, There is a -1 there on the item holder table:
atkcalc
:
undefined
attack
:
"0"
damage
:
"1d4+1"
id
:
"pLg718JaTHyX6F1C"
name
:
"Knife"
roll
:
"Attack!"
trained
:
"<i class=\"fa-regular fa-square \"</i```
And it seems to think there are more columns than I have. Should only be the item name, trained, atkcalc, damage, and roll.
Also, if it helps, here is the formula in the atkcalc row that is being computed successfully if that helps:
${(item.usestr?strmod:dexmod)+item.untrainedpen+item.modatkbonus+atkbonus}$
I think I have figured out part of the problem, it doesn't like the number the above formula is spitting out.
Alright, I found my way around it.
Wsp, i was wondering if there anyway i could make larger text field for big texts.
Like for notes and etc...
Rich Text Area?
I can't seem to add macros/commands to inline rolls so instead I thought to at least let Dice so nice change the color of enemy dice.
Normally a chat message would look like /r 1d6[fire]
But I can't seem to replicate this when using ${}$ values. Inside it throws an error and outside it just prints as text. Any ideas?
${[1d6[fire]]}$
Welp, now I feel dumb, thank you!
So, I'm making a character sheet, to keep track of information.
Is it possible to create a new row in a Dynamic Table through Macro scripts?
Y, the rows are just objects after all
Is there a simple way to add objects then? I'm a lil new to this, but learning a lot ^^
What would the "SampleNewRow" be? It's saying that it isn't defined, so I'm assuming I need to add something, yeh?
Your values in the row. I think it can be an empty object
Does it need the elipses? Or is that placeholder?
And I tried making the "newrow" like this, but getting major errors, so assuming that's wrong. card is the name of a card
Oh, I just made it empty and that cleared some things I think?
Oooh, so it's saying like- all of it? That's cool ^^
Object creation in JS should look like JSON, so replace = with :
Riiight, I did the exact same thing just hours ago @w@ I feel blind sometimes
Ok, I'm down to the last bit and am unsure how to fix the last bit, can I copy and paste the code here for help?
Sure
let card = token.document.name;
macroID = macroCompendium.index.find(t => t.name === card)._id;
macroCompendium.getDocument(macroID).then(m => m.execute());
let GT = game.actors.getName("Growth Tracker");
let table = GT.system.props.card_use_table;
console.log(Object.keys(table).length);
let NewRow = {
name: "card_name",
value: card,
name: "card_uses",
value: 1
};
if (Object.keys(table).length) {
const newIdx = Math.max(...Object.keys(table).map((key) => Number(key))) + 1;
table[newIdx] = { ...NewRow };
} else {
table = {
0: { ...NewRow }
};
}
foundry.utils.setProperty(GT.system.props, GT._id, table);
await entity.entity.update({
system: {
props: entity.system.props
}
});```
Now it only errors when that last 'await' is there
With this error, if it helps
It doesn't know what entity is, because you have to define that (TemplateSystem of either Actor or Item)
I tried this too:
system: {
props: GT.system.props
}
});```
It sadly gives the same error
Oh, it wants the template system?
let GTT = game.actors.getName("Growth Tracker Template");
await GTT.update({
system: {
props: GTT.system.props
}
});```
I changed it to this, now it doesn't error, but it isn't adding any rows
Depends. The first entity is an instance of TemplateSystem while the second one is an instance of CustomActor or CustomItem. You could skip the first one and directly use the Actor or Item
That one is fine, yeah
let card = token.document.name;
macroID = macroCompendium.index.find(t => t.name === card)._id;
macroCompendium.getDocument(macroID).then(m => m.execute());
let GT = game.actors.getName("Growth Tracker");
let table = GT.system.props.card_use_table;
console.log(Object.keys(table).length);
let NewRow = {
name: "card_name",
value: card,
name: "card_uses",
value: 1
};
if (Object.keys(table).length) {
const newIdx = Math.max(...Object.keys(table).map((key) => Number(key))) + 1;
table[newIdx] = { ...NewRow };
} else {
table = {
0: { ...NewRow }
};
}
foundry.utils.setProperty(GT.system.props, GT._id, table);
let GTT = game.actors.getName("Growth Tracker Template");
await GTT.update({
system: {
props: GTT.system.props
}
});```
So, this is what I have now, pardon if I misunderstood anything so far. Now it doesn't error, but it's still not adding anything to the actor's table.
Your setProperty() is incorrect. The 2nd arg defines, which key you want to set
So, would I want the key to the table there?
Yeah
foundry.utils.setProperty(GT.system.props, table._id, table);
I updated it to this, but it nothing changed
There's no table._id
Oh lol, so what would I put there?
Just the key of the table as string
Yay!~ Ok, step in the right direction!~
It's adding a new row, but it's not adding the "NewRow" information, just blank.
You format of the object is probably wrong. Check this here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Dynamic-Tables#1-definition-of-dynamic-tables
Question. Is there a way to target a Text field with a formula so that I can display text from the field in a different Label?
And never mind, I figured it out 🙂
hey, I have a question. How would you go about changing the chat output of a roll from:
to foundry's roll style that you'd get rolling from the chat:
let roll = await new Roll('1d100').evaluate(); await roll.toMessage();
Depending on if you have it in a label or macro you'd need %{}%
so if it's in a label, could you demonstrate how that syntax would look?
in my example I want it to roll 1d20 + str, where 'str' is the key of a label
%{let roll = await new Roll('1d20 + ${str}$').evaluate(); await roll.toMessage();}%
Should work
I just figured it out exactly like that!
thanks. Though I have a followup question. Would you be able to add text to that chat message still?
like:
"Strength Check:"
%{let roll = await new Roll('1d20 +${str}$').evaluate(); await roll.toMessage();}%
not like that obviously but ya know
brilliant
thanks
oh my god
I couldn't get it to work and couldn't figure out why for the longest time until I realized it's because my heritage betrayed me
I spelled it 'flavour'
So I am super novice to script written but I think I have a simple question. Changing the color of checkboxes. I see there is a spot for script but I am not quite understanding how to use it. What would be a simple example of using the appearance modifier for making a checkbox red?
Check this article here: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics
Using CSS in CSB:
- You upload your own CSS-file and reference that in the game settings
- You use the CustomCSS-module (recommended)
CSS (Cascading Style Sheets) is the code that styles web content. CSS basics walks through what you need to get started. We'll answer questions like: How do I make text red? How do I make content display at a certain location in the (webpage) layout? How do I decorate my webpage with background images and colors?
So I'm chugging along at my sheets and I'm about done I think, but now I'm wondering if there is a way to make a sheet that tracks stats in other sheets, like a Party Management sheet so I can see all my players characters current hp, AC, etc.
No big if it's not possible, I can just look at their sheets, but I was wondering.
You can fetch stats of players with fetchFromActor(). The only drawback is, that the party sheet wouldn't update automatically
Would I refresh the party sheet to do that? Also, do I target the actors by name?
Any change in the sheet would trigger an update. A simple checkbox would be enough. And yeah, you can target the actors by name
Oh that will be fine as I'll have checkboxes as a turn tracker as well.
You my friend are an inspiration!
Dang, not getting it:
${fetchFromActor('Charlemagne',"ac",0)}$
only returns 0. Am I missing a part of the key? Like actor. (which I actually tried and also didn't work).
Do you get something with game.actors.getName('Charlemagne') in the console?
Actually I'm getting no errors at all. Just a blank entry.
With the label I'm using to house the formula that is. It's blank.
Then type game.actors in the console and check, if your Actor is actually there
Well...there appear to be some actors 🙂
:
{"voXqWEnWRjYHGNCD" => CustomActor}
1
:
{"vSBJTmxQyx54QXCy" => CustomActor}
2
:
{"SWUwpPXJQVRr2yXr" => CustomActor}
3
:
{"pG9HfX8yuInxRYFw" => CustomActor}
4
:
{"CgG820SQ82ufsMSW" => CustomActor}
5
:
{"p9ko8cJbSwmv6PdN" => CustomActor}
6
:
{"EpwROtii6NfVpNxX" => CustomActor}
7
:
{"ZSi0jcGo8mlcGrX8" => CustomActor}
8
:
{"4qOb0AUCTJz02s06" => CustomActor}
9
:
{"wc9pQrBSw5ARSeOe" => CustomActor}
10
:
{"tMA7VixkZFtTZMXK" => CustomActor}```
Why they don't have the names in their Name field I don't know.
Oh wait, interesting, I can open the menus and see who they are connected to. Man, looking up their weird id string is going to be onerous
Nope, even when I use the alphanumeric string associated with Charlemagne id doesn't work.
:
{"vSBJTmxQyx54QXCy" => CustomActor}
key
:
"vSBJTmxQyx54QXCy"
value
:
CustomActor {name: 'Charlemagne', ```
hmmm, I may have worked it out.
Nevermind, messing about with fetch actor somehow broke the whole character's sheet. Now nothing on it works...that sucks.
Duplicating the character and deleting the old one saved the character. No idea what I did to mess it up, to many errors to parse on my own. Ah well, I'll just do a manual entry Journal if I need to for PC stats.
I'm getting info from an Actor's name, how can I get it from an Actor's ID?
(the drop down menù where you read 003 in the first image in q005)
what i'm doing wrong?
${lookup('q12', 'q10', 'q11', q005, '=')}$
the formula is this one
= is not a valid operator
it must be double me dumb
Replace id and key:
%{return game.actors.get(id).system.props.key}%
still cannot make it work
What is the content of q005?
(001 is q005)
a valu of a dropdown menù picked from a dynamic table
Is q005 within the Dynamic Table?
not the same no i made two different
I just want to know, where q005 is located
where? Because right now this is how it works:
this is the componet that key is q005 (first image)
in the second image i circled it
%{return game.actors.get('${namefield}$')?.system.props['KG_fixed'] ?? 0;}%
returns an error
Which one?
The error is related to a different formula, that is dependent on that one
the formula is this one: ${sum(lookup('test', 'weightfield'))}$
which works perfectly with my version
Try out ${consoleLog(lookup('q12', 'q10', 'q11', consoleLog(q005), '=='))}$ and see what you get in the console.
Did you change namefield to contain an ID?
That is not an ID. That is a UUID
can I use the UUID instead? it's way easier to get
can't be done without a script? :/
Do you have an entry in q11 with 001?
No. What I send you is already a script
yes, also this
(i did not had that error in the dropdown menu)
would this work then?
`const abacus=await fromUuid("${namefield}$")
return game.actors.get(abacus)?.system.props['KG_fixed'] ?? 0;`
Where 001?
wait a fucking second, i did not inverted the reaserch collumn
If you execute that from a Label without a key, then yeah. Otherwise no, because you use an async operation. And abacus is already an Object of type
then this?
`const abacus=await fromUuidSync("${namefield}$")
return game.actors.get(abacus)?.system.props['KG_fixed'] ?? 0;`
Change game.actors.get(abacus) to abacus
Because you already fetched the object
And remove await, there's nothing to await in a non-async operation
like this it should be more clear what is what and wich is wich
Alright, and by what criteria do you want to filter?
And which one is the target column, you want to have the result from?
ok lets start from 0
in the first part i have
a dropdown menu that let me choose beetwen (class1,class2,class3)
when i choose the class, i want in the second drop down menù to chose fromn the ability of that class
so if i choose class 1 i need to be able to choose beetwen pow1 and pow2
in my mind this was feasible with two dynamic table, one with the classes and 1 with the abilites
Class-Dropdown:
- Dynamic Table key:
q12 - Dynamic Table column for option keys:
q10
Power Dropdown:
- Formula for key options:
lookup('q12', 'q11', 'q10', q005)
`const abacus fromUuidSync("${namefield}$")
return abacus?.system.props['KG_fixed'] ?? 0;`
is this one right?
const abacus = fromUuidSync("${namefield}$");
returns 0
You can do a console.warn(abacus); before the return and verify, that the Document is found
abacus is null
`%{
const abacus = fromUuidSync("${namefield}$");
console.warn(abacus);
return abacus?.system.props['KG_fixed'] ?? 0;}%`
%{
const namefield = '${namefield}$';
console.warn(namefield);
const abacus = fromUuidSync(namefield);
console.warn(abacus);
return abacus?.system.props['KG_fixed'] ?? 0;
}%
Ah right, it's within a Dynamic Table. So you have to use sameRow()
yeah
%{
const entries = "${lookup('q12', 'q11', 'q10', q005)}$";
return [...new Set(entries.split(','))].join(',');
}%
https://www.geeksforgeeks.org/how-to-remove-duplicate-elements-from-javascript-array/
like this?
`%{
const namefield = '${namefield}$';
const abacus = fromUuidSync(namefield);
${fetchFromActor(sameRow('namefield'),'abacus?.system.props['KG_fixed']')}$
}%`
Wait wait, you can't just use CSB-functions in Scripts directly. They are only allowed inside ${}$
${namefield}$ --> ${sameRow('namefield')}$
How do I make it so that, if critCheck isn't equal to 12, nothing is output into the chat? I'd rather not have "not a crit" on every other roll.
${critCheck == 12 ? "CRITICAL HIT!" : "Not a crit."}
${${!critCheck != 12 ? '#' : ''}$critCheck == 12 ? "CRITICAL HIT!" : null}$
Thanks!
could you have an item displayer only display the first item of the given type dropped onto the character sheet and then subsequent items of that type bounce or overwrite the previous?
I'm thinking like adding a class item to a character, where if the character tries to add a different class it doesn't just expand the table
also different question, can items be attached to another item so that you could make class items that auto populate class feature items from a table based on matching the level key of the character with the level column of the class feature?
Not without your own world script
WIP
is it possible to show only the item Icon at Item Container?
I am so lost currently. For example _inventory what the hell is {Weight} referring to in the item modifier
To the Weight-Component in the Item
There is nothing labeled in the item as the weight component, thats what Im confused on
Apologies, I was very tired last night and in stupidity I did realize that the component key weight was on the numerical field.. not the label
Better question as well is how is total bulk knowing to display the total weight?
And thank you for your time
is there a good way to lessen the gap between these elements? I'm finding it really difficult to resize the flex groups, especially the ones the display: grid; ones, and on top of that I can't figure out how the parent structure of elements in panels works, when I try to apply a background to panels the background has a higher z-index than some of the elements in the panel so they're hidden behind it, I guess because of their place in the html structure. Feels like I'm going about it the wrong way for sure
use CSS to set the margins to <10.
still need help?
My problem was that the panel 3 column grid was difficult to resize with margins. I fixed it to my liking in a roundabout way but I dont' really feel like I mastered it, I just got around the problem 😄
You're trying to reduce the spacing between the columns correct?
Well, the rows too I assume
yeah and I did manage that by putting the meter in a different panel so it didn't take up space
I see, yeah adding a panel is by far the easiest solution, in fact i'd be overboard and throw a third panel in to group the two together but that's just me.
But you can absolutely manage the same thing with just css
I'm sure
You'd need to either specifically identify the current max and barrier labels and number fields, and set a max-width: x% (or px value). The margins could also be adjusted for further fine tuning.
Btw just a small suggestion, I'd consider using a table rather than a panel for first section. ^^
to be specific, i'd do this:
how so?
nest a table with 3 columns and 2 rows within a verticle panel? The meter is just placed below the table within the same panel
that way your HP specific elements are grouped properly, and the table offers better centering and element control for the contents
frankly then you could set the meter to auto size and it'd take up the entire width
though that last part is entirely optional, Idk what you're going for aesthetically
smart, I'll give it a try
Does this clarify?
even just using the built in size property you can change the number fields to be less abrasive:
that way you're avoiding additional css code uncessarily, but you also do get the ability to use some really useful CSS functions,
using nth row function to target the header or the content, or just the barrier column for example.
absolutely, smart
Think I got it figured out, thanks!
Actually I do have a question while I'm thinking about it. Does anyone know how to change the display of a meter?
Specifically I'd like to use some meters as clocks (like the blades in the dark progression clocks). I'd also like to fill in from the right side for some meters to show temporary hit points or shields if possible 🤔
sounds like custom script territory to me
I have a tangential question. I converted this into a table aswell, where I have 4 images in panels to use as icons for the different stats, but they get sent to div hell on the sheet and I don't know how to get them back
is there a specific reason you're using panels to hold the icons?
no just the first solution that came to mind
I think the issue has to do with panels not really taking up space natively.
In fact; I'd just reorganize your setup there.
Yeah I'm 100% too tabel happy
To do this I just made a single table with 2 columns
the Label is just a label with the text being the "row name" but then in the label icon section i used Font Awesome's sword import.
yeah but my problem is I have custom icons and the background-image property slips behind the neighbouring divs
and / or doesn't go outside the label div
maybe I could do overflow: visible or something
I think the issue is more to do with panels not natively taking up space and your icon being a background property is the same so it's being thrown off the side
You can either nest tables like I original had, which is a ugly solution
or I think you may be able to use a min-width property on the panels
wish there was a foreground-image property 😄
you can use a empty label with a set size, no?
perhaps
Yeah I just tested it
wait wut lol
interestingly setting the first icon to a label made all of the others hop into the right place
I hate css
do you know where the first label went off to?
Same 😅
and it's because you've set the first cell on a column to a size now, so the following cells are properly aligned
the problem is now that your first icon's position is thrown out
Ouu martin, this is a good question for you ❤️ 😄
shouldn't have stuck your head in >:)
so yeah, if you can find where your icon went off too it should be an easy fix
I don't even know how to style something to a clock 😅
Honestly with progression clocks being so dang useful - and with nearly every system having some sort of shield property used... these may be great feature requests built in natively.
progression clocks less so - but ever since discovering them I can't stop using them for long term down times, events, healing - etc.
it's still there it's just 0px tall
oh too easy man
You can try first placing a single space in the label text area
or a <br> tag, either should force it to take some verticle space
the height of the label is too small so it gets cut off
you can force it wiht a css line:
min-height: <x>px;
and set x to the value the other cells take natively
frankly i'm a lazy schmuck and would use <br><br>
yo?
the two line break label is untargetable in the template so if I leave it like that I can never edit it again
are your icons interactive somehow?
nope
I've played enough WoW to know that customization of Ressource Bars can be a hell of a work 😂
then why would someone need to click them?
no but in the template, I can't edit the label
which means if I ever need to change it I can't
an empty label template has this border you can click to edit it for that exact reason
but if I add a line break in there that border disappears because it's not empty anymore. But the line breaks aren't clickable so you can't get into the edit page for the label anymore
okay then you're 100% doing the css code
you're going to need to set a min-height, and height line
well that was easy
I can't believe I hadn't thought of min-height before
there fixed
that was faster than the lazy solution
final question. Is it possible to make the elements of the sheet resize with the sheet instead of just compressing?
probably not but on the off-chance that it's simple to do I'll ask
Wasn't there something like a Container viewport?
wdym, they should do that natively?
btw your bottom icon is clipped a bit 😛
lol dont sob easy easy min-width:
so does your stuff not scale natively?
well this is the sheet unfolded
if so you can set the
height as a %
ohh - i see
i mean yes you can do that
but you'd be basically coding an entire new character sheet
that's what I figured
you'd basically be making different displays based on PX size
recoding the entire sheet based on the display size being less than or greater than certain page widths
definitely not doing that
🤣 yeah me either - not worth
btw what I'm doing is trying to make a custom system for the upcoming final fantasy 14 ttrpg that releases in february couse I'm pretty sure no one is gonna make a full on system of it seeing as how strict square enix is with their license and I feel like playing it so here I am
and I didn't feel like coding a custom sheet from the ground up with html
btw can you make a border around the first child of a table like this without it getting a border in the column divider?+
it's from an item displayer
I can get it like these examples but I can't get it to wrap around the item delete button in the table th section
without adding the middle border between the two
yeah 100%
you need to use the nth child property
/* Header Row, First Cell (Attribute Name) */
.attributeTable tr:nth-child(1) td:nth-child(1) {
text-align: center;
display: block;
}
that's my css for selecting the first cell of a table
first row, first column only
tr being row, td being column
or wait did you want to include the trashcan in the border without the diving border
Alright I guess I dont understand. How exactly does the item modifier from inventory items know what label to adjust?
The key in the Item Modifier tells, which Label needs to be adjusted
yeah I wanted to include the trashcan part without the dividing border, exactly.
So I should put the component key of the label I want modified there correct?
you can select the eniter element and add the border
Yep
And that would have to be in ${}$ syntax
No, a static key is enough
You only need a formula, if the key should be variable
haha i never played that game but it looks so good
The story line is insane compared to other MMOs
yeah it sure is, I just finished endwalker
i got spoiled on mabinogi growing up 😩
is it a margin? hover over it with the inspect tool
also what does the div right above that one highlight?
hmm...
that div you highlighted is what you'll need to target
you may need to target the class item container itself then go up a level from there
Alright, first thank you for helping out. Didnt realize I was being dumb with syntax
Second, if you wanted to do a formula on the number that is modifying that label NOT in the item modifier but in the label itself, how would you do this?
With the goal of say dividing the final number that is the weight of the inventory by 2
actually i have an idea
put borders on both the trash can and word individually, just leave off the left and right border respecitvely LOL