#Custom System Builder

1 messages · Page 45 of 1

dense pine
#

im trying to figure this out too. There are scripts in the CSB Wiki if you are familiar with Macros

elfin gulch
#

None of those seem to remove them from that menu, I can add new ones in like three different ways, but I can't remove those defaults...

dense pine
#

i asked the same question a while ago, see here

grand obsidian
#

Hi hello Aldo, this is Yann, your french Supers Fan, I have not found any Supers module for Foundry so I'm trying to learn Custom System Builder for Supers

bright cape
grand obsidian
#

After he created some templates and objects and explained me how it worked. It was still difficult but a bit less, I have understood what I didn't manage to understand the first try

#

Still I would prefer a Supers System in Foundry but I know making a game system take time and people doing this on Foundry usually do it on their spare time so I cannot be disappointed if no no one has really the time for this.

#

I should probably learn JavaScript and do it myself but these days I am pretty tired and not really in the right mindset to learn coding.

bright cape
grand obsidian
# bright cape I get it. I’d throw myself into that project, but remember - I don’t have owners...

Thanks for the reminder, I tend to forget that even if you are one of the game designer, you are not the owner of the IP. I don't think Hazard Studio will produce a character sheet for any VTT. I don't know the company personnally but Supers RED was conceived in 2014 and it's 2025 now. If nothing has been done in 11 years, I don't thing Hazard still care about Supers, but you know them better than me 🙂 .

#

I have asked my players if we should switch to another superhero system I own and which has a Foundry system, that reduces the number to Mutants & Masterminds, Tiny Supers and Wild Talents. Of all these three, the first is the one I know better but character creation is quite a work. I think Tiny Supers is too "Tiny" to game with it in my Necessary Evil campaign and at last, Wild Talents, I haven't read the rules for a long time and the Power Creations are still a mystery to me.

#

Besides the players don't want to switch. They like Supers RED.

round badger
#

I did the same thing, removing all the default icons and making my own with a world script:

//... snip
"esmodules": [
    "my-script.js"
  ],
//...snip

//create my-script.js (or whatever you want to call it) then add or create
// a setup hook

//remove and change status icons
Hooks.on("setup", () => {
  CONFIG.statusEffects = []; //remove all icons
  CONFIG.statusEffects.push({ id: "defeated", label: "Defeated", icon: "path/to/desired/image.png" }); //add new icon
  //... add more push statements for other icons
}); // close the setup block```
Hope that helps 🙂
#

Note: The id used to reference the effect in code and the label is what you will see in the UI.

bright cape
crimson aspen
#

sooo i am trying to post a document link to a chat. like @Item.[e1GENaKeXG7mmi9q]
It will always try to evaluate this as a roll. Is there a fixed way to handle [] without the system trying to evaluate a roll?

bright cape
#

Hi folks! I'm trying to create a Dynamic Table with two columns. How do I accomplish that? The idea is that I can use it for traits. I'd like one column to be a text field where players can enter the name of the trait or ability (in bold) and the second column to be a text field where they can write a description for the trait (not bolded).

formal goblet
crimson aspen
hollow crow
#

Good evening, i wrote this formula in a Spell-Item Text Label {fetchFromActor('selected', "level")/2}$d4: the purpose is to show the damage dealt from the spell increasing with the character's level. The fact is more often than not the program doesn't update the value when a different character is selected. I mean, the roll and the formulas work correctly because the number of dice thrown is right, but "visually", on the spell item sheet, the damage label doesn't show the right value because it "remebers" the previously selected character's level. Rarely the value is upddated though so i don't understand why the program sometimes updates the value in the label and sometimes doesn't. Is there a formula, a script or something to force CSB to update spell item sheet on opening? I've already tried 'reload template' and this sometimes works and sometimes not....

formal goblet
formal goblet
dire socket
#

Hey so, pretty random and serious issue. My custom system builder seems to have just stopped working entirely. Like my sheets are blank and only show items and this are the onyl errors I get.

#

sheets look like thsi

formal goblet
dire socket
#

It's very weird, I just happened upon my game in this state after taking a 4 day break from a session where everything seemed to work just fine

#

I am on Forge, if that helps. The issue persists between games so maybe it's the system itself somehow?

formal goblet
#

Which browser do you use?

dire socket
#

Chrome

formal goblet
#

Any modules?

dire socket
#

A lot, but its still like this when theyre all off

formal goblet
#

And does a new world trigger the same error?

dire socket
#

Lemme check

dire socket
formal goblet
#

There's something corrupt with the system file

dire socket
#

Ah I see

formal goblet
#

Or your browser is doing weird stuff

dire socket
#

Should I try reinstalling the system?

formal goblet
#

First Ctrl + F5

#

Then try reinstall if that doesn't help

dire socket
#

Thank you

formal goblet
dire socket
#

Got it, I'll keep that in mind

oblique willow
#

Reposting this one. I still don't understand why it's erroring out. It's not a critical issue but I like to understand what I'm doing

formal goblet
#

I suspect you forgot quotes around ${item.cooldown}$ at the top

#

Otherwise I also can't spot a syntax issue there

candid badger
#

Hello - I am building out a custom system (no pun intended) that I originally had built out in Sandbox. I am moving through the wiki well enough, but I cannot find an answer to what is something I think should be easy. How do you pull into two different variables from a dialog? For example, I have a popup dialog asking for a bonus and a penalty. I want to add the bonus and subtract the penalty from a roll, but I cannot find how to do that. i can get it to do one, but not both.

formal goblet
candid badger
#

Okay...got the roll calculating correctly, but how do I get the bonus and penalty to appear in the chat vs. the word modifier?

candid badger
#

Hopefully I post this correctly:

<table>
<tr>
<th>Agility Check</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[1d20]}$</td>
</tr>
<td>Agility</td>
<td>${agility}$</td>
</tr>
<tr>
<td>Modifier</td>
<td>${?#{Modifier}}$</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>${Roll + agility + bonus - penalty}$</strong></td>
</tr>
</table>

formal goblet
oblique willow
formal goblet
candid badger
formal goblet
candid badger
oblique willow
eternal flame
#

Hello, I am having trouble creating the token in the scene. I pick up the actor, drag it to the scene, and release it, but nothing appears. I asked for help in _troubleshooting and they told me to come here, explain the issue, and show this image because it apparently is a game system issue. Can someone help me?

lone patrol
#

hey! currently running on V12 - there seems to be no percievable difference between Tiny and Smaller for number fields. havent tested if its the same on the other fields, but thought i should let know as Small isnt the right size for me, but tiny is, well, tiny!

elfin gulch
formal goblet
steel musk
#

Greetings, is there a way to fetch the ID ${fetchFromActor('Steven', "1236449256419")}$

#

I'm trying to grab onto the name under the id, since it's returning [object object] and display it in a dropdown list label formula.

#

But obviously I need the ID first that I assume is randomized.

formal goblet
steel musk
#

Yes this worked thank you!

lone patrol
#

i know this isnt a CSS classroom but i'd appreciate some help - does anyone know how best to target the sliders for CSS modification? I've been reading This but have had no luck at getting them to change so far.

#

not quite sure what class(es) i should be trying to modify

grand obsidian
steel musk
# formal goblet It's `item.id` in an Item Displayer if you mean that. If you want the names in ...

So I managed to input in to Formula for Key-Options:
${lookup('pc_weapon_list', 'pc_weapon_damage')}$ which turns pc_main_weapon = pc_weapon_damage
While displaying the dropdown label with the name of the item in Formula for Label-Options:
${lookup('pc_weapon_list', 'name')}$
Is there a way to store multiple items in the component key or is this a limitation? I've got another value I wish to track to determine if the weapon is ranged.

potent fossil
#

When I fetchfromActor something is there a way to have a default value for the variable in case the item is not in the sheet yet ?

lone patrol
eternal flame
formal goblet
eternal flame
#

Foundry

#

System

formal goblet
eternal flame
#

It didn't work

#

It looks like the error is in this line within "ator.js"

keen carbon
#
<h3>Damage</h3>
${Roll:=[:roll_dice:]}$ ${#Strength:=fetchFromActor('attached', "str", 0)}$ ${!Strength==0 ? '' : (Strength>=1 ? '+' : ('-'))}$ ${${!Strength==0 ? '#' : ''}$Strength:=fetchFromActor('attached', 'str', 0)}$ ${#Protection:=fetchFromActor('target', 'protection', 0)}$ ${!Protection==0 ? '' : (Protection>=1 ? '-' : ('+'))}$ ${${!Protection==0 ? '#' : ''}$Protection:=fetchFromActor('target', 'protection', 0)}$
<div>${! concat('<br><strong class=\"result\">', string(Roll+Strength-Protection), '</strong><br>')}$${roll_type}$</div>
</div>```
#

this is the roll formula i ended up with which conditionally hides resistance/protection/defense unless it's a non-zero value, and which provides a clickable-formula-description that matches the other values

#

and which includes a dice-roll icon in the result

#

now also hides stat/strength/ability boosts/bonus/score damage unless it has a value which would actually modify the roll, and works in character sheets and in the item compendia

potent fossil
candid badger
#

Is there a way to restrict an item displayer to only 1 item?

formal goblet
crimson aspen
#

Is it possible to do something like this from a item displayer within the actor?
find(item.ITEMTABLE,item.ID,item.NR,roll)

I want to filter the dynamic table i got on a item sheet. the roll is a value from 1-20, and the item.NR field contains only those values. I keep getting the error:
key.split is not a function or its return value is not iterable

Which i cant seem to understand sadly...

this would be the ITEMTABLE
item: DICE: "1d20" ITEMTABLE: 0: {$deleted: false, NR: '1', LEVEL: '1', ID: 'm5zON9iqBF9QlnGr', TYPE: 'Weapon', …} 1: {$deleted: false, NR: '2', LEVEL: '1', ID: 'nrg2QRZ5Ewggeb1w', TYPE: 'Weapon', …} 2: {$deleted: false, NR: '3', LEVEL: '1', ID: 'aPAA1atUOy450az4', TYPE: 'Weapon', …} 3: {$deleted: false, NR: '4', LEVEL: '1', ID: 'eDEi70FRovGvCYFH', TYPE: 'Weapon', …} 4: {$deleted: false, NR: '5', LEVEL: '1', ID: 'nDSpIA5apjwc27VW', TYPE: 'Weapon', …} 5: {$deleted: false, NR: '6', LEVEL: '1', ID: 'nDSpIA5apjwc27VW', TYPE: 'Weapon', …}

formal goblet
crimson aspen
formal goblet
crimson aspen
#

Nevermind

#

yes - my bad here ^^

#

thanks a lot!

crimson aspen
#

Thought it would be because i gave the column the key "ID" but that isnt it either...

dense pine
#

I would like to display the value of a variable in a userInputtemplate that i defined in the same roll message right before i call the input template. How do i do that?

Both
${ZUSTAND}$
${fetchFromActor('attached', 'ZUSTAND'}$
dont work

crimson aspen
dense pine
#

it is created in the roll message, please see first screen

crimson aspen
# dense pine it is created in the roll message, please see first screen

then my idea stays the same. Try to use a hidden attribute or another value that is saved inside the actor data. Because if i understand correcty what the wiki says, you can use actor or item data. But i am not sure if you can use data you create inside the message. i might be wrong - but worth a shot i guess.

dense pine
formal goblet
crimson aspen
#

Even when i try it from within the item i always fall back to the key.split error. thats really strange. used it a while back with another system and it worked just fine. Is it a bug maybe?

crimson aspen
crimson aspen
crimson aspen
formal goblet
crimson aspen
# formal goblet It shouldn't be an issue to pass a string though

Yes - i am doing it like this right now:
@Item[${!find('ITEMTABLE','ITEMID','NR',roll,'==')}$]
That works like a charm. But i dont know if i can reference the table from within a actor.itemDisplayer. Normally you would do find(item.ITEMTABLE...).
But if i do that, it would give me the key.split error. My guess is, that it does that because "item.ITEMTABLE" isnt exactly a string? How would i create a reference through here to the dynamic table within the item. I hope i explained well enough... ^^

formal goblet
crimson aspen
formal goblet
oblique willow
#

Why are the new "RichTextAreas" so small, both in label and text compared to the old ones? Is there a way I can change their size?

normal ore
#

Hey everyone!

So, I need an Input List in a dynamic table to fetch entries from another actor called "Lolvard." However, its filter is another Input List in the same item row of this dynamic table called "category." I'm trying something like this:

${fetchFromActor('Lolvard', "lookup('dynamictable_configpericias', 'pericia', 'categoria', sameRow('categoria', 'Geral'))")}$

But it's not working!

What am I doing wrong?

eternal flame
oblique willow
eternal flame
#

write more

oblique willow
#

But I don't want loads of text, the old ones are still large and proper. Besides the label isn't going to enlarge is it?

honest forge
#

Is there a way to see CSS changes realtime without needing to exit/reload the world?

formal goblet
honest forge
#

Killer system, btw, ty!

lone patrol
#

ok so dragging items between a character and an item in the CSB beta is VERY buggy lol

lone patrol
#

have pushed an issue through on the GitLab <3

honest forge
#

Is there an easy way to throw a logo above the name on the actor sheet?

lone patrol
# honest forge Is there an easy way to throw a logo *above* the name on the actor sheet?

you can modify the css of the character name with h1.charname{}, in there im sure you could do some kinda content::before modification like explained hereand here to get the image in, and after that you'd need to do some flexbox/grid modification to align them but i think you could get there!

CSS has a property called content. It can only be used with the pseudo-elements ::after and ::before. It is written like a pseudo selector (with the colon),

#

this is the first solution that came to my mind but there's likely another better path - this one should work tho :>

#

a basic example that i did to modify my sheet:

    h1.charname {
        font-family: MontePro-NormaleUltra;
        color: black;
        font-size: 26pt;
        input {
            background: rgba(0, 0, 0, 0);
            border: none;
            text-align: center;
        }
    }
honest forge
#

Aha, killer idea - thank you!

honest forge
#

Yep, totally worked.

dusky mauve
#

Hi, I have Dynamic Table (dt_cleric_gods)
and other field which refer on it ( ${find('dt_cleric_gods', 'god_points_max','god_name', '${item.god}$')}$ ).

and got an error
UncomputableError: Uncomputable token "find('dt_cleric_gods', 'god_points_max', 'god_name', 'GOD_WHITE_FLAME', '===')"

because such Record not present in the DT, is any possibility to suppress such error exist? - Some kind return default value if not found.

eternal flame
#

Guys, I'm having trouble putting the token on the battlefield and I don't know what to do. I don't understand much about programming. Has anyone experienced a similar problem?

#

Is there any pre-configuration that I need to do for the token?

formal goblet
formal goblet
eternal flame
#

Is it possible to transfer the templates I made from one to another?

formal goblet
sick cedar
formal goblet
eternal flame
sick cedar
#

Status effects from the tokens menu works fine though

formal goblet
formal goblet
eternal flame
#

If I put the actor without choosing the template, it works. When I choose, it show up this.

formal goblet
eternal flame
sick cedar
fringe silo
#

im trying to do some basic crap and for the life of me cant get it to work, im trying to ref a key and then mutiply that by a constant to get a total, what am i doing wrong

fringe silo
#

is giving me a 0

sick cedar
#

Does lifeforcex have a value?

fringe silo
#

3

#

should give 60

#

would it update while reloading sheet

sick cedar
#

Yeah, you need to reload the sheets after modifying the template

fringe silo
#

yeah thats not working

#

no errors

#

do i need the ()

sick cedar
#

Not really necessary but shouldn´t be the cause

steel musk
#

isn't multiplication x?

sick cedar
#

Do the field and the variable you are using have the same name? No typos?

sick cedar
steel musk
#

ah it is for item modifiers

#

but this is a key

fringe silo
#

lfpcnum is the key where the value is to go, lifeforcex is the key for the constant

sick cedar
#

Show the definition of lifeforcex please

fringe silo
#

this what you mean

#

?

sick cedar
#

Yeah

#

You have this currently, right? ${lifeforcex*20}$

fringe silo
#

yeah

#

no i have spaces

#

removed the spaces but no change

sick cedar
#

It shouldn´t matter, if you type ${lifeforcex}$ what do you get?

#

Remember to reload the sheets after modifying the template

fringe silo
#

still 0

#

tried reload at the template level and the the reload on the sheet

steel musk
#

Whats in the field where lifeforce is input?

fringe silo
#

0

#

lifeforcex is 3

steel musk
#

Can you take a snip of the sheet where it is used?

fringe silo
steel musk
#

its 0

fringe silo
#

sheey on left is a sheet, template on right

steel musk
#

Life Force is lifeforcex?

#

ah I c

#

You want Life Force to show the multiplied number?

fringe silo
#

anything with x at the end is the muliplier

#

yeah

steel musk
#

Alright so whats going on inside Life Force?

sick cedar
#

What happens if you leave "Life Force" input field blank? What does it default to?

#

In the sheet I mean

fringe silo
#

0

#

${lifeforcex}$ but im just trying to get it to report the multiplier before i add the constast im multipliing by

sick cedar
#

Just a question, is this a value that you want to be updated every time you update the multiplier?

#

Because you are using the default value

steel musk
#

That's funny

#

I also get a zero when using a number field

fringe silo
#

what field should i use

steel musk
#

I use label

#

When I know the number is not mutable

#

Text field

fringe silo
#

in the end yes but for now im cool with it not the multiplier will change but slowly as the game proceeds

#

but it will be another mulipyier i will add to the formula later after i get base formula working

#

should i also make it the max formula cause its max lifeforce umless players have a way to go over thier max which is not done untill a higher rank

#

what is autocomplete formula are these ones that update

steel musk
#

I'm surprised, you'd think that default value would show what ever is placed there so long as it computes.

#

huh

#

Something strange does happen

#

WHen you modifie the field

#

if you give it a 1 it will do the calculation

fringe silo
#

i switched to a text field and now its just showing blank

steel musk
#

But with 0 it does nothing

#

What did you put in the text fields label?

fringe silo
steel musk
#

Oh switch it to Label

#

My bad I forgot what it was called

fringe silo
#

so i will have to create a lable for it

steel musk
#

Oh you can do Life Force: ${lifeforcex*20}$

#

But the number field works as well as long as you change the number from 0 to 1

fringe silo
#

and then for trcking wounds i just make an mumber box with damage taken

#

ugg gunna take some rework but thanks for help i like the way its gunna go

steel musk
#

Yeah I feel you buddy hang in there. You can use the number field as well as long as its multiplying by anything but 0.

#

If you want to keep your style that is

fringe silo
#

its been up in the air on how i want to do it the tracking damage will work better for my mostly manual sheet anyway

#

i think

formal goblet
#

There are info-icons at some fields (like the default-value). These contain useful information, like that the default value is only relevant at the creation of the Component

formal goblet
# eternal flame And how I do that?

You can click on uncomputedProps and check the formula. The formula doesn't work with the supplied values, so you have to do changes there. scope can help you tracking down the error.

formal goblet
potent fossil
#

Hey, I’m working on a custom world script, and I need some help figuring out how keys like ${key}$ are turned into their actual values.

For example, in chat, a message like this:

dmg..${item.final_dice_qte_neutral}$;${item.dice_value}$;${ref(item.characteristic)}$;...;${item.hands}$..dmg```
ends up looking like this:

dmg..8;10;3;6;...;1..dmg

I’m trying to set up an event listener to take these values and use them from my world script. problem being that the event listener does not understand the value returned by the keys. Maybe with some insight about how it's done I can fetch them in a better way
formal goblet
#

I think the fastest would be to do CONFIG.debug.hooks = true in the console and check the arguments of the Hook that you're interested in.

potent fossil
eternal flame
formal goblet
eternal flame
eternal flame
formal goblet
#

Actually, you can edit the JS-file. Let's see what you get, if you replace actor.getTokenDocument() with this:

async getTokenDocument(data = {}, options = {}) {
  const tokenDocument = await super.getTokenDocument(data, options);
  const rollData = this.getRollData();
  console.warn(tokenDocument);
  console.warn(rollData);

  // Prepare character roll data.
  for (const prop in rollData) {
    tokenDocument[prop] = rollData[prop];
  }

  return tokenDocument;
}
#

That should print some log messages in the console, which will tell us, with what data it computes

eternal flame
#

Okay, thank you

#

It's still showing an error in "tokenDocument[prop] = rollData[prop];"

formal goblet
#

They are in yellow

eternal flame
#

In the version without formulas, nothing appears in yellow. Do you want me to get a version with formulas for you to take a look?

formal goblet
#

You have to reload the world after changes in the code

eternal flame
#

I had forgotten to restart the world, I did it, but nothing in yellow appears yet.

formal goblet
eternal flame
formal goblet
eternal flame
#

I restarted the world and it came back, my God, one minute.

formal goblet
eternal flame
eternal flame
#

sorry

#

take the print

#

The second warning.

formal goblet
# eternal flame The second warning.

Rename your key data to something else. That seems to cause an issue. And there's highly likely also a bug in the system, because it doesn't seem right that the properties of the actor are on the top-level of the token instead of being rightfully in props

eternal flame
#

I had to leave for a meeting, came back now and changed the 'data', and it worked. Sometimes I forget that the default programming language conflicts with mine.

#

Thanks for the help.

crude matrix
#

Never installed this module before, it's not showing up in the foundry module manager and using the repository link doesn't work either? Foundry is up to date and I can install other mods just fine (including the CSB example). Am I missing something?

formal goblet
crude matrix
#

Custom System Builder, are there different modules?

formal goblet
#

Eh... system

crude matrix
#

oh my god

formal goblet
#

CSB is not a module 😅

crude matrix
#

oh ym fucking god

#

i have been doing this for 30 minutes

#

Why did I not

#

Nevermind, thank you for your help lmao

honest forge
#

TIL I've been doing a lot of ${concat(victories, ' Victories')}$ when I could just have done ${victories}$ Victories. facepalm

lone patrol
honest forge
#

Until the full system implementation is ready.

fringe silo
#

MCDM?

#

My Cat Does Magic?

honest forge
fringe silo
#

western rpg? always looking for a good one

#

hasnt been a good one since deadlands imo

#

swade jusr didnt do it justice

lone patrol
#

The game sells itself on the four pillars of "Tactical", "Cinematic", "Heroic" and "Fantasy", so you can expect a game more akin to DnD 4e, however it stands very distinctly apart form the core tenets which D20 Fantasy lives and dies on.

lone patrol
#

God, the things i'd do to sit in a voice chat and have someone who understands this tool well walk me through a problem i'm having

fringe silo
#

if you post the issue ppl will get to it in time

lone patrol
#

oh i know, the issue isnt that people wont help, the issue is that this issue is very complex and hard to put into words!

fringe silo
#

i usally post screen shots with questions when i find my self in that predicament

lone patrol
#

might have to record a little video on it honestly lol

lone patrol
#

nevermind - decided to just rewrite my system to make more sense LOL

lone patrol
#

is there an intuitive way for me to check if an item displayer is empty?

dire socket
lone patrol
dire socket
#

Beats me, I'm trying to figure it out. Probably a module

lone patrol
#

does it just appear? and nothing seems broken?

#

if so, move on and pretend it doesnt exist 😂

#

bugs arent bugs if you can see em /j

dire socket
# dire socket

It seems like it could be causing a previous error. Not sure though since it kinda resolves if I just ctrl f5 in a clean game

dire socket
lone patrol
#

from the looks of it, the program isnt expecting the error code as text, there's probably a missing quote somewhere. if you click on the VM6251:1 bit, that should vaguely guide you to the problem

dire socket
dire socket
#

Ah it's Dscryb

storm stream
#

peeps, apparently CSB examples module requires CSB 4.30 but CSB won't update past 4.20

#

what could I be doing wrong?

formal goblet
storm stream
#

how do I do that?

storm stream
#

also whyte version issue?

manic crypt
#

Its not an issue, the example is up to date with the beta version.

manic crypt
# storm stream how do I do that?

You have to go to the module in the ..\foundryvtt\modules folder and open the module.json file in a text editor. change the realtionships.systems.compatibility.minimum to "4.2.0" and it should stop complaining. Some of the things in the example sheet may not work, depending on if they've implemented them in there in preparation for the main release going to 4.3.0.

#

if you do that and you have a problem with something related to it, you should probably uninstall and reinstall the module and check again before bringing anything to Martin here though, because you'll have changed the code, a sort of 'voided the warrantee' situation.

trail lake
#

Is there a way of making tab titles bold or larger font?

timid marten
#

How does this work?

manic crypt
timid marten
#

something like closed ? true : false

#

?

trail lake
# manic crypt CSS stuff.

Any knowledge of how to do that. I just want the tab titles in bold and maybe a font size larger? No problem if you don't, but thought I would ask 😀

manic crypt
#

As long as closed is a key, you can just type in 'closed'

timid marten
manic crypt
trail lake
brittle moth
#

Hello !

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

Features

  • Added function fetchFromParent(), which will replace fetchFromActor('attached', ...)
  • Added new functions alookup(), lookupRange(), fallback(), fetchFromUuid()
  • Reworked the function concat()
  • Added the possibility to have multiple keys inside 1 modifier (separated by comma)
  • Adjusted lookupRef() to return an Array instead of a single value due to the change above
  • Adjusted parameter propertyName in setPropertyInEntity() to also accept an Array due to the change above

Fixes

  • consoleLog() and consoleTable() now actually let values pass through as they should instead of returning undefined
  • Fixed an issue, where user-defined properties could collide with Token-properties
  • [#409] Fixed a bug, where Template IDs wouldn't be exported
  • Fixed a bug, where local variables in Label Roll Messages wouldn't be considered when calling user input dialogs

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 !

#

I almost released a full version, but @lone patrol logged an issue with the items in items feature, which I did not see (Thank you for testing it and finding that, I really appreciate it !)
I'll look into the issue quickly and work to release a full 4.3.0 as soon as possible 🙂

static stratus
#

Hi, I'm working on my first sheet for CSB, and I'm trying to increase the spacing between two text fields. Is there a way to do this within CSB, or will I need to use CSS?

manic crypt
candid badger
#

I would like to create a component that shows a 'score' that is based on the average of 3 others numbers. What is the best way to do it?

manic crypt
#

If you need it to be a specific type of component it might vary slightly, but you could do it with a keyed Label component if you need to access the number elsewhere and don't want to be able to directly edit it.

candid badger
manic crypt
cerulean chasm
#

Hey, I seem to have broken something. I'm at wit's end trying to figure out why, but when I add an item to a character sheet, all of my hidden attributes are unset. When I remove the item, they reset. Any help appreciated.

fair yoke
#

Hello, I'm trying to modify a value on an item (from an actor context, not an item displayer) with setPropertyInEntity but what I understand from your previous message is that it is not possible at the moment, but would be doable with fetchFromUuid. Could you point me on the correct syntax to do it?

Would something like this work?
${setPropertyInEntity('self' , 'Actor.lvY0dry6JyqNG5ym.Item.tGR1MQ0OWL9UTsS1.key_of_the_field_to_set' , 0}$

And would it work only on the beta which was released yesterday ?
I've seen there is a script on the wiki that would do it, but i'm a total "javascript-illiterate" and can't make it work for me.

dense pine
#

@brittle moth Question about the upcoming Version 4.3.0:
Will the itemDisplayer inside an item be able to display items that belong to its parent (actor)?
For example: My actor has an inventory with different kinds of arrows (items) in it. i would like to display the arrows that he owns and are compatible with his bow inside the bow-item again as options to choose from which ammunition he uses right now.

formal goblet
formal goblet
mint plaza
#

heyy i have a problem with the custom system builder
${[1d100]}$+@{target|FIRE_RESISTANCE}
so i'm trying to make a formular like this work but whenever i put the @{target|FIRE_RESISTANCE} into the ${}$ formular brackets it just spits out an error

manic crypt
#

You have a fire resistance key?

mint plaza
#

i do

#

it works outside of them

formal goblet
mint plaza
#

${[1d100]}$+@{target|FIRE_RESISTANCE} so this would actually work but not calculate the d100 + my key they would just be printed next to each other

#

${1d100+fetchFromActor(target:FIRE_RESISTANCE)}$ correct?

manic crypt
#

No

#

one sec

#
${[1d100+:tgtFire:]}$```
#

You can put a # in front of the first instance of tgtFire in order to hide that line if you don't want it to be in the message.

formal goblet
#

Or simply ${[1d100] + fetchFromActor('target', 'FIRE_RESISTANCE')}$

manic crypt
#

I thought that would have some weird interaction between the roll and the fFA?

mint plaza
#

funnily enough both formulas seem to be just printing the values right next to each other

#

or not

#

only the first one

manic crypt
#

The 34 is the total, the 6 is the reflected fFA.

mint plaza
#

second one works

mint plaza
manic crypt
#

That's what I meant by inserting the #, that would hide the 6.

mint plaza
#

ahh thanks

#

🙏 you guys were a great help thank you very much

manic crypt
#

But Martin's method is simpler, if you're just after the total.

mint plaza
#

i am just after the total, the calculations will get more complex from here on out

formal goblet
mint plaza
#

how does the fetchFromActor('attached', 'DAMAGE') work it doesn't seem to take the key from the defined items and just spits out an error

formal goblet
mint plaza
#

ahh so it's the other way around

#

good to know

#

no way to get the stats of an item for a role via the charactersheet?

manic crypt
#

If you're rolling from an item displayer you can use item.key to reference the item you're creating the roll on.

#

in your case item.DAMAGE

#

you just use that in the place of any other key in the formula.

mint plaza
#

hmm ok i'll try

#

convenient

#

Is fetchfromactor( selected) only for tokens selected on the map or does it fetch from the sheet directly

fair yoke
formal goblet
fair yoke
#

Ok, no more error, thank you! but it doesn't update the value on the item...

#

@formal goblet To clarify what I'm trying to do, i need to update the value of one field of an item attached to a character. The trigger of this is a roll message is a label (button) wich is on the character sheet, but not in the item container. It should be doable on v4.3.0-rc2 If I understand correctly what you said here : #1037072885044477962 message

manic crypt
#

clarifying question: is the button a static button on the character sheet, or is it in an item displayer?

fair yoke
#

a static button

manic crypt
#

how does it determine the item to be changed? The uuid for an item changes between the uuid of the base item (in foundry's Item selecter panel) and the one that's attached to a character (two items attached to different characters will have different uuids from each other and from the item in the selector panel..).

fair yoke
mint plaza
#

${setPropertyInEntity('selected', 'ACTIONPOINT_BAR', "target.ACTIONPOINT_BAR - ACTIONPOINT_REGENERATION")}$

i have a problem i'm trying to add to a numberfield with this so that i can modify a meter but for some reason this doesn't work when executing it from the character label .

This Formula works when executed from an Item actor label
${setPropertyInEntity('selected', 'ACTIONPOINT_BAR', "target.ACTIONPOINT_BAR + ACTIONPOINT_USE")}$

#

for some reason the first formula works when i don't use a meter component as an input but a seperate numberfield

mint plaza
#

pls help

formal goblet
formal goblet
mint plaza
#

${setPropertyInEntity('selected', 'ACTIONPOINT_BAR', "target.ACTIONPOINT_BAR - ${ACTIONPOINT_REGENERATION}$")}$
has the same issue as before, when i click the button nothing happens

#

${ACTIONPOINT_REGENERATION}$

#

has also nothing happening

#

this is the meter and its current value

#

should return 20 when i click it

#

but just nothing happens

#

no text message no nothing

mint plaza
#

i don't understand other keys from meter components work

#

i'm copying this one from the keyname

#

and it just does nothing

formal goblet
mint plaza
formal goblet
# mint plaza

game.actors.getName('actorName').system.props in the console and replace the actor name with your actual actor name

mint plaza
#

renamed it to ACTION_REG

#

and there it is it says undefined

formal goblet
#

Show me the config of the Meter

mint plaza
formal goblet
mint plaza
#

NOOOOO

#

it still had a value so i thought it was correct

#

goddammit

#

i'm very sorry

#

🙏

#

but thank you very much for your help

#

i was really confused there

#

probably would've taken me another hour

#

it works❤️

cerulean chasm
#

I deactivated all of my modules and the problem persists.

formal goblet
cerulean chasm
#

foundry.js:655 Error: Failed data preparation for Actor.LHo4jJqDlz94kus5. item is not defined
[Detected 1 package: system:custom-system-builder(4.2.0)]
at Hooks.onError (foundry.js:654:24)
at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54)
at CustomActor._safePrepareData (foundry.js:10801:15)
at CustomActor._initialize (foundry.js:10630:19)
at CustomActor.reset (foundry-esm.js:10369:12)
at #handleCreateDocuments (foundry-esm.js:56444:15)
at async CustomItem.createDocuments (foundry-esm.js:11423:23)

Logger.js:33 Custom System Builder | item is not defined ReferenceError: item is not defined
at eval (eval at processFormulas (ComputablePhrase.js:128:40), <anonymous>:3:1)
at processFormulas (ComputablePhrase.js:128:132)
at async ComputablePhrase.compute (ComputablePhrase.js:157:34)
at async ComputablePhrase.computeMessage (ComputablePhrase.js:257:9)
at async Label._getElement (Label.js:107:26)
at async Label.render (Component.js:143:25)
at async ItemContainer._getElement (ItemContainer.js:262:33)
at async ItemContainer.render (Component.js:143:25)
at async Panel.renderContents (Container.js:43:25)
at async Panel._getElement (Panel.js:97:33)
at async Panel.render (Component.js:143:25)
at async Panel.renderContents (Container.js:43:25)
at async Panel._getElement (Panel.js:97:33)
at async Panel.render (Component.js:143:25)
at async TemplateSystem.getSheetData (templateSystem.js:344:41)
at async CharacterSheet.getData (actor-sheet.js:49:19)
at async CharacterSheet._render (foundry.js:5838:18)
at async CharacterSheet._render (foundry.js:6572:5)
at async CharacterSheet._render (foundry.js:7158:5)

formal goblet
cerulean chasm
#

I'll see if I can't hunt it down, here's hoping

#

Oh my goodness. That fixed it. I think I had mistyped the handles on one of the variables with & or % instead of $. Thank you so much.

brittle moth
#

Hello !

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

Features

  • Added new functions setValues() and array()

Fixes

  • [#421] Fixed an issue with item dragging within the same actor or within an item containment tree

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 !

formal goblet
short widget
#

hi, I'm having a problem to make the roll in my dynamic table work properly. I have a dropdown option in the last column, that have a custom origin (that lists the keys of my other attribute table), so the player can select a skill before rolling (as skills can use different attributes). However, when I apply the roll, it sends it to the chat, but with an error result.

formal goblet
short widget
#

sorry, I'm not a codder, what you mean by check the properties?

formal goblet
formal goblet
#

Because you only get a static text from a Dropdown

short widget
#

thanks

#

can u help me with other question? 🙂

#

how I make the roll be with advantage when the check box is checked?

fair yoke
fair yoke
#

And it's working !!! Thanks again @formal goblet , I've been struggling with this for a few weeks now, it is a relief! ❤️

manic crypt
formal goblet
formal goblet
# short widget how?
${#roll_formula:= sameRow('training') ? '2d10kh' : '1d10'}$
${[:roll_formula:] + sameRow('attributevalue')}$
sick cedar
#

Is there a way of delaying the messages printed by a macro until the dice has finished rolling? I don´t know if this is a weird interaction with "Dice so nice" module but the messages printed by the macro are being printed (correctly though) before the table from this formula is shown

${?#{DamageRollTemplate}}$ <table> <tr> <th colspan="2" style="text-align: center; vertical-align: middle;"><img src='${!%{return linkedEntity.img;}%}$' width="48px" height="48px"></th> </tr> <tr> <td colspan="2" style="text-align: center; vertical-align: middle;"><strong>${item.name}$</strong></td> </tr> <tr> <td>Damage dice roll </td> <td>${damageRoll:=[:targeting_advantage_option:]}$</td> </tr> <tr> <td>Extra Damage dice roll </td> <td>${damageExtraRoll:=[:damage_extra:]}$</td> </tr> ${#damageModifier:= (damageRoll+damageExtraRoll)<10 ? round(((damageRoll+damageExtraRoll)*0.05)+0.45, 2) : round((damageRoll+damageExtraRoll)*0.1, 2)}$ <tr> <td>Raw Damage </td> ${#damage:=${round(equalText(item.item_basetype,'Physical') ? (pc_totalstrength*item.item_damage*damageModifier) + (pc_totalstrength*item.item_damage*damage_type): (pc_totalmagicpower*item.item_damage*damageModifier) + (pc_totalmagicpower*item.item_damage*damage_type))}$}$ <td>${damage}$</td> </tr> </table> ${#%{ const macroCompendium = game.packs.get('world.utility-macros'); macroID = macroCompendium.index.find(t => t.name === "CalculateTargetDamage")._id; return await macroCompendium.getDocument(macroID).then(m => m.execute({damageType: "${item.item_basetype}$", rawDamage: ${damage}$})); }%}$

formal goblet
sick cedar
#

Nothing serious though, just weird seeing the final damage values before the dice has finished rolling :v

short widget
formal goblet
short widget
#

<h1>Skill Test ${sameRow('skillname')}$</h1>
<p style="text-align: center;"><strong> ${#roll_formula:= sameRow('training') ? '2d10kh' : '1d10'}$
${[:roll_formula:] + ref(sameRow('attributevalue'))}$</strong></p>

formal goblet
short widget
#

aaah foundit thanks

#

worked 🙂

#

I'll publish the system next week, is for Battle Century G-Remastered

#

there is anyway to block the text field camp to it cant be edited by players?

formal goblet
short widget
#

or here?

formal goblet
# short widget here?

Yep, formula must resolve to true or false. You can set it to false without any logic to hide it unconditionally

short widget
#

coool

#

beautiful

proper dagger
#

I can't seem to call a custom user input from a template. I've been using the formula, ${?#{<userInputTemplate Test>}}$, which returns "A user input template was not found."

Any ideas?

brittle moth
proper dagger
#

Beautiful! Thanks

#

Follow-up, what formula might I use in a roll message to get the larger or smaller of two rolls? Like for advantage/disadvantage.

formal goblet
proper dagger
#

What does "Store it in a local variable" mean? I'm sorry, this stuff is not my forté.

formal goblet
#

Using that, we can use the ternary operator (a conditional operator) to decide, if we either use the kh (keep highest) or the kl (keep-lowest) modifier:

${roll_modifier:= checkboxKey ? 'kh' : 'kl'}$
${[2d10:roll_modifier:]}$
proper dagger
#

Ok, starting to understand. Let's say I have two check boxes, one for advantage, one for disadvantage.

#

Or would that not be the best way to handle it?

brittle moth
#

A better way would be to use Radio buttons, one for advantage, one for default roll and one for disadvantage. That way your players cannot select both advantage & disadvantage

formal goblet
proper dagger
#

Ok, so use a radio button. How would I use that in the above sample formula?

formal goblet
proper dagger
#

Yay! Made it work

#

That last '1d10', what is that for? Is that if neither are checked? I can't seem to have none checked.

sick cedar
#

You need a third radio button for the regular roll

proper dagger
#

Just figured that out lol

#

Thank you guys for the help, and thanks for making the system in the first place! Keep up the good work

raven raven
#

how do you do soething like this in CSB? I mean how do you use icons on the character sheet?

sturdy mesa
#

I'm trying to make a specific roll in CSB. The characters roll a certain number of d10 dice. I would like to separate all the "1"s rolled from the rest of the roll, counting as critical failures. Does anyone know how I can do this?

And is it possible to double the successes of the "10" rolled?

oblique willow
#

Going to ask this again, why are the new "RichTextAreas" so small both in label and text compared to old ones? Is there a way I can change their size? The font is different too.

formal goblet
formal goblet
brittle moth
# oblique willow Going to ask this again, why are the new "RichTextAreas" so small both in label ...

What do you mean by "new" ?
I haven't changed anything drastic lately, but maybe Foundry Core did, since I'm using the core's functionality to generate these editors.

I'm sure we didn't change the font-size.
The editor size on editing is an open issue (https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/417) on which I'm working (not easy to fix, btw... automatic height is not easy to manipulate...)

oblique willow
#

I'm still on foundry11 due to most modules not updating or working properly on 12 yet. I updated from... some older version of CSB to 3.2.5 and it seems all rich text areas that were empty now have both their label and text drastically reduced. Also affects any new such richtext

brittle moth
#

Existing and filled areas were not impacted ?
There has been some tweaking to Rich Text Areas in v3.x versions, but I don't remember modifying the font size

oblique willow
#

Like in my screenshot, there are 2 text areas. The upper one looks as before, the lower one is new.

#

It also seems like a different font? Or at least greyer.

brittle moth
#

I am pretty confident saying CSB is not the culprit then. Any update we would have done on component display like this would have impacted every text area equally.

Is your game accessible from the internet ? I would like to take a look to help you 🙂

oblique willow
#

Give me a moment to setup a user

#

I'd also like to add that I hate that discord doesn't have any real forum features, or actual functional search.
I wish there were actual posts I could look through to find what people have done/asked instead of asking myself or being a discord-detective

brittle moth
oblique willow
#

Ooh. Let me try.

brittle moth
#

Word of warning though : if you change the key in the template, you'll lose all the data associated in the field. Please make a backup or create a new Rich Text Area beforehand

oblique willow
#

Yep that did the trick, so used to CSB warning me about any key thats already in use. Maybe its good to add a warning for this one too?

brittle moth
#

yep, I'll add it to the list of reserved keywords ^^"

oblique willow
#

Thanks so much for your help, you're all stars around here

formal goblet
mint plaza
#

Is there a way to check how many spaces an actor moved in a turn?

formal goblet
brittle moth
formal goblet
#

Ah yeah, that one displays it

mint plaza
#

can i use the amount it shows to calculate things?

brittle moth
mint plaza
#

unfortunate but the module is still useful i'll just add a numberfield where you can type in your squares walked and then i'll add a label to apply it

oblique willow
#

Drag ruler is really useful, I made my own mini-module for it to implement the different speeds for my csb system

mint plaza
#

for some reason when using drag ruler it doesn't let me move the tokens anymore and just says they are locked while creating a ghost token on the map

raven raven
#

is there any way to insert a Rolltabel into the character sheet?

formal goblet
steel musk
#

Hello, I decided to try out Calling macros from the sheet per 3.3.4. and just simply execute the script the only thing I change is what my macros are named. Why is it displaying an error? Because it's giving me the character sheets name I assume the error must have something to do with the sheet and not the macro? I dragged the macro into the quick buttons slot and same error occurs. I feel like something is being added to the script causing the error. The roll is executed just fine and seems to work, the console displays no error to my knowledge.

formal goblet
steel musk
#

Oh so the script needs a return.

rocky sable
lone patrol
#

Just found something about the items-in-items while testing CSB's Beta branch - you can put something inside of another item, and then if you dont have an item displayer, you dont actually have a way to get it out!! Would help having a "can store items?" toggle somewhere that prevents something like this

crystal quarry
#

Yo, so I'm using Custom System Builder in a fairly minimal way; essentially, there is a Google Sheets file that is already scripted and ready for use, and I want to piggyback off of it, as it is a very complex system that would take very very long to make.

I found a module that allows me to add the Google Sheets to the Character sheet and add references to specific cells, but I cannot get this to work.

When I try to add HP to the bars, it does not allow me to add a "maximum". Is there a way to have Custom System Builder reference a different Attribute for the maximum HP?

lone patrol
#

How can i access the max value of a meter?

raven raven
#

Is it possible to create a dropdown list, with labels that have Labell roll messages ... So i want to select a text from a dropdown list, and if i click on the text, i want it to roll 1d6 for example

#

?

ashen turtle
#

help, CSB has somehow completely stopped working for me on Forge. no updates or anything, tried reinstalling the system, doing a new blank world, all that. character sheets are blank and look like this, CSB settings don't show up in the settings

brittle moth
brittle moth
brittle moth
brittle moth
brittle moth
raven raven
ashen turtle
brittle moth
dense pine
#

Anyone familiar with the Modul Status Icon Counters and made it work with CSB? This module allows to display COunters for Active Effetcs (that works) and to multiply the Status Modifiers according to the Number of Effects. The later Part doesnt work for me

#

eg a status effect gives you Attack -1 , so 3 stacks should result in Attack -3.

#

that doesnt work

#

maybe part of the problem is that when you configure your custom active effects in your template these effects have no name as seen on the screenshot

#

i defined the names beforehand via a world script.

ashen turtle
brittle moth
ashen turtle
#

Nothing. I find this extremely weird but guess I can use Chrome for now

brittle moth
#

Bugfix time, we are close to release !

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

Features

  • Switched all Rich Text Editors to ProseMirror

Fixes

  • [#379] Fixed a bug causing undefined values in Item Displayers to be populated with the values of previous items
  • [#418] Fixed Dynamic Tables & Item Container sorting system
  • [#397] Fixed Dynamic Tables default value handling, correctly computing default values & formulas in default values
  • [#417] Fixed an issue with text editors opening too small

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 !

formal goblet
dense pine
candid badger
#

Hello!
I am having trouble with an initiative calculation:

${ceil(attributeinitiative+professioninitiative+insightinitiative+gearinitiative+miscinitiative)}$

Everything calculates correctly except attributeinitiative which is based on another calculation: ${ceil((agilty+intuition+aura)/3)}$

I figure that is what is causing the issue, but I don't know how to resolve it. How do you include the result of calculation in one label in the calculation of another label?

formal goblet
formal goblet
candid badger
formal goblet
candid badger
formal goblet
#

Do you use this ${ceil(attributeinitiative+professioninitiative+insightinitiative+gearinitiative+miscinitiative)}$ in the sheet or in the game settings?

candid badger
#

sheet

formal goblet
#

Alright, what are your values of your variables?

candid badger
#

Apologies - is this what you are looking for?
agility = 1
intuition = 2
aura = 2
the average coming out to 2

formal goblet
#

Knowing the value of agility doesn't help me, because you haven't clarified the dependency to it

candid badger
#

The first is from the template and the second is from the sheet

formal goblet
candid badger
formal goblet
candid badger
formal goblet
#

Because it tells you, that you do and that the values inside are not valid

#

Did you reload the sheet?

candid badger
raven raven
#

Is it possible to write a formula that would automatically populate a text fielf with the items UID?

#

like this?

formal goblet
#

You can use setPropertyInEntity() in a Label Roll Message though, that would update your Input Component.

formal goblet
raven raven
#

i only need it to populate once, it does not have to "refresh", even creating a macro which would populate this field in all my equippableitems would be fine.

#

All my equippable itmes has a UID field like this and i dont want to copy paste all the uid-s into all the fileds all the time....

formal goblet
raven raven
#

yes I know, thats not problem

formal goblet
#

You can replace entity.items with game.items

#

Just make sure that you have a backup before executing. You might unintentionally delete data

raven raven
#

Okay, so I have created _Test category for testing

#

So my code should look like:

lone patrol
lone patrol
raven raven
#

const itemTemplateName = '_Test';
const itemTemplateId = game.items.getName(itemTemplateName).id;
game.items
.filter(item => item.system.template === itemTemplateId)
.forEach(item => {

...and then what?

formal goblet
raven raven
#

yes I know, thats what I mean "created _Test category" I mean template...

#

so here is an item belonging to the :test template

formal goblet
#

Then it's just:

//...
.forEach(item => {
  const uuid = 'yourUuid';
  item.update({'system.props.ID': uuid});
});
#

This will update all Items using that Template with the same UUID

candid badger
formal goblet
#

Because you always need those when using static text values

#

actorName => variable
'actorName' => string

candid badger
# formal goblet Did you use quotes for the name?

No... 😔

Did that and got this:
{
"name": "Testing",
"agility": "1",
"finesse": "2",
"might": "3",
"influence": "3",
"intellect": "4",
"intuition": "2",
"aura": "4",
"power": "1",
"resolve": "1",
"labelphysical": "PHYSICAL",
"labelagility": "<p>Agility</p>",
"labelfinesse": "<p>Finesse</p>",
"labelmight": "<p>Might</p>",
"labelmental": "MENTAL",
"labelinfluence": "<p>Influence</p>",
"labelintellect": "<p>Intellect</p>",
"intuitionlabel": "<p>Intuition</p>",
"labelspiritual": "SPIRITUAL",
"labelaura": "<p>Aura</p>",
"labelpower": "<p>Power</p>",
"labelresolve": "<p>Resolve</p>",
"labelorigin": "ORIGIN",
"labelcareer": "CAREER",
"professioninitiative": "1",
"insightinitiative": "2",
"gearinitiative": "3",
"miscinitiative": "4",
"professiondefense": "0",
"attributedefense": "1",
"insightdefense": "0",
"geardefense": "0",
"armordefense": "0",
"miscdefense": "0",
"professionoffense": "0",
"attributeoffense": "2",
"insightoffense": "0",
"gearoffense": "0",
"miscoffense": "0",
"totaloffense": "2"
}

formal goblet
#

I don't see attributeinitiative. Did you forget to declare a component key for that?

candid badger
#

Found it in the 'Some props were not computed section':

{
"name": "Testing",
"agility": "1",
"finesse": "2",
"might": "3",
"influence": "3",
"intellect": "4",
"intuition": "2",
"aura": "4",
"power": "1",
"resolve": "1",
"labelphysical": "PHYSICAL",
"labelagility": "<p>Agility</p>",
"labelfinesse": "<p>Finesse</p>",
"labelmight": "<p>Might</p>",
"labelmental": "MENTAL",
"labelinfluence": "<p>Influence</p>",
"labelintellect": "<p>Intellect</p>",
"intuitionlabel": "<p>Intuition</p>",
"labelspiritual": "SPIRITUAL",
"labelaura": "<p>Aura</p>",
"labelpower": "<p>Power</p>",
"labelresolve": "<p>Resolve</p>",
"labelorigin": "ORIGIN",
"labelcareer": "CAREER",
"professioninitiative": "1",
"insightinitiative": "2",
"gearinitiative": "3",
"miscinitiative": "4",
"professiondefense": "0",
"attributedefense": "1",
"insightdefense": "0",
"geardefense": "0",
"armordefense": "0",
"miscdefense": "0",
"professionoffense": "0",
"attributeoffense": "2",
"insightoffense": "0",
"gearoffense": "0",
"miscoffense": "0",
"totaloffense": "2"
}

it shows undefined

formal goblet
#

You have a typo in agilty for your attributeinitiative

candid badger
raven raven
#

const itemTemplateName = '_Test';
const itemTemplateId = game.items.getName(itemTemplateName).id;
game.items
.filter(item => item.system.template === itemTemplateId)
.forEach(item => {
const uuid = 'yourUuid';
item.update({'system.props.ID': uuid});
});

So the code worked, but I dont want to update each item with one specific UID, but I want to update each item with its own UID

formal goblet
#

This will always point to the UUID of the own entity

raven raven
#

its hard to explain what I am trying to do but I keep these items In a item container, and one of the labels of the container has this label roll message: ${item.ID}$

#

and the items had an ID text field

#

that contained uidis @UUID[Item.oEuhab2vtVhGbZTW] like this

#

so when I clicked the button it sent the ide into the chat

#

the goal is to have a button on the character sheet that send the item into the chat

#

%{return entity.entity.uuid;}% will give me the uid

#

but the format is not okay @UUID[ ] is missing

formal goblet
raven raven
#

yes

formal goblet
raven raven
#

What could help, is a button that copyes this ID ...

#

to this text field

raven raven
formal goblet
#

Then why the Text Field, if it contains the same value as the Label?

raven raven
#

because the label updates when i copy it to a character sheet...

#

so the palyers will not see the ability if i send it to the chat, unless i give then visibility to the character sheet, meaning they will allways see all the abilityes of the enemy, also all other stats...

#

...

#

Aslo if I do this:

#

then the text field will be populated with the ID of the TEMPLATE

formal goblet
raven raven
#

so every other ID will link to the template.

#

just tested this

#

I either need a button that "refreshes" the text filed, filling it with the ITEMS ID instead of the TEMPLATES.
or I need to stop the Label from refreshing.

formal goblet
#
//...
.forEach(item => {
  item.update({'system.props.ID': '@UUID[' + item.uuid + ']'});
});
raven raven
#

const itemTemplateName = '_Test';
const itemTemplateId = game.items.getName(itemTemplateName).id;
game.items
.filter(item => item.system.template === itemTemplateId)
.forEach(item => {
item.update({'system.props.ID': '@UUID[' + item.uuid + ']'});
});

#

like this?

raven raven
#

one small problem...

#

i assume this will update all the items that are already belong to a character right?

formal goblet
#

No, game.items

#

This only includes Items in the directory and nowhere else

raven raven
#

I love you man...

#

thank you

#

is there a way to apply this on multiple template at once?

formal goblet
#
const itemTemplateNames = ['_Test', '_Test2'];

game.items
  .filter(item => itemTemplateNames.map(name => game.items.getName(name).id).some(id => item.system.template === id))
  .forEach(item => {
  item.update({'system.props.ID': '@UUID[' + item.uuid + ']'});
});

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some

MDN Web Docs

The some() method of Array instances tests whether
at least one element in the array passes the test implemented by the provided
function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array.

heavy elm
#

Hey Team CSB, its possible to use JS with component keys? When I try at first it didnt work and just returend me an empty field. After I added another value with + it worked but as soon as I recreated my character sheet it blew up everything throwing me errors everywhere?

formal goblet
heavy elm
# formal goblet It is, but it highly depends on what you're trying to do ofc.

${%{ return Object.values(entity.system.props.Armor_Container) .filter(row => !row.deleted && row.Active === '✔' && (row.Body_Region === 'Kopf' || row.Body_Region === 'Ganzkörper')) .reduce((acc, row) => acc + Number(row.Armor_Protection_Standard), 0); }% + AP_Mod}$

I have this and I want to assign a custom key: AP_STA_H

And recall that key in a label. Last time I tried it threw me errors everywhere and my complete actor-sheet became unuseable.

formal goblet
heavy elm
#

Yes

heavy elm
formal goblet
# heavy elm Is that the issue?

Kinda... The thing is, that the order of computation is not always ideal.

In the system, if a dependent property is undefined, the formula will throw an internal error and postpone the computation in a later cycle, hoping that the property will have a value until then.

The same issue applies to scripts, which depend on values of computable Components like Labels and Meters. For those cases, we've added entity.throwUncomputableError(message, source). So it allows you to check for an undefined property and throw and error to postpone the computation. In the context of an Extensible Table, you'd need to check all cells within the columns you need.

heavy elm
formal goblet
#

It adds quite a lot of boilerplate code though... @brittle moth how about adding an API-endpoint (public function in ExtensibleTable), which does these checks and returns the cleaned properties (considering uncomputed props and the $deleted-rows)?

heavy elm
#

I can also do it by just copy the label again, but it would be nicer to just refer to the key and the label shows me the value

brittle moth
formal goblet
brittle moth
formal goblet
#

True, probably an issue

brittle moth
# heavy elm `${%{ return Object.values(entity.system.props.Armor_Container) .filter(row =>...

From what I read, you're trying to sum all Armor_Protection_Standard from rows where active === '✔' and Body_Region is either Kopf or Ganzkörper

You can do this using only standard formulas

  1. Set up an additional column of type Label, keyed Active_Armor, with text ${sameRow('Active') == '✔' ? sameRow('Armor_Protection_Standard') : 0}$. Hide this column from your players using the Advanced configuration
  2. Rework your AP_STA_H Label with the following text :
${sum(lookup('Armor_Container', 'Active_Armor', 'Body_Region', 'Kopf')) + sum(lookup('Armor_Container', 'Active_Armor', 'Body_Region', 'Ganzkörper')) + AP_Mod}$

Your Label should be reflecting the right value, and will be correctly computed each time (because it will check for computation order)

heavy elm
brittle moth
heavy elm
#

Nah its kinda my mistake I made that a text

#

Its a little exotic

#

Thank you 🙂

heavy elm
formal goblet
heavy elm
formal goblet
# heavy elm

Check what's inside uncomputedProps, these indicate errors

heavy elm
formal goblet
# heavy elm

Seems like you have issues in the Costs and Total-colums of your Skills-table

#

Check scope, if your values are correct

heavy elm
formal goblet
heavy elm
formal goblet
# heavy elm

Base is missing and you have a whitespace at Mod (probably not really an issue, but it's better to be clean)

frozen willow
#

Hello!

First of all, thank you so much for your work, it makes it so easy to make actually usable character sheets.

I am currently having major issues with performance, some actions taking a full minute to resolve, and opening items taking up to 30s.
I tried many things that improved performance a bit: disabling field controls, delaying entity saving, reducing numbers of item containers (by putting everything in one and filtering), disabling log, etc.
My main issue is that sometimes (very rarely) items open without any issue, but most of the times it strangely recomputes all items tens of time ("All props for _ computed in 1-4 loops" for all items, computing the same items tens if not hundreds of times), and it makes it a real struggle to play.
My items either modify the character sheet (equipment) or are modified by the sheet (spells) but not both at the same time.
Do you have any idea of where this issue may come from please? I am at a complete loss.

Thanks in advance for any help! 🙂

heavy elm
#

Also the whole armor-thingy is throwing errors on me when I create a new Actor and give him an amor

candid badger
#

Hello again.
Can you add to a number field with a formula? And if so, how?
For example: a healing potion adding to the life score.

formal goblet
formal goblet
heavy elm
formal goblet
frozen willow
formal goblet
#

Although, why is that a Formula instead of a Number Field, if it is the base value?

heavy elm
formal goblet
#

To be fair, show me a simple update-lifecycle in any framework...

frozen willow
#

(I understood that I could reduce the number of loops by items, but the maximum I've seen for some spaghetti-coded item types is 4, so I guess it is not my main issue)

formal goblet
#

I have never run these kind of performance tests

frozen willow
formal goblet
#

I talk about stuff like fetchFromActor('attached', ...), where the Item needs data from the Actor

frozen willow
#

I see, but my equipments only interact with the sheet through modifiers (and item containers of course), they have no fetch, and still get recomputed tens of times (each in 1 loop).

#

My spells have multiple fetch so get computed in 1-4 loops, but my problem is that it is doing the same things tens of times in a row....

formal goblet
#

Foundry itself announced a performance-update for V13 regarding this topic. So it might be completely on their side. Until then we have to take the meat.

frozen willow
#

Hm. I'm a bit comforted that my spaghetti code is not the source of the issue, but sadened that I can't really do much about it.
Thanks again, I hope you can make CSB work on V13 (when it's out) without too much pain 😄

formal goblet
frozen willow
#

Btw, I was wondering about loops (for, while, ...), any plans on implementing them?

formal goblet
frozen willow
#

Thank you for the info 😉

formal goblet
frozen willow
normal ore
#

Why aren't my changes being saved?

frozen willow
normal ore
#

But is this a bug?

frozen willow
# normal ore But is this a bug?

I saw in the 4.3.0 beta changelog that they stopped using rich text fields "Switched all Rich Text Editors to ProseMirror", maybe that'll help, haven't tried yet

formal goblet
normal ore
#

@formal goblet ,
So, is it recommended not to use the "delay entity saving" feature?
Could this feature be impacting other areas, or just this component?

formal goblet
candid badger
formal goblet
candid badger
formal goblet
#

Keep in mind, that values are set and not added. You have to adjust your values by your own.

candid badger
formal goblet
formal goblet
candid badger
formal goblet
#

The only thing I can think of, are that your Label Roll Message and your target Component are not part of the same sheet.

#

Actors and Items are different sheets

candid badger
#

This is the actor sheet. The button is where i put the SetProperty formula and the vitality number component is right next to it

candid badger
formal goblet
#

Alright, everything seems correct...

#

Nothing in the console?

candid badger
# formal goblet Nothing in the console?

console looks good - no errors
I am going to try backing up and just creating somethign simpler first and see if I can get to the conclusion on why this thing is doing what I want

candid badger
#

is there a way to remove the default d20 from appearing when you use the label icon? I have both icons showing up

formal goblet
candid badger
#

When i use the SetProperty... formula it is not recognizing that I have a max value in a number component. If I try to enter manually an amount greater than the maxvlue, I get a warning message and the entry caps out at the max. If i click on the button and add an amount over the max, it just adds it regardless of the max

formal goblet
#

You can use the min()-function in the formula to cap the result

normal ore
#

Can I create a function or formula that returns the 'uuid' of the actor I'm currently using? I'm asking if this is possible with CSB formulas ${}$ and not like this one
%{return entity.entity.uuid;}%

manic crypt
#

I believe that fetchFromAcror() can have uuid, and I think (not at my computer atm) that uuid might be one of the reserved keys on the csb documents. Did you try it out?

normal ore
#

Yes, I tried. I tested it in several ways, and it didn’t return anything!

brittle moth
heavy elm
frozen willow
vagrant hollow
brittle moth
frozen willow
# formal goblet Check the conversation from this point onwards: https://discord.com/channels/170...

Hello again!
Just tried a few more things to resolve this, and it seems to not be happening (or way less at least) on recently created character sheets: one of my players was heavily affected by this issue (looping hundreds of times), I just recreated his sheet (drag&dropping items from original sheet), and the issue has disappeared.
Could it come from updating character / item templates too many times? Or editing items too many times?

Edit: duplicating all characters sheets looks like an ok workaround for this

idle inlet
#

Open to any suggestions and criticisms of what to improve on, rn trying to outline fixable things and sorta a dev-timeline

ashen turtle
ashen turtle
#

Do radio buttons in dynamic tables not pick up row data in value formulas? Mine don't seem to be doing so but I could be doing something wrong

mystic gulch
#

hi, i'm new to this stuff and i've been trying to make this work for the last 50 minutes and can't solve it. why is it not showing me the number?? always just []

Ataque à Distância: ${roll1:=[(:bonus_ranged:+:agility:-1)d6]}$ + Dado Doidão: ${roll2:=[1d6]}$ = ${result:=(roll1 + roll2)}$

Resultado: ${(:dd:-result)}$
${(roll2 == 6 ? "Sucesso doidão!" : roll2 == 1 ? "Falha doidona!" : "")}$

formal goblet
mystic gulch
honest forge
#

Perhaps a dumb item-related question:

Let's say I have a 'subclass' item type. I want to limit most actors to having only one item of this type on their sheet, but under some conditions (based on a formula) they might be allowed two - one primary and one secondary.

  • Can I limit the number of items of this type that can be added to an actor sheet based on a formula?

  • If so, can I reliably identify which is 'primary' and which is 'secondary'?

The way I'm thinking about this is 'slots' on a character sheet, but I don't see an obvious way to create a field that references a single item.

honest forge
#

The only solutions I can think of are:

  • Intercept the item creation hook and run some logic, but idk where to put this logic outside of a custom module.

  • Create a button on the sheet that calls a macro that both adds the item to the sheet and runs some other logic. But then, no way I can think of to prevent players from just dragging the item over anyway and doubling up.

full root
#

Is there any tricks to edit or add something without the UI ? I need to add a table with 45 skills, each with 5 user editable modifiers.... Doing it by hand with the UI seems like a lot of work... I have the table in html already.

formal goblet
formal goblet
honest forge
sturdy mesa
#

I have a label that acts as a button. The player clicks the button and selects some options. You know that field where the user inputs choices? For example: "Enter the difficulty," and then the player types it in.

However, I have an Item Displayer that shows "Skills," such as Stealth, Deception, etc. The player adds items (skills) to this Item Displayer.

Now, regarding my label that acts as a button, is there a way to display a dialog with a dropdown list so the player can select a skill from the list to make a roll?

The skills (items in the Item Displayer) have a field called "level," a number field, and I need to reference this number to use in another roll.

fair yoke
ashen turtle
#

Is it possible to roll an item's label directly from a script? E.g. have a button in an item displayer that rolls the "Use" label on the appropriate item

mystic gulch
#

is it possible to make a macro for a label button inside the character sheet?

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

uhhhhh, the template stopped working out of nowhere

templateSystem.js:544
Uncaught (in promise) Error: Trying to reload entity with undefined template : undefined - Actor.ze2k2eZR65YcwkzS - c
at TemplateSystem.reloadTemplate (templateSystem.js:544:19)
at HTMLAnchorElement.<anonymous> (templateSystem.js:892:26)
at HTMLAnchorElement.dispatch (jquery.min.js:2:43184)
at y.handle (jquery.min.js:2:41168)

formal goblet
mystic gulch
# formal goblet What are you trying to do in the Macro?

it's very complicated. My plan is

  1. attacker marks a target and presses the attack button
  2. the DC is calculated based on the distance between the attacker and the target
  3. it then activates a macro that asks the target if they want to dodge the attack
  4. if yes, they roll :agility:, if the result is higher than the previously set DC, it takes its place, if not, the DC continues being the same
  5. then the attacker rolls, the result gets subtracted by the DC to get the difference
  6. it checks on a table based on the difference, how much damage that would be (for example 4-9 deals 1 damage)
  7. shows on the chat if the attacker hit the target and how much damage it dealt
    (it also has a crit mechanic based on separating one d6, with 1 being critical failure and 6 being a crit)
formal goblet
#

Console is enough

mystic gulch
#

i didn't use game.actors.getName('actorName').system, i tried to get the target by using an array

#

(i'm really new to coding js sorry if it wasnt a good choice)

formal goblet
#

Does point 3 include to display the dialog in a different client?

mystic gulch
#

you mean jquery.min.js:2:43184)?

#

ah

#

got confused

mystic gulch
#

well actually it didn't work, cuz it showed in my screen, so i probably fucked up

formal goblet
# mystic gulch ye

This is advanced territory, cause you have to send web-requests to a different client

mystic gulch
#

hmmmm

formal goblet
#

But back to the actual error. Open the console with F12 and enter this command: game.actors.getName('actorName').system (replace 'actorName' accordingly)

mystic gulch
#

you want the info of the template, right?

formal goblet
mystic gulch
#

ok, so this one

formal goblet
# mystic gulch

CSB expects, that template includes the ID of the Template the Actor is using. But you overrid that somehow to the string "undefined"

#

That's why it can't find the corresponding template anymore

#

You can fix that with await game.actors.getName('c').update({'system.template': 'idOfTemplate'}) in the console (replace 'idOfTemplate')

mystic gulch
#

did i do something wrong?

formal goblet
mystic gulch
#

a different one

#

'lfonOxKVy9ghW8OY'

formal goblet
#

That is the ID. Idk what your 307... represents

mystic gulch
#

probably me being dumb

#

let me try

#

no way i'm this idiot

#

wait, i see the different, i accidently deleted the space

#

same thing wth

#

should i just start over?

formal goblet
#

Ok, how about game.actors.getName('c').templateSystem.reloadTemplate('lfonOxKVy9ghW8OY')?

mystic gulch
#

IT WORKED!!

#

thanks dude, you're the best

#

and also thanks for the patience

#

i started coding 2 days ago

#

i just know basic coding from a few courses i did so most of the things are new to me

formal goblet
#

You should be able to do much with knowledge about basic object oriented coding

#

Start with basic concepts like variables, operators and functions and continue with classes and methods

mystic gulch
#

ok!

#

again, thanks dude

#

i'll stick to the simple things for now

#

uh oh, it isn't fixed yet

#

cuz the buttons (that had nothing to do with the macros) isn't working

formal goblet
#

It's trying to get x from something, that is undefined

mystic gulch
#

``Ataque à Distância: ${roll1:=[(:bonus_ranged:+:agility:-1)d6]}$ + Dado Doidão: ${roll2:=[1d6]}$ =
${(roll1 + roll2 - %{
let baseToken = canvas.tokens.controlled[0];
let targets = Array.from(game.user.targets);

if (targets.length !== 1) {
ui.notifications.error("Please target exactly one token.");
return;
}

let targetToken = targets[0];
let gridSize = canvas.scene.grid.size;

let distanceInPixels = Math.hypot(
baseToken.x - targetToken.x,
baseToken.y - targetToken.y
);

let distanceInMeters = distanceInPixels / gridSize;

let distancePenalty = distanceInMeters * 2;

return distancePenalty;

}%)}$
${(roll2 == 6 ? "Sucesso doidão!" : roll2 == 1 ? "Falha doidona!" : "")}$``

#

it was working yesterday

formal goblet
#

Seems your baseToken is undefined

#

Do you know, what canvas.tokens.controlled[0] does?

mystic gulch
#

it refers to the first token currently selected

formal goblet
#

Correct

mystic gulch
#

the problem is: it is selected

#

i unselected and selected it

#

and got this

formal goblet
mystic gulch
#

nope, same one

#

for ranged attack

formal goblet
#

The error indicates a different Label Roll Message, because it tries to read IC from something, that is undefined

mystic gulch
#

but there's nothing that does that in my code

formal goblet
#

The console says otherwise, and that one is always true

mystic gulch
#

hmmmmmmm

#

did my "macro" also overwrite something else too?

#

like it did with the template

formal goblet
mystic gulch
#

i didn't

formal goblet
#

Because that is more or less the only way to persistently override a value

mystic gulch
#

is this what they say about coders being a bunch of mages doing magic stuff?

storm stream
#

is it possible to create a text tile on a scene canvas that updates according to a stat on the character sheet?

elder raft
#

"Ohh look, it's Archivist again, bet he has another janky-ass crazy weird question!" 😅

So... Got an idea I'd like input on.

Game designer for a 2d6 system is looking at working with 3(+)d6kh2, and now wants to experiment with 3(+)d6kl2 as well
I'm thinking my best idea to implement both of these side by side is to have the "+d" choice assign to a variable, and the "-d" to its own variable, perform the math, then shove that result into my actual roll formula?
That way if you have the same +/- counts it just cancels out.

The other thing I'm looking at is the "-d" won't be using numerical points, it'll be a list to choose from (from a dynamic table), but there isn't a super good way to have multiple choices on a User Input template is there? Dropdown is the cleanest, and I don't want to have a whole list with checkboxes on the user input, that could get lengthy... though checkboxes might work. 🤔

normal ore
#

@formal goblet
I don't know if this has already been noticed or if it's actually a bug.
But if I try to assign a key to a label, the result of this function does not display on the label. However, if I create a label without a key, then the result appears normally.

Is this behavior expected?

hollow crow
#

Hi guys! I have this macro i use to import adventure items and equipment from an excel table i own. Altough the macro is able to select the right template (_Inventario) when transforming the data i paste in the dialog box in Foundry items and correctly populates the approriate fields in the item's sheet, i have to manually click on the "reload template" button and load the template _Inventario before the macro can populate the fields. I weren't able so far to find a way that automates the action of loading the template instead of simply select the right one in the dropdown list at the top of the sheet. I mean, i don't care nothing of manually clicking 'reload template' if i have to import a few objects, like 5-10, but think of importing 50-100 items and clicking 'reload template' on each of them when the macro creates the item's sheet.... well, it's very annoying! Do you know a couple of code instruction that i can insert in a macro to tell it to automatically not only select, but also actually load the item's template? Thanks!

formal goblet
final mural
#

@flat hazel tu masz

formal goblet
foggy oxide
#

I'm not sure if I just missed it. With a dynamic table I can add items to an actor like to add weapons or equipment to a character. But it is possible to add actors to other actors too? For example if I create a spaceship as an actor and want to add other actors - characters in this case - as the crew of this ship (so some values of the ship are depent on its crew).

formal goblet
#

Otherwise there's no Component for Actors, that acts like an Item Displayer

oblique willow
#

How do I hide a script in a roll message from showing? I still want the rest of the roll message to be shown

%{return await game.macros.getName('Add Alert').execute({argAlert: { label: '${name}$: ${item.name}$ lands', message: '${name}$: ${item.name}$ lands', userId: game.user.id, roundAbsolute: false, endOfTurn: false, phase: "Squad Phase", myDuration: parseInt('${item.delay}$'),} })}%
formal goblet
#

A wait, you mean something else

oblique willow
#

Because that little box at the beginning is ugly (the script)

formal goblet
#
${#%{
return await game.macros.getName('Add Alert').execute({argAlert: { label: '${name}$: ${item.name}$ lands', message: '${name}$: ${item.name}$ lands', userId: game.user.id, roundAbsolute: false, endOfTurn: false, phase: "Squad Phase", myDuration: parseInt('${item.delay}$')}});
}%}$
normal ore
formal goblet
normal ore
normal ore
ornate haven
#

Question - for when you are setting a roll that includes a prompt for a modifier, is there a way to program this to instead provide a drop down. I am working with a system that deals with d100 rolls that has consistent modifiers like +10, +20, -10, etc

manic crypt
#

The Month format from the simple prompts example covers that.

?{month:'What month are you born ?'|"January"|"February"|"March"|"April"|"May"|"June"|"July"|"August"|"September"|"October"|"November"|"December"},

manic crypt
heavy elm
#

Hey, is it possible to setup custom status effects? Besides that given from foundry? Or modifiy the already given ones in foundry? Is that in developement?

heavy elm
#

Is it possible to remove the status effect from the world again if I may fuck up ?

formal goblet
heavy elm
#

Ah Okay. TY

meager gull
#

Hello! I'm working on changing the look of my character sheet using some CSS, and I'm a bit confused about how to access things on the character sheet. I have tabs (Basic Info, Features, Items), and in Basic Info, I have a panel (Wounds) with four checkboxes (w1,w2,w3,w4). This is the CSS I'm trying, but it's not working (though other formatting in the sheet is working). Anyone know how to access specific objects in a emplate using CSS?

#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w1"],
#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w2"],
#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w3"],
#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w4"] {
color: red;
}

EDIT: It worked! I just had to delete #my_tabs and it automatically got the right one.

crystal quarry
#

I don't know what type of component it is.

#

Is there a way I could find out?

somber gull
#

Hi there ! I'm trying to add a button to roll damage in the chat message created by my hit roll macro 🙂 Do you know if it's possible or if I'm losing my time ? I'm currently looking at something utilizing the requestor module but it doesn't seem to work 🤔

formal goblet
formal goblet
# somber gull Hi there ! I'm trying to add a button to roll damage in the chat message created...

I have no clue about the module, but it's possible (although a bit tricky):

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

The world script could be optimized, but it works. You have to make sure, that you tag your Button with a CSS-class or something else, so that you can run a selector through it and add an event listener.

somber gull
somber gull
#

Thanks, I actually didn't know about this wiki 😅 That's gonna be handy ! 😄

mystic gulch
#

just created a new world and got this error while trying to reload the character sheet

mystic gulch
#

but same thing as before, when i press a button, this pops up

#

bruh, i just fixed it

#

i uninstalled CSB and installed it again

coral cliff
#

hello, sorry if this has been asked before, but how do i acess values from a charachter sheet in a macro?

coral cliff
#

i'm trying to make an attack macro and for that i would need to access elements on the sheet such as int, but i cant access it

honest forge
raven raven
#

Hi. I have a question. Do the number of existing items and actors influence foundrys performance?

#

Im asking because I wonder if I should delete the items which belong to my systems previous versions... or can I just drag them into a folder and keep creating new ones?

hollow crow
#

Oh my, this time i'm in need (but not about a macro, for change 😅 ). In particular i cant' ger an item modifier to set the value of a Label in my character's sheet. As you can see the Label 'Valore Arma' (Component key VAL_A) on the actor's sheet is empty. I have this item in my inventory (Bastone Orientale) in which i've set an Item Modifier: if the weapon is in Slot1 and its size is 'Piccola' set VAL_A equal to the value contained in the field Valore Arma (P) of the item (component key WPNDMG_P), and if the size is 'Media' set VAL_A equal to Valore Arma (P) of the item (component key WPNDMG_M). This is the formula of the modifier: ${Slot1?(equalText(WPNSIZE, 'Piccola')?WPNDMG_P:WPNDMG_M):''}$. I've tried also a much simplier formula, like ${WPNDMG_M}$ to set VAL_A directly and simply as the value of the medium sized weapon (without conditions or referring to slots), but with no results. Why item's modifier doesn't work as expected?

formal goblet
raven raven
#

is there any way to create a character template which comes with pre equipped items when selected?

#

Or is there any way to add multiple items at onece to a selected character?

sullen spoke
#

Has anyone ever tried/succeeded with a dynamic initiative system?

heavy elm
#

Hey, is it possible to create items with itemdisplayer? Like nesting the items?

candid badger
#

Hello!
I have an item with checkboxes that I would like to put an item modifier in to reduce a number field based on how many checkboxes are checked. So far I keep arriving at NaN (not a number).

heavy elm
candid badger
heavy elm
#

You need something like:

${(Checkbox1 ? 1 :0) + (Checkbox2 ? 1 :0)}$ and a - as operator

candid badger
#

Went back step by step and found the culprit

heavy elm
#

Perfect 🙂

candid badger
#

How do you get the checkboxes to show up in columns on the item display?

heavy elm
#

Add element, label: ${item.fatigue1 ? 1 : 0}$

#

You can add of course diffrent values or even symbols from fontawesome

candid badger
heavy elm
#

A element in the itemdisplayer

candid badger
toxic venture
#

How do I set the value of each option in the dropdown?

I simply have a system that has a value, something like "AC" in D&D. Then, I use the dropdown to select the "training level" for this AC. I want to have options to add +2 / +4 / +6 / +10. For this type of "Armor Class". I will also do this with skills, so at the moment I am completely lost as to how. The problem is that there is no option in the Dropdown to add a value for each of the options in the Dropdown.

#

(Ignore the names in Portuguese, I'm Brazilian...)

candid badger
#

How do you get an item modifier to reference a checkbox on the character sheet?

formal goblet
formal goblet
toxic venture
#

Ac formula and Dropdown

#

"reflexos" or "ref" it's AC 👍

#

@formal goblet

formal goblet
formal goblet
# toxic venture Ac formula and Dropdown

And check the info box of the default value of the Number Field. The default value is only relevant, when the value of the Number Field is undefined (basically only at the creation time of the Component). Otherwise it's completely useless, because Input Components like Number Fields aren't supposed to be updated automatically.

If your value is dependent on a different Component, then you either have to use a Label or a Meter

#

And now regarding to the Dropdown. Your Dropdown will return the option key you've selected, meaning if Treinado (+2) is selected, the Dropdown will return 'treinado_ref', which is not a number.

To get rid of the issue, your Label, which should depend on the Dropdown, can use the switchCase()-function to compare the result of the Dropdown and return a number respectively. For example switchCase(graduaco_ref, 'treinado_ref', 2, 'veterano_ref', 4, 0)

normal ore
#

Is it very complicated to create a script that sends a button to the chat, and this button contains a CSB formula?

normal ore
formal goblet
toxic venture
formal goblet
toxic venture
# formal goblet Probably a Label. And you can use numeric values as keys in your Dropdown option...

I don't want to use numeric values ​​as keys, because it can get really confusing. What exactly would I have to do? I mean, I understand that I have to use the switchCase() formula, but I don't understand exactly how. And to add the value inside the AC, would I still have to put a ${graduacoes_ref + 10 + mod_dex}$?

AC/REF = 10 + dexterity mod + the graduation level (selected with the dropdown). So where exactly would the switchCase() come in??

formal goblet
#

You replace graduacoes_ref with that, what I've written for switchCase()

wheat knoll
#

Hullo shipmates, happy to have found this channel, hidden away as it is. I plan on making My Father's Sword by Nordic Skalds, as I don't see it anywhere, on any platform.
Hopefully I won't need to ask too many questions. 😜

void spire
#

Hi.
I'm trying with the Custom System Builder to create a sheet for the CJ. Carella WitchCraft rpg. I was able to create several labels for rolling for each attribute and skill, but can't combine both of them. So, as an example, let's say that the Stealth roll is usually combined with the Perception attribute or Dexterity attribute. Could anyone give me a hint, how to create either:

  1. A field with a Dropdown for choosing an attribute, and based on the chosen attribute it would combine 1d10+skill value + attribute value

  2. Or prompt a player for choosing the skill for the same combination

As an example, if the player would choose the Perception, then the roll would be with 1d10+Stealth+Perception, if he would choose Dexterity, then 1d10+Stealth+Dexterity.

formal goblet
void spire
# formal goblet If the Dropdown contains the exact Component Key of the Attributes, then `ref(Dr...

Thank you.
I'm still not sure how to implement it, sorry, I'm not very tech-savvy...
I did this: Created a Dropdown Component with the component key as "attribute_select". In the label next to the skill, I've added Label roll message "${[1d10+:Athletics:+ref(attribute_select)]}$", but it's now working (I wasn't counting that this might work actually, this doesn't seems right and I'm sure that I did something wrong there). Any advice, how to make this work?

void spire
#

Ohhh, almost worked.
Got some strange results with this though. I will try to figure out, but if anyone could advice, I would be greateful 🙂

void spire
formal goblet
void spire
#

Great, worked like a magic 🙂
Thank you

void spire
#

Is there any way to implement it for a dynamic table? (I don't think so, but it's worth to ask).

signal panther
#

I have a question related to pulling data from a table, I'll try to explain myself clearly.

So I'm using Kids On Brooms as a base for what I'm making, and adding some features on top. The attributes pane is working fine, select the die size from the dropdown, add your permanent bonuses, click the button, and it calculates exploding and everything pretty well.

The issue I have is that I want to pull additional, temporary bonus from a dynamic table as in the second image, and add them to the final output roll.

The formula currently for the roller looks like this: Brawn Roll: ${[:DIE_SIZE_DROPDOWN_BRAWN:+:BONUS_BRAWN:]}$

#

I can't for the life of me figure out how to pull just the sum of the brawn bonuses from the table, and I may be using a function wrong, but I've tried using reduce in both the roll formula and as a hidden attribute formula and it just gives me errors

#

I guess the question is, with the Dynamic table, how do I pull the sum of all values in the "Bonus" colum, filtered by the value of the "Attribute" column?

normal ore
#

I need some help understanding the new functions in the beta.

I'm trying to return, in a label of a dynamic table within an item, a reference to a field from a dynamic table of the actor that owns the item. I'm using the following formula in the item's dynamic table label:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', sameRow('arma'))")}$
I've checked the keys multiple times, and when I tested placing this formula in the roll message in the chat, I got an error (which I attached).

I don't understand why the error is happening since all the keys are correct—I verified them individually!

Where am I going wrong?

formal goblet
formal goblet
formal goblet
# normal ore

You're missing quotes around the inner formula probably

normal ore
formal goblet
void spire
# formal goblet There are, but I need more details. Especially, if the Formula is within the Dyn...

Ok, so basically I want to add new values to the dynamic table with Level of the power. The roll should be composed of the 1D10 + Attribute level (which will be fetched from another dynamic table by ref(attribute_selected)) + Power Level (which should be fetched from the Power Dynamic Table).
So I guess that this will be something like ${[1d10] + ref(attribute_selected) + fetchFromParent(PowerLevel). I didn't tried it yet, but it's something like this.
BTW, how to set up the dice type based on the dropdown? I also want to set-up the dice type for damage based on the chosen value, tried with the [1d:Nameofthedropdown:]...

normal ore
# formal goblet Directly outside of it

Try it like this:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', 'sameRow('arma')')")}$
and like this:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', string(sameRow('arma')))")}$
But it didn't work 😦

normal ore
# formal goblet Directly outside of it

I fouuuuuuund it! Thanks to your tip about putting quotes on the outside! @formal goblet , you’re amazing!!!!!

I wrote the formula like this:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', '${sameRow('arma')}$')")}$

void spire
void spire
#

Skratch that, actually the ${[1d:DamageDice:]}$ worked 🙂

#

Thank you for all your help 😁

raven raven
#

What do I write into the labell roll message, if I want it to decrease the value in a number field (key name: rex) by one when clicked, and send a text message "spent" into the chat?

heavy elm
#

Hey, is it possible to create items with itemdisplayer? Like nesting the items?