#Custom System Builder

1 messages · Page 54 of 1

velvet heron
#

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.

#

This is a good idea

sinful spade
#

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.

velvet heron
#

I'm not sure I have the kind of time required to do something that fancy

sinful spade
#

1 hour tops

#

but ok

velvet heron
#

Either way, I wouldn't be able to do it now, about to head to bed lol

sinful spade
#

btw

#

i just tested

#

You CAN use HTML in a panel title.

#

which means you can manually call font awesome through the HTML

velvet heron
#

That's rad!

I suppose css can also solve this issue of panels that are unable to be fixed-width like most other components?

sinful spade
#

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?

manic crypt
#

actor.img ?

sinful spade
# manic crypt actor.img ?

that doesn't specify what actor - also i thought that wasn't supposed to be added till the next version

manic crypt
#

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

sinful spade
manic crypt
#

that path would be a JS path, not CSB.

sinful spade
#

<img src="%{Actor.XCjaWnjDqDiU2Zk0.img}%">

#

no console error, the img just displays as 'error'

manic crypt
#

doesn't it need to be <img src="%{return Actor.XCjaWnjDqDiU2Zk0.img;}%">

sinful spade
#

Caused by: TypeError: Actor.XCjaWnjDqDiU2Zk0 is undefined
[Detected 1 package: system:custom-system-builder(4.4.2)]

Wouldnt it need a ;?

manic crypt
#

I think so, I just added it before you said that.

sinful spade
#

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

manic crypt
#

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.

sinful spade
#

${fetchFromActor(find('memberList', 'actorDropdown', 'tableIndex', 1, "=="), 'img')}$ -- no console errors just the label reading error lol

#

jeez what a use of 4 hours lmfao

sinful spade
#

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
sinful spade
#

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.

glacial citrus
#

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).

formal goblet
glacial citrus
#

so it needs to be attributes."x"?

#

👈🏾 very new to all of this

formal goblet
glacial citrus
#

I am a system admin by trade and script with Powershell and SQL, but coding hits different 😄

#

gotcha

formal goblet
#

PS is good enough to be fair

manic crypt
# sinful spade giving the functioning code a component key causes it to error, restarting the s...

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.

formal goblet
manic crypt
# formal goblet Well, that's what **providing context** is. CSB provides the context of the trig...

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?

formal goblet
manic crypt
#

how do I set the context in that script?

formal goblet
manic crypt
#

That isn't the template, the template is _Character

formal goblet
#

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.

manic crypt
#

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?

formal goblet
#

linked vs. unlinked Actor

manic crypt
#

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.

glacial citrus
#

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?

glacial citrus
#

no way... facepalmpicard

sinful spade
# manic crypt So.. <@155143448029167616> in summary of *my* floundering around this morning, t...

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

manic crypt
# sinful spade Dude I appreciate you sinking time into this at all, but I'm going to be honest ...

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.

velvet heron
#

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?

velvet heron
#

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.

sinful spade
# manic crypt So what's meant by linked is if the token's Actor data is linked back to the Act...

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?

sinful spade
#

Note that if your structure is
Div span p
Div p will still target it.
Div > p will only target p directly after div.

manic crypt
sinful spade
#

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.

tulip obsidian
#

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

formal goblet
#

Just make sure, that you revert the changes if you go in the wrong direction

heavy elm
#

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'?

formal goblet
civic finch
#

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

calm violet
#

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?

formal goblet
#

And the owner status is inherited from the root Document, meaning that Actors automatically gain ownership of their own Items

formal goblet
#

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}$

floral sequoia
formal goblet
floral sequoia
formal goblet
floral sequoia
# formal goblet 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.

formal goblet
civic finch
civic finch
#

Thanks!

oblique willow
#

Can you somehow add a button to an item displayer to add a new item with a certain item template?

velvet heron
#

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.

sinful spade
sinful spade
#

@formal goblet i still cant solve this

bleak marsh
#

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'*

raven raven
#

How can I create a number field whose value is based on the state of a dropdown list?

formal goblet
raven raven
#

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.).

#

How could i achieve this?

#

Is there any other way to present text right next to the tokens?

velvet heron
#

Welp, came across a "fun" new limit I didn't know existed before. Heh.

formal goblet
zenith yew
#

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

oblique willow
hard cedar
#

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.

tulip obsidian
formal goblet
twin goblet
#

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?

broken pumice
#

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.

twin goblet
formal goblet
regal valley
#

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

formal goblet
regal valley
#

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.

formal goblet
regal valley
#

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?

formal goblet
regal valley
#

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

formal goblet
regal valley
#

right, so is there another way to do what I'm trying to do?

formal goblet
#

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

regal valley
#

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""

formal goblet
#

Interesting... Then try this:

first(alookup('table', 'key', 'props', '~', 'propX', 'key', '===', dropdownKey)) ? true : false
regal valley
#

it's telling me now that it can't convert the weapon to a number

formal goblet
regal valley
#

Does that mean it can't be done?

formal goblet
regal valley
#

That worked! I have no idea why it worked, but it worked!

#

thanks so much!

supple latch
#

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?

formal goblet
supple latch
#

yeap. this is beyond me.

hard cedar
warm quartz
#

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 ?

formal goblet
warm quartz
#

Thanks a lot, it now works. Back on tracks to do my first character sheet with items.

twin goblet
# formal goblet You can try out how it behaves if you drag it into a RTA (in Dialog editor mode)

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.

fresh arrow
#

maybe not directly typical technical question but... what are benefits of usage skills as items ?

warm quartz
fresh arrow
#

same you can define by dynamic table 🤔

warm quartz
#

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.

warm quartz
#

With items I just have to drop one in my character sheet and it will be all.

formal goblet
sinful spade
manic crypt
west brook
#

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

lost wigeon
#

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! 🙂

lost wigeon
#

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?

manic crypt
cerulean trench
#

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 ))}$

formal goblet
#

And you have to use quotes for every literal text, otherwise it will be interpreted as a variable

cerulean trench
formal goblet
cerulean trench
formal goblet
#

Check the console with F12

cerulean trench
formal goblet
cerulean trench
#

ok thats got it showing, but anyway to put it on the left side instead of right?

cerulean trench
formal goblet
cerulean trench
cerulean trench
#

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.

cerulean trench
#

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))}$

warm quartz
warm quartz
# manic crypt The other reasons aside, there's the option to have skill description and other ...

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.

cerulean trench
formal goblet
#

Take a look at the examples of the functions and try to imitate them as close as possible

cerulean trench
#

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?

formal goblet
cerulean trench
#

${fetchFromParent('str')}$

removed it, still not working.

formal goblet
cerulean trench
#

ive no clue what any of that means

formal goblet
cerulean trench
#

the fetch commands you suggested?

formal goblet
cerulean trench
#

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?

formal goblet
cerulean trench
formal goblet
cerulean trench
#

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

cerulean trench
#

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.

sinful spade
sinful spade
sinful spade
warm quartz
sinful spade
warm quartz
#

I'll check my CSS/HTML books. Got a few some time ago in pdf format. Having some background can help a bit.

sinful spade
twin goblet
#

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...

formal goblet
sinful spade
sinful spade
lone patrol
#

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 😅

broken pumice
#

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

marble burrow
#

Not trying to sound impatient but is there an estimated timeline of when CSB will be brought up to v13? ❤️

verbal portal
#

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

twin goblet
#

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.

dire socket
#

Hey so, how would I go about making a sheetroll from an item table actually function when not targeting the token itself

west brook
#

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.

dire socket
formal goblet
#

The key should be something like WeaponStack.<rowIndex>.ActionDis

dire socket
#

Ah yes, I can try that, I just dragged it over the macro bar

dire socket
#

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?

west brook
# formal goblet https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Fo...

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?

formal goblet
dire socket
dire socket
#

oh

#

wait

#

LOL

#

nvm

#

Just read it, my bad

#

You're the best

formal goblet
crystal finch
#

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

ancient temple
#

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!

lone patrol
sinful spade
# twin goblet Scyrizu, you're right, as I look at it now a day later - there's still work to b...

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 😅

verbal portal
#

Oh well thanks to the CSB tutorial on YouTube I resolved

twin goblet
cerulean trench
#

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

charred prairie
#

How do I implement negative numbers into my sheet?

#

I'm trying to add a negative number and it spouts an error

fair yoke
shy osprey
#

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?

oblique willow
copper jetty
#

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

velvet heron
#

Might require more work to format the item template, though.

manic crypt
sinful spade
lilac panther
#

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?

copper jetty
lilac panther
#

And yes, i've used Copy UUID on the page i wanted, so everything must be okay if i'm not wrong somehow.

formal goblet
lilac panther
formal goblet
lilac panther
#

Now, in what order do i have to put my commands to lookup from dynamic table by UUID?

#

I'm lost)

formal goblet
#

The UUID is your filter criteria?

lilac panther
#

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?

formal goblet
#

Then first comes fetchFromUuid() and inside of that you use lookup()

lilac panther
#

Somehow 4 is not equal to ${4}$

flint sandal
#

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

formal goblet
flint sandal
flint sandal
zenith rover
#

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)

sinful spade
zenith rover
#

Yes, the group is “armortype” with primary armor set to “0”, helmet to “1”, and so on

zenith rover
#

That could be it!

past ivy
#

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?

formal goblet
past ivy
#

they look all accounted for

formal goblet
#

There are 3 different errors, with 2 using uncomplete characters and the third one is missing a closing one

past ivy
zenith rover
formal goblet
#

Or you just remove the $ at dmg_bon

past ivy
# formal goblet

Thanks for your input!

${[${sameRow('dmg')}$d10]+${sameRow('dmg_bon')}$+mel_dmg}$

this was works now
Edit: (the rest of the code was fine)

brittle moth
#

Hello ! I'm here for some news !

  1. 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.
  2. Notably, I would like to finish the feature I am currently working on, which is Customizable Active Effects.
  3. 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.
  4. 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 ! 🙂

civic carbon
#

/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

lilac panther
#

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.

lilac panther
formal goblet
manic folio
flint sandal
#

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)}$

formal goblet
flint sandal
# formal goblet 1. Use quotes inside quotes, e.g. `"'x'"` 2. The innermost formula is evaluated ...

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)

formal goblet
#

The updates are deferred, but the return values are not. So you can just grab the return of the function and compare with that

sinful spade
#

@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.

sinful spade
#

unstyled, but finally functional

arctic charm
#

Is there a way to add a css class to the root element of a template?

ruby spade
#

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...

▶ Play video
coral hemlock
ruby spade
#

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)

formal goblet
ruby spade
elfin fog
#

does the update break csb? (ver 13)

ivory gate
#

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

formal goblet
flint sandal
#

%{
${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

formal goblet
#

This would work:

"${alookup('status_list','id','applied_by', '===', status_combatant_check)}$".split(',').forEach();
flint sandal
cerulean trench
#

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?

broken pumice
#

Looks like you are accessing the object itself instead of the property. What does your formula looks like ?

cerulean trench
#

${(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

broken pumice
#

What dose ${(item.vessel_role.name)}$ gives you ?

cerulean trench
#

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

broken pumice
#

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.)

cerulean trench
#

thats sadly a bit over my head with the coding. its giving me this error though

broken pumice
#

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 ${}$

cerulean trench
#

sorry was eating, let me take a look at this real quick

broken pumice
#

Having used CSB for a little while, I can give you a tentative answer.

  1. 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.

  2. 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.

  3. 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 !

cerulean trench
#

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?

broken pumice
#

If I understand what you are trying to do correctly, yes I think so

#

This is an Item displayer on an actor, right ?

cerulean trench
#

i also think i confused a few of my tags, let me grab a screen shot of the next item

cerulean trench
cerulean trench
#

apologies, i got a bit confused when trying to juggle 3 sheets worth of code at once

broken pumice
cerulean trench
broken pumice
#

What does your Role sheet looks like and can a Vessel have more than 1 Role ?

cerulean trench
#

....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

broken pumice
cerulean trench
#

so this is my role item

#

and "role_text" is the text field where you would put "doctor, rock star, CEO, etc"

broken pumice
#

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.

cerulean trench
#

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?

broken pumice
#

Might have misstyped, sorry...

cerulean trench
#

oh no worries, this is helping me understand ALOT & i really appreciate it

broken pumice
#

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 ?

cerulean trench
#

no its still popping back the same error, hmmm

broken pumice
#

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]}%}$

cerulean trench
#

that one isnt popping back errors but is just displaying itself?

broken pumice
#

it should be }$ not $}

#

Well, that was my typo originally ^^ sorry again (not had my coffee yet ^^'')

cerulean trench
#

fixed that part, but it looks like its giving us the ) error in the console again

cerulean trench
broken pumice
#

I need to test something really quick...

cerulean trench
#

yeah it looks like everythings solid as far as i can tell, no typos or missing )

broken pumice
#

We might need to add "" around ${item.name}$ so like that "${item.name}$"

cerulean trench
#

hmmm, now its giving a new error 😄

broken pumice
#

new error means we are making progress ! (well, maybe ^^'') Let me look into it

cerulean trench
#

lol thanks. im doing some rules input in between it all now

broken pumice
#

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]}%}$

cerulean trench
#

hey no console error this time, but its just showing ERROR in place of any text

broken pumice
#

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)

cerulean trench
broken pumice
#

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;}%}$

cerulean trench
#

drat the console error returned.

broken pumice
#

${%{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;}%}$

cerulean trench
#

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

broken pumice
#

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

broken pumice
broken pumice
dense pine
#

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?

lone patrol
#

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!

lone patrol
dense pine
#

lookup "extracts" values from the table, i want to modify them

lone patrol
#

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, 🤷‍♀️

formal goblet
lone patrol
#

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 😅

formal goblet
dense pine
broken pumice
formal goblet
#

Must be done with CSS

plush maple
#

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.

formal goblet
plush maple
formal goblet
#

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 []

plush maple
#

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...' }$

formal goblet
plush maple
#

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.

formal goblet
#

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)

formal goblet
dense pine
#

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?

formal goblet
formal goblet
# dense pine

Huh, you're able to use ß in a component key? Interesting...

next tangle
#

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?

formal goblet
next tangle
#

So I should just parse a string into array?

formal goblet
#

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

formal goblet
next tangle
next tangle
formal goblet
brave oar
#

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.

manic crypt
brave oar
#

So if I check "Use rich text editor for label" it should work?

manic crypt
#

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.

brave oar
#

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

manic crypt
#

You could make a truncated description to be pulled into the item displayer and then have the verbose one on the item.

plush maple
#

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?

plush maple
ruby spade
#

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...

manic crypt
#

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.

ruby spade
#

Ah, thanks!

mint plaza
#

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)

formal goblet
mint plaza
formal goblet
mint plaza
#

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

formal goblet
# mint plaza i would like to apply those effects to the charactersheet in the sidebar
  1. 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)
  2. You could use setValues() and fetch the UUID of the parent entity with a little script (because the uuid-property is only available with the next patch). The script would look like this %{return entity.entity.parent.uuid;}%
mint plaza
#

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?

formal goblet
mint plaza
#

wait i think i misunderstood, the script would automatically fetch the parent uuid of the actor that is in possesion of it?

mint plaza
#

oh yeah okay that's actually great then

formal goblet
#

Is there a reason why you use setPropertyInEntity() instead of Item Modifiers?

mint plaza
#

so i can have easily modifiable items

#

as well as being able to easily scour through all of the modifiers

formal goblet
mint plaza
#

hmm i will have to look into it

#

this doesn't seem to be working

formal goblet
# mint plaza

Delimiters in value formula if you want to reference items stats instead of static values

mint plaza
#

gotta change my number fields to something else

#

to what kind of component do i have to change it so modifiers can be applied?

mint plaza
#

ok i think it might be working now

#

item unequipping is done via checkbox and a switchcase in my formula right?

formal goblet
mint plaza
#

that is a lot easier than the other method i implemented

#

well anyway thank you very much

languid hornet
#

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!'}$

formal goblet
languid hornet
languid hornet
formal goblet
languid hornet
formal goblet
#

corrected

languid hornet
faint wharf
#

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!

I’ve tried repeatedly to force Custom System Builder (and I suspect other non-native systems) to display sliders in the Combat Tracker, but CSB doesn’t use

sinful spade
#

@cerulean trench you may consider something similar for your vessel system!

sinful spade
#

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.

formal goblet
silver lake
#

Is this the correct pathing to a number field in an item called 'Quantity'?

formal goblet
cerulean trench
silver lake
sinful spade
silver lake
#

Nothing, I'll try to figure out where I might be missing something

#

oh, nevermind, got it.

sinful spade
sinful spade
formal goblet
sinful spade
formal goblet
#

It's basically all Foundry doc, so you can't look it up in CSB

sinful spade
#

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

silver lake
#

Did you ever figure this out? Stacks don't work for me in Griddy.

formal goblet
sinful spade
#

Perfect, Thanks!

formal goblet
sinful spade
#

excellent, playing with things is much easier to learn than reading docs

formal goblet
sinful spade
silver lake
#

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.

shy osprey
silver lake
shy osprey
#

@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.

silver lake
#

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.

broken pumice
#

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 ?

formal goblet
broken pumice
#

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...

broken pumice
#

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.

mint plaza
#

Is there a way to setPropertyInEntity for multiple targets at the same time?

#

or do fetchFromActor(target) with multiple targets?

mint plaza
#

and using SetValues would make it do 2 calculations instead of one and then apply those seperately?

broken pumice
mint plaza
#

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

broken pumice
#

Yes, it would

#

If you give it the Uuid of each target

mint plaza
#

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

broken pumice
#

when you say target, you want the currently targeted token on the scene right ?
give me a second

mint plaza
#

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

broken pumice
#

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.

dense pine
#

Can you guys please help me understand what this error message means? Happens when i drag an item in my actor.

manic crypt
#

A specific item, or any? Do you have a key called 'typ'?

mint plaza
#

${setValues(%{return game.user.targets.map(t => t.uuid)}%,'HEALTH_DAMGE', "target.HEALTH_DAMAGE + PHYSICAL_DAMAGE")}$

oblique willow
#

Somehow I've gotten into an endless loop of all sheets recalculating themselves?

broken pumice
mint plaza
#

the error is gone

#

and it did roll

broken pumice
#

My bad, you need to access the actor before being able to get the uuid. I've corrected the formula above

mint plaza
#

mow it created a different error

#

this is the output when targeting a single actor

broken pumice
oblique willow
#

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

mint plaza
mint plaza
#

single actor is working

#

multiple actors is spititng out the same error from earlier

#

while not applying the damage

broken pumice
# mint plaza single actor is working

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")}$

oblique willow
broken pumice
mint plaza
#

unfortunalety the new Formula still results in this error

broken pumice
formal goblet
mint plaza
#

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?

fringe silo
#

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

formal goblet
fringe silo
#

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

#

?

formal goblet
warm quartz
# fringe silo Im having an issue with item modifiers, on my sheet i have a label mightScore on...

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.

slow oyster
#

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?

formal goblet
slow oyster
slow oyster
#

Hey, thank you.

fringe silo
#

@formal goblet thanks for the help adding ${}$ to the formula worked

slow oyster
formal goblet
slow oyster
# formal goblet 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.

slow oyster
#

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.

raven spear
#

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!

peak jacinth
raven spear
#

ok, how does one do that? I am a complete noob at this ^

sinful spade
peak jacinth
sinful spade
#

Un moment

raven spear
#

Alright ^

sinful spade
#

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...

▶ Play video
#

48:42 ish

raven spear
#

Thanks !

peak jacinth
#

Oh, right, it's 'show field controls' on edit component.

raven spear
sinful spade
#

You can demand their size, always see them, and change how much they're changing

peak jacinth
#

It is very useful to be able to edit components' values from other components, though, yeah

sinful spade
oblique spear
#

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?

formal goblet
oblique spear
#

Wait wait wait, I chose "Conditional Modifier Selector" for the type, I dont see "list" there.

#

Uhh, let me do some digging.

formal goblet
oblique spear
#

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 👍🏻

formal goblet
oblique spear
#

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.

formal goblet
oblique spear
formal goblet
#

Once you do that, the selector should display all groups, that are in use and can be toggled on/off

oblique spear
#

What the heck

#

Thanks Martin

#

I overcomplicated that, SO much

warped garnet
#

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)

faint wharf
#

how is v13 compatibility? any ETA?

manic crypt
slow oyster
#

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.

manic crypt
#

The key in the floor() doesn't need :: around it

manic crypt
manic crypt
slow oyster
faint wharf
timid wing
#

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.

sinful spade
#

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

formal goblet
timid wing
#

Thanks.

sinful spade
formal goblet
#

I also wasn't completely sure. Seems like you can put almost anything into the identifier as long as properly escaped

#

Even emojies 😅

sinful spade
#

Not the emoji class, really brings a new meaning to vibe coding

sinful spade
#

For that one div that won't align properly

#

With a bunch of
! important tags to really nail that feeling of disgruntlement

glossy parrot
#

So uh... Does a custom system builder exist?

kind basin
#

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 ?

formal goblet
glossy parrot
manic crypt
glossy parrot
#

Now you're pullin my leg

manic crypt
glossy parrot
#

Well blow me down...

pine stirrup
#

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'

hazy moon
#

Hi guys I tink I have a problem

#

What can I do?

formal goblet
hazy moon
#

I downgrade back to v12 343 closing but still showing me this

glossy parrot
#

Is it possible to have multiple different versions at the same time?

hazy moon
#

nvm

#

uptaded back the modules

#

and it's working now, thanks for the quick answer ❤️

formal goblet
glossy parrot
#

May I am have direction? Or is it a Google search away?

formal goblet
mint plaza
#

${#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?

manic crypt
mint plaza
#

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?

manic crypt
#

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.

warm quartz
# pine stirrup Hello, I have a quick question for Custom system builder and I can't for the lif...

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.

formal goblet
#

That's why every function mentioned in the Wiki has a Signature in the header describing 2 very important things:

  1. What does the function expect (input parameters)
  2. What does the function return (output)
mint plaza
#

ok so is there a different way of doing that?

formal goblet
# mint plaza 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

storm rain
#

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.

formal goblet
sinful spade
pine stirrup
warm quartz
faint wharf
#

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}$

faint wharf
#

nested ifs did the same

warm quartz
#

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.

faint wharf
#

i can just hard input dice numbers?!

faint wharf
dusky oriole
#

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)

faint wharf
#

maybe something like mine? Poziom mocy z modyfikatorem ${?{add|0}}$ ${[:2+add:d10]}$

#

just replace text field with radio

dusky oriole
#

Well yes, but that is just 5 dice rolled then. Not roll 5, take highest 2

warm quartz
faint wharf
#

you mean h2?

#

${?{add|0}}$
${[:2+add:d10h2]}$

dusky oriole
#

I dont think this works

faint wharf
#

sorry not theat system. but there was shortcut to keep highest

#

kh?

#

${?{add|0}}$
${[:2+add:d10kh2]}$ it worksd i testeds

dusky oriole
#

thanks a bunch. This is huge

faint wharf
#

you can replace add with radio options.

dusky oriole
#

ah and what about take lowest 2?

warm quartz
#

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 ?

faint wharf
warm quartz
#

You'll need two different formula.

dusky oriole
dusky oriole
faint wharf
#

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)

formal goblet
#
${#additionalDices:= selection}$
${#rollMod:= selection < 0 ? 'kl' : selection > 0 ? 'kh' : ''}$
${[:2+additionalDices:d20:rollMod:2]}$
warm quartz
#

Otherwise use the label text to 'create' your roll formula :

#

Martin522's way is better.

faint wharf
warm quartz
#

I still tend to use brute force to get the result I want, but there are better ways to do it.

faint wharf
#

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

warm quartz
warm quartz
#

[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

faint wharf
#

on reroll i ment ...luck mechanics. so you redo roling.

warm quartz
#

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.

warm quartz
#

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.

faint wharf
#

critical hit? Oh it would be sad if...yee reroll it

dusky oriole
#

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

dusky oriole
#

can anyone explain, why

${8+[:max(AUS,INT,VER):]*2}$

is not a valid number?

#

AUS INT and VER are numbers

formal goblet
#

And you don't need [] as this is not a Roll Formula

dusky oriole
#

without the brackets I get an Error

formal goblet
#

Open the console with F12

dusky oriole
#

I get a "Value expected" error message

#

But the three values all have a value

formal goblet
#

I need the full message. A screenshot would be good

dusky oriole
#

Does this help?

formal goblet
dusky oriole
#

okay, somehow it wont format

formal goblet
dusky oriole
#

Ah

#

es funktioniert

pastel patio
#

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:

  1. 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!)

  2. 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.

  3. 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!

dense pine
#

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?

broken pumice
broken pumice
dense pine
verbal portal
#

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?

formal goblet
# pastel patio Greetings all! I've been using Sandbox for about a year, and I'm considering mo...

.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

formal goblet
dense pine
formal goblet
dense pine
#

Is there a better way to check? Maybe the RTA had text which was deleted, then <p></p> could mess it up again.

formal goblet
mint plaza
#

average damage formula 💀

formal goblet
mint plaza
#

had to make it that big so everything can be done inside of the setValues so AOE attacks work

formal goblet
#

Yeah, naturally.

languid hornet
#

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

oblique willow
#

And you chose to inflict it upon the rest of us?

cold swift
#

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

sinful spade
mint plaza
cold swift
#

thankyou

#

can I make it roll 1dStr somehow

#

like if str is 4 make it 1d4 str=6 is 1d6 ect

formal goblet
cold swift
#

ty!!!!

mint plaza
#

is there a way of adding formatting to the setvalue rolls?

formal goblet
mint plaza
#

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

formal goblet
mint plaza
#

thank you, will try it out

mint plaza
#

worked perfectly 👍

warm quartz
#

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 ?

formal goblet
#

try <td style="color:red"></td> in one of your data cells

warm quartz
#

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.

faint wharf
#

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?

formal goblet
formal goblet
faint wharf
formal goblet
faint wharf
#

actualy i can use same items!

warm quartz
# formal goblet try `<td style="color:red"></td>` in one of your data cells

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.

formal goblet
faint wharf
warm quartz
#

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>

faint wharf
formal goblet
faint wharf
#

ok before i go further. can i make roll create new line in the table?

formal goblet
faint wharf
#

``${#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

jolly kettle
#

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

formal goblet
crystal finch
#

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.

formal goblet
crystal finch
#

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?

formal goblet
crystal finch
#

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.

formal goblet
#

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

crystal finch
#

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.

formal goblet
#

Labels can be modified regardless of what their content is

crystal finch
#

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.

formal goblet
crystal finch
#

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?

formal goblet
crystal finch
#

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?

formal goblet
crystal finch
#

Right, that worked. Thanks, I appreciate you for bearing with me

formal goblet
#

Np

crystal finch
# formal goblet You need a Checkbox in the Item itself or some other input Component, which save...

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?

formal goblet
crystal finch
#

Ahh, I see, in the example item. Okay, thanks a lot, I would've been banging my head against a wall for hours

crystal finch
#

Is it possible to modify a Label roll message with an item modifier?

formal goblet
crystal finch
#

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.

formal goblet
crystal finch
#

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).

formal goblet
crystal finch
#

${[1d120+100 +!${M_Weapon_ATK_Dependency}$]}$

I wrote it out like this, but it isn't working. Did I make a mistake somewhere?

crystal finch
#

Ah

#

${[1d120+100+${!M_Weapon_ATK_Dependency}$]}$

This didn't work either

formal goblet
#

Open the console with F12

crystal finch
#

Okay

#

What next?

formal goblet
#

What's the error message?

crystal finch
#

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

formal goblet
#

Then there must be an error in the console

crystal finch
#

Wait

#

I'm a moron

formal goblet
#

Your key doesn't exist or doesn't have a value

crystal finch
#

This is the key on the sheet template

#

Does the component need to be a different type?

formal goblet
#

Label is fine. From where is the damage rolled?

#

Actually, do you have scope and formula at the bottom of the error message?

crystal finch
crystal finch
formal goblet
crystal finch
#

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

obtuse birch
#

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.

verbal portal
#

Hello
Some of you had problems with CSB on the new version of Foundry running on The Forge' server?

formal goblet
verbal portal
#

Ehm... I am fucked...how I can get back from the last Foundry Release?

verbal portal
#

No on Foudry

formal goblet
verbal portal
#

Ok I'll try

#

The best version for CSB is ? The 11?

formal goblet
#

V12

rocky sable
manic crypt
candid badger
#

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?

formal goblet
candid badger
# formal goblet 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'"

formal goblet
candid badger
formal goblet
candid badger
candid badger
formal goblet
#

You could, you just have to make sure, that you convert these parts back when leaving the editor 😅

candid badger
silver depot
#

Having issues with loading the Game World with this system but getting a error message about "Requires Dependencies:" without any explanation.

formal goblet
jolly kettle
# formal goblet The latest release of CSB is for Foundry V12. The update to V13 will take a whil...

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 😅

plush maple
#

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.

formal goblet
plush maple
#

Gotcha. 👍🏽 Good to know

formal goblet
# jolly kettle okay, as an update on my prior message -- i went through and cleaned up my syste...

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

plush maple
#

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.

manic crypt
#

${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.

plush maple
#

OH okay! I can't believe I forgot the code ? part facepalmpicard

#

thank you lol

manic crypt
plush maple
#

I swear i need a rubber duck at times lol.

manic crypt
#

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.

ruby spade
#

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?

vagrant hollow
mint plaza
#

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

manic crypt
#

Script notation returns them.

manic crypt
#

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 🙂

mint plaza
#

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

manic crypt
#

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?

mint plaza
#

hmm MOVEMENT and "MOVEMENT" also doesn*t work

manic crypt
#

yup, there it is.

#

I'm not sure exactly then, does Drag Ruler have some specific requirements for it?

mint plaza
#

if they do then i haven't seen them

manic crypt
#

oh, maybe you want MOVEMENT.value

mint plaza
#

i'll try

manic crypt
#

as in the whole path for it though

mint plaza