#Custom System Builder

1 messages · Page 42 of 1

sinful spade
#

i dont really understand what you're doing - to be fair i assumed martin had it but it seems he left lol

formal goblet
#

You modify one Label, pull the data from the first Label into a second Label and do whatever you need.

brazen laurel
brazen laurel
sinful spade
#

to be fair there's probably a lot of context im missing

#

im only half paying attention rn

#

getting my ass kicked in elden ring

low tulip
#

so... the header has a specific width here that doesn't take up the entire sheet which is cool. But I just changed my panels there to tables like I did below for the same reasons. but...

#

then it broke the header width

sinful spade
#

😛 bro same solution as always, maxwidth

low tulip
#

hmm

#

might need to put that lowest row in a different table, it's too wide I think

sinful spade
#

that or change the spacing

#

and view it not in GM mode too

brazen laurel
#

Can you check what the value of a drop down list is in a formula?

#

Well a script. Like if X doesnt equal Y then etc.

sinful spade
#

Link showed me how to use switchcase for that

#

i can show you example code

formal goblet
brazen laurel
#

Is this at all possible

#

Because the % is allowing me to use JS correct? Im not being dumb there?

low tulip
#

well I gotta go to sleep anyway, I'll return to this, thanks for all the help y'all!

brazen laurel
#

Unsure what value locationList is returning

formal goblet
brazen laurel
#

There are if statements further down, I had to do some weird checks for how the weight in my system works

formal goblet
#

${locationList}$ will return exactly the same barewords as in a Label. That means you lose the quotes for strings e.g.

#

Which will make the script interpret it as a variable instead of a string

brazen laurel
#

Hmmm.. so how I would ask if those things are equal

#

Im missing something here

formal goblet
brazen laurel
#

You know with a CS degree you figured Id get there

#

This may be an incredibly dumb question but what language is the ${}$ syntax even from

formal goblet
brazen laurel
#

Like custom as in you made it or someone did and you found a niche use here

formal goblet
#
brazen laurel
formal goblet
#

Nope

brazen laurel
#

So you imported this library into the module to allow custom syntax you then wrote guidelines for?

formal goblet
low tulip
#

alright got to something I'm relatively happy with, but god damn is it frustrating to get the spacings to work the way you want to

#

goodnight!

brazen laurel
formal goblet
brazen laurel
#

I wish I was half as knowledgable in understanding all of that

sinful spade
#

lol bird complaining about not understanding stuff with a cs degree

#

imagine how i feel with actually 0 technical background

brazen laurel
#

I honestly have no clue how most people manage any tech without a tech background

#

My current job is helping people in IT and its just.... rough

sinful spade
#

uh frustration and determination

#

and a heafty does of confusion

brazen laurel
#

That sounds about right from what I experience lol

sinful spade
#

i learned everything i know from making minecraft servers for my friends :I i dont understand how anything works. things just sorta work through trial and error lol

#

i still cant code 🤣

brazen laurel
#

Fair enough, thats how it all starts

sinful spade
#

lmao that was over 12 years ago

#

i've tried to learn to code probably 3-4 times in earnest.

#

brain hurty

#

scripting is no issue whatsoever
but syntax... fml

timid marten
#

I don't get how this makes what I sent wrong

timid marten
#

`%{
const namefield2 = ${sameRow('namefield')}$;
const abacus = fromUuidSync(namefield2);

return abacus?.system.props['KG_fixed'] ?? 0;
}%`

this still returns an error

low tulip
#

I've noticed attribute bars aren't editable, is that fixable?

timid marten
formal goblet
#

You forgot quotes around ${}$

low tulip
#

just realized I forgot the ${}$ there

formal goblet
#

Ah yeah, that should do it

low tulip
#

yeah it's editable now, thanks!

#

I have this gold trim around the sheet, what's the easiest way to get it to show up above the ability scores panel?

#

right now the trim is defined together with the background image as such:

.custom-system-actor-content {
     padding: 50px 20px;
     overflow-y: auto;
     overflow-x: hidden;
     background: url("assets/ff14-maps/sheet-foreground.webp"), url('assets/ff14-maps/sheet-background.webp');
     background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment: local, fixed;
}
#

I don't know if it's possible from there or if it's in the wrong place in the html structure for it

fair yoke
#

Hi everyone, i'm looking for some help on CSB (awesome module by the way). I want to have a clickable button inside the chat message, wich would compute a roll and add the result of a previous formula (wich I already had put in a variable).

timid marten
# formal goblet What does `namefield2` return?

can't get logs with this:

`%{
const namefield2 = ${sameRow('namefield')}$;
console.log(namefield2);
const abacus = fromUuidSync(${namefield2}$);

return abacus?.system.props['KG_fixed'] ?? 0;
}%`

#

I think it's undefined

fair yoke
#

But I would like to add my variable to the roll

#

(if it is even possible)

formal goblet
sinful spade
#

Martin o3o
I had a probably stupid question.

When making items, say a ring that gives +5 hp for example. I need to put a number field within the item, and then configure the item modifiers within the "ring" template. This means that 1.) players can modify the number field, and two for each new template I need to manually add the item modifiers? can i not add the modifiers to the sub template and have them auto added to a regular template?

formal goblet
sinful spade
formal goblet
fair yoke
sinful spade
# formal goblet Each Item (not Template) can have its own modifiers

Templates can also have modifiers o3o

really what i'm getting at is I want to create a massive modifiers sub template that has all the possible things that I can modify, have them all set to 0 by default, auto have the item modifiers linked to those number fields, as well as labels that import and display the value of those number fields to the players.

This way every item that has a modifier, instead of writing it in custom - i just drag the modifier subtemplate over -> and change the fields of what i want to modify.

formal goblet
sinful spade
#

ah 😦 that's lame.

low tulip
sinful spade
#

manually adding a number field, label, and item modifier for each stat and each item sounds... 😭

sinful spade
#

that's how we were doing the <BR>s yesterday

low tulip
#

you're right

#

so basically just do an <img> tag as the label text?

formal goblet
sinful spade
#

also it's not convient to display ^^

formal goblet
sinful spade
#

son of a ..

#

😮‍💨 well that fixes a number of issues lol.
I suppose I should also ask if there's a better way to display the modifiers rather than players just opening the item modifier tab

formal goblet
sinful spade
#

I didn't know that was a module, but that looks fantastic.
However that doesn't work for what I'm using most of the items as.

Things like the character's race and class have stat modifiers and what not for example. I haven't even actually got to making magic items yet 🤣

#

Hell, I still don't know how I'm going to make a basic sword yet haha

formal goblet
#

Well, it's up to you what you pick

sinful spade
#

Can I edit player's permission to edit item names as well?

formal goblet
sinful spade
#

I assume the same goes for text fields within the sheet too, eh?

#

my players are adult enough to not use it to cheat.
i just know that they're gonna meme this hard lmfao

#

oh yeah they can change the image too 🤣

formal goblet
sinful spade
#

Not looking to hide information lol. just lock it from modification.

#

I give them approximately 3 sessions to figure out they can do this, and one of them reskins a long sword to be the penetrator from saints row the 3rd.

formal goblet
#

How about a Checkbox, which toggles the visibility between Input Components and Labels?

#

That's what I do for a read-only sheet

sinful spade
#

🤔 youd be conferting rich text areas to label formatting.

#

Eh. honestly like i said, they're mature enough not to cheat.
they're just also immature enough to reskin items to be wild as hell haha.

#

that does bring up though, since they can change item skins, and open the file browers, that's a lot of ability to view all the images i have uploaded and potential spoilers.

formal goblet
#

But don't ask me how

sinful spade
#

i've never heard of such heresy - in 5e they just dont have access to anything that opens the browser so i'm unfamiliar

#

maybe not a per-image basis, but i did find this which disables them being able to change the item's image and thus access to the browser.

#

at least i've spared myself the dildo image 🤣 even if not the name and description ha

formal goblet
#

There was also something in the file browser itself to block certain paths

normal ore
#

Hellooo!

So, I have quite a few to insert into my template sheet. I saw that the Custom System Builder has an API, but I must admit I didn’t quite understand it (my own shortcoming, of course!). I need to perform a bulk insertion, for example, of multiple checkboxes. Does anyone have an example using the API that I can follow?

sinful spade
#

Not sure if this is something that can be truly described as a bug, or just how css works, but if you place a label in a panel that's aligned right, the label floats right (as it should)
but if a number field will only float the text right rather than the container itself. This isn't noticeable when the container is set to auto and takes up all available space - but rather when you set the size to something such as small.

#

mana overflow set to label:
vs numberfield smaller.

sinful spade
#

General question,

But how is everyone handling equipt items and inventory?? I realized what I had wasn't going to work, and 5e's system seems too complicated to make in CSB. 😩

low tulip
#

could you make an item modifier do lookup() on the "Equipped" column of the inventory item displayer table, then make that equipped column a checkbox? Then basically do the item modifier on let's say the armor as "if(checkbox) {}"

formal goblet
sinful spade
sinful spade
low tulip
#

hmm I can't even get item modifiers to work at all 😄

sinful spade
#

i've been playing with them for a bit if you need some help? I can only do always on or off ones currently

formal goblet
#

I have a checkbox with equipped in the Item, that determines, if an Armor is actually equipped or not. If not, you can make it display in the Inventory Displayer instead

sinful spade
#

So are all items in your inventory actually items? and I assume the container just takes all item types that aren't like a race or something?

sinful spade
#

i haven't messed with conditionals within items yet - got any leads on how to make it 1.) have stats apply when equip and 2.) change it to the equipt tab rather than just inventory?

ashen turtle
#

Copying from the readme, you'd want to use na equipped checkbox and use this conditional:

You can add conditions to your formulas using the ternary operator : <condition> ? <value if true> : <value if false>.

You can directly use the key of a checkbox to test it is checked

Example : ${ checkboxKey ? 'Checked' : 'Not checked' }$

#

On another note from a newbie, are radio buttons not supposed to be sticky? I have one on a sheet but whenever I open and close it or change anything else it resets to default.

sinful spade
formal goblet
formal goblet
sinful spade
#

oh sweet!

shy osprey
#

Admitting my computer skillz suck I turn to community to help. I need simple roll button to take a skill value (number) from the same row, ask for skill modifiers and apply them to the skill value, roll d100 and if it is same or under the modified skill it is a success, otherwise a failure.
If you are able to point to a downloadable sheet with similar functions that is also appreciated very much.

formal goblet
robust vessel
#

Heyo! Im new to Foundry and was trying to implement my game system through CSB.
My question is: Is it possible to fetch a checkbox and label component key that are under the current panel?

#

Im trying to automate my character sheet but it is tedious to keep copy and pasting all the time

formal goblet
robust vessel
#

it is because i have a lot of panels with the almost exact code, and i wanted to get the specific for each one

#

example:

#

so, instead of writing the checkXXX and modXXX everytime, i wanted to get it from that panel check and label component keys directly

formal goblet
#

I see what you mean, but meh. I'm sure you could get the children of each panel with the CSB-API, but that's a bit tedious

formal goblet
# robust vessel wdym?

Something along the line like %{entity.componentMap['panelKey'].content...}%. Can't tell the specifics right now, but it should be achievable with JS.

robust vessel
#

could you explain like you are talking to a 5yo? I'm a newbie to coding related stuff

formal goblet
robust vessel
#

i know the basics and a some c#, but anything beyond that is far from my reach

formal goblet
#

Because this functionality is not directly available in normal Formulas, because Panels are not part of the system properties normal Formulas have access to

robust vessel
#

so I would have to look up some JS to implement what I what thinking?

robust vessel
formal goblet
#

The child components should be in the content property, which I think is an Array.

#

But there might still be an issue because of the missing self reference

robust vessel
#

if this were to theoretically work, where would this JS code go, inside the formula as usual?

formal goblet
#

%{}% instead of ${}$. That's it

robust vessel
dense pine
#

would like to create a party actor template to track HP and Wounds of my players. Wounds are created as items in my world. is it even possible to fetch+display items from different actors?

ashen turtle
#

I was about to ask the same question! This would also be useful to invoke assorted centralized tables

formal goblet
ashen turtle
#

Ooh, nice

#

so if I'm doing a quickbuild thing for NPCs I can just have a table of stats for different levels

low tulip
low tulip
#

sure does, thanks

#

this is kind of cursed though

formal goblet
#

Hahahah

#

I actually forgot about that one

brittle moth
#

Good news everyone ! Insert Futurama gif here

**Beta version 4.3.0-rc1 is now available, with the following change : **

Features

  • Added ability to add items to other items

Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta

If you want to switch an existing world to the beta version, you can follow this guide : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Switch-to-Beta

If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new

Enjoy !

brittle moth
#

Spoiler alert : There are no new instructions for this feature, this is supposed to work exactly like adding an item to an actor, so... no changes in the docs

sinful spade
#

so is this so you could say add arrows to a quiver or?

brittle moth
sinful spade
#

oh -shit o3o adventuring packs!

#

that's friggin awesome

#

thanks link 😄

#

(and martin <3)

brittle moth
#

Don't thank me now, thank me after testing it and discovering the bugs that are surely hanging around :p

formal goblet
brittle moth
sinful spade
#

actually i have a weird question

#

i've been ripping appart the 5e charactersheet for how to make certain elements look good

#

and they've used SVG borders around their skills - that's something I'd like to do as well - but how could i inject that html around a dynamic table?

#

a panel cant house html right?

#

a snapshot of what they did:
it's a filigree box tag (that i didn't know existed) with 8 svgs - one for each corner and wall

formal goblet
#

What the actual f is a filigree-box?

sinful spade
#

🤣 i mean a overly decorated box

#

but idk what the tag does

formal goblet
#

That seems to be a custom tag

sinful spade
#

.. that's possible? 😱

brittle moth
#

everything's possible with imagination

sinful spade
#

i mean i understand waht it's doing
i just dont know how to recreate it.

Basically makes 4 corners of SVG images, and 4 walls - the walls stretch as the character sheet scales so you get a consistent decorative border

formal goblet
#

I think the standard allows that, although the use cases for that are... uh... usually for frameworks?

sinful spade
#

the gold border around the skills, tools, and saving throws

brittle moth
brittle moth
formal goblet
#

You can set HTML in CSS? What the hell?

sinful spade
#

i've seen that before, rare usecase

#

wait no i think im mistaken

humble sonnet
#

wonder if it's possible to build an entire website within a stylesheet

sinful spade
#

i've seen css in html 🤣

brittle moth
robust vessel
brittle moth
sinful spade
#

no JS sounds like music to my ears

formal goblet
#

That sounds like a nightmare to me 🤣

sinful spade
#

a large part of why i'm avoiding making items is because i know macros will be after.
i'm terrified. I've never once made a single functioning JS statement lol

#

even copying from online - always broken 😦

sinful spade
#

well I'm officially out of CSS styling I can reasonably do 🤣 I guess it's really time to suck it up

formal goblet
sinful spade
sinful spade
#

i'm cleaning up some of my unused templates after reorganizing how items will be handled - and i accidently deleted one before removing an item that uses it in the character sheet. Now I keep getting warnings about it - how can i delete the item from the character sheet if I can't see it?

formal goblet
sinful spade
#

i ended up having to use a console command 😩

#

had GPT generate it using the wiki - seems to have worked

worthy bolt
#

how could i import item data for the sheet?

So like, if an item gives me 2 Cha and then i have this item Equipped (checkbox), how would it be like?

dense pine
brittle moth
worthy bolt
#

How do i fix the default value is not working?

Everytime i create an new actor it just doesnt get the default value that it should get

formal goblet
low tulip
# sinful spade

that looks great! Looks very well put together and aesthetically pleasing. Here's my work in progress:

sinful spade
low tulip
sinful spade
low tulip
#

yeah that's why I'm doing all of this, I figured no one's gonna make a real foundryvtt system for the system (definitely not an official one seeing as how restrictive squenix is with the license), so I'm doing this instead

low tulip
sinful spade
low tulip
sinful spade
manic crypt
#

Is it possible to have a dropdown in the query for a roll message chatcard? As in, I have: ${#?{Modifier:'Skill Roll Modifier'[number]|0}}$ but I'd like to have a dropdown in the prompt to select a (static elsewhere) key used for determining which attribute would be used for the roll.

prisma anvil
#

This is probably really simple, but if I want to reference a key from an active character sheet in a macro, how do I do that? I managed to get it to work from a token, but I don't want be using tokens

formal goblet
prisma anvil
#

The character/actor sheet that the player clicks the button on to activate the macro.

Basically had to build a dice roller macro as the foundry dice don't support the ruleset I'm using. Now I'm trying to make a version of it that references the character sheet, rather than entering every variable manually

prisma anvil
#

Just to make sure I understand, in the example, the formula will execute the macro, and the macro will recognise "strength" to be whatever the strength key points to on the actor sheet?

formal goblet
#

There's also the entity-object in Scripts, which holds all relevant contextual information (e.g. the current actor)

#

But yeah, these passed arguments become available in the Macro

coarse gale
#

Hi Martin, ich habe auch eine Frage zu einem Würfelwurf als switchCase abhängig von einer Dropdown-Box

#

Das funktionert, aber er rollt immer alle 5 möglichen Würfel

formal goblet
coarse gale
#

Wie kann ich es lösen, dass der immer nur entsprechend der ausgewählten Option (1,2,3) würfelt

#

Also ohne Vorteil - 1 Würfel geworfen, Mit Vorteil 2 Würfel geworfen und den Max

formal goblet
#

Müsstest hier im Verlauf nen Beispiel von mir finden, wie man am besten normal, advantage und disadvantage einfügt.

coarse gale
#

Ok, danke dir

#

Ich such mal

#

Ich denke ich habe es gefunden.

#

${#roll_formula:= concat(string(2 + amount), 'd10', switchCase(style, 'a', 'kh2', 'kl2'))}$
${[:roll_formula:] + str}$

#
${#roll_formula:= concat(string(2 + amount), 'd10', switchCase(style, 'a', 'kh2', 'kl2'))}$
${[:roll_formula:] + str}$
#

Vorher die Formel zusammen stellen?

formal goblet
#

Im Grunde genommen ja

coarse gale
#

Dickes Doppeldanke für die irrsinnig schnelle Reaktion!!!!

coarse gale
#
${#wuerfelanz:= switchCase(wuerfel_option,'1',1,2)}$
${#roll_formula:=concat(anfuehren_wert,'+', string(wuerfelanz), 'd20', switchCase(wuerfel_option, '2', 'kh', '3','kl',''))}$
${[:roll_formula:]}$

Das funktioniert

prisma anvil
coarse gale
#

This meas, that if i want to reuse functions, etc. I need to write macros that i can pass parameters from scripts or formulas?

formal goblet
sinful spade
#

Hey Martin

#

I copied this code right out of the wiki

#

changed the item.ComponentKey to match what i'm using
but when i click the checkbox it just sends 'true' to chat no matter how many times i clicked it.
Console shows a NS_ERROR_UNEXPECTED

formal goblet
sinful spade
#

I do lol but it's probably something simple like that tbh

formal goblet
#

Looks fine. Which version?

sinful spade
#

of csb? 4.2.0

#

Sorry sorry!

#

i fixed it

#

the roll message setPropertyInEntity 'equipped' needed to be the key

#

that's on me lmfao

neat temple
#

Hey, it's my first time using CSB and I'm having a problem (it's probably something silly that I don't know about). I would like to get a cell in the table with the player entering a value in a number field
lookup(${dynamic_pate}$, ${dyn_pate_name}$, ${dyn_pate_value}$, ${pontosdeprestigio}$, '>')

formal goblet
neat temple
#

Ok, thanks

heavy elm
#

Merry Christmas,

is it possible to add an key to a Itemmodifier with a lookupRef? I dont understand why

${fetchFromActor('attached', "lookupRef('Skills', 'Mod', 'Name', CustomKey')")}$

isnt working. Of course the component CustomKey is within the item-sheet.

formal goblet
#

Everything within "" runs in the context of the target-Actor, that's why you have to "bail out" with a sub-Formula to be able to fetch props of the Item instead (or you concat your formula together beforehand)

spark lotus
#

Hi! I'm trying to figure out a good way to build a function within a character sheet that allows a player to enter in a trait value and a hazard level and then percentile dice would be rolled and compared to relevant percentage value from the chart below would be referenced and a success or fail result returned. I know how to have players enter in the values and how roll the dice and output the results. What I could use help with are ideas on how to translate the table into CSB. Anyone have any suggestions? Any ideas would be appreciated.

formal goblet
spark lotus
worthy sand
#

Hi there! I need some help from someone experienced with Custom System Builder.

I’m trying to set up a system where the roll changes based on the number in the "external_score" field. Here's the formula I tried:

${[
{external_score: 0, roll: "2d10kl1"},
{external_score: 1, roll: "2d10kh1"},
{external_score: 2, roll: "3d10kh1"},
{external_score: 3, roll: "4d10kh1"}
].lookup(external_score).roll()}
(ChatGPT helped me with this, but unfortunately, it doesn’t work.)

What I’m aiming for:

  • If the external_score is 0, it should roll 2d10kl1 (two dice, keep the lowest).
  • If the score is 1, it should roll 2d10kh1 (two dice, keep the highest).
  • For score 2, roll 3d10kh1 (three dice, keep the highest).
  • For score 3, roll 4d10kh1 (four dice, keep the highest).
    :external_score:
    This is the component key for the number field.

If anyone has suggestions or has tackled something similar, I’d greatly appreciate your input. I’ll make sure to update this post if I find a solution. Thanks in advance!

formal goblet
#

ChatGPT can't really help without context btw, because this is not written in Javascript

worthy sand
formal goblet
#

Ah yeah, slight mistake

sick cedar
#

Hello! I have a question about the Item displayers.

For context: I have created a section in the character sheets where the players can add the weapons they will use with an Item displayer. The thing is, only one of those weapons can be in use at any time, so only the selected weapon will apply the item modifiers to the character sheet while all the others are ignored.

Is it possible to add a check to the item displayer or any other way to achieve this result?

Thanks in advance!

formal goblet
sick cedar
#

Ah, sweet! So it was actually easier than expected. Thanks!

low tulip
#

Guys I have a problem, I don't know what to put in the big blank space in the centre

low tulip
#

just a picture of a chocobo looking right at the camera, judging you

#

I settled on expanding the hp mana space

low tulip
#

Question, can you specify a specific type of sheet in your css? I'm trying to edit the profile picture of the character sheet but the image in the item sheets has the exact same path. Can I specify only actor sheets or only item sheets somehow?

#

or maybe use the template used as a class?

vocal sorrel
#

You could potentially just check if the sheet has certain classes in it.
.character {...} - if you want it to be all character sheet.
.character:has(.specific-class) {...} - if you want to select a character sheet that has this class.
I even have a special field on my character sheet that gives the sheet a "type". Its a label that is defined by a text-field, so the only thing I need to do is write:
.character:has(.Type_Selector [value="1"]) {...} - it will limit it to the one I have this type in.

#

Its a really jank way, but it works.

low tulip
#

good shout that worked

low tulip
vocal sorrel
#

Agreed. But without CSS my sheet looks like spaghetti.

#

If you are using the ".character:has(.specific-class)" method, I recommend taking a look into CSS Nesting, if you don't already know what that is.

low tulip
#

can you add an image tag into the label content of a dropdown somehow?

heavy elm
#

Is it possible to use formulars with conditions in itemmodifiers formular? Like:

${fetchFromActor('attached', "LP_Mod") > 1 ? 2 : 0}$

#

Because this doesnt work for me and I cant figure out why.

heavy elm
#

nvm I just figured out that my values are smaller than 0 and thats why they didnt work 😅

robust vessel
#

how can i change a meter color?

static cargo
#

My tokens won't use this for their hp meter bar. It's available to select, but doesn't even show zeros. Is it because both values are contained in Labels?

formal goblet
formal goblet
static cargo
#

So, there 'should' be a non-manual bar above this token then?

static cargo
#

What about the fact that both labels' values are calculations could that be causing issues?

#

AbsCurHP(Label) = hpCur + hpTemp - hpIncurable; hpMax = hpNormMax + hpTemp;

formal goblet
static cargo
runic condor
#

Hey Guys! Its been a bit since I've used CSB and I need a refresher on how I'd make a dropdown attribute skill selector.

"${ClassSkillName}$ Test: ${[2D6]+AttributeSTR}$" is what I have now, but I want a dropdown to change "AttributeSTR" to whichever attribute I have selected in the key "ClassSkillStat"

I know you can do conditionals but I cant remember how they work or where they are in the documentation.

static cargo
#

As far as conditional things goes, I believe this works:

... (LogicalTest?ValueIfTrue:ValueIfFalse) ...
runic condor
#

If it was a dropdown with 4 options what would that look like?

#

I tried this and it wasnt working (ClassSkillStat ? "DEX" : "AttributeDEX" , "STR" : "AttributeSTR" , etc...)

static cargo
#

Theorhetically.... (ClassSkillStat == "DEX" ? AttributeDEX : (ClassSkillStat == "STR" ? AttributeSTR : (ClassSkillStat = "next" ? AttributeNext : AttributeLast)))

#

Don't loose count of your closing parentheses at the end...

#

If there's ever only the four options you can save yourself a logical test for Last.

runic condor
#

Yea this a simple game Im prototyping, its only got 4 Attributes

runic condor
#

Wound up finding a simpler solution: ${ClassSkillName}$ Test: ${[2D6]+${concat("Attribute",ClassSkillStat)}$}$

grim vector
#

I tried debug drawing and it kept creating drawings with no Points. How can I delete them? And how do I properly debug draw in an area to make sure the points I have are correct?

grim vector
#

Ah, there's a delete drawings button lol, so that's one problem down

grim vector
#

Now I'm trying to access the "#fixedPoints" I don't want to change them, I just want to use them as reference for other shapes, but because they're private, code can't even see them- unless there's a method I can't find (I've been looking for the past half hour)

#

Unless there's a cleaner way, gonna have to make my own class with the shape in it, huh? This'll be a fun learning experience

formal goblet
sick cedar
#

Can someone offer some insight regarding a weird situation I´ve encountered?

I have the following code inside a "Label roll message"
${round(pc_totalmagicpower*item.item_damage*damageModifier)}$ ${#currentMana:=pc_mana-item.item_manause}$ Mana left: ${setPropertyInEntity('self', 'pc_mana', "currentMana")}$ ${#setPropertyInEntity('item', 'item_usesleft', "item.item_usesleft-1")}$

Essentially, this casts a spell from an Item displayer subtracting some mana from the character and reducing the spell uses left by 1. This works as expected.

However, originally I had the statements reversed, meaning that I first reduced the spell uses and then subtracted the mana and after using it sometimes it didn´t subtract the mana. Any idea why that happened so I can have it in mind in the future?

sick cedar
#

Welp, in the end it was that I didn´t link the sheet to the token facepalmpicard Mystery solved.

low tulip
#

How are y'all going about making abilities and spells that can be used to deal damage etc... ?

mighty shard
#

is anyone else having issues trying to roll in the example character sheet? I try to roll the dice in the skill tab but I get this error

formal goblet
#

Which versions are you using?

vocal sorrel
#

Hi, is it possible to limit the amount of items on a sheet by type? Either by which template they are or anything else? Lets say I have class trait (that is made from an item template) that the player can only have one of on the sheet and the sheet won't accept any other class traits, is that possible?

formal goblet
vocal sorrel
#

Thanks a bunch! I don't know JS at all but I'll figure it out probably :D

mighty shard
mighty shard
#

Alright its definitely something on my end. I was able to roll it fine when Foundry is running on my Windows PC but its not working on my Raspberry Pi setup

formal goblet
mighty shard
#

Deleted my Foundry directive and reinstalled and its working now for reasons that will never be explained

robust vessel
#

how can I make a visibility formula that checks for a custom key inside a dropdown?

robust vessel
#

thx!

#

Sorry to bother, but i could use some knowledge.

I have a mana refinement mechanic, and I wanted so that the when 'Mana Refinada' went up, 'Atual' went down at real time, but it only update the MP (first bar) when i pass the mouse over 'Atual'.

formal goblet
robust vessel
#

sadge

#

is there other way to implement this?

#

one that reacts as a change

formal goblet
#

Labels would auto-update, but cannot be changed by users

robust vessel
#

I think i could place a label visible only to moderators

#

nah, that wouldnt work, i need Atual to go down too

formal goblet
#

Maybe you could script something. You'd need to listen to the changes-event and fix your values based on certain conditions. But that requires some work ofc

ashen turtle
#

I'm not 100% if this is doable, but: what's the method (if any) to use a sheet roll with parameters? E.g. have a macro that rolls the "attack" label from a sheet but sets a local variable of the rollmessage to a certain value beforehand

formal goblet
# ashen turtle I'm not 100% if this is doable, but: what's the method (if any) to use a sheet r...

https://custom-system-builder.gitlab.io/custom-system-builder/classes/formulas_ComputablePhrase.ComputablePhrase.html#computeMessage

The 2nd argument defines the properties, that should be used for the computation. You can simply merge your own props and you should be good. Just don't forget to call postMessage() afterwards (see here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools)

#

Actually, forget the first link. Everything should be doable just with the second link

robust vessel
#

Im trying to change the meter fill bars, but it doesnt seem to work, anyone has an idea why?

#
.custom-system-meter-fill {
    background-color: red;
    color: red;
    

}
formal goblet
robust vessel
#

as in

.important
  color: red;

?

#

it works in the f12, but not on Custom Css

low tulip
robust vessel
#

nicee, that did it

#

is there a way to change fill bars individualy?

low tulip
#

individually as in each bar?

robust vessel
#

yep

low tulip
#

give the bar a component key and then do

.mybar .custom-system-meter-fill {
  background-color: red !important;
}
#

and if you have more:

.mybar .custom-system-meter-fill, .mybar2 .custom-system-meter-fill, .mybar3 .custom-system-meter-fill {
  background-color: red !important;
}
robust vessel
#

thx a lot

#

that you pillows always be on the cold side

low tulip
#

if you want to change the style of the entire bar and not just the fill section then it's .custom-system-meter

low tulip
#

yep, it sure does work

low tulip
#

I was thinking I could make a label with just a roll icon as a column in the item displayer table that players can click in order to use the weapon / ability / spell but I'm not sure how to write the roll message

formal goblet
low tulip
low tulip
#

ah, thanks!

low tulip
#
%{let roll = await new Roll('${item.damage}$').evaluate(); await roll.toMessage({flavor:'${item.name}$'});}%

%{let directroll = await new Roll('${item.directhit}$+${item.damage}$').evaluate(); await directroll.toMessage({flavor:'Direct Hit'});}%

So I have this roll message looking up item damage and the damage for a direct hit, written like this it results in two chat cards like so:

#

is there anyway to have that written in a way that consolidates it to one chat card?

runic condor
#

Struggling with getting this visibility formula right. I want it to show if ClassName is ClassMage OR ClassCleric

#

Currently this works but I dont know how to add the OR

sick cedar
#

or() (2 inputs): If one of both values is true, it will return true, otherwise false

runic condor
#

how do you separate the inputs?

sick cedar
#

With a comma ,

runic condor
#

Ah I capitalized OR and that didnt work. Thanks!

low tulip
#

I can't figure out if it's possible to send several rolls to the same message

formal goblet
# low tulip ```js %{ let roll = await new Roll('${item.damage}$').evaluate(); let direct...

You didn't pass anything to rolls. If we look in the API, it says that it expects an Array of strings. The description says:

Serialized content of any Roll instances attached to the ChatMessage

I don't know which function is needed to serialize a roll (maybe a simple toString() is enough). If you need further help, ask in the https://discord.com/channels/170995199584108546/699750150674972743 - channel, because this here is related to the core-functionality of Foundry and doesn't really involve CSB (except the Script delimiters %{}%, which is CSB-specific)

low tulip
#

okay I've given up on the foundry chatmessage styling for now as I'm getting nowhere with it and am trying to follow the example template instead. In the example template for weapon attack rolls they use this
${#?{Dice_Modifier:'Attack Modifier'[number]|0}}$
to execute a dialog popup before rolling with the roll message but I can't find any documentation on it. How would I write that if I want several rows within the dialog?
in essence this but in one dialog popup instead of two:

${#?{Dice_Modifier:'Attack Modifier'[number]|0}}$
${#?{Damage_Modifier:'Damage Modifier'[number]|0}}$
formal goblet
low tulip
#

thanks a bunch

#

I'm also actually wondering about adding image elements to the roll message, is there a way to make the img tag read the datapath string from this?
<th><img src='${item.img}$' width="48px" height="48px"> ${item.name}$</th>

#

I thought the ${}$ would do it but nope

formal goblet
low tulip
#

yeah ok I would never have gotten to that conclusion, thanks

formal goblet
low tulip
#

oh is that what the !does, that makes sense!

#

Can you change Controls Style using simple promts for dialogs like above, or does that require a custom user input template?

low tulip
#

thanks for all of the informed answers, I'm really trying to figure it out on my own but there's a lot to learn

shy osprey
#

If anyone is able to provide assistance, it would be great. I would like to get the hit location from the "ones" die of a d100 roll (0=head, 1=left arm etc) used to make the attack roll.
I was able to copy/edit/paste from other systems the basic of the attack roll as follows:
${#?{Difficulty|0}}}$
<h3>Hangdguns</h3>
<table>
<tbody>
<tr>
<td>Target score:</td>
<td>${target:=handgunsValue+Difficulty}$</td>
</tr>
<tr>
<td>Roll :</td>
<td>${roll:=[1d100]}$ -- ${roll <= target ? (roll == target ? 'Critical!' : (roll % 11 == 0 ? 'Critical!' : 'Success')) : (roll % 11 == 0 ? 'Fumble!' : 'Failure')}$</td>
</tr>
<tr>
</tr>
</tbody>
</table>
So doubles are fumble or critical but I would like to get the hit location as well.
Any help appreciated!

formal goblet
coarse gale
#
${#roll_formula:= %{return await game.macros.getName('VorteilNachteilWurf').execute({fertigkeitswert: ${wert}$, wuerfelOption:${wuerfel_option}$});}%}$
${[:roll_formula:]}$
#

Ich habe jetzt so ein recht einfaches Sheet für ein neues Rollenspiel gemacht (Midgard 6). Kann ich das jetzt denn anderen interessierten zukommen lassen?

#

Und wie kann ich den gewürfelten Schaden nun auf einen Gegner anwenden?

formal goblet
# coarse gale Ich habe jetzt so ein recht einfaches Sheet für ein neues Rollenspiel gemacht (M...
formal goblet
coarse gale
#

Aber wie komme ich an den gewürfelten Schaden ran? Muss ich da die ChatMessages abfragen?

formal goblet
coarse gale
#

aaah, ich kann das Würfelergebnis ja direkt wieder verwenden:

${result:=[:roll_formula:]}$
#

Damit kann ich dann in das nächste Makro und rum wursteln

marble mural
#

Anyone know if there is a way to set a template so that it's svg image is always set for any item made using the image?

#

Using the template rather.

formal goblet
marble mural
#

Is that something I add to the css? Or something else?

marble mural
#

Ah gotcha...I'll just keep doing it manually then.

marble mural
# formal goblet No, real Javascript

By the way, thank you for being so responsive. My Ashes Without Number setup is almost ready to go, and modding it to Cities Without Number afterward will take little work.

lyric blaze
marble mural
# lyric blaze This looks so cool.

It's pretty basic, but with no module working on the current version of Foundry I had to make my own. Thankfull Custom System Builder is really, really good.

lyric blaze
lament acorn
#

Hello there!

I’ve been working on creating a dropdown menu connected to a label in my application. Here’s how it’s supposed to function:

When no option is selected, the label should roll 1d20.
When the number 1 is selected, it should roll 2d20 and display only the highest result.
When the number 0 is selected, it should roll 2d20 and display only the lowest result.
The formula I’ve implemented works as intended for the logic. However, when I try to use Dice So Nice!, I notice that it rolls 5 dice instead of only the necessary ones.

Could someone help me refine the formula so it rolls only the required dice for each case? That would be amazing!

Thanks in advance for your help!

#

<p><span style="font-size: 20px; font-weight: bold;">O valor do dado foi:</span></p>
<p><span style="font-size: 25px; font-weight: bold;"> ${switchCase(destreza_nivel,'vazio',[1d20],'um',max([1d20],[1d20]),'zero',min([1d20],[1d20]))}$</span></p>

marble mural
#

Can someone help me with this line of formula, where item.attr is the radio button group, and the radio button keys are str, either, and dex. I'm trying to set up a setting that selects either strmod or dexmod on the sheet depending on which is selected in the weapon item:

(ref(item.attr)==str?strmod:(ref(item.attr)==dex?dexmod:(strmod>=dexmod?strmod:dexmod)))

formal goblet
#

And keep in mind, that the Radio Button Group returns the value of the selected Radio Button, not the component key

marble mural
formal goblet
sick cedar
#

Quick question: I have a formula that does a couple of rolls and then reads some attributes from the target token.

As a DM the formula works fine but then as a player I get an error "user lacks permission to update actordelta in parent token" unless I set the permissions of the token as owner for the players.

Is there a way to circumvent this?

marble mural
#

Like so?
equalText(item.attr,'Strength'?

formal goblet
marble mural
#

Roger.

formal goblet
#

And CSB doesn't offer that, so you need your own solution

marble mural
#

Hmmm...not quite there, getting [0,0] result, but at least now it isn't an error.

lament acorn
hardy fern
#

How to properly format an if statement to check if a checkbox is checked?

formal goblet
hardy fern
hardy fern
#

To follow up... Is there some other/cleaner way to just have various options, not just boolean one or the other other than just stacking these "ifs" together?

Kinda like...
If X is less than 5 do This
If it's between 5 and 10 do That
If it's greater than 10 do Those
etc.

formal goblet
hardy fern
#

But if that doesn't change the situation then dang, guess I have a lot of nesting to do this winter. 🥲 Thank you very much!

formal goblet
hardy fern
#

I don't think I use those. 🤔 I'll look into them

formal goblet
#

This e.g.

#

You have a value x (score) and want to find out, what the corresponding value y (modifier) is.

hardy fern
#

Yes, I understand what a lookup table is. I'm not sure how I could use it though as I currently didn't look into it yet. And is it possible to just have it somewhere on the background so the end user doesn't see it and only the script sees it when it needs to?

formal goblet
#

If your x and y values are sorted, you could even do the lookup without a script by doing something like fetchFromActor('global', "max(lookup('table', 'y', 'x', ${value}$, '<='))")

hardy fern
#

Hm... I was looking through stuff and I noticed the "Configure hidden attributes". Technically if I filled it with all the stuff I needed and referenced those, I could keep all of it enclosed in a single actor?

formal goblet
hardy fern
# formal goblet Depends on your case, but without further context I wouldn't do it this way.

Why not? I personally somewhat prefer when things are nicely packed in a way that don't reference outside themselves.

The specific thing is just:
The player has an attribute value. That attribute value goes through some math and it spits out an integer between 0 and 8. And I want that to determine the type of die (Or in some cases a flat value added) that is rolled in an output: 0, +1, d2, d4, d6, d8, d10, d12

formal goblet
#

In this case, I'd refer to a nested if-else

#

Or even 2

hardy fern
#

The d2 d4 d6 d8 d10 d12 options so far are just a first draft kind of deal. I'm somewhat pondering using different amount of dice instead so I'm looking to have the option to fill out 8 completely different items there.

#

But anywho, I'll just look into nesting the ifs and if I end up adjusting the system I'll just try to figure that out at a later point. Thank you for your time Martin yet again!

#

One more thing unrelated to the ifs here:
Is it possible to export a system out of CSB so that it can be used by others as a full standalone system?

formal goblet
#

The example module is basically only a compendium

hardy fern
#

I revised my previous, deleted, question:
${Punching_Fail ? ${setPropertyInEntity('self', 'Punching_Value', 'Punching_Value + 1')}$ : 'Nope'}$
If I'm not mistaken this should be a simple if that checks a checkbox Punching_Fail and if it is checked it should make Punching Value increase by 1 and if it is not checked, it should send a Nope text into the chat log. However, every time it runs, regardless of the state of the checkbox, the formula just increases Punching_Value by 1 every time, regardless if it's checked or not. The only difference is that if it's checked, it will post the incremented number and if not it will post the Nope, but the increase happens either way.

formal goblet
formal goblet
#

I don't even get why you have a nested formula. The inner one is completely unnecessary

hardy fern
#

What do you mean... In order to permanently adjust the value of another field I need to use the setPropertyInEntity thing, no?

formal goblet
hardy fern
#

And there it goes working exactly as intended once I removed those... 🥲

#

So if I have the outer formula delimiters any formulas inside the thing don't need their own delimiters and just get recognized wherever they are?

#

Also how do I print out nothing? Like telling the script "Do not print out/do anything."

formal goblet
hardy fern
#

When I put absolutely nothing there in the "false" area it prints out ERROR instead which isn't a win either. I want it to do nothing if it's false. 👀 Even tried null or '' which printed out a tiny empty text box.

formal goblet
hardy fern
#

Hmm.... Wait a second...

#

Isn't this some of that Game Master debug value visibility nonsense again...?

formal goblet
#

Nope

hardy fern
#

Ok, no. Yeah... I have the hidden roles thing disabled.

formal goblet
#

And that shouldn't even return NaN

hardy fern
#

Never thought it'd be difficult to have a program do nothing...

formal goblet
#

Because division through 0 is an error

hardy fern
#

Not in this formula apparently 😅

neat temple
#

Hey Martin, I wanted the "Patente" label to be filled with the correct position depending on the "Pontos de Prestígio". If it was between 0 and 19 it should return "Recruta" and so on. But I couldn't find a logic that would work like that, the closest I could come up with was using first() and lookup(), but that just returned the option with the lowest value. I'm still studying the formulas so I'm not sure if that would be a good way.

formal goblet
#

Or ${find('dynamic_pate', 'dyn_pate_name', 'dyn_pate_value', max(lookup('dynamic_pate', 'dyn_pate_value', 'dyn_pate_value', pontosdeprestigio, '<=')))}$

ornate marsh
#

trying to make it so that current hp cant be set higher than max hp, anyone got a clue?

ornate marsh
#

you're right!

ornate marsh
formal goblet
ornate marsh
#

I see, just started learning this today

formal goblet
#

x, y is a syntax error, because you didn't specify, what should be done with those values. You can either do:

  • x + y: Combined with an operator
  • sum(x, y): Part of arguments of a function
ornate marsh
#

Thank you for the clarification, its greatly appreciated

#

As I scroll through the chat I saw an example of someones custom sheet that looked pretty cool, how are they changing the background and fonts?

formal goblet
ornate marsh
#

I'll have to reach out to the guy and ask

low tulip
#

the background can be changed with the css statement

.window-app .window-content {
  background: url('filepath')
}

and then edited to your liking using the various css properties you can find by googling such as:

.custom-system-actor-content {
    padding: 90px 80px 90px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: url('assets/sheet-foreground.webp'), url('assets/sheet-background.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment: local;
}

fonts have to be specifically edited either from

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

or in idividual cases by (with the chrome browser) pressing F12 to open the console and pressing 'inspect element' on specific text elements to view their style, and then copying that to your css file and changing it case by case, for example:

.sheet header.sheet-header h1 input {
    border: none;
    font-family: 'modesto condensed';
    background: none;
    font-size: 44px;
    border-bottom: 6px double #d1bea1;
}

you can download your own font files, put them in a folder inside foundry and use them aswell using filepaths.

hollow crow
#

Hello everyone. I have written a macro (obviously with the help of ChatGPT, since I know nothing about programming) that returns in chat the result of the damage the attacker inflicts on the opponent (basically the damage is obtained as the difference between the attacker's roll and the defender's roll by applying appropriate modifiers to the 20 die) . However, I cannot set up the macro so that on the target's character sheet the value of hit points is automatically updated. The field containing the number of hit points in the character sheet template is of numeric type and I have named its component key as 'custom_hp' . I've made dozens and dozens of attempts, but I just can't figure out what instruction I need to insert inside the macro (which is obviously compiled with the Javascript language and doesn't accept CSB formulas as they would normally be written) to make the hit points on the defender's character sheet progressively decrease as the character takes damage from the attacker. Also, to simulate the healing intervention of a cleric or the effects of rest, how could I tell the macro to consider starting over in the damage count on a new encounter? Can someone kindly help me out here? Thanks!

formal goblet
hollow crow
#

I thank you for your response. It would be sufficient for the automatic update to occur on the PC sheet whenever it takes damage from an NPC, leaving the burden of manually updating NPC hit points to the GM. After all the Master at the permission level can take action on the PC sheet, so this solution should not run into the problem you mentioned...or should it?

formal goblet
hollow crow
formal goblet
hollow crow
# formal goblet So your Chat Message is generated by a Macro instead of a Label Roll Message?

Yes, exactly: the macro contemplates very special cases (e.g. if the attacker gets 20 with the 20 die and the defender gets 1, if only the attacker gets 20 etc. etc.). Also, the damage depends on a particular value relative to that particular weapon (e.g. a sword can inflict a maximum of 8 damage, so the macro limits the amount of damage inflicted depending the weapon the macro refers to). So it would be ideal if the macro (at least on the Master side) also dealt with decreasing the amount of damage on the PC sheet rather than resorting to other formulas or scripts. One macro to rule them all 🙂

formal goblet
hollow crow
#

Thanks. I tried to insert your instructions into my macro but with no success. I am giving you the entire macro with your additions placed almost at the end. Maybe I made a mistake where to insert it or there is some other problem. I don't want to waste your time, thanks anyway.

low tulip
#

I'm a bit stuck on a css issue here and was hoping for some inspiration. I'm trying to have the left border of the table be coloured aswell as the header but for one they're overlapping and since I want to use opacity their colour gets overlayed, and secondly the left border is placed outside of the table as it's a border property which means it looks a bit strange with the black 1px top and bottom borders of the table, they end before the pink border. Any suggestions on how I might style it better?

#

Ideally I'd want to scootch every TR in 8px to the right and fill the space with the background-color but I'm not sure if I can accomplish that

low tulip
#

I kind of got it the way I want it but I had to say goodbye to the black table borders, I couldn't make them extend the way I wanted. I did manage to make the table borders rounded though 🤔

low tulip
#

I tried making an <input> tag in an item displayer column but realized that the number entered into the field doesn't stay, it disappeares again when you update the character sheet. Is there a way around that?

formal goblet
low tulip
#

I see... how would you go about linking the text field to a component key from the item?

low tulip
#

same thing with checkboxes?

#

wait a minute

low tulip
#

I did something similar with equipped items actually

#

yeah exactly that was what I looked at for equipping items! 😄

low tulip
#

what I'm trying to accomplish is uses / charges for an item if you happen to have a simpler way of doing those

formal goblet
low tulip
#

yeah

#

do you know if an empty input field returns undefined, null or something else?

formal goblet
low tulip
#

number

formal goblet
#

I think undefined

low tulip
#

basically I want to do something like item.uses == not empty ? ${item.uses}$ / ${item.usesMax}$ : ""

#

so it displays the uses column only on items that actually have numbered uses

#

I'll try with != undefined

formal goblet
#

It might also be an empty string. You should be able to check that in the console

low tulip
#

undefined worked

#

but the forward slash remained for some reason

#

what the heck

#

alright fixed it

#

was just stupid

low tulip
#

that way if you left click, it increases it by 1 up to max uses,
and if you shift click it decreases it by 1 down to 0!

formal goblet
#

Well, that works, yeah

low tulip
#

I'd rather have it where right click decreases it and not shift click

#

but that means I have to script everything manually and I don't really know javascript well enough, it'd take me all day I fear

low tulip
#

Is it possible to make custom conditions and perhaps remove the default ones?

#

or I mean it's possible but is it reasonable?

ornate marsh
#

hello all

low tulip
#

could just do display: none in css maybe

formal goblet
low tulip
#

oh really?

#

nevermind then!

formal goblet
#

And not everything is solvable with CSS 😅

ornate marsh
#

my understanding is that the dynamic table allows say the player to create rows?

formal goblet
ornate marsh
formal goblet
#

:: are only relevant in Roll Formulas like ${[:Strength:d20]}$

ornate marsh
#

so '' is like quoting text specifically?

formal goblet
#

Things in quotes are strings

#

It's one of the primitive data types

#

Others are numbers, booleans (true or false) and Arrays (collection of values)

ornate marsh
#

so im assuming then number values should also use []

formal goblet
#

You can just write 7 as a number

sick cedar
#

Question: How can I iterate through the items inside a specific item displayer of an actor object in a macro? I found a way but I doubt is the ideal one.

formal goblet
#

You actually never use [] or :: unless you want to perform rolls

ornate marsh
#

what if i wanted to fetch a number value from a specific row?

#

such as with: ${[1d20]+sameRow('wep_tohit')}$

formal goblet
formal goblet
ornate marsh
#

assuming i need to use some sort of way to specific a number val

formal goblet
ornate marsh
#

in the same dynamic table but eventually ill need to figure that out for specific player attributes

#

i got the formulas github page open trying to figure out how to get the value of the number field in there

formal goblet
#

If your Formula is within the same row, just use sameRow() like how you did

ornate marsh
#

${sameRow('wep_name')}$
${[1d20]+sameRow('wep_tohit')}$

#

is the addition wrong? do i need to expand the [] around the whole equation?

formal goblet
#

Not needed. The Formula is correct

ornate marsh
#

oh you're right, i guess i was reading it wrong

sick cedar
ornate marsh
#

i have no clue what i did but i broke something on my sheet lol

#

${sameRow('wep_name')}$
${[1d20+sameRow('wep_tohit')]}$

Attack button wont even work now:

sinful spade
#

I made a roll button within an item container;
how would i go about making it a macro? i can't just add it to the hotbar with dragging like one off a dynamic table.

formal goblet
formal goblet
ornate marsh
#

could you link it again?

ornate marsh
#

My frankenstien code rn:

To Hit: ${[1d20]+('wep_stat'=="STR"?str_val:'wep_stat'=="INT"?int_val:'wep_stat'=="WIS"?wis_val:0)+sameRow('wep_tohit')}$

Trying to get something condition to work where if wep_stat = one of three values, then itll use the right value

#

nevermind i got it: To Hit: ${[1d20] + switchCase(sameRow('wep_stat', 'unknown'), 'STR', str_val, 'INT', int_val, 'WIS', wis_val, 0) + sameRow('wep_tohit', 0)}$

#

okay almost lol

#

actually did get it this time:

To Hit: ${[1d20] + switchCase(sameRow('wep_stat', 'unknown'), 'wep_str', str_val, 'wep_int', int_val, 'wep_wis', wis_val, 0) + sameRow('wep_tohit', 0)}$

low tulip
#

I'm trying to write a line in a roll message where the entire roll is conditional on a property in the item but it's not working, can y'all tell me what's wrong with my syntax here?

<td><strong>${item.check != '' ? (${Roll:= [1d20]}$ ${!Roll >= 20 ? '<br>Critical Success' : ''}$) : ''}$</strong></td>
#

I've tried with different variations and I'm not really getting it

#

basically what I want in mock code just to explain is something like:

if(item.check == undefined) {
  <td><strong>''</strong></td>
}  else {
  <td><strong>${Roll:= [1d20]}$ ${!Roll >= 20 ? '<br>Critical Success' : ''}$</strong></td>
}
frail kettle
#

Hi people 👋
I'm creating my first system and currently struggling with the effect displayer.
The documentation tells about a reference column and various options related to that specific column or columns header.
My question is how can I add another column like the remaining time for each effect?
Is it feasible with just this module or should I use a simple table that I build myself from the effects attached to the actor ?

formal goblet
frail kettle
low tulip
formal goblet
low tulip
formal goblet
low tulip
#

aah I see

#

so... ${#Roll:= [item.check != undefined ? 1d20 : 0]}$

formal goblet
#

A good direction, but that is not a valid Roll Formula

low tulip
#

how come?

low tulip
#

doesn't seem right

formal goblet
#

In essence, the ternary operator doesn't work directly in Roll Formulas

low tulip
#

but I can reference it from a key

formal goblet
#

But what you could do is to construct the Roll Formula, save the result in a local variable and just use that in the Roll

low tulip
# formal goblet But what you could do is to construct the Roll Formula, save the result in a loc...

what I'm trying to do here is make a roll button for my abilities but I realized some abilities don't have attack and damage values and are instead healing abilities for example, so I figure I need to have the abilities output attack and damage if those fields are filled, and instead output healing if that field is filled. If there's a different method to achieve this that comes to mind I'd love to hear it 😄

#

because right now, if the check / damage fields aren't filled in, it just errors. I need it to go through just with no values or empty strings

#

I'll dig into saving the roll formula result and see what I can accomplish in the meantime

#

I solved it actually ${#Roll:= [${!item.check.includes('STR') ? '1d20' : 0}$]}$

#

thanks for the help

hollow osprey
#

Hello everyone, i'm starting to use CSB and i have a question for you. If your system need to add species (elf, human, dwarf...) on player sheet. And each species could give an improvement on an attribute choice (ex choice between Agility or Intelligence). How could you make the player choose between the attributes suggested in the "elf" item for example. I was thinking about using a dynamic table with a radio button allowing to know which attribute has been choosen like this but is there another way to do it or example ? Thanks for your advice

hollow osprey
#

but for that i should ask for user input in an event when i drop down a race in an actor sheet ? how i could trigger this event in CSB ?

low tulip
#

oh good question

#

that'd probably need a custom script then yeah

frail kettle
#

Hi again, I'm still struggling with effects. What is the format for Attributes key ? I tried using my component key as typed in the template but it does nothing. I also tried using the various methods from foundry's official doc but I can't find(or understand ?) the thing.

frail kettle
formal goblet
frail kettle
low tulip
#

I'm trying to get a heart icon to appear on the item displayer table only when there's a relevant healing value on the ability, but no matter what I do I only get errors. What could I do to make this work?

<i id="icon" style="display: none;" class="fa-solid fa-heart-circle-plus"></i>
%{
const myIcon = document.getElementById("icon");
if(${item.healing.includes('-')}$) {
myIcon.style = "display: block";
}
}%
#

I'm trying to make a heart icon only appear in the item selector table when there's relevant healing data on the ability, but I'm only getting errors, what could I do to make this work?

<i id="icon" style="display: block;" class="fa-solid fa-heart-circle-plus"></i>
%{
const myIcon = document.getElementById("icon");
if(${item.healing.includes('-')}$) {
myIcon.style.display = "none;"
}
}%
#

without the function part there are no errors so there's some syntax error inside the %{}% but I can't figure out what

#

I've tried doing the same thing with ternary operators but it doesn't like the <i></i> tag

low tulip
ornate marsh
#

silly question, is there a way to remove this little white square that appears from foundry chat because a nil value was made?

#

it shows Critical Success & Failure appropriately, was just wondering if there was a way to omit the chat in the event neither 20 or 1 was rolled

misty jewel
#

it removes the explanation box

bitter spear
#

Hello, i'd like to play a custom system but develop a full system for Foundry is far too much for me right now. I was wondering if there is a way to make a module for a poor man character sheet. What i have in mind is basically just a way to have some labels with input value that you can save and some macros who read them. Is there something like that or is doable by a beginner in some way?

formal goblet
bitter spear
formal goblet
bitter spear
#

Uhm, if i try to activate the module it says i need 4.3.0 version and i have the 4.2.0. Custom System Builder is in fact 4.2.0 but if i check for updates it says it is up to date. I'm missing something?

formal goblet
#

Or you edit the version of the module in the module management

#

I don't think that it won't work with 4.2.0, because I haven't used the new feature there yet

low tulip
#
<i id='icon' style='display: block;' class='fa-solid fa-heart-circle-plus'></i>
%{
if(${item.type.includes('Instant')}$) {
document.getElementById('icon').style.display = 'none';
}
}%

Any update on why this doesn't work as a label text? I can't see what's wrong with it

low tulip
formal goblet
low tulip
#

like just return ' '

formal goblet
#

Yep

low tulip
#

well the error signs disappeared but the display property still isn't being changed

formal goblet
#

I think it would be easier to make the style itself use a Formula to determine the display type

#

Like display: ${!item.type.includes('Instant') ? 'none' : 'block'}$

low tulip
#

didn't even cross my mind

low tulip
#
<i style='display: ${!item.type.includes('-') ? 'none' : 'block'}$' class='fa-solid fa-heart-circle-plus'></i>
formal goblet
low tulip
#

yeah just did that and no difference

#

weird

#

just outputs error... not really sure what else to do 🤔 I'll have to sleep on it I guess

low tulip
low tulip
#

interestingly though with the ! removed, it doesn't pass style="display: error;" anymore the style tag is just gone

#

OH

#

ok found a combination that worked, it needed string delimiters around the none and block, and no !

#

can't believe I didn't try that yesterday, I really did just need to sleep on it

low tulip
#

alright, everything works as intended now! One button that shows as a heart if it's a healing ability and a dice if otherwise, and sends conditional table rows depending on the ability keys. If it has a check, it sends a roll and a result row, if it has damage it sends damage rows, if it has healing it sends healing row, otherwise those rows are display: none;

#
${#Target_Defense:= item.type.includes("Physical") ? fetchFromActor('target', "defense", -1) : fetchFromActor('target', "magicdefense", -1)}$
${#concat(string(?{Dice_Modifier:'Attack Modifier'[number]|0}), string(?{Damage_Modifier:'Damage Modifier'[number]|0}))}$
${#Damage:= item.damage}$
<table>
<tr>
<th colspan="2">
<img src='${!%{return linkedEntity.img;}%}$' width="48px" height="48px"> ${!item.name}$
</th>
</tr>
<tr>
<td colspan="2">
<details>
    <summary><strong>Description:</strong></summary>

    <p>${!item.description}$</p>
</details>
</td>
</tr>
<tr style="display: ${!equalText(item.check, "-") ? "none" : "table-row"}$;">
<td><strong>Roll</strong></td>
<td><strong>${#Roll:= [1d20]}$${Roll}$${!Roll >= 20 ? '<br>Critical Success' : ''}$</strong></td>
</tr>
<tr style="display: ${!equalText(item.check, "-") ? "none" : "table-row"}$;">
<td><strong>Result</strong></td>
<td><strong>${Result:= Roll + ${item.check.toLowerCase()}$ + Dice_Modifier}$
${!Target_Defense == -1 ? '<br>No target selected' : Result >= Target_Defense ? '<br>Direct Hit!' : ''}$</strong></td>
</tr>
<tr style="display: ${!equalText(item.damage, "0") ? "none" : "table-row"}$;">
<td><strong>Damage</strong></td>
<td><strong>${[:Damage:]}$</strong></td>
</tr>
<tr style="display: ${!equalText(item.damage, "0") ? "none" : "table-row"}$;">
<td><strong>Direct Hit</strong></td>
<td><strong>${DirectHit:= [:item.directhit:+:item.damage:]}$</strong></td>
</tr>
<tr style="display: ${!equalText(item.healing, "0") ? "none" : "table-row"}$;">
<td><strong>Healing</strong></td>
<td><strong>${[:item.healing:]}$</strong></td>
</tr>
</table>
hollow crow
#

@formal goblet Hey Martin, nvm for that macro problem, i managed to integrate your instructions in it and now it works perfectly, thank you very much! (Oh, and Merry Christmas 😄 ). I'd bother you with another question regarding setPropertyinEntity: i wrote this formula ${setPropertyInEntity('self', 'custom_hp', 'custom_hp+[3d8]')}$ PF to simulate self-healing for the cleric, but it seems to ignore the maximum value that i've set in the HP field: in this way the cleric could give himself infinite hp without respecting any cap. Why does setPropertyInEntity ignore the 'maximum value' field i've set in the character sheet's template for hp?

formal goblet
hollow crow
#

Ok, that doesn't seem a big problem anyway: no matter how many hp the number under the token shows to you, i'll warn my players that the value on the sheet is what matters (and it's enough that opening the sheet automatically updates the token number).

tough scarab
#

Do you know if there are any plans to update this sheet? I'm looking to run Deathwatch and it would be great to use CSB. The sheet looks great but I don't think it's functioning as planned.

formal goblet
gaunt valley
#

Can anyone help me?
I think it should be really simple to solve, but I didn't understand from the documentation.
I need to roll an "Agi" attribute inside an item. I can roll a die inside it, but I wanted, for example, roll+Agi.
I'm currently using this:

Rolling ${roll:=[1d10]}$.

but I've already tried, for example,

Rolling ${roll:=[1d10]+Agi}$. and nothing. Agility is inside "Habilidades". I also tried something like Habilidades.Agi. sweaty

Does anyone know how I can solve it? Ty! thxblob thxblob

formal goblet
gaunt valley
#

Target inside "Armas" template for itens
Agi is inside Tabbed Panel "CabAba" and inside table "Habilidades"
this is the label:

Rolou Agilidade com ${[:Agilidade + AgiBD:d10cs>=7df1]}$ Sucessos e adiciona ${AgiBF}$ no resultados de testes.

alternative label:

${#concat(
?{DifAlt:"Dificuldade Alterada"[number]},
?{Bonus:"Bônus de Circunstância"[number]},
?{Penalidade:"Penalidade de Circunstância"[number]},
?{Info:"Informações Adicionais"[text]}
)}$

Rolou Agilidade com ${[:Agilidade + AgiBD + Bonus - Penalidade:d10cs>=:7+DifAlt:df1]}$ Sucessos e adiciona ${AgiBF}$ no resultados de testes.

Informações Adicionais: ${Info}$

is that what you need?😊

formal goblet
low tulip
#

how would you most easily go about adding items that can be added as effects on an actor?

#

such as spell effects or debuffs and stuff

#

that would show on the token as an active effect and stuff

formal goblet
low tulip
#

is that so

low tulip
#

custom script territory?

formal goblet
low tulip
low tulip
formal goblet
#

Yep

low tulip
formal goblet
#

Nope, mandatory

low tulip
#

I want for the players to be able to see if they have a spell active on themselves for example

formal goblet
#

You can add a Custom one in the Config and use that for all custom effects

#

Easy as that

low tulip
#

wait so if I add a status condition, it doesn't actually show that status condition?

#

oh I see, it shows as active but the icon becomes that of the item's active effect... weird

formal goblet
#

That's Foundry default behavior

low tulip
#

usually in systems I've used if they use active effects for such things those active effects append themselves to the conditions so they show up there when the buff is on the actor, and then go away once they aren't

#

don't know how that works behind the scenes so to speak so I've never thought about it

formal goblet
#

Me neither, I've only made Active Effect modifiers work with CSB (and the Active Effect Displayer). That's it

low tulip
#

its become really annoying after a bit 😄

formal goblet
#

Maybe something changed with the RTA with V12. I honestly use only the Dialog editor type

#

But could be worth a bug report. Chances are high, that it's an easy fix with a 1-liner

low tulip
#

I'll toss it on the gitlab

hardy fern
#

Is an if statement possible without the else bit somehow?

low tulip
#

do you mean a ternary operator or an if statement?

#

if you mean an if statement then

if(condition) {
  code block;
}
hardy fern
#

If as a formula.

low tulip
#

if you mean a ternary operator then no but you can always do something like

condition ? exprifTrue : ""

to provide an empty string as the falsy expression, depending on what your specific context is

hardy fern
#

Yeah that doesn't work. "" in specific prints out a tiny empty window.

low tulip
#

what's the context

hardy fern
#

"" prints out this.

low tulip
#

in a roll message?

hardy fern
#

0/0 was also suggested by Martin and it prints out NaN

#

I have a formula that checks if a checkbox is ticked and if it is I want it to do something. If not, do nothing.

#

But the "do nothing" part is more difficult than expected.

#

Always prints out something.

low tulip
#

what's it printing to, the chat? Is the only issue is that it prints something to the chat that it shouldn't?

hardy fern
#

Yup.

low tulip
#

ok is this in a roll message?

#

what does the context look like, is it a table?

#

what does your html look like

hardy fern
#

${Punching_Fail ? setPropertyInEntity('self', 'Punching_Value', 'Punching_Value + 1') : ""}$

low tulip
#

if you only want the box gone that's doable but if you want the chat message to not send at all I don't know if that's doable

hardy fern
#

Punching_Fail - Checkbox
True value is just a placeholder to increase a value in a field by 1 (Works fine.)
False should be doing nothing.

#

I want nothing to get printed out if the checkbox is not checked.

#

Quite literally skip, move on, do not print, alter, do anything.

low tulip
#

not sure it'll do anything but
${Punching_Fail ? setPropertyInEntity('self', 'Punching_Value', 'Punching_Value + 1') : <!--do nothing-->}$

low tulip
#

figured

hardy fern
#

If the False area is not filled or whatever it expects a second value which I kinda don't need.

formal goblet
#
${#%{
if (!entity.system.props.Punching_Fail) {
  throw 'Chat Message aborted';
}
return '';
}%}$

${Punching_Fail ? setPropertyInEntity('self', 'Punching_Value', 'Punching_Value + 1') : ''}$
#

You have to actively throw an error to abort the creation of the Chat Message

hardy fern
formal goblet
#

oops. negated

low tulip
#

do NOT ! operators work inside %{}% delimiters?

low tulip
#

apparently so

formal goblet
#

Yeah, you have full JS there

low tulip
formal goblet
#

Hide the result in the Chat Message

#

Useful for local variables, which you don't need in the Chat Message

low tulip
#

ah cool

hardy fern
#

Hm... It seems that the Return exits the entire code. I tried slapping a copy of that with adjusted names right after it and it only properly works if all of them are checked. If some or all are unchecked, it doesn't work.

formal goblet
hardy fern
#

I just have a list of skills where each skill has a single checkbox. If this is checked and then the button is pressed to run the script in question, it should go through all of the checkboxes and if it finds a checked one, it should increase that skill value by a certain amount. (As a placeholder I just do a +1 for now.) It's kind of an automation attempt because these skill increases are all done at a single point so I'm trying to make it all run from 1 button which would check all checkboxes and add the ones that should be added.

#

So basically in a dumbed down version:
Is skill 1 checked?
Yes - Add this to this value and continue.
No - Do nothing and continue
Is skill 2 checked?
Yes - Add this to this value and continue.
No - Do nothing and continue
etc.
etc.

formal goblet
hardy fern
#

No, a static, regular table because the list of skills won't be changed.

formal goblet
#

...

hardy fern
#

I most likely don't realize the purpose of dynamic tables but it just seemed like everything wanted to be the same for every row.

formal goblet
#

Use a Dynamic Table, remove the option for your players to add rows and create predefined rows in the Template. With this, you have a list of a fixed size

#

With this, you won't need a Formula for every fucking single skill

hardy fern
#

Any way to edit the rows because iirc when I tried to use a dynamic table I had labels for the skill names and couldn't edit them.

formal goblet
#

You need Text Fields

#

Labels are not editable per design

hardy fern
#

Is it possible to not have a text field box there? So it only shows text like a label does?

formal goblet
hardy fern
#

The text field box just makes it seem like the area should be editable. As a user if I see a box like that I by default expect to be able to write in that area and the names of the skills won't change ever so that's why in the table I have now I made it with label rather than text box. (Same for the modifier near the end. Only leaves a box in the areas where the user is expected to interact.)

formal goblet
#

How about you create 2 Components in the Dynamic Table?

  • Text Field for the name of the Skill with no column-name, which is always hidden (visibility formula)
  • Label, which only contains a sameRow()-Formula to the hidden Text Field
hardy fern
#

Will I always see the hidden collumn just because I am a GM? (In the actual sheet (Left), not the template itself.)

formal goblet
hardy fern
#

Yes, I figured but if I leave it without a specific formula it wouldn't be visible to regular players as long as the Column Name of the specific column was left empty as instructed?

formal goblet
hardy fern
#

By the way... Is there a situation where a dynamic table would be worse than a regular table? Since from what you've told me it's best to use a dynamic table for lots of stuff. 🤔

formal goblet
#

Something like this here

hardy fern
#

Ah, ok gotcha. Thank you for the clarification!

sinful spade
#

how can i nest multiple "then" statements?
Value == true ? doThis andThis andThis : doThat andThat andThat
&, &&, +, ,, nothing seems to work

#

unless there's a better way to do what i'm doing.

I am making a roll button within the item container for weapons:

#

I am effectively trying to do the following

if attribute radio = true
get base attribute name
lookup attribute on dynamic table, roll that skill using the button on the table (to hit)
&&
reference weapon dice quant, value, and modifier
[roll damage]
else radio = ability
do the same but for the selected ability and ability table

low tulip
hardy fern
# low tulip You can also just make the text box go away with css .textBoxKey input { Backgro...

I'm barely on the edge of understanding scripting so I'm trying to somehow put together a functional automatization system that looks as intuitive as possible. To my understanding css only focuses on visuals, not functionality so for now I'm not looking into css at all and I'm leaving it in the back of my mind as a possible option for after I have my logic set up and functional. 😅

storm stream
#

can I have fields get info from rolltables so that if I create an actor it fills in all info I want?

storm stream
#

more specifically in a text area field

formal goblet
storm stream
#

sorry

#

ugh

#

I mean rich text area component

#

i would like the rich text area component to come in filled with some text from rolltables

formal goblet
#

You need a Label with a Label Roll Message or a Macro to achieve that. You need some point to trigger the changes, the Roll Table itself can't do that

gaunt valley
hardy fern
#

Anyone have any idea why this concat:
<p style="text-align: right;">${concat(string(diceRoll), '-', sameRow('Skill_Attribute', 0), ' // ', sameRow('Skill_Value', 0))}$</p>
keeps trying to convert the dash and double slash into numbers when I'm trying to keep it as text?

formal goblet
hardy fern
#

Any way to tell it not to do that? I tried closing both of them in a string() but that changed nothing.

formal goblet
#

The solution would be indeed to cast every arg to a string

hardy fern
#

Oh EVERYTHING... Ok I'll try. 🤔

formal goblet
#

At least everything, that is not a string by default

hardy fern
#

You've done it yet again Doctor. stonks_up

low tulip
#

Doc Martin

sinful spade
formal goblet
sinful spade
#

So I tried
ItemBaseGroup == 1 ?
Ref('item.itemBaseAttribute') + lookup(...) : Ref('...')

I replaced the + with everything I could think of, and even tried nothing but the functions... Can't figure it out.

formal goblet
sinful spade
#

That's just my phone auto capitalizing, I'm not at my pc.
What's the syntax tho?

formal goblet
#

But the only conditional thing I see at your example is, if the value comes from an Attribute or an Ability. The rest stays the same regardless of the condition

hardy fern
#

The ability to delete a row in a dynamic table is visible just because I'm the GM, right? (I did select the crossed out garbage bin on all of the rows but still see it in the test character sheet.)

formal goblet
frail kettle
#

hey there,
I've been working with dice rolls expressions and I've reached this expression :

STR Roll : ${roll:=[1d100]}$/${p_net_STR}$
result : 
${
roll<=p_highroll?'CRITICAL SUCCESS':
roll<=p_STR?'SUCCESS':
roll>=p_lowroll?'CRITICAL FAILURE':
'FAILURE'
}$

I've encountered two issues and I'd would like to know if they are known limitations or bugs :

  • I could not make conditions with more than 2 operations (ex A==B -> OK, A==B&&C==D-> KO)
  • Only the "if true" part can be chained into another one.
formal goblet
frail kettle
formal goblet
bleak marsh
#

Am I insane, or does lookup not work when trying to match Booleans in Custom System Builder / CSB? (v4.2.0)
I have been fighting with this for at least 2 hours, and I need a sanity check to see if it's just me. Any insight to what I am doing wrong would be greatly appreciated (or another method to get the same result).

I have an Item Displayer (charWeapons) on the Character sheet with the weapons a Character has. There is a checkbox for "isEquipped" (using the logic from the example sheet). It has a column on the table and a prop on the weapon with the same name.
I am trying to get the weapon skill (weapSkill on the Item Displayer) of the equipped weapons (where *isEquipped *== true)
lookup('charWeapons', 'weapSkill', 'isEquipped', true) <<<< always returns nothing
lookup('charWeapons', 'weapSkill', 'isEquipped', false, '!==') <<<< always returns the skills for all weapons, regardless of isEquipped value
I have tried multiple variations passing the booleans as: strings, 0 and 1, various casing, setting a variable to true/false and using those
(and yes, *isEquipped *value is changing on the items)

frail kettle
bleak marsh
#

just tries "!=" no change in results

frail kettle
#

at least I tried

humble sonnet
#

I think the difference is that !== compares types as well as data (so "0" and 0 wouldn't be equal)

frail kettle
formal goblet
formal goblet
bleak marsh
#

oh... I kinda see it now the isEquipped is the display value

#

thanks! I moved the checkbox into the label prefix and now I'm getting changes! Results are still not quite right, but I can work with this 😁

hardy fern
#

How can I work with an entire column of values in a dynamic table at once?

  1. I'm looking to make a formula outside of the Dynamic table which sums up all the values of a certain column.
  2. How would I make the training script run through all the rows of a checkbox table upon a single click?
#

I tried adjusting the solution I got to the previous situation:

${#%{if (!entity.system.props.Skill_Fail) {
throw 'Chat Message aborted';
} return '';
}%}$

${Skill_Fail ? setPropertyInEntity('self', sameRow('Skill_Value', 0) + 1) : ''}$

But while this doesn't give out any errors it also doesn't adjust anything.

sinful spade
formal goblet
formal goblet
sinful spade
#

{Actor} attacked using an {item.name}.

Roll to hit: {ability/attribute} ( {dicepool} )
(alt roll) Situational Bonus: {Value}
Total: {value}

Damage: { item damage pool }
(alt roll) Situational Bonus: {Value}
Total: {value}

formal goblet
hardy fern
#

Do you have a halo yet mate?

formal goblet
#

Nope, only a disco ball above my head

#

It's not even a joke

formal goblet
sinful spade
#

correct - the dice pool and ability name are both conditional on the radio selection

formal goblet
#

Then save both in a variable and use them down below

#

Something like this:

${#dice_pool:= isAbility ? ability_pool : attribute_pool}$
${[:dice_pool:d6]}$
sinful spade
#

ability and attribute pools are not stagnate - they're items in a dynamic table

#

I'd need to get the same function used withtin the dice for say 'dodge'

formal goblet
sinful spade
#

doesn't that require the chained logic i was asking about earlier?
isAbility ? getAbilityName -> sameRow get total : getAttributeName -> sameRow get total

formal goblet
#

Nope. Each statement performs the same conditional check:

isA ? b : c
isA ? x : y
sinful spade
#

oh so

isAbility ? get ability name : get attribute name
isAbility ? get ability function : get attribute function?

#

brilliant

formal goblet
#

Yep

sinful spade
#

So i'm getting a cannot convert 'd6' into a number error with the concat?
${ref('item.itemRollBase') == 1 ? concat(string(lookup('attributeTable', 'attributeDiceQuant', 'attributeName', ref('item.itemBaseAttributeName'), '==')), 'd6') : 'placeholder'}$

frail kettle
#

Is it possible to modify/add/remove effects from this list ? (sorry I don't know if it is even related to CSB or core Foundry)

#

From what I've seen there is a class for that "ActiveEffectConfig"
But is it usable with CSB ?

formal goblet
sinful spade
#

i think that's a list of defaults -> you can create custom ones within an active item effect pannel but idk about the core list.

#

you could if you dug into csb files but changes would revert on update

frail kettle
hardy fern
formal goblet
frail kettle
formal goblet
sinful spade
frail kettle
#

Imo, the readme is so dense that I thought it was about everything.

formal goblet
frail kettle
#

and also the wiki tab is hidden under another section on the nav lol

formal goblet
#

That's GitLab, not us to be fair

#

On the other hand...

frail kettle
sinful spade
# formal goblet On the other hand...

it'd be more obvious to the user that they need to look for the wiki if the home page stopped at incompatabilities rather than having 85% of the information there.

formal goblet
frail kettle
formal goblet
frail kettle
#

oh...

sinful spade
frail kettle
#

That's a core foundry question but are macros persistent ? I'm very new to foundry and it feels weird to touch defaults settings with a script hotbar 🤔

sinful spade
formal goblet
frail kettle
#

it feels kinda wrong to make a macro from a hotbar to run it once.
And now I'm worrying about obliterating the default settings by accident and having a fun time reverting my mistakes

formal goblet
frail kettle
#

True

hardy fern
sinful spade
formal goblet
hardy fern
#

The '-' and '//' caused issue in my case.

#

Had to cover those in string.

sinful spade
#

right, which is why i tried string('d6') as well, to no luck.

formal goblet
#

ref('item.itemRollBase') can be shortened to item.itemRollBase

sinful spade
#

thanks lol
while it's less efficient, i'm gonna keep the ref() just for my own sanity, it helps me remeber what it's doing.

#

unless it's breaking something

formal goblet
#

Nope, it's not. Just shorter

#

And item.itemRollBase is kinda... redundant with the item in the Component key

sinful spade
#

🤣 at the time i didnt know that i could reference it with item.key

#

i care less about it being pretty than i do it working 😦

formal goblet
#

I have to override this damn concat()-function. Nobody uses the overloaded one for numerics...

formal goblet
#

It's overloaded for different types

#

I mean... try out string(lookup()).concat('d6'). This SHOULD'T try to cast to a number, right? RIGHT!?

#

Because String.prototype.concat() != mathjs.concat()

sinful spade
#

how are you concat-ing outside of the parenths 😭 i hate code

formal goblet
#

Because you can do 'Hello'.concat(' World')

#

Because it's a prototype function of strings

sinful spade
#

string(lookup('attributeTable', 'attributeDiceQuant', 'attributeName', ref('item.itemBaseAttributeName'), '==')).concat('d6')
2,d6

#

dunno where it's getting that extra comma 🤣 but it's not an error anymore

formal goblet
formal goblet
sinful spade
#

I mean this is the closest I've gotten lol

frail kettle
sinful spade
#

is there an easier way to get the output of an enitre target item? prefix, suffix and all?
the d6 is a suffix on that original cell since i have to reference the value a lot elsewhere

frail kettle
#

oh you meant the script themselves as text files are persistent ?

formal goblet
frail kettle
#

okok in the world dir etc... got it 👍

formal goblet
#

There's also a Directory for Macros. Just click on the folder icon in the hot bar

frail kettle
#

that's per world as well ?

#

or global

formal goblet
#

Almost everything is world-bound

#

Exceptions are modules, which are global (but can contain world-data ofc)

frail kettle
#

Huh, what's the difference between Apply and Save Macro... I mean save macro is obvious but apply

sinful spade
#

run vs save?

frail kettle
frail kettle
formal goblet
frail kettle
#

oh ok

#

makes sense if you make a big macro would be annoying to close it after each line for the save addicts

sinful spade
#

so I'm guessing there's no way to target a cell with pre/suffix?

another solution, - is there a way to in real time grab items out of a dynamic table? e.g. hidden components exporting the value without using a lookup function?

formal goblet
sinful spade
#

like I can make a hidden label that uses the lookup function to just get the 2 - then later concat the label 2 and the d6 in the item roll.
Is there a way to do that real time with additions and what not?

sinful spade
#

the 'd6' is just a suffix

formal goblet
#

Which is intended

sinful spade
#

i see.
and a real-time export of the base values?

#

i could make a hidden column with the concat predone actually

frail kettle
#

@formal goblet
Your world script example is on its way to be obsolete :

formal goblet
#

And well, until V14 is a long way

frail kettle
#

wow such change

formal goblet
sinful spade
#

i'll play with the css ^^ display: none !important; should work.

#

But i guess that's a feature request martin, a function or other way to access label-prefix/suffix.
Like how we use item.name to specify for the item could we somehow get a
prefix.<label>.suffix addons?

sinful spade
#

it'd be a bit of a hastle if you want the full output:
prefix.label label label.suffix

#

😦 oh ok

formal goblet
#

We want to keep the system properties clean. If something is not intended to be used as a prefix or suffix, then it should be part of the Label text