#Custom System Builder

1 messages ยท Page 25 of 1

high stag
#

hi please can someone help me?
I searched a lot in the chat and was unable to mention information about the token in the macros, such as an attribute or life points, and please idk if this macro will really return the variable "est" as a result, i think that it will remain in the console, thaks for your attention. The macro:

let sa = actor.system.sangue_maximo;
let sm = actor.system.sangue_pnl.sangue_atual;

let est = 0;

const arr = [sa * 0.8, sa * 0.6, sa * 0.4, sa * 0.2]

for (let index in arr) {
if (sm < arr[index]) {
est = parseInt(index) + 1;
}
}
console.log(est);

scarlet skiff
#

Your path misses .props.
As in system.props.sangue....

prisma grove
#

Any one with CSS knowledge know how I can make the red background stretch to the edges of the panels?

#

.custom-system-label-title { is currently the path im using to color just the backgrounds of the labels. I did try to use the padding to stretch it, but that will only stretch so far before it stretches the window and does some moving of elements

#

I also tried to set the labels to a background img but that doesn't seem to let me change the size of img. :/

#

.custom-system-panel .custom-system-field-full-size{ I could use this path, but this grabs ALL of the fields as well.

scarlet skiff
# high stag didnt work :/

well since we don't know your setup it's quite difficult knowing what the problem might be.
maybe you can make a screenshot where you want to use the code? and the error message which should show in the console?
also i don't understand what your goal might be with this and if a macro is necessary or it could be done in another way

high stag
#

It's a macro, I intend to run it inside the player's sheet, with the command: "%{return await game.macros.getName('HE').execute()}%"

I don't know if I need an input for the selected token, I imagine so, but I could not do it.

In this case, this macro returns a single value to the console, which in this case is the variable "est", so I could do an operation, something like 1d4+est.

Thanks for the attention

woeful skiff
#

I have this code in a label text field of Label

${switchCase(item.mode_type=="P",'0', '1')}$

and it throws this error

Error: Cannot convert "R" to a number

It has me stumped.

formal goblet
formal goblet
woeful skiff
#

It get the same thing with a ternary

high stag
formal goblet
formal goblet
high stag
#

didnt work

formal goblet
high stag
#

i think my macro isnt correct.
and this console.log will return the end of the macro as a single value? I want it to be added to the operation.
I have no idea how to make this return other than through console.log

woeful skiff
high stag
#

I say, based on the syntax, it works properly but I don't know how to make it work with the CSB

high stag
#

i think you don't understand me.

#

Thank you anyway

formal goblet
#

Or what exactly do you want to achieve?

high stag
#

the console says me that entity is not defined

high stag
#

something like ${[1d20 + 3]}$+%{return await game.macros.getName('HE').execute({entity: entity})%
in a label roll is what i want

formal goblet
raw terrace
#

Is there a way to add a custom class to an item table cell so that I can control the width with more precision? My brain hates that I canโ€™t get two different item tables to line up.

high stag
formal goblet
high stag
#

i tested from the sheet and simply doesnt do anything when i add +%{return await game.macros.getName('HE').execute({entity: entity})}%

formal goblet
high stag
formal goblet
high stag
#

Lmao

#

thank you

high stag
#

when i try to create a macro using a dynamic table roll button i got that message.
Its something i did wrong or its simply a bug or something?

prisma grove
#

Any ideas on how to get an image to be found for CSS? Like if I wanted to change the background in a sheet I know it has to be in the module area, but that doesn't seem to be the case for chat rolls. Any ideas where I would need to put the image?

woeful skiff
#

Is there a way to limit an item container so that i can only hold one item?

prisma grove
#

So CSB is weird I found when it comes to Img's in CSS, like if you don't place the image in a folder in the module area and then link to that it will not find it no matter what... Idk why... So it would look like

.example area {
background-image: url(foldername/filename.jpg) <---- so long as that was in the 'modules' location in foundry it should find the picture no problem.

#

but...

#

If for instance you wanna change the background on the chat area... it doesnt find it no matter where you put it.

#

Its rather frustrating.

#

I.e this area.

woeful skiff
#

Can you change the color of the background

prisma grove
#

Yeah.

#

I just worked around it what I showed there is what I came up with.

#

Since I couldnt get the image to appear.

#

If your wondering how that's just a simple gradient.

background-image: linear-gradient(to bottom, grey , white, grey);
}

woeful skiff
#

I am trying to find something. I was tinkering a few months ago and changed the background on a chat card. If I can find it.

woeful skiff
prisma grove
#

Ah I see... Thank you that actually helps alot, I just figured you couldn't mess with the divs at all.

woeful skiff
#

How are you generating your chat message

#

Or are you trying to change the background for all chat messages

woeful skiff
prisma grove
#

It was for all chat message

bright glacier
#

Hello! I need a little help. I'll provide some images to make the explanation easier. I want that when choosing the weapon in the dynamic table, the label rolls the "Dexterity" of the same sheet, but with the new label "Attack".

formal goblet
bright glacier
#

Oh no! xD I will look for a way for it to execute the roll from an external sheet or I'll think of something. Thank you for your time!

formal goblet
bright glacier
#

O_O too advance for me hahaha
How can i add a label with roll dice here?

normal ore
#

Hey guys, how are you doing?

Is it possible to turn a formula into a macro? Like, to have it on the macro bar?

formal goblet
normal ore
formal goblet
normal ore
#

Yes

#

It's Label in Item Container

#

is there a difference?

formal goblet
#

Ah ok, that's probably the issue

#

Yeah

#

It has no parent-key, so calling it from outside is not that easy

normal ore
#

I see!

So I have to think about how to make rolls on the sheet without involving items.

vagrant hollow
#

Inside of an dynamic tabel I have this in a label text:
${fetchFromDynamicTable('bonusep', sameRow('epcode'), 'bonuslv', ceil(fetchFromActor(sameRow('charchar'), 'Level')/2, 0))}$
The single components work, but as a whole it dosenโ€™t โ€“ without console error.
Where is my mistake?

vagrant hollow
#

I got it working.

vagrant hollow
#

Is # inside of an dynamic tabel label not working for hiding the result of a formula?

formal goblet
vagrant hollow
vagrant hollow
# formal goblet a?
${#epi > 11 ? epi=11 : epi=epi }$
${(fetchFromDynamicTable('bonusep', sameRow('epcode'), 'bonuslv', "${epi}$")+(20*sameRow('lvcrit'))+sameRow('TotalHits'))*sameRow('epmulti')}$```
I dont want "epi" to be seen.
formal goblet
vagrant hollow
formal goblet
#

:= and # will not work there ๐Ÿ˜…

vagrant hollow
formal goblet
#

Interesting... was sure it was only doable in Label Roll Messages...

vagrant hollow
#

It is just not nice 8)

formal goblet
#

But as I said, hiding doesn't work there

vagrant hollow
formal goblet
vagrant hollow
leaden wraith
#

Hello I'm poking in here so I can have it in my list of channels. Please excuse me while I write my question

#

Ok, hi. I'm Van Silke, and I'm developing Frame State TTRPG in my spare time. I've found Custom System Builder to be perfect for rudimentary testing of my system's features without annoying the players with excessive management.

#

I have, however, come across a small problem lately. It relates to exceptions it's occasionally throwing out.

#

I've been trying to calculate a value in the system

${recoilcontrolVal+1-recoilCurrent}$

recoilcontrolVal is a dropdown list, keyed 0 to 7.
recoilCurrent is a number field.

The exception tells me there's something wrong with one of these.

leaden wraith
#

Not sure how to read this one.

formal goblet
#

You might have a typo in one of the keys

leaden wraith
#

I'll parse through it again

#

oh thank goodness

#

it was just a mistype, yes

cerulean adder
#

Is there a way to get the UUID for an item from the item? Like item.UUID or something?

#

Example: @UUID[Item.Tpzkxc7BdPLAur7G]{Quad Laser Turret}

turbid elbow
#

Could someone be able to help me integrate some modules in CSB?

  • Always HP
    with
  • my char sheet
    I cannot seem to be able to make them work properly - I get wrong numbers on token HP total, astronomical HP numbers when adding and they can't seem to stop at the desired max cap. Additionally I seem to not be able to get required rolls when done from the char sheet.
    I cannot into Java (I know, my bad) so I can even pay for the trouble.
    Please DM me.
    PS: I did already approach IronMonk but he wasn't too helpful.
vagrant hollow
vagrant hollow
cerulean adder
vagrant hollow
cerulean adder
#

The end goal is to try to get the item to display on the attack roll. Right now I have the name of the item but it would be nice to have a clickable box that pops open the item so the GM can easily look at the values

#

The workaround I have now is to create a field for each weapon and manually enter the UUID for the Item or Compendium but then that only brings out the "template" item and not any of the modifications the player has made.

#

I was hoping I could get the ID of the item and pass it through to the chat. Something like @UUID[item.<key?>]{${item.name}$}

vagrant hollow
turbid elbow
cerulean adder
#

No worries. I appreciate it!

#

Does anyone know if Item Piles works with CSB? I tried it and I couldn't get it to work. I may be overlooking something or it may just not be compatible?

vagrant hollow
turbid elbow
#

Is there a way that I can show my char sheet, and someone would look into it?

cerulean adder
turbid elbow
#

"Edit Attribute Bars" shows this.

vagrant hollow
# turbid elbow "Edit Attribute Bars" shows this.

There is your problem.
This attribute bars are NOT editable by alwayshp, token, or any other module.

You have to set a numberfield with a set max on your sheet. This will automatically produce a attribute bar that can be selected in the token setting.

turbid elbow
#

sigh This sucks. Doesn't fit in any way with my mechanics

turbid elbow
#

I guess I need my own module specifically tailored to this char sheet

vagrant hollow
vagrant hollow
turbid elbow
#

Yes, the problem is that AlwaysHP does not seem to communicate with these fields.
Or do you mean 'adjust manually'?

vagrant hollow
turbid elbow
#

I'm aiming for modifying those fields with AlwaysHP or some other combat-UI tool

#

Hmmm...

#

I'll experiment and come back

#

Thanks

formal goblet
cerulean adder
#

Strangely no errors in the console

#

Is the [item.*] looking for something in the Items directory/folder? If so it won't find it because it's in the actor's sheet. Is that even possible to call outside of the actor?

formal goblet
formal goblet
cerulean adder
cerulean adder
glad spade
#

I think there was a pop-up on startup when you first activated the module that warned you about this, in fact

cerulean adder
# glad spade It doesn't work out of the box. You need to tell it what to look for. Every syst...

That makes 100% sense! I did think I needed to modify something but I hadn't used many modules before so I didn't know where it was saved. ProjectAvalanche pointed me in the right direction though and I need to just power through it and figure out how to set it all up.

The pop up that i saw indicated that it was making a default item pile template and it never did. I assumed that maybe there was something that needed to be modified for it work but didn't know where to look (and tbh I didn't look that hard). I just didn't want to re-invent the wheel if someone else had it setup already or if there were documentation that I overlooked.

static cargo
#

What would it take to adjust the sorting of these templates within the item container form? (ie: Alphabetically rather than, I assume, Template Creation order)

formal goblet
static cargo
#

Is it indeed Template Creation Order?

formal goblet
#

Dunno, but might be. I never had this question before ๐Ÿ˜…

static cargo
#

If I work out a solution, you want to hear it?

formal goblet
#

My guess would also be insertion order, because we fetch them directly from game.items, and that is a Set if I remember correctly.

#

Ok, WorldCollection, it's one of the custom collections of Foundry

#

WorldCollection -> DirectoryCollection -> DocumentCollection -> Collection -> Map... @static cargo yeah, it's insertion order

turbid elbow
#

Is there a way to simulate such a thing?:

  • In Dark Heresy the PC HP is just a buffer, after they go down to 0 the overflow goes into 'critical tables' for specific hit locations and specific type of damage done. There are 16 tables in total.
    Would there be a way to do this in some way that I input damage with selected options and the critical effect pops out?
#

I already created these tables as 'roll tables' but it is not really a random roll but a 'lookup'

formal goblet
#

Roll Tables are something like... I roll a 1d100 and see what event occurs... kind of stuff

turbid elbow
#

Yes

formal goblet
#

Dynamic Tables are meant for lookups, so use them

turbid elbow
#

What I need is : overflow is 5 points energy damage into Arm location and outcome no.5 pops out

#

Ok, will try.

cerulean adder
cerulean adder
turbid elbow
static cargo
raw terrace
#

I've had a good hunt for an answer, but figured I would just ask. I have a hidden attribute on the actor sheet called STAMINA_current which is set to 10 as default and displayed on the sheet. What I need to do is reduce this by a specific amount (let's say 5) if a label is clicked and a roll is made (these "actions" are currently in a table and I am using the label message to calculate the roll (thanks to your help the other day)). For the life of me I can't figure out a way for the click/roll to automatically reduce STAMINA_current by a specific amount. What am I missing? My intention is to then somehow reset STAMINA_current to its default amount on the start of a new combat, but that's a different question ...

formal goblet
# raw terrace I've had a good hunt for an answer, but figured I would just ask. I have a hidde...

Ok, let's dig a bit into the details.

You have a hidden Attribute called STAMINA_current, which has the value 10. Hidden Attributes are basically handled like Labels (keep that in mind). So far so good.

Now you want to change this value when a Roll is made. It is generally possible to change values with Label Roll Messages thanks to setPropertyInEntity() or a custom-script. But there's one restraint: You can only do that with Components, which contain persisted values (Text Field, Number Field, Checkbox, Dropdown and Radio Button). Components like Labels contain derived values.

  • Persisted values: Changeable by the user, cannot be dependent on other values
  • Derived values: Not changeable by the user, can be dependent on other values

Persisted and derived values are polar opposites, you cannot have both! And because we have a Hidden Attribute (which counts as a Component with derived values), the user is not able to change the values of them.

So, what can you do? You need a Component with persisted values, that's for sure. No way around that. But you can make STAMINA_current dependent on this Component with a Formula (but that's your choice in the end).

raw terrace
#

So I could have a "hidden" (GM-only) number field that can be affected by the roll?

raw terrace
#

Cool - let me have a try and see what happens. Cheers

#

Nice! Thank you! Got it to work with ${setPropertyInEntity('self', 'STAMINA_current_track', "STAMINA_current_track - 5")}$ (STAMINA_current_track is the hidden number field).

cerulean adder
#

I was able to get everything working with on exception regarding item piles. I'm not able to drag from my sheet onto the map as a GM or onto another token as a player to add to an item pile/container or to initiate a single item trade (respectively)

static cargo
cerulean adder
#

Yes! I'm able to create item piles by dragging them from the Items toolbar

#

I just can't get it to work by dragging it from the character sheet

#

I can drag the items into a trade screen. Just not directly onto a token to trade

static cargo
#

Ah... I see. I've had little success dropping something on the map as a player myself. I'm almost to the point of making an empty box I can put on the map, then they can "Loot & Place".

cerulean adder
#

Oh, I just realized my currency is wrong too. Dang. I set it up as actor.system.props.credits but I'm not getting anything. Hmmm

#

Okay, I just did system.props.credits and it worked! I tried that first but maybe I had a typo or something

ornate junco
#

${#concat(?{chatlog:'What are you aiming for?'|"Head"|"Chest"|"Left Arm"|"Left Hand"|"Right Arm"|"Right Hand"|"Left Leg"|"Left Foot"|"Right Leg"|"Right Foot"})}$

Can I have like Head equal a value to use to subtract from a roll?

#

Or can I have head pull from an item value?

formal goblet
ornate junco
#

I'm a bit stumped.

#

Do I switch case it within the item itself or can I just do like Head = -2

formal goblet
#

The first would use switchCase() and the second with the help of ref()

ornate junco
#

Let me put a switchcase together and give it a try

#

Thank you. I will most likely be back in a second or two.

formal goblet
#

If you need docs, you can even consult the one for Google Sheets. It's basically the same function.

ornate junco
formal goblet
ornate junco
#

Or can just be within the label roll message?

formal goblet
formal goblet
ornate junco
#

Do I put it where the drop down is for body part selection?

formal goblet
#

Oh boy... Do you remember that you have a variable defined as chatlog in your input dialog? That one saves the selection and can be used by other Formulas down below.

#
// Your previous code
${switchCase(chatlog, 'Head', -2, 'Chest', 0, ...)}$
ornate junco
#

${#concat(?{chatlog:'What are you aiming for?'|"Head"|"Chest"|"Left Arm"|"Left Hand"|"Right Arm"|"Right Hand"|"Left Leg"|"Left Foot"|"Right Leg"|"Right Foot"})}$ ${#mod:=item.weapon_mod}$
<table>
<th><h3>Roll to Hit with</h3></th>
<th><h3>${item.name}$</h3></th>
<tr>
<td><h3>Roll to Hit ${!chatlog}$</h3></td>
<td><h3>${Damage_Roll:= round([:item.roll_hit:+:ref(mod):+${switchCase(chatlog, 'Head', -2, 'Chest', 0)}$ ])}$</h3></td>

This is what I have now.

formal goblet
#

And restructure your Roll Formula. Try to have as little as possible inside a Roll Formula []. Ideally it should only have the Roll itself. Modifiers can be added outside of it.

ornate junco
#

Thank you for all the help.

calm dock
#

hi i am back got my base sheet done after a hitus to work on costumes how do i add tabs to a cherecter sheet in the custom system makers?

vagrant hollow
narrow hollow
#

hey so im having an issue when using a roll formula i cant get it to refrence any values inside of it. to give a small explnation that fetch is just checking if the sheet has a checkbox listed for a skill on the sheet. if the user has it check it will return true doing the roll with dl otherwise is does the normal looking roll. i cannot do a static amount of dice as extra dice is a commonly used mechanic for buffs and abilites.

${[:AtkRoll:]}$```
calm dock
#

@cerulean adder illl give it a try later

woeful skiff
#

Can Item modifiers be used to modify something in an item container?

scenic basin
#

Hi guys, i'm running into a trouble using the initiative on CSB... I used to have a initiative formula that worked, it was something like [1d20 +:modini:], but now one of my player chose a feat that gives him advantage on initiative rolls. So now i want a way so that I can use the initiative roll, not the initiative modifier value, on each individual character sheet to be the initiative formula, so my player that has this feat can roll with advantage while the other players roll normally, is that possible?

cerulean adder
# vagrant hollow Is this problem solved? Dragging a item from itemcontainer to canvas should be p...

As a GM sheet to sheet does work (Thank you I didn't think of that) and also if I open up the Item pile I can drag items from NPCs into the item pile this way. However, if I try to drag the item from a sheet straight to the map to create an item pile, Foundry instead tries to create an actor. Perhaps this is not the intended use?

Also as a player I'm not able to do sheet to sheet (unless I have control of both sheets) but that was kind of expected. When I try to drag the item to a different player's token I get the warning "You do not have permission to create new Tokens!" and nothing happens.

It appears everything else is working but the quick trade and I think that's totally okay. Now that you helped me discover sheet to Item Pile inventory this will be way more applicable for my GM. Thank you!

timid marten
#

Hi!

I have a stamina bar on a player and on their character sheet I calculate the percentage of stamina left

Then, with condition labs, I add a status on their token based on the percentage left of their stamina

The issue is that the label "Stamina_percentage" is not being refreshed when the sheet is closed, so lowering the stamina inside the token won't trigger the status change

It works perfectly when the sheet is opened though

Any solution for this ?

fierce harbor
vagrant hollow
cerulean adder
vagrant hollow
timid marten
vagrant hollow
vagrant hollow
timid marten
#

Basically the value is being refreshed by CSB but not my Condition Labs

#

I think the issue is on Condition lab's side then

#

that's weird though

#

it should read the props.value

#

I made a gitlab post about it here if someone has any info, tip or fix about it

#

here is a video example

#

As you can see in the video, the value updates to "2", so the effect should trigger, but it doesn't until I open the Sheet

scenic basin
# fierce harbor Can't you make so that `modini` is different by player? This way advantage or an...

I don't think I understood your question, but yes :modini: is a number field with the value, so I guess it already is individual by every player as they can put the value that they have.
what I want to do is turn this Label called "INICIATIVA" (Initiative in portuguese) into the formula for initiative, i could just copy the label roll message, but as I said, one of my players has advantage in initiative rolls so I want the initiative system formula to roll what this label rolls.

fierce harbor
scenic basin
fierce harbor
formal goblet
fierce harbor
formal goblet
high stag
#

Hi, if i have an attributeBar, how do i call its maximum value?
like attributeBar.hp the max should be? attributesBar.hp.max ?

#

I need the path that indicates the maximum of an attributeBar, to be clear.
(the props path doesn't work)

formal goblet
woeful skiff
# formal goblet Nope

๐Ÿ™ but not too sad. You have done a wonderful job with CSB. I have done a bunch of (rather amateurish ) sheets on Roll20 and there even a fairly simple sheet can take hundreds of hours. But using CSB I have put together sheet in very little time.

high stag
#

Some modules are having problems to finding the hp path, there is something i have to know about it? or its just a compatibility issue?

formal goblet
high stag
#

Ok, thank you anyway

raw terrace
#

I know this is a really basic question, but again I am either not seeing or don't understand fully the answer while searching for it: I am looking to trigger a macro when a dice roll comes up with "1". I have stitched together this conditional (which I know doesn't work) and was wondering if I am close to the answer or completely up the wrong path, thanks!

${Roll_Dice == 1 ? %{return await game.macros.getName('Roll Critical Miss').execute({name: '${name}$'})}% : "" }$
formal goblet
timid marten
raw terrace
formal goblet
raw terrace
#

Next dumb question - how would you automatically untick a checkbox when a dice roll is deemed a success? I tried setPropertyInEntity but feel this is the wrong approach - am I over complicating things?

formal goblet
raw terrace
#

Oh - okay - Bob Rossing it! Just need to figure out the right combination then. Good to know I am on the right track ๐Ÿ™‚

#

Ooh, seemed to have stumbled on it!

narrow hollow
raw terrace
#

Last stupid question for this evening: is there a way to make a checkbox trigger a roll or execute a function (or work the same way as a label message)?

raw terrace
# formal goblet Not without effort

Thanks - that's what I needed to hear. Will think about a workaround (looking at a wound track basically, where each wound has a cumulative effect on skills and attribute checks).

half beacon
#

How do I search an item container to see if a specific variable is true? I've gotten as far as filtering by template, but then I brain fart.

#

I'm using the script to find equipped items and retreive the name

formal goblet
#

Data of the Item Container is not saved in system.props. If the variable you're looking for is not in the Item, then you need a different approach

half beacon
#

It's in the item. I made a checkbox for if it's equipped or unequipped. I'm just not sure how to check for it, mainly because I don't completely understand item containers yet.

formal goblet
#

Wonderful

#

You only need to know that all Items are stored in the Actor directly. You can actually access them with Actor#items. The rest depends on your filter/find-logic, but that shouldn't be complex.

#
%{
const itemName = 'myItem';
return entity.items.find(item => item.name === itemName)?.system.props.checkboxKey ?? false;
}%

Simple as that ๐Ÿ˜…

thin leaf
#

Hi! Does someone know of an easy way to align a number of item containers with the arrows in the picture? Tables added for context

formal goblet
thin leaf
#

And I don't even know what that is lmao

formal goblet
#

Ehh...

thin leaf
#

Don't worry, it was way too ambitious anyways

#

What I want to know is if I can have a dropdown list that holds different options for different versions of the same item

#

Like for a sword it shows "Back, Hip" but for a dagger it shows "Hip, Shin"

formal goblet
thin leaf
#

Like I have a hidden table with the options I want? I'll try that

half beacon
#

I don't understand how to fetch the names from the items based on if the checkbox is checked still. When I try system.props.equipped the script doesn't work anymore.

#

But I'm able to check and uncheck it with system.props.equipped

formal goblet
half beacon
#

That's one of the things I tried. For the hell of it, I tried returning only the item's name just now, and nothing happened.

#

One more thing. I'm using custom items as skills. Once the dice are rolled, the script should uncheck these boxes. It correctly changes them to 'false' but only one column will refresh: the Sub column remains checked (even though the value is false) without actor.templateSystem.reloadTemplate() but the Prime column will remain unchecked (when false) if that's present in the script. If any of the boxes are clicked, all boxes in every column refresh properly. Is there a workaround for that?

fierce harbor
#

Hi! If I use in a LabelRollMessage of an item this fetchFromActor('attached','willDD') (willDD being a label in the actor sheet) it should retrieve the label value, right?
Tried self too, but to no avail...

SOLVED: it was me, wrong label key ๐Ÿคฆ๐Ÿปโ€โ™‚๏ธ

turbid elbow
#

Dear Lord. 3 hours yesterday on a Discord call and we finally brought basic function into a character sheet.
My programmer friend is amazed at how Foundry has absolutely zero feedback about what actually doesn't work and where.

high stag
#

The mix between dropdown lists and dynamic tables is very powerful. I would like to make a number field so that the number corresponds to the option selected from the dropdown list. Is that possible? (i tried)

I'll use D&D as an example:

option 1 from the list
movement: (terrain)
in feet: (35) // the player would be able to change this value

option 2 from the list
movement: (flight)
in feet: (10)
Just to clarify.

formal goblet
turbid elbow
#

Yes, we did approach it that way, one code line at a time.

formal goblet
fierce harbor
#

My brain just crashed...
How on earth do you treat sinlge quotes inside `concat()'.
Something like this:

concat("Check:","${!roll<=diff?'<p>A</p>':'<p>B</p>'}$")
mild valve
turbid elbow
#

Would there be a way to exchange some of these effects for other ones?

mild valve
turbid elbow
#

mm'kay

formal goblet
turbid elbow
#

Thanks

formal goblet
fierce harbor
formal goblet
turbid elbow
#

Has anyone ever tried to create something else than TTRPG in CSB?
I'm trying to conjure a way to create a Tabletop Wargame Campaign Simulator

  • It's a sci-fi wargame called Full Thrust
  • We play with minis on a table
  • The software would have to feature a space map with a hex grid, with fleets, systems and facilities marked on it.
  • Fleet Task Force compositions would use something like a character sheet.
  • We would input fleet compositions and then use turn movement until fleets meet, battle it out at my place then input the outcome and losses.
  • Fog of War implementation is crucial - we have no referee so we resort to these solutions.

Has anyone tried such a thing?

fierce harbor
formal goblet
fierce harbor
formal goblet
# fierce harbor Full code is ``` ${concat(#roll:=${<formulaA>}$,#diff:=${<formulaB>}$,!roll<=dif...

To be fair, that one is even worse. Where do I start...

  • #, ! and := can only be used at the beginning of the Formula, not somewhere in between
  • You are using nested Formulas without a real benefit. In most cases you're better of not nesting them at all.
  • Try to use whitespaces between operators and after a comma. It doesn't change the logic, but it helps a bit with visuality
  • You don't have to put everything in 1 line. Use multiple lines (especially in Label Roll Messages, where you can store results in a local variable and reuse it further down)
fierce harbor
formal goblet
fierce harbor
fierce harbor
gentle jolt
#

Hey all, I'm having some issues with Roll Messages. I've got a hidden attribute set up for each skill, <skillValue> (artValue, careValue, etc.) and have a User Input Template set up for each skill, so the users can add any applicable modifiers. When I have the following roll message set up, I get no errors:

${?#{artRollMods}}$
<p><b>Field:</b> ${socDice}$</p>
<p><b>Skill:</b> ${artValue}$</p>
<p><b>Items:</b> ${Item_modifier}$</p>
<p><b>Conditions:</b> ${socCondMod}$</p>
<p><b>Total:</b> ${totalDice := socDice + artValue + Item_modifier + socCondMod}$ (${totalDice}$)</p>

But when I try to combine the values and make a roll (dh is defined elsewhere in a module), I get errors about totalDice:

${?#{artRollMods}}$
${#totalDice := socDice + artValue + Item_modifier + socCondMod}$
${[:totalDice:dh]}$

Is there something I'm missing, or something I'm doing wrong?

formal goblet
gentle jolt
boreal hull
#

how do I create a checkbox that will change the number in a number field?

#

like when its checked then it will add to the number in said number field

boreal hull
#

so I would set in the advanced config "setPropertyInEntity([component_key]) +1 or something?

#

been a while since Ive used the system so im rusty

formal goblet
boreal hull
#

so its impossible? or am I misunderstanding

formal goblet
boreal hull
#

hmm, is there an alternative that you could think of, essentially the user would be checking off boxes till the last one then it upgrades the number, could I use some other function to do something like this?

half beacon
# formal goblet Can you show what you did?

If you mean the script, it's not much.
Script for the button that rolls the dice then unchecks the boxes:

entity.items
    .filter(item => item.system.template === skillTemplate)
    .forEach(item => {
        item.update({'system.props.Active': false});
        item.update({'system.props.Sub': false});
    });```

And the ones for the checkboxes are pulled directly from one of the example sheets you provided on the wiki.
Label text:
```<i class="fa-regular fa-${item.Active ? 'square-check' : 'square'}$" style="color: ${item.Active ? 'green' : 'red'}$; background-color: white;"></i>```

Label roll message:
```${#setPropertyInEntity('item', 'Active', "item.Active ? '' : 'true'")}$
%{throw 'done'}%```
formal goblet
half beacon
mild valve
#

Gotcha - will revisit that

formal goblet
half beacon
#

Oooh

#

That makes sense. Woops.

formal goblet
#

So I think you've constructed a race condition ๐Ÿ˜…

boreal hull
#

is there a way to do sequential checkboxes, so 1 must be checked before 2 and so on..?

boreal hull
#

okay thanks

normal ore
#

Can someone help me?
Why isn't the formula below working?

${setPropertyInEntity('attached', 'rolagens', "true")}$

Note: The 'rolagens' key is a label-type key and is within an item, just like the roll label is within the same item.

half beacon
half beacon
normal ore
formal goblet
#

If the Label Roll Message and the Key are within the same Sheet, use self

half beacon
formal goblet
cerulean adder
#

Okay, now that I have more knowledge on how item containers work is there a way to reference the labels in a container? Or even better can you reference information inside an item (attached to a character's sheet?)

formal goblet
cerulean adder
cerulean adder
#

You are, as always, amazing! Thanks for the billions of hours you help us save (collectively)

spiral dome
#

Is it possible to have a dropdown menu that retrieves the value from a Dynamic Table, and then add a formula to the dropdown menu tooltip that shows another column from the same Dynamic Table?

formal goblet
normal ore
half beacon
half beacon
#

Don't forget to refresh the item(s) within the item container manually instead of through the item template.

timid marten
#

How can I round key modifiers? For example, the modifier divides by half the value, but if the value is a decimal it rounds up to the higher

(The modifier divides 3 by half, which renders 1.5, it will then put "2" as a result)

#

I'm trying to add this to an active effect modifier

#

(force = strength in EN)

#

what is already written is a security to avoid a number that is lower than 1 because it's the minimum

#

but I want to add something that rounds the result to the final "2"

timid marten
#

so the final result should be "ceil(2)}$" ?

#

Like as

${Force / 2 < 1 ? 1 : ceil(2)}$
half beacon
#

I believe it'd be ${Force / 2 < 1 ? 1 : ceil(Force / 2)}$

timid marten
#

Oh right we can set the operation as an equal and do the operation from the formula

#

I forgot about that

#

Works like a bliss, thank you!

timid marten
#

Another quick question, how can I affect all key variables from a dynamic table's column?

For example, I want to do a "-1" to all the values in the column "Strength" of a specific dynamic table

timid marten
gentle jolt
#

With a Roll Message, how do I use a formula value and send a full roll, as if I rolled /r <expression>, instead of an inline roll?

#

For example, I've created the key totalDice and need to roll <totalDice>dh. How would I roll that as if I used the /r syntax instead of an inline roll?

#

(The reason this is important is that the system uses custom dice that have symbols instead of numbers, and the players need to be able to see the list of symbols.)

formal goblet
gentle jolt
formal goblet
formal goblet
formal goblet
formal goblet
normal ore
#

There was no error, it just didn't work.

#

Now, an observation. I changed the key according to the formula ${setPropertyInEntity('self','status_3',"true")}$.

The 'status_3 key' is of checkbox type and it worked. Now, for the label-type key 'rolagens', it didn't work. Why that is, I don't know!

formal goblet
#

And because Labels are not changeable by the User...

normal ore
#

Aaah, I see!

#

Thank you

main magnet
#

Is there a way to use fetchFromDynamicTable to search for one value from multiple tables?

gentle jolt
formal goblet
gentle jolt
#

Oh, whoops. I didn't read far enough down, my bad.

#

Thanks!

#

(Another case of PEBKAC XD)

formal goblet
half beacon
#

Is it possible to "fudge" a roll?

formal goblet
timid marten
half beacon
#

I was just looking it up myself!

#

I have boomer knowledge. All of my experience is from 15-ish years ago. Hahaaaa I hate it.

formal goblet
half beacon
#

But Martin's making it easy to get back into the swing of it

half beacon
#

For example, rolling 1d20 and forcing a result of 18

formal goblet
#

Ah no, CSB cannot do that

half beacon
#

Thanks for the heads up!

formal goblet
#

But I think some modules are already able to

half beacon
#

I'll do some digging for it

formal goblet
normal ore
#

Another thing, how do I change a radio button with setPropertyInEntity()?
I've tried referencing the group and the key of the radio button but neither case is working!

formal goblet
#

It should match the value of one of the Radio Buttons

normal ore
formal goblet
normal ore
#

Only the way I did it worked! I tested with single or double quotes only and it didn't work. It only worked when I changed the values from numeric to text!

formal goblet
main magnet
#

How do I reference a roll from a label in another roll in another label? I want it so that I click a label and it makes a roll that's assigned to another label.

raw terrace
#

Is there a way to globally affect a value in a number field on the actor sheet (for all tokens/actors of a specific type in a scene) - maybe a macro or something? I have a number field on the actor sheet named SPEED which is an initiative bonus and would like to be able to change it for everyone based on a table roll result.

weary nymph
#

Hello. I need to add a shop or merchant to my CSB Game. I've seen a homebrew game with a "shopping cart" icon on the character sheet that accesses a buy/sell menu for common items. Is this something that I can do in CSB? Failing that, are there any simple merchant/shop modules that work with CSB (I have seen several for other systems.)

formal goblet
fierce harbor
weary nymph
raw terrace
#

Okay, have been trying multiple approaches but can't seem to get this bit of a macro to work: I want it to pick up the value of STAMINA_max so that STAMINA_current_track is reset to this value when the macro is triggered. I can achieve it through a manual lable roll message on the actor sheet with "STAMINA_current_track:= STAMINA_max", but I just can't seem to get the following line on the macro to work: "system.props.STAMINA_current_track" : STAMINA_max, //Reset Stamina - where am I going wrong? Console error basically says "STAMINA_max not defined" but again, I can't figure out where or how to declare it properly. I'm sure I am close, but just seem to be able to miss my target every time ๐Ÿ™‚

#

Also, in CSB all actor sheets have the actor.type of "character", correct? If so, how would I declare an NPC sheet if I didn't want an effect to apply to these?

fierce harbor
raw terrace
#

I thought I did (choose _template), perhaps I am doing that bit wrong

fierce harbor
raw terrace
fierce harbor
raw terrace
#

There is nothing on it yet (just started on this bit), but here you go

worldly musk
#

Hi - I am trying to return a string value from Dynamic table dependant on the out put of a drop down, but it is returning error. I have text fields in the dynamic table if I have them visible on the character sheet they resolve correctly to default typed values within the table.
Example dynamic table key is 'table_key', with dropdown value selected by player being 'pc_choice' with the key & attribute of the dropdown choices being the same string. In an uneditable label, I want the dropdown selection pc_choice to match a value from 'a' and then resolve to the value from 'b' in the same row. Table columns: {text_field_a} {text_field_b}
The code line I used was: ${getRefFromDynamicTable('table_key', 'text_field_b', 'text_field_a', pc_choice)}$
Am I mistyping/misusing this? I have managed to use switchCase to do the function but if I can pull from a table it will allow editing of values if I need rather than editing the switchCase formula.

Alternatively can I use tables to define the key:attribute list for switchCase? (Happy to go reading up if there is any github help for this)

fierce harbor
#

So you are using NPC template and I believe a different one for player actors, right?
Then something like actor.template shoul tell you what that actor uses and allow you to discriminate accordingly. Console should help on that.

raw terrace
raw terrace
# formal goblet Show the whole Example
  if (update.round <= combat.previous.round) {
      return
}


const updates = [];
for(const actor of game.actors) if (actor.type == "character") updates.push({
  _id: actor.id,
    "system.props.SPEED": 0, //Reset Initiative Bonus
    "system.props.STAMINA_current_track" : STAMINA_max, //Reset Stamina
    "system.props.ATTACK_dmg" : 0 //Reset Damage Bonus

});
await Actor.updateDocuments(updates);

});```
#

Probably a lot of bad practice in there ...

#

I'm running the macro using World Scripter if that helps?

#

The speed and attack_dmg work fine (I guess because they are actual numeric values).

formal goblet
raw terrace
formal goblet
worldly musk
formal goblet
formal goblet
worldly musk
#

Ok thank you

fierce harbor
#

Back with a, hopefully, easy question...
Why in all hells does this cause Uncaught (in promise) Error: Unresolved StringTerm Actor.o9lcNHkJ2uQnjQun.Item.eEVHKDt6uwtqajtB requested for evaluation?

${item.baseCostDD==1?(roll<=diff?'${@UUID[${!%{return linkedEntity.uuid}%}$]{${!item.name}$}}$':'KO'):(checkVal?'KO':(roll<=diff?'${@UUID[${!%{return linkedEntity.uuid}%}$]{${!item.name}$}}$':'KO'))}$
fierce harbor
# formal goblet Formula-depth of 4......

I just love nested formulas ๐Ÿ˜…
Anyhow, if I just use the ${@UUID[${!%{return linkedEntity.uuid}%}$]{${!item.name}$}}$ part all is good but the whole thing just blows up in my face...

And the whole code is

${#checkVal:=arcaneDD<floor(item.baseCostDD/2)}$
${#roll:=checkVal?'0':max([1d100]-arcaneDD-item.extraCostDD,1)}$
${#diff:=((forceDD*5)+(item.baseCostDD*10))}$
${item.baseCostDD==1?(roll<=diff?'${@UUID[${!%{return linkedEntity.uuid}%}$]{${!item.name}$}}$':'KO'):(checkVal?'KO':(roll<=diff?'${@UUID[${!%{return linkedEntity.uuid}%}$]{${!item.name}$}}$':'KO'))}$
formal goblet
#

String around @UUID ?

fierce harbor
formal goblet
#

Well, I cannot tell how the @-syntax from Foundry behaves within CSB-Formulas

fierce harbor
#

I could get it to work, but with a simple formula...now it just refuses to work...

#

Oh well, blast it all...i'll find a workaround. Thanks @formal goblet for your patience and awesome tips ๐Ÿ˜‰

timid marten
#

Can you write conditions inside conditions, like this?

${Strength > 10 ? (HP > 5 ? -2 : -1) : 0}$
#

Okay you actually can

#

That's amazing

worldly musk
half beacon
#

I have an item with the item modifier ${itemBonus}$, formula for it for testing purposes is ${str_max}$
For some reason, $[str_max}$ returns its correct value, but ${itemBonus}$ remains 0.
${str_max}$ is a hidden attribute on the actor template with 5 as its value.

formal goblet
half beacon
#

Oh... So I'll have to find a different way to retrieve ${str_max}$

#

Okay

#

Fixed it. In case anyone else has this issue, the solution is fetchFromActor('attached','key')

half beacon
#

Other than that minor issue, I've actually finished this draft of the character sheet for my system! Thank you so much!

gentle jolt
#

In a roll message, is there a way to get the name of the label that was clicked, similar to using entity to get the actor/etc. object?

fierce harbor
fierce harbor
formal goblet
#

I wouldn't even know why you need the key of the Label where the Roll Message resides ๐Ÿ˜…

fierce harbor
#

Can't figure such scenario out, either, but someone might find it handy...somehow ๐Ÿคท๐Ÿปโ€โ™‚๏ธ

gentle jolt
#

Oh, I wasn't looking for the key, but the actual text in the label. It's not something that I need, but it'd be a little more robust if I could do something like

${#%{const r = await new Roll(${totalDice}$ + "dh"); r.roll(); const m = r.toMessage({flavor: entity.entity.name + ": " + parent.text, speaker: ChatMessage.getSpeaker({token: entity.entity})});

instead of having to change parent.text for each separate skill that's rolled. (Mostly it protects against user errorโ€”I tend to over-engineer things.)

#

Also, is there a way to store a variable for JS use in later scripts? For example, since there's no way for the system to not send a roll message, I thought I'd make a table of the different tiers of success, but I'm getting r is not defined errors for this:

${?#{artRollMods}}$
${#totalDice:=socDice + artValue + Item_modifier + socCondMod}$
${#%{const r = await new Roll(${totalDice}$ + "dh"); r.roll(); const m = r.toMessage({flavor: entity.entity.name + ": Art", speaker: ChatMessage.getSpeaker({token: entity.entity})});}%}$
<table class="success-table">
<thead>
<th colspan=2>%{return r.tierDisplay;}% Success</th>
</thead>
<tbody>
<th>Basic</th><td>%{return r.successes['B'];}%</td>
<th>Critical</th><td>%{return r.successes['C'];}%</td>
<th>Extreme</th><td>%{return r.successes['E'];}%</td>
<th>Impossible</th><td>%{return r.successes['I'];}%</td>
<th>Jackpot!</th><td>%{return r.successes['J'];}%</td>
</tbody>
</table>
formal goblet
gentle jolt
#

Alrighty. Any way to get a variable and store it for use in %{}% scripts later on in the message, like the example above?

formal goblet
#

And Chat Message will also be suppressable

#

And there is actually a way to suppress Chat Message creation in the current version... By throwing an error ๐Ÿ˜…

gentle jolt
#

I was actually just about to say that I was gonna do that for now, since I found that out by trying the previous example. XD

#

Makes me more understanding for the fact that Windows has a bunch of known and expected errors in the Event Viewer.

devout sinew
#

I am struggling to figure out how to adjust this macro to add a modifier from a character sheet. I am using the Custom System Builder module and I'm trying to include a value from a number field on the character sheet so the roll would be 1d12[Hope] + 1d12[Fear] + statfromcharactersheet ${d6}. Any help would be greatly appreciated. ```javascript
const buttons = ["adv", "norm", "dis"].reduce((acc, action) => {
acc[action] = {label: action.capitalize(), callback};
return acc;
}, {});

function callback([html], event) {
const action = event.currentTarget.dataset.button;
return {
adv: "+ 1d6",
dis: "- 1d6"
}[action] ?? "";
}

const d6 = await Dialog.wait({buttons});

const roll = await new Roll(1d12[Hope] + 1d12[Fear] ${d6}).evaluate();
const isCrit = roll.dice[0].total === roll.dice[1].total;
const isHope = roll.dice[0].total > roll.dice[1].total;
const isFear = roll.dice[0].total < roll.dice[1].total;

await roll.toMessage({
speaker: ChatMessage.implementation.getSpeaker({actor: actor}),
flavor: isCrit ? "Critical success!" : isHope ? "Rolled with Hope!" : isFear ? "Rolled with Fear!" : ""
});```

formal goblet
devout sinew
devout sinew
main magnet
#

How do I put an item text field to pop up as a tooltip in an item container's column entry?

main magnet
half beacon
#

What's the error?

cerulean adder
#

I'm able to call a rollable table and output the result of the roll, but when I do it via the table I get an image and when I do it with a label I don't get the image. Is there a way to get both the result and image?

main magnet
#

If I put in the weapon's column (table name) then it says 'ERROR' when I put my mouse over the weapon.

cerulean adder
#

Also, is there a way to put a variable in an html tag? I tried this but I got an error. I also tried adding ' ' and removing the ${}$ and neither worked
<img src="icons/${tableName}$" alt="table">

formal goblet
cerulean adder
main magnet
red perch
#

Hello

#

I need help with HP bars in CSB

#

can anyone help me?

formal goblet
formal goblet
# red perch I need help with HP bars in CSB

Do not create a custom attribute bar. The system will create one for you if you have a number field with a max-value. And that one will be editable.

Was that your issue? ๐Ÿ˜…

red perch
#

I figure it out but thanks for answering

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

sorry I'm very new to all this, I have this %{return await game.macros.getName('Basic Roll').execute();}% in the label on the character sheet which correctly calls the macro however, I haven't been able to figure out how to get the macro to add a specified attribute value from a number field on the character sheet. Do I need to add that to the macro, do I use this in some fashion %{return await game.macros.getName('macroName').execute({name: entity.entity.name, strength: ${Strength}$});}%, or do I need to do both?

formal goblet
devout sinew
# formal goblet The part in `execute()` is important, because here you can define what you like ...

ok would you be willing to point out where I'm messing up? I have this in the label %{return await game.macros.getName('Basic Roll').execute({Actor: entity.entity.actor, agility: ${agivalue}$});}% and this is the macro where I'm trying to put the Agility value in ```javascript
const buttons = ["adv", "norm", "dis"].reduce((acc, action) => {
acc[action] = {label: action.capitalize(), callback};
return acc;
}, {});

function callback([html], event) {
const action = event.currentTarget.dataset.button;
return {
adv: "+ 1d6",
dis: "- 1d6"
}[action] ?? "";
}

const d6 = await Dialog.wait({buttons});

const roll = await new Roll(1d12[Hope] + 1d12[Fear] + agility ${d6}).evaluate();
const isCrit = roll.dice[0].total === roll.dice[1].total;
const isHope = roll.dice[0].total > roll.dice[1].total;
const isFear = roll.dice[0].total < roll.dice[1].total;

await roll.toMessage({
speaker: ChatMessage.implementation.getSpeaker({actor: actor}),
flavor: isCrit ? "Critical success!" : isHope ? "Rolled with Hope!" : isFear ? "Rolled with Fear!" : ""
});```

formal goblet
#

And you also have to resolve agility in your macro before you construct Roll

devout sinew
formal goblet
devout sinew
formal goblet
broken pumice
#

Hello, I'm encountering a weird bug. The Rich Text Editor save button doesn't work. Closing the character/item sheet will save the text. (My players are annoyed when they type a Wall of Text then reflexively go for the save button and loose everything they just did...) It is a behaviour limited to the CSB templates (Saving the Journal Notes works as intended.)
As I have not seen anything about this issue, I was wondering if I was the only one experiencing this (may very possibly have messed up somewhere...) or if it I should open an issue.
I'm using CSB 3.0 and Foundry version 11 Build 315

vagrant hollow
# broken pumice Hello, I'm encountering a weird bug. The Rich Text Editor save button doesn't wo...

There are three different styles how rich text areas works inside of CSB (in sheet editor, dialog editor, icon only) and each work a bit different.
For me the save is working fine on for all these versions.

You are asking if it is a behaviour for templates, so I have to ask: Did you gave your players access to the templates?
If someone changes the default text inside a richtextarea, but inside the character sheet was already made any change to this value, the changes will not take effect in these character sheets.
The changes are stored but will only be visible inside sheets where the value was not changed in any way.

Or are your players use the source code editor inside the richtextarea?
Then they have to use 2 save buttons.

drifting raft
#

Anyone knows how to style the chat messages and the input dialogs (not user input templates, but the dialogs resulting of them) in CBS?

formal goblet
drifting raft
spiral dome
#

Is there a way to sort items in an item container? I made an items container for my skills, and I would like the skills to be sorted alphabetically.

dusky mauve
fierce harbor
dusky mauve
#

Yep, but I have start parallel transfer mys system to Sandbox
Due to no updates on CSB. Community is good, but no progress unfortunately in code base.

devout sinew
# formal goblet You already passed `agility` to the Macro, so you can use this variable directly...

Ok I have the roll working properly but now I'm getting weird results for the name in the chat message. I'm guessing it's because I haven't properly defined the Actor Name? When a player rolls it shows Test above the roll and message and then it will give the character name with undefined below it. Rolling as the GM gives me the GM username above the roll and chat message with the character name with undefined below (see attached screenshot). This is the script I'm using, I assume since Actor was passed to the macro as entity.entity that this maybe isn't what I want there. javascript await roll.toMessage({ speaker: ChatMessage.implementation.getSpeaker({Actor}), flavor: isCrit ? "Critical success!" : isHope ? "Rolled with Hope!" : isFear ? "Rolled with Fear!" : "" });

fierce harbor
devout sinew
fierce harbor
devout sinew
devout sinew
high stag
#

Hi it's possible to make a dynamic table in any template sheet and call it in another sheet?

high stag
#
  1. Im trying to make a number field disappears as a dropdown list option is true.
    What i made wrong here?

ref('spellduracao')!=='spelldur.instant'

fierce harbor
high stag
#

thanks!

#

Oh, it worked but somehow don't show the number field independent of the value of the list

fierce harbor
high stag
fierce harbor
#

I think it is bruxariaduracao!=bruxariadurinstant .

high stag
#

dsakjdk ah dont worry about that.
Its because i'm Brazilian
So i barely translated just to help

#

following the right name doesnt make it work

fierce harbor
high stag
#

No

fierce harbor
high stag
#

never

fierce harbor
# high stag never

My bad...
!equalText(bruxariaduracao,'bruxariadurinstant')...it is text ๐Ÿ˜…

high stag
#

now it's always shows ๐Ÿ˜‚

fierce harbor
high stag
#

as you wish

formal goblet
high stag
#

Worked. Thank you both.

formal goblet
high stag
#

Thanks

high stag
#

Im trying to refer a dropdownlist label but this returns the key.
${!item.bruxariaacoes}$

there is a path for a dropdownlist key label?

spiral dome
#

Is it possible to make an item container that is displaying only the names of the items in it to display the names in horizontal rows rather than vertical rows?

fierce harbor
fierce harbor
spiral dome
fierce harbor
spiral dome
#

hmm, I have the following issue with building my game system:

I made an item template for Talents.
Each class has it's own set of unique talents. on the Talent item template I included a dropdown-menu for the classes.
A character can have multiple classes. I wanted to make three item containers. Each item container would filter for one specific class.

My idea was to make a dropdown-menu on the character sheet with the classes above each item container. A player would chose a class on the character sheet. The item Container would then only show the talents if the dropdown-menu on the character sheet would be equal to the dropdown-menu on the Talent item.

But I cannot use formula's to filter in the item containers. Is there an easy way to achieve this?

spiral dome
#

I think I found a solution. I added a panel only visible to the GM on the Talents Items. I put some labels with fetchFromActor formula's. I can filter on those labels because they are in the item.

half beacon
#

Has anyone figured out a way to get Item Piles currencies to work without duplicating the currency item? It happens every time a player picks up gold (the only currency in the game).

dusky mauve
earnest imp
#

For that matter, do you guys use any modules for the items of your CSB system?

glad spade
devout sinew
#

How would I go about adjusting this macro to add +1 to a number field value on the character sheet with key hopevalue when a "Critical Success" or "with Hope" is rolled? ```javascript
const buttons = ["adv", "norm", "dis"].reduce((acc, action) => {
acc[action] = {label: action.capitalize(), callback};
return acc;
}, {});

function callback([html], event) {
const action = event.currentTarget.dataset.button;
return {
adv: "+ 1d6",
dis: "- 1d6"
}[action] ?? "";
}

const d6 = await Dialog.wait({buttons});

const roll = await new Roll(1d12[Hope] + 1d12[Fear] + ${Agility} ${d6}).evaluate();
const isCrit = roll.dice[0].total === roll.dice[1].total;
const isHope = roll.dice[0].total > roll.dice[1].total;
const isFear = roll.dice[0].total < roll.dice[1].total;

await roll.toMessage({
speaker: ChatMessage.implementation.getSpeaker({actor}),
flavor: isCrit ? "Agility Critical success!" : isHope ? "Rolled Agility with Hope!" : isFear ? "Rolled Agility with Fear!" : ""
});

{throw "Done";}```

timid marten
#

How could one get the value of the selected token's actor's props and let's say reduce them from a Macro? Like for example a simple macro that does "-1" to the props.Strength of the selected token's actor

timid marten
#

Thank you!

devout sinew
# formal goblet pass `entity` to the Macro. Then you can just do `await entity.entity.update();`...

ok I clearly did this wrong but can I put the await entity.update in this part of the macro or does it belong somewhere else. How do I use the result of the die rolls to update data? I did pass entity to the macro. javascript const roll = await new Roll(`1d12[Hope] + 1d12[Fear] + ${Agility} ${d6}`).evaluate(); const isCrit = roll.dice[0].total === roll.dice[1].total; await actor.update(${Hope} + 1); const isHope = roll.dice[0].total > roll.dice[1].total; await actor.update(${Hope} + 1); const isFear = roll.dice[0].total < roll.dice[1].total;

timid marten
#

But "Strength" returns undefined

#

It's this line that returns the error :

let HPquota = 6 * Strength;
formal goblet
#

Be aware that the formula-part of updateProperty() can only recognize props, which are present on the Actor. New variables in the Macro are not recognized, so you have to resolve them before passing them.

timid marten
#

I tried

let HPquota = 6 * key.get('Strength');
#

a.system.props.Strength returns the same issue

formal goblet
timid marten
formal goblet
timid marten
#
for (const a of actors) {
    // ***Define all needed keys here***
    const keys = ['HP'];
    // ***Define all needed keys here***
    
    keys.forEach(key => currentProperties.set(key, a.system.props[key]));

    let HPquota = 6 * keys.get('Strength');


    // ***Perform all your calculations here***
    updateProperty(a, 'HP', '${HP - HPquota}$');
formal goblet
#

Of course it cannot find it

timid marten
#

I'm not calling Strength inside the "const keys" because I do not need to modify this value

#

doesn't work either using a.system.props.Strength

#

as in

for (const a of actors) {
    // ***Define all needed keys here***
    const keys = ['HP'];
    // ***Define all needed keys here***
    
    keys.forEach(key => currentProperties.set(key, a.system.props[key]));

    let HPquota = 6 * a.system.props.Strength


    // ***Perform all your calculations here***
    updateProperty(a, 'HP', '${HP - HPquota}$');
formal goblet
#

I want to see what's in it

timid marten
formal goblet
#

he

#

Are you doing it in the for-loop?

timid marten
#

I am

formal goblet
#

But how can a be not defined then? ๐Ÿ˜…

timid marten
#

idk lol

#

I tried actor instead

#

still doesn't work

#

"Uncomputable token HPquota"

formal goblet
#

You can just use updateProperty(a, 'HP', keys.get('HP') - HPquota);, it doesn't have to be a Formula

timid marten
#
let actors;
let currentProperties = new Map();
let updatedProperties = new Map();


// Get the selected tokens. Default: currentPlayerActor
if (canvas.tokens.controlled.length > 0) {
    actors = canvas.tokens.controlled.map(a => a.actor);
} else {
    if (!actor) {
        ui.notifications.error('Make sure that you select atleast 1 token or that you have a configured actor');
        return;
    }
    actors = [actor];
}

for (const a of actors) {
    // ***Define all needed keys here***
    const keys = ['HG', 'SF', 'FT'];
    // ***Define all needed keys here***
    
    keys.forEach(key => currentProperties.set(key, a.system.props[key]));

    let HPquota = 6 * a.system.props.Strength


    // ***Perform all your calculations here***
    updateProperty(a, 'HP', keys.get('HP') - HPquota);
    // ***Perform all your calculations here***
    
    for (const element of keys) {
        if (!updatedProperties.get(element)) {
            ui.notifications.info(a.name + ': ' + element + ' -> unchanged');
        } else {
            await a.update({['system.props.' + element]: updatedProperties.get(element)});
            ui.notifications.info(a.name + ': ' + element + ': ' + currentProperties.get(element) + ' -> ' + updatedProperties.get(element));
        }
    }
}

// Use this update-function
function updateProperty(actor, key, formula) {
    updatedProperties.set(key, new ComputablePhrase(formula).computeStatic(actor.system.props).result);
}
#

here's the whole thing :')

formal goblet
#

Oops, should be currentProperties.get()...

#

keys is an Array, not a Map...

timid marten
#

as in updateProperty(a, 'HP', currentProperties.get('HP') - HPquota); ?

formal goblet
#

Yep

timid marten
#

Okay I'll try

#

Alright it works, thank you!

timid marten
#

I wanted to add a query to establish the value for the stamina consumption, however I get an error and can't find out why

#

And here is the error

#

I tried to modify the way I define my var but it doesn't change the error

formal goblet
timid marten
#

I feel so dumb lmao

#

I get this error now though

formal goblet
timid marten
#

Sorry if it's dumb questions, I didn't do JS for like 10 years or so

#

Thank you, worked like a charm

#

๐Ÿซถ

timid marten
#

I just wanted to add a cancel button

#

:(

formal goblet
#

Basically the same rules as for JSON

#

If you're not sure about syntax rules, you can use an online linter for Javascript

timid marten
#

Made it work with your guidance, thanks again thxblob

devout sinew
# formal goblet https://discord.com/channels/170995199584108546/699750150674972743/1221662971432...

ok I've done some experimenting and still not having any luck so I'm hoping you might give me some more insight into where this is going wrong. Is my pathway correct for hope? This is what they suggested over on Macro-polo but they aren't familiar with custom system builder: await actor.update({"key.off.hope": Hope + 1}); and this is what I have passing to the Macro: %{return await game.macros.getName('Agility Roll').execute({Actor: entity.entity, Agility: ${Agilityvalue}$, Hope: ${hopevalue}$});}%. This is the full macro ```javascript
const buttons = ["adv", "norm", "dis"].reduce((acc, action) => {
acc[action] = {label: action.capitalize(), callback};
return acc;
}, {});

function callback([html], event) {
const action = event.currentTarget.dataset.button;
return {
adv: "+ 1d6",
dis: "- 1d6"
}[action] ?? "";
}

const d6 = await Dialog.wait({buttons});

const roll = await new Roll(1d12[Hope] + 1d12[Fear] + ${Agility} ${d6}).evaluate();
const isCrit = roll.dice[0].total === roll.dice[1].total;
await actor.update({"key.off.hope": Hope + 1});
const isHope = roll.dice[0].total > roll.dice[1].total;
await actor.update({"key.off.hope": Hope + 1});
const isFear = roll.dice[0].total < roll.dice[1].total;

await roll.toMessage({
speaker: ChatMessage.implementation.getSpeaker({actor}),
flavor: isCrit ? "Agility Critical success!" : isHope ? "Rolled Agility with Hope!" : isFear ? "Rolled Agility with Fear!" : ""
});

{throw "Done";}```

formal goblet
devout sinew
formal goblet
devout sinew
formal goblet
#

Then what does the console say?

devout sinew
formal goblet
devout sinew
devout sinew
formal goblet
#

What does game.actors.getName('yourActorName').system.props.Hope return in the console?

devout sinew
formal goblet
#

Btw, why 2 update-calls?

devout sinew
devout sinew
formal goblet
devout sinew
formal goblet
# devout sinew ๐Ÿ˜… well I was hoping to include it with the conditionals that already exist but ...
MDN Web Docs

The conditional (ternary) operator is the only JavaScript operator that takes three operands:
a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy.
This operator is frequently used as an alternative to an ...

timid marten
#

It always returns 1051.1 instead of 106.1

devout sinew
timid marten
#

After some console checking I found that the 1.1 is purple (it means it's a number I believe) and 105 is grey (it means it's a string I believe)

But why is currentProperties.get('STAMINA') suddenly a string?

#

I also tried to replace it with a.system.props.STAMINA but it also returns a string

formal goblet
#

They are all strings currently, but that's usually not an issue because of implicit coercion.

timid marten
#

Then there is something wrong somewhere in my code I guess, but I can't find where :/

gray tangle
#

Just started with foundry trying to build my own system. I've created a world with CSB but it won't open/load the world I think because there's a required module that I can't find to download.

formal goblet
gray tangle
#

How many people here are working to build their own homebrew ttrpg system(s)

formal goblet
fierce harbor
#

If I'm not mistaken there are around 600 users on this channel.

devout sinew
high stag
#

Im trying to make a component show as a checkbox is checked.
So ${!item.bruxariare_b == TRUE? "B": ""}$ its not "TRUE" the syntax?

sharp prairie
#

Reposting this question because I have found no answers elsewhere. The module works perfectly in all other systems I've used. Any help is appreciated!

high stag
#

Its the cauldron feature the problem?

sharp prairie
#

I am not using the cauldrron.

high stag
#

brb, i will test it.

formal goblet
formal goblet
high stag
formal goblet
high stag
#

sorry๐Ÿ˜‚
I have a checkbox field (bruxariare_b) that is the checkbox key. If it's checked I want it to display "B".

formal goblet
#

Edited

high stag
#

There is no A

high stag
#

It's about the nature of the ripper module.
It is made to change the fields of the foundry's default sheet. This is how he integrates with systems.

I don't see a way for it to work correctly with CSB, unless you actually edit the module to make this integration.

sharp prairie
#

The product of the recipe appears in the sheet, yes.

#

oh. hmmm, ok

#

well, I mean, worst case, the player just needs to delete the ingredients from their crafting container I guess. Not terrible. ๐Ÿ™‚ Thank you for looking!

high stag
#

From what I tested was this, I use the module so if I find a way I'll let you know here @sharp prairie

sharp prairie
#

At least I won't have to dig out the product and give it every time they craft.

#

Thank you!

#

Maybe it's because I'm working with 2 separate item containers?

#

and a different template for ingredent and product

high stag
#

i tested with only one and you know

#

but if it works for you ๐Ÿ˜‚

high stag
high stag
#

There is a way to divide a label roll message in two foundry messages?

formal goblet
high stag
#

How can I hide this d20 icon? (its a chat roll result)

high stag
formal goblet
high stag
#

obs: I removed the [] and it worked

half beacon
glad spade
earnest imp
#

Looking to retrieve token.document to use inside a %{}% formula, any clues?

%{
    status_count = EffectCounter.findCounterValue(token.document, CONFIG.statusEffects.find(e => e.name === "Brave").icon);
    return status_count;
}%```
earnest imp
# formal goblet Are you maybe trying to do this here? https://gitlab.com/custom-system-builder/c...

Ooooh thats an alternative I used before, but more or less yes. Though I do have additional detail to offer to the link you posted:

What I found before when using this, it only works when the status counter is set to statuscounter.simple:

return entity.entity.appliedEffects.find(e => e.name === 'Dead')?.flags.statuscounter.counter.value ?? 0;```
However if the statuscounter is set to either `statuscounter.countdown_round` or `statuscounter.countdown_turn`, I found out you need to use this code instead, since status icon counter defines their effect stacks differently per option:
```js
return entity.entity.appliedEffects.find(e => e.name === 'Dead')?.duration.remaining ?? 0;```
half beacon
formal goblet
earnest imp
#

just the side kink of status icon counter

formal goblet
#

Well, I was only interested how many stacks an effect had, not how long it would last

earnest imp
#

That's the thing, Status Icon Counter is a bit odd internally, you'd think duration means how long it lasts, but no its apparently also where stacks are kept track of per turn/round lol

formal goblet
#

Ok, that's indeed a bit odd ๐Ÿ˜…

earnest imp
#

Wanted to share the info at least so I'm the only one who suffered ๐Ÿ˜†

formal goblet
#

I tried to work with the API in my first attempts to get the stacks, but had some issues with that, so I'm doing it the raw way.

earnest imp
#

The API issss weird

#

It seems that Status Icon Countdown API only works if you use the one where you use the status icon path

#

i.e:

let effect = CONFIG.statusEffects.find(e => e.name === effect_name);
let effect_counter = EffectCounter.findCounter(token.document, effect.icon);```
#

EffectCounter.findCounter and EffectCounter.findCounterValue works

#

But it seems that every other API that doesn't look up by effect icon just doesn't work

#

Noooot very svelte but that's mostly the thing with the API

formal goblet
#

Who'd use the icon path as a kind of id...

earnest imp
#

I share your confusion

#

But it is what it is

#

And I'm working with what I got

glad spade
#

or things that make items similar

#

Otherwise all items are unique

#

Including currencies.

abstract siren
#

Hello everyone, is there any way to keep the vanilla roll display in the chat and access the single results of the roll from js?
I'm currently struggling with it, the idea is to do something like the following and process the results further in js for crits, partial success and the like. The issue is that the "roll" variable is just a string when parsed in js due to it being output in a computable phrase, so I can't access the single results of the dice.

<p> ${NAME}$ is attacking with ${modifier:=${ATTACK_modifier}$}$</p>
${roll:=[2d12]+modifier}$
%{console.log(roll)}%
fierce harbor
abstract siren
#

makes sense, it's a nice hack, the issue is still with keeping the vanilla chat display (having only the unified result showing to the chat), with faculty of click inspection, which could still be done by scripting probably. I was wondering if there's a native way to do this with the given apis

#

thanks for your input though @fierce harbor

fierce harbor
brazen kettle
#

So how good is Sandbox?

half beacon
formal goblet
abstract siren
formal goblet
abstract siren
formal goblet
abstract siren
formal goblet
# abstract siren Interesting, will have to look into it with more time on my hands though, it's a...

Well, it's more complex than just using CSB-Formulas, I agree with that ๐Ÿ˜…. We also know that Dice Pools are not integrated well into CSB, but engineering a satisfying solution for our Formula System is quite challenging... https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/207

pallid kettle
#

Is there a way I can make a panel scroll?
I have two panels next to each other on the character sheet.
I'd like one to be static while the other one scrolls. Any way to do that?

latent sorrel
#

that requires CSS, specifically 'overflow-y: scroll;'

main magnet
#

How do I reference an item's image (to send it to chat)?

formal goblet
raw terrace
#

I'm getting some strange behaviour trying to set up Item Piles with CSB. I can get it to work and pick up the right information if I click on the token of the initially dropped (default) item pile, but if I choose the actor, it defaults back to the actor sheet and doesn't change when I configure it. Plus, the next time I open the sheet connected to the token, it has defaulted back to the actor sheet rather than the merchant/container/item pile view. I am thinking it is something to do with the character actor type, as I have different templates set up for this and I was just wondering if anyone else had come across this?

normal ore
#

Hey folks, how are you all doing?

Can I use this macro and activate the status effect on a target instead of a selected one?
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Active-Effects#1-macro-for-creating-active-effects-for-selected-tokens

Another thing: can I use CSB formulas in any variable of this macro? For example, instead of defining the effect name in the macro, could I use a formula like ${poison}$?

formal goblet
normal ore
formal goblet
# normal ore Cool!

Have to correct one thing. You can use CSB-Formulas in Script-Expressions, but not in Macros directly. If you're calling a Macro from a Script-Expression, you have to pass all needed values to the Macro#execute()-function.

normal ore
formal goblet
normal ore
#

Thanks

silver lake
#

Heyo! Did an oopsie, and had two equal tabs created, which had a lot of important information on them for a lot of characters. Everything went [object Object].
Is there a way to recover any of that information, has it been stored in any log?

formal goblet
silver lake
formal goblet
#

If it's not, then... Well...

silver lake
#

Just.. a lot to break down.. but I'll work on it

#

thanks!

formal goblet
silver lake
#

It's okay, I'm scrounging fine so far. It's just a little bit outdated, but most of it is here. It's just all of the players' and npcs' inventories. The players are hoarders though..

stone swan
#

Is there a way to get a label formula to call a rich text field and then run formulas that are in that fields text?

#

I'd like to have a dynamic table where players can, effectively, write and store macros for their abilities. I've figured out how to create a dynamic table where each row has a button that will spit out the results of a corresponding rich text field, and it will even handle rolls, but any other formula stuff, like variables or prompts, gets ignored.

vagrant hollow
stone swan
weary nymph
#

Hello. How can I access currencies in CSB/Foundry? I'd like to see if I can change currency names and exchange rates. I'm planning on using Item Piles merchants.

raw terrace
normal ore
#

@formal goblet ,
Still about the status effect macro, how could I reduce the target's current HP by 10% every time the target's turn comes, for example?

formal goblet
devout sinew
#

is there a way to increase the maximum value of specified number field using a formula, for example: ${setPropertyInEntity('self', 'defensevalue', "defensevalue.maximum +1")}$. .maximum isn't correct so is there a key for the maximum value?

formal goblet
formal goblet
#

But you can achieve a similar effect by having an additional number field, which should contain the max-value of the other one

normal ore
formal goblet
#

I don't know the correct Hook for end of round, but you can inspect the Hooks fired by enabling the debug-mode with CONFIG.debug.hooks = true and watching the console

devout sinew
formal goblet
#

As a rule of thumb, as long as a User is able to directly change the value of an Component, setPropertyInEntity() can do so as well

devout sinew
devout sinew
broken pumice
stone swan
#

Is there a way to use setPropertyInEntity (or something similar) to modify the roll message of a lable?

raw terrace
#

โ€ฆ and the strange behaviour I was seeing with Item Piles has gone (I removed the quantity path as it wasnโ€™t needed in my case and it all started working as expected). Nice!

vagrant hollow
stone swan
# formal goblet No

That's unfortunate. I haven't dug into it too much, but I did see some stuff on creating custom components. Would it be feasible to create a version of labels that adds a button to allow users to edit the roll message?

formal goblet
stone swan
#

And, just to double check, would those editable components be able to do the normal Label roll message stuff?

empty glen
#

Does anyone know how to explode more than one die on a roll? For example, if I'm rolling 3d6 and I get two 6s, I would like Foundry to reroll both 6s.

empty glen
#

Yes, you're right. I didn't ask the right question, or rather the full question. I'll try again:

I'm building Deadlands Classic. In the game, you roll your dice, reroll any max results, but only add the highest of each round of rolling. For example, 3d6 gets me 2, 6, 6 on the first round of rolling. I reroll the two 6s and get 3, 6. I reroll the 6 again and get a 4. The total result would be 22 (6+6+6+4).

formal goblet
empty glen
#

How do I define my own logic?

formal goblet
#

Javascript and the use of the Roll-API from Foundry

empty glen
#

Copy that! Thank you!

formal goblet
sonic coral
#

For some reason reason I'm not able to find custom system builder in the search and when I try to install with the manifest url I get this error:

#

running v11 build 315

formal goblet
#

CSB is not a module

sonic coral
#

oh jeez

#

facepalm

weak zealot
#

Hi, I'm new here. I was wondering if there is any way to send a general notification when a player checks a checkbox (I should mension the chekbox is part of a dynamic table)? I've tried adding a formula to the label of the checkbox ${ notify('info', 'object used') }$ but it obviously didn't work. Any idea? Thanks

earnest imp
#

How can I get the "label" of a dropdown value?

#

selected: hp_value
what i want: HP โค๏ธ

formal goblet
earnest imp
#

ahhh shit okay ill do it a bit less prettily then

#

thanks

formal goblet
#

But you can have the Key match the Label

#

There's no restriction like for Component Keys

abstract siren
#

I have a question regarding the update of values in the sheet and the interaction with chat roll messages.
I have a Label that rolls for damage that can be impaired or enhanced depending on a Number Field that players can modify. The value used for the Roll is currently dependent on a Hidden Attribute containing javascript code that does all the calculation.
What currently happens is: Player modifies the Number Field, clicks on the Label(which currently displays the old value), damage gets rolled, the Label is updated with the new value.
How does one have the Label updated before the roll? Should I roll by putting JS in the label and rolling AFTER a whole sheet update? Or is there a way to handle this case natively?

formal goblet
abstract siren
#

To answer your question more precisely, the label doesn't update until I click it, so yes I have issues before I click.

formal goblet
#

Ok, so it doesn't even have something to do with the Label Roll Message. How does your Label text look like?

abstract siren
# formal goblet Ok, so it doesn't even have something to do with the Label Roll Message. How doe...

label text is just ${ADJUSTED_DAMAGE}$
label roll message is:

${#dice:=%{const damageLadder = ["d4", "d6", "d8", "d10", "d12", "d10+d4", "d10+d6", "d10+d8", "2d10", "d12+d10", "2d12"];
const props = entity.system.props;
let damageValue = ${DAMAGE_DIE}$;
console.log("damageValue: " + damageValue);

let enhancements = Number(props["VANILLA_DAMAGE_ENHANCEMENTS"]);
let impairments = Number(props["VANILLA_DAMAGE_IMPAIRMENTS"]);
let totalModifier = (enhancements - impairments) * 2;

const damageMap = {};
for (let i = 0; i < damageLadder.length; i++) {
    const key = 4 + i * 2;
    damageMap[key] = damageLadder[i];
}

// Use Object.keys() for objects to get an array of keys
const keys = Object.keys(damageMap).map(Number); // Convert keys to numbers if they are not already
const lastKey = Math.max(...keys); // Get the highest number key
const firstKey = Math.min(...keys); // Get the lowest number key

if (totalModifier != 0) {
    let updatedDamageValue = damageValue + totalModifier;
    if (updatedDamageValue > lastKey) {
        damageValue = lastKey;
    } else if (updatedDamageValue < firstKey) {
        damageValue = firstKey;
    } else {
        damageValue = updatedDamageValue;
    }
}

damageDie = damageMap[damageValue];
console.log(damageDie);

return damageDie;
}%}$
Inflicts damage for ${[:dice:]}$ HP.
#

ADJUSTED_DAMAGE is exactly the same code until "return damageDie", this is the latest hack while I was trying to update before the roll

#

before this I would just put "Inflicts damage for ${[:ADJUSTED_DAMAGE]}$" in the roll message

#

DAMAGE_DIE is a number

formal goblet
formal goblet
#

Otherwise I don't know why the Label text has an update anomalie atm

high stag
#

how i setup the custom css path? everywhere I put it, doens't matter he don't recognize it

earnest imp
#

When making an equippable item, any way to access the variables of the equipee?

#

I was able to get the value of the parent using this, but this feels a little gross so Im wondering if theres a cleaner way to do this

%{
    return entity.entity.parent.system.props.variable_name_here
}%```
high stag
#

if you are talking about a label roll you can just use ${!item.}$

abstract siren
abstract siren
formal goblet
earnest imp
#

ooooh nice

#

ill use that then, thanks!

vagrant hollow
high stag
#

Yes I know, the problem is that it appears in the console: "Not allowed to load local resource".

#

and no matter where I put it

high stag
#

I'm trying to make lines on a roll label disappear when a checkbox is not checked. When including a more complex formula (e.g. 1d20+strength) it does not work. The only way to do this is through a macro?
or is it at least possible?

vagrant hollow
abstract siren
#

does anybody know if it is possible to reference a Label KEY inside the Label TEXT?

#

like if I have a Label whose Key is called RESTORATION, I'd like to reference that in a variable inside the text of the Label itself

formal goblet
abstract siren
#

thanks anyway

#

๐Ÿ˜„

formal goblet
high stag
#

And can I make some conditional for this syntax?

#

e.g
Attack:[x] <- checkbox

and on the roll will have the roll formula

#

Ah, is for an item

formal goblet
high stag
#

i put a simple d20 and didn't work

#

With a macro it will only return one field right?

#

How can I refer to this checkbox from a itemcontainer in a script?
Specifically the same clicked to roll?

#

Im thinking about doing this with three different macros ๐Ÿ˜…

fresh arrow
#

Good evening...

  • first of... sorry if that was already asked, but yet have no idea how to search in "subchanel" of Discord... if anyone could advice me in that would be great ๐Ÿ™‚
    [EDIT: ok... that one solved, simply didn't click on subchanel on the chanell list ๐Ÿ˜‰ NVM]
  • secondly... can someone help me how to get information out from "item" in "item container" and use it in formulas elsewhere on charsheet?
    (like item in container impact number field by +2 or we need to display specific text which is text field in item somewhere on charsheet)
  • and third question... can I anyhow set a specfic width of item?
    (like max width of x or min width of y)
high stag
fresh arrow
fresh arrow
high stag
high stag
fresh arrow
fresh arrow
# high stag you want to call that where? on a macro? a label roll?

already two cases there:
in that specific example I wish to pull back description of the "item" somwhere else on "char sheet" as Label
second example (not detailed above) is to use data in "item" to impact "label roll" as so ie to have weapon with "field" that will determine its skill bonus to use it as modifer during roll if hit take place

high stag
fresh arrow
formal goblet
# fresh arrow Good evening... - first of... sorry if that was already asked, but yet have no i...
empty glen
#

Is there a way to set one checkbox to automatically uncheck when another checkbox is manually uncheck?

high stag
#

you could help me to solve the problem to hide a section? @formal goblet

#

please

empty glen
#

I'm try to push an item's name into the message box from the item itself but can't seem to do it. Basically, I'm rolling from an item but want the message to show up with the name of the item. I'm sure there is a way but I'm not seeing how to do it on the documentation.

normal ore
#

Hey guys, how are you doing?

I need some help!

I'm trying to use the status effect script, and when the round ends, I need to modify an attribute.

I found the trigger that calls the end of the round, which is effect.setFlag('effectmacro', 'onRoundEnd.script', 'My Macro Here');

I've already tested it and it works really well. Now I need a macro that reduces the HP attribute, similar to HP = HP-10. How can I make this macro? Is it simple?

formal goblet
normal ore
#

Its target actor

formal goblet
# empty glen I'm try to push an item's name into the message box from the item itself but can...

${name}$ or a Script, which post a Chat Message with a different Speaker:

const rollKey = 'keyOfLabelWithTheLabelRollMessage';
const rollText = entity.getCustomRolls()['main'][rollKey];

let phrase = new ComputablePhrase(rollText);
await phrase.compute(this.entity.system.props, {
  computeExplanation: true,
  triggerEntity: entity
});

let speakerData = ChatMessage.getSpeaker({
  actor: entity.entity,
  token: entity.entity.getActiveTokens()?.[0]?.document,
  scene: game.scenes.current
});

phrase.postMessage({
  speaker: speakerData
});
formal goblet
normal ore
formal goblet
normal ore
# formal goblet Context is provided, not created. Now the question: Whose target? ๐Ÿ˜…

Sorry, I meant provided, not created, as I use translation apps, my English is terrible. Here we go:

Basically, I want this script I'm making to be triggered on a target through an item table formula in the character sheet, everything works fine up to this point.

The problem lies in this trigger effect.setFlag('effectmacro', 'onRoundEnd.script', 'My Macro Here'); because here I want a specific status effect to reduce the HP of whoever has the status effect active. And I'm not able to determine that. I've already placed another macro, for example effect.setFlag('effectmacro', 'onRoundEnd.script', 'ui.notifications.warn("Next Round");'); and it works fine (I did this because it's very simple, just to test if the modifications I made are working). However, when trying to place a macro to change an attribute of a character sheet that has the effect active, I'm not able to do it. Did I manage not to be confusing with my terrible English?

formal goblet
normal ore
# formal goblet Because we miss important contextual information, and that is **who** the Actor ...

Got it!
I even tried to use a reference from the status effect creation wiki. This one:
changes: [
{ key: "system.props.DEX", mode: 5, value: (token.actor.system.props.DEX) * 3 },
// Attribute to change, set "key" and "value", the value can be js formula (IMPORTANT : mode must be 5 otherwise it breaks because in CSB attributes are stored as strings), in this example dexterity will be multiplied by 3
]

I tried to adapt it to something like:

effect.setFlag('effectmacro', 'onRoundEnd.script', '{ changes [key: "system.props.for", mode: 5, value: (token.actor.system.props.for) * 3 }]');

But it seems it doesn't work!

formal goblet
normal ore
#

Now I just need to learn and understand how to set variables in macro calls, for example: %{return await game.macros.getName('${item.status}$').execute();}% so that I can define the variables using CSB formulas.

high stag
#

that comes from an item

high stag
latent sorrel
# normal ore Now I just need to learn and understand how to set variables in macro calls, for...

If you mean sending a variable value through the macro. Also, you dont have to declare the variable in the called macro that you passing from the .execute(). It is automatically defined by sending the variable to it. Therefore, using example below, you can do just have let newValue = parseInt(targetVariable)*2 without having to declare targetVariable in the macro:

 %{
const data1 = "${csbField}$";
const data2 = entity.entity.system.props.anotherCsbField;
return await game.macros.getName('${item.status}$').execute({targetVariable:data1,targetVariable2: data2});
}%
normal ore
#

Guys, how do I highlight the scripts here on discord

formal goblet
normal ore
#

Thank you for responding, but actually what I'm wanting is basically this:

My formula in an item container is like this:

%{return await game.macros.getName('${item.status}$').execute();}%

The key "item.status" contains the name of the macro and works very well.

Now, the macro that the formula is calling is a status macro. Here's the macro:

#
if (selected.length === 0) {
    ui.notifications.warn("Select at least one token !");
} else {
    selected.forEach(async token => {
        let effectData = {
            name: "Test",
            icon: "icons/svg/daze.svg",
            tint: "#ff0000",
            duration: { seconds: 300 }, 
            origin: token.document.uuid,
            sourceName: "Invisibility spell", // The source of the effect (must be a string), displayed on the effect window if you have Visual Active Effect
            disabled: false, // If the effect should be disable when created (boolean)
            description: "Just a test macro!", // Description of the effect showed in the UI if you have Visual Active Effect
            flags: { core: { statusId: "test" } } // Actual ID of the effect (IMPORTANT), can be found in Core Settings Extended and/or Monk's little details, if not set correctly it will not trigger default modifiers and behavior of the system, if you want to create a non-system existing effect, enter a new value here
        };

        // Apply the effect to tokens
        let activeEffect = await token.actor.createEmbeddedDocuments("ActiveEffect", [effectData]);
        
        // Script when the effect is created
        ui.notifications.warn("Effect created");

        // Special triggering script on specific events (must have Effect Macro)
        activeEffect.forEach(async effect => {
            
            // Round end
            effect.setFlag('effectmacro', 'onRoundEnd.script', 'await actor.update({"system.props.hpatual": Math.floor(token.actor.system.props.hpatual - token.actor.system.props.hpatual * 10 / 100)});');
            effect.setFlag('effectmacro', 'onRoundEnd.script', 'ui.notifications.warn("Test Key" & ${time});');                

        });
    });
}```
#

Basically, what I wanted is to change the value of duration: { seconds: 300 } through a key contained in an item. And that's what I'm not managing to do. Did I make myself clear?

formal goblet
normal ore
# formal goblet You can pass variables to the `execute()`-part. So you can provide an Object wit...

I've been trying various arguments, and this was one of them that I tried and couldn't get to work, it gave an error:

    at mathInstance.SymbolNode.onUndefinedSymbol (Formula.js:853:27)
    at Array.<anonymous> (math.js:26377:89)
    at math.js:26229:57
    at math.js:24864:40
    at math.js:24866:43
    at Object.evaluate (math.js:24162:45)
    at r.evaluate (math.js:24139:55)
    at Formula.computeStatic (Formula.js:858:27)
    at Formula.compute (Formula.js:442:21)
    at processFormulas (ComputablePhrase.js:139:35)
normal ore
formal goblet
normal ore
formal goblet
normal ore
normal ore
formal goblet
normal ore
fresh arrow
formal goblet
fresh arrow
#

By edition of several label roll messages for skills I run into conclusion that I should use one macro/script which will generate the roll and in each of skills simply by giving input attributes like skill name, skill value, attribute value inside of label roll message... by that I could edit only one place in case of changes in rolls... is that possible in CSB ?

formal goblet
brave trench
#

Does anyone know which function to use to return a value with only 1 decimal place? I saw the toFixed function but I'm not sure how to use it.

formal goblet
brave trench
#

round(sum(fetchFromDynamicTable('geardyna2','totalVolume')),1) I tried this but its returning a whole number even though it should have decimals.

formal goblet
brave trench
#

oh i think I know why. it is pulling from a list that is using Floor.

#

Is there a way to hide, not round or floor, but just hide decimals, then use them later?

formal goblet
#

Either they are there or not

brave trench
#

ok, solves that issue then. I'll just use round everywhere lol. Thanks!

fresh arrow
normal ore
#

A personal question:
How do I set an unlimited/infinite turn in the status effect script in this line here: duration = { rounds: time };?

formal goblet
quasi summit
#

Hi. In an item container, it seems that you just can put one unique item. Not one unique item multiple times but different unique items.
Is it normal?

quasi summit
#

Ok, thanks ๐Ÿ‘

raw terrace
#

Is there a solution for a party sheet for CSB? Is there a module that works or some sort of code that will allow an actor sheet that other actor sheets can be dragged on to it.

static cargo
#

No Mods, no funky Macros, just Vanilla CSB. ๐Ÿ˜

raw terrace
#

On a different note, I am trying to write a macro that checks for linked actors based on the tokens in the active scene and reduce the quantity of two different items (if they have them on their sheets) by 1. I have scoured the wiki and can't seem to get my head around how to target the specific items - what am I missing?

#

Have tried actor.setPropertyInEntity("item", "Oxygen Pellet", "item.props.GEAR_quant -1"); based on the ammunition example, but get the unknown function error in console

formal goblet
formal goblet
raw terrace
#

Hello again. I have an attribute number field on the actor sheet (manually entered). I also have a number field that tracks Rads. If Rads goes above 51, it needs to reduce the attribute by 1 (if it goes above higher numbers, there is a cumulative reduction). Is this possible with CSB (there are no clickable links, just the number field).

formal goblet
last comet
#

Possibly a dumb question, but I can't figure it out - is there a way to make the left side of my tables bigger, and the right size smaller? The left is intended to be skill names filled in by the players, and the right will be a fairly simple "d4" or "2d6" and therefore does not need as much real estate as it's given.

formal goblet
last comet
last comet
woeful skiff
#

So it's impossible to use items created in CSB with user created modules. I created a module and moved a lot items into it including the template for them. When I try to add an item from a compendium to an actor I get "Item template has been deleted for item x". I did export the original items before deleting them but even importing the items does not make them useable again.

formal goblet
# woeful skiff So it's impossible to use items created in CSB with user created modules. I cre...

When importing from a Compendium to the Directory, the Templates are getting a new ID. So references between Entities and Templates break upon an Import. But these broken references can be fixed by reselecting the Templates in the Entities.

Item Containers have the same issue, but I was able to fix that with the next version by using a separate field as the template identifier. I also checked the case with Compendias, but that will take a bit more work.

somber bay
#

I'm confused on how to use the customInputTemplate to actually update values... or show up. Is there a way to define what the 'click the accept' triggers?

#

does the customInputTemplate return something that can be used in a formula?

somber bay
#

Ok I think I figured it out... anything I referce or change needs a formula in the same roll to use the value I just got.

patent dust
#

Hello there, and Happy Easter! I have a question (maybe was already answered). Can I refer in a label the name of the current actor? Is there a formula like fetchFromActor giving as a result the name of the Actor itself?

patent dust
normal ore
#

I'm trying to make a simple script to update the initiative of a selected token. I tried to use a script that I already have and works very well, which is this one:
await actor.update({"system.props.hpatual": Math.floor(token.actor.system.props.hpatual - token.actor.system.props.hpatual * 10 / 100)})

Below is my adapted script, but it's not working (it doesn't give an error or anything, it just doesn't work):
await actor.update({"system.initiative": token.actor.system.initiative - token.actor.system.initiative -5});

Does anyone know what I'm doing wrong?

amber nebula
#

Hello there and happy easter everybody!

I have a text field on my actor sheet that acts as a modifier that i can add to rolls i make.

I'd like that number to be a die instead of a flat number. For exemple: a 1d6 instead of a flat 6

Is it possible to make a Label Roll message that reads the ammount of die i write on that text field?

This is what i have so far

${[2d6]+base_str+bonus_str}$

base_str is a number field which represents my strenght attribute

bonus_str is the text field i wanna turn into a die

Sorry for the bad english

formal goblet
formal goblet
amber nebula
stone swan
#

Ok. Before I jump in to something over my head and/or reinvent the wheel, I'd like to check a few things.

For context, I'd like to have a table in my character sheets, where players can list their abilities and right a complex roll message that actually gets rolled/sent to chat.

My current understanding is that the roll message field on a label basically does what I want, in terms of holding and sending the type of content I'd want for these abilities. However, there's no way for players to edit a Label's roll message, nor can the Label dynamically place it's content, based on a Rich Text Area. At the same time, Rich Text Areas can also hold the type of content I'd want and they can be edited by players, but they can't be directly rolled. A Label's roll message can reference a Rich Text Area's content, but none of the formatting or nominally computable text it has will actually be parsed.

#

The first thing I'd like to double check is that the above is correct and also that there's no way to natively send a Rich Text Area's content as a roll message or for a Label to reference a Rich Text Area's content in such a way that it still gets computed.

formal goblet
stone swan
#

Unfortunately, I'm not entirely sure how that works in this context. That's a script, so you'd add it as a Foundry script macro and it will then reference things on the character sheet, right? Is that getting triggered by something on the character sheet and then being passed relevant key, created individually for each ability, or something else?

I'm definitely missing something here, but I'm not sure which part I'm failing to understand.

#

Oh. Is the Label triggering that script which then gets the content of a Rich Text Area and sends it as a computable message?

formal goblet
stone swan
#

That sounds like it should work and it's a lot simpler than what I was considering. Thank you.

stone swan
#

Hmm. That doesn't seem to be working. I think I've done something wrong, but I'm not sure what.
I've set it up so I have a Rich Text Area called 'SillyAbilityText', a Label called 'SillyPassthrough' that has ${sameRow('SillyAbilityText')}$ as its roll message and a finally Label with the following as its roll message:

#
const rollText = entity.getCustomRolls()['main'][rollKey];

let phrase = new ComputablePhrase(rollText);
await phrase.compute(this.entity.system.props, {
  computeExplanation: true,
  triggerEntity: entity
});

let speakerData = ChatMessage.getSpeaker({
  actor: entity.entity,
  token: entity.entity.getActiveTokens()?.[0]?.document,
  scene: game.scenes.current
});

phrase.postMessage({
  speaker: speakerData
});}%```
#

SillyPassthrough works as expected, but the final Label produces no results in the chat and an error in the console.

formal goblet
stone swan
#

So would I drop the roll key line and make rollText =${sameRow('SillyAbilityText')}$?

formal goblet
stone swan
#

That being the rollKey line?

formal goblet
stone swan
#

That's what I thought.