#Custom System Builder

1 messages · Page 22 of 1

summer kiln
#

Uhhh no i don't believe so. Let me make a version that has visible text for both

#
${setPropertyInEntity('self',getRefFromDynamicTable('status_table','status_number','status_effects',status_effect_list),status_potency)}$

${shield_drop:=fetchFromDynamicTable('status_table','status_number','status_effects','Shattered Shields')}$

${setPropertyInEntity('self','shield','base_shield <= 0 ? 0 : base_shield-shield_drop')}$

${armor_drop:=fetchFromDynamicTable('status_table','status_number','status_effects','Corroded Armor')}$

${setPropertyInEntity('self','armor','base_armor <= 0 ? 0 : base_armor-armor_drop')}$

${speed_drop:=fetchFromDynamicTable('status_table','status_number','status_effects','Paralysis')}$

${setPropertyInEntity('self','speed','base_speed <= 0 ? 0 : base_speed-speed_drop')}$```
#
${setPropertyInEntity('self','status_duration','status_duration <= 0 ? 0 : status_duration - 1')}$

${status_duration = 0 : setPropertyInEntity('self',getRefFromDynamicTable('status_table','status_number','status_effects',status_effect_list), 0)}$

${status_duration == 0 : setPropertyInEntity('self','shield','base_shield')}$

${status_duration == 0 : setPropertyInEntity('self','armor','base_armor')}$

${status_duration == 0 : setPropertyInEntity('self','speed','base_speed')}$```
#

Not sure if there's a way for me to have a click to expand, I'll scoure through the commands later

#

If it helps at all, this is how I've made the dropdown and dynamic

hazy saffron
summer kiln
#

Ahh mb

hazy saffron
#

CSB Question: Is there a command or code that can be included in chat output or label roll message expression so that a piece of chat output allows the user to 'click to expand' or toggle visibile of that portion of it?

dusky mauve
hazy saffron
hazy saffron
# dusky mauve Or that?

I think this is a product of the roll mechanics, correct? Or can that be added to normal chat text as well?

hazy saffron
#

Though from the example, this has to be coded for each specific bit of content you want to expand?

dusky mauve
hazy saffron
#

Is the correct class then the 'tooltip part"?

dusky mauve
hazy saffron
#

Can you share the 'advanced settings' part of your Label Roll? That's where css can be assigned right?

dusky mauve
# hazy saffron Can you share the 'advanced settings' part of your Label Roll? That's where css ...

No any advanced styles

In Label Roll message:

<div class="dice-roll">
    <div class="dice-result">
        <div class="dice-formula" style="font-weight: bold;">Your MESSAGE</div>

        <!-- This part is toggle by mouse click on prev div -->
        <div class="dice-tooltip" style="display: none;">
            <section class="tooltip-part">
                <div class="dice">
                    <header class="part-header flexrow">
                        <span class="part-formula">Header of tooltip</span>
                        <span class="part-total">000</span>
                    </header>
                    <p>Any Info for tooltip</p>
                </div>
            </section>
        </div>
    </div>
</div>
hazy saffron
#

Oh okay thank you! I didn't realize you could put HTML/CSS in the roll message

lyric swan
#

The order is stored in the actor flags

lyric swan
#

If it can help I'll be happy to, but I don't no how to do that. I'm not even the one really doing this work, I'm using AI for most of the js. I'm no dev or anything. So i'm not familiar at all with Gitlab, branches and stuff. 😅

hazy saffron
night sand
#

So, how do I format an item container/items to do a simple quantity thing?

Basically, I'd like to be able to have the main column say "Rations" or whatever and then another column with quantity that can be easily added to or subtracted from.

#

Even better if someone can tell me how to format a macro or button or whatever to automatically subtract certain items (like rations) when clicked. E.g., a player clicks a label button titled "rest" and it subtracts a ration.

night sand
#

Okay, figured out the quantity thing by just putting:
${item.'item component name'}$ in the label of a new column and making sure the item sheet has a number field for quantity on it.

Still struggling to auto subtract though.

night sand
#

Basically, I think I'm trying to use a script or macro to change the number field on the item's sheet. Not sure that's possible though

fleet rampart
#

none of them have what i asked help for, i'm out of that shit, weeks i'm seaching, asking and nothing, i'm just going to ask for a refund of the vtt at this point

formal goblet
formal goblet
# fleet rampart none of them have what i asked help for, i'm out of that shit, weeks i'm seachin...

Sry for this experience but you always asked me at a pretty much unfitting time for me (probably because of timezone shifts) and the questions you asked need quite a bit of time to answer in full detail (and I tend to forget stuff when it's a few hours ago). Just understand that CSB and Foundry is a private hobby and not a commercial job, so everything falls under personal free time (which is limited).

night sand
# formal goblet `setPropertyInEntity()` should do it

I'm missing something here. I don't really know what I'm doing with CSS or Java. Just kind of reading, copy/pasting, and tinkering till stuff works.

But yeah, I can this to put out a chat message with the correct result, but I can't get it to actually edit the item sheet.
e.g.
${setPropertyInEntity('item', 'rations', "item.quantity - 1")}$

I tried using %{ }% like it suggests for scripts, but nothing happens.

grave ether
night sand
#

Indeed, gratitude is very much in order. I'm glad to get any guidance, even if I end up too dense to make it work

grave ether
# fleet rampart none of them have what i asked help for, i'm out of that shit, weeks i'm seachin...

I am sorry your having issues and as a community we are happy to help as much as we can. If your frustrated that no one is answering you its because this is not a job, its a hobby and the ability to even use this to create your own design without fully coding it in js or css is a benefit. Please continue to ask youe questions but know they are answered as a community and not always the right approach depending on what your doing. I am not an expert but would like to help if you need it. Please ask again.

night sand
# night sand I'm missing something here. I don't really know what I'm doing with CSS or Java....

Okay, I can create a workaround by just putting a label and number field directly on the character sheet and then using setPropertyInEntity()

That's fine as long as I only want to subtract a single kind of item and one that is universally used by all characters. The example given at gitlab of subtracting ammunition is totally lost on me. Also, that example seems to refer only to clicking a label within the item container. I was looking to be able to use a label with chat message macro (script?) somewhere else on the sheet that then edits a specific item's quantity in it's container.

I'd like to figure out the quickest way to automate subtracting various items in response to other actions throughout the sheet, if anyone has a relatively simple way of doing that?

coral hemlock
#

Hi. Sorry I am sure this has been covered somewhere, but I find it difficult to search here correctly. Anyway.... I have a label roll message that calls a macro to roll dice and output to chat. This is all working fine. There is a variable in the macro that I need to pull out and reuse as part of the roll expression so I can add skill value and other mods. I cannot figure out how to get this to work. Is there someone that can possibly help?

fleet rampart
grave ether
# fleet rampart I already asked for the refund but to give you an idea of what i was asking : Cr...

All that is doable, css and js can be used for pretty much everything. There are sample templetes that you can used or create your own. I used a sample templete to begin with to learn how things are done.

Items templates normally are static sheets that push vaules to the main sheet. You just have to tell it what field its mapped to.

Tokens and maps all follow foundry default. None of that is controlled by csb.

I tend to use helper cells for some things, hidden sheet eith values that calculate the value but each field created can have a key which then can be used as a reference.

Without more context, issues your having this is the best i can provide as a high level overview.

I assume your trying to use csb because you would like to create your own system. If this is the case then nothing will be polished out of the box.

grave ether
coral hemlock
#

The label roll message contains %{return await game.macros.getName('D100OpenEndedTest').execute()}%. This activates the macro correctly, but at the moment the variable diceRoll cannot be reused

coral hemlock
grave ether
#

No worries bud, let me know if it works.

grave ether
#

Thanks Martin!

Also think you could do it via js by capturing the variable but... go with the above lol

fleet rampart
formal goblet
# fleet rampart To make a resume of what i asked for because it seems like you didn't check my p...
  1. I need more information for that one. Do you mean stats between different Tabs of the Tab-Component? It shouldn't make any difference in calculations if stats are within the same Tab or not.
  2. You cannot directly do that, but there is a little workaround. First, you need Input-Components for the GM. This should be only visible to the GM. Then you create a Label, which references the stats of that Component. You cannot really hide this Label from the GM, but at least the Players will not be able to modify the stats.
  3. You can use the function fetchFromActor('attached', "formula/key") for that case: https://gitlab.com/custom-system-builder/custom-system-builder/#4210-fetchfromactor
hazy saffron
#

Can you call fetchFromDynamicTable() from within a text field column display of that same dynamic table?

formal goblet
hazy saffron
#

Okay, this was a text field that tried to have a formula in it

#

and I keep getting Error

formal goblet
#

Text Field is only an Input Component, it cannot handle calculations

formal goblet
hazy saffron
#

Sorry for the confusion

hazy saffron
#

Is there a string 'exact' match comparison operator that can be used with fetchFromDynamicTable calls?

Example, I have a dynamic table with a Title column that contains the following two rows (There are other columns but not important for this):

extra_is_selected     extra_title         extra_cost
X                     Range               10
X                     Increased Range     20```

This ```fetchFromDynamicTable('extras_selection', 'extra_title', 'extra_is_selected', true, '===', 'extra_title', 'Range', '===')``` returns

Range,Increased Range 

But I only want "Range" returned. Is that possible?
formal goblet
turbid sphinx
#

Hello, I want to create a confirm dialog for a label roll (no other input, only confirm or close).

The best I could do is this. With a userInputTemplate

How to remove "sleep_message" from the chat message. I know with ${! }$ I can hide formula but "sleep_message" is still written, and with "throw Done" I remove everything but I want the message about hp 😖

formal goblet
weary nymph
#

Hello, working on trying to understand items and item containers. I configured item modifiers in an item template, but these modifiers don't seem to be inherited in items created with the template. Is this the expected behavior? I'm having to input item modifiers in each item created or switched to the template.

formal goblet
weary nymph
#

I see! Thank you.

#

But, how can i keep track of the modifiers. Or, what if i want to change a modifier for a particular instance of an item?

coral hemlock
lethal flax
#

so how do i make a thing in a dynamic table not visible when a checkmark of the same row is checked, and make it so no other rows are affected. @formal goblet

fierce harbor
#

Morning everyone. Is there any way to limit the number of items in an Item Container?

formal goblet
fierce harbor
formal goblet
storm flame
#

Sorry if this seems like a dumb question is it possible to use visual effects add ons with custom system builder?

storm flame
formal goblet
storm flame
#

Awesome thanks I'll look into it

vagrant hollow
# storm flame Awesome thanks I'll look into it

I am using it this way. Have the visual effect set up in a macro and calling the macro via a roll message.
But I separated the dice roll from visual effect, so GM can first decide if the roll was a hit. Then the player can start the effect via the label alternative roll message (SHIFT+Click).

weary nymph
vagrant hollow
#

@lyric swan
After implementing your solution in most containers of my whole sheets, I had to recognise that the drag and drop is not working for players, only for GM. I was so excited that I had forgotten to test this. Is there some setting that I have missed?

Also there is a strange interaction between your script an item piles.
Item piles offers a solution with allows to drop items from character sheet onto the canvas.
For containers which are connected to your script this function of item piles is not working anymore for players, while containers without connection to the script work with item piles like intended.
As GM there is no such problem.

scarlet skiff
turbid sphinx
#

In a label roll I have this script :

`%{
async function updatePA() {
let message = "";

        [... code to edit message ...]
        
        let chatData = {user : game.user._id,content : message,};

        ChatMessage.create(chatData,{});
    }

    updatePA();

}%`

In the chat how the show the Actor instead of User ? I think chatData should have ",speaker : [???]," but can't a correct value for it

turbid sphinx
#

Thx working code is :

`let chatData = {user : game.user._id, speaker : {actor:entity.entity}, content : message,};

ChatMessage.create(chatData,{});`

lyric swan
#

i'll post a version without that you want

lyric swan
#

Here is a version where I commented the GM only section, allowing players to drag n drop items in the container too. About the canvas droping with item pile, this code does not prevent this to happen (it's on an other code thar I use), I just tested it with only this script and you can drop it on the canvas so you must have some other script that is interfering with this one.

vagrant hollow
# lyric swan

Thank you very much.
This also solved the problem with item piles.

vagrant hollow
lyric swan
#

I'm not the one doing this, I'm using AI, so thanks GPT 4 lmao

wet heron
#

How do I make a roll be gm only? ${[gm1d20]}$?

cosmic karma
#

Hello, Im trying to wrap up a sheet for Shadowdark (dont like the adv/disadv system de actual module uses), its like this right now

#

I'm trying to use the shift+click to roll with adv/disadv using the formula

${switchCase(adv_check,'advantage',[2d20kh]+strmod,'disadvantage',[2d20kl]+strmod)}$

is there a better way? It works, but its rolling 4 dice, I want to make it roll only 2 ...

#

Also: all the Gear items have a "slot" numberfield with a certain value. Its possible to sum up all the values of them and place the result value in a label at the end of Gear section?

coral hemlock
#

Is it possible to show a resource bar such as HP on a character sheet as well as on the token?

#

I can do token resource bars ok, but would like it to show on the sheet

lethal flax
#

@formal goblet how do i make a roll formula that calls for two different values from the same roll (one of which only applicable when a checkbox is checked?), with the values being on the same row of a dynamic table (dropdowns in specific)

vagrant hollow
cosmic karma
#

Doing a follow up: I want to make some items as "free to carry", that means weight = 0. I've added a checkbox to the item template , but I can't figure out out to do after that. Could someone help me? (I'm not a programmer)

turbid sphinx
#

Do you mind share your css ? I want to use it as inspiration

#

@cosmic karma

fierce harbor
cosmic karma
# turbid sphinx <@390860491943313408>

no problem at all, but it's pretty "hacky" it only works on fixed size and such. Argh, character count limitation its on the file below. I'm using the Custom Css module during the creation to speed things up. But keeping the files on a module folder for later distribution:

cosmic karma
fierce harbor
cosmic karma
#

I think I found the post, just needed to invert the order, worked perfectly. Thanks for point it out! The original is like this, from here #1037072885044477962 message

Prio: 1
Key: totalWeight
Operator: +
Formula: ${equipped ? weight : 0}$

I changed the formula to: ${free_to_carry? 0: weight}$ and that was it. Thanks, @fierce harbor

formal goblet
formal goblet
cosmic karma
storm flame
#

Is there a way to make a token default to have vision enabled?

formal goblet
cosmic karma
#

ok... this one has to be a dumb question... is there any tutorial on how to format/create chatmessages cards for the rolls? Or the correct way is to do it with macros and call them?

formal goblet
abstract siren
#

Hello everyone, do you know if it is possible to update a character property with JS without using return? I have this code block for an Errant hack and the issue i have is with the 3rd to last line, the property (entity.system.props.SPECIAL_DIE_num) is correctly updated in the log, but doesn't get updated in the sheet.

let rollString = ${FIRST_DOCTRINE_DICE}$+"d6"
let doctrineThreshold = 5
let r = new Roll(rollString);
await r.evaluate();
game.dice3d.showForRoll(r,game.user,true);
diceResults = r.terms[0].results;
resultsArray = []
for (let i=0; i<diceResults.length; i++)
{
    resultsArray.push(diceResults[i].result);
}
spentDice=0;
for (let i=0; i<resultsArray.length; i++){
    if (resultsArray[i]<doctrineThreshold)
    {
        spentDice++
    }
}
console.log("YOU BURN THIS DICE AMOUNT: "+spentDice);
entity.system.props.SPECIAL_DIE_num = entity.system.props.SPECIAL_DIE_num - spentDice;
console.log(entity.system.props.SPECIAL_DIE_num)
return r.total
#

To add on this, the property entity.system.props.SPECIAL_DIE_num is the value of a number field

abstract siren
lethal flax
abstract siren
abstract siren
abstract siren
lyric swan
#

Guys, does anyone have a but when they open and save the "configure active effect" window on an actor sheet? When I do that (even if I don't change anything, as long as I save it happens) then I can't edit anything on the sheet definitively...?

formal goblet
lyric swan
lyric swan
#

Yeah, I saw that but i'm not using this one at all.

lyric swan
#

This could be problematic for people because it breaks the actor template for good

#

You cant still edit the active effects while the module is off and put it back on after tho

storm flame
#

is it possible to have a table based on a variable like X = 2 and the amount of rows = X?\

storm flame
#

Darn thank you either way

night sand
#

Is there a way to put a button or something in the final chat output that lets a player click to roll?

Like, I want them to click to display the item/ability in the chat and then be able to click a button inside that message to then make a related roll.

formal goblet
night sand
#

Ah well. I'll just have them roll from their sheets

tough jetty
#

Hey, yall! I'm trying to set the initiative formula in Game Settings, but I can't seem to figure out the right way to reference the key for an attribute on the character.

cosmic karma
#

Hi everyone. I'm pretty happy with were this is going, thanks for all the help.

#

the duplicated rolls are happening again, right now my code is like this:

${#roll_formula:= switchCase(adv_check, 'advantage', '2d20kh', '2d20kl')}$
<div class="chatRollCard">
    <div class="rollMdf"><span>+</span>${dexmod}$</div>
    <div class="rollResult">${[:roll_formula:]}$ </div>
    <div class="rollTotal"><span class="text">Dex:</span>${[:roll_formula:] + dexmod}$</div>
</div>

any clue on how to solve?

#

I'm using flex: row-reverse to show the total first, then the roll, then the modifier. If anyone has any idea how to do this better you're more than welcome 🙂

storm flame
#

nvm figured it out

tough jetty
#

@turbid sphinx & @formal goblet Thank you so very much! I was being silly and putting everything between the [ ]!

#

Is it possible to have more than one Condition statement in a formula and add their results together? Such as ${Key ? '2' : '0' + Key ? '+6' : '0' + etc + etc}$?

formal goblet
tough jetty
storm flame
#

So I'm trying to make the item inside the item container play the animation and roll the dice at the same time. but copying the script for the item doesnt do the roll

stiff forge
#

Is there any way to use a component to display an image on a CSB sheet, other than the default actor image?

#

(not an icon...an actual image...)

stiff forge
#

Could you give a quick example of that code? (I suck at HTML)

#

img src="img_girl.jpg" alt="Girl in a jacket" width="500" height="600">

#

Like that ^^^

#

would that work?

formal goblet
#

Yeah

stiff forge
#

Excellent! Thanks

cosmic karma
cosmic karma
# cosmic karma not working for me with the switchCase ```js ${#roll_result:= switchCase(adv_ch...

I think I got it [WRONG: STILL TWO ROLLS BECAUSE OF 2[] ]:

${#roll_A:= [2d20kh]}$
${#roll_B:= [2d20kl]}$
${#switchCase(adv_check, 'advantage', roll_A, roll_B)}$
${#modifiers:= strmod}$
<div class="chatRollCard">
    <div class="rollMdf"><span>+</span>${modifiers}$</div>
    <div class="rollResult">${switchCase(adv_check, 'advantage', roll_A, roll_B)}$</div>
    <div class="text">${switchCase(adv_check, 'advantage', 'A: ', 'D: ')}$</div>
    <div class="rollTotal"><span class="text">Str:</span>${switchCase(adv_check, 'advantage', roll_A, roll_B) + modifiers}$</div>
</div>
floral crater
#

Hi ! for Roll A et B use 2d20 not 1d20 bécause these no choice 😉

cosmic karma
#

hahahaha, of course, thanks!

formal goblet
formal goblet
cosmic karma
cosmic karma
formal goblet
#
${roll_formula:= switchCase(...)}$
${roll_result:= [:roll_formula:]}$
cosmic karma
# formal goblet You're missing the second part where you resolve the text-formula

Thanks again @formal goblet , and sorry to be such a bother.

The code that works in the case someone is following my stupid ass thread of a no coder:

${#roll_formula:= switchCase(adv_check, 'advantage', '2d20kh', '2d20kl')}$
${#roll_result:= [:roll_formula:]}$
${#modifiers:= strmod}$
<div class="chatRollCard">
    <div class="rollTotal"><span class="text">Str:</span>${roll_result + modifiers}$</div>
    <div class="rollResult"><span>${switchCase(adv_check, 'advantage', 'A: ', 'D: ')}$</span>${roll_result}$</div>
    <div class="rollMdf"><span>+</span>${modifiers}$</div>
</div>

fleet rampart
latent sorrel
# fleet rampart To make a resume of what i asked for because it seems like you didn't check my p...

I can see your frustrated trying to get things setup and I am sorry. I wanted to see if I might be able to provide suggestions on what you are trying to accomplish. However the sheet image posted has no supporting text to provide clarification of your needs and the question you asked about the summary (referenced) also isnt clear. By summary, do you mean a page that shows uneditable stats that reference the information shown in the image posted or something else?

Sorry. This is getting longer then I intended. I have found that, when seeking answers, I frequently need to provide additional supporting information to get help in doing things. In my seeking to build a proper sheet, I have been given the answer, multiple times, of "you can't do that". Which usually means that it requires javascript so I started learning that. I have also had questions completely unanswered. Everyone here is helpful, but its all a volunteer endeavor for them and they are busy and most of us are amateurs; sometimes things get missed plus some of my questions have been rather unusual.

Its also taken me 3 rebuilds and about 5 months to get a proper sheet, as I found my self going down the wrong path. I am almost finished (I hope). It has tons of javascript and I can drop items on to items, theres a macro to simultaneously create actors/items and assign templates, newly created actors auto attach skills (which are items). Items now supply text data (only number data is native) to the actor. Dropping race (also items) auto assign abilities (items), talents (items) sort to containers based on previously existing talents, dropping careers (item) on actors spawns popups asking player input, actors can be dropped on vehicles, custom dice roller, a macro to fix the unique quirk, and player claimable combat slots. None of this I had any clue how to due when I started down this path. You will get there, it just takes take time and patience.

south marsh
#

Hello everyone and thank's already to all of you !
I've a question more about the structure than the code itself. How do you organize your formula to gather multiple variables ? I mean, if you have a formula that gather multiple component into it (for example, charisma will gather your number of points, but also some feature of you race, maybe some modifier given by item...) how do you calculate it ? I'm currently doing cascade 'switchcase' but this is terrible to read... I'm not a programmer so I'm struggling with it. Good luck everyone and happy play!

dusky mauve
#

with filtering by my value - in example it's **STR ** attribute.

formal goblet
# south marsh Hello everyone and thank's already to all of you ! I've a question more about th...

It highly depends what you're actually calculating... The switchCase()-function in general serves as a multi-mapper, where a specific key is mapped to a specific value (more or less like a Lookup Table). Like mentioned above, one alternative to using this function is to actually have a Lookup Table, on which you're performing lookup operations (fetchFromDynamicTable()). This scales great with 1 to 1-mappings (each key has one value), but not with n to 1-mappings (data-ranges, where multiple keys correspond to the same value).

PS: I'll implement a solution for the later case for the next update (similar to VLOOKUP() in Google Sheets)

cerulean adder
#

Is there a way to increment damage?

${sameRow('weapons_name')}$ Damage: ${[:sameRow('weapons_damage'):]}$

For instance the above roll will display the field in weapons name, "Damage:" and then roll the value in weapons damage which is typically something like 1d12 and it displays that for me.

What I'd like is to be able to do something like roll a d12 5 time but roll the dice one at a time and add them to the previous value. So 1d12, +1d12, +1d12, etc instead of 1d12, 2d12, 3d12, etc

Is this possible in the custom system?

formal goblet
cerulean adder
#

Ah, thanks!

turbid sphinx
latent sorrel
#

Is there a way to use single quotes in item names without having to include an escape within same name: Goa'uld Baster vs Goa\\'uld Baster

turbid sphinx
cerulean adder
#

Hello, I've got another quick question. Is there a way to decrement a different field when clicking a rollable filed?

I have weapons_ammo which is a number field that stores how many shots we have left

I have Label weapon_tohit that runs the following message roll

<br>
AC: ${[1d10] - (sameRow('weapons_ac_mod'))}$
<br>
Body part: ${[#Body_Chart]}$
<br>```

Could I add something like "{sameRow('weapons_ammo)-1} or something?
#

That would just print out the value in the chat. It wouldn't actually change the data, right?

cerulean adder
formal goblet
cerulean adder
#

OMG

#

I already had it opened so I didn't click the link. Sorry!

cerulean adder
formal goblet
#

4.2.11

cerulean adder
#

Oh weird! That was a trainwreck on my end. Thank you! I will play with this!

spiral dome
#

Is there a way to make a Dynamic Table 'permanent'? I made a Dynamic Table of all the skills in the system I use in my _template, but in my testplayer character it leaves out a lot of information. The reason I use a Dynamic Table is because in the skills section of the character sheet there is a dropdown menu with the skill names.

spiral dome
#

A text field with the asociated attributes to the skills

#

... I fixed it. I deleted my test player and recreated it, and now it's working fine

lethal flax
#

@formal goblet so how do i make it so that in an item contain it would only show a label, one with a value based on the item in question, if a checkmark within an item is checked?

formal goblet
formal goblet
lethal flax
formal goblet
somber bay
#

so I figured I can put images in labels if I use 'rich text' do you know if there is a way to reference the portrait in a character or item?

lethal flax
formal goblet
somber bay
formal goblet
lethal flax
somber bay
#

@lethal flax I use ammo in a couple of systems I built... give me few minutes while I see how I did it

#

${item.iquant}$

#

which I think you are using item_amount where I'm using iquant because I'm weird

lethal flax
#

still isn't returning a number for some reason.

somber bay
#

oh I see you have some logic there

formal goblet
somber bay
#

$ are for the whole sentence or see what Martin just posted

#

(so do not treat them like parenthesis but rather blocks... so you can have multiple blocks like multiple formulas in a label or roll but no need for internal ${ within an existing ${)

lethal flax
#

well now it says "item.item_ammo_amount", so clealy i have no idea what is happening now.

lethal flax
#

now it says "'',"

formal goblet
#

Also remove the double-quotes and show the final formula

lethal flax
#

it just says "ERROR"

formal goblet
#

Formula

lethal flax
#

${item.ammocheck ? item.item_ammo_amount : ''}$, which for some reason isn't revealing the number of its number field for some reason.

formal goblet
#

Looks good so far (syntax-wise). Go to the console (F12) and show the error.

somber bay
#

Also that is a logic statement but you could straight up just have it show the ammo

#

(with the drawback that it would show 0 instead of ' ' which I think you want)

lethal flax
#

okay, i just need to delete the item and it shows stuff. For some reason it isn't showing stuff from text fields but it is showing stuff from number fields.

latent sorrel
# formal goblet Is there an issue with those?

Yes. If I have an item in a container with a single quote in the name, if I call a key with the item, I get strange results. ${item.skill}$ where skill == "Arcane", A is returned instead of Arcane. The same happens with linkedEntity.system.props.skill.

storm flame
#

Just kinda curious is there a better way to manage spells cause atm I have them as an item that players select from their inventory

vagrant hollow
storm flame
#

But currently code wise I've just been trying to break em down into different types of spells
Roughly support (restoration), support (cure), attack, status inflictor, and aoe

#

But atm I'm im getting to the point some spells do both damage and status stuff so kinda stuck deciding on what to do with it

rigid sapphire
#

Has anyone done work on a Lamentations of the Flame Princess set up for Custom System Builder? I feel like I must be reinventing the wheel.

drowsy rune
#

Hello, can anyone help me ? I'm using the Custom System Builder because I have created my own system, but I don't know how to code. I have created stats blocks for my actors and I would like to integrate them as PNG or HTML code to their sheets, how can I create such sheets ?

#

I have absolutely 0 experience with coding

formal goblet
drowsy rune
#

In other words... I mean, can I have a PNG or a PDF or a HTML block when I click on an actor in the side menu ?

#

That would look like that

#

(the power of Paint)

drowsy rune
#

I'm gonna take a look, thank you 🤗

#

Ok. So if I was able to find someone to code me a quick JSON statblock template, I could use it ?

formal goblet
#

You can export the example-template to check the format

drowsy rune
#

Yeah I mean if I give the template to someone, he can simplify it to work with my stats blocks and I then I can import if on Foundry ?

formal goblet
#

Well, you can freely import/export templates between different Foundry-instances

drowsy rune
#

the issue of displaying my stats blocks directly on actors has been a huge problem of mine for weeks now and I cannot progress further in my game unless I have a reliable way to display and edit those blocks on the actors, instead of taking screenshots, putting them in journals and doing it again when I'm updating due to balance

formal goblet
# drowsy rune the issue of displaying my stats blocks directly on actors has been a huge probl...

I mean the core concept if CSB is to create templates and editable actor-sheets 😅 . It doesn't even need deep coding-knowledge, just some simple concepts (variables, data-types, operators and functions). That's why CSB is so popular even among non-programmers, it's pretty easy to create simple sheets.

You can find more info here:

drowsy rune
#

Thank you, I'll try and look into it

snow locust
#

Does condition lab work at all with CSB ?

snow locust
#

ah neat, thanks

cerulean adder
#

I have a dynamic table setup on my sheet that will give you an shoot action based of of another player editable dynamic table in their inventory.

So say they have gun a and gun b in their inventory with all of the data used to calculate range and damage etc. They can go to their action tab and select gun a and the sheet is setup to use that weapon's stats to roll to hit and all that good stuff. This works great!

My question is: Can I set up the defaults for the number fields to populate based off of a field in another table when the player selects a drop down option?

So if the player selects gun b, I want their "ammo" field to default to what their "maxAmmo" field is set to in the table in their inventory that has all of gun b's info.

Sorry if this is too convoluted.

TLDR: Can you use a reference command to populate a default number in a dynamic table from another dynamic table when the filterValue is a drop down selection?

abstract siren
#

Hello, I'm using this code here to update values around the character sheet. Everything works fine, but I have to reload the sheet to see the changes caused by "actor.update()" towards the end. Am I doing something wrong?

${#roll:=%{

const actor = entity.entity;
const props = entity.system.props;
const doctrineThreshold = props['FIRST_DOCTRINE_DIE_THRESHOLD'];
const fervor = props['FERVOR_SPENT'];
const startingFaithDice = props['SPECIAL_DIE_num'];
const startingFervor = props['SPECIAL_RESOURCE_num']
const doctrineDice = props['FIRST_DOCTRINE_DICE']

let spentDice = 0;
let resultsArray = []
let rollString = doctrineDice+"d6";
let r = new Roll(rollString);

await r.evaluate();
game.dice3d.showForRoll(r,game.user,true);

finalResult = r.total+fervor;
diceResults = r.terms[0].results;


for (let i=0; i<diceResults.length; i++)
{
    resultsArray.push(diceResults[i].result);
}

for (let i=0; i<resultsArray.length; i++){
    if (resultsArray[i]<=doctrineThreshold)
    {
        spentDice++
    }
}
console.log("YOU BURN THIS DICE AMOUNT: "+spentDice);
props['SPECIAL_DIE_num'] = startingFaithDice - spentDice;
props['SPECIAL_RESOURCE_num'] = startingFervor - fervor;
props['FERVOR_SPENT'] = 0;
await actor.update({'System Props': props});
return finalResult;

}%}$

<p> ${[#Prima Dottrina|:roll:]}$</p>
formal goblet
abstract siren
abstract siren
formal goblet
#

Yeah

abstract siren
cerulean adder
#

Can you store a variable in a conditional clause? I tried and I kept getting an error

Proficiency: ${sameRow('proficiency') == '2' ? unblockableBase:= 9 : unblockableBase:= 20}$

abstract siren
abstract siren
cerulean adder
latent sorrel
#

@formal goblet what is the key that stores the last viewed tab in a tabbed panel. 😳

formal goblet
cerulean adder
drowsy rune
cerulean adder
jolly latch
#

Hello I have a question I have a d6 system where I want the roll message to say the number of success where success is between 4 and 6 how do I do that

#

${[:stat_for_mod:d6 + :stat_per_mod1:d6]}$

#

Actually this is my formula

#

Just want to add this roll message

jolly latch
#

Nobody?

fierce harbor
latent sorrel
#

I have a master actor that holds common calculations. Is there way to force an update/recalculation without opening the actor, probably using JS.

wet heron
#

Hey there!

Im looking for a macro, but my first step is asking if the core Foundry macro can call for CSB variables?

#

or will it work with the built in?

#

anyway im looking for a macro that does [1d20+Skill_value]=>[Target defence+mods]

Target defence, would be good if it could be a dropdown of either the tokens on the map, or the tokens in Combat

fierce harbor
summer kiln
#

Does anyone have an example of making an ammunition table that adds damage to a weapon based on the ammo used

wet heron
wet heron
#

sight, i dont understand,
i tried to boil it down but im stuck

${fetchFromActor('target', "Dodge") + 100}$
${:fetchFromActor('target', "Dodge") :+ 100}$

Please help

#

Nvm, ill just make manual calculation

cerulean adder
#

Question: I'm trying to predicate off of the value of a prompted drop down but I keep getting an error.

<br>
${aimBenefit=='Target'?'yes':'no'}$```

I'm able to print aimBenefit and it shows Target (if I choose that which I did for the test) but I keep getting an error for the above
fierce harbor
formal goblet
cerulean adder
wet heron
hazy saffron
hazy saffron
formal goblet
cosmic karma
#

Hello, is this correct? The idea: to show the spell DC on chat only if the item is a spell. I have a checkbox on the item with the key isSpell:

${#spell_dc:= (10 + item.tier)}$
${#show_spell_dc:= switchCase(item.isSpell,'true',spell_dc,'')}$
formal goblet
cosmic karma
#

Thanks @formal goblet And how should I format the text to insert it in front the spell_dc? to be like: Spell DC: spell_dc ? The text only has to appear IF the item is a spell. Its on the spell_dc variable, on the ternary? with quotes or not?

formal goblet
cosmic karma
#

thanks a lot! @formal goblet

summer kiln
#

Is there a way for an item to fetch from a dynamic table of the attached character?

formal goblet
summer kiln
#

Thanks, I'll give it a shot. I have a friend currently telling it it doesn't work so I guess I'll see in 52 seconds

#

${ammo}$```

Ok this is the way I've typed it, but it doesn't work
#

Any ideas

summer kiln
#

Thanks, definitely a step further into solving it. Gonna test a few more things

#

${ammo}$```
Am I not understanding something? From what I think I know, this should refer to the Table with key "ammo", and the value it looks at should be the "ammo_count", filtered by the "ammo_type"

But it's returning 0s to me
#

If I remove the ammo count it does seem to work

formal goblet
summer kiln
#

Oh I see! Thank you

#

Sorry, I'm both learning the basics to coding and also making a custom system. You and everyone else in this server have been very helpful and polite

formal goblet
#

No problemo

night sand
#

I can make a label so that it changes values inside a dynamic table, but how do I make one that updates a number field on the character sheet?
E.g. If i put a label that says "Heal 10 HP", how do I make it so it automatically updates the number field 'HP' with a new number 10 more than what's currently there?

cerulean adder
#

I feel like this is an extreme oversight on my part, but how do I call a field value in a panel? I've been working with dynamic tables and have that down but I'm having trouble with the simpler version!

${ref(acPanel.armorName)}$

I tried this but no luck. I also tried

${ref(acPanel.0.armorName)}$

foggy grotto
formal goblet
formal goblet
night sand
#

Oh, yeah that makes sense

cerulean adder
night sand
formal goblet
hazy saffron
# formal goblet Unfortunately it can only have 1 column filter. A solution would be to use Scrip...

I don't mind adding a bit of complexity if it's possiible to do what I'd like. I have a Dynamic Table with several columns:

Selected (Check)    Title (Text)      Cost (Number)    Notes (text)
( )                 Range             1                This makes it a ranged attack
( )                 Increased Range   3                This increases range by 10 per cost

So essentially I'd like to know if "Range" is selected and I also want to get the "Cost" column from "Increased Range" if it's "Selected"'

formal goblet
hazy saffron
formal goblet
cerulean adder
#

Are there global dynamic tables or are they only found in the assets themselves?

hazy saffron
formal goblet
cerulean adder
#

I'm using drop down boxes in a few different places and they reference similar things

#

I was hoping to not have to make the tables every time

hazy saffron
formal goblet
cerulean adder
#

Ah, awesome! Thank you!

cosmic karma
foggy grotto
#

Is someone that done with css?

cosmic karma
#

All of it really

foggy grotto
#

Fair. I need a starting place to learn such.

cosmic karma
#

This discord is awesome and the CSB project has a lot of tools that when you understand are pretty easy to have something done in no time. I can't code to save my life but this is not stopping me from moving around 🤣

foggy grotto
#

That's valid. I just no zero about css.

#

Or how to input.

night sand
# formal goblet "The formula which should be calculated on the referenced actor or item. It can ...

I guess I (incorrectly) extrapolated that it was an option because the Readme listed things like 'self' 'selected' and 'target' as options for the entityName. When I saw that 'target.' also worked as a prefix in one of the examples, I kind of figured 'self.' and 'selected.' might work.

I couldn't think of how else to designate which actor/sheet I wanted to edit.

Of course, I just now tried to simply put the property without any prefix and that worked. So, it turns out I was making it more complicated than it needed to be.

Thanks!

hazy saffron
#

Question: I have an item with a label (unkeyed), which has a label text field with a ${recalculate(%{return await ...}%)}$ call in it for a macro. The macro returns a string (with various ${variable}$ calls to display on the item The returned string is a concatenation of several other strings that I read from a dynamic table, any of which might contain single quotes (') or double quotes (") in them.

I'd like to ensure that the string I return from the macro to display maintains the right display of single and double quotes without causing an error in the sheet. I've tried doing (what I thought) was a global escape replacement of the single and double quotes with escaped versions \' and \", however, in the output display I'm seeing the backslash characters display in front of single quotes and sometimes the first instance of a quote is ignored for the escape sequence.

Am I going about this the right way?

This is my string replacement code in the macro (Posted in macro-polo for insight there too)

let newNote = dataNote.replaceAll("'","\\'").replaceAll('"', '\\"');
vagrant hollow
#

Just found out how easy it is to place a value bar on the sheet and because it was several times asked wanted to share with you:

tame nimbus
#

Hi. I am trying to create a formula to roll 3 dice that in the chat tells me that if there are any 6 I am successful in the roll, but I can't finish creating it because what it does is add the results. Could someone tell me how to do it?

#

I want something like Vaesen or Mutant Year. Each 6 is a success.

wet heron
formal goblet
wet heron
#

First it said no target, but after moving the token and trying again it always goes for "träff"

#

The variable state it's -5 for some reason

formal goblet
#

Try it without melee_mods

wet heron
#

No target

formal goblet
#

How do you target?

wet heron
#

I have made a manual calculation now that I fill the dodge, it's just easier

wet heron
#

Does it have to be in combat?

formal goblet
#

Not enough, that's just selected. Press T while hovering over the token.

wet heron
#

Oh my god

#

I had no idea

#

I've tried and didn't want to bother more as I thought I understood..

wet heron
cerulean adder
#

Is there a guide or documentation on how to target an attribute in an item on a character's sheet? I'm trying to figure it out but haven't gotten very far.

cerulean adder
#

It sounds like you can't? First, you cannot get values from Item Containers by referencing them

turbid sphinx
fierce harbor
#

I believe you could traverse the whole data tree via JS to do that...

hazy saffron
cerulean adder
#

Hmm, okay! Thanks everyone. I'm not 100% on what that means but it's enough of a thread for me to pull on to see if I can't figure it out. Thank you!

fierce harbor
hazy saffron
fierce harbor
hazy saffron
# fierce harbor Now I'm seeing that your code is ``` let newNote = dataNote.replaceAll("'","\\'"...

I made that update, thanks. it doesn't seeem to change the overall output.

Here is an example of the content inside a dynamic table that I want to format and display in a label.

Source content (In Dynamic Table) - 2 instances of the single quote
Allows the character to leave behind a copy of his armor; however it can't be worn by others. For appropriate quantum powers, this Extra now adds +2 to the character's physical (PDV) defense value. PDV and MDV must each be purchased as a separate Extra.

Here is what it looks like after the 'escape code' in the macro using console.warn() - Both instances have been escaped

Allows the character to leave behind a copy of his armor; however it can\'t be worn by others. For appropriate quantum powers, this Extra now adds +2 to the character\'s physical (PDV) defense value. PDV and MDV must each be purchased as a separate Extra.

And heres what it displays after being run through the recalculate() on the label - Only the first instance displays properly. The second instance displays the \ character.

Allows the character to leave behind a copy of his armor; however it can't be worn by others. For appropriate quantum powers, this Extra now adds +2 to the character\'s physical (PDV) defense value. PDV and MDV must each be purchased as a separate Extra.

So it's escaping the first one properly and displaying right but all others are displaying the .

fierce harbor
hazy saffron
fierce harbor
hazy saffron
# fierce harbor Can't say, but trying won't hurt, if you will 😅

Well that didn't do anything. I also don't think it's the period. I put two single quotes in the same sentence:

Allows the character to leave behind a copy of his armor; however it can't be worn by others and the character's armor. Used mainly for distraction purposes. Cost 1 Willpower.

And it came out

Allows the character to leave behind a copy of his armor; however it can't be worn by others and the character\'s armor. Used mainly for distraction purposes. Cost 1 Willpower.

#

I appreciate your help in this, but it seems like a bug or at least something wonky

fierce harbor
hazy saffron
#

Is there a place to see the actual recalculate() code?

fierce harbor
hazy saffron
#

I'm wondering if it's doing some type of .replace() code without making it a global replace

fierce harbor
hazy saffron
#

So I know nothing about this code, but I saw this function in what you linked, @formal goblet

const handleTextVars = (formula, textVars = {}) => {
    formula = formula.toString();
    // Isolating text data, enclosed in '' inside the formula
    // The (?<!\\)' part means match quotes (') which are not preceded by \
    let textTokens = formula.matchAll(/(?<!\\)'.*?(?<!\\)'/g);
    let textToken = textTokens.next();

    while (!textToken.done) {
        let textValue = textToken.value[0].substring(1, textToken.value[0].length - 1);
        if (textValue.includes("'")) {
            let textRef = '_computedText_' + (Object.keys(textVars).length + 1);

            // Recreate apostrophes inside text + removing delimiters
            textVars[textRef] = textValue.replace('\\', '');

            formula = formula.replace(textToken.value[0], textRef);
        }

        textToken = textTokens.next();
    }

    return { formula, textVars };
};

I see a textValue.replace() should that perhaps be a replaceAll()?

#

It looks like it's doing the "remove any escape characters" but only on the first one (which is what I'm seeing in my output)

hazy saffron
# fierce harbor Tested like this, seems to work.

In your macro code, I see you're using only a single \ in the replaceAll(0 expression. I was told in macro-polo that it required two:

let newNote = (dataNote.replaceAll("'","\\'")).replaceAll('"', '\\"');
fierce harbor
hazy saffron
#

If I only use one \ in my replaceAll code, I get the recalculate error involving dots

fierce harbor
hazy saffron
fierce harbor
hazy saffron
# fierce harbor Atm cannot test that part, sorry 'bout that.

No problem! You've been a great help so far and I appreciate your time. I think I may have found the issue in the code @formal goblet linked above. When it does a 'remove escaped characters' it's using .replace() instead of .replaceAll() which is consistent with what I'm seeing

fierce harbor
scarlet skiff
#

@formal goblet hi martin, i'm not sure if an earlier update already adressed this. from what i can gather from the documentation (5.2.3 & 5.2.5) it should be possible?
my question: is it possible to create an dynamic item modifier?
for example if i have a dropdown (for different skills) and a number field so i can create different modifiers with the same base item (e.g. same base item can be used to make +2 atheltics or +5 stealth item). then the item modifier key would be whatever the dropdown would be and the formula the number-field-key.
is it possible to add logic to this, so i have two modifiers (for add and subtract) and with a checkbox i can set one or the other modifier to 0 (= activate one or the other modifier --> necessary since the operator is not changeable)?

hazy saffron
scarlet skiff
#

🙂 sure if you already use it you can help me as well
my main concern is if it is possible to use a dynamic key. the formula states clearly that it can be a formula and the value will then influence the chosen key.
so is it possible to build a key which can be used e.g. for all skillchecks? so i don't have to write 12 modifiers (for each skill 1) but can just use 1 modifier for all of them

hazy saffron
fierce harbor
hazy saffron
fierce harbor
hazy saffron
hazy saffron
# fierce harbor Oh well...thanks for clarifying that 😉

Sorry, the longer version is, the string with the escaped characters when you run it through Recalculate() on the CSB sheet, reverses the escape code, but was using Replace instead of ReplaceAll so it was only doing the first one.

fierce harbor
hazy saffron
formal goblet
hazy saffron
formal goblet
#

But you can change that manually until it's released

hazy saffron
formal goblet
fierce harbor
hazy saffron
formal goblet
scarlet skiff
# fierce harbor You want a single key, derived from an item, to affect many statchecks? Just to ...

for an example see this item fields i have at the moment (screenshot).
to adjust the right stat at the moment i have 234 item modifiers which have an value formula to only output a number if the appropriate thing is set (so a modifier for each stat and each row)
in a future update i would like to reduce this huge amount of item modifiers and make it dynamic so i can use one modifier to handle all the different stats

hazy saffron
formal goblet
scarlet skiff
#

i want to "future proof" my current working system. so when i rework it it should be possible to adjust it easily so that is way there is always this "could be adjusted in the future"

  1. at the moment i think i have 4 stats - but i would like to be able to maybe extend that in the future
  2. at the moment i think i have ~43 different stats (maybe more in the future)
  3. mainly yes (there are exeptions but they can be handled in another way in the future
    martin: no changeable modifiers is not necessary since i use active effects for such things. at the moment i have 234 instances of such modifiers (see screenshot)
hazy saffron
# scarlet skiff i want to "future proof" my current working system. so when i rework it it shoul...

Not sure this makes it any easier on you to setup, but it should make it easier to extend later. With 43 different stats it will be big...

A) Left Image: The item template has 3 dropdowns since this item can change up to 3 'stats'. It also has a dynamic table listing each of the stats, it's key, display, and values that could get changed. For this particular use, the modifier is always the same, but you could also incorporate a text field next to each ability/stat dropdown and read the value from it
B) Middle Image: This is the code on the dropdown that shows the key/labels which are the same as the stats
C) Right Image: This is the "Item modifiers" for each stat to change based upon it's selection and the dynamic table values. This is where it becomes easier to extend this later as you only need to add a new row in these tables/lists for each new stat.

The code in the "Value Formula" for one key (academics_dice) is

${((equalText(ability1, 'academics') ? recalculate(first(fetchFromDynamicTable('abilities', 'abil_dice', 'abil_key', ability1), 0)) : 0) + (equalText(ability2, 'academics') ? recalculate(first(fetchFromDynamicTable('abilities', 'abil_dice', 'abil_key', ability2), 0)) : 0) + (equalText(ability3, 'academics') ? recalculate(first(fetchFromDynamicTable('abilities', 'abil_dice', 'abil_key', ability3), 0)) : 0))}$

scarlet skiff
pallid kettle
#

Is there a way to transfer an item from one character's item container to another character?

formal goblet
hazy saffron
formal goblet
scarlet skiff
formal goblet
hazy saffron
#

Also the GM didn't want players to need to figure out the right code to put into item modifiers

formal goblet
hazy saffron
formal goblet
#

I think that got changed with the introduction of the Conditional Modifier List

hazy saffron
#

Will definitely keep that in mind knowing keys can have formulas though

scarlet skiff
south marsh
#

This is my lines... Don't judge me, I'm a noob...
But you can reproduce it --> The Hidden_FRC for the MECA is not updated (in fact, it update, then rollback almost instantly to 0)

${(switchCase(SC_selection, 'MECA', 1, 0)) ? (setPropertyInEntity('self', 'Hidden_FRC', "Hidden_FRC + 1", 0)) : (setPropertyInEntity('self', 'Hidden_FRC', 0))}$
${(switchCase(SC_selection, 'MECA', 1, 0)) ? (setPropertyInEntity('self', 'Hidden_DEX', "Hidden_DEX + 1", 0)) : (setPropertyInEntity('self', 'Hidden_DEX', 0))}$ ```
vagrant hollow
pallid kettle
south marsh
formal goblet
south marsh
south marsh
#

I don't want to be annoying but I think there is a problem.
I followed your advice and to be honest, since I'm note very good at programming, I decided to bypass some 'complex' formula (like thoses in your link).
I made a very simple label with this roll text

${setPropertyInEntity('self', 'Hidden_CHA', "Hidden_CHA - 1")}$```
When you roll it, the first one is working, the second isn't.
If you swap them, same, the first is working, the second isn't.
There is nothing else than that.
I'm getting wrong ? 
PS : The second is working after a reload of the sheet...
night sand
#

Does anyone have a script for totaling weights in an item container? Or just referencing anything inside them? I know formulas can't.

The FAQ version doesn't seem to work consistently. Even when it does, I can't get it to update weights when an item's 'quantity' changes.

If I could just get a script that can pull data out of all the labels of one type within the container, I could work out the rest.

south marsh
#

I've managed to set my first former working code to your "prevention problem double-execution" formula.
For a quick note, the 'FERO' and 'MECA' value are now in Class_Value and SC_Value, nothing too fancy.
This is what I got.

${setPropertyInEntity('self', 'Hidden_FRC', (Class_Value==2) ? "Hidden_FRC + 1" : 0)}$```
The issue is still present. Update to 1 then instantly fall back to 0.
I've got to say that I'm quit surprised by the new "limitations".
night sand
# night sand Does anyone have a script for totaling weights in an item container? Or just ref...

Based on the fact that this script
const itemTemplateId = game.items.getName('_rations').id; entity.items .filter(item => item.system.template === itemTemplateId) .forEach(item => { const newQuantity = Math.max(item.system.props.quantity - 1, 0); item.update({'system.props.quantity': newQuantity}); });

can manage to pull item.system.props.quantity out of each item (that matches the filter) and use it in an equation, it seems that I just need to
a) widen the filter or remove it altogether
b) get it so spit out item.system.props.quantity (or 'weight' as the case may be) into some label or something instead of simply using it in the equation and never showing it.

vagrant hollow
vagrant hollow
formal goblet
scarlet skiff
#

hey, anyone using monks token bar module with CSB? does it (partly) work?

drowsy rune
#

Hello, I may have a slight problem with item containers and dynamic tables.

#

How can I assign my item container only to the second line ?

#

Template looks like this

latent sorrel
# drowsy rune How can I assign my item container only to the second line ?

I did something similar but using static containers (not in a dynamic table). I had to use JS and a "dropActorSheetData" hook, to increment a counter on the item that determined which container it went in. Since you are doing a dynamic table, it gets more complicated since you would need to determine how the code knows which row it was dropped on.

vagrant hollow
drowsy rune
#

I don't know how to do that sadly and I don't know how to display my items and their properties without this system...

#

Can I use a filter or anything ?

#

Even if it means using another component and changing all the items I created

drowsy rune
#

Because no matter what I try, adding one item container to the sheet adds it to every item container 😦

vagrant hollow
# drowsy rune Because no matter what I try, adding one item container to the sheet adds it to ...

The name "container" is irritating – you have to think about it a different way:
You do NOT ad an item to a specific container – you DO ad it to the character sheet.
And a “container” is just a window with filter possibility that shows what items are stored on the sheet.
But the filters inside the “container” can not be set with variables/formulas.
So from my viewpoint, there is no way with basic CSB to do it the way you want.
(maybe with script – I don’t know)

But why not storing your variables (Arme, Degats, Portee, Cadence) inside of the item and display/interact them via the “container”?

Example:

drowsy rune
#

Mh...

#

I guess that could work

#

Can you display these stats directly on the sheet tho ?

vagrant hollow
drowsy rune
#

Ok

vagrant hollow
#

Here you can see two diverent "containers" on one sheet page.

#

For everything that has to be used outside of the container (ex. item weight), you need to use the item-modifiers inside the item and a label somewhere on the sheet.

turbid sphinx
drowsy rune
#

Ok, I’ll try that once I’m back on the computer

drowsy rune
night sand
# vagrant hollow For everything that has to be used outside of the container (ex. item weight), y...

But that doesn't work if you allow multiples of a single item.
E.g. if you have the item 'Rations' which has both 'quantity' and 'weight', then using the item-modifier to modify a label for weight only ever catches the 'weight'. If you raise 'quantity' on the item to 100, it still only registers the weight once.

You'd need players to carry multiple copies of stackable items (rations, ammo, potions, etc.) in order to accurately reflect weight

formal goblet
vagrant hollow
drowsy rune
vagrant hollow
# drowsy rune I have created a weapon using a panel, and I can add it as an item to my sheet. ...

Sorry, I don‘t understand.
Each of my weapons is a different item, all basing on my weapon-item template.
On the sheet template I placed a container with the template “weapon” as filter.
Then I added several labels to the container to show values from within the items.
On the player sheet I just had to drag-drop an weapon item over the container area.
Done.

It is all in the CSB description and examples.
https://gitlab.com/custom-system-builder/custom-system-builder

drowsy rune
#

Can you show me an exemple of one label in the container ?

vagrant hollow
drowsy rune
#

Ok so if I wanna do that I still have to input some formulas...

vagrant hollow
drowsy rune
#

😦

vagrant hollow
# drowsy rune 😦

If you just need a place to store values of the character’s in foundry, this can be done by just click and drag-drop.
But if you want functions, the possibilities are to high that any system can fit them all in just click/drag.
The CSB logic and formulas are much, much easier to understand than learning java and realizing your own system wishes in foundry from nothing.

It will take some time.
I am building up my system for more than a year now, and still find ways to make the live of my players and me easier.
But back in 1992 they said rolemaster is the most complicated system of the world… 🤪

drowsy rune
#

It's just I have so much to display

vagrant hollow
drowsy rune
#

I indeed know nothing

vagrant hollow
#

On my sheet i have 29 containers each with different filter settings.

drowsy rune
#

The problem is the formulas ahah

#

What I’m gonna do is try and display all the things I need even if it’s not really optimal for now and when I have everything on Foundry, I can try and make things prettier / simpler.

#

I have delayed my work for too long…

night sand
#

Huh. It works. I must have had a typo or something before. Thanks!

drowsy rune
#

A dynamic table I have to manually fill ahah

cerulean adder
#

I know there is a way to hide a result from a chat message by adding a # to the beginning of the formula. Is there a way to make the result or a part of the result visible to the GM only?

cerulean adder
# drowsy rune What I’m gonna do is try and display all the things I need even if it’s not real...

~~Idk if this is the best solution but I have two dynamic tables at the moment. One in the inventory tab where you can set all of the values, and another on the action tab that shows me only what I need to see and the buttons to roll using the data from the inventory table.

This way I can be as detailed as I want but not have the clutter on the main page. I'm looking at finding a better way but this has been a huge improvement to the clutter I had before.~~

Nevermind, I read the earlier comments and this has nothing to do with what you're talking about!

cerulean adder
wet heron
#

how do i sum up a Matrix from a dynamic table?
my code is this
${fetchFromDynamicTable('Damage_taken', 'damage_mangd')}$

wet heron
#

I get the matrix to show, but i want it to sum up to one number

wet heron
drowsy rune
#

Alright, new question:

#

Any way I can prevent this ? 😂

#

The huge gap between "Corps à Corps" and "Distance" because of "Intelligence"

fierce harbor
drowsy rune
#

I haven't.

fierce harbor
drowsy rune
#

I now have

#

Sure

#

I have set empty labels in the middle because I will eventually put things there

formal goblet
drowsy rune
#

Will do

#

Indeed, that's way better 😄

#

Thanks !

#

Also is there a better way to let spaces and gaps than putting empty labels ? Pretty sure that's not a good option 😂

night sand
#

Is there way to set a drop-down list within a dynamic table to only allow each option to be selected once?

#

Like, if there are 4 options, each option can only be selected on a single row of the table rather than selecting the same thing on every row

night sand
#

Thought so. Just have to ask players to use common sense in their data entry

mystic pine
#

Hello everyone, Ive kind of hit a wall and I have no experience doing anything like this but ive gotten my system somewhat functioning. For player convenience Id love for Skills and stuff to automatically pull resources.
I currently have Skills set up as an item subtemplate I would love to know if theres a way to have them subtract resources when clicked. Happy to provide more information if it would help, thanks in advance 🙏

#

This is what the Skill/Item looks like when opened

fierce harbor
mystic pine
#

Awesome, thank you so much!

sonic vault
#

Hi guys
I basically gave up on making the system from scratch, at least for now I still don't have the knowledge.

#

Could you help me with the custom?

#

first question

#

basicaly level and xp. I would like to automate this, I already have the algorithm in js for this

fierce harbor
sonic vault
#

yep

#

`function calculateExperienceRequired(currentLevel) {
if (currentLevel <= 136) {
if (currentLevel === 1) {
return 0;
} else if (currentLevel === 2) {
return 100;
} else {
let previous = calculateExperienceRequired(currentLevel - 1);
let previousPrevious = calculateExperienceRequired(currentLevel - 2);
return previous + (previous - previousPrevious + 1000);
}
} else {
const baseExperience = 25;
const growthFactor = 1.1;
return Math.floor(baseExperience * Math.pow(growthFactor, currentLevel - 1));
}
}

const currentLevel = 5;
const experienceRequired = calculateExperienceRequired(currentLevel);
console.log(To reach level ${currentLevel}, you need ${experienceRequired} experience points.\n);
`

fierce harbor
# sonic vault yep

So xp is not the actual xp amount but what is needed for the next level?

sonic vault
sonic vault
fierce harbor
formal goblet
#

Well, you can also just use this js-code with %{}% in a Label if it's simpler for you.

sonic vault
#

being the keys, the variables?

formal goblet
#

You have (more or less global) access to the entity-object. The props are under entity.system.props

sonic vault
#

🤔 I am going to try

sonic vault
#

I took a while because I was redoing the algorithm correctly

formal goblet
# sonic vault ?

The string interpolation in the console.log() might be an issue because CSB uses similar delimiters for Formulas ${}$. Besides that idk, because it's hard to read because of the formatting.

sonic vault
#

`function calculateLevel(experience) {
if (experience < 1000) {
return 1;
} else if (experience < 3000) {
return 2;
} else {
let level = 3;
let previousExperience = 1000;
let currentExperience = 3000;

    while (currentExperience < experience) {
        let newExperience = currentExperience + (currentExperience - previousExperience + 1000);
        previousExperience = currentExperience;
        currentExperience = newExperience;
        if (newExperience <= experience){
            level++;
        }
    }

    return level;
}

}
`

#

the code

sonic vault
formal goblet
sonic vault
formal goblet
#

Yep

sonic vault
#

iam back with the console.log calling the function, using key "experiencia" with parametrer

formal goblet
#

You're missing 2-3 things:

  • A top-level return
  • The property value for experience from the character sheet
  • (optional) The call to your function if you want to keep it. Otherwise remove the function-header and only work with the body
sonic vault
formal goblet
sonic vault
formal goblet
sonic vault
sonic vault
#

iam going to try

#

BIUTIFUL

#

thanks very much

storm flame
#

any way to stop this pop up from happening

cerulean adder
#

I'm using "target" in the fetchFromActor command for attack rolls. The issue is that if I don't have a target selected the whole button fails to work. Is there a way to prevent this from happening and just skip that part of the csb?

fierce harbor
fierce harbor
storm flame
#

thats the thing I deleted the item, the template, and the inventory slot

fierce harbor
storm flame
#

yep

#

just ended up remaking the character and it is fixed nvm

fierce harbor
storm flame
#

nah it's all good thanks though

foggy oxide
#

Is there a roll message to add an actor (self) to an encounter on the combat tracker and roll its initiative?

sonic vault
#

Good morning!
I have a problem regarding the creation of something. Essentially, in my system, the player has one key/main mental attribute (int, char, win) and one key/main physical attribute (str, dex, con). What is the best way to implement this?

#

I thought about something like checkbox, but I don't know how I would do it, would this be the best way?

#

in my system, attributes have their values and their modifiers as well.

fierce harbor
sonic vault
#

The player must choose only one mental attribute, to be the key one (used in things like skills in the system) and one physical one

#

I wanted to save this information so when I called the key attribute I would go straight to the value

#

like the mods, or just the value

fierce harbor
formal goblet
formal goblet
sonic vault
fierce harbor
formal goblet
formal goblet
sonic vault
#

something like this?

#

and in value would be the key of the attribute value?

#

but if would like this, where would the mods be?

fierce harbor
sonic vault
#

Let me get this straight, when I want to mod the mental attribute, knowing that it already exists and the key is "atr_mod", I call the concat function, with the desired

#

genius

#

This would be the same logic as a mental.mod

#

I will test

fierce harbor
sonic vault
fierce harbor
sonic vault
#

syntax

formal goblet
# sonic vault

You need ref() around concat(), otherwise it's just a string

fierce harbor
#

True that, sorry for not saying it.

sonic vault
#

work it

sonic vault
#

sorry me for so many dumb questions rs

fierce harbor
sonic vault
#

Is there any way to make my functions global, so I just call them? Is there any problem with using script instead of formula?

fierce harbor
scarlet skiff
drowsy rune
#

Is it possible to integrate a panel into a dynamic table so this dynamic table can spawn a fillable panel ?

mystic pine
#

Hi guys, I got some awesome guidance a few days and a link to the github to help me understand the tools a bit more. I just ran into a bit of a problem that i dont understand.

This is an item that i remade into Skills. I successfully got the item to interact with the attached actors Stamina with ${setPropertyInEntity('attached', 'STAMINA', "SCSTAM")}$
SCSTAM being the items listed cost and Stamina being the actors current Stamina amount. When I tried to edit the formula to
${setPropertyInEntity('attached', 'STAMINA', "attached.STAMINA - SCSTAM")}$
(with the intent of having the item subtract its stamina cost from the actors current stamina) but it just stops working. I cant seem to get the formula to properly pull any values from the actor sheet, even though it does interact with the actors Stamina. I've tried a bunch of different edits to the formula but all have failed and after a few hours of ERROR i come asking for help again 🙏 . I thought it would be as simple as something like the example setPropertyInEntity('item', 'Ammunition', "item.Ammunition - 1")

formal goblet
night sand
#

I don't guess there's a way to use the filter on fetchFromDynamicTable to automatically select the current row? Like, I want to put a label column in the dynamic table that automatically calculates its value based on a number entered in another column of that same row of the table.

E.g
Column 1 is a number field, column 2 is a label that automatically reads 'column 1's number value * 2

night sand
#

Thanks!

light stratus
#

Is there currently a way to suppress the dice roll audio when using a label roll message?

formal goblet
#

There might be a setting to lower the audio, but idk

light stratus
formal goblet
mystic pine
cerulean adder
#

Is there a way to apply damage to a selected token from a die roll in the chat message?

civic finch
#

Is it possible to have a checked checkbox have a positive and negative affect? As in, give one stat +1 and another -1

formal goblet
civic finch
#

Yep! I figured it out!

cerulean adder
formal goblet
cerulean adder
#

Ah, I see! Thank you!

tame nimbus
#

Is there a formula to add more than one checkbox to the same panel or radio button (like in vampire the masquerade) and when selecting them subtract dice from a roll?

#

Example: Normally you roll 4 dice, but if you are wounded 1 you would roll 3

fierce harbor
# tame nimbus Is there a formula to add more than one checkbox to the same panel or radio butt...

Yes. As you said, create a radio button group where each button has the desired malus, then in the roll message you can use conditional to modify the roll as needed.
Like this:

Radio button group

Label: Wounded (1)
Group: roll_malus
Value: 1

Label: Wounded (2)
Group: roll_malus
Value: 2

and so on.

Roll message

${roll_malus==1?[:dicePool-1:d6]:(roll_malus==2?[:dicePool-2:d6]:(...))}$

and in the innermost conditional you'll put the unmodified roll [:dicePool:d6].

Please always refer to CSB doc or wiki.
https://gitlab.com/custom-system-builder/custom-system-builder#36-radio-buttons

tame nimbus
vagrant hollow
fierce harbor
tame nimbus
tame nimbus
#

mi formula es "${[:fortaleza_field:d6cs=6<success_threshold>]}$"

fierce harbor
tame nimbus
fierce harbor
formal goblet
summer turtle
#

Is it possible to have a dice roll grab the number of dice it needs from another component key? In this case a number and type of dice needed for a damage roll:

summer turtle
#

Thank you. I've tried ${[:weapon_damage:]}$ but I get this error. weapon_damage in the item container pulls from item.weapon_damage to display the number of dice required. I'm assuming I've missed a step or what I want to do isn't quite possible.

formal goblet
summer turtle
#

Oh, duh, yeah that does it, thank you facepalmpicard

fierce harbor
#

I'm trying to use a simple user input, but to no avail.
This is my code:

${total:=base+?{add:"Additional:"[number]|0}}$

Cannot get it to work. Could anyone point out what the mistake is, please?

formal goblet
fierce harbor
formal goblet
#

You know that screenshots are a thing? 😅

fierce harbor
formal goblet
#

Remove the whitespace left from := next to totalCost

fierce harbor
tame nimbus
#

Example: atack roll 5 dices, but the character is wounded 1, the he must roll 4 dices

fierce harbor
tame nimbus
#

Sorry for the inconvenience, but I'm quite new to this and I've gotten myself into a big mess xD

fierce harbor
kindred oxide
#

Hi, i'm using foundry for first time; specifically using Custom System Builder, I want to put this dice visual directly on the chat. Is there a way to do this?

earnest imp
#

Chatting to follow this thread for good instead of manually opening this again later

earnest imp
#

does CSB by any chance have premade character template to tinker about? i think i do better learning by taking an example apart rather than building it from scratch

earnest imp
#

Oh my god reading is hard

#

LOL

#

Thanks for the help though

kindred oxide
#

I want the chat message to show any individual or grupal dices. Is there a way to do this?

formal goblet
drowsy rune
#

If I was to create a dynamic table, could i use it to generate panels when clicking the + button on a sheet ?

formal goblet
drowsy rune
#

Ok !

#

Yeah I was looking at a way for the sheet user to quickly spawn more panels for my inventory system.

finite depot
#

(sorry for the not so good english, not a native speakers)
Hello, i'm new to coding and CSB so i struggle a lot :

How can i display a text from a character sheet in a roll ?

For example i have :
${chara_name}$
${'fait un jet de Force de'}$
${[:chara_stat_force:]}$

Which works but separate the message into 3 small box (see my screenshot)

But if i want to put the character name, like this for example :
${chara_name}{'fait un jet de Force de'}$
${[:chara_stat_force:]}$

or without the second {}
Then the dice still rolls but the rest get me a ERROR message in tchat :/

Also, i don't understand how the math.js related stuff works, i try this to test : (it's the base example, i just changed it for my stat key)
${floor((chara_stat_force - 10) / 2)}$

And it does nothing, not even have a ERROR :/

#

(i forget that the error consol was a think, didn't help much >.>)

formal goblet
vagrant hollow
finite depot
#

Thank you ! It works !

One think however :
How can i put a space between the name and the following phrases ?

I manage to ''cheat'' by putting a ,
but it's not very good :/

${concat(chara_name, ', fait un jet de Force de')}$
${[:chara_stat_force:]}$

Also i guess it's impossible to have the roll inside the message box because it's either a text without calcul or a number with calcul / roll right ?

kindred oxide
#

hi, i need a custom chat that show dices when rolled directly, each one separated (d6)

#

i need my own Script with a custom Chat-Message.

#

only i dont know how to do ito r even start

solar zephyr
#

${ (kom == "str" ? "**" : (kdm == "str" ? "*" : "")) }$
Why is this generating an ERROR?

#

kom and kdm are Dropdown fields.

vagrant hollow
# finite depot Thank you ! It works ! One think however : How can i put a space between the ...

How can i put a space between the name and the following phrases ?

Basically a simple SPACE should do it: ' fait
Otherwise use a HTML non-breaking space < > so: '< >fait

Also i guess it's impossible to have the roll inside the message box

I am not absolutely sure about this, but maybe just hide the boxes will fill your needs?
${!concat(chara_name, '< >fait un jet de Force de')}$
${![:chara_stat_force:]}$

vagrant hollow
solar zephyr
#

${ str }$ won't show anything as I haven't defined that variable

finite depot
solar zephyr
#

basically anywhere I try to use a variable name in a formula, it's displaying ERROR or the name of the variable rather than the variable's value. Except in this simple case where I told it to show just ${ kom }$.

solar zephyr
#

ah, thanks ... that got one field on my sheet working. But still not the nested ternary that's supposed to return ** or * or empty string.

formal goblet
kindred oxide
#

"rollMessage": "<br>\nAtributo: ${(Stat1)}$\n<br>\n<br>\nTirada: ${[:StatFull1:d6]}$",

#

This is the atribute in the json of one charactet sheet i have

#

how can i display the vallue of every rolled dices in the chat?(separated each one)

#

this is the character sheetç

finite depot
kindred oxide
#

i think this is the part where it should return in the chat the stat rolled

formal goblet
kindred oxide
#

only need to figure it out how can i get all diced displayed

#

dices*

finite depot
kindred oxide
#

${[:StatFull1:d6]}$

#

Being StatFull1 a stat, my intention is to show all the dices rolled

#

in that

#

stat

#

in the chat

#

how do i have to proceed

#

"key": "Tirada1",
"cssClass": "",
"role": "0",
"permission": "0",
"tooltip": "",
"visibilityFormula": "",
"label": null,
"defaultValue": null,
"size": "small",
"icon": "fa-solid fa-dice",
"value": "",
"prefix": "",
"suffix": "",
"rollMessage": "<br>\nAtributo: ${(Stat1)}$\n<br>\n<br>\nTirada: ${[:StatFull1:d6]}$",
"altRollMessage": "false",
"style": "label",
"type": "label"
},
{
"key": "STB2",
"cssClass": "",
"role": "0",
"permission": "0",
"tooltip": "",
"visibilityFormula": "",
"label": "Bonus:",
"defaultValue": "",
"size": "small",
"allowDecimal": false,
"minVal": "",
"maxVal": "",
"allowRelative": false,
"showControls": false,
"controlsStyle": "hover",
"type": "numberField"

kindred oxide
#

i hope im able to do it

formal goblet
#

Just be aware that you'll lose the Roll-Explanation from CSB

kindred oxide
#

im very new at this

#

oki

tame nimbus
#

When I roll dice, the chat message shows me a number with the d20 icon. Is there a way to change the style of the message so that only the number appears? Thank you.

formal goblet
tame nimbus
tame nimbus
#

oh

#

so easy

tame nimbus
formal goblet
#

That one is already without

tame nimbus
#

aah ok

#

it shows the number of dices you roll

formal goblet
#

You sure your Roll Formula is correct then?

tame nimbus
#

my formula is ${![(:pooldices:+:skill_field:-:wounds:)d6cs=6]}$

formal goblet
kindred oxide
#

any CSN that know a bit of macros?

#

i need the system to print different dice pulll ( in fact, a summarzing of two dice pools)

#

and maybe i need %{}% script macro

#

but the pp from macro pool says to ask here

tame nimbus
cosmic karma
#

i'm doing some thing wrong? The talent vars are working on the sheet (image). They came from the talent items. But my formula doesnt work. Should I do it in another way?

${#roll_result:= [1d20]}$
${#attribute:= switchCase(item.attribute, 'Str', 'Str: ', 'Dex','Dex: ','Con','Con: ','Int','Int: ','Wis','Wis: ','Cha','Cha: ')}$
${#att_bonus:= switchCase(item.attribute, 'Str',strmod + TalentStrBonus + item.wp_str_bonus,'Dex',dexmod + TalentDexBonus + item.wp_dex_bonus,'Con',conmod + TalentConBonus,'Int',intmod + TalentIntBonus + TalentSpellBonus,'Wis',wismod + TalentWisBonus + TalentSpellBonus,'Cha',chamod + TalentChaBonus)}$
${#roll_dmg_dice:= item.wp_damage}$
${#roll_dmg:= [:roll_dmg_dice:]}$
${#spell_dc:= (10 + item.tier)}$
<div class="chatRollCard">
    <div>
        <span class="rollTotal">${attribute}$<span></span>${roll_result + att_bonus}$</span>
        <span class="rollResult"><i class="fa-solid fa-dice-d20 bigger"></i>${roll_result}$</span>
        <span class="rollMdf"> + ${att_bonus}$</span>
    </div>
</div>
<div class="rollDmg"><span class="smaller text">${item.name}$:</span><span class="bigger text">${roll_dmg + item.dmg_bonus}$</span><span class="smaller text">damage</span></div>
<div class="rollDmg"><span class="tiny text">${item.isSpell ? concat('Spell DC: ', string(spell_dc)) : ''}$</span></div>
formal goblet
# cosmic karma

Check the console. That one has the description of the error

cosmic karma
#

TypeError: Unexpected type of argument in function addScalar (expected: number or string or boolean or BigNumber or Complex or Fraction, actual: undefined, index: 1)

tame nimbus
#

I have this formula ${descripcion_text}$ to show the description of an object in an item container, is it correct?

formal goblet
formal goblet
cosmic karma
#

I'm using labels now, but I should be using number fields? Could be that?

formal goblet
cosmic karma
#

As I was just using to show values I've used labels for everything, but since now I'm trying to use on the formulas...

earnest imp
#

heya, by any chance, is there any function to sort dynamic tables?

#

if there isnt thats ok, its just a little qol thing for my players if its available

formal goblet
earnest imp
#

poggers!

#

this isnt a question i just wanna share what I've made cus I've been enjoying the flexibility so far

#

it started from FATE and oh boy my group ended up modding the system so much the official FATE no longer supports what we want

#

so my group agreed to take a campaign vacation while i work on trying to reconstruct our homebrewed FATE while also adding the systems we want

formal goblet
#

Well, good luck. But you're not the only one. I've worked on my own SR-6-template, because the official system here lacked functionality, so I also had to redo everything 😅

earnest imp
#

Hahahahahhahahah I think at this point our system's a full fledged game system

#

It's 5+ years worth of modding

formal goblet
tame nimbus
#

today's last questions xD

  • How can I make a roll from a skill item that is on the character sheet?
  • In item container can I put a roll formula that is in an item?
formal goblet
#

I need a Wiki-section about scopes/context and troubleshooting...

earnest imp
#

My prayers for you to not be burnt out in the long term 🙏

formal goblet
#

Well, it's not without a reason a hobby.

And I have a feeling an Inugami is following us...

tame nimbus
#

and the second, I mean if that previous roll, I can simplify it into a formula in an item container on the main page of the character sheet

#

I don't know if I've explained myself well, I'm making a big deal on my own xD

formal goblet
civic finch
#

Hello there! I'm trying to get drag ruler to work. I have this actor.system.props.Speed_Total in the speed attribute section. I'm having a hard time with setting up the Speed_Total attribute. The total has multiple parts added together, does it need to be in a Label or a Number field?

civic finch
#

I can't get the speed total to add together and that value to get picked up by the ruler

solar zephyr
#

When I add an Item to an Item Container, it shows up on all the sheet's Item Containers -- even the ones for which it is not a correct Item Template according to the Filter. What is happening?

solar zephyr
#

never mind, figured out that I just needed to Refresh the sheet after setting the Filters

coral hemlock
coral hemlock
#

I would like to have a label on the sheet open a journal entry directly (without having to send it to chat first), is this possible?

formal goblet
#

Might be doable with the right HTML-code

coral hemlock
#

Thanks Martin, I will try the RTE first.

#

Thanks Martin, Tested ok. This will work for my needs

coral hemlock
#

When you add an item such as a race, is there a way to have the player choose something such as a language from a list then add that choice to the sheet?

solar zephyr
#

This formula on an item is showing a blank:
${ fetchFromActor(attached, genAttack) + miscAttackMod }$

#

do I need a ref() function somewhere or something?

formal goblet
solar zephyr
formal goblet
solar zephyr
#

ok

#

making it a string wasn't clear to me when I read that, but that's probably on me

tame nimbus
#

What is the formula to display the name of an item when you roll on it? Im trying item."name"

formal goblet
tame nimbus
formal goblet
cerulean adder
#

I have a weird one. I have a rich text area that I use for the notes on the associated weapon. I'd like to only print out data if the notes aren't empty.

${equalText(weaponNotes,'0') ? '' : weaponNotes}$

This will print the notes but if the field is empty I get an error

${weaponNotes == '0'? '' : weaponNotes}$

This will give me an error if the notes aren't empty but will display a tiny box with no data if it's empty.

Any suggestions?

formal goblet
cerulean adder
#

I tried this but I got the same issue. An error when there are notes but a tiny box when it is empty

${weaponNotes == ''? '' : weaponNotes}$

#

Ah, it says it cannot convert the notes to a number

#

So it seems like when there are notes it's character but when it's empty it's a number?

formal goblet
cerulean adder
#

I'm not sure I follow...Sorry!

formal goblet
#

Try this one: ${weaponNotes ? weaponNotes : ''}$

cerulean adder
#

Oh, that worked!

formal goblet
#

And if this is inside a Label Roll Message and you want to get rid of the box, then you need to use ! at the beginning of the Formula

cerulean adder
#

Beautiful!

tame nimbus
#

<h2 style="text-align: center;"><strong>${item.roll_icon}$</strong></h2>
<p style="text-align: center; font-size: 1vw;"><strong> ${![(:habilidad1_field:+:habilidad2_field:+:bonus_talento_field:-:penalizador_talento_field:)d6cs=6]}$</strong></p>

formal goblet
storm flame
#

So I'm trying to use the example macro but it doesnt seem to fire any idea as to why?

formal goblet
storm flame
tame nimbus
# formal goblet What's the error in the console?

Uncaught (in promise) Error: Uncomputable token item
at mathInstance.SymbolNode.onUndefinedSymbol (Formula.js:853:27)
at math.js:26377:89
at math.js:24320:51
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)
at async ComputablePhrase.compute (ComputablePhrase.js:212:34)
at async HTMLAnchorElement.<anonymous> (Label.js:271:21)

formal goblet
tame nimbus
formal goblet
tame nimbus
formal goblet
storm flame
#

So I'm trying to make a macro pull up the players dexterity saved as "DexStat" and cant seem to make it pull that stat in the roll is this something I can actually do?

coral hemlock
static cargo
#

Hey everyone... Hope y'all are having a good day/night.

#

Is there a way of changing / adding / removing from these?...

formal goblet
static cargo
abstract siren
#

hello everyone, I have struck a wall in my system development. I need to display on the tokens a health bar based on thresholds (arbitrary numbers derived from a script, not straight fractions nor formulas).
Ideally, I would like to apply effects on the tokens when the thresholds are triggered.
For example, when health goes down from 10 (max) to 5 (past the "wounded" threshold) I would like the token to gain the "weakened" status effect.
Is there anyway to take care of both the issues within CSB? Do I need other modules? I was thinking about using a world script to trigger the status effect activation, but i don't know if it is feasible for multiple targets linked to the same sheet.

formal goblet
abstract siren
formal goblet
abstract siren
sonic vault
#

Morning guys!
Back to this question, how exactly do I do this? (the macro or world script) (I took a while because I was a little busy)

#

someting like this?

#

function is the name of macro, where is the function

abstract siren
sonic vault
#

either it doesn't work or I use it incorrectly

vagrant hollow
vagrant hollow
sonic vault
latent sorrel
# sonic vault

World Scripter macros are not like normal macros. "World" macros run when certain events occur. Typically, these are done with "hooks", but not always. A hook says "do something" if high level event occurs such as an item/actor is rendered, item is dropped, combat begins, etc. World scripts can be used to "enrich" actors or journals by adding or replacing text. What this means is that you don't write world macros like you write normal macros. I have used the world scripter module to all the above but I had to figure it out by searching #macro-polo alot. Martin is right, #macro-polo is a great resource for aid in creating macros. They are very helpful and knowledgable.

solar zephyr
#

Can I have a column in a Dynamic Table in which the user enters a die roll formula (e.g. 3d4+5), and another column that performs whatever roll is written there?
EDIT: Figured it out!

sonic vault
sonic vault
foggy oxide
#

If I use a simple prompt for an user input (Wiki 4.8.1) a dialog is shown and after I closed it with the okay button I can access all the variables used on the input dialog.
How does this work with userInputTemplates (Wiki 4.8.2)? With ${?#{AttackDialog}}$ I can open the dialog window and I can close it with the okay button too. But where and how do I have to enter the roll message that uses the values that I entered in this dialog window?

scarlet skiff
latent sorrel
latent sorrel
scarlet skiff
# latent sorrel Can you elaborate more on how this works. How do you alter the macro and see cha...

sure. so when developing a world script you have to reload foundry each time you make a change to it (i use desktop client --> F5 to reload). otherwise your change will not be implemented.
if you have your hook in place you can let the world script call a macro which does the job you want your world script to do. for this you can do a simple code like this (this is not optimised can be written shorter)

let macroName = "YOUR MACRO NAME";
let key = "YOUR COMPENDIUM PATH WHERE THE MACRO IS STORED" // world."compendium-name" all lowercase and blank spaces are "-" e.g. "world.test-macros"
let pack = game.packs.get(key);
let macro = (await pack.getDocuments()).find(i => (i.name === macroName));
await macro.execute();

so in essence you call await macro.execute() on a macro in your compendium. then you can open this macro in your compendium and change the executed code in there and save it. so you don't have to reload foundry each time after a change (which can take a lot of time...)
hope this helps. if there are further questions just ask.

foggy oxide
#

What's wrong with this visibility formula on an userInputTemplate? If I use the same formula as text on a label it shows "true". If I remove ">0" it shows "6". Both is right, both should be true, right?

formal goblet
foggy oxide
#

Okay, I have to admit I don't understand the use of userInputTemplates. I have created an userInputTemplate with a number field named "usedMana" where players can add how many mana they would like to spend for a skill check. But it seems like I have no chance to use the value of "usedMana" on any roll message. If I add an roll message on the userInputTemplate I can not use the value (not working). And I cannot use "usedMana" on the roll message that has opened the userInputTemplate. What do I get wrong here?

turbid elbow
#

Is there a way to create more vision modes than the default ones that I can pick here?

vagrant hollow
sonic vault
turbid elbow
vagrant hollow
turbid elbow
#

Because if I could add more, then maybe I wouldn't have to macro Night Vision Goggles in my games

solar zephyr
#

This is generating an ERROR in my chat on the rolling part, even though I've greatly simplified it:
${ item.name }$ Attack: ${ roll:=[1d20] }$

#

OK I restarted Foundry and it works now 🧩

latent sorrel
# sonic vault basically, my final go is make a function and use that function just by making t...

Your description is very vague. When you say "use that function just by making the call in any other script", does this mean you want a common function that can be called by multiple scripts? When you refer to "form", do you mean an actor or item sheet? Perhaps if you can provide a more specific example of what you are specially trying to do, such as "When an actor is opened, I want to automatically run a macro that sends information to another macro and, depending on the information sent, a second common macro is called to further process some of the sent information". The more detailed you are, the more we can help

fierce harbor
#

Anybody knows what is wrong here? bwPoints is a DropDown where keys and labels are numbers from 0 to 10.

${concat('<i class=\"fa-solid fa-hat-wizard fa-2xl\"',${bwPoints==0?' style=\"color: #c0c0c0;\"></i>':'></i>'}$)}$

It just says value expected.

formal goblet
fierce harbor
nimble ridge
#

About the math

Okey so I am making the custom character sheets (or rather the custom template for the character sheets), and I've come to a math problem. The players have to distribute points to determine their Abilities, the abilities go from -2 to +4 and go from 1 to 1. So if a player wants to have a +3 in one of their abilities it will cost 5 points. However, going from a +3 to a +4 costs 2 points instead of 1, so "buying" a +4 would cost 7 points instead of 6. How would I write said formula so its automated within the character sheet? (I'm sorry for any grammar problems English is not my first language)

#

Im also sorry if i am asking too much with this

formal goblet
nimble ridge
#

Thankyou ^^

acoustic fern
#

Hello everyone ! I am trying to build my own system thanks to "Custom System Builder" but I am struggling with the use of "UserInputTemplate". Does anyone is familiar with that ?

acoustic fern
foggy oxide
acoustic fern
formal goblet
foggy oxide
formal goblet
foggy oxide
# formal goblet What's the error in the console?

Okay, I think I found the issue here. To give my templates an easier read, I have named them like "[Dialog] Attack" or "[Item] Weapon". In terms of actors and items there was no problem with this. But it looks like the square brackets made trouble with userInputTemplates. I have changed the name from "[Dialog] Attack" to "DialogAttack" and now it fires the messages on the chat. So I will try if I have access to the values from the template too.
But I have another question to the userInputTempalte, just to be save. Can I insert a new Label with an unique Key (not used on the calling actor sheet) or do I have to have all Keys already on the actor sheet?

earnest imp
#

nvm, my mistake lol

earnest imp
#

by any chance, can I make it so that a "character actor sheet" (left) is drawing variables from some sort of "global actor sheet" that stores all the global variables? for instance, the left sheet drawing default HP and MP from the right sheet

formal goblet
earnest imp
#

oooooh thanks!

hazy saffron
#

Is the ability to have a label display the label (visible) part of a dropdown list (instead of the key) on the future list of additions/improvements?

formal goblet
hazy saffron
formal goblet
hazy saffron
#

Fair point, but at least in our game's case, the dropdown keys will refer to (and be the same as) component keys used elsewhere on a sheet

formal goblet
hazy saffron
sonic vault
#

lets try again with an example

#

The question: "is there a way to have a function that can be used anywhere?"

#

the example, i create a function showNumber(number){ console.log(number); }

#

What I want to know is if there is any way in other scripts, within the form itself, whether it is an actor or an item, I can use showNumber(), without rewriting the function

#

Is it possible, if so, where would I put the showNumber. Made sense? (sorry for the inconvenient)

nimble ridge
#

dumb question but how do i make an if statement inside a formula? I want a formula that adds a variable only if said variable is superior to a set value (in this case 0)

nimble ridge
formal goblet
# sonic vault What I want to know is if there is any way in other scripts, within the form its...

Not really. You can use Macros and call them from different places and use the returned results, but besides that there's currently no way to write and use own functions conveniently in CSB-Formulas. Maybe by extending math.import(), but that would require an import before the sheets are loaded: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/formulas/Formula.js?ref_type=heads#L496

nimble ridge
#

thankyou ^^

sonic vault
#

I think the import is better than copy and paste 30 lines of code whenever I need the function

sonic vault
#

I didn't get the import issue, but anyway

#

Is it possible to leave this hidden (the code)? (ignore the code please lol)

formal goblet
formal goblet
sonic vault
#

it really looks better, going to try

normal ore
#

Hey, everything good?
I've got this ongoing dilemma on how to solve a problem with a system, let's dive in:
The system basically involves one to three rolls for tests/damage. Usually, there's an attack test roll, then a damage roll, and after that a status condition roll (poison, sleep, etc). My first question is: Can I automate it so that it only rolls when it passes a test, and then it moves on to the next one? (Example: let's say I passed the attack test, then I'd want it to roll for damage, and if necessary, roll for the status condition, all separately in an automated way). Is that possible?

latent sorrel
# sonic vault the example, i create a function showNumber(number){ console.log(number); }

For this specific example, put the following code in a macro inside the World Scripter module. i tested it by creating a button on the actor and inserting showNumber(5) into the roll message. However, I assume, perhaps wrongly, the you want to do something more complicated. Depending on what you are actually wanting to do, this may be the wrong approach:

window.showNumber = function(num) {
  console.info("Your number is", num);
};```
latent sorrel
# sonic vault Is it possible to leave this hidden (the code)? (ignore the code please lol)

I had a similar problem. I used the Custom CSS module and wrote some css that turns the code on the template into a small overflowing square with a lightly colored background (to easily identify these blocks) so my templates dont explode like this. The class to target is ._template ,element_or_class_name. The _template this is required to target only the template and not the actor sheet.

sonic vault
#

worked exactly how I wanted

nimble ridge
#

funky stuff with dice

I have to make a little of a long explanation to get to the point of what I wanna do. My system is a 2d10 system, each check is made by rolling 2d10 and adding any relevant modiffiers (abilities, skills, etc) to the result. Instead of critting when you get the maximun roll possible, the dice in my sistem expolde. They explode only and only if both dice have the same result: if you roll a 2 and a 2 (ignoring the modifiers) the dice explode, so you roll an adicional set of 2d10 and add the result to your total roll for the check. Is there a way I could automice that? Theoricaly my player can check manualy when they roll in the chat, but doing so each time they make a check is a pain and they often forget. With fissical dice that aint a problem, of course, but in this vtt it is.

fierce harbor
vagrant hollow
#

When made a change to one item-template, all items that are still in the items list can be updated via “Reload all item sheets” on the template.
But this is not updating the items that are already connected/inside of an actor.
Is there any way that the GM do not have to separately open all the items on all the actors to update them to the changes made in the item template?
That is always very annoying.

nimble ridge
#

okey never mind I've seen the advanced dice link

#

okey never mind again that didn't work

#

i think ill ask in a different chat

fierce harbor
nimble ridge
#

I see

#

thank you^^

fierce harbor
nimble ridge
#

I shall

vagrant hollow
nimble ridge
#

Okey now

#

dumb question again

#

How do i make it activate a macro instead of plainly roling (now that i have a macro that rolls)?

formal goblet
vagrant hollow
nimble ridge
#

danke

fierce harbor
# normal ore Can someone help me?

Sorry for not answering, message got lost in the chat flow 😅
I believe a macro would best suite your needs. There you could check every roll outcome and then request the next if it's the case.
With a formula you could check each roll result but then for the next roll you could not request modifiers, if any, or things like that.

formal goblet
vagrant hollow
formal goblet
vagrant hollow