In my use case, I have here two mutually exclusive checkboxes in separate sections of the sheet. The more I thought about it, the more I realized radio buttons wouldn't work here because even if I did turn each checkbox into a set of radio buttons, the interactivity between them I don't think would work with a Y/N/none set for both.
#Custom System Builder
1 messages · Page 54 of 1
I mean if you wanted to really go a step above
do the checkbox visability thing
but then have a 3rd and 4th box that appear as the 1st or 2nd one disappear... However these arent actually check boxes, they're labels that are styled to look like greyed out checkboxes.
I'm not sure I have the kind of time required to do something that fancy
Either way, I wouldn't be able to do it now, about to head to bed lol
btw
i just tested
You CAN use HTML in a panel title.
which means you can manually call font awesome through the HTML
That's rad!
I suppose css can also solve this issue of panels that are unable to be fixed-width like most other components?
yep.
just set min-width AND max-width to the same value
same thing as a fixed width
has anyone got the JS handy for calling an actor's profile picture externally from the sheet?
actor.img ?
that doesn't specify what actor - also i thought that wasn't supposed to be added till the next version
idk, I'm in the 5e system for a game right now, I can check in csb in a sec.
still looks like Actor.<uuid>.img
i mean calling
<img src="${Actor.....img}$"> didn't work
that path would be a JS path, not CSB.
<img src="%{Actor.XCjaWnjDqDiU2Zk0.img}%">
no console error, the img just displays as 'error'
doesn't it need to be <img src="%{return Actor.XCjaWnjDqDiU2Zk0.img;}%">
Caused by: TypeError: Actor.XCjaWnjDqDiU2Zk0 is undefined
[Detected 1 package: system:custom-system-builder(4.4.2)]
Wouldnt it need a ;?
I think so, I just added it before you said that.
even with it:
Caused by: TypeError: Actor.XCjaWnjDqDiU2Zk0 is undefined
[Detected 1 package: system:custom-system-builder(4.4.2)]
this js returns the right path in console...
console.log(game.actors.getName("Halivaard")?.img);
but
<img src="%{return game.actors.getName("Halivaard")?.img;}%"> doesnt work
could you do it with something more indirect, like return the value into a label then use that as the path?
it seems like I've had this fight before, I'll see if i can find something with it in the morning.
${fetchFromActor(find('memberList', 'actorDropdown', 'tableIndex', 1, "=="), 'img')}$ -- no console errors just the label reading error lol
jeez what a use of 4 hours lmfao
So weird af
I tried this and kept getthe the label to say error but no console errors
reloading the sheet didnt work etc etc
i shutdown my server and relaunch it... boom.
const actor = game.actors.getName("Halivaard");
return actor?.img || "";
}%}$```
finally returned a datapath as a label and i can call that im img src.
Bless you
wtf? i go to reference it later and suddenly functional code errors.
i copy the code, delete the label repaste it, and it works again -- no console errors.
@formal goblet Idek how to begin bugfixing this.
no errors in console.
giving the functioning code a component key causes it to error, restarting the server doesnt help, deleting the label and making a new one doesnt seem to help either.
Can anyone help me fgure out why the attributes aren't saving on a template? I can name it, put in entries, but after I press 'save' and I go to open it again, it disappears (as if I'd never entered any data).
The name must meet the same criteria as Component keys
The key can only be composed of letters (upper and lowercase), numbers and underscores
I am a system admin by trade and script with Powershell and SQL, but coding hits different 😄
gotcha
PS is good enough to be fair
Oh god. Talk about overcomplicating things for ourselves..
<img src="%{const actor = entity.entity; return actor.img || "";}%">
At least now I actually understand what Martin is referring to when he's talking about entity.entity. The thing about it is that to use the entity path at all it MUST be coming from inside a label. So while typing %{console.warn(entity;}% into a label works, typing the same command into a macro that isn't triggered inside a sheet or into the console doesn't. It needs that "from the sheet's perspective" to work.
Well, that's what providing context is. CSB provides the context of the triggering entity in all scripts within the sheet. And Foundry provides the context of the selected | players Actor in their Macros if executed manually.
Yeah, I've actually been seeing a lot of people with those issues regarding other aspects as well, so it was kind of in my mind when I sat down this morning to work on Scy's thing.
From his purposes though, he's working on pulling the images from other sheets to a dynamic table where he wants to display their image. Is there an external path to entity.entity? So if I'm on an actor named "Test" and want to pull the image path from "Test2", I can't just embed a script in a fetchFromActor(), because the embedded script formula would be executed first from the context of the initiating actor, right? How would you go about that?
I'd just use fromUuidSync() or game.actors in the script to fetch the other actor and get whatever data I need
That seems to loop me back around to Scy's original thought of ${%{const actor = game.actors.getName("Test");return actor.img || "";}%}$ which returns the template's image instead of the character's image.
how do I set the context in that script?
Then don't use the name of the Template 😅
That isn't the template, the template is _Character
Template and Character are technically both Actors in Foundrys world
game.actors.getName('Test') retrieves the data of the Actor with the name Test from the game directory.
On the Test sheet, using the formulae shown in image 1, I get these two results (image 2):
The first one is showing the image that's currently assigned to 'Test', using the entity.entity method, while the second should be calling the same image but externally, instead it's pulling the mystery-man image from the template?
Check the console what the second script returns. You probably have different actors
linked vs. unlinked Actor
Yup. That was entirely it. Alles in Ordnung now. It didn't even occur to me that the stuff I'd been doing was all from the character sheet of an unlinked token I'd dropped to make it easier to do a console.log(actor) earlier.
As soon as I updated the sheet it started working exactly right:
So.. @sinful spade in summary of my floundering around this morning, this should help for your DT:
<img src="%{const actor = game.actors.getName("${sameRow('Name')}$");return actor.img || "";}%">
Assuming you're doing that on a dynamic table where the reflected character name is already input from like a dropdown or something.
Also, don't be like me and wind up doing all your testing on an orphaned unlinked token from the canvas.
If I made a table and I want to make a copy of it (so I don't have to recreate it by hand). Is that possible?
CTRL + Drag
no way... 
Dude I appreciate you sinking time into this at all, but I'm going to be honest I have no idea half of what y'all were talking about 😂 linked? Unlinked? To what? Where?
I got a small script working last night that got the path to a label, and I put that in as a reference into the img src which seemed to work.
BUT about that same time my find functions started wigging out. They display errors after working for hours. Turns out if I give any of them componentKeys they turn into an error, and if I don't they seem to eventually convert as well.
@formal goblet showed a page about linked actors on the wiki but I'm not sure how that relates to component keys breaking labels
So what's meant by linked is if the token's Actor data is linked back to the Actor in the bin; Most of the time you want a Player Character to be linked, meaning that if they click on the token on the canvas, it opens their sheet, and any updates done there are done on the sheet. By contrast, unlinked tokens are like monsters, where when you drag six copies of it to the canvas you don't want them all to have the same data, you want to have their hp and effects tracked separately. It's an option you can set in the prototype token settings, a foundry-side thing.
So what I was doing, and the reason I wasn't getting the right image, was that I was making all my changes to an unlinked copy of Test that I had dropped on the canvas so it would be easier to mess around with it. That was also the place where I'd selected the image of the skull. So when I was using the script to find the current image of the actor, it was accessing the actor's data, which hadn't been updated with the data from the token.
Under a component's Additional CSS classes, if you want to add more than one class, are they separated by a space or a comma?
Space
If an expandable panel is in the middle of a table, how can I force the other non-panels to remain at the top of their cells when the panel is expanded? It seems the only aligning tools are horizontal, not vertical.
Setting a CSS class using vertical-align: top; does not seem to be working, even when applied to the whole table.
So I don't have any token setup, which means it should default to having an unconfirmed token with the hooded figure.
(I've barely done anything outside of the main character sheet at this point, as I don't want to commit to certain details until the maps are done and I can match tokens and attributes to the same style)
But what does the actors token have to do with broken label component keys?
Space if you're going a level deeper, comma if you're targeting multiple starting ' points '
.class p
Targets all paragraphs that occur after a class.
.class, p
Targets all occurrences of class and p equally.
.class p, div p
Targets all p under .class or any div
Note that if your structure is
Div span p
Div p will still target it.
Div > p will only target p directly after div.
Possibly nothing, they might be unrelated. What do you have that's breaking right now?
Just a simple find statment
It works fine without a component key (for a while) but if given one or after a few hours it just decides to display an error with no changes.
Hello, my template stopped work. Before that a warning that i exceed something had appeared. Would love help on the matter.
Foundry.js:655 Error: An error occurred while rendering TemplateSheet 90. Maximum call stack size exceeded
at Hooks.onError (foundry.js:654:24)
at foundry.js:5795:13
The first is the exported template sheet, and the second the error that appears on the console
Then you probably have a faulty Component config in the JSON. What you can do, is trying to find the faulty Component by deleting Components in the JSON and reimporting the Template. Try to start with a big chunk of Components (e.g. a whole Tab) and try to go down in the hirachy when you find the right Tab.
Just make sure, that you revert the changes if you go in the wrong direction
Is it possible to assing automatic status effects to tokens via CSB? Like when a value hits 0 like HP the token gets the effect 'Dead'?
That must be achieved with world scripts, where you listen for changes in the Actor and apply (and remove!) the status effect when needed
good evening! how is the initiative formula supposed to be written? 2d6+Total_Init is what I've been using, and it worked just fine in previous versions, but now doesn't add the 2D6
Hello. Sorry if this has been asked before, but is there any way to give players editing/input permissions for just a few components in an item (Some text boxes and a dropdown box) without giving them Owner role over the whole item? Alternatively, is there a way to give them Owner status over the instance of an item they drag on their sheet but not the core item itself?
No owner, no permission to edit at all. Ownership permissions are handled by Foundry alone, we cannot override that
And the owner status is inherited from the root Document, meaning that Actors automatically gain ownership of their own Items
[2d6] + Total_Init
Depends on what you want to do with those props. If you just want to list them, then ${propA}$ ${propB}$. If you want to add them together, then you have to use operators or functions: ${propA + propB}$
Yes, I know, but it's not working. I created a roll label inside my weapons Item Displayer. It is supposed to roll a formula like ${numStr + numHitBonus}$. It's not returning anything on the chat
You have to differentiate between Roll Formula and a regular Formula. Regular Formulas cannot process expressions like2d10 + 5. 2d10 is simply not a number, thus cannot be added to 5 and throws an error. Roll Formulas on the other hand do know how to process expressions like 2d10.
Regular Formulas are delimited by ${}$ while Roll Formulas are delimited by [] inside of ${}$
That's not the point. The rolls are working when I try this. The issue starts when I mention the props inside $$.
In this case, It was supposed to return a number that is a sum between numStr and numHitBonus, but it isn't returning it
Then give me more info. What's the error in the console? (F12)
I found the issue. It was the lack of the prefix "item" in the formula for the second prop. I've found a strange error in the console while watching it though:
Logger.js:33 Custom System Builder | No access to property "max" Error: No access to property "max"
at at (math.js:11946:23)
at math.js:24320:48
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:445:27)
at processFormulas (ComputablePhrase.js:195:29)
at ComputablePhrase.computeStatic (ComputablePhrase.js:242:34)
at ComputablePhrase.computeMessageStatic (ComputablePhrase.js:270:26)
at NumberField._getMaxVal (NumberField.js:88:47)
at NumberField.getMaxValue (NumberField.js:47:21)
Object
_logToConsole @ Logger.js:33
It's saying all time that an attribute.max value is returning error.
Seems to be the max-value of a Number Field. Do you have a formula at the bottom of the error message?
In the CSB settings for initiative, it specifically says not to include ${}$ though
Then skip those
Thanks!
Can you somehow add a button to an item displayer to add a new item with a certain item template?
Any idea why this keeps happening? I clear out the empty space in the filter box, hit Save, then some indeterminate time later it seems to add them again. I don't know what's causing this.
erm. yeah? Effectively you can make any button in an item displayer since it's just a label. You'd need to use JS tho to find and add the item
that happens for me too... i just generally ignore it and havent had an issue with it yet.
@formal goblet i still cant solve this
Am I doing something wrong, or can we not pass an object to a macro through the roll message?
%{return await game.macros.getName('YourMacro').execute({weapon: ${item}$})}%
it seems to send [object Object] instead of the item and I get the error>>> * SyntaxError: undefined. Unexpected identifier 'Object'*
How can I create a number field whose value is based on the state of a dropdown list?
You can't. Values of Number Fields cannot be dependent
Okay, thank you. Then how can i create text ( sutch as a label for example) that would change based on a numeric value?
In my system, monsters have different states, and I’d like these states to appear as text next to the token. I want to use this module for that:
https://foundryvtt.com/packages/healthEstimate
However, the Health Estimate Add-on can only monitor a numerical value on the character sheet and display the condition based on that number.
What I would really prefer is to handle this with a dropdown menu — for example, if I select “Enraged” from the dropdown, I’d like the token to also show “Enraged”.
But I’d also be fine with using a numbered field to step through the states — I’d just like it to display what each number means on the character sheet (e.g., 1 = Enraged, etc.).
Health Estimate, an Add-on Module for Foundry Virtual Tabletop
How could i achieve this?
Is there any other way to present text right next to the tokens?
Welp, came across a "fun" new limit I didn't know existed before. Heh.
You use either the ternary operator or the switchCase()-function to handle conditions: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#315-conditions
Question, How do I insert an image that can be edited by the players into a sheet?
Is that something I can do or will I have to add imaged manually
You can add images in rich text areas? Not very player friendly but it works
Hi I don't know if this topic has been covered. The files store History information (not just in the Json files). How can this history information be stopped or deleted from the files. This is causing issues where changes are made but the system refs to the history and continues use the history data.
Thks, and sorry for my late reply
It shouldn't happen, that the history data will be used by the Components. It's in a separate path and only contains the differential data
You can delete it from the Template by exporting, editing and reimporting it.
hello guys,
just a quick question. I would like to create a column in a dynamic table that contains a label that always points to the same compendium page.
I tried dragging the UUID of the compendium (Compendium.world.magus-szabalyok.JournalEntry.T264nJYuRWtnIt3J) into the label (this drag and drop works fine in the journal and compendium), and also copying it - but because it is a label, it does not become a link - but shows the UUID as text.
Is it possible to achieve this as a variable or in another simple way, so that the desired page appears when clicked on? Or is it simpler to build the description of the rules into the item?
Does something like that works ? <a class="content-link" draggable="true" data-uuid="Item.[ID]" data-id="[ID]" data-type="Item" data-tooltip="Item">[your text]</a>
(Remove the [] and replace them with your values)
Ah, sorry, you need a JournalEntry not an Item, give me a sec...
Try this maybe : <a class="content-link" data-uuid="JournalEntry.[ID]" data-id="[ID]" data-type="JournalEntry">[your text]</a>
Forget whatever I said, seems to work to make something draggable on the character sheet, but doesn't seem to be working to open a link to a Journal Entry, sorry.
thanks for trying. I'll work around the problem then and include the rules description in the item itself, rather than in the compendium. I'll probably get the information more easily from the item itself.
You can try out how it behaves if you drag it into a RTA (in Dialog editor mode)
Is there a way to search for a value within an array? I've looked everywhere I can't seem to find the answer i'm looking for.
I'm trying to use alookup with a confitional and im getting an error code saying that arrays arent supported
Can be done with a script. What are you trying to do exactly?
I have a dynamic table for a list of weapons, and one of the columns of the table has each of the weapons properties listed as an array.
I want a formula to be able to go through a given array and check whether a particular values is listed, returning either a true or false.
The column data is technically not an array, probably a csv string or something similar.
Sorry, im new to all of this. I have the column set up as a text input, and for each entry i've got array('prop1', 'prop2', 'prop3', etc...) I figured I needed that for it to work.
Either way, is there a way to do what i'm trying to do?
A text field only contains a string, not an Array. Where exactly have you used this formula and where is the target formula that should return true or false?
Really sorry, I dont come from a programming background, so I apologize if i'm not explaining things well. Theres a couple components in play here.
I have a dropdown thats key and name options are being pulled from a dynamic table full of weapons. In the same table, I have a text field with a series of strings listing their properties.
I have a seperate label, and I want it to display true if the weapon selected by the dropdown has a specific property listed in the aformentioned text field.
Here's how I was trying to get this to work.
If I use alookup('table', 'key', 'props', '~', 'propX', 'key', '===', dropdownKey) I can get the label to display the key name of the weapon selected in the dropdown if it has propX, otherwise it displays nothing. So I tried to combine that with:
${equalText(dropdownKey, alookup('table', 'key', 'props', '~', 'propX', 'key', '===', dropdownKey)) ? true : false}$
But I get an error in the console thats says that an Array is an unsupported type of condition
You get that because the return of alookup() is always an array, so equalText() fails to work with that
right, so is there another way to do what I'm trying to do?
I'd do it this way:
find('table', 'key', 'name', dropdownKey).split(',').contains('value')
Given that the values listed in the text field are comma separated
please forgive me, like I said, I've really not got much of an idea of what i'm doing. I put it into a label with the formula operators and i'm getting another error that says "no access to method "split""
Interesting... Then try this:
first(alookup('table', 'key', 'props', '~', 'propX', 'key', '===', dropdownKey)) ? true : false
it's telling me now that it can't convert the weapon to a number
Mhh, seems like not() doesn't work the same way as !. Then the old school way...
Does that mean it can't be done?
I've edited the previous one. Try that out
I was looking but didnt find anything of the sort so far
there is a way to spoiler text? like, it is hidden until you click it, then it shows the rest?
Create a Component, that contains the text and has a visibility formula, that is linked to a Checkbox or something else
yeap. this is beyond me.
Thanks for the reply. I have an example of dynamitic tables being changed and the template seem to refer to the old data. Which directory are the history files stored in? Thanks
I'm trying to learn how to use item displayers & items (I'm using Mythras for this).
I'm trying to use items for the skills and thus each skill will have a base % based on the actor's attributes.
My item template contains 2 dropdows to get the attributes to add. I can get the attribute keys without issues. But when trying to get the proper value either I get 'some props were not computed' or an error (No access to property). I'm looking at the item in the character sheet, so there is an actor.
I've already checked the wiki and searched internet, but still have no clue. How do I need to write a formula to access the actors properties from an item ?
You have to look at the scope. That's what you can access in a regular formula. You see that there's no actor-prop or something similar in there.
To get values of the parent entity, use fetchFromParent()
Thanks a lot, it now works. Back on tracks to do my first character sheet with items.
thank you, I did it 🙂
(just because it took a while, I'll write it down - maybe someone else will need it later)
1, I simply dragged the necessary description from the compendium to the hotbar - this gave me the hotbar macro for the article.
2, I named the macro.
3, I created a label on the character sheet, set it as a button, and inserted it into the dice code section %{return await game.macros.getName('MacroName').execute();}% where MacroName is the same as the name given in point 2.
Clicking on the button will immediately bring up the corresponding compendium page.
maybe not directly typical technical question but... what are benefits of usage skills as items ?
You just have to set them once (all the text), then just drag & drop them in your character sheet.
same you can define by dynamic table 🤔
After a day of work I've finished my item displayers for the skills. I just need to to do some CSS to remove the box around the names, set the column width & align all on the top.
You can't reuse your dynamic table skills on another character, you'll have to 'create' it again.
With items I just have to drop one in my character sheet and it will be all.
You can. You can create rows in the Template, which will be synched to every sheet
did someone say css? 🐽 🐽
The other reasons aside, there's the option to have skill description and other calculations happen on the skill item, as well as the option to do other things with a skill like stat mods from certain ranks or other item modifier related things if you like.
Hi, hopefully a quick question:
With the following structure:
weapontag (item) > weapon (item) > Actor
I have a button on the weapon, which calls keys from the tag for a roll message. It works as intended, using lookup() for the fields in the item displayer on the weapon.
Now I want to setup the same button on the item displayer in the actor sheet, calling keys from the weapon and from the tag.
Using item.key I can pull the keys from weapon, but I am stuck on how to call the columns from the tag, which are in an item displayer on the weapon.
I tried using item.key, or item.item.key (if that even makes sense 😅 ) and get no errors, just an empty return
I'm continuing having problems related to the Character Sheet not "refreshing" after a Formula has run. For instance, I have certain formulas that make updates to the sheet. However, the updates do not change the values, for instance, of fields until the sheet is manually refreshed, or another roll is made off of the sheet.
My question is this. Is there something that I can do in said formulas to force the sheet to refresh after the formula has run? Thank you! 🙂
To add to this, I guess there is a thing called application.render(); which can force something to refresh. What would I put there to force a Character Sheet in CSB to for a Character Sheet refresh as part of a Macro Formula as part of a CSB Formula?
Other people have had that issue. It's a fairly complicated script solution that LinkedFluuuush noted a couple months ago. Ill try to find it again when I'm back on my computer.
so im trying to tie a label to the dropdown in an item. in this case its the type of celestial the character is(Angel or demon) . I was trying to use switch case but am not sure if ive got this wrong or if its just not pointing at the right item on the sheet.
${(function switchCase(item.choir_band_type, 'angelchoir', Angel Choir, 'demonband', Demon Band ))}$
Remove function
And you have to use quotes for every literal text, otherwise it will be interpreted as a variable
like this? its still coming back as an error & I tried it with quotes around all the options & also this way.
${(switchCase(item.choir_band_type, angelchoir, 'Angel Choir', demonband, 'Demon Band'))}$
angelchoir and demonband are not variables, so use quotes.
its still giving me an error even if i have quotes on those.
Check the console with F12
its showing no access to the item?
Ah, yeah. You only have access to it within a Label of an Item Displayer
ohhhhhhh. ok let me try that.
ok thats got it showing, but anyway to put it on the left side instead of right?
Only with CSS
ok, well thanks for the assist 😅 i have no clue how to do CSS
You could also use fetchFromUuid(first(lookup(...)), ...) in your previous Label. Check the doc what these functions do first
ok thanks, ill take a look at that
how would i have an item retrieve info from the main sheet its on to do a calculation? vessels are items in this game & add/multiply off two of the corporeal stats on the sheet.
so ive been messing with fetchfromparent() but cant seem to even get it to register any of the parent sheets attributes at all. what am i missing?
${(function fetchFromParent(str))}$
im trying to make it work with this formula, but it wasnt working & I'm just kinda lost at this point.
${((vessel_rating+fetchFromParent(corporeal_forces))*fetchFromParent(str))}$
I'm always happy to learn more. So far I just know how to change colors (text or background) in a sheet elements. Not much but it is still a start.
Since an item displayer can show all item types (read template), you can have a displayer showing all your skills with a button to roll them and another for your magic skill showing specific information (like how many volumes of matter you can affect, base damage if it depends on your skill, etc). And since it will be the same items, increase you skill in one displayer and all the other will update.
If you know Chivalry & Sorcery, this would allow you to have a panel for skills and another for magic. Your skill in a weapon affect the action points used by an attack and the bonus damage. So it would be possible to use items for all of this.
read through that section half a dozen times & still lost
Use quotes around str and such. You pass the formula to the parent as a string
Take a look at the examples of the functions and try to imitate them as close as possible
i really am trying, but im not a coder, so this stuff is extremely difficult to understand for me. ive been trying every variation i can think of & im just shooting blind to the point of giving up
like ive done the quotations & its just not working
${function fetchFromParent('str')}$ like this doesnt even get it to appear?
Remove function. You'll never use that keyword
${fetchFromParent('str')}$
removed it, still not working.
Then open the console with F12 and check what it says
That one means that a dependent module is missing. Go back to the setup menu and install the module Chat Commander
so these commands are not part of CSB?
the fetch commands you suggested?
These are functions and they all come from CSB (at least the ones listed on our page).
Chat Commands adds the possibility to use custom /-commands in the Chat
ok lets back up a min. im not trying to do automated chat commands, im just trying to do the fetch from parent stuff that isnt working, & thats the error its throwing me. so is that option included in CSB by default or does it require this seperate module to make work?
When the world starts, CSB expects the module to be installed to register its' own Chat Commands right at the start of the world
is there a reason the system doesnt prompt you to install this by default then? it seems like a key dependancy given that the wikis code depends on this
i must admit quite a bit frustration that ive been effectively trying the impossible for a while now & the solution is to install something i had no simple way to realize.
It should actually prompt you. Don't know why it didn't happen
oh well hell. my apologies then if i was short, im installing it now.
ok its working now, with the following
${fetchFromParent('str')}$
it does require me to delete the current body metric if the str is updated, but its a win & I'll take it
it works!
${(vessel_rating+fetchFromParent('corporeal_forces'))*fetchFromParent('str')}$
i still need to figure out how to have it automatically update when they increase their strength & corporeal forces on the sheet, but this is the last bit of automation i needed
eh till i get it figured out i just tagged a reminder on the item for when people spend XP to upgrade their forces or strength.
is there a way to get rid of the -10 +10 but keep the -1 +1? or is that just static like that. i didnt like how the hovered version looked.
I offer 1:1 tutoring, and the tutorial I posted on yt covers some small things.
There's also a HTML CSS JavaScript course I followed on Coursera from John Hobkins University that's good at teaching the structural elements ( I didn't finish the JS unit because assignments instructions were broke )
Doesn't it already do that, since it's an item attached to the sheet. I think there's just a small delay?
No, that's how CSB provides it. But you can manually build +1 -1 buttons and style them to look the same.
I already watched the yt tutorial several times. It helped a lot when I started setting my item displayers.
It wasn't CSS focused but did touch on structuring and spacing elements. 🔥
I'll check my CSS/HTML books. Got a few some time ago in pdf format. Having some background can help a bit.
Actually you can almost certainly hide the first and last button with css. I just don't know the structure off hand.
😅 If you want to inspect the element and find it, there may be an easy way with a class or something, else you can always use the nth-child pseudo selectors
Hello, I have another question...
I created the items and spells using the CSB embedded items folder template so that I could drag them into the character sheet. In the meantime, it turned out - both item types have the same CSS template - but I want a different appearance for the equipment and spells.
I solved the problem by replacing the appearance in the custom CSS with the help of the unique UUID of the spells. I think the result is nice and it works.
But when I drag the spell into the character sheet, it gets a new identifier, which I was not prepared for - and thus the appearance of the spell on the character sheet is reset to the global settings.
If I create a template that modifies the appearance in the sheet configuration, would that solve the problem? I thought that I would copy the default template there, duplicate it, and rewrite the relevant lines. I just haven't found where that file is hidden yet...
You could try out this workaround: https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/231#note_1284412353
that layout is pretty dope dude
you can use the template ID as a class btw
hey all, im working on a roll macro which is a modification of what @daring thunder uses for their Draw Steel setup. The initial dialog pops up, but there's no roll message.
This here is the roll trigger on the label:
%{
game.macros.getName('DiceCheck').execute({
character_name:'${escapeQuotes(name)}$',
ability_title:'Acumen',
defaultAbility:'Acumen',
Acumen:${fetchFromActor(name,'Acumen')}$,
Logic:${fetchFromActor(name,'Logic')}$,
Brawn:${fetchFromActor(name,'Brawn')}$,
Finesse:${fetchFromActor(name,'Finesse')}$,
Mettle:${fetchFromActor(name,'Mettle')}$,
Vibe:${fetchFromActor(name,'Vibe')}$
});
}%
and the DiceCheck macro is attached.
JS is not a language i click with super well 😅
From the top of my head, it's because a Message created from a roll doesn't accept any form of content. (I might be wrong on that, can some else confirm or correct me maybe ?)
What I usually do in those cases is : first show the roll with roll.toMessage, then I'll create an other chat Message with ChatMessage.create to show a text message with the summary of the roll.
So in your case I would simply remove this line content: messageContent in your roll.toMessage call and then add another chat message with
ChatMessage.create({ content: messageContent, speaker: { alias: character_name, actor: characterActor }, });
Hope this help a bit
Not trying to sound impatient but is there an estimated timeline of when CSB will be brought up to v13? ❤️
Hello how are you guys?
I have some issues showing out a list of items from an item display linked to a dynamic table of the item type I need.
May you give me some basilar examples to filter like the equalText() command ?
I tried with something like
equalText('item.armour_zone','head')
But it showed all the armour items and not only the 'head'
When I come back home I'll send the stamp of the console
Scyrizu, you're right, as I look at it now a day later - there's still work to be done on the appearance 🙂
I started reading what you meant by your template ID as a class suggestion, but I'm just guessing - I still have a lot to learn in this area.
I tried what Martin suggested - interesting results 😄
if I put this code in the tag:
`<style>
.hide{display: none;}
._template .hide{display: block;}
div#EquippableItemSheet-Item-Ndx7SQE4TLhHs3jH,
div#EquippableItemTemplateSheet-Item-JhlZZjh3rDYPTLX3
{
margin-top: 0px;
padding-top: 200px;
padding-left: 65px;
padding-right: 65px;
padding-bottom: 80px;
height: 100%;
background: url(../ui/hatter16.png);
background-size: contain;
background-repeat: no-repeat;
}
/* YOUR STYLES HERE */
</style>
<!-- DO NOT REMOVE, THIS SHOWS ONLY IN THE TEMPLATE EDITOR-->
<div class="hide">GLOBAL CSS (EDIT)</div>`
then it will insert the background for the spell template and the given spell, and not anywhere else.
If I also insert the
div#EquippableItemSheet-Actor-a27SaOs60zEfsDjK-Item-WS9CecgYx5ZHXhbG
link, it will also replace the background on the item dragged into the character sheet. But as you can see, this is hard-wired into it - it wouldn't work for other characters and spells. So it's not perfect.
However, if I generalize and use this:
`.custom-system-actor-content {
margin-top: 0px;
padding-top: 200px;
padding-left: 65px;
padding-right: 65px;
padding-bottom: 80px;
height: 100%;
background: url(../ui/hatter16.png);
background-size: contain;
background-repeat: no-repeat;
}`
then it works fine on its own - as long as no other window is open. For example, when I click on the indented spell on the character sheet and the spell description window appears, the character sheet suddenly takes over the background - but only until I close the spell window - because then it returns to its original state.
It does the same with the other item windows. That is, if the spell description is open, then the other open windows will also take over the background image, and discard it and return to the original state when I close it.
I tried to put the same css formatting in the character sheet template to preserve its appearance. The result is that it applies the background of the last opened window to the other already open windows.
Hey so, how would I go about making a sheetroll from an item table actually function when not targeting the token itself
Quick question,
How do I use a key from an item as the comparison operator in a lookup function inside a fetchFromActor function, in a way that it doesn't look for the key in the actor I am fetching something from?
Clarifying context:
I have an actor with most of the dynamic tables I need, and want to look for keys based on an item's name. But if I use name in a lookup inside fetchfromactor it searches for the actor's name, not the item's.
I tested changing name to the actual value and the fetching is working, but I can't figure out the syntax to pass the name.
@formal goblet is this possible?
I think the generated Macro is outdated. That looks like some old syntax we used some major versions ago
The key should be something like WeaponStack.<rowIndex>.ActionDis
Ah yes, I can try that, I just dragged it over the macro bar
/sheetRoll SpelListInc(@rowId=7JCU3SXJ7C31CooU).Action is what the macro was written as
Wait thats a different macro but still a dragged one
@formal goblet /sheetRoll WeaponStack(@rowId=v2tOafMKYYAdYEQT).ActionDis yeah this only works when I select the token it's from. Is there any way around this?
I have been using this as a guide, but I must be doing something wrong, so this is my formula:
${fetchFromActor('mastertable',"lookup('signsystemstable','signsystemtype','signsystem',name)")}$
It runs in a label in an item named "test item" (not an item displayer). "mastertable" is the actor with dynamic tables.
For testing, I changed it to
${fetchFromActor('mastertable',"lookup('signsystemstable','signsystemtype','signsystem','test item')")}$
and got the value I wanted, so I assume the formula is using the name "mastertable" instead of the name of the item it executes from.
I tried using item.name, but I don't think that's how I am supposed to do it, it would work in an item displayer, referencing the key in the item, right?
const actor = '';// Your job to get the correct Actor
actor.roll('SpelListInc(@rowId=7JCU3SXJ7C31CooU).Action');
It is from an item container, I imagine thats got something to do with this
Thank you
oh
wait
LOL
nvm
Just read it, my bad
You're the best
${fetchFromActor('mastertable',"lookup('signsystemstable','signsystemtype','signsystem', '${name}$')")}$
Oh, I see it now, thank you!
On the Item Displayer, what does the "filter items" option actually do? I'm selecting a template, but items with that template are still showing up in the Item Displayer list. I was under the impression that it filters out the items with that template to show up on the table.
nvm i figured it out lol
other way around
okay so weird situation here: in my custom character sheet I have a section thats essentially Temp HP. Im trying to get this value be displayed as a bar on the token via the resource bar. issue is i dont have a maximum value set for it, and if i do set one the bar isnt full or its barely visible. idk if theres anything that can be done with csb or if its just a base foundry thing got it figured out with Bar Brawl!
i added this, then removed it, and now foundry seems happy and it just works?!? thanks lol
I'm going to be honest I'm not following what you're saying here 😅
But if you get the template id (by clicking the copy uuid button at the top left of the template sheet), and removing the prefix, so it's just the string of characters you can use that as a class that effects all actors or items built using the template -- so for me I use the player character template as a class to style all player characters 😅
Oh well thanks to the CSB tutorial on YouTube I resolved
thanks for the detailed explanation. It seems to be working without any problems at the moment 🙂 👍
is there a way to drag one character sheet onto another as an openable item? sorta like using the item displayer & then just opening to a connected sheet?
this is for a type of character resource called servants that are just entire other characters
How do I implement negative numbers into my sheet?
I'm trying to add a negative number and it spouts an error
Hello, I had the exact same problem and the only solution i found was to insert a macro code to force refresh the sheet after the roll.
if I want to use the same sheet in another world can I just transfer the templates via compendium or what is the way to do it?
You can either transfer them via shared compendium, or use the export template feature.
hello everone, i just update foundry to version 13, i saw that csb core ain't ready for the new version (yes, i make backup's before v13)
should i wait for csb be ready to v13 or should i reverse to v12?
I have a campaign next week in a world I created, I'm without haste
You can just make the servants items and have a section on PC character sheets to list the servants under an item displayer.
Might require more work to format the item template, though.
This was the solution set that LinkedFluuuush provided in September for someone having the same issue.
Inevitably you'll find errors in v13, but how bad this is -- we won't know till it's happening.
Personally I'll be waiting to move to v13 for at least 4 months
There is a command fetchFromUuid:
function fetchFromUuid(uuid: string, formula: string, fallback?: Primitive): Primitive;
I have an item UUID Item.M2a7xNed5FSr7ubJ
I need an attribute test from it.
So we get a command ${fetchFromUuid('M2a7xNed5FSr7ubJ', 'test', 2)}$, which fallbacks as 2, if it doesn't find anything.
The problem is, that it always fallbacks to 2.
Is there something wrong with the function or in my understanding of it?
thx, i returned to v12, it's all good
why do you send me an api guide? I'm just trying to use a thing from the main GitLab guide
And yes, i've used Copy UUID on the page i wanted, so everything must be okay if i'm not wrong somehow.
The UUID contains the whole text (including the Item.-prefix), while the ID is the part without the prefix.
Okay, thank you, it worked. Now i have another little problem. Example from "Readme" wiki on GitLab is wrong.
Yeah, I noticed that. Luckily it's the only wrong example
Now, in what order do i have to put my commands to lookup from dynamic table by UUID?
I'm lost)
The UUID is your filter criteria?
No, i have an item, that i read by UUID, and i need to lookup a field in a DT in that item
I have like a database inside an item and i need to access it from multiple places
Is it possible at all?
Then first comes fetchFromUuid() and inside of that you use lookup()
Finally managed to get it to work, thank you.
${fetchFromUuid('${SizeConverterUUID}$', "find('Size', 'LiteralSize', 'Number', '${Size}$')", 2)}$
Had to use double quotes and to quote dollar brackets, but now it works!
Somehow 4 is not equal to ${4}$
Man I am loving Custom System Builder.
I'm working on implementing Valor and am having such a weird issue at the moment. The same formula that works in the Label Text doesn't work in the Label Roll Message of the same component. Any ideas why that could be the case? I've checked for rich text formatting or copypaste changes causing issues and can't narrow anything down.
This particular component is a label-button as a column in an Item Displayer
I can post the code but since it's working in one place maybe I can save myself the embarrassment of my spaghetti code if there' something else I should check first
The error message in the console (F12) is always helpful
Thank you!! I'll dive into this
Thank you, solved! My formula had an issue in it (a hidden variable name change) but I guess the Roll checks the full promise while the label maybe check for switchcase parts it didn't need
I’m making a sheet for a game where with multiple armor types. Primary armor assigns the baseline defense/range of movement for a character while additional armor (such as shields or helmets) modifies those stats. To that end, I’ve created an armor template with radio buttons that determine whether the item is primary armor or one of the secondary types.
Within the character sheet, the item displayer is supposed to return baseline stats if the primary radio button is active or a text string if it is not. Instead, it’s only returning the baseline stats. What am I doing wrong?
${ item.armortype ? concat(big string of primary armor details) : item.descriptivetext }$
Changing the radio button within an item has no effect, the only way to get the secondary text string is to change the condition to false (item.armortype=0)
going on a limb here since there's a lack of details in this department, but i'm assuming there's something wrong with your radio button settup.
For example, are they all in the same group and do they have values assigned?
Yes, the group is “armortype” with primary armor set to “0”, helmet to “1”, and so on
These are strings btw
That could be it!
Hi,
the Deathwatch Template doesn't roll attacks. (Edit: Foundry 11 and CSB 3.0.0)
I have fixed it so far that everything works but it simply puts the damage as a string into chat.
the code in question:
<strong>Damage:</strong> ${#dam:=[${sameRow('dmg')}:d10]+$dmg_bon+mel_dmg}$ ${!sameRow('dmg_type')}$ (Pen: ${!sameRow('wpn_pen')}$)<br>
<em>!!! Check for minimum damage on 1 die (${!dos}$) and Righteous Fury !!!</em>
can someone help me find the error?
Check your delimiters. Every ${ must have }$ later on
they look all accounted for
They don't
There are 3 different errors, with 2 using uncomplete characters and the third one is missing a closing one
the one that's missing the closing one is in the [] right? (totally overlooked it even after your hint)
I assume bon_dmg and mel_dmg are the incomplete ones but I can't seem to get them to work as the function doesn't work at all now
Treated it as a string/refined the code and it all worked! Thanks!
Or you just remove the $ at dmg_bon
Thanks for your input!
${[${sameRow('dmg')}$d10]+${sameRow('dmg_bon')}$+mel_dmg}$
this was works now
Edit: (the rest of the code was fine)
Hello ! I'm here for some news !
- For those of you who are enthusiast about v13, please be patient. I fully intend to update the system to v13, but it will take some time. I'd like to finish some features before then.
- Notably, I would like to finish the feature I am currently working on, which is Customizable Active Effects.
- And another feature after that : Application V2 migration. I have started the work on this feature, but there may be some hidden catches. That's why it will be an opt-in system, and then an opt-out system, until Foundry decides to drop Application V1 completely.
- One more thing... The documentation has been reworked to be easier to navigate and link to. It is now in the CSB wiki ! https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Home
There are multiple goals to this transformation :
- Ease of access and linking. I'm aware that the current README is painful, especially since anchored links tend to not work at all. In the wiki, everything has its own article, or at least the articles are way smaller, so finding what you search should be easier
- Ease of translation. I set the base work for translating the docs, I still need to write a guide on how to contribute for those of you willing to do so, but the docs should be easier to localize too.
- Feedback. The Gitlab wiki allows for comments. So please don't hesitate to comment on it, to add examples, tips, or feedback on the docs, if you think some things should be changed !
Well... This is it for now. Enjoy CSB, thank you for your support, and see you later ! 🙂
/sheetroll doesn't work from a roll message, right?
ive tried putting it in a concat('/sheetroll ',string(formula)) too but it didnt work either, so i assume its not intended? i feel like it used to work a version or so ago
I've got a slight problem, because i don't understand how radio button works, and because of that i don't understand why it doesn't.
So i want to make a multi-type weapon. It is a sword, but it can do either slashing, piercing or bludgeoning damage, with either blade, tip or pummel, or a halberd, that is an axe(with slashing) or a spear(piercing). For that I've made a Dynamic table, that holds those combinations. Now just need to make a radio button, that can let me switch between them.
On the screenshots i have a Dynamic Table Types, where the ChosenType row is a radio button in ChosenWeaponType group, that has to take Type from the same row as it's value, but it behaves as if formulas are not allowed in the value field, even though it says they do. I've got a little debug on the bottom, which says, that the ChosenWeaponType is ${sameRow('Type')}$, instead of reading it.
And now it works sometimes, but only if i change the table, from where they take their types, and stops working when i try to choose a new one.
Radio Buttons do not work well with Dynamic Tables
Hello @restive nymph , this module work fine for css and with no F5 :
https://foundryvtt.com/packages/custom-css
Custom CSS, an Add-on Module for Foundry Virtual Tabletop
Howdy y'all! 2 small questions as I dive deep.
1:If I wanted to setPropertyInEntity to set something to a string, any ideas? It does work if I reference a attribute that contains a string, but I want to enter my own. string() and escapeQuotes() didn't seem to work.
2: It looks like %{scripts}% don't respect being inside conditionals, which makes sense. How should I do this?
${item.turns == 1? %{linkedEntity.delete()}%:
setPropertyInEntity(
'item','turns',item.turns - 1)}$
- Use quotes inside quotes, e.g.
"'x'" - The innermost formula is evaluated first. You have to check within the script itself
Thank you, I've gotten both instances working!
%{${setPropertyInEntity('item', 'turns', item.turns - 1)}$
return ${item.turns}$ <= 1 ?
linkedEntity.delete() : ''
}%
(Writing it this way for learning purposes).
I need to evaluate item.turns at 1, not 0, because it will evaluate the conditional either before setpropertyinentity is evaluated or before it's completed, despite setproperty being 'deeper'.
Is the issue that setpropertyinentity is going through the slower ${}$ route? How would I go about setting the linkedEntity 'turns' variable within code without ${}$s? (sorry, I promise I've tried figuring this one out)
Don' worry, you can't know this.
The updates from setPropertyInEntity() and setValues() are deferred until the end of the Label Roll Message, meaning they don't happen immediately with the call.
The updates are deferred, but the return values are not. So you can just grab the return of the function and compare with that
Ah, makes sense! Thank you!
@formal goblet i finally solved the component key bug, though I'm unsure of why it was manifesting itself that way.
I had some code populating a dropdown with a list of all actors of a certain template. This code was paste into both the key and label portions of the dropdown formula (assuming this would make the key and label both the actors name.
Somehow someway, this was making the data-value="actorname " with a space at the end, which wasn't errors in normal references or math functions, nor in console. Yet, for some reason if any component using the actor name got a component key, it would suddenly say error with no further information.
Removing the code from the dropdown label population (leaving it in the key), and adding another column referencing the same row result (and using that to reference outside of the table without needing to reference the dropdown) works. Unclear as to why, but here we are.
Is there a way to add a css class to the root element of a template?
Hey, finally jumping in to learn CSB, following this video: https://www.youtube.com/watch?v=b2XcMGpjLiY
Might have a lot of questions - apologies in advance! 😅
This tutorial covers the basics to intermediate functions of CSB without the use of JavaScript. We cover item / actor templates and sheets, as well as what most of the components do at their core.
We do not cover CSB provided functions, or advanced uses of components (aside from the label), which will be left for another tutorial if there's en...
What version of CSB are you running, I had this issue for awhile then updated the version then all started working
Quick question, how do I create a label which needs to return the value ("label") for a dropdown key?
Here's my use-case. When I set a new Label to ${reputationRating}$ it returns the Key, not the label (which makes sense). But it should return something like A (d12) or C (d8) - what's the syntax to make this work?
(I'm running CSB v4.4.2 in Foundry 12.331)
The Label is just visual. You don't have access to those. You can only try to map the key values with switchCase() or you rename the key parts to match the Labels
Ah, renaming the key values is a great tweak, thanks!
does the update break csb? (ver 13)
Hello, everyone!
I'm new to Foundry, moved from Roll20. I wonder how can I make roll dependent from radio button?
I have label button for roll and radio button for explode dice/not explode
Like if button enabled roll will be
[!:(skill1_val+skill_mod):d6x]
and when disabled
[!:(skill1_val+skill_mod):d6]
when i tried to merge them in condition I got both of them rolled
${#roll_mod:= condition ? 'x' : ''}$
${[!:(skill1_val+skill_mod):d6:roll_mod:]}$
Thanks! Will try
%{
${alookup('status_list','id','applied_by', '===', status_combatant_check)}$.forEach((status) =>
console.log("test"))
}%
Thought I was gonna get to be clever. I want to press a button (roll the label turn_down) on all rows where this evaluates true. I think I'm back to the issue of evaluation order though
ReferenceError: [relevant id] is not defined in eval
The return of ${}$ is a bareword (not even a string, like in shell programming)
This would work:
"${alookup('status_list','id','applied_by', '===', status_combatant_check)}$".split(',').forEach();
Indeed it did, clever! I had tried encasing it in string and array, but to the same effect lol. This actually answers several questions I had in one lol
Enjoy!
i'm trying to figure out if i can have my sheet reference a result in an item's item displayer, from a 2nd item
we added an item displayer inside the vessel item, to make it easier to drag & drop ready made roles. the item displayer in the vessel has no problem picking up the "nurse" from the role item, but when i do the same thing for the "Role name" on the sheet it gives me an error
so its showing no access to the vessel_role inside the item displayer....
so now ive given it access to the item displayer named vessel_role
and it gives this back.
i want to give it access to role_text inside vessel_role
but am unsure if thats possible with how CSB works?
Looks like you are accessing the object itself instead of the property. What does your formula looks like ?
${(item.vessel_role)}$
and i want it to access within that item displayer, called vessel_role, & pick out the role_text info, that its grabbing from the further nested role item
What dose ${(item.vessel_role.name)}$ gives you ?
nothing, it shows ERROR but then console doesnt show me anything
tried that with ${(item.vessel_role.role_text)}$ as well
it seems like it accesses vessel_role the item displayer, but im not picking up the displayers info
Not sure it's possible that way, but I did write a workaround that kindda work for my system.
Basically, the items and items on items are stored in the same collection on the actor so I wrote something like :
%{return entity.entity.collections.items.filter(i => i.system.props.hasOwnProperty('role_text').filter(v => ${item.name$} === v.parent_vessel_name)).map(v => v.role_text)}%
Assuming that parent_vessel_name is a field in Role that takes the name of the parent item and that there is only 1 role per Vessel.
(Not sure it will work as is, you might have to tweak it a bit. I adapted something that was not doing exactly what you want, but I think the idea is similar enough.)
I forgot to add the %{}% around the whole thing, my bad
I've corrected it now
and they have to be themselves inside a formula ${}$
sorry was eating, let me take a look at this real quick
Having used CSB for a little while, I can give you a tentative answer.
-
Probably, you will always have more flexibility if you build your own thing, but you can do a lot with CSB and I think it's well worth it for the simplicity it provides. I'd say go for it and learn. If you face insurmountable obstacles, then you could switch to building your own system, but you would at least have learn quite a lot by doing it with CSB first.
-
1d20 + agility for initiative is super easy. Then, I would personally add the luck score after the decimal point to have foundry handle tiebreaker organically.
-
Yes, you can use your own CSS style sheet and each element has a field that allows you to add CSS classes.
4 I am using Bar Brawl and it works well !
so it doesnt seem to be working, im wondering if it might just be a mix up of the tags, so going to clarify with you on this one @broken pumice
this is the one that the code would be located in, in case thats something its referencing?
If I understand what you are trying to do correctly, yes I think so
This is an Item displayer on an actor, right ?
i also think i confused a few of my tags, let me grab a screen shot of the next item
so this is on my main character sheet
and this is on the vessel item
apologies, i got a bit confused when trying to juggle 3 sheets worth of code at once
No problem, I know the feeling 😬
yeah honestly im learning but its slow going. 😅
What does your Role sheet looks like and can a Vessel have more than 1 Role ?
....let me check. i dont know if they can have more then 1 per the rules. currently they are programmed to just accept as many items as you throw on them
OK, let's try to make it work for 1 then and go from there !
so this is my role item
and "role_text" is the text field where you would put "doctor, rock star, CEO, etc"
So here is what I would do and why (I'll try to explain line by line the best I can) :
In Role Temple, add a label called parent_namewith in it ${fetchFromParent('name', {fallback: "No parent"})}$ That way, this field will take the value of the Vessel's name it is currently attached to.
Then on your actor sheet in vessel_list, vessel_role_display you will write this :
${%{return entity.entity.collections.items.filter(i => i.system.props.hasOwnProperty('role_text').filter(v => ${item.name$} === v.parent_name)).map(v => v.role_text)}%}$
The first part entity.entity.collections.items will go look at all the Items that are currently on the Actor, but we don't want them all, so we use the function filter to only get those we are interested in.
filter( i => i.system.props.hasOwnProperty('role_text'))
This part let us only take the Items that possess a role_text, so only the Roles can have that, but it will still give us any Role that is on the Actor sheet, including role from other Vessels. That's why we need the second : filter(v => ${item.name}$ === v.parent_name)
This time we access the item in the Item Displayer (so normaly the Vessel on that line) with ${item.name}$ and we take this name to compare it to the parent_name of the role.
i got the role template updated, & its working, but when i put the 2nd piece in, its giving me this.
figure we are missing a ) somewhere?
Might have misstyped, sorry...
oh no worries, this is helping me understand ALOT & i really appreciate it
hmmm, actually, I think we have one ) to many..
${%{return entity.entity.collections.items.filter(i => i.system.props.hasOwnProperty('role_text').filter(v => ${item.name$} === v.parent_name).map(v => v.role_text)}%}$
Like this maybe ?
no its still popping back the same error, hmmm
ok, just a sec
Ah yes !
${%{return entity.entity.collections.items.filter(i => i.system.props.hasOwnProperty('role_text')).filter(v => ${item.name}$ === v.parent_name).map(v => v.role_text)[0]}%}$
that one isnt popping back errors but is just displaying itself?
you have a typo after item.name
it should be }$ not $}
Well, that was my typo originally ^^ sorry again (not had my coffee yet ^^'')
fixed that part, but it looks like its giving us the ) error in the console again
oh i could not do this without caffeine 😄
I need to test something really quick...
yeah it looks like everythings solid as far as i can tell, no typos or missing )
We might need to add "" around ${item.name}$ so like that "${item.name}$"
hmmm, now its giving a new error 😄
new error means we are making progress ! (well, maybe ^^'') Let me look into it
lol thanks. im doing some rules input in between it all now
Try to remove the second filter for now, so like that : ${%{return entity.entity.collections.items.filter(i => i.system.props.hasOwnProperty('role_text')).map(v => v.role_text)[0]}%}$
That's what I have too now, but I feel I'm close to finding out why
(Apologies, I'm very not used to Javascript)
no worries at all. this is a minor thing mostly, i honestly feel like my players wont care, its just something ive been trying to figure out myself
I'm dumb.... I forgot the system.props the access the field...
Let's try this :
${%{let to_display = entity.entity.collections.items.filter(i => i.system.props.hasOwnProperty('role_text')).filter(v => ${item.name}$ === v.system.props.parent_name).forEach(v => v.system.props.role_text.concat(" ")); return to_display;}%}$
drat the console error returned.
${%{let to_display = ""; entity.entity.collections.items.filter(i => i.system.props.hasOwnProperty('role_text')).filter(v => ${item.name}$ === v.system.props.parent_name).forEach(v => to_display +=v.system.props.role_text.concat(" ")); return to_display;}%}$
that ones kicking back the same error.
tbh im not far from crashing so i can loop back to this at a later point. its mostly a puzzle at this point & not a game breaking problem
but thanks a bunch for helping me on this
It's strange because I have counted those parentheses at least 20 times and I feel there is parity... I'm thinking the error might be somewhere else, but I cannot find where
no problem, I see it as a puzzle too ^^ Sorry, that I wasn't bale to help better.
I know you have gone to bed, but maybe you will see this in the morning. I think this time it will work.
${%{
let to_display = "";
entity.entity.collections.items.filter(
i => i.system.props.hasOwnProperty('role_text')).filter(
v => "${item.name}$" === v.system.props.parent_name).forEach(v => { to_display += v.system.props + " " } );
return to_display; }%}$
Question about Dynamic Tables:
I would like to modify specific Values of a Dynamic Table (Screenshot) with Item modifiers. I know how to do that with a normal table where every entry has its own Component Key. But as dynamic tables only have Component Keys for the entire column, how can i do this?
Or is it only possible to edit manually with Number Fields?
Hey, new roll macro problem! I'm passing a dropdown value called SupplyDie to a roll macro which has it roll that size of die (dropdown screenshot attached). My macro is spitting an error when i click the button to roll it (error screenshot attached). I've also tagged on my Button roll message and the roll macro. Any help would be appreciated, as nothing is rolling :) Fixed!
is it bad practice to pass the value as the same name? probably but that part works just fine AFAIK :P
oh wait, i think i know whats happening....
Determine Tier is probably tripping it
also my roll message is calling the wrong macro
rookie errors!
you're probably gonna be wanting to use lookup or potentially lookupRef. not sure what you're trying to achieve but those two options cover most use cases.
lookup "extracts" values from the table, i want to modify them
Yeah i don't know of any way to do that, not with a dynamic table.
lookupRef might possibly be useful because it gets you a data-path?
not a thing i've tried to do unfortunately.
find can also get you a single value but again, 🤷♀️
The item modifier key must contain fetchFromParent("lookupRef(...)")
Wanted to share a progress update on my sheet for my system BEACON: most essentials and styling are there and we're almost fully ready to run sessions that arent just playtests! the only work now is getting features and items designed and made, and hoo boy that is gonna take a WHILE 😅
Is this a valid syntax?
Formula-delimiters are missing
im a noob - sorry 🙂
This looks great !
I should be creating Item and such for my system, but I keep procrastinating by adding functiunality.. So good luck with THAT particular grind XD
Must be done with CSS
Hello, still figuring out the system and haven't done the CSS part yet but my problem is with rolling in the chat bar properly.
I want to allow a Skill's d20 roll to compare to the Skill DC on the Actor sheet itself.
Currently I have the DC calculated by
${arcanaDC=profArcana ? 20-(2*statRSN) : 20-statRSN; arcanaDC}$which is [18]. How do I remove the brackets for a cleaner value?
Additionally, what I am looking for is the Arcana button to roll a d20 (+ 1d6 if Favor = true) (-1d6 if Hinder = true) with the resault saying "Pass!" if the value is equal to or higher than the DC. My code is currently this:
${arcanaVal=1d20+(favor+hinder); arcanaVal >= arcanaDC ? 'Pass!' : 'Fail...' }$
but the result is not showing at all and been trouble shooting this for a while.
Why the semicolon with arcanaDC right after it?
OH! okay that fixed the bracet issue, lol forgot to remove some code.
Ah, I see what you do. The formula syntax is similar, but not equal to JS. It has a few differences.
= -> :=
And actual roll formulas have to be additionally encapsulated with []
okay it is rolling now. Just have an Error issue now. That is much closer than where I was getting. XD
Going to remove some code to see if I can just get the d20 to roll first then come back to adding the Hinder and Favor mechanics but that did help me at least get rolls in now. Defaintlly will keep chipping away at this. I knew i was just squinting at this and missing just the tiniest thing LOL. This is what I got now.
${arcanaVal:=[1d20]+(favorVal+hinderVal); arcanaVal >= arcanaDC ? 'Pass!' : 'Fail...' }$
${#arcanaVal:= [1d20] + 0}$
${arcanaVal >= arcanaDC ? 'Pass' : 'Fail...'}$
OH Thank you so much! Okay that is a lot cleaner than whatever I was doing lol.
Honestly didn't know you can just use strings twice, thought it all had to be one string.
1 Phrase can contain as many Formulas as you like. You can even nest them (like in bash-programming, if you have experience with that)
Hey folks, I have a small fix for the Wiki:
The restructuring of the Wiki was based on an old version, meaning that the content it displayed was partially outdated. That issue got fixed, so all entries should be up to date now.
Hello all!
I would like to populate a dropdown inside an item with values from its parent actor. The actor has a dynamic table and i would like to to only select the entries that are marked in this screenshot:
So the dropdown list the Keys (and labels):
EHK
SK
These are the ones that are listet as "active" in my dynamic table
How do i do that? Do i need to choose the "Dynamic Table" Option or the Formula Option?
Formula option with fetchFromParent("lookup(...)")
Huh, you're able to use ß in a component key? Interesting...
Hello!
I'm trying to make a table with some constants to reference to. My approach is to make System actor and store every necessary consts there. To do so I have to fetch data from it and filter it. So I figured fetchFromActor is going to be handy. But I've got into problem with scripting feature. Seems like it doesn't work with arrays properly. Executing fetchFromActor('SysRefs', "alookup('The_Table', 'Dice')") returns an [0d6+0,1d6+2,1d6+2]. Then I tried to get an element by it's index, but I got an error. And I get the error even without accessing an element, just by returning an array.
%{return ${fetchFromActor('SysRefs', "alookup('The_Table', 'Dice')")}$}%
What am I doing wrong and what are good practices to store and get consts from ref tables?
fetchFromActor('SysRefs', "alookup('The_Table', 'Dice')") might return [0d6+0,1d6+2,1d6+2], but ${fetchFromActor('SysRefs', "alookup('The_Table', 'Dice')")}$ will return 0d6+0,1d6+2,1d6+2
So I should just parse a string into array?
If you want to access by index, then try to use sameRowIndex() in the table itself and filter by it with alookup(). With this, you can guarantee to only get the row data you're interested in and not data from all rows
'${...}$'.split(',') would be possible, yeah
I need to get an element by index, but the index is value from current actor. As far as I understand, it's not possible to inject values from current actor into fetch formula
Oh, now I see how it could be done. Something like ${fetchFromActor('SysRefs', concat("find('The_Table', 'Dice', 'Lvl', '", string(Atr_Str_Lvl), "')"))}$
Thank you.
Can be simplified to ${fetchFromActor('SysRefs', "find('The_Table', 'Dice', 'Lvl', '${Atr_Str_Lvl}$')")}$
Does anyone know how to prevent this from happening when showing an item with a description in an Item Displayer? I'd like for it to link to specific journal entries, but it doesn't seem to like that.
The quick links like that only work in rich text areas or journal entries.
So if I check "Use rich text editor for label" it should work?
I'm not sure, but I doubt it. That just applies inline css formatting to the label. You'd have to echo the item description to a separate RTA component.
hmmm
Well I suppose I can just get rid of the links in the item descriptions, my brain is too smol to do much else
You could make a truncated description to be pulled into the item displayer and then have the verbose one on the item.
Just curious while looking through the wikis. Are there any formula to make the Label Button into a toggle? Or would I have to use something else?
Like while active it applies a 1d6 to any roll and not active it just the regular roll? Or will I have to use the Radio Button to toggle things on and off?
Nevermind my question for now. Just saw this link and going to read through it to see if I can formulate the toggle with this info. 🤩 Such helpful info!
Hey, going a bit crazy trying to figure this out... Weapon damage is stored in Component Key weaponDmgVal as a Number field. How do I modify the Edit Component column to show the damage value? From the Git instructions, it should look like the below screenshot, but this isn't showing any values. I'm sure the answer is obvious, but I can't figure it out...
${item.weaponDmgVal}$
When you're working in an item displayer you have to give it the context for where to find the key; if you call a key from the character sheet you can just use the key, but if it's coming from the item you have to tell it so; hence adding the item. to the front of it.
Ah, thanks!
Hey i wanted to ask if it is possible to link an items effects to a character without the character having to be selected or targeted on the map.
So apply a modifier without setPropertyInEntity(Selected)
What does "linking an items effect to a character" mean?
so i'm changing values with an item on a token with a formula that takes stats stored on the item and transfers those stats to a storage variable on the player, modifying their stats
And you do that with item modifiers or with setPropertyInEntity()? Because both do not work together at all
i do that with setPropertyInEntity()
but i don't know how to affect a character that isn't on the map
i would like to apply those effects to the charactersheet in the sidebar
- You could switch to Item Modifier and Label (Actor) instead, adjusting the stat of your Actor as soon as the Item is dropped on the Actor (or with a Checkbox toggle in the Item)
- You could use
setValues()and fetch the UUID of the parent entity with a little script (because theuuid-property is only available with the next patch). The script would look like this%{return entity.entity.parent.uuid;}%
so i could replace the setPropertyInEntity() with setValues() and the UUID but that would limit the effect of that item to that singular actor right?
Uh, yeah. But is that an issue?
wait i think i misunderstood, the script would automatically fetch the parent uuid of the actor that is in possesion of it?
Yeah
oh yeah okay that's actually great then
Is there a reason why you use setPropertyInEntity() instead of Item Modifiers?
so i can have easily modifiable items
as well as being able to easily scour through all of the modifiers
I still don't see the reason against to be fair. They would modify your stats in your Actor automatically (and yes, you can make the modifier reference the stats of your item sheet)
Delimiters in value formula if you want to reference items stats instead of static values
gotta change my number fields to something else
to what kind of component do i have to change it so modifiers can be applied?
Label, Meters
ok i think it might be working now
item unequipping is done via checkbox and a switchcase in my formula right?
A ternary operator is enough: checkboxKey ? 'yes' : 'no'
that is a lot easier than the other method i implemented
well anyway thank you very much
Hey I think I'm doing something wrong, how do I fix this? I want a -1d6 to the total dice roll if a checkbox (key: dazed) is marked. But when I test it out only 1 dice gets rolled.
${!Roll:= '${!dazed ? '${[((1+:extraDie:-:lessDie:)d6)-1d6]}$' : '${[(1+:extraDie:-:lessDie:)d6]}$'}$' }$ <hr> ${!Roll >=4 ? 'Success!' : 'Failure!'}$
${#RollFormula:= '${!1 + extraDie - lessDie}$d6${!dazed ? "-1d6" : ""}$'}$
${Roll:= [:RollFormula:]}$
I tried copying it word for word but there are no rolls and nothing happens
ty for the help btw
corrected
still no rolls
check the console with F12
it shows this
corrected
It's working now! I apologize for the trouble and Thank you so much!!
To all CSB USERS ! fight with me. We all love ripper combat slider if you dont know please look here.https://theripper93.com/module/combat-tracker-dock i made request to make it compatible with CSB (is not currently) please vote with me! https://theripper93.canny.io/feature-requests/p/system-agnostic-carousel-combat-tracker if you see people active please resend this message!
it's not styled, but it's cleaned up and fully functional!
@cerulean trench you may consider something similar for your vessel system!
i made a template for a "party sheet" that references values from other actors based on the selected dropdown.
some limitations with updating HP values for example, my first attempt had an abstracted health display (ex if health > 45% display healthy) - but it wouldnt update unless the dropdown was changed to another value and back.
wouldn't be too hard to make a button that got the value of each dropdown, changed it to blank, then reset it (as a manual refresh) -- but i'm too lazy and it wasn't necessary.
Any kind of sheet update would suffice, e.g. clicking on a random Checkbox.
Is this the correct pathing to a number field in an item called 'Quantity'?
Seems so. You only have to consider, where the starting point of the path is and continue from there
nice! anyway you might be able to share this so i can take a peak how its laid out? ive mostly got my sheet where i want it, but im curious how you laid out yours
Doesn't seem to be working. I'll check the console.
oh really? 🤔 is there a way i can check for changes and force an update automatically?
World Script required
Nothing, I'll try to figure out where I might be missing something
oh, nevermind, got it.
pretty much just a bunch of referencing components, the hard part was getting the top skills to layout and add emojis by them which you can see in the component.
im trying to learn JS as we speak... is there a function or something I need to look at?
If you want to listen to certain events within Foundry, then you have to use Hooks in 99% of cases.
I'll read up on them then, thanks!
It's basically all Foundry doc, so you can't look it up in CSB
actually martin while you're here i do have a CSB question
can i use 'not' equal text for a visability formula somehow?
!equalText() for example
Did you ever figure this out? Stacks don't work for me in Griddy.
There's the not()-function from mathjs
Perfect, Thanks!
You might want to do CONFIG.Hooks.debug = true in the console to see, which kinds of Hooks exist, at which times they fire and what kind of data they provide.
excellent, playing with things is much easier to learn than reading docs
Yep. The rest is just syntax. You can take a look at a few examples with Hooks.on() in the macro polo channel to see, how to work with that
And also this: https://foundryvtt.wiki/en/basics/world-scripts
Foundry VTT Community Wiki
i figured i'd start by trying to build basic macros - add hp potion to selector actor's inventory, check if an item exists in actor inventory, use item.... etc
So, it's been another while, and I forgot how to check if a dice rolled its max value in a label roll, and then if it did, for it to alter a value of a number field elsewhere in the sheet. I'm trying to find mentions of that here to help guide me.
@silver lake Nope unfortunately not. I was able to make Griddy do stacks but for some reason Item Piles didn't interprate those stacks as currency. If you are able to solve this at some point please share!
Oh, but you were able to make griddy stack items of the same kind when they're placed in the inventory?
@fern Yeah it started showing a little white number at the corner of the icon. It had some problems (that I cannot remember cos I stopped doing it) but it definitely stacked them.
Damn, I thought it wasn't even a feature at this point. I've tried to get stacks to work so many times.
I don't even know how to work with item piles, and currency is just something I keep track in other ways, too.
Hello !
Quick question, I have a Dynamic Table that can contain duplicate values for example [A, A, B, B, B, D, F, F] is there a formula or combination of formulas that would allow me to get each different value only once -> [A, B, D, F] in this case ?
or should I go through a Javascript script ?
There's no built-in for duplicate elimination, so script it is
I have this formula equalText(fetchFromUuid(find('item_displayer_name','uuid', 'name', item.name), "find('dynamic_table_name, 'dynamic_table_column', 'dynamic_table_column', '${field}$')"), field) which correctly return true or false in an Item Displayer row, but return an error when used in the Item filter formula of the Item Displayer.
I suspect that is because find(...) return null when not finding anything and that it is converted in the label but not in the formula ?
I'm not 100% sure of what is happening there...
I tried putting the find(...) function in a fallback, like this "fallback(find(...), 'Not found')", but it seems that the error is thrown before the fallback can be evaluated.
Is there a way to setPropertyInEntity for multiple targets at the same time?
or do fetchFromActor(target) with multiple targets?
You will have to use setValues https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Formulas/Functions/setValues
and using SetValues would make it do 2 calculations instead of one and then apply those seperately?
I'm not sure I understand the question, but I think the calculation would be made once for each object you want to update then apply for each one.
for example i have setPropertyInEntity(target, health, health-damage)
which doesn't work for multiple targets
but Set values would do the calculation for both the selected targets
how would i go about getting the uuid of the seperate targets?
but then again i don't think fetchFromActor() can take the stats from multiple targets either
when you say target, you want the currently targeted token on the scene right ?
give me a second
yes i mean the currently targeted token on the scene
but i want to apply damage to multiple targets at the same time
so AOEs don't have to click through damage for each target seperately
setValues(%{return game.user.targets.map(t => t.uuid)}%,'health', "target.health - damage")
I think something like this should work, but I am not sure if you can update an actor if you don't own it. So Player Characters might not be able to update the health of NPCs, but don't quote me on that.
Can you guys please help me understand what this error message means? Happens when i drag an item in my actor.
A specific item, or any? Do you have a key called 'typ'?
hmm i changed the keys to the keys the actors and the item uses for damage and this happens
${setValues(%{return game.user.targets.map(t => t.uuid)}%,'HEALTH_DAMGE', "target.HEALTH_DAMAGE + PHYSICAL_DAMAGE")}$
Somehow I've gotten into an endless loop of all sheets recalculating themselves?
ok, so you need an array. You can try : ${setValues(%{return Array.from(game.user.targets).map(t => t.actor.uuid)}%,'HEALTH_DAMGE', "target.HEALTH_DAMAGE + PHYSICAL_DAMAGE")}$
My bad, you need to access the actor before being able to get the uuid. I've corrected the formula above
I copy-pasted your initial formula, but you might want to check if "HEALTH_DAMGE" is a typo or the name of your key
In previous versions I had
${ref(initiative_select) + initiative_bonus}$
but it just seems to error out now. How would I reference the selected attribute in the current version? Initiative_select being a dropdown menu
Oh yeah that definitely is a typo sorry
what error do you get ?
single actor is working
multiple actors is spititng out the same error from earlier
while not applying the damage
You probably need to force the string into an array again. Try this : ${setValues(array(%{return Array.from(game.user.targets).map(t => t.actor.uuid)}%),'HEALTH_DAMGE', "target.HEALTH_DAMAGE + PHYSICAL_DAMAGE")}$
Uncomputable token, or somesuch
as long as the key field of your dropdown is the key to the attribute you want, it should work.
unfortunalety the new Formula still results in this error
I need to go eat at the moment, but I will look more into it after dinner.
Thank you very much
${#%{
localVars.uuids = Array.from(game.user.targets).map(t => t.actor.uuid);
}%}$
${setValues(uuids,'HEALTH_DAMAGE', "target.HEALTH_DAMAGE + PHYSICAL_DAMAGE")}$
seems to work and correctly apply the damage
now i will probably have to make an absolutely huge formula to check against, dodge,armor and resistences for the damage
Is there an equivalent of fetchFromActor(target) that i can use in my Formula to calculate the resulting damage from their stats, the weapons stats and the attackers stats?
target.[Key] should work right?
Do i have to calculate everything concerning the Targets in a single formula or can i split it off somehow
Like a hitchance versus the dodge of the 3 different targets
And then i continue the calculation in a different formula
Or do i have to calculate all of it in the same formula?
Im having an issue with item modifiers, on my sheet i have a label mightScore on the item I have a number field mightNum, my modifier is mightScore + mightNum, but its throwing errors in mightScore and everythin it attached to.
getting NaN as the error
mightScore starts as ${10}$
the formula should add 2 from my test race
Forgotten delimiters in the modifier itself?
So formula for the mod should be ${mightNum}$
ill see if that works when i get back to my computer
idont have to item.mightNum do i with it coming from the item
?
No, modifiers are computed with the properties of the item
I'm far (very far) from being a knowledgeable person on this subject, but I've been trying to use items for a few days and banging my head on walls. If I understand mightScore is on you character sheet & mightNum in the item displayer (and the item itself).
If you want to display mightScore + mightNum in the item displayer, then you'll need to use 'fetchfromActor' for mightScore as it is not a property of the item but from the character.
If you want to display mightScore + mightNum on the character sheet (but not in the item displayer), it becomes a bit more tricky as you will need to use 'lookup' to access the items properties from the character sheet.
Hello all!
I'm wondering if it is possible to have the results of a roll from a character sheet populate a text box directly instead of/in addition to sending it to the chat.
For example
This serial number button generates a random 6 digit number and sends it to the chat. Could it instead appear in the text field below the button?
You'll want to use setPropertyInEntity() or setValues() for that. Chat Message creation can be suppressed in the Label config
Huh, that's a little over my head. If it's not too much trouble, could you give me an example? (and if it is, I understand, I'll stumble through it until I figure it out)
Hey, thank you.
@formal goblet thanks for the help adding ${}$ to the formula worked
I'm sorry for my ignorance here, but I'd put setPropertyInEntity() into a macro and have the clickable label run the macro?
You put that into a Label Roll Message, no Macro needed
Cool! I got it to work with numbers, but now I'm having a challenge with roll table results.
${setPropertyInEntity('self', 'nameTextField', '[#Trooper Names]')}$
I can see this is rolling on the roll table because "Draw without replacement" is turned on and names are getting greyed out. But, it is neither displaying it in the chat nor putting it in the appropriate box.
Nevermind. Needed double quotes.
Hello again.
Running into another problem.
I need to roll a d10. I need to compare it to the value in a number field. I need it to display the value of the roll, so [d10cs<=:faBox:] wont work because the chat just displays a 1 or a 0.
Ideally, I'd love for it to say "Success!" or "Fail!" after parsing the result. I swear I have looked at the documentation, and while it might well be in there, I am not seeing it.
Hello! Complete noob here attempting to try and find a way to add a Button on a character sheet that increases (as well as another one that decreases) the characters health by 1 everytime it is clicked.
I am using Custom System Builder, does anyone have any advice? It would be VERY helpful!
EDIT: I know how to add the button property, but not how to code it!
You don't need separate buttons - you can just enable radial inputs on the health block itself.
ok, how does one do that? I am a complete noob at this ^
Add it in a conditional.
${[Your code] == 1 ? 'Success!' : 'Failure!'}$
Uhhh could you show me a screenshot of the health block itself? Sorry, I can't open CSB on my own computer because I'm on v13 ATM, but I can point you in the right direction if I see it
I have a tutorial on yt that covers exactly this
Un moment
Alright ^
using number field
This tutorial covers the basics to intermediate functions of CSB without the use of JavaScript. We cover item / actor templates and sheets, as well as what most of the components do at their core.
We do not cover CSB provided functions, or advanced uses of components (aside from the label), which will be left for another tutorial if there's en...
48:42 ish
Thanks !
Oh, right, it's 'show field controls' on edit component.
Thanks also!
Absolutely. Tho sometimes the buttons are still useful. I have multiple hard coded buttons on my sheet
You can demand their size, always see them, and change how much they're changing
Yeah, I just assumed they were looking for field controls specifically xD
It is very useful to be able to edit components' values from other components, though, yeah
That's definitely the easiest option! Don't get me wrong, very useful for minor adjustments
I am attempting to create modifiers for weapons. As of now, I have 2 fields.
One is a number field, and one is a label field. The number field is Strength_Base, which is modifiable by the player as they earn stat points. The label field is Strength_Modifier. The modifier is used for the items I've created, and they work fine. The problems arise when I want to strictly add those bonuses if the item is equipped. I added a Conditional Modifier Group, then specifically used the Key for that specific Inventory and the specific Inventory equip key.
However, it will not work whatsoever. I've tried a handful of formulas.
W_Inventory_Equip === true ? 'Equipped' : ''
lookup('Weapon', 'W_Inventory_Equip', 'W_Inventory_Equip', true) ? 'Equipped' : ''
alookup('Weapon_Inventory', 'name', 'W_Inventory_Equip', '===', true).length > 0 ? 'Equipped' : ''
find('Weapons', 'W_Inventory_Equip', 'W_Inventory_Equip', true) ? 'Equipped' : ''
etc...
But none are working. Any ideas?
Conditional Modifier Groups are used for Conditional Modifier Lists. Using one without the other won't do much
Wait wait wait, I chose "Conditional Modifier Selector" for the type, I dont see "list" there.
Uhh, let me do some digging.
Ah, that's the right one. Forgot that it got renamed
Ya, I misquoted from the docs. But, here's a screenshot if it helps.
I triple checked the Inventory Names I have set up, and the keys are 👍🏻
Mouse over the info icon in the group filter formula
So, I was on the right track with
find('Weapon', 'W_Inventory_Equip', 'W_Inventory_Equip', true) ? 'Equipped' : ''
I did try this one before, but it didn't work either. Whats interesting is that the modifiers only stop working for items once I add the group. None of the formula's I provided worked either.
Try it without a group filter in the selector
The formula all together? If I remove it, the item still doesn't increase stats at all. I presume thats because its Group is "Equipped".
Yep, yeet the formula out
Once you do that, the selector should display all groups, that are in use and can be toggled on/off
Hi,
Stupid question but I can't find the answer 🙂 :
If I trigger a script from a PC/NPC datasheet made with CSB, how to get the corresponding token ?
(I want to display some text bubble above the character attacking)
how is v13 compatibility? any ETA?
Linked said it's going to be a bit, because he wants to go to appV2 compatability as well.
appv2?
What am I doing wrong here? In this game, players get an award for every 1000 aliens they kill:
${setPropertyInEntity('self', 'killBadgeBar', 'floor(:killsAllBox:/1000)')}$
I get an error with this one, and I cant quite figure out what I'm screwing up.
The key in the floor() doesn't need :: around it
Thats only for inside roll formulas.
Application v2, its a core Foundry API thing.
Thanks, worked like a charm
ok so overall improvement
Hmm. I'm trying to reference the CSS of sheets with a certain template without effecting the template. However when I try to use the UUID of the template as a class I get a "bad selector" error.
Code on the right works, but affects the Template as well. Code on the left give a Bad Selector. UUID is: Actor.98WSmyPYHEDnRa5V. Tried a few different variations and can't seem to get it to work.
To clarify that the copied uuid is from the template?
But also the color of the component id classes aren't green when leads me to suspect that that's the issue
Weird that adding the code on the right works tho. Triple check the spacing between the two selectors - make sure it's not a tab or something?
Also silly goose question, have you refreshed the actor sheet, saved the css, and refreshed the page for good measure? 😅 Because the css looks fine except the spacing maybe
The CSS is actually not fine. Class names must start with an alphanumeric character and can't be a number (if not escaped)
Whoops, should have caught that.
.\39 8WSmyPYHEDnRa5V .labelDefenseXXXXX
Works. 😄
Thanks.
!! I never knew that 😅 I always just heard that was best practice!!
I also wasn't completely sure. Seems like you can put almost anything into the identifier as long as properly escaped
Even emojies 😅
Not the emoji class, really brings a new meaning to vibe coding
./😤/👿/💢 {
For that one div that won't align properly
With a bunch of
! important tags to really nail that feeling of disgruntlement
So uh... Does a custom system builder exist?
Hello all! Im trying to figure out what the path is to an item held in the players inventory and more specfically a variable called Num_Held in that item, so i can access it from another module. How could i go about finding this ?
Try this guide here: https://github.com/GamerFlix/foundryvtt-api-guide/blob/main/macro_guide.md
GitHub
Hosting short guides to get started with FoundryVTT's API - GamerFlix/foundryvtt-api-guide
That's... uhm... yeah?
I think i got it. haha.
Cool, cool... So uh... What might that be called
Custom System Builder is the title of the system in the Foundry directory.
Now you're pullin my leg
Search for it in the add system dialog.
Well blow me down...
Hello, I have a quick question for Custom system builder and I can't for the life of me figure out item displayer / Item displayer filter formula.
I looked up on the wiki but the answer honestly didn't help in the slightest.
" Q: When I drop an Item into an Item Displayer, it also appears in other Item Displayers. How do I prevent that?
A: First things first, Item Displayers are only displaying Item, they do not contain them. All Items are stored
in the Actor. Just compare Actors with backpacks carrying your Items and Item Displayers with windows only displaying
what is inside.
So back to the question... How can we prevent, that an Item gets displayed in other Item Displayers? With Filters! Every
Item Displayer has an option to configure Filters. Not only can you limit the Item Templates an Item needs in order to
be displayed, you can also specify a Filter Formula. In this case, your Formula has to resolve to true for the Item
to be displayed. For example: An Item has the checkbox with the key equipped. In order to display only equipped Items,
your Formula should be item.equipped (and not(item.equipped) for only unequipped ones). You can construct more
complex logical expressions with and and or, you only have to make sure that the result is either true or false."
Could someone please explain how this works, Pretty much I want it to filter via a template for an Item say example '_skills'
Downgrade. CSB has no release for V13 yet
Is it possible to have multiple different versions at the same time?
It is, but you need a proper setup for that (e.g. Docker Containers).
May I am have direction? Or is it a Google search away?
- https://foundryvtt.com/article/configuration/
- https://foundryvtt.com/article/installation/
- Or google "Docker Foundry"
The official website and community for Foundry Virtual Tabletop.
The official website and community for Foundry Virtual Tabletop.
${#hitChance:=(([1d100]+(fetchFromActor('selected',"WEAPON_HANDLING_SKILL"))+HANDLING)*switchCase(RANGE_DROPDOWN,'CLOSE_RANGE',CLOSE_RANGE_MODIFIER,'NORMAL_RANGE',1,'LONG_RANGE',LONG_RANGE_MODIFIER))-(fetchFromUuid(uuids,'DODGE'))}$
is it possible to set a variable like this and then keep using it for more calculations for the different targets in an AOE attack?
The variables you set with := only exist for the duration of the roll message generation. As long as you are in the same roll message you can keep using hitchance as much as you like, but you'll have to use script to pull multiple targets like you would in a macro.
${#%{ localVars.uuids = Array.from(game.user.targets).map(t => t.actor.uuid); }%}$
multiple targets are pulled by this formula
but i get this error when executing it
`${#%{ localVars.uuids = Array.from(game.user.targets).map(t => t.actor.uuid); }%}$
${#hitChance:=(([1d100]+(fetchFromActor('selected',"WEAPON_HANDLING_SKILL"))+HANDLING)*switchCase(RANGE_DROPDOWN,'CLOSE_RANGE',CLOSE_RANGE_MODIFIER,'NORMAL_RANGE',1,'LONG_RANGE',LONG_RANGE_MODIFIER))-(fetchFromUuid('uuids','DODGE'))}$
${hitChance>=100?'Hit':'No Hit'}$`
this would be the thing i'm trying to test
it also doesn't work with a singular target
the same formula works when using setValues() instead of fetchFromUuid()
or am i using it wrong?
the documentation says to quote the first value in the command, so try it with ('uuids',...).
I would think that it would have a problem with an array though.
setValues is designed for an array input, so that's probably the difference there.
You might have to go to script with it and use a .forEach to make it work with multiple targets.
You can have two kinds of filters. The first is a filter by template. So if you only want your skills in the item display, this is the place to do it.
The second is by a formula, you'll only display what is true (in my case, I just want items that have 'Held/Worn' in a dropdown menu (this menu can't be displayed as such in the item displayer, you'll only see a label, but you can change it by clicking on your item).
The list of templates is automatically updated when you create a new one. And yes, I created a whole lot of them just for the sake of filtering them.
The script above returns an Array. An Array is a collection-type, which contains multiple values. An Array can also hold only 1 value or even none, but that doesn't change the fact, that it will still be an Array, even if it contains only 1 value.
fetchFromUuid() expects a String in the form of a UUID as the first argument. But you supplied an Array instead, so it errors
That's why every function mentioned in the Wiki has a Signature in the header describing 2 very important things:
- What does the function expect (input parameters)
- What does the function return (output)
ok so is there a different way of doing that?
You either use setValues() in perform all necessary calculations within the formula-part of it (because that can reference the stats of the individual targets) or you use a script an loop through all targets and apply updates all by yourself
I have a quick question.
I'm trying to have a Meter show a number based on another value that would be given in a table.
The Body score should be a variable, as it would be changed mid-game.
As an Example:
Body Score = 1 -> Meter shows -5
Body Score = 3 or 4 -> Meter shows 0
What would be the easiest way to do this?
Oh, and if it would be possible to reference the number the Meter shows.
The current value of the Meter can be accessed like with any other Component, with the Component key
Check the yt tutorial, I briefly cover that and custom filters
Thank you!
I see my issue I thought the templates shown where ones setup already via the example and not drawn from templates you make. So I was trying to figure out what the formula was for the templates ( cause I couldn't find any where that it mentioning in the wiki that the filters will auto gen on creation of a new item template)
Glad to help, I spent a few days last week banging my head on walls just to set my first item displayers. Now I'm trying to figure how to use them to make a multiple containers inventory (with one displayer per container and items 'moving' from one to another).
Once you start to understand how they work you can do some pretty cool things with items.
hi my column makes unneseserry rolls, any idea how to make it just roll one i need? ${switchCase(MAGK, '1', [1d10], '2', [2d10], '3', [3d10], 0)+magt}$
so recomendation is nested ifs?
nested ifs did the same
A roll formula will roll all the dice at first, then apply the rules. Best way would be to use ${[:MAGK:d10]}$ instead of a switchcase or nested ifs. Foundry will resolve the MAGK as a number then roll this number of dice. I'm not 100% sure of the syntax but it should do the trick.
i can just hard input dice numbers?!
i lost so much time in various places and there was such dumb proof solution.....thankyouuuu
Can anyone help me with a problem I have? I have a game system, where you roll 2d10, but can have up to 3 disadvantage/advantage dice (roll up to 5 dice, take the lowest/highest 2).
Does anyone know, how to write a Label roll message formula for that? I have the additional dice in a radio (-3 to +3)
maybe something like mine? Poziom mocy z modyfikatorem ${?{add|0}}$ ${[:2+add:d10]}$
just replace text field with radio
Well yes, but that is just 5 dice rolled then. Not roll 5, take highest 2
I guess the 'keep X dice' is the tricky part. You'll have to define the roll outside the roll formula.
I dont think this works
sorry not theat system. but there was shortcut to keep highest
kh?
${?{add|0}}$
${[:2+add:d10kh2]}$ it worksd i testeds
thanks a bunch. This is huge
you can replace add with radio options.
ah and what about take lowest 2?
It won't work at the -2 /-3 . You'll have less than 1 die to roll. Also is the number of advantages/ disadvantages is stored somewhere ?
KL
You'll need two different formula.
The number of disadvantages/advantages would just be a radio button on top of the abilities
I see. Well, that makes it a little bit more complicated then
if i understand correctly with :: you can injest also number of advatages or even if you do low or hi
${?{add|0}}$
${?{rot|0}}$
${[:2+add:d10kh:rot:]}$
you can same place something do choose if its KH OR KL (keep low keep hi)
${#additionalDices:= selection}$
${#rollMod:= selection < 0 ? 'kl' : selection > 0 ? 'kh' : ''}$
${[:2+additionalDices:d20:rollMod:2]}$
Otherwise use the label text to 'create' your roll formula :
Martin522's way is better.
showof! 😄 i was almost there 😄
I still tend to use brute force to get the result I want, but there are better ways to do it.
Question. was anyobody able to create roll with reroll mechanik? i never seen even one. I know it requires sequencer or something, but i would love to see example to reproduce
You can have a reroll and add, but not reroll and substact.
dont follow
[1d10xo10] will roll a d10 and if you roll a 10 it will reroll and add (only once). But in Cyberpunk when you roll 1, you need to roll another die and substract the result.
[1d10x10] will keep rolling and adding as long as you roll a 10
on reroll i ment ...luck mechanics. so you redo roling.
I don't know how to do the roll 1 then reroll & substract (making your roll worse) in a roll formula. I guess it is only possible in a macro.
The only way I know is to click on your label again so that It will roll again.
Such a luck mechanic should not be automatic, a player might not want to waste a luck point on a trivial roll. Better to keep luck points for life threatening situations.
i love when they use it up 😄 we have special mechanic that gives me posibility to force them to reroll good rolls when they use to much luck 😄
critical hit? Oh it would be sad if...yee reroll it
you cannot use raw javascript inside label text fields, correct?
For example if you wanted to populate and filter an array by getting the highest number from that array
can anyone explain, why
${8+[:max(AUS,INT,VER):]*2}$
is not a valid number?
AUS INT and VER are numbers
what's the error message?
And you don't need [] as this is not a Roll Formula
without the brackets I get an Error
Open the console with F12
I need the full message. A screenshot would be good
Does this help?
Colons out
okay, somehow it wont format
Musst einfach nur die Doppelpunkte aus der Formel entfernen
Greetings all! I've been using Sandbox for about a year, and I'm considering moving over to CSB. While I do like Sandbox, it hasn't been updated in a year and I don't see that changing anytime soon. Before I make the jump, I have a few questions:
-
How compatible is CSB with other modules? This has been a pain point with Sandbox, and I'm hoping that CSB is a bit more flexible (bonus points if I can get Automated Animations to work!)
-
Are there any newbie pitfalls I should be wary of? I have a lot of roll expressions I'll need to somehow convert, but I don't want to overdo it.
-
I'm not a coder/programmer, but I've managed to hammer out a system in Sandbox. Is CSB fairly comparable in ease of use/complexity?
Thanks ahead of time for your responses!
I would like to check the condition of a Rich Text Area Field, wether it has text inside or is empty. Can anyone tell me how?
There is [1d10r1] which will reroll any 1s once and [1d10rr1] which will reroll 1s until there are no more 1s in the result.
https://foundryvtt.com/article/dice-modifiers/
The official website and community for Foundry Virtual Tabletop.
You can try doing equalText(your-text-field-key, '')
Tried that first, doesnt work
Hello All,
I am trying to use the concat() function in a condition field but I have an issue when introducing some HTML to show the results. Is there another way to combine more operations?
.1. and 2. are covered here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Home#troubleshooting. You can also scroll up in the chat a bit to see, what is commonly asked.
.3. It's fairly easy without using calculations. With calculations, the complexity rises with the amount of calculations, but that's natural. What you can do is described here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Guides/Formula-System
Show me how you've done it
The RTA might contain <p></p>, even though it looks empty. Validate that by switching to the HTML-view of the RTA
and after that equalText should work?
If you do a comparison with the initial state of an RTA, then yeah
Is there a better way to check? Maybe the RTA had text which was deleted, then <p></p> could mess it up again.
Not really. You can check for multiple states, but that's it. You have to know, which content you consider empty and which not and explicitly check for that
average damage formula 💀
Well, that's a hell of a formula
had to make it that big so everything can be done inside of the setValues so AOE attacks work
Yeah, naturally.
I made a simple sheet for a highly 'intellectual' game called "Goblin with a Fat Ass" I also added a compendium in module form so you guys can just drag and drop class and equipment. Thank you to everyone that helped!
Edit: needs Custom CSS module for the css, just copy the contents of the css file
Instructions: https://github.com/kiwi64613/Goblin-with-a-fat-ass-FoundryVTT-CSB
GitHub
Fanmade Character Sheet and Item Sheet Templates for the game Goblin with a Fat Ass in Foundry Vtt using Custom System Builder. - kiwi64613/Goblin-with-a-fat-ass-FoundryVTT-CSB
And you chose to inflict it upon the rest of us?
I am missing some very obvious syntax here but I cannot for the life of me find out whats wrong
do I have to put parentheses or something around Str
I swear I've tried everything
I dont have the code infront of me now, but I counted the length of a text input field once and checked if it was > 0. I dont know if the same is possible with RTA
i think rolls need to be in []
so that 1d4 should be [1d4]
thankyou
can I make it roll 1dStr somehow
like if str is 4 make it 1d4 str=6 is 1d6 ect
${[1d:Str:]}$
ty!!!!
is there a way of adding formatting to the setvalue rolls?
Depends on the formatting. I've made it this way to have a way of debugging to see, which values are being set
well i was hoping i could have a bit space between the different characters it targets so it's easier to read
so instead of character => damage, character => damage
character => damage
character => damage
Wrap it with replaceAll(setValues(...), ', ', '<br>')
thank you, will try it out
worked perfectly 👍
I have a big roll formula for rolling skills and showing results in an table in the chat but I haven't been able to add colors for the result (SUCCESS, FAILURE, etc.).
I tried html code, CSS, using variable declared outside the table but none of it did work. Either I get errors (often because I need double quotes) or no colors.
Is there a way to do it ?
CSS should do the trick.
try <td style="color:red"></td> in one of your data cells
Will try again with CSS. Is there a way to use double quotes inside a formula ? Because it's the most common error I got when trying to get colored text.
Ok question. did anyone achieve putting damage on for example targeted enemy? untill now all i did was manual. Second question if that was a yes did anyone made atack with for example button to parry?
It's possible to apply damage to a target with setPropertyInEntity() or setValues(). Just be careful that whoever does that, needs permission for updating the target
Thats one good information. What about second issue? had you any idea about for example parrying? I have idea (workaround if there is no good alernative) for atacks to become items on targeted character (holding damage data modifieres etc) and for player to use buttons to parry (succesful destroys item) (unsuccesfull put damage). would it work?
Whatever you do, the second one will require substantial scripting if it's not just a Button with a parry roll on the enemy sheet
i already treat damage as items to heal each one seperatly. if i make seperate view for impending atacks in charavter sheet it if i create item those would be just scripts on item.
actualy i can use same items!
As soon as I use double quotes, the roll throws an error.
Currently the result cell contains a formula : <th>${!Roll <= round(SkillVE/10) ? 'CRITICAL' : Roll <= max(min(SkillVE, 95), 5) ? 'SUCCESS' : Roll <= FumbleVE ? '<td style="color:red">FAILURE</td> : '<td style="color:red">FUMBLE</td>'}$</th>
I guess i'll try moving the formula outside the table and fill a variable with the formated result.
I see. Try to surround it with escapeQuotes()
i did it like this <div style="color:${switchCase(item.jakosc, '-5', 'red','0' , 'black','5', 'dimgrey', '10', 'darkgoldenrod')}$";> <h3>${item.name}$</h3> </div>
Thanks, I finally managed to get the result I wanted.
I did create a few variables (less code to repeat) and used \ just before the double quote so that they are accepted. I might tweek a bit to use different colors, but it works.
${#Failure:='<td style="color:red">Failure</td>'}$
${#Fumble:='<td style="color:red">FUMBLE</td>'}$
${#Critical:='<td style="color:green">CRITICAL</td>'}$
${#Success:='<td style="color:green">Success</td>'}$
<th>${!Roll <= round(SkillVE/10) ? Critical : Roll <= max(min(SkillVE, 95), 5) ? Success : Roll <= FumbleVE ? Failure : Fumble}$</th>
If you have to use a quote or double quote inside a string (text variable), just put a backslash () in front of each quote/double quote. I tried with a slash (/), that was wrong. https://gitlab.com/custom-system-builder/custom-system-builder#44-use-text
i ask gor sugestion. as i list all damage dealt what would be better. holding it in dynamic table or as items? i dont want to bloat system
Probably Dynamic Table, but can't tell for sure, because I've never run performance tests for this system
I understand. but i wanted to confirm as i already have like 30 wounds (many healed on a players) and thats go for all characters even npc. we will have same amount of columns. as fields in item. so would 30entry table be better that 30 added items to character. multiplied by npc amounts 😄
ok before i go further. can i make roll create new line in the table?
Yeah, but requires a script
ok so you found my achilles heel. No example to rip off?
``${#concat(
?{Obrażenia|0},
?{Typ:"Typ obrażeń"[check]|0,"Stłuczenie"|1,"Rana"|2,"Opażenie"}
)}$
${#calc:=Obrażenia-RES}$
%{
if (${calc}$ <= 0) {
return 'Tylko muśnięcie';
}
return await game.macros.getName('Rana').execute({x: 0, y:number(${calc}$), k:${Typ}$, enit: entity.entity});
}%
${ HPL>0 ? (calc-HPL>0 ? calc-HPL : 'Nie'): calc }$ Krytyczna w ciało
`` my current for creating items as example
hey all, wondering if custom system builder is updated to a point i'd be able to fully build a system in more up to date versions of foundry?
and additionally -- if anyone could direct me to a place/person for coaching/help because my system might be really hard to adapt
The latest release of CSB is for Foundry V12. The update to V13 will take a while. And if you need help, you can ask here. That's what the channel is for
This may be a bit long and I have absolutely no coding experience, so bear with me:
The first image is the stat screen. The second number is a number field component, and is meant to be edited by players as they choose what stats they want to increase as they level up. The first number is a label component, which is meant to change as items or other buffs adjust their stats. Effectively, it is supposed to be their "current" stats, after taking into consideration outside changes (though it is currently not in a working state).
The second image is the inventory screen, but to make things simpler, the armor is what I was planning to test since it is supposed to directly change the defense stat. The template for armor is an item template (obviously) and it's stored in an item displayer on a separate tab in a tabbed panel component.
What I need help with is figuring out how to add the stat value to the armor, then make it so that by clicking the equip button, that the current stats will change on the stat screen (instead of just having the stats change simply by having the item in the inventory). I'm completely lost on this, so any help is appreciated.
You need Item Modifiers if you want, that your Items should modify the stats of your actor. Just use a formula like ${equipped ? defense : 0}$ in there.
I forgot to mention; The "Equipped" button is effectively just a visual here, it has no functional use besides being able to be checked and unchecked. Does the formula take into consideration the functionality of the "Equipped" button, or is there another step I should do?
You need a Checkbox in the Item itself or some other input Component, which saves the equipped state
Just to make sure: this is the formula for the "current stats" number. The item modifiers aren't working, so I'm wondering if the formula is conflicting with the item modifier formula.
It doesn't
But you should at least use default values in your number fields
I don't see the need to add by 0. It's a neutral operation, so it can be removed
Ah, I was worried that it would just always keep the number in the number fields on the label, instead of being modified, if it didn't have the + 0.
Labels can be modified regardless of what their content is
The item modifier formula isn't changing any numbers on the stat screen, even though I tested out both the default one you sent and swapping out the variables with the correct component keys.
Then show me the component key of the label you want to modify, the item modifier and all keys of the item you use in the modifier.
The images are in order. I'm not entirely sure what you mean by all keys of the item I want to use. As in, the component keys in the template?
The key in the modifier doesn't match the Label you want modify
Oh, the key in the item modifier should be the same as the key in the label?? I thought that'd conflict, or does the key in the item modifier not create an entirely new key?
It doesn't conflict. You actually have to enter the matching key
Right, that worked. Thanks, I appreciate you for bearing with me
Np
Really quickly, for the "Equipped" button, I basically took the structure of the button in the example template and put it over in my own, without it functioning to fit my template, which is here. Can I edit something in the component for the button to make it function with the item modifier, or would I have to put another component somewhere? If that's the case, would I have to put the component in the item or could I put it somewhere else in the inventory?
This snippet expects a Checkbox with the key Active in the Item
Ahh, I see, in the example item. Okay, thanks a lot, I would've been banging my head against a wall for hours
Is it possible to modify a Label roll message with an item modifier?
No. Why would you need that?
On the items I've made, you can roll its damage by clicking a button. There are stats on a character's sheet that would modify its damage, so I was wondering if there was a way to add that stat's modifier to the damage button. When I tried to just add the component key (for the stat damage modifier) to the Label roll messaage formula itself, it didn't work, so I thought you might have to do it on the item modifier menu.
You must save the damage mod in a Label or hidden Attribute then
I have it saved on the character sheet, but not on the item. These are my formulas (the key in the formula is the key of the dependency).
Use ! at the beginning of the second formula. And I think that whitespaces are not allowed inside []
${[1d120+100 +!${M_Weapon_ATK_Dependency}$]}$
I wrote it out like this, but it isn't working. Did I make a mistake somewhere?
! must go inside ${}$
Open the console with F12
What's the error message?
There's no error message being sent. The roll message isn't actually being sent into chat, the button just does nothing with the inputted formula.
Clicking on the button doesn't send an error message either
Then there must be an error in the console
Your key doesn't exist or doesn't have a value
This is the key on the sheet template
Does the component need to be a different type?
Label is fine. From where is the damage rolled?
Actually, do you have scope and formula at the bottom of the error message?
I don't think so. This is the whole error message.
The damage is rolled on a button on the weapon itself, not the character sheet.
And the atk-mod is on the actor sheet? That won't work, because Item and Actor are separate entities. By default, you only have access to the properties of the currrent entity
The attack modifier is on the actor sheet, since its value is modified by stats on the actor sheet. If that's the case, then manual math can just be my back-up
Thanks for the help again
You can use fetchFromParent() to fetch stats from the parent entity: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Formulas/Functions/fetchFromParent
hi, i'm in a bit of a pickle.
this is a inline script that i put inside a label to automate a skill roll.
and it works, the only problem is that in the chat happer 2 messages one with the result of the script, the other is an error.
i cant understand why and how to solve it.
Hello
Some of you had problems with CSB on the new version of Foundry running on The Forge' server?
Disable chat message creation in the label config
CSB has no release for V13
thx
Ehm... I am fucked...how I can get back from the last Foundry Release?
On Forge? Dunno
No on Foudry
You usually reinstall the other version and use a backup
V12
Is there going to be one?
Linked says it's going to be a bit because he's trying to make it AppV2 compatible in the process.
I need some help.
If I use the following ${Roll==20? 'Failure' : 'Success'}$ I get the appropriate response on a roll. This was my troubleshooting test. When I attempt to put what I actually want ${Roll<20? 'Failure' : 'Success'}$ I get ERROR.
Why?
What's the error in the console?
Unexpected type of argument in function bitAnd (expected: number or Array or DenseMatrix or SparseMatrix or string or boolean or Matrix or BigNumber or Fraction, actual: Unit, index: 1) TypeError: Unexpected type of argument in function bitAnd (expected: number or Array or DenseMatrix or SparseMatrix or string or boolean or Matrix or BigNumber or Fraction, actual: Unit, index: 1)
at M (math.js:6437:59)
at Function.oe (math.js:6725:51)
at bitAnd (math.js:6740:54)
at Object.evaluate (math.js:25781:48)
at math.js:24771:55
at Array.forEach (<anonymous>)
at Be (math.js:11759:41)
at math.js:24770:41
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
{formula: "Roll<20 ? 'Failure' : 'Success'", props: {…}}
formula
:
"Roll<20 ? 'Failure' : 'Success'"
Roll<20 ? 'Failure' : 'Success' --> Roll<20 ? 'Failure' : 'Success'
I put ${Roll<20?'Failure':'Success'}$
I am not sure why the log is saying <
It converts it if you use the Rich Text Editor
Ah...that is what I am using. How can I get that to work if still using the rich text editor?
Manually convert it back
So no using Rich Text Editor when attempting formulas like this?
You could, you just have to make sure, that you convert these parts back when leaving the editor 😅
Ugh...I just realized that right after I typed it.
Having issues with loading the Game World with this system but getting a error message about "Requires Dependencies:" without any explanation.
The module "Chat Commander" is required
okay, as an update on my prior message -- i went through and cleaned up my system to a point i feel its more presentable to an outside perspective. i have very little knowledge of javascript/coding, but i am willing to learn if someone else with more knowledge thinks it'd be feasible to implement via CSB, or put into foundry at all.
given my cluelessness/ignorance of what this seems to require, i dont really have any way of knowing whether something is truly possible or not. i can link to the trello & to an example character sheet for my system, or am super open to explaining as much as possible
apologies, i know this probably is not the best approach to CSB, i just have been really interested in exploring foundry as a platform for my system and migrating from google sheets, but i think it'd be best for my sanity if i figured out how feasible it'd be through someone more experienced before spending days to weeks on something that might not be the right option
looking through the gitlab it seems like it would be, but i don't know exactly how far it can be taken and i certainly have no idea how capable i am of working through it 😅
So i am getting an error for a dropdown option. Kind of want what a player picks for a drop down to appear as the Label not the Key information. Is there anyway to fix that?
The code I have is <b>Ancestry:</b> ${charAncestry}$ do I add a .label? or something else.
You can't get the Label option of the Dropdown, it's just a visual representation.
Gotcha. 👍🏽 Good to know
I've also used google sheets prior and then switched to CSB. Some knowledge about basic concepts of common programming languages is more than enough for this system to come far. At the end, it comes down to your use cases ofc, but that's hard to evaluate if you're starting from 0. Maybe the example module can help you figure out, if the system is feasible for you or not: https://foundryvtt.com/packages/custom-system-builder-example
Custom System Builder - Example, an Add-on Module for Foundry Virtual Tabletop
I feel like I am doing this string of code wrong. But not sure which parts I need to fix or look at in the wiki to find the solution. If I do multiple strings it makes multiple numbers but if I make one string it doesn't work as I thought.
${statDEX <= 2 : 25; statDEX >= 6 : 35; 30}$
Basically the stat equal or lesser than 2 makes the move speed 25, but if not then 30. Then also checking if the stat is equal or greater than 6 then it makes the move speed 35. But if it is not it still becomes 30.
${statDEX <= 2 ? 25 : statDEX >= 6 ? 35 : 25}$
${ IF ? THEN : ELSE}$
or, in your case: ${IF ? THEN : IF? THEN : ELSE}$, you can string them that way.
No problem, have fun with it!
I swear i need a rubber duck at times lol.
That's basically what the channel is like for me sometimes. I was working on a sheet and about five or six times I typed in my question then figured out what I was doing wrong just by seeing it typed here instead of in VSC.
Hey, I've got a handful of PCs built but the game we're playing has variable health (HP) values for each player. But in order for the attribute bars to work on the tokens, I have to set a maximum value on the attributes in question in the template. Is there a way to set individual maximum values per actor, without having to create a separate template for each actor?
Simply create a numberfield for the maxHP of the character. Then use the key of this numberfield in the max column for the actuallHP numberfield.
Eg: ${maxHP}$
You can hide it from the players – if they are not allowed to change this.
is there a way to get the attribute keys that other foundry modules use?
like if i have a component key called movement how do i get the attribute key so i can use it in a module like drag ruler
Script notation returns them.
So like if you were looking for system.attributes.movement, you could use %{return system.attributes.movement}%
Martin is, of course, the master of the appropriate links 🙂
ok neither actor.system.props.MOVEMENT
nor %{return system.attributes.MOVEMENT}%
seem to work
MOVEMENT by itself also doesn't work and doesnt matter if i add ${ brackets or %{ brackets
Ah, I think I misunderstood what you were asking about. Are you sure you can see MOVEMENT in the console at actor.system.props.MOVEMENT? Like you can assign the stat in a sheet, go to the console for an actor with it and see it?
hmm MOVEMENT and "MOVEMENT" also doesn*t work
yup, there it is.
I'm not sure exactly then, does Drag Ruler have some specific requirements for it?
if they do then i haven't seen them
oh, maybe you want MOVEMENT.value
i'll try
as in the whole path for it though