#Custom System Builder

1 messages · Page 23 of 1

vagrant hollow
#

game.actors.forEach(actor => actor.items.filter(item => item.system.template == 'mu9pD5gENufOjziR').forEach(item => item.templateSystem.reloadTemplate()))

Ahhhhh.....IT WORKS !!!!
Thank you very, very much 😍

formal goblet
#

kein Ding

vagrant hollow
formal goblet
nimble ridge
#

im using a macro for rolling stuff because of how dice work on my system and it works, but for some ungodly reason this second message keeps poping up

#

this is the formula

#

and this is the macro

fierce harbor
nimble ridge
#

it stopped working

#

did i write it wrong?

fierce harbor
nimble ridge
#

ah

#

oki

#

%{await game.macros.getName('Dobles').execute({bonus: ${constitucionTo}$});}%
%{throw "Done;"}%

#

like this?

fierce harbor
#

Yes, should work.

nimble ridge
#

mmm

#

doesn't

fierce harbor
#

Hm, let me check my code

fierce harbor
nimble ridge
#

%{await game.macros.getName('Dobles').execute({bonus: ${constitucionTo}$});}%
%{!throw "Done";}%
I've did it like this and still it doesnt work...

fierce harbor
nimble ridge
#

mmmm

fierce harbor
#

I have

%{!throw "Done";}%
vagrant hollow
# nimble ridge mmmm

Did you deleted it out off the macro again?
It has to be ONLY in the roll message.

nimble ridge
#

Okey sorry for the wait

#

I already did that

#

However

#

I erased by accident a little bit of the macro

#

I had a lot of headaches realising it

#

Now it works perfectly

#

Thanks

fierce harbor
earnest imp
#

by any chance, to the right of Minor Consequence text, can i combine three columns together into one column for a box of text?

fierce harbor
earnest imp
#

Hmmm gotcha

#

So another question, I'm in the process of making GM tool which just automates certain things for me, like reset player character attributes

So: Assuming all my player characters use the Template Player Character Template, is there any way for me to alter all Player Character's specific value, such as pc_current_hp, through a clickable link/button like in the pic?

fierce harbor
earnest imp
#

Ahhh so this starts dipping into macro

#

Alright then I'm gonna go check macro

fierce harbor
#

Can I use Fontawesome icons as Dropdown labels? Looks like it doesn't like that code...

manic hearth
#

I'm runnin' Mekton Zeta and trying to figure out how to write a function for dice rolls. They explode on a 10 and implode on a 1.

The exploding part is easy, but the imploding has me stumped. My first thought was to use a simple if-then, but say you roll a 10 then a 1, or vice versa, it doesn't work. I'm new at this, so I'm hoping I'm just missing an easy solution.

fierce harbor
manic hearth
#

Opposite of exploding, just subtract instead of add.

fierce harbor
#

So if you roll a 1 what exactly happens? I have to admit I'm confused...

manic hearth
#

It's just like exploding dice, but the other direction. If you roll a 1, roll again and subtract it from the total.

fierce harbor
manic hearth
#

Not quite. The ten is still part of the total. The third die could be a different number. So the math could go something like 10 + 1 - 5. And theoretically it can explode and implode infinitely, which is the problem I'm having.

fierce harbor
manic hearth
#

That's what I figured. I found a macro for mekton that someone else wrote, but I gotta tweak it and I didn't want to spend time figuring out how macros worked.

fierce harbor
coral hemlock
storm flame
#

Is there a way for a template for weapons to do something like
Weapon b gains 1d6+1d12 damage
But weapon c gains 1d4+6d2 damage?

formal goblet
storm flame
formal goblet
#

Text Field is one of the Input Components that is available. If you need variable damage Formulas for different weapons, then create a Text Field, that should contain the damage roll formula.

storm flame
#

Oh didn't know you could do that

summer kiln
#

Anyone have advice on making a cooldown on an item that changes based on rounds passing? I'm not sure where to begin

formal goblet
fierce harbor
fierce harbor
fierce harbor
fierce harbor
# vagrant hollow Maybe via CSS?

I've attempted, with no success, to add an icon to a Dropdown List with module CustomCSS using :before like this:

select:before {
display: inline-block;
width: 32px;
height: 32px;
background-image:url('https://fontawesome.com/icons/face-awesome?f=classic&s=solid');
background-repeat: no-repeat;
background-size: 50% 50%;
}

Any idea?

fierce harbor
nimble ridge
#

how do I display specific information from an Item into the character sheet when said item is equiped? Like, for example, a weapon, how do I display its attack bonus or its damage once its equiped in the character sheet?

#

I've alredy made the colums in the item container for each pice of information, I just dont know what formula I have to use

vagrant hollow
nimble ridge
#

Okey im here with items again

#

I'm trying to make weapons, for context.

In my game, weapon damage works similar to DND, each weapon rols a specific die for damage and then adds a character ability like strenght to the damage. How do I make a weapon template that lets me set different damage dies for diferent weapons damage and also lets me add directly a character ability to the damage?

#

I just want that if a character has a longsword equipped it shows that their longsword makes 1d12+whatever they have in strenght damage

vagrant hollow
nimble ridge
#

okey sounds good

normal ore
#

Hey everyone, all good?
I need some help!
The formula below is showing an error.

Formula:

${equalText(tipodanobase_hpalvo, 'armas_mundo') ? fetchFromActor('mundo', "fetchFromDynamicTable('armas_mundo', 'key_dado', 'key_atributo', atributodedano_hpalvo)") : "0, 6, 8, 10, 12"}$

Error: expected type of argument in function addScalar (expected: number or Complex or BigNumber or Fraction or Unit or string or boolean, actual: undefined, index: 0)

Could you let me know where I'm going wrong?

Note: "atributodedano_hpalvo" is a key from a spreadsheet list. I'll be showing in the screenshots.

nimble ridge
#

if not i dont think it will be a big problem for my players to just roll damage manualy, but im still trying anyway

formal goblet
nimble ridge
#

what am i doing wrong 😭?

fierce harbor
nimble ridge
#

i am not geting errors

formal goblet
nimble ridge
#

instead of procesing the 1d8 it gives me this message

nimble ridge
#

omg

#

i

#

am

#

so

#

fucking

#

dumb

#

thank you

#

I READ THAT PAGE LIKE 20 TIMES I CANT BELIVE I MADE SUCH A DUMB MISTAKE I-

#

Im gonna cry

brisk finch
#

anybody have item or inventory template with weight in CSB? I found in CSB but this dont work,or work with errors

formal goblet
#

dw, it's easy to miss things at the first time

brisk finch
formal goblet
dusk surge
#

Right now, my sheet has a Key called lcHandtoHand that has the dice rolled for damage.
I want to use a Label Roll Message to roll the dice in that key.
What is the syntax?

#

I tried reading the doc (which are great BTW). But I either didn't understand it, or I missed it, sorry.

dusk surge
#

Thanks, I'll try that!

brisk finch
#

CSB have video tutorial or something like that?

formal goblet
nimble ridge
nimble ridge
#

thank you ^^

earnest imp
#

Hi, quick question, how can I run a Macro from a Label?

#

Assume the name of the macro is "Reset PC HP"

#

The idea is I click on this panel link and the macro runs

earnest imp
#

Thank you!

#

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

Okay so I understand the game.macros.getName('macroname').execute(); part, but what does return and await mean in this context?

#

(I'm a complete novice at Javascript)

formal goblet
earnest imp
#

Thanks again!

#

Hmmm okay so the macro does work nicely

#

But apparently the actor I binded the macro in is now posting whatever it could retrieve which turns out to be undefined

#

Will the Actor just post anything on the Label roll message no matter what?

formal goblet
earnest imp
#

Oooooh danke, works perfectly ❤️

#

Thanks again!

formal goblet
#

kein Ding

nimble ridge
#

Okey

#

thank godd

#

everything works

#

the character sheet works perfectly

#

now

#

is there a way to automace certain aspects of combat? Such as iniciative rolls, etc?

#

or is that a macro thing?

earnest imp
#

I believe that's when it dives into scripting

formal goblet
#

Everything else is on your own

nimble ridge
#

I see

#

perfect

brisk finch
#

how can i make icon more bigger? in item container panel ?

dusky mauve
cerulean adder
#

How would I get the name of the target?

${#targetName:=fetchFromActor('target',<Name?>,'N/A')}$

brisk finch
cerulean adder
#

...I'd like to jump off the nearest cliff now thank you...

#

Lol i don't know why I didn't just try that first. Sorry!

formal goblet
brisk finch
#

anyway-thanks. for help, i try my best

formal goblet
cerulean adder
#

One last question. I was told that using the ! in front of a conditional formula will display nothing if the data is blank. Is there a way to conditionally write a new column (<tr></td>) or a new line (<br>)? Like I only want a new row in my table in the chat message to display if I'm targeting an individual.

#

I haven't found a way to do this

formal goblet
cerulean adder
#

Ah, so there isn't a way to conditionally add a row to the chat?

formal goblet
#

Hmmm. My guess would be no because of sanitization. Try out ${!'<br>'}$ and check what it displays.

cerulean adder
#

I think that worked!

#

I'll have to check this out when I get back home but I think that might do it!

#

Maybe not!

#

No worries though. I thought it was a slim chance of working

formal goblet
#

No 'ifs' without 'else'

weary nymph
#

Noob help, please. I'm setting up a Number Field in an item template. I only want it visible (it's ranged weapon range) if the weapon is designated as Ranged. Trying to use Advanced configuration Visibility Formula option, but this is giving me some crazy results. "Component will be visible if this formula resolves to true." Trying 'true' or 'false' works fine. But using a key from the item (obbon) doesn't give me expected results. I've tried (no quotes) 'obbon=1', 'obbon===1', 'item.obbon=1', 'item.obbon===1', I've tried other item variables. Even tried ${}$ though it spec. says not to. I seem to be missing something simple.

#

Add: inputting '3===1' makes the component visible also. Doesn't make sense to me.

cerulean adder
# formal goblet No 'ifs' without 'else'

I got it to work! My only question is why is it no longer a box that you can click on to look at the formula results?

${!targetName ? '<td>' : ''}$
${!targetName ? 'Target' : ''}$
${!targetName ? '</td>' : ''}$ 
${!targetName ? '<td>' : ''}$
${!targetName ? targetName : ''}$
${!targetName ? '</td>' : ''}$
${!targetName ? '</tr>' : ''}$```
earnest imp
#

So I wanna be a bit fancy, when I change the content of the Action dropdown, can I use it to dynamically update the content of the Skill dropdown?

#

Or is that dipping into the scripting territory?

formal goblet
formal goblet
cerulean adder
#

Ah! Okay. I'll take it!

earnest imp
weary nymph
#

Yes, that ('==') was it! (also, removed 'item.'). Thanks, Martin.

velvet solar
#

Hello. In a Dynamic Table, I am trying to hide a checkbox depending on the value of another field on the same raw. I tried a lot of possibilities in the Visibility formula, including sameRow('pC2') - pC2 is the key that should trigger the visibility without success. It is possible or should I forget this idea please ?

formal goblet
velvet solar
#

ok, thank you Martin

velvet solar
#

do you have an idea of the release date ?

weary nymph
#

Following along in the FAQ, but still with problems trying to get total inventory weight. Component: Label, Key: Encumbrance, Label text: ${item.Weight}$. On inventory items, Item modifiers: Group: blank, Priority:0, Key: Encumbance, Op:+, Value form: ${Weight}$. I keep getting ERROR in the item component, even when I have no items on the actor.

formal goblet
sonic vault
#

Hi guys, all good?
I wanted to make a checkbox ("pop-up") that, when checked, every time there was a roll on the form, the user input would appear. What would be the best way to do this?

#

I thought about putting a conditional on the rolls that depending on the box would call the input, but would this be a good way to do this?

static cargo
sonic vault
#

a macro that is always active?

#

I'm going to make a macro that makes a comparison with the checkbox?

#

hmm

static cargo
#

Not really my approach... Let's consider someone's about to fire a bow. My macro, "Shoot Bow" would sit in the player's hotbar. They click it. The macro opens a dialog box asking: "Taking the Aim Action? [_]". They check or uncheck the box, and then Shoot Bow works out what the dice formula should be.

I hope I haven't made an incorrect assumption about your need.

#

I'm afraid I've hit my own brick wall. I've made an item called Kevlar Vest. It took me a min, but I found that the item's Conditional Modifier is limited to adjusting labels containing numeric values (previously tried to adjust a Numeric Input). It works great except I need to know how to apply the change only if it's Equipped checkbox is checked.

#

As it stands now, it applies just by posessing the item. It's better than nothing, but.....

sonic vault
sonic vault
# static cargo

So that's what modifiers are for, interesting (still learning rs)

static cargo
sonic vault
static cargo
#

Yeah, the Configure Modifiers dialogue is brought up by the Configure Item Modifiers button that just barely didn't make it into the top of my screen clipping. 🙂

I thought putting the id of the checkbox in the Group field would do something, but that doesn't seem to be what it's for. 😔

earnest imp
#

is there a way to do a simple if-else in the delimiter ${ }$?

#

something like if value x, type a, else b

#

i could use switchcase but

#

just wondering if theres alternative

formal goblet
formal goblet
earnest imp
#

ohhh neat, ty

formal goblet
static cargo
earnest imp
#

Wait checking out console, somethings wrong

#

Um

#

So apparently, ${pc_luk_bonus > 0 ? '+'.pc_atk_bonus : ''}$ causes this error on the console, no property found

#

Nevermind, tried a thing

#

${pc_luk_bonus > 0 ? '+${pc_atk_bonus}$' : ''}$

#

Have to use another delimited for it to work

weary nymph
# formal goblet Label text should be `0`

Changed the Label text to 0 (zero) but now I'm getting NaN on the character sheet when I add an item. Without the items, I get 0. The item weights show up correctly in a list of items, however.

formal goblet
weary nymph
forest junco
#

how do you code in an initiative button? I'm trying to add a button on the CS to roll for initiative whenever the player needs to (system requires a roll for initiative each action)

forest junco
#

No for the character sheet.

vagrant hollow
dusky mauve
hazy saffron
#

Can an item using fetchFromActor() return a key to a dynamic tablel on the actor sheet that can then be referenced within the item using fetchFromDynamicTable()?

formal goblet
hazy saffron
formal goblet
hazy saffron
#

Oh! Okay wasn't sure if the quotes would be needed! Thanks, I'll give it a try

formal goblet
#

You basically pass a string, which will be handled as a Formula

lethal flax
#

So @formal goblet how do i make a roll formula roll as a gmroll?

hazy saffron
# formal goblet You basically pass a string, which will be handled as a Formula

Can this be double-nested? In the item, there is a dynamic table with a dropdown, and when the user changes that dropdown, I want to lookup that dropdown key from the dynamic table lookup table on the actor.

The item-dynamic table is called 'effects and the dropdown column is 'effect_ability' and returns a 3-letter abbreviation such as 'str'. I want to take that and feed it into the actor dynamic table lookup table and pass it as the 'lookup_key' column and return the value in 'lookup_label'

${fetchFromActor("attached","fetchFromDynamicTable('key_label_lookup', 'lookup_label', 'lookup_key', fetchFromDynamicTable('effects', 'effect_ability', 'effect_title', effect_select))","None")}$

#

This is returning '0' to my display and not even the fallback "None"

formal goblet
lethal flax
formal goblet
formal goblet
hazy saffron
formal goblet
# hazy saffron If there is something that I can look at that will help, I'm happy to. I do stru...

Usually Formulas are executed with the execution context of the current sheet. So a Formula in an Actor would normally be executed with the props the Actor.

Now comes the interesting part. Depending on the Formula, the execution-context might change (From Actor to Item and vice versa). An Example:

Imagine we have an Actor and an Item, which both have the property Weight. In the Label of the Item Container, we can either use ${Weight}$ or ${item.Weight}$. The first one returns the Weight-Value of the Actor while the second one returns the Weight-Value of the Item.

We do a similar thing with fetchFromActor(). Usually, formulas are executed with the context of the source-sheet. But in this case, the Formula passed to this function as string will be executed with the context of the target-sheet (the string-part is important, otherwise it would resolve the passed key/function with the context of the source-sheet and the result of it* would be passed and executed with the context of the target-sheet).

It will need some more examples to understand it in depth, but that's the gist.

static cargo
#

Hello again. I'm stuck with something and hoping the answer is something easily corrected.
Actor Sheets have a Label with id initFormula.
initFormula contains "${init20s}$ + 1d${initSkill}$".
initFormula is named in the CSB Initiative Settings.
I can't get it to actually Roll.
► (Must be a finite number)

I've tried variations on initFormula(Label)'s content:
${init20s}$ + 1d${initSkill}$
[ ${init20s}$ + 1d${initSkill}$ ]
[[ ${init20s}$ + 1d${initSkill}$ ]]
Dice-so-Nice threw some dice for that last one, but the number wouldn't go into the combat tracker.

formal goblet
static cargo
#

I've edited the Settings as shown, I'm also including the Console during the process of Deleting the last Combat, putting Coldtrail into combat mode, and clicking the initiative button.

#

Is there a known conflict with Combat Tracker Groups?

hazy saffron
# formal goblet Usually Formulas are executed with the execution context of the current sheet. S...

This makes sense and I've used item.var notation elsewhere. If I understand correctly, in the second 'nested' fetchFromDynamicTable, because that's getting executed by the actor sheet during the first fetchFromDynamicTable(), it needs to have 'item.effects' as the reference to the dynamic table and item.effect_select to reference the dropdown on the item?

${fetchFromActor("attached","fetchFromDynamicTable('key_label_lookup', 'lookup_label', 'lookup_key', fetchFromDynamicTable('item.effects', 'effect_ability', 'effect_title', item.effect_select))","None")}$

static cargo
#

(Context: in case of conflict, Combat Tracker Groups is deactivated.)

formal goblet
static cargo
#

Yep, sorry, ...leftover troubleshooting tests. The label in the actor template now looks like this, but the problem persists...

formal goblet
# hazy saffron This makes sense and I've used item.var notation elsewhere. If I understand corr...

The item.-prefix is only available in Labels of Item Containers, so you cannot do this. But there's a little trick: CSB will resolve the innermost keys/functions first before going further to outer ones. And you're able to nest CSB-Formulas:

${fetchFromActor("attached","fetchFromDynamicTable('key_label_lookup', 'lookup_label', 'lookup_key', ${fetchFromDynamicTable('effects', 'effect_ability', 'effect_title', effect_select)}$)","None")}$

static cargo
#

(PS: I shortened up the actual input ids for the sake of space and clarity.)

hazy saffron
formal goblet
static cargo
formal goblet
static cargo
#

This is where the player can set both speedInitiative and ongoingInitiative... (Skills tab of a Tabbed Panel)…

#

This is where the resulting content of initFormula is part of Coldtrail's character sheet. (GM tab)

#

Note, the ►◄'s are new and just for demonstration.

#

init20s comes from a dropdown that sets either 1d20, 2d20kh1, or 2d20kl1

formal goblet
#

I think it's faster if you show me the props in the error message. These contain the resolved values

static cargo
#

little rusty with the console, tbh... sorry, but I'd select Coldtrails pog then........

formal goblet
static cargo
#

Forgot speedInitiative: "2" as well.

formal goblet
static cargo
#

Nothing now that it's disengaged, but it "Folders Up" all the initiatives that are tied.

#

"► Tom, Dick, Harry ---- 10
► Larry, Moe, Curly ---- 7
Gordon ------------------ 5"

formal goblet
#

Should work

static cargo
#

If it does work with a literal formula, those with different skill dice, or that have Edge, are screwed, but I can test it on mine to see....

formal goblet
static cargo
#

This is how I edited the actor Template for InitFormula...

formal goblet
static cargo
#

Since I directly edited the initFormula label text, the settings are not changed.

#

A change of this nature shouldn't need a server restart, right?

formal goblet
#

nope. Do you get any errors when updating a value in the actor?

static cargo
#

Through the character sheet or do you mean by macro script?

formal goblet
#

Just go to the Actor Sheet and change a random value

static cargo
#

I can change values flawlessly editing the sheet. I'd need to slap together a macro to test that.

formal goblet
#

Doesn't matter which

#

Huh? Why? Go to a number field e.g. and change the number

#

And you watch the console if any errors pop up while changing something

static cargo
#

the - + buttons are good, typing a direct value, ... flawless

formal goblet
#

If it doesn't show more errors, that's fine

static cargo
formal goblet
# static cargo

looks fine. Now the question why the initiative still doesn't resolve

static cargo
#

And a very good question, at that.

Can I say I don't feel so bad now that we are confused, not just me? 😅

#

I hate having to do it, but I think the time has come to disable all mods, test, turn one back on, test again... (cringe)

#

Do you agree @formal goblet ?

formal goblet
static cargo
#

"Must be a finite number"...

#

Oh my... @formal goblet, you're going to love/hate this. I tried setting a literal formula 1d20 in the settings and this is what's produced in chat:

static cargo
#

I wish I knew.... Turning off all mods... Back in a while...

#

Ok, that last screen clip was from the initiative setting being 1d20 instead of [1d20], that's one mystery solved. 🙂

#

Multi-dice initiative also checks out [1d20 + 1d4]...

#

Ok, @formal goblet, I've stayed in completely vanilla Foundry mode and tried the initFormula reference in the settings. Huzzah!!!

formal goblet
#

At least that works 😅

static cargo
formal goblet
#

yep

static cargo
# formal goblet yep

My brain hurts now!! I disengaged all mods, turned on 2-4 at a time........ And I've now run out of mods to turn on! I even turned on a couple more that were dormant yesterday!

hazy saffron
#

Weird question: does the key of a dropdown used in a dynamic put in some trailing spaces? I'm getting this to display for this code, where megaattribute returns a 3-4 letter key and no spaces in the actual field. I thought by adding first() that would eliminate any oddness with the array returning multiples)

${concat('m_', mega_attribute, '_mod')}$

This is displaying m_str _mod (With a space before the last _mod)

Where mega_attribute is this:

And 'effects' is a dynamic table with a column 'effect_attribute' that is a dropdown list, with keys that are just 3-4 letter words:

summer kiln
#

${fetchFromActor('attached','armor')}$

${setPropertyInEntity('attached','armor',('armor + defense'))}$

${#character_current_ap:=fetchFromActor('attached','AP')}$
<br>
Remaining AP: ${setPropertyInEntity('attached','AP','character_current_ap-basic_ap_cost < 0 ? character_current_ap : character_current_ap-basic_ap_cost')}$```

Well it's been a long day and my brain is off. I'm trying to make code for an item that increases armor by the inserted value. Not sure what isn't working
#

Alternatively I get some sleep and figure it out tomorrow

lethal flax
#

@formal goblet so i'm trying to set up something weird. so in a Dynamic Table i have a dropdown which is supposed to be referance in a roll formula so it can fetch the value of a given stat (brains, brawns, or bravery). I did not work. How do i make it work.

brisk finch
#

can i use monk journal and CSB to make custom money system?

vagrant hollow
brisk finch
vagrant hollow
#

I sugest use item piles.

vagrant hollow
formal goblet
lethal flax
formal goblet
earnest imp
#

Through label roll message, how can i actually run a /roll in chat?

earnest imp
#

ahhh okay

brisk finch
earnest imp
#

Hey guys, can I make it so that the following code doesn't display the variable in block?
<td>Roll (${pc_player_dice}$)</td>

#

I want the 2dfkh2 to be simple text and not a blocked result

nimble ridge
#

I want to call a macro with the bonus from a type of weapon that i get from item.ataque, but it just does not work.

formal goblet
vagrant hollow
brisk finch
earnest imp
#

One more question, how would I go around making something like this? An if clause that checks the value of skill_selection_value, and display the html segment inside if conditions are met? (and vice versa)

#

for use in the following example

formal goblet
earnest imp
#

Ahhh alright then I'll work with that constraint for now

#

I just don't wanna clutter up the roll table on chat with another HTML row that 99% of the time I know won't get used haha

#

I think I'll just modify my HTML bit so that I dont have to modify the overall HTML structure to use it

formal goblet
#

You can have full control if you create your own Chat Message from a Script, but that's costly.

earnest imp
#

I don't think it's worth the headache to do something that simple

#

I don't wanna overcomplicate my script as is since, last time i did that, I shot myself in the foot by commiting the classic crime of a saying

#

"If it takes all of your brainpower to develop something, you will not be able to maintain it, because maintaining a feature will always be harder than developing it"

vagrant hollow
# brisk finch Yeah First thing. i dont undestand how it work, i try make simple money system. ...

First I defined a purse for the characters in the template sheet. Simple numberfields with keys (my keys mithril, gold,…). Then I placed a numberfield in any item where GM sets the basic price of the item (my key gmptown), which has to be your “Primary” currency so in the item piles settings I set my mark at Gold. Also I placed in every item a numberfield for the amount of pieces in a item stack (my key quantity).

For the right path the console can be used, but I personally find it easier to head to the resources tab of an actors configuration and open the dropdown for attributes. There you find any key of your template.

I basically learned all this from the Item Piles Wiki.
https://fantasycomputer.works/FoundryVTT-ItemPiles/#/

earnest imp
#

More question, so for this line of code:

<table>
<tbody>
<tr>
<th>Regeneration-Roll for</th>
<th>Life Points & Spirit Points</th>
</tr>
<tr>
<td>Roll for Life Points</td>
<td>${Roll_Life_Points:= [1d20]}$</td>
</tr>
<tr>
<td>Life Points Modifiers</td>
<td>${Life_Points_Dice_Mod + (HasBed ? 3 : 0)}$</td>
</tr>
<tr>
<td>Roll for Spirit Points</td>
<td>${Roll_Spirit_Points:= [1d20]}$</td>
</tr>
<tr>
<td>Spirit Points Modifiers</td>
<td>${Spirit_Points_Dice_Mod + (HasBed ? 3 : 0)}$</td>
</tr>
</tbody>
</table>
<p><strong>You have regenerated ${Life_Points_Total_Regen:= Roll_Life_Points + Life_Points_Dice_Mod}$ Life Points and ${Spirit_Points_Total_Regen:= Roll_Spirit_Points + Spirit_Points_Dice_Mod}$ Spirit Points</strong></p>
${#setPropertyInEntity('self', 'Life_Points_Total', "min(Life_Points_Total + Life_Points_Total_Regen, Life_Points_Max)")}$ ${#setPropertyInEntity('self', 'Spirit_Points_Total', "min(Spirit_Points_Total + Spirit_Points_Total_Regen, Spirit_Points_Max)")}$```

Can I put this example message in Macro format?
earnest imp
#

like so

nimble ridge
#

how can I use the component Key of a column in an item container?

#

%{await game.macros.getName('Dobles').execute({bonus: ${ataq}$});}% %{!throw "Done";}%

I'm using it in this macro calling but it sais that it can't compute the key

formal goblet
earnest imp
#

Javascript scripting it is LOL

earnest imp
#

More question, how do i concatenate the content of a variable with a string in the ${}$ delimiter?

#

e.g:

Before (works okay)
${aoe_flag == true ? fetchFromActor('GM Panel', "aoe_roll_penalty") : ''}$

After (error)
${aoe_flag == true ? '-' . fetchFromActor('GM Panel', "aoe_roll_penalty") . '%' : ''}$

formal goblet
static spindle
#

Hi folks, I am working on how to select an action out of an array. Using a little help from ChatGPT, along with some cleaning to match csb needs, I have this...

${die:=fetchFromDynamicTable('item.action_table','action_dice')}$
${rowcount:=count(action)}$
${actions:=action.join('|','')}$
${dies:=die.join('|','')}$
${?{actionselect:={"Select Action"|actions}}$
${selectedDie:=dies.split('|').at(action.indexOf(actionselect))}$
${roll:=Roll(selectedDie).roll()}
${!concat(name, ' scores ', roll.total,' hits!')}$```

However, It is not appropriately splitting the 'actions' string to make each action a separate value: it recognizes that there should be X items, but it lists the option as  'ERROR'... Any suggestions?
formal goblet
static spindle
#

does this work with multiple items in the array? It seems to throw me an error...

This ends up with this prompt:

${#dice:=fetchFromDynamicTable('item.action_table','action_dice')}$
${#rowCount:=count(actions)}$
${#actionOptions:=actions.join('|')}$
${#?{actionSelect:"Select Action"|actionOptions}}$```

 Where I'd rather it be a dropdown  (i.e. Attack! , Stab!). .split only seems to make the actionOptions throw 2 error values, but appropraitely split (ERROR, ERROR)
velvet solar
#

@formal goblet Where do you define the dialog box _RegenUserInput in _Template please ?

summer kiln
#

Is it possible to have an item edit a value in a dynamic table in the attached players sheet?

formal goblet
formal goblet
summer kiln
#

Ok, i'll give it a shot. Thanks!

#

Do you mean like this?
${setPropertyInEntity('attached','getRefFromDynamicTable('status_table','status_number','status_effects','Corroded Armor')','2')}$

formal goblet
summer kiln
#

Hmm, I'm not sure what I'm doing wrong now. It doesn't seem to want to work

${setPropertyInEntity('attached',getRefFromDynamicTable('status_table','status_number','status_effects','Corroded Armor'),'2')}$

#

NVM

#

Figured out the issue

#

Thank you so much!

craggy python
#

heyo, perhaps this has an answer already but I can't seem to find it. is it not possible to reference attributes from my sheet in the hidden attributes page? here's a screenshot of what i'm working on

#

both the console logs and setting :level: to a fixed value instead of an attribute reference seems to indicate that this might be the case.

#

(console says:)

fierce harbor
craggy python
#

neither work, even after removing the colons

fierce harbor
craggy python
#

yeah

#

actually, ref_base gives a different error, which I hadn't noticed because I was focusing on \🆎 first

craggy python
#

ah, i hadn't found this page, thanks

#

adding the delimiters was the issue, actually. thanks!

#

yup, that fixed everything, actually. thanks for the quick and helpful responses everyone!

earnest imp
craggy python
#

spent a bit of time reading here and i've come to another impasse. the system I'm adapting (KryxRPG) uses 2d10 instead of 1d20, and for advantage/disadvantage, you add another d10 (which can stack to multiple more) and keep either the highest or the lowest two. I've got something here which has a dialogue and works, but with Dice So Nice enabled, it rolls twice the amount of dice, presumably because it's calculating both under the hood instead of only the equation that the switch statement selects. Is there a way around this without writing Javascript? I don't have any experience with that language

earnest imp
#

${aoe_flag == true ? '-'.concat(fetchFromActor('GM Panel', "aoe_roll_penalty"), '%') : ''}$

This is a bit messy, any neater way to do concat? 😅

#

Second question, how might I open a specific tab I want (pc_action_tab) when opening a character sheet? This is my code, it opens the character sheet with actor.sheet.render(true) but am lost in opening a specific tab


if (selectedTokens.length > 0) {
    let actor = selectedTokens[0].actor;

    if (actor) {
        actor.sheet.render(true);
    } else {
        ui.notifications.error("No actor associated with the selected token.");
    }
} else {
    ui.notifications.error("No token selected.");
}```
formal goblet
craggy python
#

ahh, i was thinking i might try to do this but didn't know how to approach it. thanks so much!

#

man being able to evaluate things in :: before rolls gets processed is actually really awesome

formal goblet
earnest imp
floral crater
#

not aoe_flag==true? but aoe_flag?

earnest imp
#

Thanks!

brisk finch
#

anybody have guide how make money system?

dusky mauve
brisk finch
dusky mauve
brisk finch
#

can i find example or templates worlds?

dusky mauve
#

I have use post above as the base.

#

And it works

#

I have add Currency config in the module, and add the same env var to the char list to preserve currency amount. Which are can be accessible in module by path prefix system.props.
@brisk finch

#

So you are free to use only 1 or 3 or even 100 variations ) for you currencies

cosmic karma
#

Hello, I understand that this question comes a lot, but could anyone point me in a direction? How can I show the dice rolled (is a keep higher roll in this case) results in a "formatted way"?

brisk finch
earnest imp
craggy python
#

how are you guys making features sections for your systems? I've yet to decide on an approach for myself, but i'm looking for a relatively simple implementation that won't require a ton of manual data entry to port over the hundreds of feats and traits from the system i'm adapting (this is just for one game I'm running, nothing I plan to publish at the moment). I was thinking about using item containers but it seems like you can't add them from the sheet, and I don't expect my players to be foundry-savvy enough to add their own features when they level up. any clever solutions?

brisk finch
#

Does item piles have a quantity? i mean can i make quantity in item not in item-pile config?

blazing jacinth
#

Is anyone working on this? How people are solving this problem for long campaigns?

brisk finch
#

can anybody give me template to custom economy?

#

where i can find a world on CSB? or maybe somebody can send it?

earnest imp
#

Hey guys! Since CSB apparently doesn't support Combat Utility Belt (and in extension CLT as its the forked variant), how does CSB handle custom status effects? I'd like to add lots of custom statuses.

earnest imp
#

Hi, I'm not sure if this is related to CSB, but for Core Expanded Settings, I'm not sure how I should disable the core Status Effects? I clicked the checkbox off but reopening the setting constantly leaves it checked

sonic vault
#

Hi guys, someone help-me with that error

#

I suspect it's the last line

latent sorrel
karmic wolf
#

${roll:=[:dice:]}$
${result:=roll+ref(AcrobaticTrait)}$
Where AcrobaticsTrait is the name of the Pull down displaying "Str"
This assumes you strength number box is called "Str"
FYI - the roll and result are separate variables so you can add message stuff in the Chat

sonic vault
ornate junco
icy fractal
#

Hi, there is a way to translate a module written for CSB ?

craggy python
# latent sorrel It containers work great for sorting things but I am unclear on what you mean by...

I guess what I was saying is that even beyond players, for the sake of quick editing and handling a lot of data. if I were to create a statblock and I wanted to add a feature to that monster that's specific to that monster, is it possible to create an item as a feature on that statblock without creating an entry in the compendium just for that one monster's ability? aside from feeling a bit out of the way, I think it might clog up my compendia a bit

brisk finch
#

why i cant sell or change coins in item coinainer? i want change 10 copper to 1 silver but traders dont do it. i try many things...

scarlet skiff
brisk finch
scarlet skiff
#

no this is just for currency conversion
so if you have e.g. silver and gold 10:1 -> you cant just exchange currency (as far as i understood) you need to setup a service for that and services need a macro

brisk finch
#

i have this, but i dont have this as seller

scarlet skiff
#

with a service this should be possible

#

in the end all you have to do is:

  • give the service a price (this will be reduced from the actor - e.g. "sell 1 silver buy 10 copper" = price of service = 1 silver)
  • attach a macro to the service (here you have to do the logic to add the desired thing to the actor - e.g. increase copper quantity by 10)
brisk finch
#

it means i cant make item "copper coin" as currency ? traders cant buy coin and exchange it with another coin? i cant just sell 10 copper to buy 1 silver?

acoustic fern
#

Hello everyone, I have an issue with the equalText() function while using the ternary operation (condition). As I was confused I have tried something very basic. But I don't understand the result:

#

it always show 'not equal' even with this simple example

#

Does someone could please explain me what I am doing wrong here ?

scarlet skiff
earnest imp
#

i dont think CSB's delimiter automatically defaults a true variable to be true without a comparing operator

scarlet skiff
#

anyone know how i have to change "changeQuantity" for this to work?
%{let changeQuantity = isLightOn ? 0 : 1
${setPropertyInEntity('item','quantity',"item.quantity-changeQuantity ")}$}%

#

console says: Error: undefined. Uncomputable token changeQuantity

vagrant hollow
acoustic fern
earnest imp
#

Does custom system builder has any this() equivalent? For use below

latent sorrel
icy fractal
#

Hi again, I'm looking for a way to translate a module written for CSB. Any hint?

fierce harbor
fierce harbor
half beacon
#

Hello. The system I'm making allows the player to use multiple skills. Each skill adds a die to their dice pool depending on the skill's rank. Since there's a wide variety of skills, I thought I'd make them all into equippableItems that can be dragged and dropped into the character sheet. But I'm still fairly new to understanding how items work. I've made them and have been able to get them into the character sheet, but how would I go about checking which ones the player chooses to use?

sonic vault
#

Hi guys
I would like to do a check, depending on the marked value, I would get an id and change it.

I thought about the "radio button" but it could be a dropdown list, basically the character can be efficient(+20%(min +1)), deficient(-20%(min -1)) or normal in that skill.
How would be the better way to do that?

craggy python
scarlet skiff
fierce harbor
formal goblet
formal goblet
formal goblet
sonic vault
formal goblet
formal goblet
scarlet skiff
# formal goblet Yeah, the innermost Formula is always executed first. And you cannot pass variab...

this is the whole thing:

%{let quantity = ${item.quantity}$;
if (quantity>0){let token = canvas.tokens.placeables.find(t => t.name === entity.entity.name);
let isLightOn = token.document.light.dim > 0 || token.document.light.bright > 0;
await token.document.update({
    'light.dim': isLightOn ? 0 : 10,
    'light.bright': isLightOn ? 0 : 5
});
${setPropertyInEntity('item','quantity',"item.quantity - (isLightOn ? 0 : 1)")}$};}%
%{throw 'Done';}%

this is the error: Error: undefined. Uncomputable token isLightOn

if this is not possible with CSB+JS i'll just have to do it in pure JS

fierce harbor
formal goblet
formal goblet
fierce harbor
scarlet skiff
sonic vault
formal goblet
sonic vault
scarlet skiff
scarlet skiff
#

this helps a lot 😄

formal goblet
# sonic vault what would be the difference between a derived and persistent value?
  • Derived value: In most cases a Formula. Derived values are dependent on other values (be it persisted or other derived values). These are calculated automatically and players cannot change the value manually.
  • Persisted value: Can only be in Input Components such as NumberFields, TextFields, Checkboxes, Dropdowns, etc... These are values, which can be changed from players. They cannot contain Formulas.
earnest imp
earnest imp
#

alright, thanks for the clarification!

sonic vault
earnest imp
#

still nothing btw, anything i missed? 🤔

#

says Status Effect ID and Name are required

formal goblet
earnest imp
#

Ooooooh I see

#

So on the topic of modules right, I saw that Combat Utility Belt is noted to break when using CSB? I'm assuming that Condition Lab and Triggler also breaks when using with CSB since its a fork of CUB

#

Is there any plans in the future to make Condition Lab compatible with CSB?

formal goblet
earnest imp
#

Hmmm alright in that case, if say I were to use Condition Lab & Triggler with CSB, is it just CSB's Conditional Modifier feature that will break or just about everything?

#

If that's too broad of a question that's ok, I'll test and try out things

formal goblet
#

The error itself is probably fixable, but Condition Lab wouldn't work redardless

earnest imp
#

Ah that explains why the value of character sheet just duplicates everytime I apply one status

#

In that case, what's CSB's local solution for custom status effects?

#

Or at the very least, an active effect module that may work with CSB

formal goblet
formal goblet
earnest imp
#

Ahhh hmmm alright then I'll start from there and see what I can do

earnest imp
#

Thanks for the pointers! I'm also gonna download the Fabula Ultima sheet since IIRC the game system does have status effects in it

#

Maybe also toy around with Monk's Little Details...

sonic vault
#

Is there any way to modify a label, an id that is already a formula inside it? for example a buff that increases the strength attribute by 2

turbid elbow
#

const {visionMode} = token.document.sight;
await token.document.updateVisionMode(visionMode === "basic" ? "lightAmplification": "basic")
await token.document.update({
sight:{
range: visionMode === "basic" ? 20: 0,
angle: visionMode === "basic" ? 60: 0
}
});

This is what I have representing night vision equipment and it works great.
How exactly do I change the effect to grainy monochrome to represent basic thermal sight?

half beacon
vagrant hollow
latent sorrel
half beacon
#

I'm looking for a way to "select" the items so that when they're selected, they add to a variable. Here's an example I did without the items.

latent sorrel
#

Are they rolling from the skill item or are they rolling from elsewhere on the character sheet? The locationof the "roll" button

half beacon
#

They roll from somewhere else on the sheet. I'd like for them to be able to select the skill or skills they use. I think I can figure out how to add dice myself, but I'm not sure if adding a checkbox to item containers is possible.

latent sorrel
#

Do the ranks add to the skill check (ie 1d20 + ranks in skill).

earnest imp
#

If you mean you want to dynamically add multiple values from one single table depending on which you checked, to one final variable, fetchFromDynamicTable() comes to mind

latent sorrel
#

Not if their using items as skills

latent sorrel
# half beacon They roll from somewhere else on the sheet. I'd like for them to be able to sele...

Unless you need to remove skills, a dynamic table might work best. Perhaps just set it up so that each skill in the table has its own roll button. Is there a reason this approach won't work? The only reason to have items as skills if you have to store a lot of information on the item or you need them to be temporary such in a universal system where skills may change to reflect setting flavor.

earnest imp
#

Speaking of skills, what format do you guys build a skill in in CSB

#

I've recently just finished developing the basic character variables, stats, bonuses and basic actions

#

Currently looking to build their abilities

latent sorrel
#

Skills vary based on mechanics. It depends how how the skills affect the sheet. In some cases they work better as items and in some cases they work better in a dynamic table. What do you need to accomplish with your skills?

earnest imp
#

Think JRPG abilities I suppose

#

No regards to enemy positioning like in normal DnD

#

Just select a target and wham away with selected abilities

#

One ability for 1-2 type of actions only

#

I.e: singletarget or AoE

latent sorrel
#

I am not familiar with JRPGs. What your describing is not skills, its combat. Skills (usually) affect dice rolls in some capacity, whether its an attack or a persuasion check. Combat relates to locations on the board and how important hex counting is.

earnest imp
#

Oh if that's the skill you meant I've also already developed em as a dynamic table complete with drop down and everything

latent sorrel
earnest imp
#

Hmm not exactly but let's go with that anyway since I'm curious, I'll tweak my question a bit

#

How do you handle custom token effects in CSB?

#

Let's say, Wet status

#

Or Hungry status

#

If you use a different module that's fine too

latent sorrel
#

In simplest form, I use a condition on the token to do that. If it adds a mechanical effect, I have items setup to modify skills and attributes, so I create an item called "Exhausted" with a -2 penalty to all skills and drop it on the actor. If you mean a more visual affect, such as actually appearing wet, there are modules that apply affects to tokens.

earnest imp
earnest imp
half beacon
sonic vault
earnest imp
#

Simplest way is to simply add a + to your strength modifier with the number or variable you want, assuming if you are adding a variable, the variable is defaulted to 0, do you need something more specific?

sonic vault
#

Could I do this entirely from another label, like updating a variable, like mod_str = (new value), or mod_str.set(new value)?

latent sorrel
#

You can put items on to actors, like a sword, armor, lock picks, etc. This is native to Foundry. Items in CSB can pass (only) numeric value to the actor. This means you can have a +2 sword that improves the combat skill.

earnest imp
#

Ooooh I didn't know that, I'm gonna mess around a bit with it

sonic vault
earnest imp
#

CMIIW, I'm only a week into CSB

sonic vault
#

🤔

latent sorrel
earnest imp
#

Question, can I make it so that one piece of equipment can only be used on one character? Atm I can use the same weapon on two characters

formal goblet
somber jay
#

do inputs or buttons cause a jump to the top for anyone else or is this intended?

i have a long sheet, so when there are inputs on a field and one of my players or i add something in a text box, the value is taken but the sheet completely jumps to the very top.

half beacon
#

I've got another question. Is it possible to get a string from a dynamic table? I tried this, but it didn't work out the way I thought it would. Nothing happens. tableText is a text field.
%{ const selectRandom = [${fetchFromDynamicTable('dynamicTable','tableText')}$];}%

earnest imp
#

Question for Item Modifier, can I use something like ${stat_to_modify}$ in the key section? I want to dynamically update which stat the item is boosting

earnest imp
#

Second question, does Item Modifier from template not get inherited to any new items? I've made a template complete with the item modifier and found that all the items ive made doesn't have the Item Modifier the template had

formal goblet
formal goblet
sonic vault
#

Hi guys, Is there any way to complete this faster?

#

It's basically the same drop down list for the entire table (just changing the id)

formal goblet
sonic vault
#

😮

earnest imp
#

ohhh thats why the modifiers got doubled, i had the modifier on both the item and the template

#

Third question, is there any trick for item modifier to draw from all contents of a dynamic table?

#

Like for example this is the content of the dynamic table (ignore that it looks like normal table)

sonic vault
#

is this bad? (the expected result happened)

#

I managed to correct it, it was what still needed to be filled in with the values

outer wharf
#

Yo what up lads, lasses, and whomever, I am back with another question.
Basically, how would one set the properties of multiple entities at the same time? Such as in an AOE spell.
Below is some code that applies damage:

${setPropertyInEntity('target','This_is_where_damage_goes','Damage_amount')}$

The problem I encounter, is that only the first actor targeted is applied the damage and it seems as if 'target' can only handle one target at a time. Anyone know a solution or workaround?
Thanks.

fierce harbor
latent sorrel
lethal flax
#

@formal goblet how do i set up a formular so it can have exploding die?

formal goblet
earnest imp
earnest imp
latent sorrel
patent dust
#

Hi there! Please excuse me, I'm pretty new to foundry and custom system builder. How can I create macros that interact with the character sheet in custom system builder? For example, how can I create a macro that allows to change the hit point value without opening the character sheet?

latent sorrel
kind basin
#

Heres a question for you talented masterminds out there, Im working on my players character sheets and would like to add a wildshape page for my druid character. Is there a way i can make it so only she can see it? just so it doesnt clutter up players sheets who dont need it ? If not its not an issue. just thought it would be cool.

formal goblet
kind basin
#

I'm unsure how to do a visibility formula, I tried setting the min permissions to see the tab but it didnt have the desired effect. Is that formula available on the doc ?

kind basin
#

Can i just use " player_Name == Shyla " or is it more complex than that ?

pallid kettle
#

Is there a way to get rid of the symbol in front?

fierce harbor
kind basin
fierce harbor
kind basin
#

That was my next path if i couldnt get it working! haha.

#

Heres another question, i have a button for long rest that refill players Hitdice based on a formula. it works. but it sometimes exceeds the max value set by the number field. if the field gets clicked on it corrects it but leaves it wrong until then. is there like a refresh command that i could run after my math so it makes sure it doesnt exceed ?

fierce harbor
kind basin
#

${setPropertyInEntity('self', 'VE_total', 'VE_Max - AttunementDrain_total')}$

${setPropertyInEntity('self', 'hd_Aval', 'hd_Aval + ((player_lvl +1 )/2)')}$

${setPropertyInEntity('self', 'Temp_Health', 0)}$

${setPropertyInEntity('self', 'hd_Aval', 'min(resetVal,maxVal)'}$

#

so something like this ?

fierce harbor
#

Yup, should work.

kind basin
#

No joy sadly, I tried doing a switch case but those are new to me( like all of this. haha. )

switchCase(hd_Aval, 'hd_Aval > player_lvl+1', player_lvl+1)

fierce harbor
kind basin
#

Ok, so i think that makes sense. parameter is what im checking, next is a possible returned value and the third is what to do if it is that value. then repeat ? So in mine im checking the value of hd_aval, seeing it its greater than player level +1 and if so changing its value to its max. I have it printing out the requested value but not changing it now.

fierce harbor
#

And the last param of the formula is without hd_aval=.

kind basin
#

Are you familiar with the 1984 pop hit "Holding out for a Hero" by Bonnie Tyler ? You are the hero she sings about...

#

worked like a charm. Thank you for helping a dummy like me figure it out,

fierce harbor
fierce harbor
#

Bedtime for me know...you all take care 😉

kind basin
#

You too. Thanks again

formal goblet
civic finch
#

Hello there! I want to add a checkbox that when checked will add a die to the roll, what's the best way to do this?

formal goblet
civic finch
#

will that affect every roll, or do I need to enter that formula into every stat with a dice roll?

formal goblet
civic finch
#

oof, I was afraid of that

#

thanks!

formal goblet
#

Well, there's no global setting for that

#

Because every Label Roll Message is handled individually.

civic finch
#

that's what I thought, but I was hoping to be wrong

civic finch
#

how would you have it subtract a die?

earnest imp
#

Any ideas on how I can make an active effect reduce actor HP every turn, like say, Poison? Current effect modifiers only changes character variable temporarily

scarlet skiff
vagrant hollow
# earnest imp Any ideas on how I can make an active effect reduce actor HP every turn, like sa...

I am using the module active-token-effects an set the effect via a macro that is then triggered every round.

// Token selections, can select and apply effect on multiple tokens
let selected = canvas.tokens.controlled;
if (selected.length === 0) {
    ui.notifications.warn("Markiere mindestens ein Token !");
} else {
    selected.forEach(async token => {
        
        // Effect settings
        let effectData = {
            name: "blutung",
            icon: "icons/svg/blood.svg",
            tint: "#FF0000",
            disabled: false,
            flags: { core: { statusId: "blutung" } }
        };

        // Apply the effect to tokens
        let activeEffect = await token.actor.createEmbeddedDocuments("ActiveEffect", [effectData]);
        
        // Script when the effect is created
        ui.notifications.warn("Blutungseffect erzeugt");

        // Special triggering script on specifics events (must have Effect Macro)
        activeEffect.forEach(async effect => {

        // Every turn end
        effect.setFlag('effectmacro', 'onTurnStart.script', `
          let currentPV = actor.system.props.TempHits;
          let dropPV = token.actor.appliedEffects.find(e => e.name === 'blutung')?.flags.statuscounter.counter.value ?? 0;
          let newPV = Math.max(currentPV - dropPV, 0);
          token.actor.update({"system.props.TempHits": newPV});
          let tokenName = token.name; 
          ui.notifications.info(dropPV + " Blutungen abgezogen von " + tokenName);
          `);
        });
    });
}
vagrant hollow
scarlet skiff
kind basin
#

Hello again, any way to tell this line of code to drop the decimal / only return an int

${setPropertyInEntity('self', 'hd_Aval', "min(hd_Aval + ((player_lvl +1 )/2), player_lvl +1)")}$

fierce harbor
kind basin
#

so like this
${setPropertyInEntity('self', 'hd_Aval', round("min(hd_Aval + ((player_lvl +1 )/2), player_lvl +1)"))}$
?

fierce harbor
formal goblet
kind basin
#

I’m confused. Are my “ in the wrong place ? I have them in round formula. Should I wrap “round()”

kind basin
#

Alrighty. I’m on lunch break so I’ll try that when I get back.

cerulean adder
#

Hello, I've read up on Item Modifiers a few times and I need a bit of help understanding.

Currently I have a dynamic table in the inventory tab that allows the player to customize their weapons

The in their main tab they have another dynamic table that lets them select a weapon from the drop down and uses that data to calculate the attack and damage.

I would love to use items for this but I was told that you can't actually get the information stored inside of the item. So If I setup fields that show the damage or the range I'm not able to reference that when calculating the attack or damage, correct?

#

Is there another way to leverage this? Can I create item modifiers that use the information inside the item (like damage and attack type)? Or is this not somethihng that's setup for this type of thing?

formal goblet
# cerulean adder Hello, I've read up on Item Modifiers a few times and I need a bit of help under...

Uhm, I'll clarify a few things:

  • Items are directly attached to Actors, so it's possible to access all Items of an Actor via %{entity.items}% (only via Script-Expressions, not CSB-Formulas)
  • Item Containers (and their columns) on the other hand are not referenceable, because they don't have own props (like Dynamic Tables), so fetchFromDynamicTable() doesn't work on Item Containers.
  • Item Containers have access to both Actor and Item data
  • Item Modifiers are able to push information from an Item to the Actor (be it setting a Label to a specific value of an Item or doing simple math). So it's possible e.g. to accumulate the Weight of all Inventory Items in the Label of an Actor.
earnest imp
#

The CSB incompatibility lists CUB which Condition Lab & Triggler is a fork of, but it doesnt exactly cause nuclear bomb on your game system

cerulean adder
#

Oh, I see! So I might just be able to accomplish what I need with this information! Is there anywhere I can go to read up on %{entity.items}%?

earnest imp
#

I have managed to create custom statuses pretty fine, the macro for on-apply and on-remove runs pretty well

#

In the active effect screen you can adjust the status tooltip just fine, but you just cannot interact with anything that directly changes the character's parameters as it is in my experience, it wont break your game but the status will apply twice if you do that

earnest imp
#

And yes, that includes the Effect Macro option that gets added in CLT Active Effect screen, you cannot use this

#

However you can circumvent it by running a macro that applies the EffectMacro flags of the status effect to your own desire

#

Example content of what's inside the macro that flags the EffectMacro addition:

const dot_effect = token.actor.effects.find(effect => effect.name === "Burn");
dot_effect.setFlag('effectmacro', 'onRoundStart.script', 'ui.notifications.warn("onRoundStart")');```
#

So Condition Lab & Triggler (1.5.4) while is still incompatible with Custom System Builder (3.0.0), it's not a 100% nuke and there's a few workarounds and this is what I confirmed to be possible in the CLT UI:

  1. Creation of custom statuses (and an UI to manage it)
  2. Changing the tooltip of custom statuses
  3. Running a macro everytime a status is applied or not applied
  4. [Effect Macro] Scripts from EffectMacro can automatically be applied to any effects that gets applied via macro from 3), see #1037072885044477962 message for example

What you should not do

  1. Do not touch anything in CLT that directly tweaks player parameter, this will not work
  2. If you've already done 1), and if your Conditional Modifier List component breaks down, see https://gitlab.com/custom-system-builder/custom-system-builder/#313-conditional-modifier-list for how to fix it

What I haven't tried

  1. Triggler system, did not see the need to use this in my system, so I have not poked around with it
#

Thought I'd share my findings here 🙏

cerulean adder
formal goblet
earnest imp
formal goblet
#

np

cerulean adder
#

My idea is to use the attack button right here in the item container using the ```%{entity.item}%```` to get the information from the item for the damage and bonuses to attack. I'm assuming, however I'll have to dig through the character data to get to this and I'm assuming the name of the items is one of the things I'd need to levereage to get that information?

#

I'm I completely off base?

formal goblet
cerulean adder
#

Ohhh

#

I was trying to drill all of the way down here

formal goblet
#

But it's also not bad to know the internal data structure

cerulean adder
#

Thank you so much. That was way simpler than I was making it out to be. I was able to get it going!

#

Sorry, one last question! I was able to get it to display the dice with ${item.blasterDamage}$ but when I tried to add [] inside it stopped working. Is there a way to get it to roll? Do I need to convert it to a number first?

formal goblet
#

[1d20] is valid, [Strength] is not

cerulean adder
#

I did not have the :: around the key. It worked! Thank you!

earnest imp
#

Hey guys, so I'm running Effect Macros on status DoT, think there's a neater way to do this script?

const effect = token.actor.effects.find(effect => effect.name === "Burn");
effect.setFlag('effectmacro', 'onRoundStart.script', `

let burn_stacks = token.actor.appliedEffects.find(effect => effect.name === "Burn")?.duration.remaining ?? 0;
let fire_damage = Math.min(burn_stacks, 4);
fire_damage = fire_damage * token.actor.system.props.fire_multiplier * token.actor.system.props.magic_multiplier;
fire_damage = Math.round(fire_damage);

let current_hp = token.actor.system.props.hp_value;
let new_hp = current_hp - fire_damage;
new_hp = Math.min(new_hp, token.actor.system.props.hp_max);

token.actor.update({"system.props.hp_value": new_hp});
console.log("Burn Stacks: " + burn_stacks, "Burn Damage: " + fire_damage, "Current HP: " + current_hp, "New HP: " + new_hp);

`);```
#

The third parameter of the setFlag i can already tell is going to be unscalable since all of the formula is in the form of hard strings, so I was wondering if anyone has any idea can simplify the code?

prisma grove
#

Is there a way to show the maximum value along side a number field like this?

formal goblet
prisma grove
#

Ah I was afraid of that lol. I was trying to be lazy, thanks though lol.

formal goblet
#

Yeah, things are a bit different compared to Sandbox

prisma grove
#

Yeah, each has things I like. This is the first time I've used CSB, feels good so far.

formal goblet
#

Good to know. Well, it was designed to be a bit beginner-friendly without loosing the options for extensions

formal goblet
earnest imp
#

I'm actually in the middle of working on a promising solution, will post my results later

#

👌

#

It's slightly gross but better than having a big logic be written on a hardstring

formal goblet
#

At least it's a string literal, normal string would be nightmare.

earnest imp
#

Oh yeah lol

formal goblet
#

I'd actually use an IDE and copy the code when finished

earnest imp
#

I already gave up on the normal macro text lol

#

Still WIP

#

Using a proper text editor for this one

formal goblet
#

Good boy

civic finch
#

is there a way to write this to subtract a die? ${dices:= 2 + (checkboxKey ? 1 : 0)}$
${[:dices:d10]}$. I've tried to figure it out but haven't gotten it to work

formal goblet
civic finch
#

I tried that and it still added a die

#

I tried -1 after the ? and it added a die

formal goblet
#

Can you post the full Formula? Might be an issue somewhere else

civic finch
#

for the original roll: ${[2d6+:poi_base+poi_bonus+wpn_skill+wpn_mod:]}$

#

additional dice: ${dices:= + (Dice_1 ? 1 : 0)}$
${[:dices:d6]}$
${dices:= + (Dice_2 ? 1 : 0)}$
${[:dices:d6]}$
${dices:= + (Dice_3 ? 1 : 0)}$
${[:dices:d6]}$
${dices:= + (Dice_4 ? 1 : 0)}$
${[:dices:d6]}$
and these work just fine

#

${-dices:= - (Dice_5 ? -1 : 0)}$
${[:dices:d6]}$
the one I can't get to work

formal goblet
#

- * - = +...

civic finch
#

that was me just trying to figure out if I was putting it in wrong

#

${dices:= - (Dice_5 ? 1 : 0)}$
${[:dices:d6]}$ this way adds one

formal goblet
#

Well, idk if reassigning a local variable works how you're thinking. You should change it so that you have only 1 dices:= in the whole Formula.

civic finch
#

even with 4 checkboxes for an additional die?

formal goblet
#

Yeah

civic finch
#

how would that work with just one?

formal goblet
#

${dices:= (checkbox1 ? 1 : 0) + (checkbox2 ? 1 : 0) + ...}$

civic finch
#

${dices:= (Dice_1 ? 1 : 0)+ (Dice_2 ? 1 : 0) + (Dice_3 ? 1 : 0) + (Dice_4 ? 1 : 0) - (Dice_5 ? 1 : 0)}$
${[:dices:d6]}$
Dice_5 still adds one

formal goblet
civic finch
#

Dice_5 is the key for the checkbox

#

wait

#

so it shows the 3 dice in Dice So Nice! But subtracting the value of one of them

formal goblet
#

You should also have only one Roll-Formula [] at the end

weary nymph
#

Could someone show me a basic macro script that would work for rolling, say a 1d100 that triggers a Dice So Nice dice roll while printing to chat and console? ChatGPT keeps giving me answers that seem to reference now-defunct code.

cerulean adder
#

How would I call on another actor for a dynamic table key?

#

I have the key and the column but I'm not sure how to target something not on the current PC's sheet

civic finch
formal goblet
civic finch
#

well I messed up somewhere, nothing works

formal goblet
civic finch
#

great, thanks so much for your assistance!

earnest imp
#

Finally done

#
const dot_params = {
    effect_name_applied: "Burn",
    element_type: "fire",
    damage_type: "magic",
    damage_per_dot_stack: 1,
    dot_damage_cap: 4
};

FTStatusHelper.countdownDotEffect(token, dot_params);```
#

The actual code in the minimodule

#

Basically turning a whole function into a string before feeding it into effect.setFlag()

#

It's still kinda messy code-wise but

#

I can just shove the code mess to my helper module and just adjust the parameter in the macro manually

civic finch
tribal tapir
#

@brittle moth @formal goblet Is there a way to put item quantity and a way to adding a generic value (for example a number for armor related to the item i put in the container) in the "Item Container"?
I wanted to put a quantity on the "Balisong" item but in the guide i didn't find something about it
Thank you.

cerulean adder
formal goblet
formal goblet
half beacon
#

Another question. Is it possible to make a script that adds a new row to a dynamic table and then auto-fill it with values?

formal goblet
earnest imp
earnest imp
#

I have two DoT statuses, burn and poison

cerulean adder
#

I did

${#equalText(attackType,'Blasters') ? ${setPropertyInEntity('self',item.ammoCurrent,item.ammoCurrent -ammoExpended,0)}$ : 'N/A'}$

earnest imp
#

Problem is, if I apply both DoT status on a token, when the Effect Macro runs, they run async and one of the DoT status cannibalize each other

earnest imp
#

So instead of two DoT statuses adding up, they instead randomly caniballize each other

#

Await?

formal goblet
#

Yeah, await is a thing. Never heared of async/await?

cerulean adder
#

I also tried ${setPropertyInEntity('self',item.ammoCurrent, -1,0)}$ with no luck

earnest imp
#

I've only recently gotten into JavaScript, I'm not too familiar with the async architecture

#

I just know they run independently

formal goblet
#

Basically just await actor.update()

earnest imp
#

Hooooo I will attempt that then

formal goblet
earnest imp
#

Ohhh so does that mean await just forces everything to stop until the task is done?

tribal tapir
formal goblet
formal goblet
formal goblet
tribal tapir
earnest imp
half beacon
earnest imp
#

@formal goblet Any ways to dynamically change the name of the item title or is that not possible?

formal goblet
scarlet skiff
# earnest imp The actual code in the minimodule

i don't quite get why you would use the regex conversion - can you please explain why this is necessary?
wouldn't somthing like this work for you (using ${} in your string)?

let effect_name_applied = "Burn";
let string = `"The effect name is: ${effect_name_applied}"`
cerulean adder
craggy python
#

trying to use some javascript to build a damage formula with dice so nice for some damage types, but I can't for the life of me get this to compile without some kind of error reading Unexpected Token '<literally anything I do>' followed by a traceback. The error seems to be around the first line of code, usually, and it's had all kinds of problems, throwing errors for const, or for adding a semicolon at the end of the first line.

Here is my code:

%{
const damage_bonus = ${ability_modifier}$
const damage_formulas = [${fetchFromDynamicTable('damage_table','damage_formula')}$];
const damage_types = [${fetchFromDynamicTable('damage_table','damage_type')}$];

let formattedDamage = '';
for (let i = 0; i < damage_formulas.length; i++) {
    if (i > 0) {
        formattedDamage += '+';
    }     
    formattedDamage += damage_formulas[i] + '[' + damage_types[i].toLowerCase() + ']';
    if (i == 0) {
        formattedDamage += (damage_bonus>0?'+':'') + damage_bonus;
    }
}

return formattedDamage;}%

i should state that I have programming experience but I've never worked with javascript before. am I doing something glaringly wrong?

formal goblet
# craggy python trying to use some javascript to build a damage formula with dice so nice for so...

You'll loose any type-information when using CSB-Formulas in Scripts. It doesn't matter for Booleans and Numbers, but Strings and Arrays can cause issues if not handled accordingly. So I guess your issue lies within the line of fetchFromDynamicTable(). What you can do instead is the following:

const damage_formulas = '${fetchFromDynamicTable('damage_table', 'damage_formula')}$'.split(',');

A semicolon at the end of a line shouldn't cause any issues. JS will implicitly add one anyway.

craggy python
#

see, what i'm confused about is that the problem line so far seems to be the first one. having a semicolon after ${ability_modifier}$ nets me an Unexpected token ';' error in the console. When I remove it, I get an Unexpected token 'const' error.

formal goblet
craggy python
#

i think you just found my bug lmao

#

it doesn't contain anything atm

#

(it's supposed to be an integer that's fetched from the character it's on, but I'm just testing this in a stray item)

#

putting it on a character sheet, it works fine without any other edits lmao. thanks for helping me out!

formal goblet
#

np. You also have global access to the object entity in Scripts, if you need that

craggy python
#

i'll keep it in mind, though i'm not sure what I'd use it for. the problem is actually that ability_modifier is a hidden attribute on my items, which is what's responsible for fetching the correct number to use from the attached sheet. i think I'll just modify that attribute to have it return 0 if it can't come up with anything lmao

craggy python
#

well, i won't need it, because I got around the error for now by just adding in a quick check like so

const damage_bonus = ${ability_modifier==''?0:ability_modifier}$;
#

but i'll keep this in mind going forward, so thanks

earnest imp
earnest imp
#

Tbh I just don't wanna be coding in a hardstring

cerulean adder
formal goblet
cerulean adder
#

Oh, not the Dynamic Table!?

#

This is what I was doing

formal goblet
#

Use Formula if you reference Dynamic Tables outside of these scopes

cerulean adder
#

Okay, nice. I'm assuming I'll have to use fetchFromDynamicTable() as well?

formal goblet
#

yeah

cerulean adder
#

When I use ${fetchFromActor('Tables', "proficiencyTable")}$ it is only returning 0 so I figured i'd have to do more to get the data in the table

#

oh, did you mean yes or why?

cerulean adder
#

Sorry, I'm still having trouble with this. I've tried a few different combinations and I'm pretty sure I'm doing it wrong. I keep gettin uncaught typeerror.

${fetchFromActor('Tables', fetchFromDynamicTable('proficiencyTable','proficiency'))}$

formal goblet
cerulean adder
#

I did that too and all I got was 0

#

On the "Table" actor's sheet I did ${fetchFromDynamicTable('proficiencyTable','proficiency')}$ and I got 0,1,2,3 back as expected

#

But when I try to combine it with fetchFromActor it only returns 0

#


${fetchFromActor('Tables', tableInfo, 99)}$```
#

I tried that along with what you suggested with just adding the quotes and I just get 0

cerulean adder
#

${fetchFromActor('Tables', "fetchFromDynamicTable('proficiencyTable','proficiency')")}$

scarlet skiff
formal goblet
cerulean adder
#

No errors that I see

#

I also changed the value of the dynamic table and I still only got 0 even though that was no longer one of the options

earnest imp
static spindle
#

I posted about this earlier, but I think I am getting closer to a solution... but I may be going about this entirely wrong. Is there a way to use a .for statement on the 'actions' to have it iterate through each row of the dynamic table? It currently seems to just output the entire array as a string, which is not intented.

${dice:=fetchFromDynamicTable('item.item_actions','action_dice')}$
${rowCount:=count(actions)}$
${#?{actionSelect: "Select Actions" |actions}}$ -- problem exists here: it comes up with "Select Action: Slice, Dice"```
static spindle
formal goblet
static spindle
#

Ah! That would be where I am stuck :P.Would it be possible to appropriately format it through a script %{}% and then run it? as in, get it to look like Slice|Dice and run it from there?

formal goblet
static spindle
#

10-4. Off to GPT to see about jscript :P. By the way, for any folks using it, it actually can do some basic ideation around CSB coding, so long as you feed in the readme and the FAQ. It's not perfect, but it certainly helps take a complete newbie to asking questions regarding script coding 😛

static spindle
#

Yep, adding that into the feed 🙂

prisma grove
#

Is there a way to have button roll different types of dye / number of dice? Like for instance if I set something like this up. Red being the button and green being the die outcome.

prisma grove
#

So how would I set it so the button would be the outcome of the dropdown? :Key_place_holder_text: doesn't seem to convert the roll formula from the drop down.

raven raven
#

I really really really need to track cooldown for my spells and abilites.... any advice on how to track that?

raven raven
#

acheck box would be the best... but how to create a checkbox next to an ability

formal goblet
raven raven
#

I will show you, gimme a sec

#

this is how I handle it at the moment

#

but it suxx

earnest imp
#

Ohhh you make abilities/spell into item?

raven raven
#

every time i want to modify the ability I have to open it

#

it is slow as hell

#

And it needs to be an item because I can just copy paste abilities from word

#

it is much easyer to work with abilities like this

#

it is easier to develope a system like this

earnest imp
#

Noted, i have just finished with my status functionality, trying to make abilities but not quite sure of the approach

#

Will keep in mind of using Item as abilities

raven raven
#

and, i can send these to chat:

formal goblet
#

The example-template has something like a checkbox in an Item Container. It uses a small trick with conditional Icons and setPropertyInEntity()

raven raven
prisma grove
#

${[:LIST_INSP:]}$ is what I'm currently trying to use. LIST_INSP being the dropdown key.

raven raven
#

so i can introduce a new ability to palyers easyli and if the ability causes a status effect they can just drag and drop it from the chat to themselves

earnest imp
#

You ever tried to make a status effect that gets dispelled whenever the enemy HP changes or not?

#

Or is that something you handle manually?

raven raven
#

I handle everything manually

earnest imp
#

Ooof, ok, thanks for the insight

raven raven
#

mine is a relatively easy system

raven raven
earnest imp
#

I don't really have anything to say else really, I just wanna share my progress with CSB cause I just wanna share it

raven raven
formal goblet
formal goblet
prisma grove
#

Ah ok I figured it out... I was using custom when I needed to be using formula.. lol

#

Thanks again

earnest imp
#

I did take a lot of reference from your example sheet thxblob

#

this is where the magic happens tho

#

each character sheet is basically its own database of personal modifiers and multipliers

#

8D

raven raven
#

yes it has check boxes, but i need the check box to be on the character sheet without haveing to open the ability

earnest imp
#

For "global variables" and "global tools" I even have a GM Panel that helps me do just that

#

Everytime i want system-wide things changed, I just go to this custom panel and tweak the parameters ❤️

formal goblet
raven raven
#

can you please send me a screen shot?

earnest imp
#

Also in the middle of making a damage calculator to further help my life GMing 😊

formal goblet
earnest imp
#

Oh I guess I should say this now since I haven't really said it before

#

CSB sheetbuilding capabilities are amazing

formal goblet
#

@earnest imp you have the example-sheet, right? Can you show him the section with the pseudo-checkbox in the Item Container?

#

That's not an Item Container

#

It was either Armor or Weapon. And you need to create an Item for those.

earnest imp
#

oh its an armor

#

right i set it to inventory

#

these ones? one of the two

formal goblet
earnest imp
#

Hmmm then i cant find it sorry

formal goblet
#

Can you create a Weapon and Armor and show the Container to me?

earnest imp
#

?

formal goblet
#

Drag these to the Character Sheet and navigate to the Combat-Tab

earnest imp
#

dragged

formal goblet
#

Ah, you might need to go to the template and reselect the Item Templates in the Item Containers...

earnest imp
#

ah there you go

#

it was all disabled

raven raven
#

How did you do this again? 😄

formal goblet
#

Just make sure to reselect the Item Templates in the Item Containers, the references are getting lost after an import. This will be fixed with the next version.

formal goblet
raven raven
#

the problem is, i can not drag and drop the sword

#

so

#

i have imported the sword

#

it looks like this

#

then created an example character and applyed the "_Template"

#

I go to the combat tab

#

it looks like this

#

and when i drag this here:

#

then nothing happens

formal goblet
raven raven
#

still not working

formal goblet
#

And you have to go into the configuration of the Item Container and reselect the correct template.

raven raven
#

i have started over but still no luck

#

okay

#

i got the problem, _weapon was not selected here:

#

Now i have got this

#

but the problem is i still can not change the cooldown... so i can see the checkboxes, but i still have to open the weapon to edit the checkbox

#

Sidenote: the magick tab is not visible for some reason

formal goblet
#

Go to the actor-template and open the config of the Label of the Sting-Damage column. In the Label Roll Message enter the following:

${setPropertyInEntity('item', 'checkboxKey', "item.checkboxKey ? 0 : 1")}$
%{throw 'Done';}%

Replace checkboxKey with the key.

raven raven
#

like this?

formal goblet
#

Wait a sec, it's referring to a Dropdown... hehhhhhhh....

raven raven
#

Thank you

#

you are the best 😄

#

I really appreciate the help

raven raven
#

i did

#

not the swords are gone and drag and drop does not work again

#

even if i check this:

formal goblet
#

Did you reload the Character Sheet?

raven raven
#

nope,

#

i just relized this

#

OMG it works

#

this is so awesome

#

Just what i wanted

#

thenk you

formal goblet
#

np

raven raven
#

you are my favourite human being at the moment

formal goblet
#

So +1 doggo?

raven raven
raven raven
formal goblet
#

Your profile picture 😅

raven raven
#

🙂

#

appsoluteley

#

Not i only have to figure out how to create reroll some dice of my rolls...

raven raven
#

its not that simple, because i use a coustom dice

#

this is how it looks

#

and I would need to be able to select and rerol selected dices....

formal goblet
#

Heh, well I can't help you with that. This needs quite a bit of Scripting to achieve that

raven raven
#

skill and specialization is not visible. Why is that? ist it a weapon property?

#

its not a big issue but i could make use of this 2 filed

formal goblet
raven raven
#

but then why ? I keept all the item properties:

formal goblet
#

Actually... try to change the value of the Item

cerulean adder
#

Is there a way to run this in Label Roll Message without creating a chat message?

#

${#item.equipped == 1 ? setPropertyInEntity('item', 'equipped', "0") : setPropertyInEntity('item', 'equipped', "1")}$

raven raven
#

you mean these values?

formal goblet
raven raven
#

OH

#

i might have deleted that 😄

cerulean adder
#

Perfect! Thank you!

raven raven
formal goblet
raven raven
#

im there

formal goblet
# raven raven

That's the Config Window of the Item Container, but I need the Config Window of the Label of the Item Container

raven raven
#

here?

formal goblet
#

As you can see, it is trying to pull information from a Dynamic Table, which doesn't exist

#

Just put ${item.Skill}$ in it

raven raven
#

okay, works

#

thank you

#

Last question: is ther any way to increase the size of this checkbox?

half beacon
#

Not sure if this should go here since it's just overall help, but is it possible to put a spoiler message in Foundry's chat window ||like this?||

raven raven
#

thank you

half beacon
#

Thanks for all the help you've given, by the way!

earnest imp
#

@raven raven Oh my god? You figured out a way to change data FROM item container?

earnest imp
#

If you dont mind could you send me an example template and the character for that? I can share mine too if you want 😄

#

Is that a different example sheet than before? 🤔

formal goblet
#

Yeah. The one before is V2.3.1 This one is V3.0.0

earnest imp
#

ohhhh so its more updated

#

gonna pin that then

half beacon
#

Wait, so it IS possible to have checkboxes for items? How?

half beacon
#

So clicking the checkbox won't actually change anything? I'd experiment with it myself, but for whatever reason, items didn't show up in the item containers (except in the Hidden tab) when I took a look at it last time... and just a moment ago too.

formal goblet
half beacon
#

Thank you so much!

hazy saffron
#

Quick question (Which may lead to a longer one): Using a script macro is it possible to return a list of all items attached to the actor that are within a specific item container, if you know the key for the item container? If anyone has a reference page to help me ou tthat would be great if it's easier than typing it out.

latent sorrel
# hazy saffron Quick question (Which may lead to a longer one): Using a script macro is it poss...

I dont think you can by referencing the container but if you are using filters on the container, you can reference the filtering criteria. It also depends on what you want to return. Do you want a list of names, or you want the objects? If you put the following in a label, it will return the names as a comma separated list. Replace FIELDNAME with the name of your item that you are filtering on your container and replace "value" with the filtered value from the container. If you need a list of objects, remove the map method and modify the code as appropriate to process the objects as desired.

%{
return entity.entity.items.filter(item => item.system.props.FIELDNAME === "value").map(item => item.name).join(",");
}%
hazy saffron
#

The ittem container does contain filters

latent sorrel
#

It will require some modification, what exactly are you wanting to do once you have collected the objects? Just a list of names or something more?

hazy saffron
#

So....in a nutshell, we have a blind player and I'm trying to make a dialog box thatt will put all the item names on his sheet into dropdowns by a specific category (Which I guess I can get via the filtering?) and once selected, it will find the item on the sheet and execute the 'roll' assigned to that item

Also, I'd like to be able to change values on an item from a macro

#

So I need the names to display then the abiilty to get a reference to the item that matches the name. I want to display the items on the dialog into multiple dropdowns (attacks, powers, etc)

latent sorrel
#

There two ways to approach this. One option is to build a macro that creates a dialog that does all the things you mentioned. Its pretty complicated. Alternately you can create a special actor and you can use most of what is native to CSB to do this. It will still be fairly complicated, but I think it will require less javascript.

hazy saffron
#

I already have the dialog built and it pulls in 'Dynamic Table' rolls, stat rolls, and skill rolls. I just need it to do item rolls now

latent sorrel
#

You can put the following in a macro. the order of the function call is:Actor Name, field name containing value, value to compare. I hope this helps. It returns a common separated list of names.

let attacks = getList("Olaf the Lost","type","attack");

function getList(actorName,field,value){
    const actor = game.actors.getName(actorName);
    const names = actor.items.filter(item => item.system.props[field] ==  value).map(item => item.name).join(",");
    return names;
}

Edited to fix code error

hazy saffron
earnest imp
#

hold on, whats a getList? 🤔