#Custom System Builder

1 messages · Page 55 of 1

mint plaza
#

so? game.actors.value.system.attributeBar.MOVEMENT.value

#

ok that also doesn't work

formal goblet
#

You have to think from the perspective of a Token. That's where your relative path starts

lost wigeon
#

Is Automatic Sorting in Item Containers broken, or is there something specific that I need to do in order to get it to work?

mint plaza
lost wigeon
#

To show what I mean...

lost wigeon
#

As you can see above, the sorting is set, but it isn't actually working on the sheet for some reason.

mint plaza
formal goblet
lost wigeon
#

IE, 14, 8, 6. Etc. Right now, it seems to sort by name only any time I enable auto sorting.

lost wigeon
formal goblet
lost wigeon
#

I haven't seen any other odd behavior on the sheet. Basically, I'm trying to build a template for action orders, but when I duplicated a sheet, I found that the new sheet doesn't respect the manual order I set on the template sheet.

#

So, I'm just trying to find a way to not need to manually sort the actions every time I create a new Character Sheet.

mint plaza
#

no idea where to find the attributes in a token i can see them when i do _token.actor.getRollData() but i don't get the path

vagrant hollow
vagrant hollow
# mint plaza

Thats the path that works for drag ruler in my world.
Is the MOVEMENT coming from a numerfield?

mint plaza
#

no from a meter

#

but even when i use a numberfield

#

doesn't work

vagrant hollow
mint plaza
#

damn

#

no idea why mine doesn't work then

brittle moth
manic crypt
lost wigeon
#

I sorted my problem out anyways. Thankfully, it turns out that Duplicated sheets automatically sort by "Order Added" not by Name. So, that's totally managable for my purposes:) The fact that Autosort doesn't appear to work isn't an issue for me now, but thank you! 🙂

#

I did wish to share something with other CSBers, by the way. I was having a problem on my very complicated sheet for my own system, vG WoD, where the sheet wouldn't "Refresh" the Character sheet after running the roll macro, probably due to the time needed to recalc the sheet, and this was resulting in issues where the Sheet wouldn't be sync'd with the background values for the Actor.

I found a way to fix this very neatly. The following code at the end of the Label Roll Message code makes it function perfectly, and the time can be adjusted based on the size of the sheet.

${#%{function wait(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

(async () => {
  await wait(5000);

  // The sheet is likely `entity.entity`, but here's a robust version:
  const actorSheet = entity?.entity ?? actor?.sheet ?? null;
  if (actorSheet?.render) actorSheet.render(true);
})();}%}$

Obviously, my sheet is quite large and complex. So, I give it a full five seconds to do its thing.

mint plaza
manic crypt
#

I wonder where it's getting that x from then.

brittle moth
mint plaza
mint plaza
brittle moth
#

hmm
From what I can see from the error message, this is not an issue with the movement property after all, but with Drag Ruler. Specifically, it seems the module is unable to get the destination's coordinates :/
What is your version of Drag Ruler ? And is your map Gridless ? It looks like Drag Ruler v1.14.0 does not work with gridless maps

mint plaza
#

i'm using a hex grid but maybe i have the wrong version of foundry

brittle moth
mint plaza
#

just updated it now it's 1.14.2 i think

#

goddammit

#

that was it

brittle moth
#

Yeah, I recommend updating your Drag Ruler module, it is compatible with Foundry v12 starting from 1.14.0. With 1.14.2 it should be okay

mint plaza
#

it was just outdated

#

very sorry

brittle moth
#

No problem, glad you could sort it out !

formal goblet
#

Yep, incompatible version

mint plaza
#

thank you guys very much for the help

tardy warren
#

Hey everyone, I was hoping you can help with something. I am trying to add my initiative rolls to the combat tracker. Ex: I want to click on my initiative roll on my sheet and tie it to the combat tracker. Is there a way you can do that?

jolly kettle
#

apologies for ghost ping, was feeling a bit helpless and will do some studying on videos and see what else i can grasp before i try to ask through some things

pine sundial
#

Hello, I'm trying something in Custom System Builder. This works, but it rolls all 5D20, for all possibilities : normal roll, advantage, disadvantage. Is it possible to just roll 1 ou 2 D20, for the correct roll?

${#concat(
?{avantage:"Avantage"[check]|"0","Aucun"|"1","Avantage"|"-1","Désavantage"},
?{bonus:"Bonus / Malus"|0}
)}$

${avantage:=${avantage}$}$

${de:=${avantage}$ == 1 ? [2d20kh] : ${avantage}$ == -1 ? [2d20kl] : [1d20]}$
<br>
Bonus : ${bonus}$ Attaque : ${attaque}$
<br>
Résultat final : ${total:=[${attaque}$ + ${bonus}$ + ${de}$]}$
<br>

%{
const roll = ${de}$;
return roll == 20 ? "🌟🤩 Réussite Critique 🤩🌟"
     : roll == 1 ? "💀 Échec Critique !" 
     : "Résultat normal";
}%

<br>

%{
if (!game.user.targets.first()) 
    return "Pas de cible sélectionnée.";
let ennemyValues = game.user.targets.first().actor.system.props;
return ennemyValues.name + " : Esquive : " + ennemyValues.esquive;
}%
pine sundial
formal goblet
pine sundial
formal goblet
cerulean adder
#

Is there a way to conditionally stop a label roll message from completing? I want to add a kill switch to the attack roll if there isn't enough ammo. I tried %{throw 'Done';}% but I wasn't able to get this to run conditionally.

formal goblet
#

Because inner formula has prio over outer formula

cerulean adder
#

Oooooooh

#

This is why you're my favorite!

cerulean adder
#

I have one more question. I'm trying to debug some of the logic I have but I'm not entirely sure how to read the console. I know that I have a parenthesis issue but is there something in the console error that narrows down where the issue is occurring or do I just need to look at the entire data?

formal goblet
warm quartz
cerulean adder
formal goblet
#

And if you want to be real fast, export your templates, open them with an editor and hit CTRL + F to search for it

cerulean adder
#

That is a brilliant idea!

#

I'll do that!

formal goblet
#

I can at least tell, that it is a Label within an Item Displayer

cerulean adder
#

Yup, I did what you said and found it instantly. It was a visibility formula. I accidentally added ${}$ when it explicitly tells you not to

topaz bone
#

is there a page that has all the variables for making formula?

#

I want to make a 10 + Con mod + prof formula

storm rain
#

I might have come across a bug..?

I'm trying to roll a incoming damage roll, and when it gets pressed, nothing happens at all.

The main formula is:
"${round(${[:Incoming_Damage:] - [:Ammo_Type:] * ref(ref('Hit_Location')) - [:Body_Type_Modifier:] }$) }$"

I know that everything works if I remove "[:Body_Type_Modifier:]".

[:Body_Type_Modifier:] is from the Meter Component and has the formula: "${round(${([:Body_Score:]==1) ? 5 : (3-[:Body_Score:])/1.8 }$)}$"

[:Body_Score:] is a basic number field value (with a minimum of 1)

Any clue how to work around this?

manic crypt
formal goblet
storm rain
manic crypt
#

Ah, those must be die codes, that makes sense.

#

Martin has the answer then.

storm rain
#

The Meter Component shows the correct value, it just doesnt work when used for the roll

manic crypt
#

is it a static number, or something like a die code?

formal goblet
manic crypt
#

What he's saying is that inside a component (not a label roll message) you can't use the roll delimiter, so if you replace [:Body_Score:] with just Body_Score it should work.

storm rain
#

That seems to do the trick!

#

Thanks for the help!

umbral wraith
#

If I have a collection of checkboxes, such as in the screenshot, is there a good way to see how many of them are checked at any given time and then adjust things elsewhere in the sheet if enough of them are checked?

manic crypt
# umbral wraith If I have a collection of checkboxes, such as in the screenshot, is there a good...

So, those checkbook are just booleans, idr if they're considered 0 and 1 or false/true for the purposes of math, if the former is true, you could have a label where it just sums them up (like ${sum(check1, check2}$ etc) and then if you need more than a number go to conditionals or a switchCase() from there. If it's the latter, then you're kind of stuck with longer conditionals inside the sum(), like ${sum(check1?1:0, check2?1:0}$ (though you might have to make those sub formulae instead, I'm not at the computer to remind myself right now).

safe herald
#

Hey! Quick question - is there a way to trigger macros through a Label Roll Message in CSB? Or at least to change stats like HP with it? Like, press one button to add some HP, press another to subtract?

broken pumice
# safe herald Hey! Quick question - is there a way to trigger macros through a Label Roll Mess...

Yes and yes, if you want to simply change a value on the character sheet by clicking a label you can use setPropertyInEntity(...) in a label roll message :
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Formulas/Functions/setPropertyInEntity

If you want to call a macro, you can do it by calling a bit of javascript with %{return await game.macros.getName("macroName").execute();}%
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Guides/Formula-System#calling-macros

safe herald
#

thanks for the help!

lethal flax
#

so when should we expect custom system builder to be updated for V13?

olive trellis
#

quick question i want to get a value in the character sheet (skill value) based on a dropdown selection in an item the keys of the dropdown in the item are the same as the skill keys. i want to roll with a label in the item displayer how would i do that

formal goblet
olive trellis
olive trellis
#

another question ${#damage:=item.itemdamage}$ doesnt seem to hide the element in the chat box is the # not working or did i something wrong?

olive trellis
#

thank you

#

now it works as intended

#

i guess i activated that because i thought private rolls where meant by that

brave oar
#

Is it possible to get these panels to hide based on whether the PC has a spell of that rank? I've used rankx_spells.length > 0 for the visibility formula and that seems to work to hide them, but once the PC gains a spell of that level the list never disappears - even if they lose the spell.

formal goblet
plush maple
#

So I am looking up options to checkbox something if another value = true. Slowly chipping away at these codes but if I want the formula to be invisable do I need to code it elsewhere and just have the code lookup the value? or can it all be in one place?

#

Basically trying to get my status conditions automated with fatigue stuff.

formal goblet
plush maple
#

Whenever the sheet is updated. It would relay on the character's sheet not the over all world? If that makes sense.

#

Like if the character's Fatigue = 3 then the sheet would update to checkbox the statusCondition Restrained.

formal goblet
#

Well, either you use Labels to show the status, so these can be automated with formulas. Or you have to rely on a world script, which actually listens to your sheet updates and applies changes when needed.

plush maple
#

Okay! So I should make a sperate Actor sheet just for all the status effect code/calculations? (still my first time really getting all this progress done. XD so apologizes. )

#

Pretty easy to do just wanna make sure I don't waste time working through something and handling it wrong. XD

formal goblet
plush maple
#

So the template should have the code built in. Gotcha. Wanted to make sure.

plush maple
#

So currently within a Label text I have this code, not sure if it will auto checkbox the restrainedStatus. Basically trying to code if this box is checked then effects happens else nothing happens.${restrainedStatus == true ? moveSpeed == 0 : none}$ ${(occInvSlots == maxInvSlots) or (armorSlots >= mitStat) ? restrainedStatus == true : restrainedStatus == false}$

#

Just realized I am missing something else. Will have to fix that code later though as it will take some extra reading. But will keep this up for now.

formal goblet
plush maple
#

ah i see. Will need to re-read through some of the stuff to see how to code at least some kind of toggle effect. 🤔 Getting one step closer though. XD It has been fun coding and figuring this out slowly but surely.

formal goblet
plush maple
# formal goblet I'll help you with some constraints: - Input Components (Number field, Checkbox,...

😮 📝 I see. Hmm... probably need a visual to activate when the effects are active rather than relay on the checkbox being the visual. Just to see if it works with both of these kind of components. 🤔 Cause I do want the option for players to click to toggle the effect if an enemy causes it, or for the character sheet itself to auto toggle it if they become effected by something else within the code.

Will try to trouble shoot this idea a bit more.

#

I do have something similar with how Proficiency works with the check boxes so maybe I can play with that concept a bit more.

formal goblet
plush maple
formal goblet
plush maple
#

Okay! Then I will play around with that and see where it gets me. :DDD Probably won't get another update from me for a little bit. But once I start messing around with this again, I'll be sure to post here of any results. ✨

dense pine
#

is there a macro or console command that tells me the datatype (?) of a specific component or hidden attribute? Lets say i have a hidden attribute "INFO" and im not sure wether its an array, string, number, true or even undefined. How can i find out?

formal goblet
hardy fern
#

Hello, just a very quick question: There's no way I can run CSB with Foundry version 13, right?

warm quartz
#

Hi, small question concerning dynamic tables and sameRow function.
Is there a known issue or limitation when the column is a label ? I have a dynamic table with several columns (Text fields, Number Fields & Labels). When I try to get the value of a label with sameRow I always get the fall back value.
It works fine when I change the column type to a number field, but labels won't work. There are no alerts or errors in the console.
I can change my column to a number field, but it will be weird to have a number fields where min & max value are the same.

formal goblet
warm quartz
warm quartz
#

With some html code this now give a nice effect.

cerulean adder
#

Is there a way to call a sound to play when a condition is met? For example, can a blaster sound kick off if I make click the attack button?

formal goblet
cerulean adder
#

Haha they sent me back here. I'll see if I can figure it out

formal goblet
#

Just ask them, how it's done via a Macro

#

Rest is just integrating into a Label Roll Message, which is pretty easy

cerulean adder
#

Two more question! Is there a way to kick off a chat message x times? I have an attack roll button that works great but some of our guns shoot 2-5 times per action. Is there a way to have that roll run multiple times depending on a value passed or is that another JavaScript thing?

And last question, I have a macro built out but I'm not sure how to save it so that anyone can use it. Is there a place I'm supposed to save it or are there options that I need to enable to let others use it?

cerulean adder
hardy fern
#

What dependencies does CSB have? I've updated everything to version 13 before realizing CSB isn't compatible so now I downgraded to 12 343 and I'm getting Incompatible dependencies on the Game world I've made with CSB.

hardy fern
#

Perfect, thank you very much for your prompt help as always mr. Saint Martin, sir. 🥹

charred prairie
#

How exactly do you get an input prompt to display before I roll?

I'm would like:
Press the button to roll dice
Display a field where I can type in any modifiers
Output the roll with said modifier applied

cerulean adder
warm quartz
verbal portal
#

hello all

#

I will want to know why this code at the last past give me error

#

<table>
<th colspan="5" style="text-align: center; font-weight: bold;font-size: 15px;">
<p> Abilità: Armi da Fuoco </p>
</th>
<tr>
<th style="text-align: center; font-weight: bold;"><p>Dai che ce la fai !!!</p></th>
</tr>
<tr>
<td><p>Roll</p></td><td><p>${Roll:=[1d100]}$</p></td><td><p>Modificatore</p></td><td><p colspan="2" style="color:red;">${?{Modificatore[number]|0}}$</p></td>
<tr>
<td><p><strong>Risultato</strong></p></td><td><p><strong>${Risultato:=Roll + Modificatore}$</strong></p></td><strong><td>Vs </td><td><p style="color:red;">${lookup('abilit','abilitatetot','abilitate','Armi da Fuoco')}$</p></td></strong>
</tr>
<tr><th>${Risultato <= 2 ? 'Successo CRITICO!!!' :
Risultato >= 98 ? 'Mannaggia all'Apocalisse!!!' :
Risultato <=lookup('abilit','abilitatetot','abilitate','Armi da Fuoco') ? 'Successo!' :
Risultato>lookup('abilit','abilitatetot','abilitate','Armi da Fuoco') ? 'Niente da fare' : 'Errore'}$
</th></tr>
</table>

#

I had tried assign the lookup to a var but didn't work

#

why did not the Var 'Risultato' in the label roll can be reused ?

#

I tried also to showed it out without the condition formula and I saw it in the chat message

formal goblet
warm quartz
#

You can use max(lookup()) to get the highest value returned in your array.

#

And since you are using the same lookup 3 time, you can add a line to declare the result as a variable.

#

${#VarNam:=max(lookup('abilit','abilitatetot','abilitate','Armi da Fuoco'))}$

#

You can replace the lookup by the VarName like when you used Modificatore.

verbal portal
#

I am going to try

warm quartz
#

I have used a sum() on an array, so the max should work.

#

It will transform the array in a number that can be compared to other numbers.

verbal portal
#

max() didn't work now I ll try with sum

warm quartz
verbal portal
#

it give me back like this now... but better than an error... and the number() function can help ?

#

I am tring in multiple ways

formal goblet
# verbal portal

You've supplied a literal string to the max-function, which won't work. It can only take numbers or an Array.

verbal portal
#

but the result of my lookup is a number...how can I transform that in a number which I can compare into a condition ?

warm quartz
#

Here is an example : ${sum(lookup('CFI_ID_Equipment', 'CFI_ID_Equipment_ENC'))}$ will give an array of the weight of each item in my item displayer and make the sum. Lookup will give you a list of numbers (an array) even if there is only one.

formal goblet
warm quartz
#

max() will give you the highest value of this array, sum() will make the sum of all the values in the array.

verbal portal
#

I changed like that just to try...
<table>
<th colspan="5" style="text-align: center; font-weight: bold;font-size: 15px;">
<p> Abilità: Armi da Fuoco </p>
</th>
<tr>
<th style="text-align: center; font-weight: bold;"><p>Dai che ce la fai !!!</p></th>
</tr>
<tr>
<td><p>Roll</p></td><td><p>${Roll:=[1d100]}$</p></td><td><p>Modificatore</p></td><td><p colspan="2" style="color:red;">${?{Modificatore[number]|0}}$</p></td>
<tr>
<td><p><strong>Risultato</strong></p></td><td><p><strong>${Risultato:=Roll + Modificatore}$</strong></p></td><strong><td>Vs </td>
<td><p style="color:red;">${#testdifficult:=max(lookup('abilit','abilitatetot','abilitate','Armi da Fuoco'))}$</p></td></strong>
</tr>
<tr><th>${Risultato <= 2 ? 'Successo CRITICO!!!' :
Risultato >= 98 ? 'Mannaggia all'Apocalisse!!!' :
Risultato <=testdifficult ? 'Successo!' :
Risultato>testdifficult ? 'Niente da fare' : 'Errore'}$
</th></tr>
</table>

but now doesn't die anymore also XD

#

How can I get that value from the array ?

#

even with the switchCase it won't work right ?

warm quartz
#

'Mannaggia all'Apocalisse!!!' -> this might be an issue. You have a quote in the middle of the text.

formal goblet
#

Yeah, you have to fix that

verbal portal
#

aaaaaaah it could be !!!

warm quartz
#

You can use a \ before the quote inside the text

verbal portal
#

I am a jerk !!! fuck me

#

thank you so much guys!!!!!! thank you thank you thank you ❤️

warm quartz
#

Don't worry, I had the same issue not long ago. HTML code was my bane...

verbal portal
#

ahahaha the quotesssss T__________T have a nice day guys !!!

olive trellis
#

hey is there a way to delete a item from the actor sheet if the value of a component called "uses" reaches 0?

formal goblet
olive trellis
olive trellis
#

ok before i fuck something up majorly would that work i havent used scripts yet?: ${item.uses = 0 ? %{linkedEntity.delete('item')}%}$

formal goblet
#

Because inner formulas are executed prior to outer ones

#

And the else-case in the ternary operator is mandatory

olive trellis
#

so would i write it this way? %{linkedEntity.delete(${item.uses = 0 ? true : false}$)}%

formal goblet
#

Also no. linkedEntity already represents the item in question. The delete()-function is called without any arguments.

#

This would be safer.

%{
const props = linkedEntity.system.props;
if(props.result == 1) {
  await linkedEntity.delete();
} else {
  await linkedEntity.update({'system.props.uses': props.uses - 1});
}
}%

Just keep in mind, that setPropertyInEntity() will defer the update until the end of the Label Roll Message.

olive trellis
#

ok so it would still sit in the inventory at 0 then? can i force setPropertyInEntity() before the script

formal goblet
#

You can however capture the result of it

olive trellis
#

with ...result:= ... correct?

formal goblet
olive trellis
#

okay thank you very much

#

okay it deletes the item as intended but now the roll of 1d6+1 does not get trough before it is deleted

#

<h2><strong>${!item.itemname}$ Roll</strong></h2><h1>${![!:item.itemeffect:]}$</h1>

${result:= setPropertyInEntity('item', 'itemuses', 'item.itemuses -1')}$

%{
if(localVars.result == 0) {
await linkedEntity.delete();
}
}%

here is the code do i need to shift something around?

formal goblet
olive trellis
#

if uses are 2 or more it works fine

#

just the last spits out that error

formal goblet
#

Just remove setPropertyInEntity(), it will be covered by the script itself.

olive trellis
#

ok i will try it

#

somethings wrong i guess result is not defined

#

ill try something

#

nope that didnt work i tried calling the itemuses but it calls them before the script

#

got it

#

<h2><strong>${!item.itemname}$ Roll</strong></h2><h1>${![!:item.itemeffect:]}$</h1>

${#%{
const props = linkedEntity.system.props;
if(props.itemuses == 1) {
await linkedEntity.delete();
} else {
await linkedEntity.update({'system.props.itemuses': props.itemuses - 1});
}
}%}$

#

needed to change if(props.result == 1) to if(props.itemuses == 1)

#

but thanks you were a great help#

cursive heron
#

Is anyone in here working on a Daggerheart system?

plush maple
#

Question, could I use the Active Effect displayer for toggling or activating status conditions on a character? 🤔 Never mind I thought the action did something else my bad. Just trying to find a way to apply status effects similar to 5e's little status toggles.

plush maple
#

Okay just one other question while I still work on that project on the side.
Where do I place my CSS file in maually? I know where some of the folders are located but it still won't let me select it. Sorry if I am missing some fine details.

west garden
#

Try right clicking the foundry tab and opening your directory from there
A good option is whichever world you are using

plush maple
#

Okay its best to put it in the Data > worlds > world-name > data ?

west garden
#

Yeah, purely for organizational purposes

#

Ok, over the past few days I’ve been trying to piece together a working sheet for a pbta-like system

  • It doesn’t use traditional stats, but instead has a series of tags which can by applied to rolls on a case by case basis
    • I have elected to use check boxes and text fields for this for the time being
  • rolls are done in a dice pool format, with a number of d6s based on the tags used
  • It is going to need a compendium of moves and playbooks like a pbta style game

Any advice?

plush maple
west garden
#

Oh, yeah, select the json file instead, then just change the file destination manually once you enter it

#

…I say with the confidence of someone that didn’t just learn this yesterday

plush maple
#

It half worked but none of the additional details. But that could be a me problem but I now know that I can change stuff XDD

west garden
#

One sec

west garden
# plush maple It half worked but none of the additional details. But that could be a me proble...

This tutorial covers the basics to intermediate functions of CSB without the use of JavaScript. We cover item / actor templates and sheets, as well as what most of the components do at their core.

We do not cover CSB provided functions, or advanced uses of components (aside from the label), which will be left for another tutorial if there's en...

▶ Play video
#

This is what helped me so far

plush maple
crude briar
#

Is it possible to modify a hidden attribute using an item modifier?

candid badger
#

Is it possible to have an item modify a field within it based on the a value from the actor?

For example, I want weaponerror on the item to change if the proficient value on the actor is checked.

warm quartz
candid badger
warm quartz
candid badger
# warm quartz Can you send the formula on discord ? Maybe someone can find the reason.

I am trying to use the Configure item modifiers option as I have a universal template and this effect will only happen on specific items.

Here is what I got:

Actor field is in an item displayer item.itemweaponerror

Actor checkbox: trainedswords

I want item.itemweaponerror to be 1 if the 'trainedswords' box is checked and 3 if not. I have a label called 'trainedswords' that will result in a 1 if the box is checked or 3 if not and this is what I want to use to populate the item field.

The default is 3 and the box is unchecked by default.

I put in the item modifier configuration:

Key: item.itemweaponerror
Op: =
Value formula: ${fetchFromParent('trainedswords')}$

The result is no change from the default of 3 and no errors on the log.

formal goblet
candid badger
warm quartz
#

The value of a checkbox is False or True. Nothing else.
So you just need to make a IF-THEN to transform into your end value (1 or 3) -> ${fetchFromParent('trainedswords') ? 3 : 1}$

#

If the fetchFromParent give you True, you get 3 displayed, otherwise you get 1.

formal goblet
candid badger
# warm quartz If the fetchFromParent give you True, you get 3 displayed, otherwise you get 1.

I considered that so I created an extra field temporarily to help sort this out called trainedX this would result in a 3 if the corresponding box was unchecked and 1 if it was. I used that as my reference point. I am thinking it is using the item modifier to modify the item itself. I created a terniary formula to drive a similar result outside of the item modifier and it worked.

warm quartz
#

As long as it works. 😋

candid badger
#

Is there a way to make certain rolls Private GM even if Public Roll is set as the default?

formal goblet
limber burrow
#

Hello fellow nerds.

Over the past few years I've written my own TTRPG system which I have been testing and playing in roll20 using HTML and Javascripts.

I've tried migrating it to foundry for a number of reasons but mainly its the ability to have custom compendiums to speed up character creation, and a less restrictive implementation of JavaScript for macros or scripts.

I'm working with the Custom System Builder first to see how easy it is to port this over.

I've been making an assumption which I guess is wrong.

In roll20 I'd define custom attributes (say if the Strength mod is attribute_str_mod) within the sheet's scriptworker sheet.

From what I've recently understood in CSB I need to instead define that as a hidden value and then call that value in a number field or whereever else I want it.

Is first defining it as a hidden variable the right way to do it?

Also how do I then call that hidden variable in a number field in a way that just displays the number but is uneditable?

#

From reading the documentation am I right in saying I don't call it as $[str_mod]$ because you don't want to call variables in a formula unless said formula is transforming the attribute/variable in some way shape or form?

#

I've just figured it out.

Labels labels are how I do that

warm quartz
#

You are right, you can use a Label for uneditable fields. As for hiding it in you character sheet, you can set any element as visible only for the GM or by a formula (just make it always false like 1 == 2).

formal goblet
limber burrow
formal goblet
limber burrow
#

No complaints if its harder, this is already easier than making a custom HTML sheet with JS for the logic.

formal goblet
limber burrow
#

I mean for adding items from the compendium to the sheets themselves.

For example in my system there's already near 300 spells.

I'd like to be able to speed up character creation by having drag and drop from compendium to sheet

formal goblet
#

Yeah, that's possible

#

You just drag the Actors/Items out of the Compendium whereever you need it

#

I suggest to load the Templates into an Adventure Pack, so you don't get issues with different document IDs between different worlds or so. The other Document types (Actors, Items, Macros, ...) can be put in whatever type you like.

limber burrow
#

in the character sheet templates I mean

formal goblet
#

CTRL + Drag

limber burrow
#

Thanks, this is all shaping up to look like a much more custom friendly system.

#

Roll20 has served me well so far, but my god do scripts slowdown load times.

Also hardcoding an entire compendium in JS looked like a task that I'd rather die before doing

formal goblet
#

Yeah, you don't do that here. You simply just move the documents into the compendium collection and they get stored there

#

It will still take a lot of time to create 300 Items, because you have to set the values for each sheet. But that's natural

limber burrow
#

the on paper system is a good 80% done so I'm working from a good foundation.

formal goblet
limber burrow
# formal goblet Yeah, that should also work, as long as the schema is valid

might be a more generic Foundry question.

But would that be able to handle one item in the compendium filling multiple different field sections in the sheet.

For example I have a defined JSON structure for weapons, but also for actions. A sword would naturally come with an attack action for it. Or would I need to keep that seperated into the sword item and the action item for swinging said sword?

formal goblet
limber burrow
limber burrow
#

Would that work in table rows though? With the compendium essentially populating a blank row below the item to hold any action fields it may need?

#

Actually I've got full CSS control over the sheet so it'd make much more sense to have a pop-out panel open when hovering over items with the actions associated with said item if it had one, and then just use hidden fields for it that select based on the item ID.

warm quartz
#

Finaly! I finaly found how to remove those pesky boxes around the item names... (and yes, I know that many of you have already figured this, but there are still people who are new to CSS)
For those, who like me, have been looking for an answer : In you item displayer, there is a collapsed part called Advanced configuration. Inside you'll have Additional CSS classes. Just add a CSS class with the following code :
.BorderNone a {
border: none !important;
background: none !important;
}
'border: none' will remove the little black border & 'background: none' will remove the white background.
Here is the result before (check Professional Skills) & after (check Common Skills).

warm quartz
silver lake
#

Hey, anyone's got a template I can study to understand 'Active Effects'?
I want to figure some way to tag a character as wounded, in a way that it would lower some of their stats. I imagine Active Effects is how I'd get around to doing something like that?

formal goblet
#

You can also start with an Active Effect Displayer. This one lets you create an Active Effect on the go without much effort

silver lake
silver lake
formal goblet
formal goblet
silver lake
#

Right. Still, when I look at this:

#

I don't understand what I'm looking at.

#

I know what keys are

#

and I can write formulas.

formal goblet
silver lake
#

I never used item modifiers because I don't know how to work with them

formal goblet
#

The value (formula) is just the value you want to modify by

silver lake
formal goblet
#

You could, but not mandatory

silver lake
#

I don't know what group is, or what op. is, or prio

#

I imagine 'prio' is priority.

#

I don't know how that influences anything, or how that would be written

formal goblet
#

Group and Description can be ignored if you don't use conditional modifier lists

silver lake
#

Oh

formal goblet
#

Operation is selfexplanatory

silver lake
#

right, so Op. is operation, therefore '+' or '-'

#

and so on

#

yeah?

#

oh

formal goblet
#

yeah, it has a Dropdown

silver lake
#

sorry, I had a glitch before and the dropdown of Op. was blank

#

now that I restarted the app it's not

#

I didn't realize it after taking the screenshot

#

Okay yeah, I was mainly worried about group and prio

silver lake
#

So, these take effect after I tag a token with the status effects on default foundry, is that how that works?

formal goblet
#

Yeah, only applied if the Active Effect is active

silver lake
#

Alright

#

it's easy then

#

thank you!

#

Have a good day Martin!

silver lake
formal goblet
lilac panther
#

I have a Tabbed Panel "Gamemodes" and inside of it i have a tab, named "Fantasia". Can i use something like ${Gamemodes == "Fantasia"}$ to see if a tab is open, or all interactions with the Tabbed Panel are client-sided?

Obviously, I'm asking because ${Gamemodes == "Fantasia"}$ does not work.

cursive heron
#

Could someone tell me, or tell me how to find, the data path to an actor's movement value in CSB?

#

I promise I looked in the wiki first.

lilac panther
#

A feild with a name "movement"?

cursive heron
#

Oh wait, this might be something I have to make actually. Nevermind, I just grasped what I was being asked.

cursive heron
#

I feel like everytime I need to know something, I ask someone, and then immediately after the question leaves my faceholes I figure it out myself... I need a rubber duck to talk to or something.

lilac panther
cursive heron
lilac panther
#

I looked off the foundry to the discord and back. Now I'm lost)

lilac panther
quick sinew
#

I am trying to follow this video so I can make a custom system, but I think it's out of date already because v13 just came out. When I try to download what he recommended I just get errors and I can't create a world.
Does anyone have a workaround or know what I can use instead? https://youtu.be/b2XcMGpjLiY?si=DHLKgbW5ORTPLgZM

This tutorial covers the basics to intermediate functions of CSB without the use of JavaScript. We cover item / actor templates and sheets, as well as what most of the components do at their core.

We do not cover CSB provided functions, or advanced uses of components (aside from the label), which will be left for another tutorial if there's en...

▶ Play video
manic crypt
#

Csb doesn't work with v13, you have to be on v12 to run it.

quick sinew
#

I'm completely new to Foundry. How do I switch versions? I looked around a bit for it but couldn't find anything.

manic crypt
#

You would need to uninstall then install the last v12 available from the Foundry download page.

quick sinew
#

Ahhh cool. Thanks.

manic crypt
#

Same place you downloaded the v13 installer

quick sinew
#

I appreciate it 🙏

#

I figured it had something to do with that.

manic crypt
#

No problem. It's great to use and the community here is nicely responsive.

formal goblet
plush maple
#

So I am trying to use Dynamic Tables with the Dropdown menu making the values from 4,6,8,10 so that hopefully using '1d' in front of it will allow it to roll. Am I making something?
${DmgRollButton:= lookup('DmgTypesFormulas','DmgDice')}$ [1d${DmgRollButton}$]

formal goblet
plush maple
formal goblet
lilac panther
#

Oh, sorry. I see it now on the right.
Another question.
How to make it look like a button?

#

I am sorry for being stupid. I'm asking the question and finding an answer a second later. Don't answer.

silver lake
#

Hey hello! How would I write the 1.(key1+key2) to represent '1.2' if the value of the keys is '1' each, for example?

${(floor(6+(keyA)+(keyB)+(keyC)+(keyD)))/1.(key1+key2)}$
#

These keys are a number field somewhere else in the sheet.

#

The idea is that it would lower this whole value by 10%, for example, if the value it is divided by is '1.1'

#

Therefore, each point in the number fields should lower this value by 10%

#

For clarification 1.(key) does not work.

silver lake
#

I was giving a simpler example for it to be easier to understand.

#

Well, maybe they would complicate things too muc anyway.

silver lake
#

Thank you, I'll try that

plush maple
plush maple
#

Personally I am coding all the mechanics first before jumping into CSS cause I wanna make sure I have everything first before jumping into visuals. But it all depends on how you are tackling this. If you already have a game that you are refrencing off of it should be fine. 🤷🏽

#

Currently working on the Weapons of my system, trying to make it easy for GMs to make weapons, but not have so much bloat that the players look through. Should I use the hidden attributes more in this case?
Also with Dynamic Tables is it possible to still use those values for Item Modifiers? Like if I use lookup('DmgTypesFormulas','weaponSlotVal') to grab the value from that to add onto the occInventory value calculation on the Actor sheet?

heavy elm
#

Hello, is it possible to include a button within a rollmessage so I cant trigger an additional roll from my character sheet or a dynamic table?

sinful spade
#

Personally I do a mix of both,
I go page by page -> all elements on page, then css the page.
you can do section by section.

this helps me keep my workflow clear and visualizing what's going on post 'rough sketch' on powerpoint or photoshop.

#

but it's probably best to get all your elements on the page before styling them, or maybe even doing a 'quick and dirty css' (aka just colors by name rather than rgb, and general positioning/layout) before going back over it with a fine tooth comb later. But it's all up to whatever helps you get the work done.

sinful spade
#

so you'd likely need some javascript? or maybe to hardcode the sending character into the message so if anyone clicks that button it sends for that character? Not exactly sure how you'd handle that...

But you should be able to just use <button> html tag and %{}% to nest javascript into it.

#

Disregard, this doesnt appear to work, i tested it on my end.
apparently JS nested in the ChatMessage.create isn't read by the system.

I think you're stuck with a plain HTML button and a worldscript solution.
something like:
<button data-findme>Click Me</button>
and

  html.find("[data-findme]").on("click", () => {
    console.log("hello world!");
  });
});```
broken pumice
#

That way players only get the relevant informations and the GM can easily go look through the tab if they want to change something.

sinful spade
#

Theoretically doable with a panel set with a z-index to be behind everything, a background-image / color, and a visability formula to choose which to show

#

personally i'd have a separate template for monsters.

keen goblet
#

Greetings ! Just wondering, is there a CSB build for Foundry V13 ( potentially unstable is fine ). No worries if not, just thought to come here and check 💙

keen goblet
#

Alright ! Thank you !

limber burrow
#

How would I have a non unique key sum into a unique key.

So if I had multiple attributes impacting my con_change and my con score is base_con_score + con_change how would I sum up all the fields with con_change in them to get to that total, and would I need to have each con_change be a different key/variable? like con_change_1, con_change_2, etc.

On my current system working in roll20 your traits or character improvements can increase your base score, a character improvement essentially acting like a class ability

#

I’ll have to be able to replicate this system for multiple hidden attributes, for example, totals rolled for proficiencies might have multiple sources for their proficiency mod which sum together.

It’d also be good if I could handle this in a dynamic table so that people can drag drop from the compendium in the future, and so that I don’t need like, 100 hidden rows and values of xxx_change_1, xxx_change_2.

From what I currently understand I can achieve half of this with JavaScript scripts on refresh of any sheet, but I’m unsure how I can have two rows in a table have the same key for a value and both retain unique values

formal goblet
limber burrow
#

Should I expect the table rows to all have the same keys? Or will it number them?

#

It won’t matter much either way as I’ll just direct the script to look for all the keys with the same name ignoring the number

formal goblet
limber burrow
#

Okay but they will presumably all share a common prefix based on the column right?

#

So summing it won’t be difficult I’ll just take from the first n characters

formal goblet
formal goblet
limber burrow
dense pine
#

Curious why my label roll messages for talent checks look different on my mac and my windows pc:
This is how it should look (mac)
Second one is weird (windows)

#

how can i make it always look like on the first screen by default

vagrant hollow
#

Thats a mater of the used Browser. You use on Mac Safari, on Windows Firefox?
It is nearly impossible to make it identically for every Browser.
You will need different css for every Browser.
Foundry is optimised for Chrome.

dense pine
#

i use chrome on both

#

and it looks more like a setting in foundry, dont think its a browser setting

cerulean adder
#

Is there a way to display data in a dynamic table in an item on a character sheet?

I created a backpack template and I want a list of items to display on the character sheet so you don't have to look inside the pack to see what's all in it.

#

I just scrolled up and saw someone asking about something similar but I'm not 100% how this translates to concatenation.

warm quartz
#

I used several item displayers and a dropdown for location on the items. With a filter formula, you can have an item displayer with the gear carried/worn/held and another for the backpack.
Maybe I went a bit overboard myself since I use half a dozen displayers or more (depending on the location).

#

Click on an item, change the location and it goes from held to backpack.

#

The two displayers filter formula (held/worn & backpack).

sinful spade
#

Oh, too easy. Use the template id as the class.

stark creek
#

Is anyone else experiencing this? I have the most recent version 13 build 344 for Foundry.

I've uninstalled and reinstalled it, attempted to revert to a prior version of Foundry, and nada.

formal goblet
stark creek
#

I went back to V12 and it still didn't work

formal goblet
stark creek
stark creek
#

I went back to V13 as it wasn't working on 12, but I don't mind reverting to V12 to use this if need be.

formal goblet
umbral jackal
#

Is importing sheets with item containers supposed to not also import the filters?

short swallow
#

Hello, currently trying to extend dynamic tables to be able to have something sort of like a primary key column
noticed that there's a folder named tests in the source code; was wondering how to use it and also add test cases?
thanks in advance :3

sudden ore
#

Hello, I'm trying to figure out if there's a better way to stop item modifiers from stacking. I just want the highest value modifier of an item to apply. The modifier on the item itself is likely to be a formula that fetches data from the actor sheet. I've already got it working by calculating the modified value and using the ternary operator to update the actor's value if it's bigger. However, I really want to avoid that if I can, since I don't want to keep writing that formula for every item that needs a non-stackable.

dense pine
formal goblet
dense pine
harsh hornet
#

Hi! I'm interested in creating an item displayer that allows only ONE SINGLE item. Is that possible? and if so, how?

formal goblet
harsh hornet
#

That makes me sad 😔 Thanks for the answer.

manic crypt
# harsh hornet That makes me sad 😔 Thanks for the answer.

You can, however, configure an item where it has a dependent field (say, an equipped checkbox) that will only allow a single item to have that status, and then set the item displayer to only display items with that status, which means you'll only ever have one item in that item displayer. I did that for an armor displayer on a sheet, and with some modification you could probably adapt it to your needs:

${item.Readied ? setPropertyInEntity('item', 'Readied', "false") : equalText(string(first(lookup('Armor', 'armorhidReady', 'armorhidReady', 'true'), 'false')), 'true') ? notify('error','You cannot ready more than one set of armor') : setPropertyInEntity('item', 'Readied', "true")}$```

This might not be optimal coding, I was still pretty new when I was playing with that, but it should give you a direction to check in.
formal goblet
manic crypt
#

Good point. Mine does assume that someone could be carrying more than one set of armor and prevents them from equipping it.

formal goblet
manic crypt
#

Oh, that's a MUCH more expansive concept.

formal goblet
# manic crypt Oh, that's a MUCH more expansive concept.

It would be a completely new feature at this point, with quite a bit to consider from our perspective. And making it as easy AND extentible as possible to use is also something we have to think about. And tbf there are some other features I'd like to work prior to this one

tiny hinge
#

i am getting " Error: Undefined function fetchFromDynamicTable" . is fetch from dynamic table deprecated?

formal goblet
tiny hinge
#

oh dang alright. let me try that out

formal goblet
tiny hinge
#

and thanks btw. lookup fixed it

formal goblet
#

And I also don't like long function names, but that's just a side fact

tiny hinge
#

understandable

#

how do you add columns to the item displayer?

#

oh wait something is not right the item displayer is a renamed item container and old item container has the ability to add columns

tiny hinge
#

ok nvm figured it out lol

plush maple
#

Okay getting closer to a lot of my system progress. But I’ve been curious if it is possible to make the Class Levelup system similar to 5es with the pop ups and auto adding some of the class feature to the proper boxes?

I might be missing an options with the items or custom template so I just wanna make sure before getting too distracted.

formal goblet
plush maple
sinful spade
# harsh hornet That makes me sad 😔 Thanks for the answer.

in my system i have races that can be selected, they're gained by a radio button during character creation - when you hit the 'next' button it gets which radio button is selected and then gives the player that item.
it also checks if an item with that template (_race) already exists in the character sheet, and if so, deletes it - this means there can only be one during creation and i dont plan on dragging more in manually.

however if you need to be more secure than that for some reason -> create a world script that checks a character sheet for more items of said template and delete them EVERY TIME a item is added, or of that template.

sinful spade
# plush maple Ah okay! Good thing I didn’t get too far into that XD Was hoping the compendium ...

if it's item based like 5e, you can use user input templates to select options, and use js to fetch the item with that name and template to add to their sheet based on selection 🙂

That, or you can do what i did for my character builder, and place your whole sheet in a panel that can be hidden when 'advancement' mode is on -> if it's on, hides the main panel with your actual sheet, and shows the advancement panel instead, where you can have the full range of CSB editing.

#

so normally the enableCC button is hidden, but i revealed it to show more about how it works, -> when a sheet is created it is checked by default, and finalizing creation or ending advancement unchecks it.

brittle moth
plush maple
sinful spade
#

And thank you! They took a looott 🥲 I had to make a custom meter in a label and build out additional spans to get the shielding

#

Or I guess grey healt in the case

plush maple
#

Okay that helps a lot. I am using Item based stuff to help along, but the classes also do not have to worry about Sub Classes. So having the perks auto add and then pop-ups for saying to add additional perks was the idea so far. But this helps a lot.

plush maple
# sinful spade Or I guess grey healt in the case

I bet!! I haven't gotten into my CSS diving yet, as I wanna make sure the mechanics work first before doing all the ribbons. Also cause I know if I do the CSS code (which is the code I am most familar with) it will defeat the purpose of this projects. Me learning more about JS XD;;;

harsh hornet
sinful spade
plush maple
#

😮 📝

#

Okay I see. Yeah those hidden panels are very helpful. I am using them for the item creation part for GMs to make custom items in the system easier. Hopefully coding everything to just be toggled then add the value with drop downs and number fields.

sinful spade
#

Yeah I have panels that are just inputs for items for myself 😅 then the other panel is the player view and displays all that info in an orderly way

#

Input d input mod input type input -> 4d6+2 slashing

#

😅😅

plush maple
#

XDDDD It works for me! LOLOL I am also doing something similar to just help stream line all future item creation while keeping it within the system rules (for the most part.)

short swallow
brittle moth
austere lava
#

Is it possible to have an Items check box be clickable inside an Item Display?

broken pumice
#

Not directely, but you can add a label that when clicked will change the state of the checkbox via setPropretyInEntity().

austere lava
#

Is there a way to use sameRow() to get a dropdown's label text instead of its value?

warm quartz
austere lava
warm quartz
#

So I you cannot change the dropdown key, then you can use a formula to display the right text.

austere lava
#

Looking into the objects I can see the values are set next to the keys so they should just be grabbable.

austere lava
#

Ahhh I got a fix using a switchCase()

safe herald
#

Hello there. I'm trying to use a Label Roll Message to post a button in chat, and when you click it, it should run a function (like rolling dice or something). I think I figured out how to get the button to show up, but it doesn't actually do anything when clicked. Can you help with this?

brittle moth
formal goblet
sudden ore
#

Is there any clean way of passing text to the initiative chat card? I'm modifying the effective roll numbers in a macro on certain results, but I need to reference the original roll numbers because it matters for degree of success adjustments. I'm probably just going to end up creating a 'ride-along' ChatMessage specifically for initiative rolls, but it'd be slightly neater to me to just tweak the flavor of the initiative card that already gets generated.

sudden ore
#

I already have a similar thing to that for everything that's not the initiative formula set in the CSB game settings. It's that I want to alter the message flavor of.

formal goblet
sudden ore
#

Doesn't seem too difficult to leverage in my use case, thanks

fair yoke
#

Hi all, Is there a way to create a new line in a dynamic table frome a rollmessage ? I'm trying to implement a log system to let my players track there XP expenses and was thinking of using a dynamic table.

weak saddle
#

Hi folks, how do I put a hr (horizontal line) between my labels for example? it's not a component

weak saddle
#

it just creates a line break area, likely has 0pt size. can't click on it too, have to undo

#

I guess css is needed to make it have size

#

or inline style attribute maybe?

formal goblet
#

You can do both, there's no restrain for that

weak saddle
#

is it possible to dynamically add checkboxes to a character sheet? I don't like HP, wanna use hits with different severity, and checkboxes to mark them as the character gets hit, but the number of checkboxes depends on endurance...

formal goblet
weak saddle
#

so I could hide some if the endurance is not high enough? cool 🙂

formal goblet
weak saddle
#

The hidden items make their slots available for following items in the panel with columns 😦

#

4th and 5th are hidden in two first rows, as well as 3rd and 4th in third

#

is there way around it? a table instead of a column panel?

#

okay, got it, thx!

plush maple
#

Okay so, I am sure it has been asked here before but I've been trying to trouble shoot ammo usage. Not coding the use of ammo part just layout wise. Do I really have to make each checkbox for the amount of ammo a player can have or am I missing a significantly easier way to do this?
Or should I just use number field and give up on that idea to do boxes? XDDD

weak saddle
#

if this is for firearms with clips or other weapons that use a similiar resource, you could maybe stack them in clips and track each clip value as a hidden parameter and only mark clip as empty when the last piece of ammo is used? This way the players wouldn't know how much ammo they have left in the clip- realism increases 😄

safe herald
plush maple
weak saddle
#

I'm trying to hide the location selector when the corresponding checkbox is not checked, but it just won't hide regardless of what I have in the visibility formula 😦 Ideas?

#

I checked and the key in the formula is identical with the key on the checkbox

austere lava
#

I have panel layout set to vertical and for some reason its slotting in horizontal

formal goblet
formal goblet
safe herald
formal goblet
#

And checkBoxKey == true can be shortened to checkBoxKey, because true == true => true & false == true => false

formal goblet
weak saddle
#

If I have 3 or more selectors like this, do the keys for options in the dropdown need to be unique as well? they should mark essentially the same thing regardless which selector marks it

#

also, after correcting the formula the selector won't show up no matter what I do 😄

#

not even refreshing the sheet after checking the box helps

formal goblet
weak saddle
#

thank you!

stone hare
#

Hey all! I just want to say i am super grateful for CSB! I am not experienced in scripting so to have an ability to do majority of stuff though CSB is a blessing.

That being said, i am wondering about how to do specific thing. Its for the Step-Dice that i have in my system. I have multiple variables:

  • Attribute: number that player can control
  • Dice: is connected to attribute and its going to be the number you roll. (pure calculation)
  • Max Die: is just a maximum number that ill use for some other calculations. (pure calculation)
  • Cost: this is for point system that will also be included into calculation on how many attributes you can have and how many do you get per level. (pure calculation)

I was wondering if Dice, Max Die and Cost is something i should put into Hidden Attributes since they all come from changing the Modifier?

Thanks for any help!

formal goblet
stone hare
stone hare
# formal goblet Yeah

Cool, now i got to figure out how to connect all the variables so when i change attribute, the dice also changes.

stone hare
formal goblet
short swallow
# safe herald Hello there. I'm trying to use a Label Roll Message to post a button in chat, an...

you could also try using the requestor module (https://foundryvtt.com/packages/requestor)

label roll message could be something like this

%{
await Requestor.diceRoll({formula: "2d4+2", flavor: "Healing Potion"});
}%

or if you want for the buttons to be as if you clicked an actor button, you could make it call chat commander stuff
(provided you have a selected actor token or a configured player character in the user configuration)

%{
await Requestor.request({
  title: "Rolling",
  description: "in the deep",
  buttonData: [{
    label: "click me",
    command: async function(){
      return actor.roll("buttonSTR");//or some other button (key to a label) in the actor
    }
  }]
});
}%
sinful spade
#

Here's mine for the label text
<i class="fa-regular fa-${item.isEquipt ? 'square-check' : 'square'}$ " style="color: ${item.isEquipt ? 'red' : 'green'}$; background-color: white;"></i>
Roll message:
${setPropertyInEntity('item', 'isEquipt', "item.isEquipt ? false : true")}$
this is a in-item displayer checkbox toggle for the 'isEquipt' checkbox.

#

@formal goblet the wiki section on this is missing, unless i'm just missing it in this new organization ^^

stone hare
#

Stupid question but how do i add condition to calculation

e.g. STR is 0, but if I pick a Specialization STR from the dropdown menu, it gets +1

stone hare
#

i am trying to do it like this:

${Specialization == spec_spd ? 'Yes' : 'No'}$

#

But its giving me an Error

#

if i change Key of the Power to 1 and i use the same formula but i put == 1, then it works. I guess i just cant use ==, but i dont know what to put in.

broken pumice
#

If you want to compare strings in CSB you have to use ${equalText(Specialization, "spec_spd") ? "Yes" : "No"}$

stone hare
#

I am not sure if this is the bug or i am doing something wrong. But i have a Field with the Key called spec_spd that i deleted, and now when i want to create it again with the same name, it gives me error that i need unique name (like its already being used, but i deleted it).

#

i restarted the Foundry and now is ok.

regal pike
#

Good time of the day! I have a question. Is it possible to implement dice values ​​from a Dynamic Table using the lookup command? Or do I need another command? I understand that lookup works on numbers, but with a text field - an error is returned.

I want to make it so that when choosing a dice, it is used in the cube roll. Is it possible to do this?

formal goblet
#

Because only ${ref(dropAttribute)+10}$ is a formula, the rest is a static text

brittle moth
#

Hello people, it's been a while !

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

[DEPRECATION] Deprecated Item modifiers and Status Effect modifiers, to be removed in CSB 6.0.0 - Foundry 14

Features

  • Added button to open Documentation in Settings Tab
  • Added possibility to use formulas in the classes-field of every Component (conditional formatting)
  • Added img and uuid to the standard-properties of every entity
  • Added variable this for self-references
  • Added russian translation (thanks to Друманин Дрин (Drumanin Drin))
  • [#446] Added indentation and removed Template History for Template Exports
  • Added progress bar for Template reloads
  • Added more Template reload options (e.g. Tokens in Scenes)
  • Added Custom Active Effects feature : (the big one - Documentation : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/beta/en/Guides/Active-Effects)
    • Added Active, Origin and Description columns to Active Effect Container
    • Added buttons on active effects to manage a predefined list of Active Effects
    • Added a Dropdown in the Active Effect Container to optionally select a predefined Active Effect to add
    • Added full integration of now-recommended module DFreds Convenient Effects
    • Added full integration of now-recommended module Status Counter
    • Items can now be modified by an Active Effect
    • Added Status Effect Customization

Fixes

  • Fixed an issue with sub templates and user input template not saving correctly
  • Changed requirements for module Chat Commander, making it optional
#

Please refer to the Beta Wiki for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/beta/home
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 !

storm stream
#

Is there a formula that checks how many lines there are in a dynamic table? i want to create a burden modifier: for every burden you get -1 to rolls

#

i fugured I could secretly create a number column with the number 1 and have formulas refer to that but Idk

manic crypt
#

count(lookup(<tablename>, <name column>)) could do that.

storm stream
#

let me try!

manic crypt
#

Theres a lot of stuff that math.js can do, you just leave the math. part of the expression off in csb.

storm stream
#

i have tried looking into math.js but i couldn't grok it

short swallow
#

Looks like there'd be full support for status counters as well; could potentially be the count of the burden status

manic crypt
storm stream
#

${count(lookup(burdens, burdenWeight))}$ is this correct ?

#

i'm getting an error

manic crypt
#

quotes around your keys in lookup

storm stream
#

thank you, that did it!

#

My last question for now is whether I can make a label component into a button that creates or looks up a journal

#

I would like players to be able to create an item and, if they wish, create a journal page to detail that item

#

I could use the item component instead though

manic crypt
#

When CSB formulae interface with the core functions of Foundry you're entering js scripting.

storm stream
#

But then the deal would be to make a button that creates a new item

manic crypt
#

same deal then, they're comparable tasks from foundry's viewpoint.

storm stream
#

Maybe I would like the journal better

#

Because then items will have a history or something

#

Catalogue style

#

Well, what do I do? Is that something I ask in macro polo instead?

manic crypt
#

Essentially, yes. You need a macro that creates a journal entry (or item), and then you create a label button that executes the macro.

storm stream
#

Fantastic.

#

Thank you!

formal goblet
#

Yeah, or you execute it in the Label directly. There's basically no difference at that point

manic crypt
#

True.

storm stream
#

Thanks!

candid badger
#

Hello all. I am having trouble with a roll formula:

Current Reputation: ${reputation}$<br>
${#?#{Reputation}}$
Spend: ${reputationspend}$<br>
New Reputation: ${setPropertyInEntity('self', 'reputation', reputation - reputationspend)}$
${equalText(reputationselection, 'Renown') ? setPropertyInEntity('self', 'renown', renown + reputationspend) : ''}$

Everything works except the last part of updating the component renown. I even simplified the formula to give a hard number and I see it show up int he result, but it doesn't update the component renown.

Any ideas?

formal goblet
candid badger
formal goblet
candid badger
regal pike
regal pike
sick acorn
#

Hello All. I was wondering if I could request help on what seems like a simple roll formula. I'm using a dynamic table for players to input their own damage for a spellcrafting and weapon enchantment system. I want each individual spell or enchantmant to have it's own roll option that will output the formula the players input in the WENCHANTDAM field (As a string). If I use the formula ${[sameRow('WENCHANTDAM', '0')]}$ nothing happens. But if I remove the square brackets it outputs the string into chat. But I want it to actually roll.

formal goblet
harsh hornet
#

Hi! Is there a way to get the profile picture of an item inside an Item Displayer? Something like the "item.name", but with the image? Also, how do you print it on the chat? Thanks

plush maple
#

Okay quick question. If I wanna show the dice result with the true false, do I need to just repeat :alchCdValue: or do I need to do additional code? Basically I wanna see the result for a success be # Effect Persist I see that the dice rolls again unless I am missing something else.
(second screenshot)
I am trying to see if making the value something saved but I am missing something. It rolled the first code fine, but now not working with the second one. Trying to see if I'm just blind to the one thing I am missing. 😵

formal goblet
plush maple
#

Okay thank you! I knew I recognized parts of this. XD I just used the wrong finding key words while searching. THank you again!

plush maple
#

I got it working! Thank you again!

astral jewel
#

Hi, new to CSB, is there somewhere I can find tips for building templates and making rolls or linking labels for calculated values?

plush maple
#

https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Guides/Formula-System#execution-context Been finding a lot of the helpful stuff in the wiki here. With some help about arrays here. https://mathjs.org/docs/expressions/syntax.html Not sure exactly what you are looking for. But these two wikis are where I started.

stone hare
#

Hey all, i have a noob question. Lets say i have:

STR modifier and i want to add to it from different sources. Is it possible to do that inside of Formula of thoes sources instead of taking STR modifier and inside formula to reference those sources.
E.g. I have 10 different items that add +1 to STR modifier.
Instead of STR Modifier having +1 from each one of them.
Can I have so each Item gives +1 to it.

If so, how would that be inside of formula of the item. I guess i would reference "key" of STR Modifier and add to it, but how to do that?

manic crypt
#

Item modifiers can do that. When the item is on the sheet it can apply the mod to designated existing keys.

storm stream
#

y'all, something is up: i made a button for a dice roll and so every time I roll it increases the current value of the stat?

${setPropertyInEntity('self', 'strengthTotal', 'strengthTotal+7')}$

#

you know

#

i should not be using set property facepalmpicard

plush maple
#

I am feeling super silly, how do I remove the extra number 4. I just want the dice number not the extra one. 🪦 I am not sure if I am just being very clueless.

manic crypt
#

Try putting the die roll in its own line in the Roll message and prefacing it with #, so ${#[!1d6]}$ that should hide the line from the Roll message but still display it.

plush maple
#

🤔 It removed the dice over all. Trying to solve this problem.

#

Very troublesome XD cause I wanted a specific look but that is my fault in the end for not knowing enough code. XD

#

The only thing that made it work is making an IF ELSE statement that only shows the text. Not sure if this is the cleanest way to deal with this but this is what I got.

storm stream
#

folks, for dynamic tables, i wpould like to have a roll that checks a dropdown option and chooses the ability to roll based on it

#

how do i reference the dropdown key for same row rolls?

plush maple
#

I believe it is loockup(...) code? If I remember from when I also was trying to do this. Um... (looking for link)

#

but something that I've been told a lot is the dynamic tables are always Arrays so it might need a little extra code to get the value stuff you are looking for.

broken pumice
#

Seeing that the beta for Active Effects has released ! Thanks for the great work !
I have approximately half a million macros that I can now consolidate into one 🙂

verbal portal
#

Hello All
I am trying to make a button that when pressed set to true a checkbox in the same dynamic table...but something doesn't work

#

${first(lookup('radiazioni_livello','Livello1')) ? true : setPropertyInEntity('self', lookup('radiazioni_livello','Livello1'), true)}$

I made once before I messed up but now I don't remember how I made XD

verbal portal
#

I can use well the setPropertyInEntity with a normal static key but when using a dynamic table here the mess...

#

I know is the array problem. but there isn't a way to jump over this issue ?

brittle moth
verbal portal
#

Thanks mate !!! I did not think for anything to that

stone hare
#

I am trying to find the best way to do a specific thing:
I have specializations in my game: its currently a drop down menu with multiple choices. When you seletc one i would like to add some bonuses to stats. Do i need to go to each one of those stats and reference a condition and bonuses, or is it possible to have a list of bonuses in one place like:
+1 to STR
+5 to SPEED
+DEX to ACCURACY etc.
And when I select specialization, all of those are added.
If so, how do i do it?

broken pumice
#

I think the best way would be to have an Item that is the specialisation with all the modifications to the different stats as Item Modifiers. Then, the players can simply drag and drop the specialisation they want on their character sheet.

stone hare
#

That is an interesting approach and it might work for this example. But is there no way to just add a number into another formula? More specifically, i have a number field (that player can manipulate), its got min and max values. But i would like to add to that value some other stat's value. Like here in the screenshot. Lets say player set this to 2, but if HP is FULL, it give it 1 more to it, so it would be 3 and player can still move the number up or down.

broken pumice
#

You can do it by modifying a third Label with a formula in it. Something like ${speed_modifier + (hp_current == hp_max) ? 1 : 0}$ then you can use this label for other calculations.

#

or if your value of HP is literally FULL, then ${speed_modifier + (equalText(HP, "FULL")) ? 1 : 0}$

#

Input Fields (like Number Field in your case) cannot be directly modify by a formula. There would be conflicts between the value set by the formula and the value set by the user, so you have to go through a Label.

stone hare
#

@broken pumice Sorry to bother you, i have not done any items so far, but i made a simple template where I have put what attributes i want to add some numbers to. But when I made an item and dragged to the character i didnt get any bonuses. What am i doing wrong?

broken pumice
#

You have to set the Item Modifiers. It's the button on the top right.

stone hare
#

Sorry for stupid questions, i started using Foundry like 3 days ago, and i also dont have any experience with coding.

broken pumice
#

No problem ! People are here to learn and to help other learn.

#

You should see something like this. Put on the left the key of the field in the actor sheet that you want to modify and on the right the formula or value that you want to add.

#

So, for example, if you want a Specialisation to add 1 to STR and 2 to SPD. You would put STR on the field key, choose the + as the operator and then put 1 as the value.
Then, you can add a line and repeat the process : Key : SPD, operator : +, Value : 2.

stone hare
#

i made this, but its still not working for me. I assume dragging it just into the Item Displayer is not enough, maybe i need to set it somehow to be equipped?

broken pumice
#

Dragging it should be enough.
You don't need the ${}$ on the left side.

stone hare
#

that was it

#

thanks

#

now i have an errors for my Dice Roll connected to mod_pow_final. I have a step-dice system, and i am reading the values from the dynamic table. It looks like me adding an item impacted how the formula is calculated, resulting in error.

broken pumice
#

It seems that the system is finding nothing in the Table named Attributes that has a Mod equal to mod_pow_final and therefor returning null. How does your Attributes table look and what is the value of mod_pow_final ?

broken pumice
#

remove the double quotes "" from the 1 and 0 in mod_pow_final. It's adding them as string and not numbers. (I think)

#

(ie. "1" + "2" => "12", but 1 + 2 => 3 )

formal goblet
broken pumice
broken pumice
# stone hare

With the information I have I am not really sure of what is going wrong. All I can say is that, probably mod_pow_final has a value outside of the -1 to 7 range.

harsh hornet
#

Noob question: is there a way to trigger a roll inside a Label from somewhere else?

formal goblet
harsh hornet
formal goblet
harsh hornet
harsh hornet
storm stream
harsh hornet
formal goblet
formal goblet
storm stream
#

i am missing something

#

${[1d20] + ref(sameRow('traitAbility'))}$

foggy grotto
#

] needs to be after )) I think

formal goblet
formal goblet
storm stream
#

ok, so i made it point to the correct stat as text in a label

#

just not the die roll

#

i don't know what changed but it worked this time

#

oh i know

#

i wrote the incorrect keys in the dropdown

#

like

#

each dropdown element has to be the same correct key as the atribute it is referring to

#

look, strength works because the stregth ability key is strengthTotal, but endurance should also be enduranceTotal, not traitEND

storm stream
sick acorn
#

Thank you all for the support, I have another question!

I' doing carry weight limits, and I'd like them to be calculated Dynamically. I ahve two item viewers, one for weapons, one for armor, called WEAPONINV and ARMORINV respectively. The item templates for all items accepted by these viewers all have the ARMORWEIGHT or WEAPONWEIGHT field. I want to add a label field to each item viewer that will show the total of all those fields, but I can't find a way to do that without calling the uuid directly. unless I'm misunderstanding something this won't work since I want it to be dynamic (As in plyers can add things to their own inventory and the field will be auto-updated, no matter which player it is).

I'm thinking the "fetchFromUuid" or "fetchFromActor" would work best, but I can't figure out how to use this. Is there some way I can dynamically call the actor's uuid and set it as a variable?

formal goblet
sick acorn
#

I guess what I'm asking is how do I get the item displayer itself to contain the value from the items in it.

regal pike
#

Good evening today, working on the dropdown menu in the concat menu and received a bit confusion on a problem.

`${#concat(
?{Advantage:"Преимущество?"[check]},
?{Disadvantage:"Помеха?"[check]},
?{CharacteristicHit:'Попадание?'|"Лёгкое Оружие","Лёгкое Оружие"|"Среднее Оружие","Среднее Оружие"|"Тяжёлое Оружие","Тяжёлое Оружие"|"Особое Оружие","Особое Оружие"|"Древковое Оружие","Древковое Оружие"|"Огнестрельное Оружие","Огнестрельное Оружие"|"Рукопашный Бой","Рукопашный Бой"}
)}$

${Roll:= Advantage ? [2d20kh] : (Disadvantage ? [2d20kl] : [1d20])}$

${modWeapon := CharacteristicHit == "Лёгкое Оружие" ? PM_PreSe1MOD :
CharacteristicHit == "Среднее Оружие" ? PM_PreSe2MOD :
CharacteristicHit == "Тяжёлое Оружие" ? PM_PreSe3MOD :
CharacteristicHit == "Древковое Оружие" ? PM_PreSe4MOD :
CharacteristicHit == "Особое Оружие" ? PM_PreSe5MOD :
CharacteristicHit == "Огнестрельное Оружие" ? PM_PreSe6MOD :
CharacteristicHit == "Рукопашный Бой" ? PM_PreSe7MOD : 0}$

<table>
<tr>
<th>Проверка <strong>${CharacteristicHit}$</strong></th>
</tr>
<tr>
<td>Бросок</td>
<td>
${Roll}$<br/>
<strong>${Roll == 1 ? "Критический провал" : Roll == 20 ? "Критический успех" : ""}$</strong>
</td>
</tr>
<tr>
<td>Тип броска</td>
<td>${Advantage ? "С преимуществом" : (Disadvantage ? "С помехой" : "Обычный")}$</td>
</tr>
<tr>
<td>Модификатор<br/><small>${modWeapon}$</small></td>
</tr>
<tr>
<td>Модификатор Рассудка</td>
<td>${PM_SanityBuDe}$</td>
</tr>
<tr>
<td><strong>Результат</strong></td>
<td>
<strong>${Roll + modWeapon + PM_SanityBuDe + PM_Insp}$</strong>
</td>
</tr>
</table>`

formal goblet
storm stream
#

my last one is that i want the die button to roll whatever i write in the text field but i am not managing

#

in this case 1d6

#

i tried this ${[ref(sameRow('itemDMG'))]}$ and this ${[sameRow('itemDMG')]}$

#

it's a text field component

#

things can be anything from idk 1d4 to 2d6+1d8+2 XD

regal pike
storm stream
#

in other words, how do i tell csb to roll the contents of a text field

broken pumice
storm stream
#

Understood! I'll try, thank you!

vapid olive
#

Small thing! I'm trying to connect a Number Field Component Key called 'str_number' into a macro for calculation. How do i use Component Key's as a variable for macro scripts? Cant wrap my ahead around how to do that in the tutorial.

#

It's probably really easy and im just being a goober

formal goblet
vapid olive
#

From a lable ^w^
%await void game.macros.getName('YourMacro').execute()%

#

Script and the Macro works from the lable, its just that i need to connect Component Key values into the macro uwu

storm stream
#

I removed ref

#

World's now!

#

Thank you!

vapid olive
#

I'll post the macro as well!
//I want to put in the component key strength or 'str_text' in numDice or other values i decide.
const numDice = 4
const fixedSuccesses = 0;

const roll = await new Roll(${numDice}d10).evaluate({ async: true });
const results = roll.dice[0].results.map(r => r.result);

const baseSuccesses = results.filter(r => r >= 5).length;
const criticals = results.filter(r => r === 10).length;
const failure = results.filter(r => r === 1).length;

const extraSuccesses = criticals;
const extrafailure = failure;

const totalSuccesses = baseSuccesses + extraSuccesses - extrafailure + fixedSuccesses;

sick acorn
formal goblet
vapid olive
#

Ahhh knew I was missing something, gonna check it out when I get home.

brittle moth
#

Beta time !

**Beta version 4.5.0-rc2 is now available, with the following change from 4.5.0-rc1 (#1037072885044477962 message) : **

Features

  • Added Active Effects on Templates, copied to the Actors or Items on refresh
  • Added Manager Active Effects button even if Convenient Effects module is active

Fixes

  • Fixed Convenient Effect integration - Predefined effects object is now compatible with the module
  • [#441] Added the id of the entity to its default props
  • [#439] Fixed Rich Text Area left alignment
  • [#448] Fixed Number Field wrongly triggering relative modification when its value is a negative number

Other

  • Updated Verified Foundry Version to the latest v12

Please refer to the Beta Wiki for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/beta/home
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 !

storm stream
#

Folks, how do you set up a github Repo for this?

#

I wanna share my sheet (and other things I make for the UVG system)

undone smelt
storm stream
#

Awesome!

plush maple
#

Nevermind what I typed XD;;; I realized that hidden attributes can't be edited once it is turned into an item. So that helps.

fair yoke
#

Hi all,
I'm trying to fill a text field in a dynamic table using SetPropertyInEntity. It works fine when I try to enter a number, but not with text. I feel like SetProperty can only write computable values (numbers, true/false). Is there a function to update a field with text data?

storm stream
#

y'all, this might be complicated: i would like to add an option to a dropdown list that is read as armour

#

like, if i add an entry that says ARMOUR, the defense bonus in a different label component gets updated when that entry is selected

#

i assume this is something i add in the "defense" label component?

#

like

#

that physical defense bonus at the top updates from 8 to 9 if an item has the ability "armour" and the mod is 1

formal goblet
formal goblet
fair yoke
fair yoke
formal goblet
fair yoke
formal goblet
#

Otherwise they aren't nested

fair yoke
sinful spade
#

i would have said 'navigating the wiki' 😉 but the new one is so much cleaner

broken pumice
#

I would say wait for the Items and modifiers, because the beta introduce Active Effects and Item Modifiers will be removed in version 6. So you are probably better starting with an other topic then come back to Items and explain the Active Effects with them.

dense pine
brittle moth
# dense pine Do i understand this DEPRECATION Text correctly - Items will lose the ability to...

Yes and no 🙂
In CSB v6.0.0 (Foundry v14), the modifier system will be deleted entirely, in favour of Active Effects

Active Effects can be used as modifiers, using the "effects" tab of an Active Effect Configuration. By default, the Active Effect modifies the current entity it is assigned to, but in Items you can set it to transfer to the parent entity, which is the Actor or the container Item.

Using this, you can recreate these modifiers with a more powerful system than modifiers ever were 🙂

warm quartz
#

Is there a way to " preload " an item displayer so that when creating a new actor from a template a few items are already present ? Like the common skills from Mythras.

#

If not, i'll just create a blank character and duplicate it when needed.

formal goblet
warm quartz
broken pumice
#

I'm messing around with the beta and I'm trying to reproduce some of my Item Modifiers with Active Effects, but I'm not able to make them work conditionally. I use to have a modifier that would add a value to a key only if the Item is equipped with ${equipped ? 2 : 0}$
But Active Effects don't accept formulas. Is there an other way to achieve the same result ?

formal goblet
broken pumice
#

ok, I've probably messed something else up, then. I'll keep trying.

formal goblet
#

It's a fresh feature, so stuff can miss. Better finding and fixing it now instead of later

broken pumice
#

I think I know what my problem is.
Formulas works, but the Active Effect is looking for keys on the Actor and not on the Item. Since my equipped field is on the Item, the system cannot find it.
I don't know how to access a key in the Item. I tried item.equipped but it's not understood either.

formal goblet
broken pumice
#

Yes

formal goblet
#

@brittle moth might be the wrong trigger-entity in this case

broken pumice
#

I have to go very soon, but I can open an issue later if needed.

brittle moth
cerulean adder
#

How would one save a macro for ALL players to use?

formal goblet
cerulean adder
#

Ah, so the players will have to pull it from the compendium in order to use it? So if I create a button that triggers a certain macro it won't work if the user hasn't downloaded it from the compendium?

formal goblet
cerulean adder
#

Oh, awesome!

formal goblet
cerulean adder
#

Is there a way to conditionally run a macro? I'm trying this as a test before I add more stuff but it's not working.


%{return await game.macros.getName('Grenade').execute()}%

</span>```
#

Nevermind. I just did it with JS

formal goblet
cerulean adder
#

I'm a bonehead! But, I'm learning! haha thanks for your patience

timid marten
#

Will CSB get an update for Item Piles since all further versions will need for system creators to add the compatibility themselves?

#

IP is one of the most known and necessary modules for Foundry and a great addition for CSB since we cannot drop items or create item piles without the module

#

And I don't think this compatibility can be added on the user's side

storm stream
#

${agilityTotal + 7 + (equalText(itemAbility, 'physicalarmour') ? 1 : 0)}$

formal goblet
storm stream
formal goblet
#

Errors and Warnings with uncomputable props

storm stream
#

doesnt look like any of the errors are related unless i am looking in th wrong spot

formal goblet
storm stream
#

without any operations, only as a label, it shows 0

#

(the one right under "defense"

storm stream
#

console tab

formal goblet
#

You could try fromUuidSync('uuid').system.props with the UUID of the Actor and inspect the values created

storm stream
#

where do i do that?

formal goblet
#

In the console directly

glossy hare
storm stream
#

fromUuidSync('Actor.OGnNzCOEZCcz8QTu').system.props

#

like that?

#

for the record, this is what my dropdown looks like

#

and i am looking to have the "defense" label add the value i input here:

#

in the "mod" field

formal goblet
# storm stream

defense is outside of the Dynamic Table, where you want a value from. So you have to use either find() or lookup() (for Arrays)

storm stream
#

maybe that's the issue?

#

first of all, i did type this correctly, right?

#

${agilityTotal + 7 + (equalText(itemAbility, 'physicalarmour') ? 1 : 0)}$

storm stream
#

like equalText... between ()

#

ok, cool

#

so my thought process is correct there

formal goblet
#

Now you should find out, if your dependent values are there and contain the value you'd expect

#

That's why the command in the console, so you can inspect them

storm stream
#

what am I missing?

formal goblet
#

In this case, you depend on agilityTotal and itemAbility

storm stream
#

yes, i want 7 + agilityTotal + item mod, if itemAbility is selected as armour

formal goblet
sick acorn
#

I may be overlooking this in the documentation, but is there any way in formulas to pull the uuid of the actor that has the templated loaded and save it as a variable to use in the formulas?

formal goblet
storm stream
plush maple
#

Okay so I am having trouble applying the slots my armor is taking up. I want the item's slot value to show up in the Occupied numbers when it is in Inventory.
used_slots is part of the actor's hidden attributes while in the Item Moddifiers I also have
used_slots but also a second code that I am trying to allow the value to be ignored when equipped checkbox is toggled.

Any tips?

#

OH and I just relized that the checkbox isn't checked so the characters armor should NOT be activating. I think the equipCheck formula is what is causing the most issues. Do I need to put it in its own lable and then have the value formula refrence that??

formal goblet
plush maple
formal goblet
plush maple
#

Do you mean the hidden attributes or the item modifiers?

formal goblet
#

None of those. It is a Component

plush maple
#

Trying to understand what you are asking for sorry. I am not sure if that is a completely different template that I haven't used yet or if it is already a part of the templates I've already made.

formal goblet
#

It is literally just a Component like Label, TextField, Dynamic Table, etc...

plush maple
#

OH yes. I have that then.

#

The used_slots is part of a label in both Actor and Item template.

formal goblet
#

Ok, that Component is important if you use the Group-column in Item Modifiers. Otherwise the modifier will never work if you have a specified Group

#

Ok, next. equipCheck is either a Label or a Meter in the Actor. Correct?

plush maple
#

Yes, it is going to follow the checkbox in Item Displayer to ask if it is equipped or not.

formal goblet
#

Does equipCheck contain a numeric value?

plush maple
#

That might be my issue. Let me double check.

cerulean adder
#

I'm really beating my head here.

Are you not able to pass variables when calling a compendium? I was able to get it to work when calling a macro name but not the compendium.

formal goblet
plush maple
#

The wiki dosen't have it anymore sadly.

cerulean adder
formal goblet
#

Because I can guarantee that it works

formal goblet
cerulean adder
#

This is what I tried

if (${animation}$ == 1) {
  const macro = await fromUuid('Compendium.JB2A_DnD5e.jb2a-sequencer.Macro.4bbpyZxPo9fSY3e7');
  if (macro) {
    await macro.execute({ fxValue: ${item.fxValue}$ });
  } else {
    ui.notifications.error("Macro not found!");
  }
}
return "";
}%
%{throw 'Done';}%```
formal goblet
cerulean adder
#

I just have that so it doesn't submit to chat during testing

#

%{ return await game.macros.getName("Blaster Shot").execute({ fxValue: `${!item.fxValue}$` }); }% This worked for me

#

But I can't get other non-GM players to execute it

formal goblet
plush maple
#

Then I will hold off for now till it is restored XDD and try to trouble shoot another way. Thank you!

sinful spade
#

How can i quickly find what an item name is based on it's uuid?

#

i'm getting an error from console about an item not being defined but have no clue what it is and i checked the obvious ones manually

formal goblet
sinful spade
#

thank you ^^

formal goblet
formal goblet
#

The error message would help

cerulean adder
#

Yeah, I'm able to get a shield, swap artwork, and make a big explosion. The only thing is none of those are passing through variables but this one is needed.

Yeah let me run it again and see the error

#

Crud. There is no error. Hmm

sinful spade
#

Okay so i tracked down the error to a specific item

#

but after deleting the item from the char sheet, readding it, deleting the main item - and rebuilding it from the template, checking the template i cant root out this error

#
[Detected 1 package: system:custom-system-builder(4.4.2)]

Caused by: ReferenceError: item is not defined
[Detected 1 package: system:custom-system-builder(4.4.2)]```
cerulean adder
formal goblet
formal goblet
sinful spade
formal goblet
#

No stack trace?

sinful spade
#

those two are causing the other errors i should say

#

oh you mean all the stuff under it saying 'foundry this foundry that?

#
[Detected 1 package: system:custom-system-builder(4.4.2)]
    at Hooks.onError (foundry.js:654:24)
    at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54)
    at CustomActor._safePrepareData (foundry.js:10801:15)
    at Game.initializeDocuments (foundry.js:9168:18)
    at Game.setupGame (foundry.js:9054:10)
    at async Game._initializeGameView (foundry.js:10432:5)Caused by: ReferenceError: item is not defined
[Detected 1 package: system:custom-system-builder(4.4.2)]
    at eval (eval at processFormulas (ComputablePhrase.js:216:34), <anonymous>:3:1)
    at processFormulas (ComputablePhrase.js:216:121)
    at ComputablePhrase.computeStatic (ComputablePhrase.js:242:34)
    at ComputablePhrase.computeMessageStatic (ComputablePhrase.js:270:26)
    at TemplateSystem._prepareEntityData (templateSystem.js:208:61)
    at TemplateSystem.prepareData (templateSystem.js:139:14)
    at CustomActor.prepareDerivedData (actor.js:89:29)
    at CustomActor.prepareData (foundry.js:10824:12)
    at CustomActor.prepareData (foundry.js:15863:11)
    at CustomActor._safePrepareData (foundry.js:10799:14)
    at Game.initializeDocuments (foundry.js:9168:18)
    at Game.setupGame (foundry.js:9054:10)
    at async Game._initializeGameView (foundry.js:10432:5)```
formal goblet
sinful spade
#

never leard how to read those.
just looks like a lotr of 'computablephrase' and 'foundry.js'

#

🤣 thought only the header was useful for error tracing

formal goblet
#

That is the call chain when the error was throw at that time

plush maple
sinful spade
formal goblet
sinful spade
#

it's an item displayer referencing a label in the item referencing a number field in the item. (to prevent player mod) changing to ref the numberfield directly doesn't solve it.
there's really nothing in there that should be causing that...

formal goblet
#

Unlucky. Well, I need the PC to investigate further, so not for today

sinful spade
#

thanks anyway martin

#

i'll try deleting a few more things out and hope one of those clue me into where the error is sourced.

plush maple
sinful spade
#

that's either hollow or filled out to show 'equipt' or not

plush maple
#

I am guessing I have to remove the CSS part in the lable itself first. one sec.

sinful spade
#

the huh wut now

#

no no

#

you can leave all that.

plush maple
#

It dosen't seem to change anything atm when I put it into the CSS raw. Will figure it all out later unless it is an easy fix XD so sorry.

sinful spade
#

ope i forgot some of the css too 🤣

        margin: 0px;
    }
    .enableEquip i {
        background-color: unset !important;
        max-width: 30px;
    }
    .enableEquip .fa-square::before {
        content: "\f132" !important;
        color: black;
    }
    .enableEquip .fa-square-check::before {
        content: "\f132" !important;
        font-weight: 900;
        color: black;
    }```
#

still should have worked without the first two lines ( should have put the item beside the square)

sinful spade
#

the error only seems to occur in the actor too - the error will not occur with the template or the item from the item menu - only when the one in actor is refreshed.

sinful spade
plush maple
#

Haven't tried it yet. But will in a moment. Just trying to do one more silly thing with the inventory before I get too distracted with CSS XD

sinful spade
plush maple
plush maple
plush maple
sinful spade
#

i think you'd have to put the <i> tag making the checkbox conditional logic, and move the class from the column itself and into the code

#

is item equiptable ? dispaly checkbox with class (making shield) : display grey shield

plush maple
# sinful spade is item equiptable ? dispaly checkbox with class (making shield) : display grey ...

Hmmm okay do you think I can already use the checkbox that is in the Weapon and Armor templates as the condition? Or should I make a different condition that is only in Weapons and Armor templates that apply the true/false condition? (So sorry if this is complex)

But I do see how the gray shield ? : works. I will play around with that while trying to think of how to have the items communicate with the actor.

sinful spade
#

isEquipable ? <i class="isEquipt fa-regular fa-${item.isEquipt ? 'square-check' : 'square'}$ " style="color: ${item.isEquipt ? 'red' : 'green'}$; background-color: white;"></i> : <i class="fa-solid fa-shield" style="color: grey"></i>

plush maple
#

I was typing that up but within ${}$

sinful spade
#

reading more into how the code is structured you may even be able to get by without the css...

#

they built the logic into the class right here

#

class="fa-${item.isEquipt ? 'square-check' : 'square'"}$

#

so
class="fa-shield" style="font-weight: ${item.isEquipt ? '' : 900}$"

#

that should work

#

similarly,

#

class="fa-shield" style="font-weight: ${item.isEquipt ? '' : 900}$; color: ${isEquiptable: black : grey}$;"

plush maple
sinful spade
#

i mean if you go this route

#

you can either do it this way, or with a css file tbh, should be the same result

plush maple
#

Where dose the <i></i> go? Just wanna make sure before I start deleting code.

#

Nevermind I think I figured it out lol

#

Wait no I didn't sweaty

plush maple
sinful spade
#

lemme see the code/

plush maple
#

I hit undo as I don't wanna loose my progress so far with the shield.
<i class="fa-regular fa-${item.isEquipped ? 'square-check' : 'square'}$ "style="color: ${item.isEquipped ? 'green' : 'red'}$; background-color: black;"></i>

I tried to pu the code like so

${isEquipped ? <i class="fa-regular fa-${item.isEquipped ? 'square-check' : 'square'}$ "style="color: ${item.isEquipped ? 'green' : 'red'}$; background-color: black;"></i> : <i class="fa-regular fa-shield" style="color:grey;" }$

sinful spade
#

so that isEquipped at the front is wrong

#

"is the item equipt"?
if so -> create an i tag, with the class (is the item equipt? if so ...)
if not -> create a grey shield

#

rather than

is the item equiptable
-> make the toggle shield
-> make the grey shield

#

aka if the item is unequipt the grey shield appears, rather than simply being unequipt

#

the condition "it's unequiptable" is never checked

plush maple
#

Okay, I might be tired as I'm trying to understand. LOL so sorry. Just give me a moment.

sinful spade
plush maple
#

Hmmm the check keeps disappearing though if I tried that. So I am seeing if adding a different condition in my item will allow me to make the correct true/false value for this to work.

#

I must be putting the <i> part in the wrong place or something stupid. 😵 If I do it one way it is Errors, if I do it the other way the boxes disappear. It must be a me thing.

plush maple
cerulean adder
plush maple
#

<i class="fa-regular fa-shield" style="font-weight: ${item.isEquipped ? '' : 900}$; color: ${Equippable ==1 ? 'black' : 'grey'}$;"></i> Still trying to make the shield even change gray I think I need to sleep on this cause I can't seem to make my brain click dispite all the help. So sorry to have failed yeah @sinful spade LOL XDDDD;;;

#

Happy to at least have the equip system working with the AC and the Inventory. Still feeling very accomplished.

sinful spade
#
<i class="fa-regular fa-shield" style="font-weight: ${item.Equippable ? (item.isEquipped ? 900 : '') : 900}$; color: ${item.Equippable == true ? 'black' : 'grey'}$;"></i>
#

hmm one sec i need to revise something

#

if it is equitable, and equip it should be black and filled in;
if it's equitable and not equip it should be a black outline
if it's unequitable it should be grey and filled in.

plush maple
sinful spade
#

i mean i think the multiple invi system is the most intuitive.

#

but

#

it wouldn't be hard to do this

#

in the class=" "
${item.Equippable ? 'EquippableClass' : 'UnequippableClass'}$

#

then in your css you can define on-hover and pointer-click events

plush maple
sinful spade
#

??? not sure how disabling hover effects and on click effects for unequiptable items would add or remove items

plush maple
#

Let me see if I can add those in. I might need a sleep before I can tackle more of this XDD

sinful spade
#

pointer-events: none;
stops the mouse from chaning to a pointer when you hover over it.

unequiptableclass:hover { }

can be used to stop find and stop all the hover effects to indicate it is clickable

#

actually pointer event should also make a click ' pass through' the item, as if they clicked empty space since nothing is behind it

plush maple
sinful spade
#

right and since we're targeting the class given IF an item is unequiptable > it only targets grey shields, meaning black ones can still be clicked

plush maple
#

Yeah! Exactly. Let me see...

#

so do you think we can fit another IF statment that IF grey then not clickiable?

#

or would that break the <i> ?

sinful spade
#

that's sorta what i did with the classes

#

if it's not equiptable give it this class, if it is equiptable give it that class

#

you can then edit the css in the css file

#

but if you really want it in the style tag then you could do it, it's just getting messy

plush maple
#

Yeah for sure.

sinful spade
#
style="pointer-event: ${item.Equippable ? 'auto' : 'none'}$;"
#

i don't believe you can modify the :hover pseudo selector inline though, so you would be stuck adding the class anyway

#

and if that's the cass i'd move as much of the logic the css as possible

sinful spade
plush maple
#

Okay I've noted down what I need to do tomorrow. Going to have to re-type a bit of this but basically make sure the link and hover interaction is not apart of the gray shield at all. But that is tomorrow Key's problem. XDDD I sleep

hallow ginkgo
storm stream
#

i am struggling to locate the label i want to check the values from

#

physical defense shows "undefined"

#

and these are the errors i'm getting

#

but it doesn't look like they are related to the issue

#

alright, not showing an error anymore

#

turns out i had unwanted extra text in the label messing up the calculation

#

however

#

the bonus up there should be 11, it's not adding the modifier from the armour

#

the current formula in the defense label is this: ${agilityTotal + 7 + (equalText(itemAbility, 'physicalarmour') ? 1 : 0)}$

#

hmmm

#

equal text would point at the text in the "ability" column

#

i'm supposed to use ´find()´ or ´lookup()´ right?

#

${agilityTotal + 7 + (lookup(itemAbility, 'physicalarmour') ? 1 : 0)}$

#

somthing like that?

#

wait, how do I tell it that i want the result of the mod field?

#

lookup("itemAbility", "physicalarmour", "itemMod", "??????")

#

ugh

#

i don't know

#

if itemAbility is physicalarmour, then i want the value from itemMod, otherwise 0

formal goblet
#

In SQL it would be: SELECT itemMod FROM dynamicTableKey WHERE itemAbility = 'physicalarmour'

storm stream
#

so ${agilityTotal + 7 + (fallback(find('items', 'itemMod', 'itemAbility', 'physicalarmour'), 0))}$?

#

got an error

formal goblet
storm stream