#Custom System Builder

1 messages · Page 18 of 1

bright berry
#

Just makes my life easier when I look over the code again

grave ether
#

Makes sense

#

give me 10 mins, I wanna piddle with your rolling stuff

errant sapphire
#

I'm certain there is a better solution, but here's what I came up with. I made a Script macro with this command:

let actorprops = scope.actorprops;
let item = scope.item;

let phrase = new ComputablePhrase(item.system.props.use_text);
await phrase.compute(actorprops);
return phrase.result;

Then, in the item container, I made a rollable label that does this:

Used ${item.name}$.<br>
%{return await game.macros.get('5xbMAF0eVhslZ8rX').execute({'actorprops': entity.system.props, 'item': linkedEntity})}%

The biggest downside of this implementation is that it removes the ability to check the roll, but as much as I love form, function is more important

runic condor
#

is there a way to make the sheet roll macro work with multiple selected tokens?

#
let rollMessage = await actor.roll(
    'AttributeLabelBrawn',
    { postMessage: false}
);

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

rollMessage.postMessage({speaker: speakerData});
#

Currently this only rolls the first token it sees

formal goblet
runic condor
#

sooo is there a way to put all that in a box that runs for every token selected?

#

Im not good with scripting

#

I guess its more of a macro question I can ask there

ornate junco
#

Where would I place a custom css file for template styles?

formal goblet
#

1 Box means only 1 Chat Message. This means, that the distinction between multiple actors must be handled in the content of the Chat Message.

  • If you want to have separate Chat Messages for the actors, then a simple foreach-loop is enough
  • If you want to have only 1 Chat Message, then it´d require quite some logic programming-vise
runic condor
#

Im good with separate chat messages. Just trying to trigger one for each token selected

#

let actors;
let currentProperties = new Map();
let updatedProperties = new Map();

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

for (const a of actors) {

let rollMessage = await actor.roll(
    'AttributeLabelBrawn',
    { postMessage: false}
);

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

rollMessage.postMessage({speaker: speakerData});

}
#

Did I frankenstien that correctly?

grave ether
#

@bright berry why do you have a second string? ${attbon != 0 ? attbon : string('')}$

#

you could also string them together

${! attbon != 0 ? string('Attack Bonus: ') : attbon != 0 ? string('') ? attbon : string('')}$

formal goblet
#
bright berry
#

That errors out, too

#

The second string is because I needed both a string and a variable showing up

#

No worries, what I figured out is like 99% what I wanted. I'm happy with this

formal goblet
#

Btw, '' is already a string (empty-string), no need to wrap that with the string()-function 😅

bright berry
#

Oh, I know

#

I did that for me

#

I'm dumb when it comes to code. This means I'll be able to go back and know what I'm doing

grave ether
#

You did good my dude

#

dont cut yourself short

bright berry
#

I will say, I did figure out how to make it do advantage/disadvantage based on whether it's in Fight mode or not by myself and I'm friggin thrilled about it

grave ether
#

I wrote this with very little help, and I have very little code experience.

// Function to roll a 1d100
function roll1d100() {
  return Math.floor(Math.random() * 100) + 1;
}

let Chance = replaceMe; // Replace with your Skill Value (Chance)
let roll = roll1d100(); // Roll a 1d100


let SL;

if (roll >= Chance + 170) {
  SL = `SL -5`;
} else if (roll < Chance + 170 && roll >= Chance + 120) {
  SL = `SL -4`;
} else if (roll < Chance + 120 && roll >= Chance + 110) {
  SL = `SL -3`;
} else if (roll < Chance + 110 && roll >= Chance + 60) {
  SL = `SL -2`;
} else if (roll < Chance + 60 && roll >= Chance + 50) {
  SL = `SL -1`;
} else if (roll < Chance + 50 && roll >= Chance) {
  SL = `SL 0`;
} else if (roll < Chance  && roll >= Chance / 2 ) {
  SL = `SL 1`;
} else if (roll <= Chance / 2 && roll > Chance / 4) {
  SL = `SL 2`;
} else if (roll <= Chance / 4 && roll > Chance / 4 - 10) {
  SL = `SL 3`;
} else if (roll <= Chance / 4 - 10 && roll > Chance / 4 - 20) {
  SL = `SL 4`;
} else if (roll <= Chance / 4 - 20 && roll > Chance / 4 - 30) {
  SL = `SL 5`;
} else if (roll <= Chance / 4 - 30 && roll > Chance / 4 - 40) {
  SL = `SL 6`;
} else if (roll <= Chance / 4 - 40 && roll > Chance / 4 - 50) {
  SL = `SL 7`;
} else if (roll <= Chance / 4 - 50 && roll > Chance / 4 - 60) {
  SL = `SL 8`;
} else if (roll <= Chance / 4 - 60 && roll > Chance / 4 - 70) {
  SL = `SL 9`;
} else if (roll <= Chance / 4 - 70) {
  SL = `SL 10`;
} else {
  SL = 'Invalid Chance'; // Handle invalid Chance values
}

ChatMessage.create({
   
    speaker: { alias: name  }, // Who is speaking
// What it displays and how 
    content: `<table>
    <tr>
        <th>Standard check</th>
    </tr>
    <tr>
        <td>Roll</td>
        <td>${roll}
    </tr>
    <tr>
        <td>Chance</td>
        <td>${Chance}
    </tr>
    <tr>
        <td>Success Level</td>
        <td>${SL} </strong> </td>
    </tr>
    <tr>
    </tr>
       </tr>
</table>`
    
});
bright berry
#

neat

bright berry
#

I have a really stupid question

#

Is all the scripting in CSB java?

#

am I secretly learning javascript?

formal goblet
#

CSB-Formulas are not in JS, but it's quite similar. Script-Expressions on the other hand are indeed in JS.

bright berry
#

I see, cool

#

still, I'm learning something I didn't know before. That's worth something

plucky canyon
#

I'm having this as a value formula in an item modifier, but it's not working as it always result in -1, not matter how high crew_actual is. If crew_actual is 11 or more it should round up to 2, right?

${(max(1,(ceil(fetchFromActor('attached', "crew_actual") / 10))))}$

formal goblet
plucky canyon
#

Ah... yeah, that might be the trouble.

#

Is there a way to round/floor/ceil the formulas in item modifiers?

#

The top one here I'd like to divide by 2, rounding down. But seems tricky to do...

formal goblet
plucky canyon
#

ok, thakns

sweet fjord
#

How do I pass a variable into this?

${fetchFromActor("crew roster","fetchFromDynamicTable('crew_chains', 'chain_heat_left', 'chain_name_left', 'VARIABLE_HERE')","missing: crew roster")}$

formal goblet
# sweet fjord How do I pass a variable into this? ```${fetchFromActor("crew roster","fetchFro...

You can inject another CSB-Formula into it. Or you use concat() to build the formula-string.

${fetchFromActor('crew roster', "fetchFromDynamicTable('crew_chains', 'chain_heat_left', 'chain_name_left', '${VARIABLE_HERE}$')", 'missing: crew roster')}$
${fetchFromActor('crew roster', concat("fetchFromDynamicTable('crew_chains', 'chain_heat_left', 'chain_name_left', '", string(VARIABLE_HERE), "')"), 'missing: crew roster')}$
ornate junco
#

Would anyone be willing to share what their character sheets look like?

blazing ibex
#

i have different types depending on the character, here is the first tab for a PC

ornate junco
#

Thank you :)

#

I'm just looking for a few more examples.

ornate junco
blazing ibex
mental rose
#

okay, can someone help me here? I have 4-6 items in an item container. I want the actor sheet to draw values from the items. What is the identifier that the container uses? Like say I have Desk, Chair, Table, Lamp in the container. How do I identify the first item in the container in a formula?

#

is it "Containername 01" or something?

mental rose
#

okay. so to make sure I understand this: On the actor template create a label called "Armor", key "total armor". On each item click on configure item modifiers and add an item modifer with key "total armor", Op +, Value Formulae $5$ (for example) ?

formal goblet
#

But basically yeah

mental rose
#

why is it giving me NaN when I add the item?

formal goblet
#

Is your formula correct? It´s either just a static number or like this: ${5}$

mental rose
#

currently formula is $Move$. Should it be ${Move}$ ?

formal goblet
#

Yeah, just $Move$ is not valid and will be interpreted as normal text

mental rose
#

ahhh

#

testing now

#

it works. Thank you!

tulip mauve
#

You aren’t by any chance building the DC20 System Alpha by the Dungeon Coach, are you? If so, we should join forces! He’s also got a 4 action point system. They’re SO HOT right now!

waxen sequoia
#

How do I use a radio button in an if statement?
I've tried radiogroupname = 'radiobuttonvalue' (with and without quotes) but it doesn't seem to work

waxen sequoia
formal goblet
#

You need equalText()

waxen sequoia
#

I meant equalText(), sorry. I'm getting the value button from an userinput template, but when I set equalText(radiogroupname, 'radiobuttonvalue') it does not work

kind yoke
#

#modules message
As stated above, I'm having some issues with attribute bars not working correctly on my end. I'm fairly certain text fields should generate an attribute bar but it doesn't seem to be working at the moment for me. If possible I'd like to find a way to make it track a value from the character sheet directly to save me some trouble down the line.

#

Since I'm new I don't actually know if this is a bug with the system itself or I'm not doing something right

#

Nevermind, I figured it out. It was user error on my part. Sincerest apologies!

latent sorrel
# ornate junco Yup screenshots! If you have more I would love to see them.

The arrows only appear when PCs have enough XP to buy a higher rank. Skills are items, and the dice pool is a combo of attributes and skill ranks. Talents are all individual item containers with a filter (and javascript) to determine what column they go in. Question marks are tooltips containing talent description due to space limitations. Just noticed that I have to get long talent names to wrap.

ornate junco
ornate junco
grave ether
#

This is a fantastic sheet @latent sorrel. I would love to get a copy of it. I see elements that I would implement into my own sheet. Plus yours is pretty

latent sorrel
# grave ether This is a fantastic sheet <@170323593224388608>. I would love to get a copy of i...

There is a lot of JS behind the scenes either because I didnt fully understand CSB command structure when I started or because this game system (Genesys) is a pain to code the logic. The "pretty" is CSS that is either lifted directly from another similar setting or heavily inspired by it. Its also not be live tested yet as I need to finish one last macro (he says for the 4th macro) before populating with talents, gear, careers, etc. and seeing what I need to tweak or add. It also relies heavily on items for everything (skills, careers, gear, injurie, etc) and there is communicate between items. I can give you what I have but you have been warned 😱

ornate junco
latent sorrel
ornate junco
#

Css?

latent sorrel
#

Yes, I use Custom CSS module for all my css. easier

ornate junco
#

As am I

grave ether
#

Hahaha i get it, i am learning js and have been writting some of my sheet in it. I planned on using the items, races, sex, so on as item as well. Either way would love it all so i can pull it apart and learn from it. Also, steal pieces that make sense on my side

ornate junco
#

I'm just getting this at the moment. So I need to work on removing the border and increasing the picture.

latent sorrel
#

My inclination would either exclude the picture for the race and class and use the actor image to define these or just use a head shot to give the idea. Personally, I have a journal with full images and details with a button so the Player can drag the item onto the sheet. Once its on the sheet, the player knows what a wookie (or whatever) looks like. Those images aren't meant to have a lot a detail IMHO and big images eat up screen real estate.

ornate junco
#

Thank you both

#

You guys are making this such a breeze.

quasi summit
#

Hi. Is there a way to make things hidden in a chat card only to the GM, visible again when you reveal the card ? For now, texts are shown anyway, forumals with ${! }$ too, and ${ }$ stay hidden. ❔

sweet fjord
scarlet skiff
sweet fjord
#

how can I turn a matrix/array into a table? either html or component.
say I can convert a matrix into an 2d array using a custom function.
I tried to return html data but seems to cause error from the <table> html through using something like ${%{return Mything.doMyTable()}%}$

fierce harbor
#

Non-coding question: how would you go about creating an 'armour set', i.e. something that when dragged to an actor adds a specific grouo of items to the inventory?
With a feature, maybe, like in D&D 5e?

formal goblet
fierce harbor
lyric swan
#

Is it possible to get some kind of item stacking in CSB? Like piling up identical items (ammo for example)?

copper jetty
#

hi guys, i'm new on foundry, you guys are probably tired of hearing this, but when i try to install CSB, foundry ask's for me do some manual installation, i already read the how to install section, and still doens't understood how to do it, can someone help me?

#

i have the .json, but how exactly i import on foundry?

formal goblet
copper jetty
#

damn, it was a module, not a system

#

thank you so much

sweet fjord
#

can I call fetchFromActor() globally in a script? I can't work out the parent class name for it.

formal goblet
ornate junco
ornate junco
#

Also for the item containers that you have where the image is on the left and text is on the left. How exactly are you achieving that?

blazing ibex
#

Not sure what you mean

#

Screen?

blazing island
#

Apologies

#

My hand slipped

ornate junco
blazing ibex
#

Look at the one that says bigger item icons

ornate junco
#

Like what column is being referred to here?

#

When I make an item container am I not just placing the item with in the container? Where is the rest of the text coming from exactly?

blazing ibex
#

Every actor/item has a key called name. It's just the name of the object. You will also need to create a key called info on your item, this should be a brief description in a text field

ornate junco
#

Okay, I see now. Thank you for the clarification.

blazing ibex
ornate junco
#

Apologies for all the questions. I'm just trying to get a handle of all this.

#

Would you be able to provide a visual example as well for one of your item containers?

blazing ibex
#

In a minute, I just got home

ornate junco
#

Take all the time you need.

#

Thank you for the help. I appreciate it.

blazing ibex
#

when i remove the delete button

blazing ibex
lyric swan
rustic void
#

Is there a way to equip/unequip an item on an actor with a checkbox ?

quasi summit
#

@blazing ibex is there a way you can share your templates ? So interested in the the designs you set up (the flex one 🙂 )

#

My sheet looks like this right now 🙂 🙂

static cargo
#

Between WotC's scandals and other (better, imho) systems catching my eye a long time ago. I don't know the 5e behaviour you're talking about, but some simple html might achieve what you're hoping for:
Damage Resistance <details><summary>Read More…</summary>You have damage resistance to the type associated with your draconic ancestry.</details>

quasi summit
rustic void
#

Thanks man, I don't care if it is a whacky solution, from my point of view, it is much better than what i've been doing until now XD

main magnet
#

Anyone got Item Piles to work with this?

It actually does work to an extent but I don't know the path to the item attributes. Any ideas?

sweet fjord
#

Is there an easy way to make a button that links to an actor sheet via a key? I'm trying to get the _id to use in a href link but I can't get the ID, only the name of the actor.

#

oh am using fetchFromActor(ship_actor_name,'_id')

sweet fjord
formal goblet
#

fetchFromActor only looks at the props. The id is outside of the props

formal goblet
sweet fjord
#

so %{ return stuff }% instead?

#

got it. %{return game.actors.getName('${ship_actor_name}$')._id}%

#

So I'm doing buttons that link to another sheet like this, is there a better way?
<!-- ${#crew_id:=%{return game.actors.getName('${crew_roster_name}$')._id}%}$ --><a class='content-link' data-uuid='Actor.${crew_id}$' data-id='${crew_id}$' data-type='Actor' data-tooltip='Actor'>CREW RELATIONS</a>

main magnet
#

Ok so I got currency to work with item piles, just not quantity.

system.props.item.item_count is the number field for quantity of an item, but it doesn't want to read it for some reason. Currency works fine (which is system.props.item_value).

Any ideas what could be wrong?

formal goblet
blazing ibex
#

search for in:#diy-systems from:wasp

main magnet
blazing ibex
#

yea, one sec

#

when you create an item, you have to go into the item pile settings for that item and select a category. you can configure those categories in the the module settings

daring bay
#

New to Custom Systems, how exactly would I reference a drop-down selection that uses data from a dynamic table?

#

for example: Each score should be (1 + species_mod + talent_mod) and both species and talent are selected by drop-downs using data from a dynamic table

main magnet
daring bay
#

oh my god that was right under where I was reading in the docs

blazing ibex
#

maybe if you export as json, you could use a text editor to do a find + replace

daring bay
#

Sorry if I misunderstand, but the following returns null no matter the option

formal goblet
daring bay
#

speciesName

formal goblet
#

Well, that has to match with the one in the formula

daring bay
#

Yeah, I'm sorry I just don't get it. The dropdown has 'speciesName' as the key, and that's also what I want to use right before dropdownKey, right?

formal goblet
daring bay
#

Okay, for some reason whenever I include speciesName and species_bodyBonus in the same formula it doesn't return a value no matter where they are positioned.

formal goblet
daring bay
#

I am terribly sorry

#

Thank you so much for your time

#

It works

#

I feel like a moron because I was literally using dropdownKey instead of the actual key

mental rose
#

If I have items with the same value categories (attack bonus for example), am I correct in assuming that even putting them into different containers would not allow for those valued to be displayed independently on the actor sheet? (EX container 1's item shows it gives a +4, container 2's item shows it gives a +1)

formal goblet
mental rose
#

okay, let me try to explain it again. Let's say I have 4 items. Each of them has a value labelled "AttackBonus". I want these 4 bonuses displayed independently on the actor sheet

ornate junco
#

Question. How would I roll a standard d20 and add in the strength modifier?

formal goblet
mental rose
#

Yeah

#

I mean, if the values can be displayed individually in/on the container without opening the item that could work too

#

this is what I'm going for, really

formal goblet
#

Well, you can use Item Modifiers, which target different Labels in the actor sheet. Or you try to do that via a Script, which iterates through all attached items.

formal goblet
mental rose
#

I have an item container but all it's showing are the item names

formal goblet
ornate junco
formal goblet
mental rose
#

lemme see

#

ahhhh!, That seems to work just fine. Thank you

ornate junco
formal goblet
ornate junco
formal goblet
#

No

#

Open the component config of your number field component and remove a checkmark (somewhere at the bottom)

ornate junco
mental rose
#

@formal gobletthank you, this is almost perfect

formal goblet
ornate junco
#

Is there anyway to set a label name in a dynamic table?

Like have different names.

formal goblet
ornate junco
#

I thought a dynamic table would be good.

#

Would a regular table be better?

formal goblet
ornate junco
latent sorrel
lyric swan
ornate junco
#

I wonder if anyone can help me here with a formula. I am trying have it to when a player selects a modifier from this dropdown it calls the modifier number and then adds it to a d20 dice role.

#

I have this currently.

#

When they click Acrobatics it should roll but I am getting nothing.

#

Would anyone have an idea for this formula?

main magnet
#

Is here any way to make a workaround for sorting items in an item container before the update lands?

fierce harbor
fierce harbor
latent sorrel
ornate junco
#

${skills_mod == 'Str' == [1d20] +str_mod}$

fierce harbor
ornate junco
fierce harbor
formal goblet
fierce harbor
raven raven
#

is there any way to changer how item containers show items, the default is vertical, but i want them to be in horizontal order. Is there any way to achieve this?

formal goblet
raven raven
#

thx

ornate junco
#

It looks like this now.

fierce harbor
ornate junco
fierce harbor
grave ether
#

Is there a way to list all component keys or a limit of how many you can have?

#

I have a component key that for some reason isnt being referenced called PAB. Its in a table so I am confused why its not populating.

formal goblet
grave ether
#

Let me look, i am jusr confused on why nothing is populating

#

How strange, yep, the component doesnt show up on in the sheet

#

It is however on the sheet

formal goblet
#

Any errors when saving?

grave ether
#

No

#

PAB field has been on the sheet since almost the beginning

#

Its also labled in the json

#

Actually more I am looking at it, almost every lable in this table is missing

#

PSD isnt listed

formal goblet
#

Are we talking about a normal Table?

grave ether
#

Yep

#

just a normal table

formal goblet
#

Huh..... Dunno...

grave ether
#

Its strange thats why I asked about limitations

#

I get a lot of lag open the sheet

formal goblet
#

There are no limitations about any counts

grave ether
#

I wonder if that is part of it

formal goblet
#

Try to move it out of the Table and see if it appears again

#

Actually... Is the table hidden?

grave ether
#

no its not a hidden table

#

Moving the table out doesnt fix the issue

#

Going to recreate the label and see if that fix it

#

Nope, going to recreate the Table now, this is very confusing

cloud marsh
#

I don't suppose anyone has made an English version of the RM2 templates?

formal goblet
grave ether
#

@formal goblet - even after recreating it didnt work... Idk what is going on

formal goblet
grave ether
#

nope no modules

formal goblet
#

Which versions are you using?

grave ether
#

3.0

#

I do have some errors in sheet but its only placeholder base code

#

It should effect anything regarding the Key

cloud marsh
formal goblet
grave ether
#

I will attempt to but the Key is reference to other formulas...

ornate junco
ornate junco
#

Does anyone know how to target the css for one checkbox and not all of them?

fierce harbor
fierce harbor
plucky canyon
#

Having trouble with concat() in a roll message. I've used it this way before to mix chat text with variables, but here it doesn't work. Why does it want to convert the text within the ' ' to numbers?

${#mos:=sensorstotal > threshold ? sensorstotal-threshold : threshold-sensorstotal}$
<br>
${!sensorstotal > threshold ? concat(' success! MoS: ', mos) : concat(' failure with. MoF: ', mos)}$```

Error:
```js
Error: Cannot convert " success! MoS: " to a number
    at Array.convert (math.js:12242:57)
    at math.js:6567:108
    at Array.map (<anonymous>)
    at Function.r (math.js:6692:90)
    at Function.a (math.js:6699:66)
    at Function.oe (math.js:6724:82)
    at concat (math.js:6740:54)
    at ...any (math.js:35684:46)
    at Function.a (math.js:6699:66)
    at Function.oe (math.js:6724:82)```

Just this works fine:

```${(sensorstotal > threshold) ? 'success!' : 'failure!'}$```
plucky canyon
#

Ah, it's the old string() thing again. I didn't think that was the solution as it worked in another spot where I didn't use it. Oh well. 🙂

runic condor
#

Is there a way to have a dice roll out of a rich text field?

#

Normally its [[1d6]] but thats not working on my item sheet.

dusky mauve
#

Hello,
How to update value in dynamicTable outside the dynamicTable?

I can:

  • get value
  • get path to the cell

but can't update it.

${ fetchFromDynamicTable('dt_test_table', 'colum1','colum2','value1') }$

${ setPropertyInEntity('self', "getRefFromDynamicTable('dt_test_table', 'colum1','colum2','value1')", 'NewValue') }$
vagrant hollow
runic condor
formal goblet
formal goblet
formal goblet
runic condor
formal goblet
runic condor
#

Ohh awesome thank you!

dusky mauve
#

@formal goblet

${CURRENT:=first(fetchFromDynamicTable('dt_cleric_gods', 'god_points','god_name','god-one'))}$

${getRefFromDynamicTable('dt_cleric_gods', 'god_points','god_name','god-one')}$

${setPropertyInEntity('self', "getRefFromDynamicTable('dt_cleric_gods', 'god_points','god_name','god-one')", "CURRENT - 1")}$
formal goblet
dusky mauve
formal goblet
runic condor
#

Trying to get a text field in a dynamic table to put its contents in the tooltip

#

Is there a way to do that where it references itself? Goal would be whatever they enter in the text box is also what pops up when they mouse over so they can read text easier that is too long for the box on the sheet

#

What I put in the picture there just says ERROR

#

Its close with ${fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription')}$ but it doesnt filter out the other fields. Not sure how to do that

runic condor
#

anyone know how?

fierce harbor
south marsh
scarlet skiff
south marsh
#

Oh.. I'm not finding the right way to do it I guess then.
I just want to emit light on active effect trigger
I'm editing the active effects of a actor template but nothing seems to work 😦
Just putting 'emitsLight' to 'true' in the active effect modifiers but when the right active effect is toggled, nothing happen... The syntax is probably wrong but I can't find the right one

scarlet skiff
#

For such a task im pretty sure you have to create the effect with all the propertys with a Script(csb) or a macro (foundry). To get an Idea what you have to do you could try asking in macro-polo Channel (If macros/JS is new to you)

#

Oh. If you want to do this (on/Off Trigger) for every effect toggle you have to do a world Script. Macro-polo Pins for what that is

#

So e.g. you can create a world script which has the Hook on effect Update (Not sure of the right Name) and check If a certain effect was toggled. Then you can on/Off the light automatically

scarlet skiff
south marsh
#

Oh dear... I guess it's time to blow my brain... x)

#

Thank's anyway !

runic condor
#

I need help launching a macro differently based on where on my sheet it triggers from

#

right now it shows a box that reads all the data from the character sheet of the selected token. it sees what skills have ranks and lets me select them from drop downs and pair the attribute I want to use with them, my goal is to have it pre-select the dropdown options based on what you clicked on your sheet. so like if you click melee the skill dropdown is melee etc.

#

this is how it pops up if you launch the macro on its own. this macro handles building the dice pool and all the fancy visuals for the chat message so itd be cool to have the sheet just modify the defaults of all the forms in the popup window somehow

grave ether
#

Can you use the compare 3 values with the if else then fuction?

#

If not, I can write a script to do it but how do I execute it via label consistantly

dense pine
#

Can a key inside a Label Roll message be handed over to the UserInputDialog to be displayed there in a Label field?
In my example the key is "auto" and would like to display it like this:
In the roll message auto is defined aus follows: ${#auto:=[:MUT_erschwernis:]}$

grave ether
#

I know you can reference in the roll message the key, idk if it can be called but suspect it could

grave ether
#

@dense pine Are you attempting to assign ${auto}$ to always be MUT_erschwernis ? or just temporarly assigned? I am looking for use case so I understand. I am in a meetin for another hours but happy to look after.

dense pine
# grave ether <@638053336884445194> Are you attempting to assign ${auto}$ to always be MUT_ers...

nope. depending on the attribute that does the roll, auto always gets the value of the variable (XXX_erschwernis) that holds the modifiers for this specific attribute. there are 8 attributes, all of them have a var like this that starts with the name followed by _erschwernis. IF that wasnt the case and it was always the same Var i could write it directly into the UserInputDialog. So auto is just ment as a placeholder

grave ether
#

I have a roller that will replaces a value with another during that action but doesnt retain it.

grave ether
#

My use case is that a target would = Target_Number, and in the script I have a varable replaceMe that gets replaced on the roll

#

You maybe able to do the same pushing to the field

silver lake
#

Heyo! How could I make a /r add a value from the sheet? Like /r 2d10+[@attributeBar.CStrength]]

grave ether
#

use ${Key}$ in the follow

#

or are using it via script or via label?

silver lake
#

Using it in chat

#

automating Dice-tray

#

but I heard it's impossible, was about to come back and say I'm using a work-around: 2d10+2*@attributeBar.CStrength.value

grave ether
#

interesting

#

I put a roll on each modifier so something like this

#
<tr>
${sameRow('Name')}$
<th>To Hit</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[2d10]}$
<strong>${!Roll >= Crit ? '<br>Critical Success' : Roll <= Fumble ? '<br>Fumble' : ''}$</strong></td>
</tr>
<tr>
<td>Ability Modifier</td>
<td>${sameRow('SMod')}$</td>
</tr>
<td>Misc. Modifier</td>
<td>${sameRow('SMisc')}$</td>
</tr>
<tr>
<td><strong>Result</strong></td>
<td><strong>${Roll}$</strong></td>
</tr>
<table>
<tr>
<th>Weapon Damage: ${sameRow('WDice')}$</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[${sameRow('WDice')}$]}$
</tr>
<tr>
<td><strong>Result</strong></td>
<td><strong>${Roll}$</strong></td>
</tr>
</table>```
#

${sameRow('SMod')}$ <-- Str Mod

#

Whatever the lable is

silver lake
#

But, do these work on chat messages?

#

Here are some images for reference.

#

I was just adding more easy ways for my players to interact with the game.

grave ether
#

nice

#

How did you figure out the icons on bottom

runic condor
#

I need help with tooltips on a dynamic table

#

I want a text box's tooltip to say whatever is written in it

#

${fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription')}$ has the right info but IDK how to filter out the other fields, it lists all of them seperated by commas

grave ether
#

${fetchFromDynamicTable('InventoryItems', , INFORMATION YOU WANT LISTED, 'InventoryTableDescription', FILTER)}$ <--- try something like this

#

${fetchFromDynamicTable('table', 'value', 'reference', 'filter')}$

#

Thats how I remember it

#

You will need 2 more pieces of information based on that... Right now your saying hey, give me this value off this table.

#

You may need to add first at the beginning of it ${first(fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription'))}$

runic condor
#

Right idk how to reference the current line its on

grave ether
#

Show me your table

runic condor
#

right now with ${fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription')}$ as the tooltip, it puts 0 for everything thats empty and the text in the one. but they all have the same tooltip

grave ether
#

ok question

runic condor
#

so each one that I mouse over shows "0,0,0,0,Tools that.....0"

grave ether
#

Are you trying to references inside or outside the table, and what are you trying to filter to?

runic condor
#

I want it so when you mouse over the description of an item, it has a tooltip of whatever is written in that text box.

grave ether
#

So try

#

sameRow('InventoryTableDescription')

#

You normally only use the fetch if your trying to get data out of the table or your referencing somewhere else in the table

silver lake
#

And edited them.

grave ether
#

I will take a look

#

🙂

silver lake
runic condor
#

Its giving me an error

grave ether
#

Hang tight let me test on myside

grave ether
#

@runic condor - I dont know, I have attempted multiple times to reference the cell while in the cell in different ways and its not acting like I would expect it should

runic condor
#

Thanks for trying, yea ive been stuck on this

grave ether
#

sameRow() should be the key, I am confused why its not working...

#

If you can pull a table you should be able to filter it.. but cant do even that

#

@formal goblet - Can you help Savory, I am stumped on why its not resolving correctly.

formal goblet
grave ether
#

OK good to know

#

Sorry Savory

runic condor
#

At least we arent crazy lol. Thanks!

waxen sequoia
#

On an item container, how can I hide the reload button based on if the ammolabel column is 'N/A'?

quasi summit
#

Hi. Is there a way to test if a variable is set or not ? (not empty or not but set)

formal goblet
quasi summit
formal goblet
#

A Label in a Dynamic Table might be able to do that (Labels support HTML).

static cargo
#

Can anyone see what I've not done?...

#

This is a Label with a roll message on a Dynamic Table row.

fierce harbor
static cargo
#

No Errors, it just throws the entire text un-processed into the chat log as a message.

fierce harbor
#

Missing ${}$ around it.

static cargo
#

3/4 $'s ... thanks Torlan. There's also a way to not enclose the result in an 'explanation', isn't there?

#

Is it ${! instead of ${ ?

fierce harbor
static cargo
#

Huzzah! My brain's not running on fumes!!

fierce harbor
#

Mine is...
I'm trying to update actor resources via macro and it works...but the resource bar on the token does not update unless I open and close the actor sheet...
Any hint?

static cargo
#

Sometimes just explaining the problem "out loud" helps take me down different tracks. Do you find that too or am I just "special"?

fierce harbor
static cargo
fierce harbor
static cargo
#

Do you mind showing the code you have? ... it sounds like you're ahead of me in my own project and may want to steal... take inspiration from it. 😉

fierce harbor
fierce harbor
grave ether
static cargo
#

I just mentioned it in macro-polo...

fierce harbor
static cargo
#

Hey Torlan, I've got a neat trick for you, in case you don't know. You can wrap lines of code in these in discord and it makes it all pretty 'n' stuff.
```js
Lines of Code
These are called Backticks.
They're on the button left of the 1 key on a standard keyboard.
```

#
if (test) {
  do stuff
}
fierce harbor
static cargo
#

oh... ok, then ... is there any more after else {ui.notifications.warn... ?

fierce harbor
formal goblet
fierce harbor
formal goblet
fierce harbor
formal goblet
fierce harbor
quasi summit
formal goblet
fierce harbor
#

Add +(saveCheckbox?mod:0) to the roll formula.

#

Same thing, Just add that to the formula you are using.

fierce harbor
#

Building such an array is quite possible, with labels, but I'm not sure to understand what you need here.

formal goblet
#

There´s currently no multi-select-component. The next best thing would be an Item Container (with modifiers) or a conditionally hidden Panel with Checkboxes

fierce harbor
fierce harbor
formal goblet
formal goblet
#

You have Roll-Formulas in conditionals, this should be avoided at all costs. Only the bonus should be conditional in your case.

#

${[1d20] + (acrpr ? agimo : 0)}$ This makes sure that the Roll is performed only once and that the bonus is applied if acrpr is true, otherwise it will add 0 to the roll-result.

silver lake
#

Hey! On the most recent V11 version, radial is still not working for Dynamic Tables, right?

#

I have just updated everything and ported from the latest Unstable V10

formal goblet
#

The orange color does not come from CSB. The icon can be hidden with CSS I think

silver lake
#

The radial checkboxes.

formal goblet
#

Ah, the Radio Buttons. Yep, not working with Dynamic Tables

silver lake
formal goblet
#

The formula in the Label of the Item Container has to contain the item.-prefix

#

The Label is just a visual thing, you can only retrieve the key.

ornate junco
#

Is there anyway to move it so the name is on the top, bottom, or on the left?

zinc verge
#

I'm assuming you're using Monk's Enhanced Journal? I believe this is what has made your items look this way. The visual of items and other elements that show up orange like this can be edited from the Monk's Enhanced Journal settings

blazing ibex
#

unrelated: is it possible for a rollable table to create items in CSB

rustic void
#

In an actor sheet, I have a label fetching a number field in another actor sheet but it actualize itself only if I reload the first sheet. Is there a way to do it automatically ?

fierce harbor
fierce harbor
rustic void
#

${fetchFromActor('dkpool' , "currentdk")}$

fierce harbor
#

Hm, nothing strange, as far as I can see

formal goblet
fierce harbor
formal goblet
fierce harbor
formal goblet
#

There are only 2 solutions. Either Actor A sets up an Event Listener, which triggers on Actor B - Updates or Actor B gets the responsability to trigger the update of Actor A.

rustic void
#

the second solution might be the best for me ^^

grave ether
#

Actor or user?

#

One second

#

I believe its Actor.character but I could be wrong

#
<tr>
<th>${sameRow('Attribute')}$</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[2d10] + sameRow('Total')}$
</tr>
<tr>
<td>Dice Mod</td>
<td>${?{Modifier[number]|0}}$</td>
</tr>
<tr>
<td><strong>Result</strong></td>
<td><strong>${Roll + Modifier}$</strong></td>
</tr>
</table>```
#

Is what is in my roller, and the already pulls the card in chat

#

<th>${sameRow('Attribute')}$</th>

#

Something like that, OR use name

#

name: Contains the name of the entity (actor name or item name)

#

so ${name}$

red plume
#

I've searched a bit, and come up dry:
Is there a way to export a built system into a standalone?

formal goblet
ornate junco
#

So I am trying to create a formula for when a item is added to a character sheet it increases the ability score of certain abilities. Would anyone have any idea how to go about that?

latent sorrel
ornate junco
quasi summit
dense pine
#

I populated a dropdown inside an item with the key from a dynamic table in its parent actor. So far so good. Now i would like to display values from this Table inside my item next to the dropdown. It it were in the actor itself, the following code would do what i want:
${fetchFromDynamicTable('nahkampftalente', 'talentwert', 'kampftalent', talentauswahl)
}$
How do i need to change the syntax of my label?

formal goblet
kind yoke
#

I'm very new to coding in CSB so please forgive me if this seems like a very simple problem, but I'm currently trying to make it so that a panel disappears if a certain dropdown option is not selected (in this case the "Firearm" option in "Item Type")

Frankly, I have no idea what I'm doing and I've been throwing random code at it hoping that one of these equates to an "IF" statement of some kind.

kind yoke
runic condor
#

Is there a way to have a clickable dice to roll from an item containter? The item works if you look at it seperate but not on the sheet:

dusky mauve
#

Is it ok? if I set vision permission by role GM
and visibility formula at the same time, the permission by role stop working

#

User start to see content that was only for GM

latent sorrel
#

I need to be able to capture the ID of the last dropped item that is dropped on an actor sheet as stored in the actor. I have figured out to get the ID of the source item from the sidebar using Hooks.on("dropActorSheetData"but I can figure out how to capture the ID of the "just dropped" item? Does anyone have any ideas on this?

spare sky
#

@formal goblet Gibt es eine Möglichkeit, Würfelausgaben (z.B. ${#concat(?{trade:'Roll type?'|"Leicht"|"Mittel"|"Schwer"|"Sehr schwer"|"Fast unmöglich"})}$) nur GMs anzuzeigen?

marsh bough
#

I have a system where a certain stat references a dynamic table to pull a dice formula.
Open Legend, using a similar system, also uses a popup, which can add or subtract advantage from the roll (functionally having you roll another dice from the dice formula and dropping the highest or lowest dice from the outcome, for disadvantage and advantage respectively)
Is there any way to add this sort of popup or some other additional step so that a player can add advantage or disadvantage to their check when they click on the label that has all the dice roll code in this way?

lyric swan
#

Are all system.props stored as strings? Trying to access it in js and I need to parseInt() 🤷

formal goblet
formal goblet
#

I think a combination of recalculate() and setPropertyInEntity() will do the trick.

formal goblet
grave ether
#

When do you expect the next release to happen

formal goblet
grave ether
#

Gotcha

latent sorrel
#

If you need to have a macro do something when you drop an item onto an actor, the following will allow you to do this. I put this in the World Scripter module. In this case, I have ~30 item containers that are used to show talents in a specific arrangement which is based on a filtered value. The macro sets the value determined by existing talents and the dropped talents rank. I used to use a button to place each talent but this is automatic.

    //sort talents by tier when dropped    
    Hooks.once("createItem", async (item, options, userId) => {
        const itemTemplateId = game.items.getName('_Talent Template').id;
        const droppedTemplateID = item.system.template
        if(itemTemplateId != droppedTemplateID) {
            return;
        }
        await game.macros.getName('Add single talent to Journal').execute(
    {actor: actor, item: item, itemType: "talent"})
    
        await game.macros.getName('Add to XP Journal').execute(
    {actor: actor,itemType: "talent",item: item})
    
    });
});
formal goblet
grave ether
#

I need a way to return the 2nd value in an array....

formal goblet
grave ether
#

Been fighting with that all day, let me try that

#

Will that work through a actual label?

formal goblet
#

Yeah, just the comma-splitterator is important

grave ether
#

Ok that sorta works, gotta sort it now so i can pull the second largest

#

%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%
How do I add this into the middle of a CBS formula?

#

basicly looking to do the following:
(MAX(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'))*SecMult + (%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%)*SecMult)

formal goblet
#

sort() is not a CSB-Function, that comes from JS

grave ether
#

Yeah I know

#

sort works in CSB because its part of the math.js doc

formal goblet
#

That works? lul

grave ether
#

%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}% <-- this does

#

It sorts and provides me with the second largest

#

MAX(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'))SecMult + (%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%)SecMult <-- I am not sure I can nest the % in there

formal goblet
#

MAX() shouldn´t be valid, function-names are case-sensitive

grave ether
#

max() works

#

basicly taking a excel formula and converting it over to CSB formula

#

=(MAX(PCF_SkillRange_Start:PCF_SkillRange_End))*SecMult + (LARGE(PCF_SkillRange_Start:PCF_SkillRange_End,2)*SecMult) <--- this is the value

formal goblet
#

max() != MAX(), that´s what I want to say

grave ether
#

Correct

formal goblet
#

What is LARGE?

grave ether
#

LARGE is the same functionality as %{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%

#

it produces the value of [n] so in this case it calls for the 2 value which is what I was looking for

formal goblet
#

I see, looked it up in Google Sheet. Works the same way

grave ether
#

Correct

formal goblet
#
max(fetchFromDynamicTable('PCF_Table', 'Skill_Rank')) * SecMult + (%{return "${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$".split(',')[1];}%) * SecMult

You had quotes in quotes. To prevent strings to be cut of, you have to use both " and '.

#

Btw, using syntax highlighting helps a lot spotting those issues

grave ether
#

LOL Yeah it does

#

${max(fetchFromDynamicTable('PCF_Table', 'Skill_Rank')) * fetchFromDynamicTable('Variable_Table', 'Value', 'Variable', 'Secondary Multiplier') + (%{return "${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$".split(',')[1];}%) * fetchFromDynamicTable('Variable_Table', 'Value', 'Variable', 'Secondary Multiplier')}$

#

Fixed it, it works kinda, gotta figure out the values and match to the sheet but it works and pulls data!! Thanks for helping Martin, you have saved me a bunch of work

#

Going to have to figure out nesting a bunch of if else statements later but its bed time for me..

formal goblet
#

This formula looks like a nightmare 😅

grave ether
#

Hahah its not the worst one i have put together

latent sorrel
# formal goblet Fun fact: The new feature will allow automatic and manual sort for Item Containe...

I know but I am trying to simulate the Genesys talent pyramid from the paper character sheet. It has a grid of 5 columns (Matching 5 levels of talents) and theoretically unlimited rows. Talents are placed on the grid based on their level. A lower level talent must be purchased before a higher talent (moving left to right on a row). Also some talents can be bought multiple times, and each one of these counts as a higher level talent. There are other placement rules that I have left out for brevity. So its not quite as simple as sorting alphabetically by name or by other columns.

Additionally This code would be useful when trying to drop an item onto a sheet for purposes other than populating an item container.

static cargo
#

Hey guys. I thought this would work in the Default Value of a Number field in a Dynamic Table...

${sameRow('srALevel') * sameRow('srACPL')}$

... but it just puts that text in, then throws a fit about it not being a number. Any thoughts?

#

Also what would I put in a Label that would be the equivalent of "=sum(DynamicTableColumn)"?

fierce harbor
grave ether
ornate junco
#

Is there a way to check a checkbox from outside an item container?

#

Like can I have a button be clicked and it checks the check box?

grave ether
#

Havent figured out items yet, so no clue red

formal goblet
ornate junco
#

Is there any plan to include checkboxes within an item container?

formal goblet
grave ether
#

not sure what works with CSB.

formal goblet
#

Core Settings Expanded is the only module which can tinker with Status Effects without issues afaik.

grave ether
#

What so you mean automation?

formal goblet
#

Only modifiers can be automated by the system. Concepts like Damage over Time are not implemented, so you'd need to implement all that by yourself

#

No

grave ether
#

Idt dots are implemented in a system to my knowledge

formal goblet
#

"Damage" is a permanent stat change, which can be done via actor.update().

"Over time" is something like an Event, so you have to work with Hooks, which listen to time-changes for example. When the event emits, you have to check if an actor is currently affected by a status effect. If so, you can apply the damage part.

That's all I can say.

static cargo
grave ether
#

Yeah not able to do that

#

You can use a number field and use default as a formula field

#

but thats about all I can help with

static cargo
grave ether
#

${sum(sameRow('srALevel') * sameRow('srACPL'))}$

#

try that

formal goblet
grave ether
#

When you say more components what do you mean.

formal goblet
#

e.g. a Label, which uses the value of a Number Field if a Checkbox is checked, otherwise it uses the normal formula. That's how an override would work.

grave ether
#

I havent used anything like that. I would be interested in looking at it

static cargo
#

I found a wholly different work-around, so I'm ok.

formal goblet
#

The console (F12) can help finding the cause

ornate junco
#

Is there anyway to make a field not editable by players and only editable by DM?

grave ether
#

Make the field viewable by a gm only, it will be hidden from players but the dm can edit stuff or what not

ornate junco
#

I would still like players to see the value though.

grave ether
#

Then makr a reference field as a lable if you want the player to see it

#

Have it call the hidden field

ornate junco
#

Thank you

cloud marsh
#

Is there a way to do this on a character sheet? - I have one field with the quantity of an item (1, 2, 7, etc.), a second field with the weight of the item. Can I have a third field that shows the total weight? e.g. item weight x item quantity = total weight.

cloud marsh
#

How?

formal goblet
#

Inside an Item Container or outside?

static cargo
#

(Lurking, hoping for an example of 'outside')

formal goblet
cloud marsh
#

Also outside. I'll check the FAQ.

lyric swan
#

What is the correct macro formula to check if an active effect is affecting a token?

lyric swan
#

Thanks man !

lyric swan
#

So, since items can't be stacked in inventory, what do you do to your system? Only one item per pile? Or have you found other solutions?

formal goblet
lyric swan
#

Fair, ty for answering

potent fossil
lyric swan
#

Is it possible to use the Effect macro module in CSB? I can't find a way to access the active effects settings other than in "Configure Active Effects" on the character sheet (to set modifiers).

formal goblet
lyric swan
#

Basically you can assign a macro to an effect so it runs it when you gain/lose the effect, but you have to set it on the "classic active effect board", but I can't find it in CSB so my guess was that it is fully replace by the effect modifiers board.

formal goblet
lyric swan
scarlet skiff
#

As far as i know this Module doesnt Work with csb

#

Or at least Not properly Like in other systems. Maybe you could be able to get IT to Work but then its the question If its worth the hassle

formal goblet
#

Only the target-actor-name (with fetchFromActor('target', "name")), not the target-token-name (that one requires a custom-script).

quasi summit
#

Anyone knows how to access/modify status of a character ? Thanks

potent fossil
#

is there a function to keep the highest value from a list of given keys ?
Like having an attribute only return the highest value between strength, dexterity and reflex

grave ether
#

Are they in a dynamic table?

#

Or you could use nesting if statements

#

Or switch() statements

#

All depends on how you have it broken down

grave ether
#

If in a dynamic table you could refernce the max(fetchFromtActor(table, value) )

potent fossil
#

nvm nvm

#

I forgot to change one Math.max by max so obviously it wasn't gonna work

#

thanks bro

quaint python
#

Hi, quick question, how can I change the roll formula depending on a value from the table?

potent fossil
quaint python
#

Yeeep, sry, not good into foundry stuff
I have a dropdown list for a number of characteristics, with a non-numeral values (I used letters from E to A)
So, if a char has a characteristic of A - he uses 3d10kh2, D - 2d10kl for a roll formula and so on

potent fossil
#

${key = "A" ? 3d10kh2 : key = "B" ? 2d10kh2 : key = "C" ? 1d10kh : 2d10kl}$

#

try something like this

#

I'm not 100% about the " " actually I think there is another way to do it

#

but I can't recall it

lyric swan
#

Is there a way to store a system.props as number instead of string??

#

Because even number fields are stored as strings.

quaint python
grave ether
#

${ switchCase(KEY argument, 'A', '3d10', 'B', '67d4', ect)}$

#

Doing this by phone and by memory but its listed in the wiki

#

Its similar to if statements

quaint python
#

Thank, ill try this one

tiny hinge
#

can someone explain what the conditional modifer list is for or what the use case is? i was thinking of creating something like a list of active effects but apparently for it to show the list of modifier groups, you need to first administer the effect from the token first. ticking all the groups also doesnt list down the groups until the status is applied from the token.

#

if i have to apply the status from the token then tick the modifier group, then there is not much use for the list isnt it?

#

or its a wrong use case thing?

runic condor
#

Confused on this bit on how to call a macro with arguments. %{return await game.macros.getName('dXroller').execute({name: '${name}$'})}%

If I wanted to do /macro dXroller total=4 dX=8 how would I work that into that last bit with multiple arguments?

stray latch
#

Hi everyone, I wanted to ask when it came to dynamic tables. I was wondering if anyone knew how to set a label value for a row when making one in the initial template. I'm trying to make a skill table with the preset skills in. But I can't see how to set premade instances to certain values? So they'll all be already on the sheet straight away. I've been trying user inputs but they don't seem to trigger on creation.

A text box would work, but I've seen others peoples skill lists that seem to use labels for the skill names, so I was curious as to if that's being done simply by inputting some values somewhere I'm missing, of if it's CSS work?

fierce harbor
runic condor
#

Im not sure what to do for a single argument either on the name bit

#

is it %{return await game.macros.getName('dXroller').execute({total: '${4}$'})}% ?

fierce harbor
#

Try something like this:

%{return await game.macros.getName('mavroName').execute(
    {1stArg: 1stVal, 2ndArg: 2ndVal, 3rdArg: 3rdVal})}%
runic condor
#

got it to work like this: %{return await game.macros.getName('dXroller').execute({total: '${4}$', dX: '${10}$'})}%

Now is there a way to make it hide the output like when you do ${#stuff}$ ?

potent fossil
runic condor
#

I tried putting the # and it still shows "undefined" in the chat bc the macro isnt meant to return a value like that

tiny hinge
potent fossil
tiny hinge
potent fossil
#

Hopefully one day

tiny hinge
#

yeah i just re-enabled DAE

inland grove
#

Hello there !
I'm new here and i'm a total beginner on Foundry (and JS) and i have a question :
I have an item in an item container and i would like to use some attributes from the character on the item for a roll.
here is my formule so far :
<H2>attaque : </H2>${[1d100] + %{return entity.system.props.attaqueval}%}$ + ${%{return entity.system.props.strval}%}$

#

the attribute "attaqueval" is on the item and "strval" on the character but, obviously, "strval" appear undefined.
can someone explain me how to recover the value from the caracter please ?

formal goblet
inland grove
#

oh.
Thank you ^^'
I'll try that now

inland grove
#

Many thanks ^^

obsidian swallow
#

Are there any good tutorials or resources for getting started with CSB? I am completely new to Foundry and am trying to implement a medium-high crunch custom system that I'm working on.

formal goblet
# lyric swan up?

I don´t even know why they are strings in the first place. But even then, it shouldn´t be an issue to cast it to a number.

lyric swan
#

Well other modules are looking for numbers and this lead to compatibility issues

fierce harbor
runic condor
#

is there a way to trigger a macro with a roll message without outputting anything to chat? It always puts a blank message

grave ether
#

Yes, i believe its # mark but not 100% sure

#

Its documented in the wiki

runic condor
#

It still puts out an empty message in chat, scrolling up it looks like this is a known limitation

grave ether
#

Does it put unknown or blank?

#

The thrown done above should prevent the undefined as well

runic condor
#

totally blank

grave ether
#

Hmmm

runic condor
#

oh now its working, I think I had a typo, I re-pasted into a new label

#

sweet thanks

grave ether
#

Np!

ornate junco
#

So I am trying to get a formula that calculates all my weights.

#

All of my weights use decimals as well but its not calculating the one weight that is showing a decimal.

#

Does anyone know how to get this to work?

#

${floor(Total_Weight_Weapon + Total_Weight_Armor + Total_Weight_Pockets + Total_Weight_Wallet)}$

#

This is the current formula.

formal goblet
#

Do you see the value of the one weight in a Label prefix?

ornate junco
#

Yes

#

I see the value of all the other weights.

#

Besides the one that is displaying a decimal.

formal goblet
#

So that one isn't even showing up. Errors in the console?

ornate junco
#

No errors that I can see.

formal goblet
#

Warnings?

ornate junco
#

None that I can see.

#

Here is another visual.

formal goblet
#

Yeah, and your formula should show 11

ornate junco
#

It is showing 11 at the moment.

#

I would need it to show 11.5

formal goblet
#

Remove floor() then 😅

#

That one rounds down to the next full-number

ornate junco
#

Thank you

potent fossil
ornate junco
#

Thanks. Martin just said the same thing.

potent fossil
#

yeah I was too slow on that one 😂 sorry

#

good luck with your project

potent fossil
#

I have a question. I know that for dropdown list a specific label can only have one key linked to it. but what if I want to update two values depending on what is selected in a dropdown list ? How should it be handled.

Example : A dropdown list lets you chose between a easy, medium or difficult skill. depending on that, you would need to update 2 values in a label : (1) the number of points required to level it up (2) the time you need to spend studying to level it up.
If you had only one of the two to update, it would be pretty straightforward: you just put the value of one them as keys in the dropdownlist. But now that you need to account for two variables, how should it be handled?

#

When I have to do it, I set the keys to 1, 2, 3, 4.... and then use ${dropdownlistkey == 1 ? value1 : dropdownlistkey == 2 ? value 2 ...}$ but I feel like it's not very efficient. So I wonder if there is an easiest/more efficient way to acheive that

grave ether
#

You can always use the and() to compare 2 values as well if needed but it doesnt seem like that is needed

#

Are these on dynamic tables?

potent fossil
#

Nope, I just manually enter the values of the dropdown lists. The thing is, the way I do it works, it just seems a bit overcomplicated to me, so I thought that maybe someone knew how to it differently

formal goblet
grave ether
#

Yeah that was my next thought

#

Make a dynamic table that has the list of things you want on it. Then have the dropdown used to select what options your wanting

#

I am a fan of helper tables

#

In this case say dynamichelpertable hase the following,
3 rows 3 columns

Difficulty, multiplier, bonus
Easy, 6, 9
Medium, 3, 3
Hard, 1, 0

Write the other fields to look at this table and all fielda will update accordingly.

#

Then you can add to the table if needed later on

potent fossil
#

thanks for the insight guys 😁

grave ether
#

Not sure about status effects.

formal goblet
#

It´s just the key-name of your Label (Label must be a number).

formal goblet
#

Templates are independent from each other, so you have to do that for each one

#

You can do one trick and copy your configs from the export-json

#
  • Source-Template: right-click, export
  • Target-Template: right-click, export, copy & paste relevant parts from Source-Template, right-click, import the edited file
pallid marsh
#

Grüß Gott,
so my problem is this:
I want to equip/activate only one weapon/item at a time, unequipp the others
Use a Label to then roll the damage with the damage-value of the equipped weapon

I know in theory how to calculate the total damage-value of all equipped weapons, same procedure as _Template afterall.
But if the damage-value of a weapon is "2d4" e.g. it returns with "NaN" since i assume the item modifier dont like the D

grave ether
#

Wouldnt it be :2d4: ?

formal goblet
grave ether
#

I am travelling so i dont have access to my sheet but i have it so whatever is in that field is replaced in my roll mechanic.

#

2d4 then reference the field ${DAMAGESIZE}$ in the roll to replace the dmg

formal goblet
pallid marsh
#

so since a picture says more than 1000 words

grave ether
#

Hmm maybe i am a bit confused on what is trying to be achieved

pallid marsh
#

basically, im happy enough if i stop getting NaN

formal goblet
pallid marsh
#

is there another way to get my damage_value out of the item?

grave ether
#

Items are outside my knowledge. But dont you have to reference the container not just the key?

formal goblet
grave ether
#

Didnt know that

#

Suggestion then, break down the dice size

#

Add of the total amount of dice and reference that instead of the 2d4 it would be 2 d4 and when you roll base it off of the weapon type? Idk what your weapons are designed around

formal goblet
# pallid marsh is there another way to get my damage_value out of the item?

Yeah, but the strategy is completely different.

  1. We won´t add damage-rolls together (doesn´t work). Because we have strings, we will join them with a +.
  2. Joining strings doesn´t work with item modifiers, so we have to get the values of the items by a Script. This example here illustrates how to iterate throug the item-collection: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Script-to-update-multiple-items. Set the right filters and join the remaining ones with a +
grave ether
#

I will be back into town on Sunday, i will poke you with what and how i do it. It might or might not help

pallid marsh
#

wait, could i refference a roll table with my numerical damage-value and have my calculation then go with correspoing roll table?

grave ether
#

Sounds like a good thing to try

#

I have my weapons do that, if its this type and equaltext of this name give me this roll

pallid marsh
#

many ways to rom after all, lets see what i will do

grave ether
#

Rock on man, i am new to this as well, but try to help as where i can. As my friend would say be the rubberducky

pallid marsh
#

now that the easy problem is dealt with,
how do i get the distance from actor to a target and us it to calculate bulletspread and accuracy.
bonus points if a missed shot is able to hit tokens on the path to or behind the target

formal goblet
pallid marsh
#

just kidding :D

#

i will ask my local code-monkey for that one

formal goblet
#

Hört sich nach nem guten Plan an

grave ether
#

Lol i need a local code monkey

#

Best i got is a hamster on adderall.. not the same

pallid marsh
#

mine is easy to handle, only problem is his inability to express coding-stuff into a human language

grave ether
#

Lol i actually do that for a living, code to human translator.

#

My coding skills are limited unfortunately but i manage

pallid marsh
#

i copy from _Template and am very, very happy about the thorough documentation and this channel

grave ether
#

Thats where i started as well. The system i am making a sheet is all about d100 rolls on a success chart. Using skills as the target. Getting the math to match the excel sheet has been a challenge but I am almost there.

#

The second sheet i am working on is taking the book dungeon crawler carl and putting a character sheet together for us to use. That one has been a bit more straightforward since its being developed as we play

slate mulch
#

Hello! I have a question I'd appreciate some assistance with!
I'm trying to make a macro that can look at an actor's item and toggle an "is this equipped" value. I'm able to grab the information I'm looking for, but I can't figure out how CSB wants me to update it.

I just want to confirm that I should be trying to edit the value in item.system.props and not item.data.system.props, since I see there's a item.data.update() but foundry says that's no longer used

#

for reference, the script on the left is the macro in the label, and the macro on the right is what's being called

#

oh wait, looks like this could be done with setPropertyInEntity

slate mulch
#

ok yeah that was a lot easier, never mind!

slate mulch
#

Thank you!

slate mulch
#

One other question - is there a way to use setPropertyInEntity to update things like radio buttons or checkboxes? For example, I currently have a checkbox and I can use setPropertyInEntity to change it to true or false, but doing so doesn't seem to change the state of the original checkbox. When testing with radio buttons, setPropertyInEntity could change the value, but doing so would remove the dot from the center of the selected button

#

For example, the item container here reads that it's equipped and it appears in the correct filtered item container.
However, by setting the property to false, it correctly moves to the other filtered container, but doesn't update the original checkbox when it should be unchecked

#

update - it looks like set property will update a checkbox if the value is currently false and is then set to true. However, it won't update the checkbox if the value is currently true and you set it to false

hollow dew
slate mulch
hollow dew
#

i'm using my checkbox value in a ternary to see if it's true or false and it works for me

slate mulch
#

ooh interesting

#

lemme tinker a bit

hollow dew
slate mulch
#

ok so with some testing, it looks like setting the value to 0 almost works. If you set it to 0, it'll clear the checkbox but the checkbox won't read as false. Once you update the item again (in my case I selected an unrelated checkbox), the 0 will turn into false and will read as false

formal goblet
potent fossil
#

hello guys, do you know how to make a 1/3 2/3 panel?

#

like one column of the pannel occupies twice as much space as the other

formal goblet
potent fossil
#

OKay thanks

latent sorrel
#

Does updating a template and selecting update all update items in compendiums too?

formal goblet
forest junco
#

Does anyone happen to know how to include multiple sheet elements in an attribute? I'm trying to set up an attribute that adds all the users protection hit points into one attribute. Is this possible?

Current formulas tried:
First Attempt: ${armor_min}$+${shield_min}$+${aura_min}$
Second Attempt: ${[:armor_min:+:shield_min:+:aura_min:]}$

formal goblet
forest junco
#

thank you

snow locust
#

So i'm trying to make an item where you can input which entries on a dyn table to modify on the attached actor.

The item has a text (skill_name) and number field (skill_bonus), and the following modifier:
${fetchFromActor('attached', replace("getRefFromDynamicTable('skill_table', 'total', 'name', 'name_rep')", "name_rep", ref(skill_name)))}$
which just adds skill_bonus to the result

I'm using replace because it occured to me that functions in a string won't trigger, but it sadly doesn't seem to work. Anyone know what i'm doing wrong or a neat workaround ?

formal goblet
snow locust
#

oh that just works. I don't even remember why I did ref there
Thanks !

potent fossil
#

May I ask please what is the expected use of the userImputTemplate, I don't think I get how they work. Are they like dialogue boxes when you want to a roll ?

formal goblet
potent fossil
#

Okay thanks 😄

ornate junco
#

Has anyone been able to get two labels to be side by side in css with a border box around them?

coral hemlock
ornate junco
#

Would anyone know a way to achieve something like this:

#

I want the boxes next to eachother

coral hemlock
#

I am not at my PC at the moment but if you drop two items onto one table location (+) it puts them in the same spot, not sure if horizontal or vertical though.

ornate junco
coral hemlock
ornate junco
#

They aren't close enough.

#

My issue when it comes to moving them with CSS. Is that it fucks up the entry field.

#

Seems to be working though even when moving them.

#

I like this.

coral hemlock
ornate junco
coral hemlock
ornate junco
coral hemlock
latent sorrel
#

I have the following JS in a label

%{async function main(){
const desc = await game.macros.getName('SC Description V2').execute({actor:entity.entity, itemName:"${FormDropDown}$"});
console.log("bbb");
console.log(desc);
return desc;
}
return main();}%

Which calls the following macro:

async function main(){
    const items = game.folders.getName("Species Generator Items").getSubfolders(true).flatMap(f => f.contents); //would be all items in a folder + subfolders.
    const nameList = await items.filter(i => i.system.props.name == itemName).map(i=>i.system.props.description)[0];
 console.log("aaa")
 console.log(nameList)
    return nameList;
}

nameList in the macro (second function) returns the correct value to console but the returned value as seen in desc (first function) is undefined. Does anyone have an idea as to why? Thanks

snow locust
#

in a label roll message, is there a way to conditionally roll a dice without showing the unrolled dice in chat ?

#

or a way to individually roll a variable number of dice ?

formal goblet
snow locust
#

unless you mean to dynamycally call the dn part as well, i will try that

pure pine
#

quick question, does csb make use of the Scrolling Status Text feature in core, I want there to be text feedback on the token when changes are made to hp/mp field in the sheet

latent sorrel
#

For some reason, I have container on an actor sheet that will only accept non-unique items from a specific template. There are no errors but foundry generates Item creation prevented during pre-create.

weak turret
#

What variable is used to store HP and damage? I'm trying to spawn a damage/healing counter over the token when there is any HP change

formal goblet
formal goblet
weak turret
#

The reason myself and Dark Magician Girl are asking is because we're both trying to have damage/healing numbers pop up over tokens

#

like so

#

OK, I'm making assumptions based on an earlier conversation I had with DMG, but yeah 😛

formal goblet
#

I see. I'm actually a bit surprised that this is not done by default by Foundry.

weak turret
#

I believe it's under the Scrolling Status Text feature in core, which was added in.... v10?

#

but CSB seems to disable it

formal goblet
#

I don't think we are actively disabling it, we would have no reason for that. It's more probable that it requires an implementation.

weak turret
#

mmm gotta think about how i wanna do that

#

i'm very out of my depth

latent sorrel
# formal goblet Is `make item unique` ticked in the items?

When that box is checked. Only one item is allowed, at all, in the container from the template. When it is unchecked, I can drop multiple things from the template. However, I think I may have found the problem. I have a macro which contains several JSON databases. I am creating items in bulk from this JSON by duplicating an existing item with a new name and then updating the relevant fields on the new item via JS. I think it may be relating to the issue.

formal goblet
latent sorrel
#

So the duplicated item is retaining the ID of the original somewhere within?

formal goblet
latent sorrel
#

It looks like sourceId needs to match "_id"

formal goblet
#

I think that is the right one if I remember right.

latent sorrel
#

I have turned a panel into a scrollable div with an item container. I am using code to populate the item container which seems to force a re-render (using Custom System Builder) of the div and I loose scroll position. I can scroll the div via a button with

const speciesCreatorDiv = $('.speciesCreatorMain');
speciesCreatorDiv.scrollTop(200)

However when I capture the initial position, after re-render, the div not reposition to the captured position. I have tried await -> then and long setTimeOut without success. Does anyone have any ideas.

glossy hare
#

There is efficient way to implement checkboxes that add +1 to an attribute?

formal goblet
grave ether
#

Could also do a drop down box to do +1 2 3 ect

#

Helper field if you need to do calculations behind the scenes

ornate junco
#

What formula would I use to pull a value from a number field and show that formula in another number field?

grave ether
#

The number field key

#

Unless i am misunderstanding the question

ornate junco
#

I do understand what keys I'm using, but I'm confused on what formula to use exactly.

grave ether
#

let me start at the beginning, are you just trying to pull the data from the number field? What is the use case?

ornate junco
#

Actually, we're good.

#

I figured it out. :)

grave ether
#

Hehe np

ornate junco
#

Thank you for giving me a hand Drag!

grave ether
#

Anytime man

ornate junco
#

Took me a minute to understand what I was trying to do.

#

But I am just trying to pull a number from my GM tab and put it in my body section.

grave ether
#

Sometime talking through it is best way to figure it out

#

Do it all the time

ornate junco
#

For example, its being interjected into the total sections.

ornate junco
grave ether
#

Yep thats how i work lol wife hates it

ornate junco
#

My girlfriend listens and then just goes "Did you figure it out finally?"

grave ether
#

Mine says, can you go in there your talking to yourself again

ornate junco
#

I need to buy a picture to hang on the wall to just spew shit at.

ornate junco
#

Like when you equip a piece of armor that gets added into a number field

grave ether
#

Hmm

ornate junco
#

Could that be done within a item modifier?

grave ether
#

Check that out

#

It might help a bit, i am not good with items but you should be able to reference the item, not the container

ornate junco
#

Interesting.

#

Yeah I have done it before for the weight of my items.

#

Let me give this shit a shot.

grave ether
#

You SHOULD be able to since thats the purposes

ornate junco
#

Like if checked add value?

grave ether
#

Similarly to if and then statements

#

About as best i got atm, will need to do some testing myself to help you further and i am traveling until Monday

ornate junco
#

If anyone else gets a chance to chime in I would really appreciate it. I am stuck on this one.

formal goblet
ornate junco
#

I was trying to accomplish this within item modifiers.

formal goblet
ornate junco
#

By doing this.

formal goblet
#

That one modifies a Label. A Label contains only derived values.

ornate junco
#

Would I be able to send the value to a label and then pull it from the label then?

formal goblet
#

Then it would derive values from a Label. Still no

ornate junco
#

Is there anyway to have a system that where a player can equip a piece of armor and that armor is then added to a number field?

formal goblet
#

You can add those values to a Label without a problem but Input Components are a big no no

ornate junco
#

Is there any plans in the future to add that type of functionality?

formal goblet
#

Uhh, no. This would require some massive changes in the core-functionality. And would also lead to bad design. That's why even Excel doesn't allow this. You can either have an input value or a formula in a cell, not both.

ornate junco
#

Fair enough.

#

Fucks up my plans for automation, but I can make my players just input the data themselves.

#

Thank you for the insight.

formal goblet
#

Why not just combining it? The base value is in a Number Field while the total is captured in a Label

ornate junco
#

So I need my players to be able to edit their armor number field.

#

In my system I use it as a padding to their health pool.

formal goblet
#

Well, that's what the base-value is for

ornate junco
#

Apologies, I am not fully understanding what exactly you are suggesting.

#

Can you explain a bit more in-depth? I am still learning the system's full functionality.

formal goblet
#

Let's see...

I'd create 2 Components for tracking armor. A number field for the base-value of the armor (freely changeable by the player) and a Label for the total armor (base-armor + modifiers, not changeable by the player). That's all you need or am I missing something?

ornate junco
#

Some what... So let me explain what my old workflow was in Sandbox that I was trying to mimic with CSB. I use to have armor (items) with their durability number and when the player equips that armor its added to a number field.

The player would then substract from that field each time they took damage. There was then a button that would repair all armor from the items durability.

It was a fully automated process involving the items.

#

But from what you were explaining earlier. What Sandbox had was bad practice when it came to the design itself.

#

Which makes sense and explained a lot of the issues I use to have.

formal goblet
#

I see no need to have a number field at all then.

Do you have the Example-Template? That one also works with Armor-Items.

ornate junco
#

That one provided in the Git? Yes, I do! Unless there is another one.

formal goblet
#

Nope, only 1.

#

If you add Armor Items to the Actor there, it will adjust the total armor value automatically (summing up the armor values of all equipped armor items). This value can then be used in other places (like damage rolls).

ornate junco
#

And that is be added to a label, correct?

formal goblet
#

Yep, the total armor value is in a Label

ornate junco
#

Hmm, gotcha ya.

#

Once again thank you for all the help.

#

For now I think I will just have to remove my dream of automating it the way I envisoned it.

#

And have my players just do some basic math.

formal goblet
#

Well, what you explained can be fully automated

ornate junco
#

My only issue it takes away the full durability of the equipped armor being moved to a number field for them to freely edit. Does it not?

formal goblet
#

Current durability would be a Number Field in the Armor Item itself, so that it can be changed by players and rolls.

ornate junco
#

So okay, hmm.

#

I do have the current durability of the armor in the armor itself. My players are lazy and they like it all in one section. So for example....

#

They would want the durability of their helmet to show up here and not within the item itself.

formal goblet
#

Create a Label, which shows the durability then. It would be read-only, yeah, but it would at least display it.

ornate junco
#

I'll most likely end up doing that.

#

Follow up question for you. Is there a way to see if a check box in an item container is checked and if its checked pull a value from another number field within the sheet to another number field?

#

The only time it would be interacting with the item is to see if a check box is selected?

formal goblet
ornate junco
formal goblet
#

You can change every Input Component with the button, so yeah.

ornate junco
#

This most likely wouldn't work but my dumb idea was to list all the armor's individual durability in the gm tab, and then when they equip the armor using the button it calls back to that number. That number field then feeds the value into the box I showed above.

formal goblet
ornate junco
#

Very True.

#

Apologies for spewing all of this at you.

#

I was just dreaming of a lot of automation.

#

Is there a place I can donate to the development of the system?

formal goblet
#

There's a Ko-fi - link in the Readme

ornate junco
#

Thank you. I'll throw you guys a few bucks.

#

Besides this setback everything you have created has been amazing.

#

Thank you for all your hard work.

calm dock
#

hey i got showed to come this way i am trying to make a sytems and sheets for mekton zeta and i dont now how to do codign or were to start dose anyb one now were a good place for me tpo figure it out in detail,? i got to make genric items and stuff

dense pine
#

Visibility Formula: Would like to show a field only if one or another condition is true. can i use "OR" operator here? Maybe my syntax is wrong because it doesnt work:
OR(typ==3, typ==7)

scarlet skiff
#

Try Type==3 or typ==7

#

Not Sure about amount of brackets

dense pine
calm dock
#

@vagrant hollow hey i am looking at your links ands tying to figure out the system tell am i am trying to build the template it dosent really give of an example of hoe to input the key to get a block of info to appear in it

forest junco
#

Hey all, I am trying to add a static bonus if a checkbox is checked in a dynamic table. How would I do this? Very new to JS in general, thanks!

ornate junco
#

What would the formula be when a player rolls and you want it to substract from their spell slots or uses?

ornate junco
#

Like it substracts the value that is set in a label.

static cargo
ornate junco
#

But I think that would be a lot for a simple substraction.

static cargo
#

... triggered simultaneously with a Roll event, w/o manual intervention... right?

ornate junco
#

They click the button for a roll damage and then it subtracts one or two from something.

static cargo
#

They could also potentially give you something that checks for a slot available to give up before rolling...

static cargo
#

Anyway, if/when you approach Macro-Polo, it'd be a kindness to volunteer quickly that the system is CSB.

ornate junco
static cargo
#

Ok, perhaps I could have worded it a little better "5 level one slots powering the use of something like Level 1 Magic Missile." right?

#

A macro can check first if we're not already at zero slots remaining, roll the dice or complain that you are spent, then (if the roll was done) spend a slot.

ornate junco
#

I don't really use the levels for spells.

#

When a player casts a spell they delete that number.

static cargo
#

So it's more like they have energy points and each use of Spell X costs N energy?

ornate junco
#

Sure

static cargo
#

Then, a macro could:

  • see if theres enough energy to power the roll
  • if there is, subtract N from Energy...
  • ... and roll the dice
  • if not, describe how the spell fizzles.
ornate junco
#

What would that formula look like?

static cargo
#

((Doing all that in the same breath is beyond CSB's scope by itself. But again if someone more skilled than I can correct me, I'd love to know better.))

ornate junco
#

In the template that is provided it seems to already be occuring

static cargo
#

Then one of two things is going on, the template provided is already using a mostly correct macro, or I should stop confusing the matter.

#

In any case, very often the folks at #macro-polo are happy to offer their insights. Especially if you can provide lots of details, without writing a small novel. 😁

fierce harbor
static cargo
#

This will still roll if they can't pay for it at the time though, right? And the resource being subtracted from isn't handled here...

fierce harbor
# static cargo This will still roll if they can't pay for it at the time though, right? And the...

You can do so that the macro returns without rolling. The resources can be handled, too.
With some kind of 'metacode' it would look like this:

if(resource >= cost)
{
    resource_new = resource - cost;
    set resources value to resources_new and update actor;
    roll for spell;
    write funky little flavour message;
    return;
}
else 
{
    write funky little message to let the player know ther's not enoough resources to cast spell;
    return;
}

scarlet skiff
# ornate junco What would the formula be when a player rolls and you want it to substract from ...

here is a simple CSB-method to do this (with a check if there is enough ressource to do the spell)

the following is put in the "Label roll message (optional)" of a label component
${yourRessource>=ressourceCost?[1d6+:yourModifier:]:'Oh no'}$
${yourRessource>=ressourceCost?setPropertyInEntity('self','yourRessource',"yourRessource-ressourceCost"):'You dont have enough Ressource to use this.'}$

just replace the parts with your keys
yourRessource: Replace with the key of your number-field (<-- important) which holds the spell slots
ressourceCost: Replace with the key of your component where the cost of the spell is stored. or just replace it with a fixed value e.g. 1 or 2 etc.
yourModifier: Replace with the key of your damage-modifier-component if the spell has a damage modifier (e.g. INT, etc... if not you can delete it) or replace it with a fixed value e.g. 1, 2,....

this is a way how to do it with CSB-formular. with scripts you can do much more.

oblique willow
#

How do I get rid of a hidden item? I have an item that won't show up in any containers but is still applying its modifiers

formal goblet
oblique willow
dense pine
#

my templates, actors and items suddenly stopped working and look like this. anyone know what to do?

static cargo
#

Could it have been timed along with an update?

fierce harbor
#

Haven't updated to the last version yet. It looks like the page is still loading, though.

static cargo
#

Have you tried a shutdown/restart to fix?

dense pine
#

sure

formal goblet
fierce harbor
#

No errors, but an advice says it could not load CSB template-functions.js. Other advices about fonts and glyphs and nothing else.

formal goblet
fierce harbor
formal goblet
#

There was no Update from CSB or Foundry... Did a module get an update at that time?

fierce harbor
formal goblet
dense pine
#

I’m on 3.13 and the error happened 30 mins ago

formal goblet
#

I´m also on 313 and no issues. Any modules loaded?

dense pine
#

Did no updates and 5 mins before everything worked