#Custom System Builder

1 messages ยท Page 43 of 1

sinful spade
#

that's not exactly possible in some cases i've run into

#

a simple example would be adding a + sign to positive numbers

#

it's self-calling for example

formal goblet
frail kettle
#

Oh CONFIG.statusEffects is client-side only !

sinful spade
#

correct- and i need for the attribute to remain a number value, not a string.

#

it's modified by items and what not.

formal goblet
#

Or you use a Script, which fetches the suffix data

sinful spade
#

which is where we go back to hidden columns lol

#

one that outputs just a number and is hidden for modification, the other a reference of the hidden for display

formal goblet
#

I think it was:

return entity.componentMap['labelKey'].suffix;
sinful spade
#

${ref('item.itemRollBase') == 1 ? lookup('attributeTable', 'attributeTotalConcat', 'attributeName', ref('item.itemBaseAttributeName'), '==') : 'placeholder' }$

#

for anyone else struggling with a similar concept: this 100% works

formal goblet
formal goblet
#

${false}$ is a valid Formula

#

Same as ${42}$

sinful spade
#

dude i think you'd hate to look at how this sheet actually works at this point.

#

behind the scene:

~dont touch it, it works~

formal goblet
#

dw, my sheet needs 1-2 seconds to fully update per change because of many computations

sinful spade
#

dude? what system even

formal goblet
#

Shadowrun 6

sinful spade
#

what has you generating so much???

formal goblet
#

Items... Our sheets have 20-30 Items in average

sinful spade
#

oh lorde
I haven't even really gotten to that yet. this is gonna be laggy ๐Ÿคฃ

#

i have placeholders

formal goblet
#

You don't even have multiple tabs

sinful spade
#

sir

#

i absolutely do

#

i just took an excerpt

formal goblet
#

Ok, that looks more like a real sheet

sinful spade
#

capability equip and social each have 3 sub tabs lol

#

so ~11 total tabs?

#

what i've spent the last 3 days working on is those little red roll buttons on the item displayer ๐Ÿคฃ

low tulip
#

๐Ÿ˜“ lot of data entry to get all of the abilities in working, atleast semi-satisfied with how it looks now

low tulip
# sinful spade

btw if you haven't heard it before you've really got an eye for graphic design. Both of those screenshots look phenomenal

sinful spade
bleak marsh
# sinful spade

this is gorgeous,
question though, how do you get the icon to show on the weapon list? for the life of me I can't figure it out

sinful spade
#

I think i found a bug:

${[:sameRow():d6]+(sameRow()+sameRow())}$
results in xD6 + modifiers
([:lookup():d6]+(lookup()+lookup()))
results in x+modifiersD6

formal goblet
sinful spade
#

Yeah, i was confused like

Isnt that the default?

#

it's the same in Tom's

bleak marsh
#

did you re-style the content-link? mine has the image and name in a box and it's super tiny (i'm still on default styles for the most part still)

sinful spade
#

thanks for the support on the css tho haha
it's the one thing i'm confident in about this sheet haha

sinful spade
#

i made a class

#
        max-width: 25.6px;
        max-height: 25.6px;
        border-radius: 20%;
    }```
bleak marsh
#

swipes css

sinful spade
#

you'll probably also want these then:

/* Item Containers */
    /*text*/
    .itemDisplayer table tbody tr td:nth-child(1) {
        width: -webkit-fill-available;
    }
    .itemDisplayer table tbody tr td:not(:first-child) {
        width: 5%;
    }
    .itemDisplayer table tbody tr td span a {
        display: inline-flex;
        align-items: center;
        width: -webkit-fill-available;
    }
    
    .itemDisplayer table tbody tr td span a.content-link {
        background: none;
        padding: 0px;
        border: none;
    }```
#

the first one is just the icon;
these are the rest of the table

bleak marsh
#

cool, I fried my brain earlier, I forgot that sometimes there are simple solutions ๐Ÿ˜„

sinful spade
#

felt.

#

i'm doing another thing martin will probably hate

sinful spade
#

๐Ÿคฃ

#

nothing, but is that thing i mentioned actually a bug or am i dumb

formal goblet
#

Streamlined for readability

${[:sameRow():d6] + sameRow() + sameRow()}$
${[:lookup():d6] + lookup() + lookup()}$
sinful spade
formal goblet
sinful spade
#

I MADE IT PRETTY SKIN DEEP OK?~

formal goblet
#

Well, I don't see an issue, except that you should use first(lookup()) or find() if you expect only 1 value and not multiple ones

sinful spade
#

is that how i get lookup to stop spitting out arrays?

formal goblet
#

Trust me, this will bite you in the neck if you don't do it this way

formal goblet
#

first() retrieves the first element of the Array

sinful spade
#

you don't know how long i've been trying to find an answer to that ๐Ÿคฃ

#

when would i ever need more than 1 item outta a lookup function, i have yet to find a usecase

formal goblet
#

Returns the sum of all rows within a column

sinful spade
#

ah. yep i've used that.

formal goblet
#

Useful for weight in Inventory and such

sinful spade
#

yep!

#

anyway

#

so will the first function fix the uh... adding to the dicepool issue? or is that something outside my scope

sinful spade
#

correct, it did not.

#

its weird that within the table it works just fine
but the minute i use the same syntax and logic outside?

formal goblet
#

You probably fucked up elsewhere

sinful spade
#

within the same button or meta-button?

formal goblet
#

What is a meta-button?

sinful spade
#

meta = prior to

#

sorry niche use

#

metaphysics = that which comes before physics or "first"
same for metalanguage and what not

formal goblet
sinful spade
#

or did you mean the actual code?

formal goblet
#

From the looks of it, it seems to be correct:

sameRow: 2d6 + 3 => 4 + 3 => 7
lookup: 6d6 + 2 => 26 + 2 => 28
#

Different values, but the modifier is applied after in both cases

sinful spade
#

I am just now realizing for testing purposes i had changed the skills and my dyslexic ass got confused by 6d6+2 and 2d6

#

๐Ÿ˜ฎโ€๐Ÿ’จ all is in order, thanks martin

gaunt valley
#

@formal goblet Thanks for the help yesterday on how to get the character's Agility value from an item you're awesome! โค๏ธ

Can you help me with one more thing? haha

How could I do the opposite, now an item that gives an agility buff? I tried something like $fetchFromActor('attached', "Agilidade", 0)$ 8 inside but it didn't work sweaty

ty โค๏ธ

formal goblet
#

And Key should be Agilidade

frail kettle
#

Hey there,
I'm trying to have active effects with some custom fields such as stacks, I've seen that Dynamic Active effects allows that but it's not compatible with CSB, is there any quick win module that would allow me to achieve something like that ?

frail kettle
#

After taking more time to read more carefully the doc, there's already a section in active effect scripting for stacks yay !

#

Damn that documentation thing is really when one knows how to read it sweaty

low tulip
# sinful spade

is that the chat? Do you know if you can make those dice number visuals show up in chat messages?

formal goblet
low tulip
#

oh, fair enough

low tulip
#

here's something weird, if I set sort to auto ascending and input the column key 'abilitylevel' who's label is item.level (a number field), this is how it sorts it, not actually ascending

#

if I set it to manual sort and then click on that column it sorts it correctly

#

nvm I did it wrong disregard me

#

but there's still something wrong here, everything sorts correctly except for the green table

#

if I do 06, 08, 12 it works

#

but with 6, 8, 12 it seems to think that 12 is less than 6, 8

#

it's like it doesn't read the entire number. Is this some weird string conversion

#

am I doing something wrong?

formal goblet
sinful spade
shy osprey
#

Struggling with initiative and could use help. I would like the system to roll a die from a dropdown menu (key: Initiative). Now what should I write on the settings "Initiative formula" to get it pick the die from the sheet and roll that?

shy osprey
#

omg that simple?๐Ÿ˜‚ Thank you!!๐Ÿ™ Sometimes the shortest route is indeed the shortest route

sinful spade
#

Martin really is the MVP lol

sinful spade
#

How can i add character profile pictures to chat?
Including rolls sent from outside the charactersheet with the dicetray module?

#

I've tried a number of things within the sheet like:
@{Selected | actor.image}
but not even sure if i'm on the right track with that one.

sinful spade
#

found a bug, this one is worth signing up to gitlab to report so i'll be doing that in a bit:
I got my weapon attack message first draft working last night (yey! on to upgrading and formatting it)

The issue: Items with radio buttons checked by default do not work with formula

Long form:
I dragged the same item (iron dagger) to the character inventory to have two of them, renamed one to keep track of which is which and adjusted the modifier.
However, the roll button did not work for the new item, only the old one. The items rely on the same templates and the only difference was their names and the modifier (which is a number field). The error:

[No packages detected]```
Toggling the item to use the other radio button fixed the issue, and toggling back to the default button still works; all new items created and added using the default radio generate the same error.
half bloom
#

Sorry to bother but I've been trying for hours yesterday.
Is there a way to automatically fill out the fields based on the choice in a dropdown menu?
Here I'd like to automatically fill out Timing and Effect based on the choice (in this case Blue Wing).

I tried to do it via labels and conditions, but it seems like Labels cannot access the Keys set in the dropdown options.

I fear making them items might be my best option but then I'd also have to get into CSS too which I'd like to avoid.

sinful spade
#

Hey Malea,
Have you tried using the reference function and conditional logic?

${ref('keyOfDropdown') == keyOfOption ? 'Action Phase' : ref('keyOfDropdown') == nextDropdownOption ? 'appropriate phase' : (...)}$
until the last 'else' you just put
' ' as in 'null' or do nothing.

#

@half bloom forgot to ping oops lol

half bloom
sinful spade
#

here's where we get into me just trying dumb stuff

try adding the '' around blue and red wing e.x 'bluewing'
if that doesnt work, try removing them from wingdrive and bluewing

#

leave it around action phase, that should be right

#

i never know when to use those things so i just default to it ๐Ÿคฃ

ref('hp') Returns the value of the field with the key hp
ref(currentArmor) Returns the value of the field targeted by currentArmor
the wiki is a bit weird on it and it's not always just when it is a number like i thought

half bloom
#

Just adding '' around blue and redwing didnt do anything, removing it from the wingdrive made it not throw any errors anymore, but it's also not computing anything and just defaulting to Action Phase

sinful spade
#

Ah damn. Oh hey your Savior is here

formal goblet
#

switchCase(wingdrive, 'bluewing', 'Action Phase', 'redwing', 'Reaction Phase', ...)

sinful spade
#

Is there only two options?

#

Guess I should have asked that ๐Ÿ˜‚

half bloom
#

yeah, was just doing 2 for simplicity rn sorry if that changes things

sinful spade
#

No worries, I wouldn't have thought of that solution anyway ๐Ÿ˜›

half bloom
#

not your fault should have elaborated

sinful spade
#

Also martin I reported a bug.
But still need help on the chat styling. Any idea how I can get actor pfp and itempfp into chat? ๐Ÿ˜ฉ I'm about 12 hours into figuring this out haha

half bloom
#

Thank you very much, both of you.

formal goblet
sinful spade
#

Ah a return script.
Which entity gets scrapped for actor or item?

#

Cursed JavaScript

#

My bane

formal goblet
sinful spade
#

๐Ÿค” then if I execute it with a button in an item container it'll still be a player profile picture and not the item?

#

Is there somewhere on the wiki I can reference this?

formal goblet
#

If you want the Item from the Item Displayer, use linkedEntity instead of entity.entity

sinful spade
#

Too easy.
There a way to get the default player character though for external sheet rolls? Like through dice tray?

#

I figure that'd have the be through csb somehow

#

Though I guess it could be the dice tray module code too

sinful spade
#

Oh Christ. Yeah that's out of my league for now.
I don't even think I could write a hello world function in JS.

#

Alright. ๐Ÿ˜‚ Not necessary for function. Thank you anyway.
I'll use the scripts for the internal stuff

formal goblet
sinful spade
#

๐Ÿ˜‚๐Ÿ˜‚ yeah I'd have got that wrong mate

System.out.println("hello?")

Or is that just regular java? Idek

sinful spade
#

๐Ÿ˜ฉ ๐Ÿ˜‚

#

Man, nothing has made me feel as stupid as coding

#

I swear, I'm only a little stupid on a daily basis ๐Ÿ˜‚๐Ÿ˜‚

formal goblet
#

dw, I'm playing with 4 programmers rn

sinful spade
#

Huh ๐Ÿ˜‚

#

The only thing I'm playing is League. I see your PFP over there

#

but if you mean your ttrpg crew - mine are all big math nerds. none of them can code though... wow i never realized i also fell into that category till just now

#

I got a forensics guy, engineer, physicist, and myself o3o

sinful spade
#

thoughts?

sinful spade
#

Here's all the different roll types ๐Ÿ˜ฉ

fair yoke
#

how would I go about setting a condition like if skill equals 0 do a different roll than if they are 1 or above?

bitter spear
#

Hello, i'm trying to have a custom actor for a system of mine. I got the example module and i want to modify the Attributes. I modified for example Strenght in to Brawn under the "hidden" table, editing the label and the ${first(lookup('Attributes', 'Total', 'Attribute', 'Brawn'))}$ but it seem it's not the right way. Is there a guide for dummies for customize those info perhaps, please?

bitter spear
#

I suppose they are defined somewhere but I don't understand where.

storm stream
#

I got a dropdown menu that pulls info from a dynamic table. any chance to make it pick a random entry upon actor creation?

#

It seems I could use something similar to this except it's from a dynamic table no?

elder raft
#

Is there a way to color dropdown options/text without custom CSS?
Is there a specific HTML styling that works in those?

sinful spade
sinful spade
sinful spade
sinful spade
bitter spear
elder raft
# sinful spade You can use css within the html tag? <Div style="width: 100%; height: 50%;>

Apologies,
I was hoping to have one of the text in the Dropdown to be a specific color without creating a full css style sheet,
like how you can have html styling in labels and such.
But it appears as though html styling doesn't work inside the dropdown-list labels specifically?

Perhaps if I make the Dropdown a "formula" rather than a custom? and add the options as an array/string?

#

For instance, give Overcome a bold and green style, Temporary perhaps just a color, etc.

sinful spade
#

Ohh! I tried to do that earlier. Link mentioned it would be a nightmare to achieve. I'll see if I can find his response and maybe you'll make sense of it

#

Okay I can't search on mobile, @elder raft search for messages from me containing 'color' and 'meter', link replied.

elder raft
#

Ahh I see, yeah. I had a feeling if it didn't just accept HTML in the dropdown itself that it'd require an actual CSS style sheet, which I'm not ready to build or implement yet.

Thanks!

sinful spade
#

IIRC it isn't just CSS to access the dropdown either.

#

Actually @elder raft
I think i did what you're asking for by mistake - it doesn't change the dropdown meter once selected but it does change the menu, i think.

elder raft
#

Ohh really?

#

Ohh, interesting

sinful spade
#

that's with just css, but you can try to had that styling into an html tag into the label value of the dropdown and see if that works

#

you'd certainly need some sort of JS or something to change the dropdown element based on the selected value though.

elder raft
#

Yeah, I was hoping it'd be as simple as making the dropdown option "<p style=color:green;>Overcome</p>' or something like you can with labels and labeltext, but it seems it's more involved!
No worries, thanks for your insight!

sinful spade
#

bro no worries, you've helped me out before ๐Ÿคฃ
how's your system going btw?
I remember you asking about dice faces in chat - did you ever sort that?

elder raft
#

Not to complete satisfaction, but I got it to do kinda what I wanted, visually, just using the Foundry dice system.
Aint perfect, but I learned a lot trying to figure it out

sinful spade
#

shame, i'm not ready to learn JS yet, so no scripts or macros for me.
I'm still scrapping everything together with just CSB and CSS ๐Ÿคฃ

#

I'd love to get the dice faces in chat tho :U

elder raft
#

Haha same!
Bit above my head. I got little bits and pieces to work, but I need a lot more learning before I can totally tackle the scripting and macros

sinful spade
#

๐Ÿคฃ such a mood.
I'm not a computer person - what's with all my hobbies trying to make me learn to code haha

#

I'd love to look at your sheet sometime dude. Not enough people share their wins in this channel!

elder raft
#

haha, welcome to the future! Everything needs a CompSi degree now!

sinful spade
#

I aint going back to school for compsci ๐Ÿ˜ 

#

maybe my phd haha but that's only because i want to be a professor when i retire

humble sonnet
#

the funny thing is everyone I know in the compsci field basically says that school for it is way less necessary than having a portfolio and using free resources to learn

sinful spade
#

but certianly not in this black magic taboo of computers

elder raft
sinful spade
elder raft
sinful spade
#

I absolutely love when fields recognize that degrees aren't useful at the entry / early middle levels.

#

They can be helpful once you get far enough into a profession that you start benefitting from knowing theory

elder raft
#

I need to do some JavaScript and Python tutorials on Youtube or something, too much is starting to rely on some kind of understanding of certain languages

sinful spade
#

I did take a Web Dev one too that was great for html and css, but i dropped out of the JS unit because it was just too much too quick and a bad time for me irl

#

The CSS unit was actually disgustingly helpful.

elder raft
#

see, all my CSS and HTML comes from learning to pimp out my MySpace and DeviantArt pages back in the day! ๐Ÿคฃ

#

a bit ancient there

sinful spade
#

Nah bro i remember it

#

that's where i started but this went way further in depth than that

#

it tought how to make your own grid system to jerryrig a bootstrap system so you knew the theory, then got you to use actual bootstrap

#

i've used those principles 100x in my sheet

elder raft
#

it all trickles down and builds on itself!

sinful spade
#

i'm about to start my captsone on it ๐Ÿ˜ฉ things a nightmare haha

#

have python specific courses but i can't speak to them since i am just trying to hone in on data wrangling specifically to speed up some of my work

bitter spear
#

Hi, there is a way to make a button on an actor that execute a macro?

#

I'm using the actor sheet in example module

sinful spade
#

you can use the %{}% wrappers to execute normal JS.

#

I dont know the syntax for identifying the macro but if you can code JS that should be fairly easy to get the macro and execute it with that in mind

bitter spear
#

I have no experience in coding but i'll try. Thank you.

frosty lintel
#

Noob question: how do I create an action? Like a melee weapon or spell, that I can apply rolls and animations to?

low tulip
#

speaking of animations, has anyone dabbled in getting automated animations to work with this system?

#

or another way of automating weapon animations for that matter

low tulip
bitter spear
low tulip
bitter spear
#

And if i disable the "send to chat" simply doesn't work

frosty lintel
sinful spade
sinful spade
bitter spear
#

Well, i got most of the actor sheet to work for customized stat, skills, calculated fields and the likes but rolls automation is beyond me. Are there some example that i can try to look at please?

sinful spade
sinful spade
#

fyi the # is found here:

4.9. Hide formulas in chat messages
When using formulas in chat-messages, you can hide some formulas to perform preliminary calculations assigned to reusable variables. To do so, prefix your formula with #, for example :
${#testResult := target - roll}$

bitter spear
# sinful spade wdym roll automation? Just fetching a stat and weapon damage?

A bit more complicated. Player can choose a variable number of dice to roll. So i have a macro that prompt a popup, the player can input the number of dice and then roll. It would be the same to have a input number box in the sheet and a button that roll that number of dice but i'm not being able to make it work.

sinful spade
#

do you prefer the prompt or existing label

#

i have examples of both sitting around

#

@bitter spear im about to leave,

#

answer quick and i'll send it before i go

bitter spear
#

Prompt

#

Thank you very much

sinful spade
#
${sameRow('attributeName')}$ with ${concat(string(sameRow('attributeDiceQuant')), 'd6')}$
<br>
Situational Bonus: ${addMod > 0 ? concat('+', string(addMod)) : string(addMod)}$
${[:sameRow('attributeDiceQuant'):d6] + addMod}$```
This is one of the simpler ones i used:
it creates a prompt for a situational bonus and adds it as a flat modifier to the dice roll
bitter spear
#

I really appreciate the help ๐Ÿ™

sinful spade
#

to convert it you'll need to move the + addMod at the end to before the :d6, and replace the samerow lookups

#

or even just
addMod:d6
and even the d6 is changeable if you want

#

for example in this excerpt from another function i get the dice number from a number field within the item itself:
{[:ref('item.itemDamageQuant'):d(${ref('item.itemDamageVal')}$)]+(ref('item.itemBaseModifier')+damSitBon)}$

#

Frankly depending on what you're doing I'd just install the dicetray module and let players manually click the dice they want
foundry natively supports
/r XdY+Z
format:
/r 1d6
/r 5d4+3

#

dicetray just mounts icons to click on the bottom right by the chat for easy access of flat #d usage

#

Good luck!

bitter spear
#

Thank you very much

bitter spear
#

I can't make it work ๐Ÿ˜”

past laurel
#

I am dumb and don't know what I'm doing. I'm trying to use a "Meter" to act as a health bar, but I can't seem to edit it in the character sheet. Just the _Template sheet

formal goblet
past laurel
formal goblet
past laurel
formal goblet
bitter spear
#

Hi, sorry, i have created a table with an input number field with component key "Dices". Then i have created a label "button" type and in the label roll message i'm trying to get the code right to make "dices"d20 rolled but i can't get it right.
This is the abomination that i have made
${[:sameRow('Dices'):d20]}$
May i ask how i got it wrong please?

bitter spear
# past laurel And how do I link them up?

You have to set a table, make a input number and set a component key for it
Then create the meter field in the same table and in the "value" box put ${componentkey}$ where componentkey is the one you used before.
Be aware, i'm a noob with no coding experience myself so i hope i don't got it wrong

bitter spear
#

@past laurel if you don't have already looked at it, there is an example module that you can download and use as reference. It is very helpful. In the "Main" tab can see Life points or Stamina points that i think are exactly what you are trying to do.

past laurel
bitter spear
#

No problem, I'm just relaying what the dev suggested me ahahah. I think i'm in the same boat as you.

sinful spade
#

Don't worry guys, me too.
I'm just further down that road. I've been working with csb for like 4 months actively spread over a year or so

bitter spear
sinful spade
#

I'm not home yet but if you want to show me what you're working with in like an hour I can probably get you running.

#

If not cry to martin because he's fixed 90% of my shit code haha

bitter spear
#

lol

#

I have created a table with an input number field with component key "Dices". Then i have created a label "button" type and in the label roll message i'm trying to get "dices"d20 rolled
Those are the abomination that i have tryed so far:
${[:sameRow('Dices'):d20]}$
${Roll:=[(ref(sameRow('Dices'))d20]}$
${[:ref('sameRow('Dices')'):d20]}$
As you can see i'm basically guessing but i don't really know what i'm doing.
If @formal goblet would be so kind to take a look...

sinful spade
#

He's asleep

#

Pretty sure he and link are either in the French timezone or nearby

#

Just by their activity times, I don't actually know

#

Woah you're up late today martin!

bitter spear
#

Oh, ok. I tryed becaue i'm going to sleep too in short time

#

It's late here too but this roll thing is making me crazy

sinful spade
#

I'm actually just off my sleep schedule. It's only 8 here tho

bitter spear
bitter spear
#

It woooorrrkssssss. Thank you very much, now i can go to sleep ๐Ÿ˜…

#

Good night and thank you again to all

sinful spade
sinful spade
fair yoke
#

OK got a macro I am trying to link to, it has a couple of let variables

#

one is a roll name and the other target number

#

%{return await game.macros.getName('Roll').execute ({rollName: 'Reflex', targetNumber: '${REFSV}$'});}%

#

target number should be setup right... not sure how to give it just a bit of text though

#

it runs fine via the /macro command

bitter spear
#

Hello, when a roll of multiple dices is sent to the chat, it shows the total and you can click on it to see the details of each die. There is a way to get directly the detail in the chat without the total?

vocal sorrel
#

Hi, how do I dynamically count the amount of rows inside my dynamic table? Lets say I have a dynamic table the players can add rows to, and there is a separate label above it that counts the total amount of rows of the dynamic table.

dusk bobcat
#

Hey, I have a (probably very dumb) question.
Is it possible to create a global variable for an array ?

For exemple, I would like to create one for this array [-250,-160,-60,-30,-15,0,15,30,45,60,75,120,210,360] because I don't want to write this on each of my formulas.
Thank you !

versed topaz
#

Hey guys, silly question , maybe there is already an answer. Is there a way to get a reference for the whole item when doing an "lookup" search through an item displayer? I am asking because I want to access a property from an item I do not wanna display in my item displayer. Many thanks in advance!

sinful spade
sinful spade
sinful spade
sinful spade
sinful spade
vocal sorrel
dusk bobcat
sinful spade
dusk bobcat
#

Nah, I tried with numbers and comma separated, it doesn't work.
Thank you for your response, I will either use your method or use some JS

sinful spade
#

actually that's true

#

%{}% lets you use JS

#

can you just store the array as a variable in a label?

dusk bobcat
#

that's what I'm wondering

#

because you can't use variables except for Label Roll

#

so, is it possible when using JS ? I don't know, I will try some things ~

hollow crow
#

Hello everybody, trying to setup a simple dynamic table in which i have some spells with a 'roll' column. In the chat roll field of this column i wrote this: ${setPropertyInEntity('target','custom_hp', "target.custom_hp-sameRow('Danno_Inc')")}$ , where 'custom_hp' is the key for Character's Hit Points.
Now, the number field 'Danno_Inc' that is in the Dynamic Spell Table represents the damage dealt by the spell. The problem is that if i put a normal number in that field (e.g. '4') the formula behaves as expected (the target's health bar decreases by that number). But if i put a dice roll in the field 'Danno_Inc' (e.g. 4d4 to simulate Magic Missile) the system doesn't roll any dice, set to zero the target's health and the console output is an error. I tried to write in the number field the dice roll in many forms, with and without simple square brackets ([4d4])=, with and without double square brackets ([[4d4]]), etc. No problem with normal numbers but i can't get setPropertyInEntity formula to decrease target's health ('target.custom.hp') by the result of the dice roll contained in the 'Danno_Inc' number field i've put in my Dynamic Spell Table. Please help!

formal goblet
formal goblet
bitter spear
neat temple
#

Hey everyone, happy holidays, I'm trying to find a way to perform a different checks depending on the characteristic defined in the item. I tried with equalText() and now with switchCase(), but I didn't get great results with either. So I thought I would ask if anyone has experienced this. This is what I have at the moment:

sinful spade
#

in mine have two radio buttons that control which dropdown is referenced in the formula:
the value of the attribute radio is 1 and ability is 2.

'item.rollGroup' == 1 ? doThisRoll : doThisRoll
Since I only have 2 attributes ability can be the else. Otherwise you can do
'item.rollGroup' == 1 ? doThisRoll : ''
'item.rollGroup' == 2 ? doThisRoll : ''
'item.rollGroup' == 3 ? doThisRoll : ''

neat temple
#

I see, thanks

formal goblet
kindred walrus
#

HI! I have a button in an item that I want to increase the player's Belly value by 5. ${setPropertyInEntity('attached','Belly',"attached.Belly+5")}$ *Eats ${Name}$
when I press the button, nothing happens.

${setPropertyInEntity('attached','Belly',12)}$ *Eats ${Name}$
runs and returns "[12] *Eats [Raw Plant]" to the chat, but doesnt change the player's stats

formal goblet
kindred walrus
#

Oh huh
Thank you!

hazy moon
#

Hello everybody, I'm asking for help. I'm trying to find a way to sort every dice I roll in a croissant way and see them all. For exemple: /Roll 4D10 : 8 7 2 1 and not : 18. Thanks ๐Ÿ˜„

bitter spear
bitter spear
#

I noticed one thing, the in chat messages of rolls are different if i roll from an actor sheet or if i use the /r command. Why?

bitter spear
#

@hazy moon i found a module that it do it

icy storm
bitter spear
#

Dice so nice is good but not really protical in my opinion if you need to read the results. When you roll a new one you "lose" the previous one and you need to go in chat to open the message.

hazy moon
#

I found how to sort them in a croissant way but not how o show up in the tchat automaticly

bitter spear
#

foundryvtt-show-me-the-roll is a module that do that in chat

hazy moon
#

Got a link bud?

bitter spear
#

The only problem now is that it works fine if you use the /r commnad or with macro but if i roll form an actor sheet it uses a different format and so it doesn't work

#

Now, why the roll from actor has a different format? And how i bypass that, please?

hazy moon
#

kk thx, I'll try to look into that

icy storm
#

There is a module called Unfold All Rolls that does the same thing but it has the same restrictions, it doesn't work with rolls from actor or item sheets.

bitter spear
#

Thank you

#

@formal goblet so, sorry, basically if i use :: it will use CBS custom formats but if i don't use them it will simply use the Foundry one?

#

Nope, is not that simple.

#

Sorry but i need an example please
This CSB ${[:Dices:d20]}$
In Foundry basic API how is the correct format please?

formal goblet
bitter spear
#

Thank you very much

hazy moon
#

Martin it seems I got a problem ( Ps: I'm not very good at coding). I succeed to make my dice explose and be in a croissant order but still don't manage to show them automaticly. thx in advance

#

With the help of Alabaster there is no more message ERROR but the the dice still won't show in the tchat

formal goblet
#

See if someone from macro-polo knows it

hazy moon
#

okkey thanks

bitter spear
#

I resolved with the module i linked and it's working great.

sinful spade
# bitter spear Thank you very much

Did you add that code? Can you send a screenshot? ๐Ÿ˜ฉ Because if that does what I think it does, and I can sum the results into a total...

bitter spear
#

Sorry, i did not understand what you need

sinful spade
bitter spear
#

I'm trying to get a macro, let say "test3", called from an actor sheet with game.macros.getName('test3').execute() but i can't get it work. I tried with button and label, text and roll message, with and withount send it to chat but nothing.

#

I'm using
%{return await game.macros.getName('test3').execute();}%
What i'm doing wrong? ๐Ÿค”

formal goblet
bitter spear
#

It goes in the "label roll message" of a label right?

bitter spear
#

This one?

formal goblet
bitter spear
#

That strange. I rechecked the macro is there and works fine if executed manually

#

Wait, it's in a macro compendium that i have created, it can be that?

#

If i copy the uid i get Compendium.world.custom-macro.Macro.0NizrlKwib5REURR

low tulip
sinful spade
# bitter spear

well I know what my free time is going to look like ๐Ÿ˜ฎโ€๐Ÿ’จ lol

bitter spear
#

@formal goblet sorry, do you have any idea on what the problem can be? The macro is there ๐Ÿ˜”

sinful spade
#

Hey @formal goblet
just a heads up, I have a roll function that was working just fine last time I was working on the character sheet- no changes have been made, but suddenly the rolls stopped working and were outputting a string error related to d6.
I cut out some code from one of the 6 areas the same code was pasted to test if that section was the error and reloaded the sheet and all of the rolls including the 5 that were the same uncut code, work.

I think there's an issue somehow with when a server (maybe just Node JS) launches for the first time and how CSB reads some formula.

I'm going to shut it down and reload it to see what happens.

#

-ope he's getting pinged today haha

#

restarted the server - no error.

but the server launches so much faster after it's been launched the first time. Potentially a background process. Will restart pc.

sinful spade
bitter spear
#

Uhm

  1. i checked the name more than once and tried other macros with same result
  2. how you do that, sorry?
  3. i'm gamemaster on a local installation so i think i have all the permission
bitter spear
#

Ahhh so i need to get the pack first and then get the macro

formal goblet
ashen turtle
#

getting an unusual error: sameRow fails to pick up a value when it's default. throws

Error: Uncomputable token "sameRow('Obr_base')". Failed to obtain value from the same row in the column "Obr_base". Make sure, that the column-key is correct.
the same code works perfectly fine when I input the same value manually. if it matters, the default value is derived from a different property. any workarounds?

formal goblet
sinful spade
#

It will never not impress me how you can understand what some people are having issues with. ๐Ÿคฃ I read the issues people are having and more than half the time I'm like โ“ ๐Ÿ˜ฉ I have so many follow up questions

formal goblet
ashen turtle
#

this is when I haven't defined any values manually

formal goblet
#

Well, Obr_base isn't there

ashen turtle
#
โ€‹โ€‹
"$deleted": false
โ€‹โ€‹
Atk: "Bonus_Silny"
โ€‹โ€‹
Nazwa: ""
โ€‹โ€‹
Obr_base: "7"
โ€‹โ€‹
Obr_calc: ""
โ€‹โ€‹
Obr_formula: ""
โ€‹โ€‹
Rzut: ""
โ€‹โ€‹
Uwagi: ""```
#

and this is when I put in any other value manually

#

Obr_base displays as "7" on the sheet in either case but only when I "touch" the table in the interface do the other columns show up in the code

sinful spade
#

I left my pc off for ~20 minutes and relaunched the server. The bug failed to replicate.
I'm unsure of what is causing it but I'll let you know if it reoccurs. ๐Ÿค”

formal goblet
ashen turtle
#

yes, the one I originally posted shows up when I try to interact with stuff in the table before manually changing things in it

#

so it seems like the default values only initialize (if that's the right word) when the table gets modified by hand and before that they're undefined

#

it's not a huge deal as I now know how to work around it but probably a bug?

formal goblet
sinful spade
bitter spear
#

@sinful spade well, at least you understand half of it. I'm reading guides that are meant to be used by newbie and i'm feeling dumber every sentences i read because i get the sense but i don't get how put things together...

sinful spade
bitter spear
#

Now, i got that you can use uuid to get an element directly but i don't get how to use that info to execute a macro from it's UUID...

sinful spade
#

Can you just use that?

formal goblet
bitter spear
#

Nope, because i'm calling the macro from the actor sheet

sinful spade
#

or martin does it in one line haha

bitter spear
formal goblet
sinful spade
bitter spear
#

It' would be
${(await fromUuid("Compendium.world.custom-macro.Macro.hm7r0eE5gwKdlyWi")).execute()}$
in a "label" in the "label roll message" field right?

sinful spade
bitter spear
hollow crow
bitter spear
#

I get this error so i don't get what is wrong

sinful spade
#

๐Ÿ‘€ the hell haha

#

You did the %{}% as well right?

bitter spear
#

yes

#

i tried to add return too at the beginning like in the documentation

sinful spade
#

i only asked about the %{}% because in your message you said ${}$
${(await fromUuid("Compendium.world.custom-macro.Macro.hm7r0eE5gwKdlyWi")).execute()}$

#

the % denotes regular JS while $ is CSB

bitter spear
#

Ah sorry i got it wrong wait, i try

#

Yessss thank you very much

harsh cradle
#

Sp

#

So*

#

how does it wrok

#

is there any guides that i might read?

gaunt valley
#

Hello Again! sweaty
I'm trying to add a condition to this item, to add +1 to the "IniciativaBase", but it would only be if the item's checkbox was checked, otherwise it would add 0 for example, how can I add a conditional, like this (python logic haha)

if Ativado:
IniciativaBase += 1
else:
IniciativaBase += 0

sinful spade
# harsh cradle how does it wrok

here scroll down past the intro for a bulk of the info. There're more hidden in the wiki;
and finally there's a youtube tutorial series, but it's pretty outdated here

||just kidding, here's the actual link: here, you don't think I'll do it twice in a row do you?||

sinful spade
#

lmfao. ^^ click the link and find out

sinful spade
#

Check the spelling of the values btw, i used what your message sent not what your image was ^^

gaunt valley
#

It worked!!!, tyy dealwithitparrot

bitter spear
#

From an actor sheet i call a macro trying to use values from the sheet

const roll = await Roll.create(`${Dices}$d20cs<=${Attribute_Selection_Value + Skill_Selection_Value}$`).evaluate();
const successes = roll.dice[0].results.reduce((acc,e)=>{
  if(e.success) acc += 1;
  if(e.result <= Skill_Selection_Value) acc += 1;
  return acc;
},0);
roll._total = successes;
await roll.toMessage();
#

What i'm doing wrong?

sinful spade
#

I added a text field to an item container, but text storage isn't persistent. Anyone know a better way, or how to add storage to it?

#

the code creating it is just:
<input type="text" style="width:250px;">
the regularly created labels also seem to have id="Actor.ID" and name="SomeDir"? I'm at a loss how to recreate those

bitter spear
#

I'm really confused...
If in a "Label" component in the "Label roll message" i use this

%{new Roll('${Dices}$d20').toMessage();}%

it works fine.

If in the same component i use this instead

%{(await fromUuid("Compendium.world.custom-macro.Macro.glBVCukj47SUajVn")).execute();}%

calling this

new Roll('5d20').toMessage();

it works fine

If in the same component i use this instead

%{(await fromUuid("Compendium.world.custom-macro.Macro.glBVCukj47SUajVn")).execute();}%

calling this

new Roll('${Dices}$d20').toMessage();

it doesn't work.
What i'm missing?

honest zealot
#

Heya! Possibly a weird one here. Is there a safe way to transfer a compendium/module of items to another CSB game that has the same templates?

Everything works perfectly fine on my friend's world which has the same templates, except when dragging items into character sheets, it nukes them from the with the error Item template has been deleted for item Brick on a Rope {actor id nonsense} used in Character {more actor id nonsense}

bitter spear
#

Have you tried with the "adventure" function?

honest zealot
#

I transferred them over using an adventure compendium yeah ^^'

livid temple
#

Hello, sorry to bother you but I would like to know if it is possible to add an element of all the objects in my list of objects

honest zealot
hollow crow
#

Mmmmm, got another a problem here. I have a macro that manages multiple targets damage (think of a fireball). The macro works perfectly per se, but i need to send to the macro a value in the character's sheet defined in this way in the Label Roll Message: ${Danno:=[:sameRow('Danno_Inc'):]}$ ------> refers to a dice roll inserted by the player in a dynamic table (e.g. 4d4)
% {return await game.macros.getName('MacroDanniMultipli').execute({damageFormula: '${Danno}$'})}%--------> this should send the dice roll to the macro setting 'Danno' as 'damageFormula' '****************************************************************************const args = arguments[0] || {};
const damageFormula = args.damageFormula ****************************************************************************These are the two lines of the macro that should receive the damage value the macro should consider. Obviously something went wrong because the macro won't read the correct value and considers it as undefined. I think there is some syntax error in the game.macros.getName formula, peraphs the last part .execute({damageFormula: '${Danno}$'}). Any suggestions?

ashen turtle
#

on what might be a related note (?), is there a way to delay the execution of a "%{}%" script inside a roll message until after a user input has resolved? so that it can make use of values from the input

bitter spear
# ashen turtle on what might be a related note (?), is there a way to delay the execution of a ...

I don't know if is what you need but you can call a macro with a button and i use this

const dice = await foundry.applications.api.DialogV2.prompt({
  window: {title: "Roll Dice"},
  position: {width: 400},
  content: "<input type='number' step='1' min='1' max='10' placeholder='3' name='dice' autofocus>",
  ok: {callback: (event, button) => button.form.elements.dice.valueAsNumber || 3},
});
if (!dice) return;
Roll.create(`${dice}d6`).toMessage();
sinful spade
#

the chaos ensues when martin is gone

ashen turtle
#

I was hoping to avoid messing with manual dialogs tbh

bitter spear
sinful spade
#

kj,
can you just not prompt for the input?

#
?{<varName>[:<varType>][|<choice1>[:<display 1>]|<choice2>[:<display 2>]|<choice3>[:<display 3>]|...]}```

I have a prompt that asks for any bonus modifiers then rolls the dice and adds the mods to the result.
#

gah dam thoth going ham on the chat over there

civic carbon
#

i have items which have full descriptions of spells and such (img 1) and was wondering if it's possible to display all those features in a separate tab inside my Actor's sheet (img 2) that lets me send the feature to chat (a label roll message ${!feature2}$ works perfectly from within the item) and without needing to display each individual feature, feature name, etc. in an Item Displayer since that would get very crowded.

i've tried variations of ref(), ${Class.item.feature2}$, ${item.feature2}$, etc. but none seem to work

each row would be a separate panel too with visibility limited to only show up if the item hasFeature1, hasFeature2, hasFeature3, etc., I assume that solution is adjacent?

civic carbon
sinful spade
#

well.. have you?

civic carbon
#

idk what the equivalent would be in this case but yes i've reloaded actor and item sheets and the whole world for non-related reasons and i've never come back to my errors going away :p

#

unless you count clearing the console so that all the red goes away

sinful spade
#

Heads up before i tell you anything.
I am the technical equivalent of a butter knife trying to hack into a bank vault. Determined but hilariously ineffective.
-- it may work if you don't look at it too hard, say nice things to it, and then close the door and never look inside again.

#

I assume the 'shoot a ball of fire text' is a label?

civic carbon
#

that's basically my whole m.o. for this custom system haha

civic carbon
#

so featureXName would be what I want displayed in the Actor sheet, and featureX would be what I want to send to chat if I press the message icon from the Actor sheet

sinful spade
#

I know you can output a label or text area into the item contianer - martin's mentioned a cleaner syntax but I use
${ref('item.itemKey')}$
I don't think the ref() is necessary but I use it to remind me of what's going on when i go back when it inevitablly breaks

#

point being it should would work a rich area

#

as for sending to chat,
you do the same thing in the label roll message

civic carbon
#

I'll try it again to see what the output is but I think that would run into an issue since in theory I'd have multiple items (for Class, Subclass, etc.) with the same keys

sinful spade
#

???

#

place the code in an item container

#

o3o

civic carbon
#

oh, gotcha

sinful spade
#

where else were you trying to build that?

#

and.. how?

civic carbon
#

The thing is if I put it all in an item container they will get really cluttered

#

so i want to reference the item directly from a label in the actor sheet

sinful spade
#

'-' lemme ask this
would you then not need a new label for each item you want to reference - thus having x2 the content - 1 item and 1 related button? How would that be any less cluttered?

civic carbon
#

so img 1 is a example item on the shorter side. img 2 is how I'd format the Item Displayer to display everything. img 3 is the result, error bc no feature 3. I can obviously remove the featureX columns like img 4 but then I don't think I'd have the option to send the feature to chat as a message

#

wrong img 4 :p

sinful spade
#

First question is how many features does each spell have? Max 2?

civic carbon
#

Max 3

sinful spade
#

Okay and what is wizard and foundation conveying?

civic carbon
#

Wizard is the name of the item
Foundation is if the item is a Subclass, it would have a different tier. It shouldn't show up there since Wizard is a Class but I'll get to that later. The solution is probably splitting the Class Item Displayer and the Subclass Item Displayer but then the Subclass Item Displayer would be the one with a tier displayed

sinful spade
#

Hmm.. alright with wizard being the item name that makes it a little harder to style.

But at least for the features I'd use three labels within the item displayed and use code like this

<div style="overflow: scroll; max-width: 300px; max-height: 50px"><H1>${ref('feature1namekey'}$</H1><div class="classname">${ref('feature1key')}$</div></div>

#

That should set up a smallish box with a scroll bar displaying both the feature name and content and be easy to style

civic carbon
#

I'll play around with that, thanks

sinful spade
#

Also beware typos in that code lol, I'm on mobile rn ๐Ÿ˜ฉ๐Ÿคฃ

civic carbon
#

It also seems like I can set a visibility formula and it becomes hidden in the Item Displayer and does show up on a label in the actor sheet, but then I have an empty column ๐Ÿค”

sinful spade
#

I already see one missing ; haha

sinful spade
civic carbon
#

I assume there's no way to actually hide the column outside of getting into the CSS, right?

#

Maybe i could leave the columns unlabeled

#

I'll see which option looks best, thanks :))

sinful spade
#

I don't have mine labeled for that exact reason.

civic carbon
#

fair, idt custom css is in my plans anytime soon anyway

sinful spade
#

Lol it will be.

civic carbon
#

I'm putting that off until the last possible moment

sinful spade
#

I haven't don't any JS, I refuse. It's defeated me too many times in the past

#

But css is fairly easy and makes a massive difference quickly

civic carbon
#

That's true

sinful spade
civic carbon
#

Definitely something I'll consider at some point, same for getting more into JS, but by the point I'm comfortable with it I'll probably want to make the system from scratch. CSS I can probably add in with CSB sooner

civic carbon
# sinful spade

Yeah that's sort of what I'll aim at when I get into styling

sinful spade
#

Oh hah yeah I'm good on writing the baseline system. ๐Ÿคฃ I'm gonna have my hands full making items and macros for the foreseeable future

formal goblet
formal goblet
formal goblet
bitter spear
#

Martin is back to bring order in this cursed land ๐Ÿ˜‚

formal goblet
sinful spade
#

Praise be martin, my best wasn't good enough ๐Ÿคฃ

bitter spear
# formal goblet Execution context is the keyword here. Macros are written in pure Javascript, yo...

Ah, ok.
~~I actually tried to do this in a button from an actor sheet

%{const roll = await Roll.create(`${Dices}$d20cs<=12`).evaluate();
const successes = roll.dice[0].results.reduce((acc,e)=>{
  if(e.success) acc += 1;
  if(e.result <= 6) acc += 1;
  return acc;
},0);
roll._total = successes;
await roll.toMessage();}%

It rolls the dices but ignores completly the success count part~~

It was a module problem, sorry.

bitter spear
#

In an item you can set a field as "Item Displayer" inside a table or dynamic table but trying to add other items is not working, when you try to add another item in to that, it doesn't appear. What i'm doing wrong?๐Ÿค”

sinful spade
minor pollen
#

I'm trying to create a macro that finds all the tokens in the active scene and changes the value in one number field by referencing the value in another number field within a dynamic table. My very limited coding knowledge is essentially useless in figuring out where to even begin. It took me 4 hours to figure out where in the data structure to even locate and console.log() the value I want to reference ๐Ÿ˜– I'm not even sure I got the right one for making a macro

#

I also need one that'll just do selected tokens

bitter spear
minor pollen
# bitter spear Do you downloaded the example module? It can be helpful, i did my game sheet usi...

I've only gotten as far as I have thanks to the example sheets, but since I need to write a custom script for a macro outside of the character sheets, I don't know where to begin. I can correctly console.log() the number I'm trying to reference, but that's as much as I know to do. Need a button that does a specific thing to a bunch of tokens at once, but since I don't understand the API documentation, I don't know what functions do what, or how to point to the right data, or how to even find any of this information. I see stuff like async/await in other people's scripts, but I have no idea what that means or if I need to implement it hereโ€”why or why not.

dense pine
#

Guys i need your help: I made some changes in an item template and reloaded all corresponding items.
Items that are already inside my actors arent reloaded automatically. I would have to do this manually and that would take me hours.
Is there a better way to automate this step? Can i create a Button with a label roll message that executes a script that reloads all items inside my current actor or something like that?
That would save me a lot of time. Thanks in advance!!!

bitter spear
#

Disclaimer: i don't know much about coding so i can't be of much help but for what i have understood sync means that the code is executed in order, so every task wait for the one before to be completed and then execute. Is linear in sequence. Async means that tasks can be executed at same time, so in parallel. What you usually want is the linear, much easier to manage.
About the "await" for what i have understood is the async thing, so the task know to wait for the one before to be completed.
Now, this will help in the immediate to code? I don't think so, but it's what i got for now ๐Ÿ˜“

#

I'm still in the actor sheet phase, so i did not start to wrestle with the tokens, yet.

minor pollen
#

No idea why this works
const thisActor = game.actors.getName("Actor"); console.log(thisActor.toObject());

but this doesn't:
const theseActors = canvas.tokens.controlled; console.log(theseActors.toObject());

bitter spear
icy storm
#

Every time I drag an item from my compendium I get something like this. It is no longer deleting the item from the character sheet but the pop up is annoying.
Logger.js:33 Custom System Builder | Item template has been deleted for item Longsword - Actor.UtEWQdEmhDMxXkN3.Item.VdXruWmJQzj06YfL used in Test 1 - Actor.UtEWQdEmhDMxXkN3 foundry.js:72076 Item template has been deleted for item Longsword - Actor.UtEWQdEmhDMxXkN3.Item.VdXruWmJQzj06YfL used in Test 1 - Actor.UtEWQdEmhDMxXkN3

formal goblet
formal goblet
formal goblet
formal goblet
bitter spear
#

Hi @formal goblet sorry but i tried to create an "item displayer" in a table in an Item template. But even if i select the correct type in the filters, when i try to add an item to another one, nothing appears. What i'm missing?
What i'm trying to do is to create a set of "Qualities" and add them to weapons, armor and the likes, without recreate them every time i create a new item but simply add them from the existing ones.

low tulip
#

has anyone managed a template button on an item's chat message?

formal goblet
bitter spear
#

4.2.0

formal goblet
bitter spear
#

Ah, ok

low tulip
formal goblet
low tulip
#

like you'd specify on the item that it has a template, what kind (circle, cone, square, line) and what size the template is, and then when you use the ability, a button in the chat message pops up with a "Place 20ft Circle" button that calls drawMeasuredTemplate with the args from the item properties

formal goblet
bitter spear
#

Sorry, where i can find the formula for the calculation of total weight of items in a container in the inventory, please? Found it.

livid temple
#

I have a problem, I would like the Meter to show me the addition of all the numbers and not one after the other like here (I am in 4.1.1)

vocal sorrel
bitter spear
#

There is a way to sum the values in the same column of a table dinamically, please?

dense pine
#

Struggeling with a User input in a label roll message:

#

What is the error please? I dont get it

#

The original roll message is much longer, but after i noticed the error message i reduced it to the part that causes the error

broken pumice
broken pumice
bitter spear
#

The console is screaming but i'm deaf

broken pumice
#

What version of CSB do you use ?

bitter spear
#

4.2.0

broken pumice
#

Can you show your formula ? Because with only the error message it's hard to tell. It seems like lookup() is not recognised, but I cannot tell why

bitter spear
#

Sorry, sure

${sum(lookup('TabTest', 'Colt'))}$
#

is just a counter to try in a dinamyc table with only 1 column of number input field

#

Ok, that's strange. I changed a value in the table and now it works

#

Adding rows with only default value don't make it recalculate, maybe?

broken pumice
#

Oh, it probably threw an error because the table was empty and it cannot sum something empty.

bitter spear
#

With values from items in item displayer give an error too ๐Ÿค” nevermind, i can't write, sorry.

dense pine
desert glade
#

Hello! Is there a component or "standard" way to create lookup tables, variables or formulas that are reused across different templates? Something like a mini custom library of values or formulas?

desert glade
#

For example, I'm building out a system for old school Stormbringer. I have a Demon Sheet and a Character Sheet. In each I need to make a calculation of hit points based on CON and then adjusting for SIZ over 12 or under 9. I'm doing that with hidden attributes:
hidden attribute 'siz_over_12' is defined as:
${number_siz > 12 ? number_siz - 12 : 0}$
But, that hidden attribute is defined in one sheet, and I'd like to have it defined somewhere neutral or common so I can reuse it in the other sheet.

fallen sorrel
#

So I'm banging my head against the wall here... completely having no luck with the lookup function. I am trying to perform a lookup on an item displayer keyed as 'ammo' within my actor sheet. I should be able to call ${lookup('ammo',<field>)}$ and have it return an array of <field> data, correct, which would be displayed on the sheet as-is (just for sanity checking/debugging purposes), right? Similarly I could also call ${count(lookup('ammo',<field>))}$ and get the number of discrete objects within the item displayer, right? Or am I completely out of the solar system on this one? I've been working with computers since the late 1980s but just trying to filter through all the cruft to remember half the stuff is exhausting lol!
Can someone help clue me in, please and thank you? ๐Ÿ˜‰

icy storm
formal goblet
desert glade
formal goblet
past laurel
#

Question, I'm working with a label and I'm trying to link my rolling macro to each of the attributes and pass their values in... so what am I doing wrong here?

%{return await game.macros.getName('Test roll').execute({bonus_to_roll: '${att_Heart_Score}$'})}%

"bonus_to_roll" is the const in the marco I'm trying to edit through "att_Heart_Score"

past laurel
#

I am referring to "4.5. Scripts" from the Docs:

sinful spade
low tulip
#
<button onclick="${#%{let templateData = { user: game.user._id, x: canvas.mousePosition.x, y: canvas.mousePosition.y, distance: ${item.template}$, t: '${item.templateType}$' }; let theTemplate = await MeasuredTemplateDocument.create(templateData, {parent: canvas.scene}); return '';}%}$">Place Template</button>

ok so I'm trying to make a button in a roll message to execute a script that creates a template but what I have isn't really working, it just places the template immediately when the chat message is created and then outputs this to the button:

#

is there anything obvious I'm doing wrong here?

formal goblet
formal goblet
wooden pond
#

Is there a way to "pre-fill" an Item Displayer?

i.e. I have a certain Template that is intended to ALWAYS start with a few specific entries.

formal goblet
wooden pond
#

Okay, definitely above my paygrade, then ๐Ÿ˜„

#

Thanks o/

formal goblet
past laurel
formal goblet
dense pine
formal goblet
past laurel
formal goblet
formal goblet
#

What about a console.warn(bonus_to_roll) in the Macro?

dense pine
formal goblet
#

concat() mag es nicht, wenn man zahlen darin verwendet

formal goblet
past laurel
#

Is there something I should be adding to bonus_to_roll when declaring it?

In the marco is:
const bonus_to_roll = 0;
const roll = await new Roll(``4d6cs>2 + d8 + ${bonus_to_roll}``).roll();

formal goblet
#

Btw, why double-backticks in Roll()?

past laurel
#

Oh sorry, trying to format for Discord Lol! It is only one in the macro

#

So am writing this correctly? Both in the macro and Label? It's just not wanting to pass the value over for some reason?

formal goblet
#

You override your 3 with 0 in this line

past laurel
formal goblet
past laurel
#

Now say I wanted to pass two augments in game.macros.getName, how would that look?

formal goblet
past laurel
#

Ah got ya. Thank you!

formal goblet
#

You can create an array of strings and do a forEach-loop

past laurel
#

How do you mean?

#

Basically what I'm trying to do now, is pass my attribute as a flat bonus to the roll, and get [x] value for the number of d6s rolled.

low tulip
# formal goblet This won't work. All event listeners in the HTML will be removed when created. Y...

I tried adding <button id="template"></button> to the roll message and then adding this as a world script:

document.getElementById("template").addEventListener("click", templateFunction)
    
async function templateFunction() {
    let templateData = {
          user: game.user._id,
          x: canvas.mousePosition.x,
          y: canvas.mousePosition.y,
          distance: 10,
          t: "circle"
        }

    let theTemplate = await MeasuredTemplateDocument.create(templateData, {parent: canvas.scene});
}

but the event listener is not being applied to the button, the button doesn't have any functionality at all

#

anything that looks off there?

formal goblet
#

You need something like this here:

Hooks.on('renderChatMessage', async (chatMessage, content, speaker) => {
  content['0']?.getElementsByClassName('world-apply-effect-on-targets')['0'].addEventListener('click', async (ev) => {
    // Whatever you need here
  });
});
low tulip
# formal goblet You need something like this here: ```js Hooks.on('renderChatMessage', async (ch...
Hooks.on('renderChatMessage', async (chatMessage, content, speaker) => {
  document.getElementById('template').addEventListener('click', async () => {
    let templateData = {
          user: game.user._id,
          x: canvas.mousePosition.x,
          y: canvas.mousePosition.y,
          distance: 10,
          t: "circle"
        }

    let theTemplate = await MeasuredTemplateDocument.create(templateData, {parent: canvas.scene});
  });
});

I've tried this but I got the same result, button does nothing

formal goblet
#

You have multiple Chat Messages at the end

low tulip
#

you mean something like what you did here? content['0']?.getElementsByClassName

#

I think I see, hold on

#

yup, that did it! needed elements by class names since getElementsById doesn't exist

#

then just changed id="template" to class="template"

formal goblet
low tulip
low tulip
#

which is done by multiple systems but I have no idea if that's custom functionality or if it's foundry core behaviour

low tulip
low tulip
# formal goblet I can't help with that

oh I did have another question regarding CSB though. If I need to reference ${item.key}$ in the world script, how would I do that? Could I use system.props.componentkey somehow?

formal goblet
low tulip
#

no Idea how I'd do that

wooden pond
#

Likely another simple question I can't quite figure out.

Say I have a character in the game and want to use one of its properties in a non-system function. How could I find out the data path of, say, a property called player_id ?

formal goblet
wooden pond
low tulip
# formal goblet Check this: https://github.com/GamerFlix/foundryvtt-api-guide/blob/main/macro_gu...

the thing is I can't figure out how to get the item from the chat message data per se. I'm trying to create the templates with data from item keys, if the spell has a 20ft radius circle I need that data to be in the spell itself as size: 20, type: "circle" component keys, but I've searched the data of renderChatMessage and I can't really find a reference to the item that the roll message was attached to

fading turret
#

Hello there!
I am in the process of creating an inventory and items to place in this inventory.

ITEM
The item I am creating has a dynamic table with the key beneficios.
It has two columns:

The first column is a dropdown with the key beneficio_armadura.
The second column is a numeric field with the key modificadores_bp.
INVENTORY
In the inventory section, I have an item displayer that includes a column labeled beneficios.

FORMULA
The formula I need should display the list of benefits from the dropdown column alongside the modifier from the numeric field.
It should appear like this (for example):

โ€ข Strength +1
โ€ข Dexterity +3
โ€ข Power -2

thanks in advance for your help!

formal goblet
# low tulip the thing is I can't figure out how to get the item from the chat message data p...

Wait a bit, you're mixing a few terms together.

Items are ... Items like Weapons, Inventory and stuff, that you can drag to Actors. These have system-properties (like Actors), which can be used by Formulas (or Scripts with ...system.props.componentKey)

Chat Messages on the other hand are a different concept. They don't contain the same system properties like Items and Actors, so you have to handle them completely different in that regard.

low tulip
# formal goblet Wait a bit, you're mixing a few terms together. Items are ... Items like Weapo...

So the context is I want players to be able to place measured templates from the spells they cast. The spell item itself needs to hold the template type and size among its keys: ${templateSize}$ and ${templateType}$ for example.

Then the items are in an item displayer on the actor of course, and that item displayer has a roll message to be able to cast the spell, sending a chat message with the spell's to hit, damage, etc... data.

That roll message has a <button> tag which has the added event listener from a world script that spawns a measured template. But I need the world script to know what the spell's radius and form is (cone,ray,circle,rect) which comes from the item.templateType, item.templateSize keys.

formal goblet
#

Save the UUID and get that in the HTML-Element and pass that further to your Macro or whatever you do

low tulip
formal goblet
low tulip
#

oh of course

low tulip
#

Well feel awfully guilty about coming back around on this but I've got Actor.dWusIrzf0UIwQLb1.Item.gWzNTyTpytnm5SVx stored as data-item-key but I've looked in the api until my head started to hurt and I just can't figure out what to do with it.
End result obviously is that I need to make a variable out of the id
let item = ??? ("data-item-key") somewhere in there
but I just have no idea where to even start

#

documentation on the data- attribute hasn't really helped at all

formal goblet
# low tulip Well feel awfully guilty about coming back around on this but I've got `Actor.dW...
MDN Web Docs

HTML is designed with extensibility in mind for data that should be associated with a particular element but need not have any defined meaning. data-* attributes allow us to store extra information on standard, semantic HTML elements without other hacks such as non-standard attributes, or extra properties on DOM.

GitHub

Hosting short guides to get started with FoundryVTT's API - GamerFlix/foundryvtt-api-guide

low tulip
past laurel
formal goblet
#

If your question is about the execute()-function, then it should be this way: ...execute({arg1: 'hello', arg2: 'world'})

past laurel
formal goblet
formal goblet
#

Or your passed value is undefined

#

CSB Formula syntax is ${...}$, not ${...}

past laurel
#

Thank God it works! Thank you @formal goblet for putting up with my dumbass

heavy elm
#

Good Morning Europe, maybe this question is trivia but I cant figure out by myself: How can I add a custom font? I already found it in core but I dont know how to add it in CSB

low tulip
#

You could also do:

:root {
--font-primary: "yourFont";
}

to change all cases of that primary font being used to your custom font. Of course the font needs to be a filepath to where the font is within the foundry data folder "fonts/yourFont.TTF" for example

#

maybe it needs to be url("fonts/yourFont.TTF") actually

wooden pond
#

Perhaps another simple one from me. I have someone who will write me a more complex script macro for a combat resolution that has some interesting niggles and wiggles.

To do so, I need to call the macro and give it a list of arguments, say attacks, accuracy, damage and ap.

In turn the macro will return me an array of data I then want to read in a formula (if possible).

So basically... a roll formula on a template button calls the script and executes it, gives it the arguments I mentioned before.

As output it should return hits, damage and final_accuracy_rating

The actual questions:

  1. How do I call and feed the macro the data I want as input.

  2. How do I take the return array and get the right data? For example, get hits back from the macro and input it into a variable called output_data_hits for later use?

formal goblet
wooden pond
#

Vielen Dank!

heavy elm
low tulip
low tulip
# heavy elm For the start in Labels

then you add it in a css file. Either make a text document, rename it to .css filetype, and put it in the foundry data folder somewhere, then point to that file in the CSB system settings, or you just use the Custom CSS module. Then all of your custom stylings need to go in that css file / custom css window in the css markup format.
https://www.w3schools.com/Css/

#

if you want it in a specifc label you can use the component key of that label as your class:

.myLabel {
  font-family: url("fonts/yourFont.TTF")
}
#

or if you want to change more at a time you can inspect elements in F12 console (for chrome browser) and look at their styling to see where they get it from. Many text elements in foundry use var(--font-primary) and can be changed with

:root {
--font-primary: url("fonts/yourFont.TTF")
}
#

or this for example:

body {
    --font-body: "Signika", "Palatino Linotype", sans-serif;
    --font-awesome: "Font Awesome 6 Pro";
    --font-awesome-duotone: "Font Awesome 6 Duotone";
    --font-monospace: monospace;
    --font-blockquote: "Signika", "Palatino Linotype", sans-serif;
    --font-h1: "Modesto Condensed", serif;
    --font-h2: "Amiri", serif;
    --font-h3: "Signika", "Palatino Linotype", sans-serif;
    --font-h4: "Amiri", serif;
    --font-h5: "Signika", "Palatino Linotype", sans-serif;
    --font-h6: "Modesto Condensed", serif;
}
#

oh and for example you can do:

@font-face {
                font-family: 'myFont';
                src: url('fonts/myFont.ttf') format('truetype');
            }
.myLabel {
  font-family: 'myFont';
}
desert glade
#

After you make some actors, items, etc., how does one package them up to be used in different foundry worlds? Do you make an adventure module? If I wanted to source it out of say gitlab or github, how might I go about that? (I'm currently developing w/CSB using a self hosted instance out of digital ocean - I'm comfortable w/unix, setting up and maintaining various things, etc.)

formal goblet
desert glade
#

Nice, thank you!

#

And thank you for this tool - after a few hours of learning and tinkering, I have a reasonable, totally usable character sheet and some auxiliary sheets and items. I'll be able to use this with just a little bit more work. It's mostly a duplicate of a paper character sheet, but has some bells and whistles like skill and damage rolls.

#

I salute you! ๐Ÿ™‚

formal goblet
#

You should only make sure, that you preserve Document IDs. Otherwise, you'd have to reconfigure some stuff. And Templates should be loaded first into a world

#

CSB doesn't read Templates from Compendiums

desert glade
#

As a programmer myself, mostly back end and infrastructure focused, it's totally obvious that this is a labor of love that started out scratching your own itch, and sharing it with the community is extremely generous. Thank you.

formal goblet
#

At least it's waaaaay more open for modification than 2 years ago, where you couldn't even do calls to the Foundry API from the sheet

mystic badger
#

hey, awesome setup but I am reading through the documentation and I am trying to figure out how to send data from a label call to a custom user input?

#

user clicks roll next to a skill and I need to prompt them to select an attribute to pair for the roll the skill selection should be known based upon what button they press

mystic badger
#

also I tried to download the example module but it wants version 4.3 but the latest version is 4.2

storm stream
#

is is a CSB thing or a general fundry thing?

sinful spade
#

csb is built on math.js

storm stream
#

I am trying to get text instead of numbers though

#

i mean, entries from a dynamic table

minor pollen
#

Is there a way to get Tactical Grid's range finder function to work with CSB items and spells and stuff? Or at least, is there anything like it compatible with CSB? Seems support for ranges has to be hard-coded, unless I'm missing something.

sinful spade
dense bay
#

So, been a while since I asked anything. CSB has been working reasonably well for me. ( Been running a Hyperborea 3E campaign in it ) So much so, that I haven't bothered to move to the now official mod for that system. ๐Ÿ˜‰

Anyway, I've been expanding on my templates, and had a dread thought about possible trouble in the future. I setup a tab for each PC as an XP journal, implemented as a Dynamic Table. Each entry is a log of XP earned, and at the top, I have a label that runs through all the entries and sums them up. So far, so good. works like a charm. But now I'm wondering if this will eventually bite me in the butt. Has anyone had any trouble with large numbers of entries in a DynamicTable? ( like 100s of entries? ) I figure it's probably good to know now, so I can work on a solution before things get busted.

sinful spade
#

note: after its even 1 year old it gets thrown in in the 2024 box and subsequently thrown into a closet to be forgotten about till say 2029. Didgital copies are kept in the same way.

dense bay
sinful spade
sinful spade
wooden pond
#

Is there a way to use something like sameRow on a normal non-dynamic table?

heavy elm
#

May somebody can provide me some Help with the math? I have an value that equals 1 or 2 or 3. Lets call it A. I need an formular/equation that solves to 2 when A is 1, to 4 when A is 2 and to 4 when A is 3. I tried several Things but somehow I cant wrap my head around it. Unfortuneatly I need it in an conditional formular so I cant use that ๐Ÿ˜…

heavy elm
#

Nest?

#

Oh verschachteln

#

Really? Since when is that possible? How can I?

formal goblet
#

a > b ? x : a > c ? y : z

heavy elm
#

Ah yes I know but I need it within a conditional. Like

a > b ? y > z : 0

formal goblet
heavy elm
#

Holymoly! Thats awesome easy!

wooden pond
#

Is there a way to create an array of information within/utilizing the system?

I have a series of "keywords" I want to pass to a script, and I'd prefer to create an array for that ๐Ÿ™‚

bitter spear
#

Maybe it's just me...

heavy elm
#

@formal goblet How to Kofi you?

heavy elm
formal goblet
formal goblet
wooden pond
#

All sourced from one actor

formal goblet
#

Dynamic Tables would also be an option

wooden pond
#

Thank you, I think I can work something with that! ๐Ÿ™

brave trench
#

Ever since the big update to csb and foundry my trusted players are unable to edit items in folders. Is there a setting in CSB that changed? Or is this a Foundry thing, and if so anyone have a clue where to fix it? I can't see any relevant permission settings in the config.

formal goblet
#

Your players should be owner of the Items

sinful spade
#

Btw I have two feature requests if possible ๐Ÿ˜ฉ

One should be very easy.

  • make a csb "companion module" that has all the template actors and example sheets made with those templates in a compendium for testing and viewing. Have a popup on csb world first launch asking users to install it - this may help cutdown on user questions if they have accessible and easy examples.

Two is certainly a small pain (sorry!)

  • add more options for columns in dynamic tables, and item containers (etc), having to improve meters, dropdown, and text storage has been the bain of my existence haha.

Or at least make a callable function that can be placed into the existing labels to create them figuratively anywhere as an "advanced option". Even exactly recreating how the system appears to do it causes errors with the JS functions used on them within the system. ๐Ÿ˜ฅ

formal goblet
sinful spade
formal goblet
sinful spade
#

As to the second point, more options within columns of item containers specifically. When I try to create a new column I can only choose label or meter, I'd love to have access to more stuff like dropdown, text field, etc.

I know Hikanx also was mentioning something along those lines.

My usecase is simply the ability to make quick notes about where stored items are located. Though I could see uses for all sorts of other stuff.

#

I tried calling both <input> and <select> with the appropriate classes and everything but they seem not to trigger the native JS functions, and thus dont save the data even if they match how CSB builds them natively.
Every time it deletes the contents with an AlphaNumeric Error - despite only being simple "111" or "ttt" without the quotes

#

same with the <select> and <option> tags once an item is selected it sets back to blank and the same error occurs

formal goblet
# sinful spade As to the second point, more options within columns of item containers specifica...

The reason only these 2 Components are possible, is because they are computable Components. All other Components (especially the Input Components) are non-computable ones.

Item Displayers work different in terms of persisting data in the Actor (especially the old version, where the container didn't even have own system.props in the Actor). The count of rows is dependent on the amount of Items an Actor has (unlike a Dynamic Table, where the count of rows has no dependency).

#

I don't exactly know if the current version of the Item Displayer still has the restriction or not. It'd need a test

sinful spade
#

I think I follow: effectively there's no way that a non-computable token would be able to modify the item so there wasn't much of a reason to re-make those "elements" for a item container?

*i'm not on the beta if that helps at all v4.2.0 ๐Ÿšฌ *

#

I've considered switching to the beta for the item in item storage. ^^ but am worried things will break lol

formal goblet
#

I'm talking about Item Containers from v.3.0.0 vs. 4.0.0

sinful spade
#

Would making a display component be easier? display a parent component of the same type from the item within the item container -> Potentially even having the option to update its parent within the sheet?

formal goblet
#

@brittle moth do you have more insights on why column Components in Item Displayers are restricted to computable Components only?

sinful spade
#

I've approximated just the display result with a ${ref(item.Key)}$ haha. My original way of doing the location dispaly was exactly that, but having players open an item to change its storage location was a bit non-ui friendly

#

i've cut every corner so far to minimize user-clicks where possible, and to increase useabiltiy.

formal goblet
sinful spade
#

๐Ÿคฃ oh i see you requested that 2 years ago haha

brave trench
#

I'm having an issue. again... lol. This 4.x update changed so much.

anyway, my weapons (items) have different attack options. Example: a sword could have slashing or thrusting damage. These options are on a dynamic table inside the item. How do I get the top option in the dynamic list to show up on the item container? I thought first() was supposed to do this, but it is not. I think its just picking the first option that was ever created. (the funny thing is, CSB 3.X did this perfectly, it always updated the sheet container to show what was first in order on the table)

Or is there just a better way to go about this?

formal goblet
brave trench
formal goblet
bitter spear
#

Hi, sorry, is there a way to get an actor sheet content all bigger by a %, please?

sinful spade
#

martin probably still had it in his clipboard

sinful spade
#

You could install the popout module, and then use your browser's default zoom property

bitter spear
sinful spade
#

Idek the actual class name off hand, you'd need to find that

bitter spear
#

I'm not familiar with css and the module works good so I'll stick with that at least for now. Thank you.

bitter spear
#

Tbh i'm really grateful about all the help i got but it's really time consuming adapt Foundry to a new system. I can't invest to much time on it, i'm still fine tuning my system, developing the first setting and a second is scheduled, plus i still need to write some adventures and i'd like to GM it sooner or later ๐Ÿ˜†

#

Holydays are about to finish i will not have that much time for a while ๐Ÿ˜ญ

bitter spear
#

Sorry, is there a way to move an entire table from a tab to another in an actor sheet?

bitter spear
#

Uhm sorry, maybe i'm not understandig something basic but if i get a table from, let say, "main" and i drag on "magic" nothing happens

formal goblet
bitter spear
#

Oh sorry, i'm an idiot. Thank you very much.

bitter spear
#

Sorry, i have a mixed bag here so i probably making a mess but i don't really know how to make it work

%{const data = await foundry.applications.api.DialogV2.prompt({
  window: {title: "Roll Dice"},
  position: {width: 400},
  content: `
    <div class="form-group">
      <label>Dice:</label>
      <div class="form-fields">
        <input type='number' step='1' min='1' max='10' placeholder='es. 1' name='dice'>
      </div>
    </div>
    <div class="form-group">
      <label>fumble:</label>
      <div class="form-fields">
        <input type='number' step='1' min='1' max='30' placeholder='es. 1' name='fumble' autofocus>
      </div>
    </div>`,
  ok: {callback: (event, button) => new FormDataExtended(button.form).object}
});
if (!data) return;
const roll = await Roll.create(`${data.dice}d20cs<=${Talent_Roll_Total}$`).evaluate();
let failures = 0;
const successes = roll.dice[0].results.reduce((acc,e)=>{
  if (e.success) acc++;
  if (e.result <= ${Skill_Selection_Value}$) acc++;
  if (e.result >= data.fumble) failures++;
  return acc;
},0);
roll._total = successes;
const msg = await roll.toMessage({flavor: `<h1 style="font-size: 20px"><div style="color:green;"><b>Successes: ${successes}</b></div> <div style="color:red;"><b>Failures: ${failures}</b></div></h1>`});
msg._rollExpanded = true;}%

What i'm doing wrong this time, please?

#

In theory it would show a prompt with 2 value to insert (with a default value for each) and then roll the input number of dices and use a value from the actor to check success, another value to count critical success (count double) and the other manual input to count critical failures, giving the 2 totals (success and failures) back in the messagge chat.

#

Using it wit all 4 as manual input works, but when i try to use value from the actor sheet it fails somehow

wooden pond
#

Having a bit of a weird issue with radio buttons.

I have a group of two things set up. They are in the healthType group. One radio button is keyed as key_manpower the other as key_structure.

key_manpower is "checked by default".

Any time I open the sheet of a unit based on the template containing this radio button group... it's got structure activated. Changing it in the sheet gets reset on opening it up again.

Any idea as to the cause here? ๐Ÿ˜

formal goblet
wooden pond
#

I dont think so. Lemme swap the group key name to something unique and see

#

That wasn't it, sadly. Behaves the same after giving it a random unique id

formal goblet
bitter spear
#

I though it can be that one but how do i make it work please?

formal goblet
#
const roll = await Roll.create(data.dice + 'd20cs<=${Talent_Roll_Total}$').evaluate();
...
const msg = await roll.toMessage({flavor: '<h1 style="font-size: 20px"><div style="color:green;"><b>Successes: ' + successes + '</b></div> <div style="color:red;"><b>Failures: ' + failures + '</b></div></h1>'});
#

Othwerwise I need your error message

bitter spear
#

Sorry no, the error is this using your edit

#

The first one is using ${} for data values, the second without those

wooden pond
#

Okay my issue is solved.

#

My dumb <bleep> didnt give a value. Added in value and then checked for equalText. Now it resolves.

bitter spear
#

@formal goblet Otherwise there is a (simple) way to get 2 different

${#?{userInput|2}}$

In the same dialog?

formal goblet
bitter spear
#

It works, thank you very much!

shy osprey
#

I am using wounds as items in my system. Now I would like the wound "item" to have a clickable button or something interactive that would apply a condition to character. What would be the best way to approach this?

hollow crow
#

A little big problem here. In order to use switchCase formula, in the carachter's sheet i've set a simple dropdown (component key Liv_Inc) like this in the picture. Then i have a Label, named Costo PM , and in its label text i wrote this formula: ${switchCase(Liv_Inc, '1', 1, '2',5 ,0)}$. The purpose of this system is that, when i select 1 in the dropdown list, the label Costo PM should assume the 1 value, and when i select 2 in the dropdown list, Costo PM should assume the 5 value. Probably something went wrong, because the Label value is always 0, no matter what i select in the dropdown list. Console says the value is 'uncomputable'. but i don't understand why.... please help!

wooden pond
#

How can I edit the predefined lines in a dynamic table?

formal goblet
wooden pond
#

Ah, okay - thanks!
Might have to do some sorcery then, since I don't want them to be editable by players ๐Ÿ˜…

Dynamic table where the GM enters the data and another one for players to peruse and use the attack function maybe.

formal goblet
wooden pond
#

That would work as well, yeah. Thanks ๐Ÿ™

bitter spear
#

Is there a way to easily "turn on/off" light for a token, please? Or i need a macro to do that?

sinful spade
#

You'll need to edit the jason file

bitter spear
#

Thank you

#

Uhm it works even without editing the json. Sorry, why i need to do that?

sinful spade
#

Ah the first paragraph of the git, if no recognized system is in play it'll use no item and have a self property.

#

Aka your character is radioactive and glowing.

bitter spear
#

ah lol

sinful spade
#

this worked perfectly

heavy elm
#

Hey, its possible to change a label in a dynamic table with an itemmodifier?

sinful spade
#

I don't believe so.
You can change a input component like a number field. Use a hidden one that that then adds to the label?

#

So the displayed label in your field would be

(Original value)+${ref('newValue')}$

formal goblet
heavy elm
formal goblet
#

Except if you modify a Label outside of the table and reference that in your rows

hollow crow
# sinful spade make sure you refresh your sheet. also there's a mising space between '2' and 5.

Thanks for your answer Scyrizu. I followed your suggestion to respect the spaces... and i found that switchCase seems to work as intended in a panel, but not in a dynamic table (in your exemple, if 'test' and 'test1' are in a dynamic table you get always 0, no matter what value you select in the dropdown list). Anyway i post you the image of the Label Costo PM in which i wrote the switchCase formula (respecting the spaces this time, or so i hope...). 'Incantesimi Offensivi' is the dynamic table, Liv_Inc and costo_pm are two of the columns.

formal goblet
hollow crow
#

Got it Martin, but the problem here is that switchCase allows you to set the value dynamically (e.g. a first level spell costs 1 mana point, a second level spell costs 5 mana point... etc.). Using sameRow means i have to insert only one specific value. I can try to create a panel (hiding it to players by permission or visibility settings) in which for every spell level you get the mana point cost. In the 'original' dynamic table, i could use the 'ref' formula (or another suitable formula) to obtain the value i want pointing at it outside the dynamic table (in this case in the invisible panel).

formal goblet
hollow crow
#

Oh, wow.. that seems cool! I could give it i try (probably i'll fail as always) ๐Ÿ˜„ . Thanks! No surprise if i'll be back (and no, i'm not Schwarzenegger).

brittle moth
formal goblet
heavy elm
#

It seems somehow I cant get my Itemmodifier to check for an checkbox in a dynamic table.

${fetchFromActor('attached', "lookup('Languages', 'ReadWrite', 'Name', '6')") == 'true' ? 1 : 0}$

Something is wrong but I cant figure out :/

formal goblet
sinful spade
formal goblet
heavy elm
formal goblet
#

I think there will be a new poll after we've finetuned the Items in Items-feature

formal goblet
heavy elm
#

Further I need a value but I could use an condition for this, right?

formal goblet
#

true == true can be shortened to true

heavy elm
#

Yes, but I need to assign a numeric value if the checkbox is checked and another if its unchecked

formal goblet
#

true ? 1 : 2

heavy elm
#

Ah thats what I meant

formal goblet
#

Replace true with find() and that's it

bleak marsh
#

So... I'm not sure if this is addressed anywhere as I feel like it's an edge case, but the system I'm trying to build here counts Initiative from low to high. Does anyone know how to flip the combat tracker to start from 1 (ascending order)?
(it is not an option in the given Core Combat tracker settings, I checked)

heavy elm
#

And then you get the same effect

bleak marsh
#

yeah, I have considered something like that, as we do have a ceiling for round segments. I can technically do (20 minus the roll result) and let the combat tracker count down, but I was hoping to have it work "naturally"

formal goblet
fading turret
#

Hello there!
I'm trying to get de defense value of an item (armor). The fetchFromActor is returning error and i can't figure it out.
thanks in advance ffor your help

sinful spade
#

'item.componentKey' should be what you want

fading turret
#

I used 'item.componetKey' here and it works. What I've been trying to do is get the value of 'Defesa' (attached to the item) and use it somewhere else

sinful spade
fading turret
#

that's what I'm trying to do. For some reason I cant figure it out

sinful spade
formal goblet
sinful spade
#

Martin ๐Ÿ˜‚ go to bed haha

formal goblet
sinful spade
formal goblet
#

Almost 3

sinful spade
#

๐Ÿคฃ you're not helping your case

covert linden
#

I've created an attack macro that's intended to automatically update the targeted token's currenthp value and subtract the damage, but the player/trusted player role doesn't have permissions to alter said hp.

Here's the specific section of the code,
game.user.targets.first()?.actor.update({'system.props.currenthp' : (game.user.targets.first()?.actor.system.props.currenthp - totalDamage)});

and attached is the error, if any of that helps.

I'm not sure what permissions would needed to be changed to fix this, or if it could be done without allowing players/trusted players access to the sheets themselves, or even if this is a more general issue I should probably have taken elsewhere, but any information on the subject would be helpful!

brittle moth
# sinful spade is the roadmap publicly available? The one roadmap.md is blank

I always forget to update the file ><
In my mind, the main missing features right now are :

  • Mirrored components in Item Containers
  • Ability to create custom active effects / manage the active effects, from CSB itself or by supporting another module doing that
  • Formula refactoring to allow async operations everywhere (for example : rolls)
  • Application V2 full support (scheduled for end v12 as opt in, and v13 as opt out for now)

I don't think I forget anything, but maybe I do ^^

But I guess I'm finally getting to a feature complete CSB! \o/

formal goblet
covert linden
#

Gotcha, fair.

hollow crow
# formal goblet You know that you can combine it? `${switchCase(sameRow('Liv_Inc'), '1', 3, '2',...

No luck with that combo formula to use in the dynamic spell table, Martin. I have also tried converting the 'Liv_Inc' column from dropdown list to number field and using lookup in the 'costo_mp' column, inserting 'Liv_Inc' (now renamed 'Liv_Inc2') as a field filter for another dynamic two-column table, where the first column is the spell level and the second contains the cost in spell points... no way. It is as if the values entered in the 'Liv_Inc' column refuse to be read as numeric values in more complex formulas than just 'ref' (which works by itself, but in this context it does not work e.g. using it to define the lookup filter field pointing to the second dynamic table 'SpellCost'). I finally had to give up and am creating a normal table for spells. This is an acceptable workaround, however I felt it was only fair to let it be known should someone else bump into it.

wooden pond
#

Is the following possible, and if so - how? ๐Ÿ˜ฌ

A dynamic table that starts empty.

Players can pick entries from a dropdown menu and hit a label-button to add a predefined entry from the dropdown to the dynmic table.

formal goblet
wooden pond
#

Thanks o/

wooden pond
#

I am grabbing a bunch of data with a lookup function. Is there an easy way to add them together when they get returned as array?

wooden pond
#

I tried something like it but it didnt work, was perusing the math.js API ๐Ÿ˜…

#

Thanks again Martin, you're a great help. Gonna have to support ya for sure ๐Ÿค˜

formal goblet
brave trench
#

can a visibility formula for tabbed panel look for an item.name to be shown? if so, how?

#

does the find() function work for this?

formal goblet
brave trench
# formal goblet Yeah, it does

find(perkContainer, Name, "Arcane Gift") made the tab dissappear, but having the item with name Arcane Gift on the actor doesn't make it visible. What am I missing?

formal goblet
brave trench
#

Oh, 3 of the arguments are listed as optional so kind of confusing that 4 are required. Could you give an example for how this is to be written out? Examples in the guide go a long way for dummies like me lol.

formal goblet
#

The equivalent for SQL would be SELECT targetColumn FROM extensibleTable WHERE filterColumn = filterValue

sinful spade
formal goblet
hollow crow
sinful spade
near jackal
#

Good afternoon! I'm very new to programming, so I need something very simple. I'm using the Custom System Builder and created an actor for global character resources called "Group." One of the attributes in this sheet is "LUCK." I want to set up a rollable table to roll 1d12 + LUCK. Could someone help me with the formula for this?

formal goblet
sinful spade
sinful spade
#

That's how I handled situational bonuses and damage modifiers

hollow crow
# sinful spade So levels don't require set mana and need to be adjusted real time in gameplay? ...

I have given the setPropertyInEntity instruction (which is in the die roll label at the end of each row), the task of handling the curtailment of spell points. In the 'Label Roll Message' I have in fact inserted several formulas (to set the chat output i need whenever a player cast a spell) and a macro to handle differential damage between different targets depending on whether they pass the saving throw or not. Of course, entrusting the macro also with the task of curtailing magic points would, among other things, allow the cost of spells to be determined dynamically, although my system does not provide for this. I actually wanted something much simpler: making a dynamic table would allow players to add spells they want at will. By entering the level, the spell point cost field would automatically populate with the cost relative to the level, and this value would then serve to setPropertyInEntity to determine how many spell points to scale from the character. The switchCase formula would have served precisely to vary the magic point cost depending on the level entered by the player without bothering with any macros.

sinful spade
near jackal
#

But I don't know how to refer it from the Actor file

brittle moth
sinful spade
formal goblet
#

Yeah, you have way more module support there with Times Up (having Timers for Effects), Status Icon Counter (Stacks), and so on

sinful spade
near jackal
#

Hey guys, how can I set the roll so that it uses the LUCK modifier from the GROUP Actor file?

formal goblet
near jackal
#

But will it understand from which Actor it will take the LUCK modifier? ๐Ÿค”

formal goblet
near jackal
#

I see! Thx

sinful spade
# hollow crow Precisely

I see. I'm handing that with an item container, you can just have a default item mana value that can be changed too

#

In the case of spells I haven't made yet I have a unfilled out spell item with blanks a player can enter in the meantime.

hollow crow
# sinful spade I see. I'm handing that with an item container, you can just have a default item...

It's just about 15-20 days i'm into Foundry and CSB. I'm not very familiar with item containers (except for inventory use, i just finished to set an encumbrance table). I was discussing yesterday with a friend of mine about the 'item' approach to spell compendium. We were wondering if it would be possible manage spell casting relying on the combat tracker instead of the character sheet. Ideas are pretty confused right now, but the purpose should be to make possibile cast spells directly from CT without linking a spell (or a spell compendium) necessarily to the character's sheet. You know, inserting two hundred spells in a sheet it's a sort of PITA, as they say ๐Ÿ˜„

sinful spade
formal goblet
hollow crow
hollow crow
formal goblet
hollow crow
formal goblet
hollow crow
sinful spade
formal goblet
sinful spade
formal goblet
#

Yo community, what type of formula functions do you miss in CSB? I'm currently adding a few new ones, including:

  • fetchFromParent(formula: string, opt?: {fallback?: Primitive, top?: boolean}): Basically like fetchFromActor('attached', ""), but only the next parent in the hierarchy if top == false instead of the top-level parent, which is always the Actor
  • fetchFromId(id: string, formula: string, fallback?: Primitive): Fetches the item based on the ID
  • fallback(value: Primitive, fallback: Primitive): A bit like first(), but instead sets a fallback if value is either undefined or null
  • concat(...values: Primitive[]): An override of the mathjs.concat() to get rid of the nasty overloads for numbers and those custom types
  • alookup(extensibleTableKey: string, targetColumn: string, ...filterArgs: Primitive[]): Like lookup(), but this time with infinite filter criteria if you like
sinful spade
formal goblet
hollow crow
formal goblet
brave trench
formal goblet
hollow crow
formal goblet
brave trench
formal goblet
brave trench
formal goblet
brave trench
formal goblet
brave trench
#

ok well, changing the target column to capital Name now makes the tab disappear but only when the item is loaded, and then reappear when the item is gone. The opposite of what it should do...

Yeah, false removes the tab.

formal goblet
brave trench
formal goblet
hollow crow
# formal goblet I need returns for these 3 cases, otherwise I won't know what exactly you plan t...

I suppose in your example the first case should return 7, the second 0 and the third all three values, but this is not what i was thinking about. The comparison isn't between a value and an array, but between specific values, some belonging to a dynamic table and the others outside of it. Assume you have 'TotWeight' value, which represents the total Weight carried by your character with 18 Strenght. Now you have this encumbrance table, as in picture. As you can see, with 18 Strenght your character could carry until 50.4 Kg without being encumbered. Between 50.5 and 100 Kg the character has medium encumbrance and between 100.5 and 150 has heavy encumbrance. The question the formula should answer is: a character with 18 strenght who carries 120 Kg (value 'TotWeight' outside the dynamic table, e.g. at the bottom of your inventory) has 'Medium' or 'Heavy' encumbrance? So you tell the formula: 1) go to the Encumbrance table and read the 18 Strenght row 2) is TotWeight equal or greater than 50.5 AND lesser than 100.5? 3) If the answer is yes write in Label 'Medium Encumbrance', if the answer is no check if TotWeight is equal or greater than 100.5 4) if the answer is yes write in Label 'Heavy Encumbrance', if the answer is no it means the character doesn't have medium nor heavy encumbrance TotWeight, so in Label you can write 'Not Encumbered'.

formal goblet
#

I'll let find() return null instead when nothing is found. Problem solved

neat temple
#

Hey, someone know if there's a good way to add roll buttons in chat. I want to add the check, damage and critical damage of the attack item in the chat. This is what I have so far, but doesn't work yet

formal goblet
#

You need this in a World Script (or something similar, could be optimized):

const hook = Hooks.on('renderChatMessage', async (chatMessage, content, speaker) => {
    content['0']?.getElementsByClassName('world-apply-effect-on-targets')['0'].addEventListener('click', async (ev) => {
        // Do stuff
    });
});
formal goblet
#

And well, I wouldn't know a proper function implementation for this case. Only multiple find() or a script, which is a bit more efficient

neat temple
hollow crow
formal goblet
#

Nobody will miss that ๐Ÿ˜…

fringe silo
#

so i was wondering how would i roll 3d12 and look for dice 9 or higher and report the amount of successes

fringe silo
#

thank you

#

is there some where i can go to look up basic roll expressions so i dont have to bother yall with basic stuff i have recently moved from sandbox to CSB

fringe silo
#

so i was looking thru this and maybe im missing it but how do i ref different selections from a drop down to grant differnt modifiers based on the entry from the drop down

brave trench
formal goblet
fringe silo
#

nvm i think i found it

formal goblet
fringe silo
#

switchCase(expression: *, case1: *, value1: *, [case2: *, value2: *, ...], [defaultValue: *]): *, so in this string case 1 is the key?

formal goblet
fringe silo
#

switchCase(powrank1, 'npow1', 0, 'ipow1', 1, 'bpow1', 2, 0), this is what im using and i keep getting a value must be numeric error, powrank1 is drop down and the npow1, ipow1,and bpow1 are differnt entry keys

fringe silo
#

so far

#

im dumb i fqired it out i was missing the ${

fringe silo
#

${[:spdscorepc:+:spdrankmodpc:d12cs>=9]}$, so why wouldn't this work. spdscorepc=3 spdrankmod=1, but it only rolling three dice instead of 4

formal goblet
fringe silo
#

its the one with pc