#Custom System Builder

1 messages ยท Page 38 of 1

copper jetty
#

sup guys, i have a tricky question

how do i write a condition that rolls 2d6 + one of these two number fields (_AGI or _INT), whichever is higher?

i tried :_AGI: too as 4.6. Add rolls says on gitlab instructions

formal goblet
#

You have a typo in the function

formal goblet
#

Show me the formula and the keys of the Dropdown

fallen coral
#

Is there a workaround to prevent dice-so-nice from rolling the dices for both outcomes from a ternary operation?

fallen coral
#

Just to make sure, I can expect that same behavior from switchCase()?

formal goblet
formal goblet
fallen coral
formal goblet
fallen coral
formal goblet
#

You won't see this stuff as a regular user

fallen coral
copper jetty
copper jetty
#

i see now, it was on math.js all along

merry pendant
#

@formal goblet, @ I just want to express my great appreciation for you and what you've done with custom system builder. It's amazing to be able to build my system in Foundry without needing much programming knowledge.

earnest imp
#

Ohh? 4.x.x is launched?

#

is there anything i need to do before migrating from v11 to v12?

#

(or should i give up on it :P)

formal goblet
earnest imp
#

hmmmm that should be everything

#

im more concerned of the modules ill need to replace but thats a bridge ill cross eventually

ebon laurel
#

I'm using the fetchFromActor+lookup combo to pull stats from another item container associated with the same actor, but running into an issue where it is finding every value that has historically been held by the item container on that actor instead of what is currently being held by the container.
${recalculate(fetchFromActor('attached',"lookup('HeldWeapons','WeaponRange','WeaponType','${AbilityType}$')","Not attached"))}$
Any idea why the historical values are being held and can still be referenced, even from an item container where no items meet the reqs to be in it currently? All items have been scrubbed from the actor using a catch-all container to confirm there's no hidden items, and I've replicated it with a new actor from the same template as well
(I think this may be the same issue ElPainis had here(#1037072885044477962 message)

summer turtle
formal goblet
formal goblet
formal goblet
summer turtle
formal goblet
#

You probably want to use switchCase(psy_rank, 'psy_alpha', 8, 'psy_beta', 6, ...)

ebon laurel
formal goblet
summer turtle
#

If not I'm very lost on what I'm missing

formal goblet
summer turtle
#

That's the hidden attributes

formal goblet
#

I see

#

Which error in the console?

summer turtle
#

Custom System Builder | Parenthesis ) expected (char 65) SyntaxError: Parenthesis ) expected (char 65)
So I've missed a parenthesis somewhere?

formal goblet
#

You're missing commas

summer turtle
#

I've changed it to this:

${switchCase(psy_rank, 'psy_alpha', 8, 'psy_beta', 6, 'psy_gamma', 4, 'psy_delta', 2, 'psy_epsilon', 2, 'psy_none', 0)}$
And now it's forcibly changing the dropdown to None and there's nothing displaying in the psy_rating label, nor am I getting an error?

formal goblet
#

Change the key of the hidden attribute. That is a duplicate key

summer turtle
#

Oh my god that was it lol, I kept getting psy_rating and psy_rank mixed up

#

Okay, it's working now! Thank you

ebon laurel
#

Trying a different approach to link the item containers using helper values on the actor instead, and so using:
${fetchFromActor('attached', "switchCase(AbilityType, Melee, MeleeRange, Ranged, RangedRange, Magic, MagicRange,0)")}$
Where AbilityType and the drop-down options of Melee, Ranged, and Magic are on the item's drop-down list, while MeleeRange, etc. are on the actor. I've tried a bunch of permutations with AbilityType within ${}$ and without, and with different quotations for the comparators but can only seem to ever get it to match everything (ie. Magic == Melee) or nothing. Any chance I'm missing something that would make this work?

merry pendant
#

Is it possible to specify the color of a die in a dice formula?

formal goblet
raven raven
#

I have radio buttons. They can not be unchecked by default on the character sheet. Why?

formal goblet
raven raven
#

How should I do this?

formal goblet
#

Something like ${(checkBox1 ? 3 : 0) + (checkBox2 ? 5 : 0) + ...}$

raven raven
formal goblet
raven raven
#

thank you for the tipp

#

โค๏ธ

fallen coral
#

Is there a way to prevent players from deleting rows from dynamic tables? Or to vanish the trash bin button?

formal goblet
fallen coral
#

Oh is it the user permission?

formal goblet
fallen coral
formal goblet
spice sierra
#

Hi, probably another obvious thing I'm not seeing. So I have a field in an item template called armor_slot that can have the value "head", "torso" and "legs" and I'm trying to use it in the filter option of the item container to get just the head armor:
item.armor_slot == "head"
This is giving me a "Cannot convert "head" to a number Error" though. Can anyone tell me what I'm doing wrong here?

spice sierra
#

oh, thank you. I'm going through the documentation as I build it but sometimes I just get stuck thinking in javascript and forget somethings don't work the same XD

half beacon
#

I made a Number Field as a bonus modifier for physical armor. Sometimes this can be a negative number. When it is, every time my mouse hovers over it, it multiplies itself by 2 going from -1 to -2... -4...-8... And it's only for this one number field.

formal goblet
half beacon
#

Ah, so I won't be able to just type "-2" when something happens to decrease it more? That's fine.

#

Thanks

somber bay
#

Is there a way to ensure labels are rounded? even if I put a formula in the label once it gets modified by invisible modifiers it goes 'nuts' with decimals that should not be there

formal goblet
somber bay
#

Thanks... while you are around... I'm a 'write to actor' addict... has the option to not have it display a chat message and roll effect been implemented yet? I do not see it in updates but obviusly the V12 update cleared out the roadmap.

formal goblet
elder raft
#

So this is odd, I'm switching a roll card from a simple userinput to a template so I can use dynamictable stuff, and I got it all switched over and implemented, but somehow it's erroring a part of the card I didnt touch?

This is the end of the code that grabs the success tier from the result that's erroring:


<!--Regenerate a paragon point on failure (as long as roll didn't use a paragon point)-->

${#result <= 6 & paragonuse == 2 & player_paragon < player_paragonmax  ? setPropertyInEntity('self', 'player_paragon', "player_paragon + 1")notify('info', 'You Regenerate a Paraon Point!')  : '0'}$

The only thing that's changed in there is that skill1/skill2 is no longer using a "Userinput equalstext of skill? then Grab mod number of said skill" (referencing individual keys from a table) to now being a lookup of a dynamic table (which is much cleaner, lol).
But that lookup is early in the code and is working just fine in the roll calculation, displays the name and mod properly, and assigns to the "result" variable just fine for use elsewhere...

formal goblet
elder raft
#

Seems like a cleaner way to juggle that, for sure
Still popping up the Array console errors and not actually regen'ing the point, though... Hmmm

#

lookup returns an array, even if I'm only grabbing one value and assigning it to the skill variable... maybe I need to use lookupref to grab a value to assign to just grab the specific data?

half beacon
#

I'm kinda familiar with scripting, but I've learned in a very informal way and never needed to work with APIs are or learn how to read them. Can someone recommend a good place to start? I'd like to be able to make my own rules for dice. ๐Ÿ˜…

elder raft
elder raft
#

haha nice, thanks for the insight!

worn iron
#

@formal goblet I'd like some assistance working on my system again.

This time, I'm working on the bread and butter Core of my system. The Techniques.

Most Techniques follow a simple enough format.

See the 1st example. In cases like this, all I'd need is to make a button that can read from the item sheet what skill to roll and the Target Number such a roll should be.

Where things get more complicated is when a combat technique requires referring to a number on the enemy you're targeting.

Right now I've the following component keys.

How I'm currently thinking of implementing things is...

  • Use Technique
  • Reference "tech_skill" and assemble dice pool
  • Check "use_tech"
    • If a defense skill (Parry, Evade, Hardiness, Stealth, Resove, or Wits) is selected in "use_tech" then search for Target number in the target's sheet.
  • Set "skill_diff" as the target number for the roll

Does that make sense?

cerulean berry
#

Hello,
First of all, sorry for my English; it's not my native language. For my custom system, I'm trying to create spell templates (items) that could trigger macros (for spell animations). I'm not sure if this is feasible. We can launch a macro using the formula in the template, but I havenโ€™t found a way to do it from the instance of the object itself. If I want to do this, am I required to create a template for each spell?

cobalt mango
#

Hello!
I am trying to make a bit of a user -friendlier interface.

Atm my item (let's say a sword) has an entry where you say what you're using to Attack (let's say "Strenght_Skill_Total") wihich then uses fetch from actor to get its value.
I would like to show a user friendly label "Strenght" and pair it to the actual attribute name so that my Players can work with the sheets without having to know code-like syntax.

My intuition tells me I need some sort of table to pair labels and attribute names but I was looking for suggestions

cobalt mango
midnight schooner
#

Hey!
Like people above me I'm going to start with a question. My custom system relies on choosing and stacking stats. I want to use a dropdown menu for every stat I stack. But I can't figure out how to take a key that has a number associated with it, and then once I select it, to get it's value displayed and then added.
For instance I have a variable 'Resolve_Total' which equals 4. I want to be able to select the variable from a drop down menu, and the assiciated number to be displayed in a cell right next to the menu, and also be able to take and sum this attribute along with other attributes I decide to stack along.
I'm currently using the Custom option of the dropdown menu. My instinct says that all of this has to be managed through a dynamic table. But I'm also trying to manage these attributes as individual units and not something I have to constantly use lookup() for. Just use ${Resolve_Total}$ to get the number. I managed to make everything else work, and only this dropdown menu holds me back from jumping from 50% feature complete to like 75%, and I can't really continue on without it, because all of the modifier calculations depend on this.

timid roost
#

Hey guys, quick question here: Is there a way to always display the dice rolled? Like, if I roll 3d6 it always shows the result under the sum like "3, 4, 6"?

formal goblet
midnight schooner
cerulean berry
# cobalt mango You can call a macro from an item (which is what a spell would be) Maybe I don't...

It's probably me not understanding something; I'm not very familiar with the custom system or even Foundryโ€”I just started using this software. On the left is my template, on the right is my object created from the template, and on the far left is my template label with the macro execution. The problem I'm having is that all my items created from my template will trigger the same macro, whereas I'd like to be able to change the macro triggered for each distinct item.

formal goblet
cerulean berry
thorny spear
#

Hello there. Supposing i want to do a dynamic table like the AD&D exceptional strength table, how would i go around not having to put every single percentile strength value on the table and just using the lookup value easily? As an example, supposing i want to do a single row at strength 18 and 1 to 50 percentile strength, what should i put in the field? I'm very much a noob here.

thorny spear
#

Another question. I probably did it wrong by doing it a bunch of text fields, but how can i autofill these fields just by changing the key attribute?

#

i did create a table with each possible value (except percentile strength, as noted above), but how do i reference both the dynamic table AND the strength value?

thorny spear
#

@brittle moth @formal goblet just saw that there are two devs on this, sorry for the inconvenience of ping you both. I'd appreciate some help with this. As much as i hate GPT, i'm trying to create a formula for the lable that look up the values, but it's resulting in an error, currently.

${lookup('strtable', 'thitadj', 'str', 18, 'percentstr', percentstr) || lookup('strtable', 'thitadj', 'str', str)}$

cerulean adder
#

Is there an opposite for equalText? I tried notEqualText and it didn't return anything. I'm trying to use a conditional formula where the variable is not empty

formal goblet
formal goblet
# thorny spear <@303274115433889794> <@199124934880919552> just saw that there are two devs on ...

The lookup()-function can only take a maximum of 5 arguments:

  1. The key of the table
  2. The column key of the table, from which you want the values
  3. (optional) The column key of the table you want to filter by
  4. The value, which should be considered for the filter
  5. The operator for the filter. Default-operator is ===, so it filters by equality

Having multiple filters in the same lookup is not possible, so you'd have to get the right value with a Script: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Dynamic-Tables#2-scripts-for-fetching-values-in-a-dynamic-table

thorny spear
thorny spear
#

thank you so much for this. Sorry for bothering you!

thorny spear
#

With the script, i mean

formal goblet
#

Sure

thorny spear
#

Alright, thanks!

spiral dome
#

Question about item modifiers: is it possible to set a (new) formula into a label?
In my testworld i have 3 labels: numberA, numberB, numberC, and a label with formula ${numberA+numberB}$
Is it possible to change that formula with an item modifier to make it 'numberB+numberC'

formal goblet
#

But you could override the value of the Label

spiral dome
#

I'm looking for a way to change formula's when talents/feats change the way skills are used (dexterity instead of strength for melee attacks for instance)

thorny spear
# formal goblet Sure

Not sure if i'm doing this correctly, i'm looking in the console looking for my hitadj label i created, but i can't find it.

#

Going through the beginner macro tutorial, that's where i'm at, but i'm a bit lost

spiral dome
timid roost
#

Is the green success die and the red failure de a customazible thing in CSB? Like, can I set it that if a die ever gets result X or Y that ir red or green?

thorny spear
# formal goblet Sure

Also, If a label is a formula, in my case, ${(str)}$, would the value be fetchable by the script?

formal goblet
#

By doing that, your Script won't be removed by the computation queue and will resolve once the dependent value is not undefined anymore

thorny spear
# formal goblet Yeah, but only with a save guard, because values can be `undefined` depending on...

I think i understand! This is my current script (not mine tbh, i hate using it but since i have little knowledge of coding i must depend on gpt most of the time).

If it would not bother you too much, could you help me with building the actual script or modifying it? Here's what i have right now:

const actor = game.actors.getName("pc");

// Obtain the value of str and percentstr
const strValue = actor.system.props.str; // Acesso ao valor da key str
const percentStrValue = actor.system.props.percentstr; // Acesso ao valor da key percentstr

// search for the value on thitadjust on strtable based on str
const hitadjBaseValue = Object.values(actor.system.props.strtable)
    .find(row => !row.deleted && row.str === strValue)?.thitadj;

//If str is 18, adjust the value of hitadjBaseValue according to percentstr
let finalHitAdjValue;

if (strValue == 18) {
    // Ajusta o valor com base no valor de percentstr
    if (percentStrValue === 0) {
        finalHitAdjValue = hitadjBaseValue; // Use o valor base se percentstr for 0
    } else if (percentStrValue <= 50) {
        finalHitAdjValue = hitadjBaseValue * 1; // 1x
    } else if (percentStrValue <= 75) {
        finalHitAdjValue = hitadjBaseValue * 1.5; // 1.5x
    } else if (percentStrValue <= 90) {
        finalHitAdjValue = hitadjBaseValue * 2; // 2x
    } else if (percentStrValue <= 99) {
        finalHitAdjValue = hitadjBaseValue * 2.5; // 2.5x
    } else {
        finalHitAdjValue = hitadjBaseValue * 3; // 3x
    }
} else {
    finalHitAdjValue = hitadjBaseValue; // Para valores de str de 1 a 17, use o valor base
}

// Update the label
await actor.update({'system.props.hitadj': finalHitAdjValue || 0}); // Define como 0 se nรฃo encontrar```
#

oops. Let me translate the portuguese.

thorny spear
# formal goblet Yeah, but only with a save guard, because values can be `undefined` depending on...

Also, this is going to be a very dumb question, but i'm kind at a loss here, and tbh GPT is probably doing nothing useful atm, so i'll ask directly:

Here is my issue: I'm trying to populate this label called hitadj with a value from my table, strtable, in the thitadj column. So, what i want to do is, get the values from str (strength) and percentstr (percentile strength), which both vary from 1 to 25 and 0 to 100 respectivelly, and fetch the according value in strtable.

I was not sure if it was necessary, but i created tstr and tpercentstr just so i could have access to the according values at the table. That said, i have no freaking clue what to do.

#

oh wait, this is cursed. I'm dumb.

#

Ok, i made it more readable.

thorny spear
#

Also, sorry if i'm very slow at this, know that i appreciate very much you helping out

formal goblet
thorny spear
#

Okay let me try. Do i just throw it at the lable text?

#

Honestly it actually kind of worked, it has not come back as an "error", just undefined. Lemme try tinkering with the values.

#

Ok, ok, the formula itself is working, just not as intended! Thank you so much for this, once this is fixed, i'll be able to do the rest on my own. So, what is happening right now is, the value on str, being ${strs}$, doesn't seem to affect hitadj at all. percentstr does, though, although weirdly. If the value is 0, the result becomes undefined. If the value is 1 through 5, it's +1, weirdly, if the value is between 6 and 9, hitadj becomes +2, then comes back to +1 from 10 to 50. After that, hitadj seems to work normally, except on 100, then it becomes +1 again.

#

Oh yeah, not sure if it's relevant, but i'm on CSB 3.0.0, since i did not update to v12 yet

thorny spear
formal goblet
#

And 3.0.0 isn't the most recent V11 version, there should be 3.2.4 or so

thorny spear
#

it's okay, that's on me for not updating ๐Ÿ˜›

#

i think i gotta update manually, i'll try doing it

formal goblet
#

Updates are never automatic

thorny spear
#

Lemme get the link for the 3.2.4 version

formal goblet
#

It even goes up to 3.2.5

thorny spear
#

True, got it

#

Ok, i updated to 3.2.5, i can't update to v12 yet caus of my other games, but hopefully this will work

#

huh, weird, now that i updated, the formula you gave me is not working at all

timid roost
#

Hey guys, is there any way I can configure the green and red dice effect for maximum and minimum value into the roll formula to color the result? Like critical hits and fumbles.

formal goblet
thorny spear
#

oh wait, it's not tstr, it's score

#

me big dum dum

formal goblet
#

yep, should be that

thorny spear
#

okay, lemme try changing it

#
const props = entity.system.props;

return Object.values(props.strtable)
  .filter(row => !row.deleted && row.score == props.str)
  .find(row => isValueInRange(row.tpercentstr, props.percentstr))?.thitadj;


function isValueInRange(range, value) {
  const ranges = range.split('-');
  
  return ranges.size === 1 ? true : value >= ranges[0] && value <= ranges[1];
}
}%```
#

Ok, it "works" again! That was it

#

but it came back to the original state with a few caveats (or whatever the hell it's spelled)

. Now, the STR stat does inffluence it, but only if it's 18. By that i mean, if the str label is anything other than 18, the result comes out blank. Same thing if it's 18 and percentstr is 0.

formal goblet
#

It should be ranges.length instead of ranges.size

thorny spear
#

Ok! Lemme try.

thorny spear
thorny spear
# formal goblet It should be `ranges.length` instead of `ranges.size`

Holy shit we made it work, thank you so much!!! I think i can do the rest on my own, chatgpt ended up being useful for once, here's the formula that worked for me:

const props = entity.system.props;

return Object.values(props.strtable)
  .filter(row => !row.deleted && row.score == props.str)
  .find(row => isValueInRange(row.tpercentstr, props.percentstr))?.thitadj;

function isValueInRange(range, value) {
  const ranges = range.split('-');
  
  if (ranges.length === 1) {
    return value == ranges[0];
  } else {
    return value >= Number(ranges[0]) && value <= Number(ranges[1]);
  }
}
}%```
thank you so much man. It's not much, but i would love to donate to you guys. Do yall have a kofi or something? If so, please link it to me
formal goblet
thorny spear
#

Ok ok make sure he at least buys you a coffee

formal goblet
#

Maybe when I plan a trip to France ๐Ÿ˜…

thorny spear
#

Thank you so much! Handling the rest should be easier. Threw 2 euro at linked's face in your name lol

#

one last thing, @formal goblet, is there any way to hide the formula from the template sheet? I only have so much screen space ๐Ÿ˜›

#

hide or decrease the size, at least

thorny spear
#

oh well, making it collapsable works well enough lol

merry pendant
#

Anyone know a method of counting doubles? In my system if you roll doubles on wound dice you collapse. Haven't been able to figure it out yet.

cobalt mango
midnight schooner
#

Hey, me again. Is it possible for a lookup() from a dynamic table to sum up all the values in a column?
I'm trying to sum up all of the numbers in the Mod column.

midnight schooner
thorny spear
#

quick question, if i have a text field that says +4 and i use it in a formula, can i do calculations with it? Like, if i put said text field + Y text or number field, and they're all numbers, will the calculations work or they gotta be number fields?

#

@formal goblet sorry to bother you so soon ๐Ÿ˜ญ

#

oh nevermind i just checked it WORKS!!!!

thorny spear
#

Oh, i might need your help after all @formal goblet. Not with this, though. So, strength is the only stat that uses percentstr and the other ones only use the 1 to 25 scores. I'm now trying to fill the values below, but only initiative works.

Here's the formula i'm using:

const props = entity.system.props;

return Object.values(props.dextable)
  .filter(row => !row.deleted && row.dexscore == props.dex)
  .find(row => row.tinitmod)?.tinitmod;
}%```

Then i tried changing `.find(row => row.tinitmod)?.tinitmod;` to `.find(row => row.tmissileadj)?.tmissileadj;` but it did not work. the first one works perfectly, though, so i'm  not sure what to do. Here's the formula that does not work:

```%{
const props = entity.system.props;

return Object.values(props.dextable)
  .filter(row => !row.deleted && row.dexscore == props.dex)
  .find(row => row.tmissileadj)?.tmissileadj;
}%```
half beacon
#

CSB has helped me play test my game so much, and the support here is invaluable!

thorny spear
thorny spear
thorny spear
#

@formal goblet @brittle moth i have a suggestion: It's a really niche and minor thing, but would be nice to have a way to collapse a panel without allowing that panel to be colapsable in the sheet itself.

timid marten
#

Hello, any update on this feature? Is this available in the latest version?

brittle moth
brittle moth
thorny spear
#

i ran out of screen space hehe

#

i'm basically done, it's just that it's cumbersome to look through

#

done with that part, i mean

#

what i did was set the panels to collapsable during editing only so i could manage it better, then once i was done, i just set it to normal

#

this is how it's looking

#

as i said, it's a very niche thing honestly, yall are doing god's work already

misty jewel
fallen coral
#

what does the error "Key and Label-options are not of same length" mean I should fix?

formal goblet
fallen coral
fallen coral
thorny spear
fallen coral
#

How can I prevent the error from appearing?

formal goblet
fallen coral
#

Great, thanks!

fallen coral
umbral jackal
#

Any way to make a field conditionally appear in a list of variables in a dialogue box? I have an attack roll that pops up a dialogue box, but I want it to only ask if I want to consume ammo if a checkbox in the item indicates it uses ammo to begin with.

formal goblet
#

Although... maybe with nested Formulas

umbral jackal
#

?

formal goblet
#

${${a < b ? c : d}$ + e}$

#

a - d are in a nested formula, which will be ecexuted before everything else

umbral jackal
#

I'll try that.

#

Nope, that didn't work. Still showed the "Consume ammo" checkbox on a weapon that didn't use ammo.

#

I'll just have to forgo the option and have it automatically consume ammo if it uses and has any.

midnight schooner
#

Hello again,
So, I'm trying to figure out how to implement Items and I'm unclear on how Item Modifiers work. In this instance, I decided to have a Trauma item, which should confer a penalty to stats. I want to be able to select a trait, then enter the penalty value and have it automatically implemented when I drag the item into an Item Holder in the character sheet.

fallen coral
umbral jackal
fallen coral
umbral jackal
#

Oh. I don't know if that really serves the purpose I want, though. The purpose of the dialog box option is, if the weapon uses ammo, to allow the player to decide whether or not they want that attack to consume ammo.

fallen coral
#

I understand, I'm configuring the same thing. Would you agree with me there is not an alternative unless, in my case, the players decide to strike with a bow?

umbral jackal
#

I suppose. I was just wondering because the dnd5e system has something like that set up, where if an item or feature is set up to use a resource, it shows a dialog box asking whether or not you want to consume that resource.

fallen coral
umbral jackal
plain kraken
#

Hello!
I have a goal: to make a button, when pressed, its text would change cyclically: " ", "/", "X", " ", "/", "X"...
How could I do this, preferably with an example code?

formal goblet
midnight schooner
fallen coral
#

I too am trying to understand the better way to go about Item Modifiers. Considering a system had multiple modifiers, none exclusive to a single item, is there a way to setup a template where if some conditions were met the modifier would trigger immediately or the way to do it is by adding the items with said effect already activated? Let's say you have a frozen condition, and a ring that if it remains equipped for 3+ turns it had a chance to apply the frozen condition

spark barn
#

Hello! I could not find which CSS class applies for the styling of the component's tooltip. There is a way around using prefix label that is already documented but for checkbox or number field there is no such option. Thanks in advance!

elder raft
#

Is there a clean way to have disparate Item Displayers that function like "slots" or "bags"
I'm running into needing to make each item their own template style so it doesnt show up in every item container. But I'd like a way to make say: a sword is displayed in the left hand, a shield in the right, but that could be swapped, or both can be moved to a bag, etc.

low walrus
#

how would i make this into a roll?

formal goblet
formal goblet
# midnight schooner An explanation of Item Modifiers will suffice. I just don't get how they work

Item Modifiers can modify the value of a Label/Meter in an attached Actor. For that, you have 4 mandatory configuration fields for each modifier:

  • Priority: A numeric value representing a sort-order (from lowest to highest value), if multiple modifiers apply.
  • Key: Specifies, which component should be modified on the Actor. If it contains a Formula, it will be computed with the properties of the Actor
  • Operator: The operation, which should be performed
  • Value: The value to modify by. If it contains a Formula, it will be computed with the properties of the Item
elder raft
formal goblet
rocky sable
#

Hello. I have a Dropdown component from which the user can choose their character's profession. The Dropdown component's key is simply 'profession'.
I'd like to be able to assign a random profession too, using something like:
${setPropertyInEntity('self', 'profession', "pro_knight")}$, where 'pro_knight' is the key to the Label 'Knight', but that doesn't work.. Can somebody advise me of the correct the syntax, please?

formal goblet
rocky sable
formal goblet
rocky sable
midnight schooner
#

This is currently how I'm working on it, and when I add the item to the Test Character, it doesn't seem to affect the variable.

formal goblet
midnight schooner
plain kraken
formal goblet
formal goblet
midnight schooner
formal goblet
#

Hidden Attribute would also work

midnight schooner
formal goblet
midnight schooner
thorny spear
#

Hey, i'm trying to create races as a way to learn how to use items. Anyone has a good tutorial on that?

#

@formal goblet

thorny spear
#

Thanks!

thorny spear
#

is it possible to put an item inside another item? I guess not but doesn't hurt to ask, like a feature inside a race or something like that

#

Or at least "link" it to another item, so that X item is added to a sheet, it gets attached to the right spot automatically

elder raft
#

Ahh, that's an ooold conversation about Item Containers,

thorny spear
#

Oof

#

Am i getting the bonker

elder raft
#

No no, not at all!

thorny spear
#

Oh, so it's a feature in the works! Interesting, that's pretty baller to be honest. Can't wait for that

elder raft
#

It's one that's been asked for and developed in varying stages for years now!
Hopefully with all the new big pushes it's something we'll see (again) soon!

thorny spear
#

It's probably not possible for now, but is it possible to, when an item is thrown into the sheet, it's sent to that item type's correct place automatically and not let other items of that type be added? (I did found the unique feature on the thingy doe)

elder raft
thorny spear
thorny spear
elder raft
#

Basically, you need to give items different templates, then you can tell each Item Displayer to only show certain types

formal goblet
#

Not necessarily. You can define a filter formula addittionally, which filters by certain props

thorny spear
#

not of the specific filter*

elder raft
#

Right, your filter is basically saying "only have items with THIS THING in this container"

thorny spear
#

That is exactly what i wanted. Thank you so much.,

formal goblet
#

The filter would only influence, in which displayer the Item will be displayed. It does NOT influence, how Items are added to sheets

thorny spear
#

Hmm, so it would be added, but it would not show?

formal goblet
#

Yeah

thorny spear
#

display, even

#

I see. I'll have to be careful with that, might explode my pc

elder raft
#

That's also technically true. Adding items to sheets basically puts them all in one "item bag"
But the filters let you sort and organize them visually into separate places.

thorny spear
#

Oooh interesting!

#

Ok, i think i got it!

elder raft
#

And there's tons of stuff you can do with the props and code to play with that too

formal goblet
#

The Actor directly holds all Items. There's no additional nested structure

thorny spear
#

Makes sense tbh!

elder raft
#

We want our nested items inside items (inside items) Martin!! ๐Ÿ˜‚

thorny spear
#

that would be sick

#

Alright, thanks for the tips fellas, i'll get to work tomorrow, now, off to bed ๐Ÿ˜›

elder raft
#

Is there a good way to make a label default to a value if the formula (in this case a lookup) is blank? Rather than a "ERROR"?

for ref: this is the Label text I've got.
${ max(lookup('player_leveltable', 'player_leveltable_level')) }$
If the player level table is empty, would love it to be "0"

#

I feel like there's a simple : '0' I just need to put in there somewhere... Maybe a ? somewhere too... ๐Ÿค”

#

Wait... 0 + max(lookup? lol duh

sinful spade
#

you're using the max function which picks the biggest item in a list.
can you just add , 0?

#

so
max(lookup('player_leveltable', 'player_leveltable_level'), 0)

elder raft
#

Hmm, that breaks the formula, but I think you're on the right answer

#

just need to get the right syntax

sinful spade
#

baring that you can use an if statement
${(max(lookup('player_leveltable', 'player_leveltable_level')))<0 ? doThis : elseDoThis }$

elder raft
#

Yeah, that's the route I was angling toward initially, but I like the cleanliness of using "max" properly like you mentioned. I'll see if I can figure that out,
Thanks for the perspective!

sinful spade
elder raft
#

Yeah exactly my face! lol

sinful spade
#

can you show me what the table looks like?

#

and would say, the first function work?

elder raft
#

Sure, yeah!

So the final output is the "Player Level"
but in this case, the level table is a dynamic table players add to when they level up cause they make some choices as to what to advance.
The check boxes sum() to their HP and Paragon Points, but the Player Level is a Label that uses that max() formula just to display their level with this:
${max(lookup('player_leveltable', 'player_leveltable_level'))}$

#

Level number is a
${sameRowIndex()+1}$
just to count up

fallen coral
#

Considering a system that has multiple modifiers, none exclusive to a single item, is there a way to setup a template where if some conditions were met the modifier would trigger immediately or the way to do it is by adding the items with said effect already activated? Let's say you have a frozen condition, and a ring that if it remains equipped for 3+ turns it had a chance to apply the frozen condition

sinful spade
#

so effectively, you are counting the number of checks that occur in a column?

elder raft
#

Sadly, the max(0, (lookup()) doesn't work for the Level. Is it perhaps because player_leveltable_level returns an array?
I've tried nesting max(0, (max(lookup())) with that speculation but that doesnt seem to do it either.

elder raft
#

even with a 0+(max(lookup()) doesn't quite flick the switch

sinful spade
# fallen coral Considering a system that has multiple modifiers, none exclusive to a single ite...

Create a hidden statistic that is a % of the effect occurring that all items can modify?
for example I have a label called hpBonus that all items can modify that is then summed directly into maxHP along side baseHP that comes from the player's attributes.

in your case you could have a label for each status effect occuring in this way (i'd use a dynamic table personally, and check for the row with a matching name).

That way you have the
'Freezing' row, with a label of 0 (suffix: %) and a ring that modifies that 0 to say 10.

sinful spade
elder raft
#

Because player_leveltable_level is a samerow() function down in the table, it just counts up each level added. The max() just grabs the highest level in the list to display in the label

sinful spade
#

oh so you're just trying to display the player's last gained level from the table?

elder raft
#

I guess I could just change the label to a sum of the row count instead and bypass the math? Though, idk if that will fix my 0/error

elder raft
#

That's the sheet, the label is in the top right, just grabbing the highest number from the table.
But I wonder if I can just sum the table row count ๐Ÿค”

fallen coral
sinful spade
# elder raft Bingo!

alright and just to be sure, your level shows up fine with contents you're only having issues with the empty table?

elder raft
#

Correct!
We go:
ERROR
1
2
etc

sinful spade
#

right ok no problem;
is there ever a case when you'd have a level 0 character?

elder raft
#

Yes, actually. This sytem starts at lvl0, haha

#

We just started a new game tonight, which is when I discovered this problem! lol

sinful spade
#

and you cant have a row added to the dynamic table by default?

elder raft
#

I... can. And I can start that row at 0

sinful spade
#

๐Ÿ˜›

elder raft
#

That is a solution

sinful spade
#

right just removing the +1 from your index number would solve that

elder raft
#

It's just, players dont get to choose an upgrade or skill at 0, I wouldnt want them thinking they get a checkbox at 0

elder raft
sinful spade
#

you could use CSS styling to select the first row and gray it out so that players can see that fairly intuitvely.

elder raft
#

Fair

sinful spade
#

but if you're against that, you're stuck doing an if statement within the display label that cheks for 'error' and outputs 0

elder raft
#

yeah, not as clean as getting max() to work for it, but sometimes that's just what you gotta do! Not like anyone is seeing the code anyway, haha.

#

Thanks for your input, and your troubleshooting. Sometimes it's good to just get a second look, even if only to confirm the answer youalready know! ๐Ÿคฃ

sinful spade
#

${ (max(lookup('player_leveltable', 'player_leveltable_level')))=='Error' ? 0 : (max(lookup('player_leveltable', 'player_leveltable_level'))) }$

#

if my output is error output 0 instead, if not output normally

elder raft
#

I think the first max() won't pull as "ERROR", but if I recursive the label itself instead, that works

#

${ player_level ==Error ? 0 : (max(lookup('player_leveltable', 'player_leveltable_level'))) }$

sinful spade
elder raft
#

ahh wait, I fucked up some of that syntax

fallen coral
sinful spade
#

so have the first one be your max(lookup(
Then the secondone simply be
ref(hiddenValue == 'Error' ? 0 : refhiddenValue(

#

it may sound goofy as shit but i have an entire pannel setup like this with stuff i dont want to bother players with

elder raft
#

Yeah, the man behind the curtain!

sinful spade
#

how to do that, I have nooo idea macros are way above my head

fallen coral
#

I wish there was a way to tackle this on the fly idk. You could have an infinite number of poisoned or frozen statuses

sinful spade
#

not a problem i've gotten around to handling yet

#

i'm sitll fine-tuning what content i even want on my charactersheet

sinful spade
#

I made a label formatted as a button with the following label roll message:
${setPropertyInEntity('self', lookup('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental'), lookup('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental')+3)}$
why isn't it working? it should add three to the mental bonus cell

#

no error is happening and if output to chat the correct number shows up

formal goblet
formal goblet
midnight schooner
#

So, thanks again for helping me with the Item Modifiers yesterday. It's great for some uses. I managed to get how to use the item. prefix for extracting data from the attached item. I'd like to be able to insert the item into an item holder and manually check if I want their effects implemented.
I used <input type="checkbox"/> to create the checkbox in the Item Holder table, but it doesn't maintain it's setting, and doesn't return true or false.
Any Idea how I can implement that?

#

Btw, the Equip Test here returns false by default, not related to the checkbox.

midnight schooner
formal goblet
#

Our Wiki has some nice tricks ๐Ÿฑ

midnight schooner
formal goblet
midnight schooner
#

that's heresy!

fallen coral
formal goblet
fallen coral
formal goblet
midnight schooner
#

So, a small snag I'm having, I'm using an item filter formula item.Item_Type==<number> to choose between 3 item containers as shown in the picture, this is set by a dropdown menu inside the item entity. What I wanted to do, is to do is to be able to move an item from Weapon, Item, or Gear to the Bag Item Container.

So, what I tried to do is to use another property in the entity like so: ${setPropertyInEntity('item', 'Item_In_Bag', "item.Item_In_Bag == 1 ? 0 : 1")}$
I thought that using 1 or 0 would make it easier to use two formulas in the filter. But... although the item appears in the Bag Container, I didn't find a way to use a second logical test in the filter formula to make it disappear from the other containers.

Another thing I need is when I move an item from their container to the bag, I need the item to be unnequiped automatically. Again, the issue is that I can't figure out how to make the pack formula, that looks like so ${setPropertyInEntity('item', 'Item_In_Bag', "item.Item_In_Bag == 1 ? 0 : 1")}$ to do two things at one.

thorny spear
#

Ok ok, i think i'm figuring items out. So, i created a test race just to learn the item modifiers, i was looking at the example race but i got a bit confused. Supposing i want my race to add +1 to strength, but i did not create a dynamic table for the stats, only labels , what should i throw in "key"? The key to the strength stat is str.

#

I got the example from the sheet, here:
${fetchFromActor('attached', "getRefFromDynamicTable('Attributes', 'Min', 'Attribute', 'Strength')")}$

But it seems like it uses a formula to get from the dynamic table, so i'm uncertain how to change it to a specific label.

thorny spear
#

just str? no ${ }$ or stuff? Oh

#

Interesting.... ok lemme try lol

#

so something like this?

#

or this?

#

ok ok, it's the second one

#

IT WORKS!!!

#

thank martin!! create a damn place so i can throw money at you

faint wharf
#

Question. when i pull item between character sheet they get copied. Is there a shortcut to move em not copy em?

formal goblet
faint wharf
#

ok thanks

sinful spade
formal goblet
sinful spade
thorny spear
#

Is it possible to put a formula on a text field inside an item and use it? In my case, i want my save against wands (savewand) to be lowered by 1 for every 3.5 con of the character, let's say a dwarf ability. I used this formula that i normally use for other cases, but it doesn't work:

min(1,(floor(con/3.5))

formal goblet
# sinful spade I think I may have a misunderstanding of how you're using path - isn't that like...

You can think of it as a directory if it helps you, there aren't many differences actually.

The working directory for all Formulas is entity.system.props with entity being the current entity-instance (an Actor or Item). In there, all user-defined keys are stored and can be accessed by every Formula. Container-Components like DynamicTables create their own Directory with entries. That's why you cannot access their data directly with a single key. You have to go deeper in this case (like having more Folders in a Folder)

formal goblet
thorny spear
#

hmm, so i may be doing something wrong, i think i know what it is

formal goblet
#

But if it only contains a formula, you can use recalculate() on a Label

thorny spear
thorny spear
#

Yeah i'm still a bit lost, i guess i could just try to do separate items to change the specific fields, would probably be better

formal goblet
thorny spear
glad spade
plain kraken
formal goblet
#

setPropertyInEntity() has exactly the same limits a normal user would have

sinful spade
formal goblet
#

And the console might also help

midnight schooner
sinful spade
#

i can't just put it in single quotes can I?

formal goblet
sinful spade
#

right, i tried just lookup with that one as well

formal goblet
#

lookup() can return anything in the array (including numbers), so that can work

sinful spade
#

the current code is:
${setPropertyInEntity('self', lookupRef('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental'), lookup('attributeTable', 'attributeBaseBonuses', 'attributeName', 'Mental')+3)}$ and returns nothing.

Console now shows some props were not computed...
I can try the remove \n again real quick but i dont think that's it.

elder raft
#

Good to mention that lookup returns an array that can cause problems with some formulas (Me the last 3 days troubleshooting trying to learn how to work around this, lol)
but you can rip the integer out of lookup() with something like first(lookup(), which grabs the first entity in the array as a value (is "value" the right term? entity?)

sinful spade
#

yeah haha i remember talking about that with you yesterday
but i'm referincing a single cell with this one, and a similar computation within items works fine (using fetchFromActor though)

elder raft
#

Even if there's only one output from the lookup, it'll be [1] instead of 1, which can cause some problems. Idk if its causing your problem, but I ran into a bunch of issues with props not defining as numbers or array.errors trying to do math on just lookup() outputs

formal goblet
elder raft
#

And then I ran into issues with first() cause my table was looking up stuff that both had the same value of +1, so it was grabbing the first entry multiple times ๐Ÿ˜‚
Had to swap the lookup from referencing the modifier to the skill-name and approach it from the other side, haha

#

So any time a player used two skills with the same modifier, (Skill1, Skill2) it'd just say:
"Skill 1: +1, Skill 1: +1" ๐Ÿคฃ
Which mathematically was fine, since same modifier... But lol we played the FIRST game in my system last night and the whole evening was me writing down all the bugfixes I noticed that I didn't find by myself. (playtesting always finds shit you never expect! lol)

sinful spade
#

yeah i have a playtest setup for tomorrow

#

which i guess means i should put the character builder functionality on hold and just make pre-made tempaltes, but i will need to know how to do this eventually

elder raft
#

Haha, just ask Martin right?
A devs work is never done!

sinful spade
#

๐Ÿคฃ i mean......

#

yall are honestly speaking way above my level with this shit haha
i just know for some reason the button isnt working and im not getting errors

thorny spear
#

Thank you so much martin ๐Ÿ˜ญ

elder raft
#

Lol, I'm not a dev at all
just good at troubleshooting and understanding directions I find on the internet, haha

But In the last month alone I've pushed like 5 versions and updates and bugfixes to this damn CSB game I'm building for my table's homebrew system ๐Ÿ˜‚
I didn't think I was signing up for THIS

sinful spade
#

๐Ÿ˜ฌ same tho, same.
im just a simple script kiddy on my best of days

elder raft
#

I last touched CSS in the MySpace days, lol. But now I know more about Javascript than I ever thought I'd care to! ๐Ÿคฃ

sinful spade
#

oh god not myspace

#

how we miss tom

merry pendant
#

Hey all! I have not managed to find a way to count doubles using CSB (or native Foundry). Any ideas?

rocky sable
#

Hello. How would you create a button label that deleted all items attached to the actor? - Edited: Now all sorted!

brisk finch
#

Hi, where i can find example how change Number Field value with Roll? i try make damage and change wound

brisk finch
#

i mean than i took 1 wound the "current" value should decress by 1

#

maybe somebody have a template charactersheet with automatic calculation?

formal goblet
brisk finch
formal goblet
brisk finch
formal goblet
brisk finch
formal goblet
brisk finch
fallen coral
#

How do I know what is the ID of a status?

#

I'm messing with the world script and am getting an error saying the status id is invalid, which I wrote "Frozen" for testing, but I'm guessing that is not how it works

#

I noticed the example has stunned but I don't know how to find its id

fallen coral
#

it works ๐Ÿ˜ฉ

noble ibex
#

Guys, i need some help. I'm not a dev, i'm just a nosy DM trying to put 3D&T, a brazilian system, in the CSB, and i'm failing with the skills part. I'm trying to build two dropdowns in a dynamic table (so my players can add more rows), one [peresp] is for the skills (and gets the value from the periciasref dynamic table), the other one [esp] is for the specializations (and this one gets the value from the column peresp to select the correct column in the periciasesp dynamic table). The problem is: Everytime I try to write the formula to get the value from one dynamic table to the other, my sheets stop working. If I make it manually, it runs well, but I need to automate this or I will have a mountain of useless work. Prints of the components involved below. Thanks in advance and sorry for the bad english (and for the illiteracy in coding).

sturdy mesa
#

I know I can use in formulas "item.name" to pull a item name
But how can I pull the item image to the formula?

fallen coral
#

The issue is that you are referencing perespand the system has no way to tell what is the value. Since one dropdown depends on the other, I'm assuming you want the value from the same row

celest prairie
#

Hi, question, why does csb leave so much space in between elements? It's making my sheet incredibly wide...

formal goblet
#

You can also use your own CSS-rules for finetuning

celest prairie
fallen coral
#

Considering I have an item Template with 2 dropdown menus: attribute and bonus, and both have keys that are equivalent to some character label (numeric) keys (i.e. value_str as the first option for the dropdown menu attribute ) is it correct to assume the following item modifier template will retrieve the correct character field from the item itself and apply the bonus to said field?

celest prairie
formal goblet
fallen coral
#

also, I wrote it wrong, bonusis a numeric value from a dropdown๐Ÿ˜…

#

I'm trying to have a modifier template that changes dynamically when I change the value from a dropdown

celest prairie
#

Hi again, panel is set on vertical, but the text boxes are not put underneath one another... Their size is small, but that shouldn't matter right?

formal goblet
formal goblet
noble ibex
fallen coral
#

sim

fallen coral
#

@formal goblet I wasn't able to help @noble ibex can you double check this syntax and help him please? Sorry for the ping

#

${lookup('periciasesp','sameRow('peresp')')}$

noble ibex
#

I'm thanking in advance

formal goblet
fallen coral
#

@noble ibex can you check this correction

fallen coral
formal goblet
#

It would read 'sameRow(' and then error out because of a missing operator

fallen coral
noble ibex
#

i will run this one, just a second

#

It worked

#

Holy cow, how could that we were so close to the solution? lol

#

Thank you Martin, Godspeed

#

And thank you again, my fellow brazilian, for the helpful intention

#

Now, my second and mostly aesthetical problem: The comas are generating new options in the dropdown, is there a way to prevent this?

#

Like "Montaria: Vocรช sabe montar cavalos e outros animais de montaria, como elefantes e camelos." should be one option, but in the dropdown it goes like this:

fallen coral
#

dieta estranha

formal goblet
fallen coral
#

how about using - ?

formal goblet
#

Any other character would not separate

noble ibex
#

Perfect

#

Thank you guys, again. Soon will be letting people know that CSB now has 3D&T in the library

sand nova
#

How do you make the item change information on the character sheet?
example: add a belt that automatically increases strength by +1 or a boot that adds +5 movement?

formal goblet
noble ibex
#

Guys, that solution you found for me worked for a while, but now it has returned to a state where I can't even open the sheet if I close it, and the mathematics are not working either. It shows this message right here

formal goblet
noble ibex
last mirage
#

is there a way to make it so when you put put multiple of the same item into a container they stack with a "number of" collumn?

fallen coral
half beacon
lost wigeon
#

I've completed the character sheet and used it for a couple of games, worked out the bugs, and it's amazing. This level of automation and capability is better than I ever hoped I would have in a VTT. Thank you guys so much for building and maintaining it!

By the way, the vG system, which is the one I designed for my games, isn't a simple one, but this makes it simple. So, bravo. My players love it as well!

storm stream
#

Folks, for creating a customs system based on a lot of Cairn and Into the Odd mechanics, is CSB enough?

#

are there any templates out there i could start with?

formal goblet
normal ore
#

Hey everyone, howโ€™s it going?
Iโ€™m working on a project to automate the FFRPG 3e. In this system, thereโ€™s a mechanic in some attack abilities called Charge Time (CT).

Basically, itโ€™s the channeling time of an ability. In practical terms, this means that the initiative of the actor channeling the ability is reduced by the CT value, and then their turn is passed to the next actor. When itโ€™s their turn again, the channeling of the ability is completed, and the effect of the ability is applied.

Iโ€™d like to take advantage of this amazing groupโ€™s experience and ask how I could automate this mechanic in the Custom System Builder.

fading pollen
#

Hi there - just found your system and it seems very promising for our custom RPG we are building. Before I begin making sheet. I just want a bit of help to see if our basic roll formular can be made in the system. Hopefully you can help me create this formula as i'm no good at this.
So... I'm looking for a roll that rolls (STR + modifier + Fatigue counter)d6 and count the successes if it's >3, count the full successes if it's >5 and if there is more than one 6 then it should display a critical. Also if the number of dice roll is 0d6 then it should roll 2d6 and take the lowest and compare this again the success/full success.
I know this is a bit of a big ask, but i'm not going to be able to do this my self, so thanks in advance. ๐Ÿ™ ๐Ÿฅณ

last mirage
rocky dune
#

Is there a specific way to implement math.format? ive got a calculation thats adding together several decimal numbers, which works but gives the Math.js round off output which isnt overly nice to look at. The screenshot is essentially the output of 0.1+0.2

have tried several iterations of the below based on the screenshot of the mathsjs description but it either does nothing or outputs an error

${math.format(item.acid+item.bludgeoning+item.cold+item.fire+item.force+item.lightning+item.necrotic+item.piercing+item.poison+item.psychic+item.radiant+item.slashing+item.sonic, {precision: 14})}$

Edit: worked it out, leaving up in case its useful to someone searching. its just format, not math.format

formal goblet
fading pollen
fading pollen
velvet heron
#

CSB is okay to update to v12 now, right?

formal goblet
fading pollen
#

but i will look at the wiki

#

just hoped that someone could help me kick it off a bit.

summer crane
#

Hi, new to CSB and am trying to set the max HP based on the class that's been chosen from a dropdown box. I made hidden attributes for each class's HP but I don't know how to put that into the max HP.

timid marten
#

Hi!

Since we can't have item containers inside of items, how could I make it so that my Guns have Magazine slots you can load into the guns? Considering guns and magazines are items

sturdy mesa
#

I have a text field in my item model with the key โ€œExtraCode.โ€

In the character sheet, within an item container, I have a Label button to โ€œUseโ€ the item, with some rolling codes, etc. Iโ€™m trying to include this Extra Code key within the Use button, but it doesnโ€™t seem to be working. Can anyone help me?

Iโ€™m using this line of code to retrieve the extra code I wrote in the itemโ€™s Text Field: ${item.ExtraCode}$

However, nothing happens.

If Iโ€™m going about this the wrong way, what would be the correct way to do it?

My intention is to create very specific items without having to make a new item model every time I add something extra. So, within a โ€œUseโ€ button in the item containerโ€”which is quite generic and could be a potion, weapon, ability, or other thingsโ€”I would like this โ€œextra codeโ€ text field to work so that I can customize it better.

#

**
**Oh, I got it. I just needed to add another set of braces to the code like this:

${${item.extracode}$}$

raven seal
midnight schooner
#

Hello again, I'm trying to create an adjust mode for the sheet, i.e. a button which would enable the user to see some panels that would otherwise be obscured, so that he can't change values unless the checkbox is ticked. I'm using a label with the following code: in the Label Text space I use

<i class="fa-regular fa-${self.Adjust_Mode ? 'square-check' : 'square'}$" style="color: ${self.Adjust_Mode ? 'green' : 'red'}$; background-color: white;"> </i>

And in the Label Roll message, use:
${setPropertyInEntity('self', 'Adjust_Mode', "self.Adjust_Mode ? false : true")}$

It seems not to work completely, not creating a property, not switching between false and true. It is worth noting that I'm using almost identical code for the Item Containers for 'equip' or 'unequip' functions and it works perfectly.

formal goblet
midnight schooner
# formal goblet Remove the `self.`-prefix

here as well? ->${setPropertyInEntity('self', 'Adjust_Mode', "self.Adjust_Mode ? false : true")}$

Like so? ->${setPropertyInEntity('self', 'Adjust_Mode', "Adjust_Mode ? false : true")}$

formal goblet
midnight schooner
# formal goblet Y

Seems not to work, the same as before. I've set up a hidden attribute to check on Adjust_Mode and it's blank.

formal goblet
midnight schooner
formal goblet
timid marten
formal goblet
timid marten
lofty crest
#

Hi. I would like the Max Value field of a number component to be the value of another number component.
The ? suggests formulas work in that field, and the gitlab page supports that, but I can't work out what I would type in there. ${MaxHealth}$ throws up a text error. ${:MaxHealth:}$ also doesn't work.
Anyone know?

fallen coral
#

I called one of the columns of an Item Displayer key: displayer_quantity, set as Label with the initial value 0. It will be responsible to track each items quantity. Instead of having a field inside the items (item.item_quantity) themselves, I wanted to have that displayer_quantity label that would be altered by a simple pop-up once that default value 0 is clicked. What would be a good way to reference that value so this pop-up modify the correct field? I read the Regenerate example formula but it sets the value for unique fields (Life Points and Spirit Points)

formal goblet
formal goblet
lofty crest
lofty crest
fallen coral
formal goblet
formal goblet
lofty crest
# formal goblet Seems fine for me tho

I think it was a component key conflict with the example module. I didn't consider that, I sort of assumed scope would prevent it.
Changing the key fixed it, as did deleting the example stuff and putting the key back how it was.
Thanks for your time ๐Ÿ™‚

formal goblet
lofty crest
#

Hrm. I'm not sure I'm doing this current vs max hp correctly. Seem like it might be a pretty common thing to do, but the way I'm doing it, eh.

Ideally I would like:

[8]/[8]

Where the right-hand 'max' value is manually editable, while the left hand one is a value with controls. Feels like the controls should be around both the current/max fields

fallen coral
#

I don't understand how _RegenUserInput is being called considering it is an item and I don't see it added to the character. Do you mind explaining that concept to me @formal goblet ?

formal goblet
#

Check the Label Roll Message of the Regenerate-Roll (should be under HP)

fallen coral
#

Label A == 10
Label B == ${Label A}$
(somehow) Label B == 10 instead of Label B == Label A

#

Is it possible?

formal goblet
timid marten
#

Is it possible to link data (like label variable) between two items that are stored inside an item container?

#

for example having a "pistol" item reading the value of "ammo" of a specific "pistol magazine" item, with both being inside an item container on a same character sheet

formal goblet
fallen coral
#

I'm trying to modify the field item_quantity of an item that is stored inside an item container, but the user input triggered by the column (that retrieves the quantity information from the item) seems not to have access to that information (item.item_quantity).

#

This is a label from the user input template which is set to ${item.item_quantity}$ and it displays the error message

fallen coral
formal goblet
fallen coral
formal goblet
timid marten
formal goblet
timid marten
#

I have an item called "Pistol magazine" inside an item container named "inv_ammo", and the value I want to fetch is called "AMMO"

formal goblet
#

Then first(lookup('inv_ammo', 'AMMO', 'name', 'Pistol magazine'))

#

Translated into SQL: SELECT AMMO from inv_ammo WHERE name = 'Pistol magazine'

timid marten
#

It returns an error :(

formal goblet
# timid marten

Don't forget fetchFromActor() if you're working from different entities

timid marten
#

so basically this?

${fetchFromActor('attached', "first(lookup('inv_munitions', 'AMMO', 'name', ammo_type),0)")}$
#

(ammo_type is a text field inside the gun item sheet that I can modify)

timid marten
formal goblet
formal goblet
#

Show console

timid marten
#

how can I target the error of this item in the console?

#

oh found it

formal goblet
#

undefined lookup()? Which CSB-Version are you running?

timid marten
#

3.0.0 since 4.0.1 was completely broken on my side (all label edits had one edit of delay before updating)

and I can't update to V12 of foundry yet so no 4.1.1

formal goblet
#

Then fall back to fetchFromDynamicTable(). It got renamed in 4.0.0

timid marten
#

now the value is empty

formal goblet
#

That's uhm... something

timid marten
#

items are properly attached

#

the value "AMMO" is not listed on the inv_ammo item container, is it why?

timid marten
#

3.1.0 had the same update issue than 4.0.1 tho

#

Is everything working properly in 4.1.1? I might update everything to V12

formal goblet
#

I expect some things to break a bit, but most of them should be fixable. A jump from version 3.0.0 to 4.1.1 is quite huge

timid marten
#

alright, I'll handle this when I have the time

#

updating this means updating all my modules too

#

And I use 222 modules on my campaign

formal goblet
#

Yeah, expect at least a day of work

timid marten
#

atleast if we get item containers inside items one day, I'll just have to update CSB

formal goblet
timid marten
#

Also, the issue with this workaround we are currently doing is that if I have two magazines with the same name, the system will get confused right?

#

However, it's usual to have multiple magazines of the same caliber

formal goblet
timid marten
#

is there anyway to fix this beside renaming it?

formal goblet
#

The best would be to rely on the ID of the Item

timid marten
#

yes but how can I get the ID?

#

Simpler, I have a value named "Loaded" on all my magazine items

Would it be possible to only read the item that have this value as true?

#

Only one at a time will be loaded

#

(issue would be if the player uses two guns with the same calibers tho)

#

so I guess ID is still a better option

formal goblet
#

Every Document has an id and uuid. So you can retreave it via a little Script: %{return entity.entity.id;}%. Besides that, every Item Displayer also contains a hidden column with the id -> ${item.id}$ (v4 and above)

timid marten
#

oh nice

#

I'll add the ID as a GM info then

#

thank you!

formal goblet
#

Nope, estimations are basically impossible ๐Ÿ˜…

timid marten
#

Alright, thank you anyway!

faint wharf
#

Can you aid me get to atribute bar in console? canvas.tokens.controlled[0].actor.system.props.attributeBar.Zdrowie does not get there

half beacon
#

Especially if it's an item with an Item Container within series of items with Item Containers

elder raft
#

Without CSS, is there a way to have an Item Modifier change the color/style of a label?
Like if an Item gives +1 to player_mind is there a way to also make the mind label green or blue or somethin'? ๐Ÿค”

#

Oooh yup got it

#

Using = (Set) lets you use it like normal and add html styling, just gotta figure out how to make it work with the math

sinful spade
#

I am trying to make a "source" within my items.
I've tried dropdowns as well, currently experimenting with a label.
My issue is getting the source to show up within a item container on the sheet so we can quickly identify where items are coming from.

#

I've tried a few ways of displaying the source, but all of them come out blank.

e.g. ${ref(item.foundationSource)}$

charred spire
#

Is there anyone here who speaks Portuguese who can help me?

sinful spade
# elder raft Without CSS, is there a way to have an Item Modifier change the color/style of a...

not sure if this helps but Linked help me figure out something similar:

<div class="custom-system-meter" style="width: 100px;"> <span class="custom-system-meter-fill" style="width: ${(sameRow('reputationProgress')-1)*25}$%; background-color: ${switchCase(sameRow('reputationTableTier'), 1, '#700e0e', 2, '#B22222', 3, '#f5103e', 4, '#FF4500', 5, '#FF8C00', 6, '#F5F5DC', 7, '#87CEEB', 8, '#00CED1', 9, '#20B2AA', 10, '#2E8B57', 11, '#3CB371')}$;"></span> </div>

creates a meter and changes its fill color based on which value is selected from a dropdown list within the samerow of the dynamic table.

#

you can probably scrap that for parts-- but it does use CSS through the <style> tag

elder raft
#

That makes sense, I think my difficulty is trying to put that on an item modifier so the item applies the styling.
I think I could probably come at it from another angle and have the label itself "go looking" for such modifiers and applying color, like the meter you posted. Might be more straightforward too, rather than having colors on item modifiers

sinful spade
#

I meant you'll probably need to change the label Mind to have a switchcase found within the item

elder raft
#

Yeah, exactly. I was coming at it from the opposite side

sinful spade
#

so instead of using a dropdown to as the housing for the switchcase condition, you'd have an item

#

you have any idea how to get items to populate information into a container?

elder raft
#

Ohh yeah yeah, I think I know how I can get it to work from the label side, like you're suggesting.
I just like to make things harder for myself and gnaw on the wrong side of the problem to start ๐Ÿ˜‚

#

Using = and <div style="color:blue">${fetchFromActor('attached' , 'player_levelmind') + item_bonus}$</div>

on the item is working, but it means that only one one item bonus will calculate at a time. Which is fine for my use case, especially since it'd be odd to have colors competing in addition to math competing, but I still wonder if there's a way to use the priorities to let + item_bonus exist independently in its own modifier without popping up an error or NaN

formal goblet
#

And you can use Label prefix

#
  • suffix for the html-tags and the Label value for the raw number
elder raft
#

Ohh can it? do you just drop your style in the hidden attribute formula? Or do you need to feed it a key as well?

formal goblet
elder raft
#

I'm messin with it now, I see how it works, that's nifty!
I got it partially working, but I'm trying to figure out the exact way to get the prefix/suffix in the label to reference those hidden attributes in the item,

fading pollen
#

Ok think i need help ๐Ÿ™‚
// ${rollformula:= (athletics_num + athletics_mod - Chivalry_fatigue_num + chivalry_drive_num) < 1 ? '2d6kl1cs>3' : ':(athletics_num + athletics_mod - Chivalry_fatigue_num + chivalry_drive_num):d6cs>3}$ // //<h1 style="text-align: center;">${[:rollformula:]}$</h1>//
The 2d6 formula works, but can't seem to refer to a variable inside a string.
Please help ๐Ÿ™‚

formal goblet
formal goblet
sinful spade
#

thank you

fading pollen
#

'(athletics_num + athletics_mod - Chivalry_fatigue_num: + chivalry_drive_num)d6cs>3'

formal goblet
#

Either '${athletics}$d6' or concat(string(athletics), 'd6')

fading pollen
#

ah ok - i'll try that

#

Thanks

#

so like this '${athletics_num + athletics_mod - Chivalry_fatigue_num: + chivalry_drive_num}$d6cs>3'

#

whole thing is this - but cant't make it do the key calculation <h1>Successes</h1>
${rollformula:= (athletics_num + athletics_mod - Chivalry_fatigue_num + chivalry_drive_num) < 1 ? '2d6kl1cs>3' : '${athletics_num + athletics_mod - Chivalry_fatigue_num: + chivalry_drive_num}$d6cs>3'}$

<h1 style="text-align: center;">${[:rollformula:]}$</h1>

#

it worked!!! just had to remove the : that was in the way!! thanks man

formal goblet
#

The console is also helpful finding issues, so use that

fading pollen
#

Yea - i'm trying but i'm not so good at reading that code ๐Ÿ™‚ but i'm learning

sand nova
#

Is there any way I can put images inside a character sheet?

In this example I'm using "label icons" but I wanted to use images

formal goblet
sinful spade
#

this works fine:
Rolling: ${sameRow('attributeName')}$ with ${sameRow('attributeFinalDice')}$ <br><br> <h2>Total: ${[:sameRow('attributeFinalDice'):]}$</h2>

but the minute i try to add situational bonusses within the alterantive roll:
Situational Bonuses: ${addMod:=?{sitBon:"Situational Bonuses"[number]}}$ Rolling: ${sameRow('attributeName')}$ with ${addMod}$ + ${sameRow('attributeFinalDice')}$ <br><br> <h2>Total: ${[:sameRow('attributeFinalDice'):]+addMod}$</h2>
it doesn't work and provides no error or output

formal goblet
sinful spade
#

but isn't addMod just = to sitBon's result?

#

sitBon is just the inquiry of how much the situational bonus is?

lofty crest
#

In this game I'm adding, weapons aren't just the values that form their primary attack, but also grant manoeuvers - alternate attacks which cost a resource.
I first thought to create these manoeuvers as separate template, and add those to the weapon template, but it isn't possible to place an item displayer object into an equippable item template.

Is there any advice around a strategy for implementing this game? I can:

  • bake the manoeuvers into each item. There's not so many that any repetition will be too annoying
  • possibly make people manually drag the manoeuvers in as separate items, but then if they lose the weapon they'd need to remember which manoeuvers to delete, unless they could auto-hide?

I'll probably just bake them in but I'd like to learn if there's a proper/good/recommended way to handle this kind of thing.

formal goblet
formal goblet
echo veldt
#

Just starting to learn Custom System Builder and I had a few questions about Additional style classes.

  1. I created a simple CSS file with styling for a class.

  2. Since I am on the forge for my server, I added CSS to my assets library and copied the link.

  3. I then set the configuration of CSB to that CSS file

  4. I then went into the component and added that class to the Additional Class field of the component, but nothing seemed to happen.

Is there something I am missing? do I need to add the class with a specific syntax? Does this not just add a class for enabling a class selector to style the component?

echo veldt
#

Another Question:

I made custom icons for my dice rolls and macros. Is it possible to use one of those for my icon rather than using Font Awesome?

#

K, so I figured some of it out by just adding HTML to the label and then putting a style attribute in the element to add css to get some styling to apply.

echo veldt
#

one more question:

I have a label Formula that rolls x number of exploding dice and then compares them each to a target number to see if I get any success.

this is the current formula I am using:

%{return new Roll(`{${Array.fromRange(6).map(i => "1d6x").join(",")}}cs>=8`).toMessage();}%

This was just to get it running enough to test to see if it was working and it does, until I try to change the number to things on the sheet.

so I try to replace the 6 with my field that is keyed to body_value, and I can't get it to work anymore. It just stops doing anything.

I have tried
body_value
:body_value:
(body_value)
@body_value
${body_value}$
${body_value}

and almost everything in between.
I then loaded a dat moduel to check my path and found it to read @attributeBar.body_value.value and tried all the combinations with that and nothing.

I then decided to try in between and tried @body_value.value and everything I could think of for that and still nothing.

please help, I don't know what I am doing wrong but at this point I am calling it quits for the night.

formal goblet
formal goblet
echo veldt
#

Thank you so much that worked. I was pulling my hair out. lol

%{return new Roll(`{${Array.fromRange(entity.system.props.body_value).map(i => "1d6x").join(",")}}cs>=8`).toMessage();}%

Trying to implement Old-school Shadowrun dice has been a pain. ๐Ÿ™‚

#

now to work on the Target number prompt since it can vary.

#

but that is a future red's problem.

Thank you and good night all.

night wraith
cobalt mango
#

Is there an expected correct way to restrict item amount based on the item template? (2 weapons , 4 potions)

formal goblet
cobalt mango
#

Alright, thank you ๐Ÿ˜
Would you say it's not worth suggesting as a system feature inside the item containers?

#

I'll store the max for each item template inside the character template so that the design is cleaner

cobalt mango
#

Ah that's way broader but fits. Cheers

echo veldt
formal goblet
echo veldt
#

I also play 6th, so that would be cool to link to. The systems are pretty far apart with regards to many of the mechanics, but knowing how you implemented edge expenditures could help with Pool expenditures in 3rd.

I also need to figure out how to implement the initiative system, which I think for all editions of Shadowrun it was the same. That is after my next task which is to figure out how to do variable Target numbers in my success test sheet roll.

potent fossil
#

Hey I have a question
is there a way to pass on a information in item to macro that is launched through the sheet?
I want to create a macro to roll the damage of an item through a character sheet but I need to pass on to the macro values from the character sheet and the weapon item

faint wharf
#

Hi! im trying to force atribute bars to work with ripper carousel combat tracker. As i understand CSB dont have straight implementation of bars that would be able to find for HP or AP. I was eble to directly inject my atributebar, but it only shows there top value no current.

Question is. can i convert some way atribute bar from CSB into a regular foundry atribute bar so the module should see it. Its not a first module i meat such problem i cant pick atributes for CSB. Is there a chance to conver or duplicate them to norrmal ones?

lament flint
#

I have a simple question I can't seem to figure out. How to I get the name of the targeted actor?

half beacon
civic furnace
#

I was wondering what i am doing wrong in my macros, i used to write something so that people can roll their macros checking if they are tunned to a certain skill, meaning the skill will not get worse the more they are tired, it worked at first, but i am trying to do it inside a Configure Hidden Atribute Bar, so that my players can just write FatigaDeStamina and if the checkbox is checked it will work.

#

this is not working

#

now i will send in the one that is working

#

${#scale:=switchCase(sameRow('simplemagic_scaling'), 'forca', ${Forca}$, 'agilidade', ${Agilidade}$, 'constituicao', ${Constituicao}$, 'inteligencia', ${Inteligencia}$, 'sabedoria', ${Sabedoria}$, 'carisma', ${Carisma}$, 0)}$
${#name:= sameRow('simplemagic_name')}$
${#roll_hit:= sameRow('simplemagic_hitmacro')}$
${#roll_dano:= sameRow('simplemagic_damagemacro')}$
${#descricao:= sameRow('simplemagic_description')}$
${sameRow('simplemagic_istunned') ? concat(
'<div>',
'<h2>${name}$<h2/>',
'<h3>Acerto = ${[:roll_hit:+(:scale:/3)]}$<h3/>',
'<h3>Dano = ${[:roll_dano:+(:scale:/3)]}$<h3/>',
'<div/>'
) : concat(
'<div>',
'<h2>${name}$<h2/>',
'<h4>Nรฃo Afinado<h4/>',
'<h3>Acerto = ${[(:roll_hit:+(:scale:/3))(${Stamina}$/${StaminaMax}$)]}$<h3/>',
'<h3>Dano = ${[(:roll_dano:+(:scale:/3))(${Stamina}$/${StaminaMax}$)]}$<h3/>',
'<div/>'
)}$
${descricao}$

#

I wrote this one last month, and i changed multiple things such as moving much of the variables to the Configure Hidden Atribute Bar

half beacon
#

Then again, I know next to nothing about macros.

civic furnace
#

Nope, did not work

formal goblet
#

Check the console for errors

civic furnace
formal goblet
civic furnace
#

For some reason in a actual actor it is diferent

#

Is it obsolete as in v12 ? i am using v11 because some modules that i use have not updated yet

#

3.2.5 is my version

formal goblet
civic furnace
#

do i remove the blank spaces ?

formal goblet
#

However you like. These spaces don't matter in this case

civic furnace
#

it is still not rolling and giving this error inside console

#

Do things such as sameRow work inside a hidden atribute declaration ?

formal goblet
#

Ahh, yeah they don't.

civic furnace
#

Damn... can you think of a work around ?

formal goblet
#

Otherwise there's no context for the same row

civic furnace
#

it is being called inside of the table, but i asume it runs the computations before my Label is rooled when the actor is loaded

formal goblet
#

Hidden Attributes are handled like Label text

#

So yeah, computed on sheet-changes. Not when you're rolling

dusky mauve
#

maybe I have already asked - is it possible return whole LINE of table instead of COLUMN
like lookup do for Dynamic table?

civic furnace
#

I tried soething diferent, i tried changing it to ${istunned ? FatigaDeStamina : 1}$, and now it works, but for some reason it is aways 1 and the value dont update when you click the checkmark

#

my ideia was to have one checkmark that a player needs to press before using a tunned magic

formal goblet
civic furnace
#

i did misspell that... the word is actually tuned with 1 n

#

but i did the same mistake in the key

civic furnace
#

so cant be that

formal goblet
civic furnace
#

false

#

when i check it it changes to true

#

and that is inside the hidden attribute thing

formal goblet
#

and ${typeOf(istunned)}$?

civic furnace
#

boolean

formal goblet
#

Wait, why do you use FatigaDeStamina in the Formula?

civic furnace
#

it translated to TiredBecauseOfStamina

#

it is used to reduce the amount of your bonus when you are low on Stamina

#

The more a battle goes on the more tired you get

formal goblet
#

Your key of the hidden attribute is the same. So you have a recursive dependency

civic furnace
#

and i want that if its a magic or a hability you use your whole life it does not impact the roll

#

i...

#

i am dumb

#

i should have writen ${istunned ? Stamina/StaminaMax: 1}$

#

it worked

#

thx Martin, sorry for the lack of eyesight

echo veldt
#

Can you change the value of a meter using a formula?

echo veldt
#

I was trying to set up a Condition monitor-style damage tracker for my Shadowrun module.

So I set a label of "Stun Damage" and a meter to give a bar-like value similar to the condition track of 0-10.

Then I noticed there was no way to just adjust the meter without calling some sort of formula. so I clicked on the label to try and set the value with setPropertyInEntity, but it is just not working to set the value of the meter to display the damage.

I was using
${setPropertyInEntity('self', 'stun_damage_value', ?{adjustment[number]})}$

I was thinking that the user would click the label and then get a box to put in either a ply or minus number, and then it would adjust the value accordingly.

formal goblet
echo veldt
#

then how is the meter adjusted by a player using the sheet?

formal goblet
echo veldt
#

is that set in the Value entry of the meter? and would I just list in that

:key:
to get that to work?

#

Ah I figured it out. thank you

night wraith
#

hey peeps, I am trying to start using this system builder. Are there any more or less up-to-date videos on youtube that show me how to properly create dynamic tables etc.?

formal goblet
night wraith
#

Thank you. While the documentation is miles better than Sandbox System Builder's, if someone could produce a system where they slowly build a system the community could greatly benefit from that!

#

Currently trying to build a dynamic table to which I can add skills items. It's a lot of trial and error for now

#

In Sandbox builder, for example, I could first create a skills table with columns for Skill name, skill rating and a roll icon and leave that table empty. Then I would create one item per skill, give these items a skill name plus according attribute to roll. Then I would just drag and drop the item into the table in the player sheet for the skill to be added. Is this possible in CBS as well?

formal goblet
#

The Dynamic Table is just a normal Table, where you can add rows. It doesn't have any drag & drop-functionality

night wraith
#

Ah, gotcha!

night wraith
night wraith
#

And where exactly do I configure

  1. which columns the table should display
  2. text fields for values like skill rating, which can later be changed on the player sheet?
#

Ideally, whenever I drag a skill over, it automatically converts into several fields like "skill name", "skill rating" and so on

formal goblet
night wraith
#

Thank you. Sorry for all these questions, this is still babysteps for me. And how can I refer to the values of my skill in the item displayer?

formal goblet
night wraith
#

Like this? This yields no name in the table sadly

formal goblet
#

Otherwise it will try to find it in the props of the Actor

night wraith
#

So if my skill name key in the skill item template is item_skill_skillname, then the correct value for the label would be ${item.item_skill_skillname}$? I am getting an error doing this.

formal goblet
night wraith
#

Nothing that looks like an immediate error regarding the skill name to me

formal goblet
#

Alright, then check the keys for typos. It means, that the result is undefined

night wraith
#

I just saw that somehow after changing the name in the blueprint, the item was wihtout name, now it works. Thank you so much! Final question for now: any way to get rid of the item hovering next to the name in the table?

night wraith
#

For me it's about aesthetics. If I can just ignore it using CSS later on that is fine as well.

storm stream
#

Folks, can anyone recommend a d20 or osr based sheet I can use as starting point for the game I am putting together?

NVM, found the example module ๐Ÿ™‚

night wraith
#

Say I want to create a skill item, with specialisation and skill rating customisable by the players within an item displayer. How can I do this? I attach an image of the item displayer table in the left window on the top, and a manual table underneath it. The manual table shows what I am trying to achieve. For example, the dropdown menu works in the manual table, because it can lookup the attribute value. But when using items, this is not possible, most probably so because the item itself does not know from which actor to fetch the attribute values

formal goblet
night wraith
formal goblet
# night wraith I am trying my best to follow you, but this system is still new to me. Am I on t...

I see what you did there. Your Key options should be just the keys without any formula-delimiters (and make sure to leave no white-spaces) and the formula of your label options should be in this format: fetchFromActor('attached', "attribute_body", 'N/A')

For the programming language part, I suggest to read these here:

In short: ${}$ uses mathjs (with some custom-behavior) and %{}% uses Javascript

echo veldt
#

Could someone pin this?

night wraith
#

I verified the key for Body attribute is attribute_body though

echo veldt
#

NVM just saw it, the plus button like a tabbed pane

night wraith
#

@echo veldt I am building Shadowrun 4e, in fact. If I remember well you are building SR3E? We might be able to help each other here and there

echo veldt
#

absolutely, many concepts are similar, even if the systems are different.

echo veldt
half beacon
lament flint
#

Is there a way to make items populate a drop down list?

formal goblet
formal goblet
lament flint
#

Another question. I'm trying to get this conditional to work but its acting odd with the mix of text and code I put in there.

${Successes >= 0 ? 'You dodged! Take no Damage' :

'Roll to Soak 'Enemy_DMG-Successes ' Damage.'

}$

Error:

formal goblet
lament flint
formal goblet
elder raft
#

Hmm... I am trying to work on something based on the Dice Pool wiki entry,
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
And... even without messing with the code I can't get Foundry to spit anything out, just the error of a bad function.
Even trying Raddy's crit version un-modified gives me the same thing... ๐Ÿค”

I'll confess, I am new to scripts in Foundry

noble ibex
#

Guys, I tried all things, but nothing is helping me. I'm throwing the template I'm trying to use here to see if a good soul can save me. Thank you in advance

daring thunder
#

Hi, when I right-click a button in my sheet and select "add as a macro" it runs the button correctly, but it also prints to the chat the roll message when it shouldn't. Any way to stop that happening?

#

As you can see, clicking the button runs this code and it works perfectly in the sheet without printing anything to the chat

#

But when you run the macro in the hot bar (which looks like /sheetRoll lose_stamina_key ) it prints the following:

formal goblet
daring thunder
#

ah damn

formal goblet
daring thunder
#

Oh that doesn't appear to be an option for me

night wraith
night wraith
formal goblet
night wraith
#
foundry-esm.js:4621 Error: The {{select}} handlebars helper is deprecated in favor of using the {{selectOptions}} helper or the foundry.applications.fields.createSelectInput, foundry.applications.fields.createMultiSelectElement, or foundry.applications.fields.prepareSelectOptionGroups methods.
Deprecated since Version 12
Backwards-compatible support will be removed in Version 14
    at Object.logCompatibilityWarning (foundry-esm.js:4609:19)
    at Object.select (foundry.js:8349:19)
    at Object.c (handlebars.min.js:27:27865)
    at eval (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:13:129)
    at Object.h [as fn] (handlebars.min.js:27:25975)
    at Object.<anonymous> (handlebars.min.js:27:18211)
    at Object.c (handlebars.min.js:27:27865)
    at Object.eval [as main] (eval at createFunctionContext (handlebars.min.js:29:10011), <anonymous>:43:47)
    at c (handlebars.min.js:27:23534)
    at d (handlebars.min.js:27:23849)
logCompatibilityWarning    @    foundry-esm.js:462
formal goblet
night wraith
#

and this is my dropdown menu

half beacon
formal goblet
night wraith
half beacon
#

Does CSB have functionality for multi-target? I could have sworn I saw someone ask this recently, but couldn't find the post.

night wraith
#

I believe I saw something about that in the documentation

formal goblet
formal goblet
night wraith
formal goblet
#

Alright, at least that works fine. Now add your Label Options

night wraith
formal goblet
night wraith
formal goblet
night wraith
#

That works! Now I really wanted to have a dropdown menu in order to make selecting the respective attribute easier for like.... 40 skills

#

I.e., hardcoding one of 10 attributes into the template is not going to work in my case

formal goblet
formal goblet
#

Yeah, it is...

night wraith
formal goblet
#

You need a fallback-value for the unattached case

night wraith
#

I just added , 'NA'.

night wraith
high stag
#

I recently updated, and i had problems defining attribute bars.
What did I do wrong? (i was trying to make a resource bar on the token and it simply displays NaN

echo veldt
formal goblet
high stag
formal goblet
# high stag

I mean their values ๐Ÿ˜… . You can create a Label and try to reference those or check via the console

high stag
formal goblet
# high stag srry

Did you also update the actor? The 2nd screenshot doesn't align with your screenshot of your Attribute Bar config

night wraith
#

Another question: Is it possible to leave certain columns/field in item displayers open for players to define? In this image for example, I would like to let the specialisation field per skill be an open text field that the players can write into. I have found no option to do this. The table underneath shows what I would like to achieve

high stag
#

yeah but same

high stag
formal goblet
# high stag

Did you also update the synthetic Actor in the Token (if unlinked)?

high stag
high stag
#

its linked

formal goblet
high stag
formal goblet
#

Which version are you running?

high stag
#

4.1.1

formal goblet
#

Maybe we can avoid the issue. Where do the values come from?

high stag
#

not from a dynamic table

#

I tried it alone but apparently now after the update I need to make the attribute for resources to recognize it, right?

formal goblet
#

How about you configure the max-value in fisico and delete your custom attribute bar? Because the number field will create one for you as soon as it has a max-field

high stag
formal goblet
#

Yep

high stag
#

now i dont have any attribute bars

formal goblet
#

Check the console for errors

high stag
#

nothing

formal goblet
#

Heh...

#

Try out game.actors.getName('actorName').system.attributeBar in the console

high stag
#

apparently it can't read anything other than text field or number field

formal goblet
high stag
formal goblet
# high stag

Alright. Try to find the faulty formula. You can find the content of the formula at the bottom of the error message

high stag
formal goblet
# high stag

Well, that's a +-operator with only 1 value. Not allowed ๐Ÿ˜…

high stag
#

yeah but idk where it is haha

formal goblet
#

You could export the Actor or Template and try to find it in the file with a text-search

high stag
#

I don't have that many buttons

formal goblet
high stag
#

i will find it

#

I didn't find it, but I deleted all the formulas and it worked lol

#

thank you Martin

high stag
#

Could you help me with quick buttons on the sheet to change or reset values?

echo veldt
#

Is there a method for displaying every name from a column in a dynamic table onto an item container column?

use case:

In my system, a character can have multiple specialties in a skill. I have defined this as a dynamic table in a skill item.

On the actor, I have an item container to display the actor's skills and you can just drag new skills over to the actor as you want.

I would like this item container to display basic info on the skill like its specialties, but as those can be any number and I put them in a dynamic table how do I display them?

#

found it, it looks like I can use the looup function to get something.

high stag
#

Has anyone here had success automating Polyglot languages with CSB?

echo veldt
# night wraith Another question: Is it possible to leave certain columns/field in item displaye...

so I figured out a work around to do this.

  1. In your item container create a column to hold a generic label to act as a button for a formula that is used to set the name of the specialty inside the item. You can use html here so if you want it to look like a generic + symbol or whatnot you can. This is done by using an <img> tag as the label text.

  2. For this label you will add a formula in the "Label roll message" box and deselect "Send roll message to chat".

${setPropertyInEntity('item', 'test_name', '?{name:"Specialty Name: "[string]}')}$

This is the one I used to set the name of an item I had in the testing I did. you would change 'test_name' in your formula to the key of the item's value you wish to change. which would be the key to the specialty text field you have in your item.
Note: You do not add item.whatever or anything else just the key you entered for that item field.

This formula will prompt the user with a text box to enter the specialty name and then set that field in the item.

thorn magnet
#

I suspect, I maybe stupid. I cannot figure out for the life of me how to make a numerical value appear below a token. just a graphical bar

crimson girder
#

Are there any example sheets that include inventory and items?

daring thunder
night wraith
plucky canyon
#

Hello all! Just noticed that today is the one year anniversary of me trying to figure out how to do opposed rolls in my Heavy Gear (Silhouette) system. ๐Ÿฅณ

I put it on ice back then, but thought I'd give it another try now. How could I store an attack roll result, so that when the target rolls its defence it gets compared to the attack roll to give the difference as the final result?

#

I'm not great at scripting, but can cobble together workable macros given enough time.

plucky canyon
#

Hmm... was thinking I might be able to use something like this, so when the target rolls evade it can use last_attack as a reference. But saw something about players not being able to edit non-owned actors.

${#setPropertyInEntity('target', 'last_attack', 'target.last_attack + attack_result')}$

formal goblet
plucky canyon
#

Hmmm... ok, thanks. I've been looking at flags as well, but unsure of how those work.

formal goblet
#

What you could try is to store the data in a data-attribute of a Button in the final Chat Message (the Button itself would execute a Script with the stored data as context).

plucky canyon
#

Aha... like a "final result: 8. Click button to roll evade." button in the chat message, that would then trigger the defence roll?

plucky canyon
#

Hadn't thought of that, but yeah, feels like a workable solution. Thanks!

Haven't done much with chat messages yet, so need to figure out buttons and stuff. But should be doable. ๐Ÿ™‚

pallid pine
#

Hey everyone! New to the csb so I am struggling quite a lot.

Is it possible to create attribute stats with a checkbox bar like this in the character sheet?

formal goblet
pallid pine
#

Okie, thank youu

round badger
#

This question may have an obvious answer I am missing, hopwever I can't seem ti find an answer: I have a working character template. From teh GM side it's working fine. When connecting as a player and they create a new character, the sheet they get is blank. How do I make the character template the default for a new, player created actor?

echo veldt
#

Been trying to figure out a way to do this myself. need to represent a 10 box health tracker similar to this and the best I've got so far is to have a meter. though the style does not match.

The best I came up with is possibly using a switch case to change the graphic to one properly filled out but I am afraid that the graphics will load too slowly for it to look good at all.

echo veldt
round badger
#

GM Sees

#

player sees

#

Just to clarify: when the character selects new actor, the only option they have is "character" and it's loading the default foundry template. No other choice is available.

echo veldt
#

doing some testing on my system. there is a setting in the Configure settings under the Custom system tab that sets the level for reloading a sheet and i wonder if that will let the player reload the template or not.

#

seems the default was set to assistant GM

round badger
#

Yeah It does, but I don't really want them to mess with being able to reload and select the NPC template ๐Ÿ™‚

echo veldt
#

ah, I see

#

it may be out of my depth then. sorry

round badger
#

Thanks anyway. I'll have to use the perms settings for now and scold them if they goof around i guess.

#

Or I can have them make the blank and force a reload once they make the initial sheet. Actually just tried it and it seems to work. I can do that for now.

high stag
#

could someone help me with a css class to change a panel width?
or idk a way to enlarge it.

#

please

echo veldt
# night wraith Thank you for your help! Could you show me an example? Especially with the HTML ...

No worries, I can walk you through what I did but yes it is basically what was listed here #1037072885044477962 message

I wish I had seen that earlier, lol.

so yeah I use HTML in labels all the time to do different things. I tend to use the <img> tag to display my custom die symbol, but I recently found that I can set the custom symbol in the global configuration so this may change the way I am doing things currently.

so to use img tag you need 1 attribute called "src" you set this with and = sign and then point it to your icon or graffic like this <img src="PATH">. you do not need to close this tag like most of HTML. to make it the correct size I set an inline style for it with the "style" attribute.

so my complete tag is this:

<img src="https://assets.forge-vtt.com/61806064e7f43b69e5a19e1a/Icons/Dice%20Icon.png" style="border:none;height:25px; weight:25px;">

this is what I use for the label of my column. I then put my formulas in the "Label roll Message boxes for regular and shift + clicks. I have "Send roll message to chat" checked because this specific script is to make a roll of the rating listed in the item, but for setting an item you would want this unselected.

the final result of my label is a small icon the player can click to make a roll of the skill.

The formula you want though is to set the attribute so it will have a different formula

${setPropertyInEntity('item', 'test_name', '?{name:"Specialty Name: "[string]}')}$

This allows you to create a clickable item in the item container that asks the user for a specialty Name and then sets the specialty field in your skill to that name.

the '?{name:"Specialty Name: "[string]}' is what bring up the dialogue box for the player
and the 'test_name' is the pointer to what to set.

echo veldt
high stag
#

this tabbed panel

#

Its taking a lot of space because this section only has two columns, I would like it to take up less space so that the other column has more space.

echo veldt
#

sorry that is out of my depth, but the dev should be able to help. the only way I know how to do it is to put the tabbed panel component inside another panel component and then set that panel component to 2-column grid. So the tabbed panel would be in the left column of the grid and the other thing would be in the right column of the grid.

another possible way would be to add a class in the Tabbed panel Component's "Additional CSS classes" box and then use styling on the class selector in your CSS to possibly set the width of the tabbed panel.

one of the devs would know more than me as I am just hacking my way through things at the moment.

high stag
#

idk, Martin could help me with this?

echo veldt
#

They would know more than I, for certain. I am just a junior web dev and not on this project. So, I know some coding and that is all, but personally, I would try adding a class to your tabbed panel and then styling that class in your CSS file.

If you don't know CSS though I would wait for a devs help and see if they can help you.

high stag
#

i did it

#

div.classe_arruma_ai{
display: flex;
justify-content: space-between;
}

div.spaco{
width: 70%;
}

this both classes are enough

#

random suggestion
a button on the template sheet to dupe components on click would be great.

echo veldt
#

you can drag components around the sheet by click dragging them. If you do so with the CRTL key held they are duplicated. you can drag things between sheets and into and out of panels.

#

found this two minutes ago and felt like I had found burried treasure. lol

#

if you do duplicate you do need to change keys and the like as they now have the "copy" added to them. so double check the setting in your duplicated components

high stag
#

thanks

high stag
#

Its suposed
to:

%{
let msrt = ${idk}$;
}%

Assign the ${}$ variable to a js variable.
Has the way this is done changed in the update?

formal goblet
high stag
#

idk its a number

formal goblet
#

Then it should be fine. That's a valid assignment

high stag
#

then why isn't

#

let mstr = ${mstr}$;
the or

#

In fact, I think I know why, wait

#

yeah, mb

#

Could you help me with that?

let efrt = (actor.flags.world?.tvaCounter ?? 0);

i dont remember how to define the actor, lol

#

done by a separate macro

formal goblet
high stag
#

I already solved
thanks for the help

#

If I remember correctly, there is a way to do a simple conditional using ${}$

#

i want to make a simple if

high stag
#

thanks

echo veldt
#

I am trying to get multiple pieces of data from a user to use in a formula.

I need them to tell many how many dice they wish to roll and what the target number is.

I then use that to make the roll.

I know you can concat to create several querries on one dialogue and you can call a custom user interface template to do so as well.

What I want to know is how do I access the individual inputs to use the data the user provided?

#

I would liek to do this in one single dialogue, I can do it in several but I am having a hard time figuring out how to do it in one.

#

my formula is:

%{const tn = ${?{tn:"Target Number: "[number]}}$;

const rating = ${?{dice:"Number of Dice: "[number]}}$;

const formula = `{${Array.fromRange(rating).map(i => "1d6x").join(",")}}cs>=${tn}`;

return new Roll(formula).toMessage();}%
#

so this give me two different dialogue boxes and I would like just one.

echo veldt
#

yes that is the concat method, but what I need to know is how to use those variable that it collects in my javascript

high stag
#

ah

#

look at the mstr variable

#

And help me here lol
two buttons would work yeah, but i want just one.

That change the day to night.
just a silly example

#

the first condition works only when estado=true

#

idk what i did wrong but it doesnt change the property if "estado = false"

echo veldt
#

is estado a key for a component of something?

high stag
#

its a checkbox