#Custom System Builder

1 messages · Page 11 of 1

sharp geyser
#

Firing Modes can wait because that's a pandora's box I do not want to try and open.

formal goblet
#

${item.name}$

zinc verge
#

Bet thank you!!

zinc verge
sharp geyser
#

Just need to get skills finished so I can have an actual value to use for said attacks lmao

#

More importantly though, the targets DR and DT are taken into account when determining damage. Already figured the formula out for it.

static zephyr
#

For skills, I made a dynamic table that I'm pretty happy with. You may end up using items for them, since you see more comfortable doing that, but it beat the first way I tried, which was having a huge, hardcoded table.

#

That makes this on the char sheet.

sharp geyser
static zephyr
#

The dynamic tables are way better for the rearrangement issue. I started with a normal table, and you're right, it was like pulling teeth.

sharp geyser
#

Well, I'll probably sink my teeth into it (see what I did there) at a later time, but basic functions are good. I overengineered the hell out of my firearm template because I intend to re-use it for other weapon types (melee, thrown).

#

Thinking about it, I could probably have Melee & Thrown use the same template, since if you're going to use it in a fight, you'll probably end up throwing it at some point lol

sharp geyser
zinc verge
#

Initiative formula works the same way as the drag ruler thing from earlier right? I should be able to just put [1d20+actor.system.props.<my key>] yeah?

static zephyr
#

You can do that, you can use the dynamic tables to make reference material for yourself, or give your players a place to input stats that you reference for computation later.

sharp geyser
static zephyr
#

There's an initiative blank in the configuration settings for the system builder, so are you doing something in addition to messing with that?

zinc verge
#

Hmm 🤔 the initiative roller doesn’t do anything at all when I just do [1d20+<key>]

zinc verge
#

Nah that’s what I’m messing with specifically

sharp geyser
#

[1d20]+<key> should work?

static zephyr
#

I haven't started messing with that yet, because I don't know if I can do anything with initiative passes, but my first placeholder in there looked more like this. I thought you needed to program something in there to rank the players by.

zinc verge
# sharp geyser

I just realized why mine isn’t working. The key I was linking to wasn’t the stat I was trying to add, it was the entire formula itself, so my formula was reading, [1d20+(1d20+stat] 🤦‍♂️

#

Seeing yours just say the key made me realize

static zephyr
#

I haven't done much with actual foundry, but do you "need" initiative if you know what order to take turns in?

#

Like, is there any options that only unlock in combat?

zinc verge
#

Not really, initiative is just how we determine turn order to begin with so automating that first step is comfy

sharp geyser
#

Plus it also adds more consistency to combat if you know that you're before (or after) one of your teammates.

static zephyr
#

I think we're going to end up having to roll initiative with the in-game roller and then annotate it ourselves, as SR4 does turns in chunks that are hard to automate.

#

${fetchFromDynamicTable('ammo_dyntable', 'ap_multi', 'ammo_type', ammo_select) == 1 ? fetchFromDynamicTable('ammo_dyntable', 'ammo_ap', 'ammo_type', ammo_select) : 'Half'}$ I'm having a senior moment because I can't get this ternary to work to save my life. I have some ammo that halves armor instead of doing a flat value, and I'm trying to make this say "If the ap multiplier is 1, then compute the modifiers, if not, just tell the player that it is Half," but it errors out on me. The fetches work on their own. It's something that I've done to combine them that throws an error.

sharp geyser
#

I may just have to have an extra space on the table where weapons are for ammo and their sub-types.

static zephyr
#

I just have a table with all the values that I reference in the same place that the player will be looking during combat. It's still in work.

sharp geyser
#

I do need to make dynamic tables strictly for referrence because I know in the long run it's going to kill me lol

static zephyr
#

The only thing that has bit me so far is that there isn't a prompt if you accidently hit the "delete" key while you're rearranging arrows. Otherwise, they're great.

raven seal
#

isn't there a confirm delete checkbox in the options for dynamic tables?

sharp geyser
#

The problem is though, I also want as little player-interaction on items and stats wherever possible, so I can't 'afford' to have text labels just openly everywhere.

sharp geyser
raven seal
static zephyr
#

I will be damned.

#

Thank you.

sharp geyser
#

(Realised I replied to an unrelated thing just now. Damn it)

fierce harbor
sharp geyser
#

Godspeed! :)

fierce harbor
#

Not sameRow but fetchFromDynamicTable, same args

sharp geyser
#

So, what's 'skillname' needed for in this instance? :s

#

(Just so I have it right)

fierce harbor
sharp geyser
#

So I want to use the Red section to get a value to be used in the blue area.

#

I feel Dynamic Tables definitely need more explaining/examples on the documentation.

fierce harbor
fierce harbor
fierce harbor
sharp geyser
#

How do I get "base" to use "stat" to determine which "SPECIAL" to use to get the "SPECIAL Total" which is then to be used by "Base" as a value

nova storm
#

I tried to create a userinput template for dice rolls, but I couldn't get it to actual popup when I clicked the label that was supposed to invoke it. - I followed the format in the documentation.

Could someone post a code snippet from I've of their sheets?

sharp geyser
#

So you need to double up the existing stuff which was on the document for some weird reason

nova storm
#

Right. Same thing I worked out I had to do on my item container damage roller

warped garnet
#

I may have found a partial workaround : in the Prototype Token settings page, you can actually select the attribute bar. So you just have to set it up for each character once, basically.

dense pine
sharp geyser
fierce harbor
sharp geyser
#

I think I'm just cursed to not have it work

fierce harbor
sharp geyser
#

Just so I know which is the "main" stat

#

Well, it's erroring now. So idk.

fierce harbor
sharp geyser
#

Template? :s

#

Oh you mean the actor template??

fierce harbor
#

Ok ty. If you please could post Base and Max setup that would be great 😉

sharp geyser
#

Max is empty #LivingDangerously

fierce harbor
sharp geyser
#

I've actually gotten a pen and paper trying to figure out the Dynamic Table stuff on the documentation

#

It feels like I'm taking a class :|

zinc verge
#

Ngl several of the decisions I’ve made on how I’m setting up my templates is based around specifically trying not to use dynamic tables. They’re a touch intimidating to mess with imo

sharp geyser
zinc verge
#

You’ll get there fam. Hold strong

#

But also, I get you lmao

#

The stuff I’ve been struggling with isn’t even half as complicated or involved

sharp geyser
#

Now I'm trying to recreate the tables on the document

#

And the thing isn't even showing up - Despite refreshing/updating the sheet

#

So much for trying to figure out wtf a "data path" is.

fierce harbor
#

I'll be not at my desk for the whole day, I'll get back to you as soon as possible
Keep trying, you'll get it 😉

sharp geyser
#

I'll die of old age before I figure this out

fierce harbor
#

I'll be not at my desk for the whole day, I'll get back to you as soon as possible
Keep trying, you'll get it 😉

fierce harbor
sharp geyser
#

I am. That's the problem.

#

Genuinely had to break it out like this

fierce harbor
sharp geyser
#

Headaches.

#

Somehow still unable to get the damned thing to work

#

Throwing in a "sameRow()" to target the dropdown causes it to flip its lid.

fierce harbor
#

Cannot test it and my memory dies not help 😅

sharp geyser
#

I mean it was better than me going in curcles

zinc verge
#

Is \n still the “new line” character for strings in CSB?

sharp geyser
zinc verge
#

Correct

sharp geyser
#

I've never used but, have used <p> and </p> on start and ends of lines.

scarlet skiff
#

<br> also works

zinc verge
#

how exactly do I format it?
for reference, I have ${concat(ITEM_name,'Type: ',SPELL_type)}$
this is where I'd like the new line separation to be
${concat(ITEM_name,
'Type: ',SPELL_type)}$

sharp geyser
#

Screenshot?

zinc verge
#

Sorry it was faster to take a picture with my phone

sharp geyser
#

NP

zinc verge
#

so where it says "Frei Type: Nuclear"
I'd like it to go
"Frei
Type: Nuclear"

sharp geyser
#

Frei<p></p>Type: Nuclear

#

Should work

#

But if you want it to look nicer

<p>Frei</p>

#

Just so you don't have some disgusting touching code things.

#

ioplex also suggested using <br> which could be nice

zinc verge
#

${concat(<p>ITEM_name</p>,'Type: ',SPELL_type)}$ like this more or less?

sharp geyser
#

exactly

zinc verge
#

it returned an error 😅

sharp geyser
#

Unsure-

#

Hmm

#

You may just have to change the 'text size' to not be auto? :s

zinc verge
#

doesn't seem to have affected anything. I think that only controls the size of the component within the template

sharp geyser
#

I pressed enter too early

#

But, you could also do something like this:
Item: ${(I TEM_name}$
Type: ${SPELL_type)}$

zinc verge
#

oh huh, I'll try that rq

sharp geyser
#

wait

#

I fucked it L}

#

:|*

#

fixed

#

Meanwhile I've made two pieces of paper to try and solve this fucking dynamic table idiocy

zinc verge
#

ah it just makes them separate boxes. That makes sense tho

sharp geyser
#

And it isn't goddamned working

#

Conclusion: DynamicTables are made by satan

#

2.5hrs wasted by circling the DynamicTable drain

scarlet skiff
zinc verge
#

Returned as an error

sharp geyser
#

Break them up into two different functions using ${}$ and place <br> between them

zinc verge
#

Oooooh gotcha

#

Yeah that worked!

sharp geyser
#

Now if only I could get this stupid function to work

fierce harbor
sharp geyser
#

I literally just realised that one of the functions I had copied (as part of an example) was incorrect.

#

So idk how long I spent wasted trying to get a function to work, when its foundation was incorrect :|

sharp geyser
#

after what I suspect was 20 minutes

#

:/

sharp geyser
#

If I knew I didn't need dynamic tables so much, I would have given up on this.

#

HALLELUJAH

#

THERE IS A GOD

fierce harbor
sharp geyser
#

Yeah just changed it to that

#

Would honestly

#

I wish the documentation for dynamic tables was 300% longer and explained more.

#

Instead of "this is this. But we don't explain why this one is better, or its purpose. But you can figure it out. We did."

#

Just salty

scarlet skiff
#

i am reminded why my sheet is so bare-bones 😅

sharp geyser
scarlet skiff
#

it doesn't help that my skills are not that easy to create and manage. so macros was on the table from the beginning. so i just got rid of all rolls on the sheet 🤷‍♂️

sharp geyser
#

I'm clearly the opposite lmao. Too much creativity but not enough technical ability lmao

#

By "not enough" I obviously mean non-existant

scarlet skiff
#

well i started i think 3 months ago with 0 knowledge of javascript
but i have to say understanding javascript is way easier than CSB-formulars

sharp geyser
#

Needless to say, you've circumvented it haha. I don't have that level of tenacity to learn coding, so I stick to what I know (mostly)

scarlet skiff
#

after all CSB is great for creating a sheet with little effort - so a big thank you to the Dev's for that. 🙂

sharp geyser
#

Agreed. There's absolutely no way I'd be able to do this much stuff on my own.

static zephyr
sharp geyser
#

Yeah I got there in the end

#

So many things were wrong. I was using a function which hecked, and who knows what else.

static zephyr
#

I was asleep when you asked. I had just done that for my ammo select.

sharp geyser
#

Just doing some reworking of stuff to do with my "character sheet" part

static zephyr
#

I saw your discussion of "sameRow" I belive that is only useful when you're trying to add the stuff in two rows together, like if you wanted to have a base and a modifier in one row and calculate a total, the way you would reference the objects in a formula would use same row. If you're just picking individual cells of a table, then you use the fetchFromDynTable.

sharp geyser
#

Ended up getting it to work exactly how I wanted :)

sterile bay
#

Does anyone have a world setup in CSB they're willing to share? I learn much faster when I have an example I can poke around with. Doesn't matter what system you've set up, so long I can see some designs and formulas in action.

sharp geyser
#

People here are pretty helpful. If you ask someone for help (with something you have in mind) you can almost always reverse engineer it :)

#

Also welcome to the foundry Discord @sterile bay :>

sterile bay
#

thanks for the welcome

sharp geyser
#

No problem :)

sterile bay
#

mostly hoping to borrow a toy so I can see how experienced people think when they work with CSB

sharp geyser
#

I spent 3 hours today struggling with something because I was using the wrong function 🤣

brittle moth
sterile bay
#

Ooooh awesome

#

I'm too much of a monkey brain for gitlab, didn't realize there were other files there

sharp geyser
#

@brittle moth Is there planned support for a 'paperdoll' system?

sterile bay
#

my head hurts from staring at the wiki so this will be a nice break

sharp geyser
#

A kindred spirit haha

static zephyr
brittle moth
sharp geyser
#

Ah. That's fair.

brittle moth
#

And I'm far from using all the features in CSB, some of you make way better use of the capabilities than me ^^

static zephyr
#

That last message was for Boomy. You can import that JSON into your world from the configuration menu where you can see the selection for module and world options.

sterile bay
#

Thanks Neo

#

For something more specific, can you use fetch from actor to get data from items?
I wanted to let players add items to a dynamic table and see both the name and description of the item.

static zephyr
#

fetchFromActor is how you tell items about the character they're attached to, so the opposite direction you said. Item properties are called out through like, item.key, but I had to defer my usage of items, because I was having a hard time understanding them.

#

Dynamic Tables are different than "Items" and are how I've been doing it. With those, you don't have to use fetchFromActor, but you have to use fetchfromDynamictable in order to get the rows and columns when you refer to items in the table.

sharp geyser
#

It's a good way of removing hard-coded bonuses/penalties to a character based of something they're wearing.

#

Like if that item from before had MaxHealth+10, any actor who 'equipped' it within their item container, would receive +10 MaxHealth

static zephyr
#

The word "Item" is confusing, because you could mean a sword in your game, or you could mean the "Item" object in CSB that goes in an "Item Container" that needs fetchFromActor to get information across that interface. I have used dynamic tables instead of the Item Container because it's easier for me to understand. But you'll see Martin's example uses Item objects for feats, races, armor, etc.

sharp geyser
#

@brittle moth What is the ideal use of Attribute bars?

sharp geyser
brittle moth
sharp geyser
static zephyr
brittle moth
brittle moth
brittle moth
glass socket
#

Thank you for your reply @sharp geyser. The initial issue was that when I drag and drop an item into the character sheet that item is added to every item container in the character sheet. What was suggested was using filters to hide items in item containers I didn't want to see the items in. I was wondering if anyone knew if there was a way to drop items into specific item containers instead of the item being added to every item container. I don't if that functionality exists with this system.

sharp geyser
#

So the "item containers" have filters, but those filters check the key component values within the Item.

static zephyr
# brittle moth I'd have to ask <@199124934880919552> If he's alright with that, and repost the ...

I asked him the same thing the other day and got no response, but he was getting hit with alot of stuff from everyone, so I don't know if he thought it was a bad idea, didn't see the message, or can't pin stuff. But I totally understand getting his permission. He ends up answering the same questions over and over with the turnover of newbies, and is pretty quick with the FAQ, but for more arcane questions it seems like having the JSON to reference would be helpful.

sharp geyser
#

So if you have a label in an item with the key EquipSlot, with the value "Armour"
You can use an Item Container which has a filter that is EquipSlot = Armour and it will allow you to place it in there, without duplicated it into every single other container.

brittle moth
sharp geyser
brittle moth
#

Long answer is :

  • Items are linked to actors, in their entirety, not to a specific component
  • The system is then responsible for the item's display and handling. This is done in CSB (for now) by filtering the items inside each item containers, first by template, next by arbitrary formulas
  • This could be handled better, and will, but it never will be a 'drag onto the right Container' situation, as this is not how the core of Foundry works
glass socket
sharp geyser
#

I'm glad somebody has learned from my suffering lol

#

@brittle moth Where's the link for the suggestions? 😖 I somehow got to it earlier today no idea how to go back lol

sharp geyser
tiny hinge
#

is it possible for csb sheets to be hosted on foundry so that people using it can get updates when there are new changes in the repo?

formal goblet
dusky mauve
sterile bay
#

can drop-downs be used for rolls or do I need to use a numeric field

raven seal
#

drop downs can be used in roll formulas so long as the keys match up

sterile bay
#

lol, I was rolling 0 with fudge dice and sat there confused why my modifires don't work

#

also damn four zeros in a row with 4df

sharp prairie
#

I have to add my ETERNAL UPVOTE to the "in-depth tutorial template world" idea. I understand only about 10% of conversation I read here and even less of the gitlab documentation. The only thing mostly saving me is my copy-paste ability but that is starting to fail me now due to how much has changed with syntax and such on the stuff in the sheet library and I don't know how or what to do to get things working again.

#

I say all of this with 100% gratitude to ya'll for making a system that allows us to play any system we desire. And really, I may not know wtf I'm doing but I'm super proud of what I've managed to do and this whole group is super supportive and helpful. So thank you.

#

Also, also, I haven't actually asked any questions lately so here's one: I think I've seen this done somewhere... how do I make a label display text based on a selection in a dropdown? (Each choice will display a different description underneath)

zinc verge
#

I also would very much like to know how to do this

formal goblet
sharp prairie
#

ooooooooh, that's what switchcase does. OK thank you, I'm off to experiment!

zinc verge
#

nice, can switchcase just go on indefinitely? like if I had 11 dropdown tabs could one switchcase formula cover each entry?

formal goblet
#

Yep, as much as you want

zinc verge
#

excellent

formal goblet
#

Whoever uses Google-Sheet / Excel, the function does basically the same

static zephyr
#

Is there any way to determine the grid distance from a selected token to a target token?

formal goblet
#

Nope, CSB doesn´t provide that information. You´ll have to look for modules / own implementation

static zephyr
#

Thank you.

sharp prairie
static zephyr
#

If anyone else wants to find a grid distance, the below will work to find the distance between your selected token and a target.

%{return distance = canvas.grid.measureDistance(canvas.tokens.controlled[0], Array.from(game.user.targets)[0]).toFixed(1);}%

static zephyr
formal goblet
sharp prairie
#

ok so far this just displays 'ERROR'.

formal goblet
sharp prairie
#

oh goody so I'm guessing I can't have any colons, semicolons, quotations, or other grammar in it?😆

static zephyr
#

You gotta escape that Grottan's great tree

#

like \

#

Look in 4.4 of the gitlab instructions, you can't type a breakout in discord for the same reason you're having trouble.

sharp prairie
#

huh ok, this just applies to the quote mark or to all punctuation?

formal goblet
#

Only quotes

sharp prairie
#

thank you, and sorry for the noob questions but like I said above ya'll are great. 🙏

static zephyr
#

At the very bottom of the dropdown, you can set the default value, so you could make that 'Grottan'

#

and you wouldn't need your 'Nothing Selected' at the end.

sharp prairie
#

Now to add a giant text wall of different descriptions🤣

latent sorrel
sharp geyser
sharp geyser
zinc verge
#

there's no way to rename the active effects in CSB currently, right?

sharp geyser
#

I don’t think so but i could be wrong

pure pine
#

I'm kinda new to csb and I have a question, is there a way to get a character's level that's not via bar attributes?

zinc verge
#

tbh I just have a number field set up with mine that has the + and - on it for easy editing

tiny hinge
sharp geyser
pure pine
#

oh no, it's something else, just wanted to get attributeBar.char_level so I can use it for a module

sharp geyser
#

Fair

#

I’m curious but what do you need the bar for? :s

pure pine
#

not the bar, I just needed the value,

sharp geyser
#

You can have a component (label, text bar, number bar) with the Key Name of "Level" and you should be able to reference it that way :)

sharp geyser
sharp prairie
#

Mmkay, I have a rather complicated problem to solve but I think the first question to ask is - what is the proper way to make a roll like "if Checkbox 'key' is checked, then roll 1d6"?

#

I understand this - ${ checkboxKey ? 'Checked' : 'Not checked' }$, but I don't know how to put it in a roll.

sharp geyser
#

So you'll need to assign a value to the checkbox, which may be easier with radio buttons, depending on how many checkboxes you're wanting

sharp prairie
#

Ok so, referencing the pic, if all four health boxes are checked, the player makes their rolls using a d8, otherwise its a d6, d4, and so on, and if only the last is checked then it's a desperation die which is calculated elsewhere. The player's skills are also marked with checkboxes which each add +1 to their roll results. So, if this player wants to make a 'Climbing' roll, then it would roll [1d8+3]. If it was a 'Athletics' roll and their health was down by 1 box, it would do [1d6+2].

#

I'm using checkboxes here simply because I understand them, I'm sure there are a million better ways to do most of the things I'm doing. 😛

sharp geyser
#

Would you like it so all checkboxes don't need to be selected to roll the d8?

#

(off-topic)

sharp prairie
#

Yeah, I suppose just marking the one die your health is currently at would be easier to calculate rather than all of them being checked. I was just doing that to simulate a health 'bar' as it were.

sharp geyser
#

(Doing some figuring out to get it to work, gimme a moment :)

#

Out of curiousity, what's the far left one?

sharp prairie
#

the little running man?

sharp geyser
#

I can't direction

#

I meant right lol

#

The red circle

sharp prairie
#

oh that's the desparation one

sharp geyser
#

Is it s d3 or d2?

sharp prairie
#

essentially a d2 but it gets tied into some other stuff on the sheet and doesn't need to be in this calculation

#

I think anyway, still also figuring that part out

sharp geyser
sharp prairie
#

what exactly is a radio button?

sharp geyser
#

Think of them as part of a 'group' of checkboxes, but only one of them can be active

sharp prairie
#

can you have a 'group' of 1? and how do you reset it on the sheet to be unchecked?

#

just hypothetical

sharp geyser
#

I think you'd be better off using a Checkbox in that example haha

#

But, here's the other thing if you wanted it based off of health

sharp prairie
#

hehe

sharp geyser
#

I may need to work on it more whoops

sharp prairie
#

also just in general thank you for the visual example of how the radio button thing is used here, I had no idea what the doc was saying lol

sharp geyser
#

I literally had to study the Dynamic Table stuff, giving myself a diagram just to understand it

#

Felt like I was back at school lmao

sharp prairie
#

I have no 'school' here, I'm a nurse 🤣

#

flying by the seat of my pants

#

well, ok my school taught me detail and deductive reasoning and such, it's helped here a little 😛

sharp geyser
#

I had this working before. IDK what the hell I've done to mess it up lmao

#

Okay so, assuming Full Health, is that the only time they get their d8?

#

Or so you want it to be so they can be a little injured?

#

IE, 8/9 health = d6, 9/9 health = d8
or 8/9 health = d8

sharp prairie
#

nope just 8, 6, 4....

sharp geyser
#

Ah kk

#

Struggling with the math

#

And then the roll message

#

_<"

sharp prairie
#

no worries I'm in no hurry, gotta go to bed soon anyway and I'll see msgs in the moring 🙂

sharp geyser
#

Heck it

#

Oh I'm going to work on my own stuff, but you're happy enough with the radio buttons, right? :)

sharp prairie
#

might be, gonna play with things more

#

thankk you!!

sharp geyser
#

Trying to figure out the roll stuff for some things, when there's a lot of math involved can be problematic :(

sharp prairie
#

indeed

sharp geyser
zinc verge
#

Tryna make a button that restores HP to max using a button label and setPropertyInEntity, but all it does is create an infinite loop of making the health increase over and over unprompted

#

Is there a way to make it so the health only restores when I click the button?

sharp geyser
#

Post the function?

zinc verge
#

One sec, loading discord on my desktop

#

${setPropertyInEntity('self','HP_current','HP_max')}$

sharp geyser
#

Hmm

#

Works for me :s

#

I can change the value back as well

#

Ahhh

#

I see

zinc verge
#

putting it in a roll message makes my current health number field read [object Object]

sharp geyser
#

That may be because of a shared key component?

zinc verge
#

huh, lemme check

#

wait is that possible? don't all key components have to be unique per template?

sharp geyser
#

They do, but you can copy keys accidently when you control+drag something

zinc verge
#

I'm not finding any dupes

#

ohp

#

I figured it out

#

it's because my max-health value is a label

#

I've been noticing several formulas seem to run into issues when the value you're having them reference is a label

#

I've been trying to use labels for stats so I can use formulas to automate things like buffs and tracking max health and such

#

I found a way around it. Went ahead and had it just set current health to <the max health formula> instead of the max health value on the sheet

sharp geyser
#

I'm honestly staring at this documentation stuff for Dynamic Tables and it's making my stupid head spin

sharp geyser
#

Anyone know why this isn't working?

#

For referrence, it's on an item. need it to determine the firing mode within itself because I don't trust the forces outside of the Item (being the Item Container) to do it correctly.

robust wren
sharp geyser
#

Tried it

#

I'm actually at a loss, asking for help is always a final, desperate measure

#

And now, my the actor's which use my character template aren't loading...

#

Was from this apparently

robust wren
#

work again? Made a backup?

sharp geyser
#

Nah found the offending thing within the template and removed it. Now I can look and load my actor with the template

#

Struggling an absurd amount with Dynamic Tables :|

#

IDK why or how. It should be so simple.

robust wren
#

maybe LinkedFluush has an idea. i never worked with setPropertyInEntity
i could give you a macro, that does the job, if needed 😄

sharp geyser
#

I'll take it haha

#

Honestly, it's going to save a lot of headache

#

This is my current Sisyphus-tier endeavour

#

Fixed it

robust wren
#

not 100% sure, but that should be it:
rollmessage:
%{return await game.macros.getName('ChangeValue').execute({args: ["FiringMode"]})}%
Macro Named ChangeValue:

const a = game.user.character ?? token.actor;

if (a.system.props.FiringMode >= 4) {
a.system.props.FiringMode = 1;
};
else {
a.system.props.FiringMode = args[0]+1;
};```
sharp geyser
#

My god that felt like I honestly didn't change anything

robust wren
sharp geyser
#

(RE: dynamic table)

#

I guess it must've sensed my frustration and decided to stop trolling me

sharp geyser
robust wren
#

click on a empty field on the bottom. It will open a new Window.
Make sure to name the Macro and set the type to script

sharp geyser
#

I don't understand lol

#

Where am I putting it? :S

robust wren
#

klick on one of those. then name the macro, change type into script and paste the macro in. Save it

sharp geyser
#

Ah

#

Hmm, error

robust wren
#

ah, well, js validator says my semikolon is wrong:

const a = game.user.character ?? token.actor;

if (a.system.props.FiringMode >= 4) {
a.system.props.FiringMode = 1;
}
else {
a.system.props.FiringMode = args[0]+1;
};```
sharp geyser
#

Sorry for lack of response, was busy trying to make things look nice haha

#

Currently 'blocking out' and organising my weapon stuff on the character sheet

#

Right side will deal with weapon range, min and max damage output based off of weapon firing mode, etc.

scarlet skiff
robust wren
scarlet skiff
#

Also keep in mind that game.user.character only works for Players assigned a Charakter. E.g. for the GM this wont Work Most of the time

#

And for the ??token.actor to work properly you assume there is one token selected. So i guess Most Times you will be fine but there are Edge cases where this could break

sharp geyser
#

I think I'll try andfigure it out using CSB stuff so I can troubleshoot and figure other stuff out

scarlet skiff
#

It would be helpful If we could Pass the actor of the Sheet the Label Roll is in to the macro. But i dont think this is possible right now

dense pine
#

Messing around with a dynamic table:
I would like to return the value of a specific field that is in the row which is actually selected with a radio button.
So, if table key is "table", field key is "field" and Radio Group is "group" with the value "1", what would be the syntax please?
thought it would be - fetchFromDynamicTable('table', 'field', 'group', 1, '=') but doesnt work

sharp geyser
sharp geyser
#

If it's in the same table, you can use ${sameRow(<column name>)}$ and it should be good to go.

brittle moth
#

fetchFromDynamicTable('table', 'field', 'group', 1) should be enough.
The error in your formula is that you are using only one =, should be ==or ===

  • =is plain invalid and does not work
  • ==matches loosely on the value (string will equal numbers and vice-versa)
  • ===matches strictly (string '1' and number 1 will not be equal)
dire socket
zinc verge
#

I believe they're using font awesome icons?

wheat osprey
#

If this was asked before I can't find it in the discord.
I just upgraded to v11, and upgraded the Custom System Builder world.
Now all my labels with stat rolls are getting error "Cannot Read Property (0) " for anything with a value or calculation. Even the items not in tables
Has this been a common thing?

dire socket
zinc verge
# dire socket How are they colored? Is it new?

unsure. I suspect there's some way to color them though. Some font awesome icons have the same name but will be black or white or filled in vs hollow, and I think you can differentiate those by putting in some kind of code that uniquely represents them, but I don't know what that code is and I suspect that's how something like this is done

formal goblet
# dire socket How are they colored? Is it new?

You can do that by adding this in your Label suffix instead of using Label icon: <i class="fas fa-dice-d20" style="color:green";></i>. Just replace dice-d20 with whatever you need as an icon.

brave trench
#

can a userinputTemplate reference a dynamic table from an item to propagate a dropdown? if so how? table key, nor item.table key are working.

brave trench
#

is there a place we can store formulas or scripts that may be useful for future sheet builders? It would be helpful to have things we can just copy and paste or use as a reference.

brave trench
#

an issues ticket? or is there a different one somewhere? I haven't really explored git lab, don't know my way around.

formal goblet
#

Yep

brave trench
#

ok

#

how do I paste code in git lab so it looks nice and isn't a weird mess. I think some of it gets read as code and reformatted.

formal goblet
zinc verge
#

ayyyy it looks like the item sizes have been fixed in the item containers!

formal goblet
zinc verge
#

normal version of what? CSB?

formal goblet
#

Yeah, CSB

zinc verge
#

I'm a lil confused lol. I was just in my foundry and I noticed the items were small and clean again

formal goblet
#

Well. That wasn´t me 😅

sharp prairie
sharp geyser
manic junco
#

In the Tips & Tricks "Macro for updating values", I couldn't get it to update hidden variables. It worked for other fields, and I managed a work-around, but should it have worked for hidden variables?

static zephyr
#

Is there a way to have a user input trigger on the target of a roll, like if a player goes to attack a target, the target gets a prompt asking which skill to use to defend?

#

I guess I could just put it on the attacker to say "Click which way the target chooses to defend" and that would do the trick.

sharp geyser
static zephyr
#

The only thing is that there are like, 3 different choices for ranged defense and 3 different choices for melee defense because Shadowrun was written by Dustin Hoffman in "Rain Man."

sharp geyser
#

Are the defences used named after the attacks/elements?

#

Like Melee vs MeleeDefence?

static zephyr
#

I haven't named them yet. I've got Reaction Defense and Full Defense that I have to do for ranged attacks, but I haven't made variables for them yet.

sharp geyser
#

If you have the keys be the same, you should be able to use this: ${DAMAGE_NUMBER-fetchFromActor('target',string(concat(ELEMENT,'DT')),0)}$

Add this is you want it to be reduced further by a percentage
--*fetchFromActor('target',string(concat(ELEMENT,'DR')),100)%}$

static zephyr
#

Thanks! I'll end up using that method for sure.

sharp geyser
#

Remember to make sure the ${'s are at the ends too.

#

I've lost count of the times I've spent 5 minutes trying to be like "wHy iSn'T tHiS wOrKiNg?"

#

Only to find out, it was because I'm an idiot lmao

static zephyr
#

Yeah, getting some javascript in one the first time yesterday took me a long time, because I also suck at js.

sharp geyser
#

I don't even want to touch that

#

I'm struggling enough with DynamicTables lmao

#

Mostly trying to make it so the "AttackMode" and "Order" columns work together to find the correct row, but it doesn't appear to want to work.

#

${fetchFromDynamicTable('WeaponSheet', 'AttackMode','Order','CostAP')}$

#

I'd have loved to have made this a userinput thing, but (in my experience) they don't update any values, so they're literally worthless

static zephyr
#

which cell are you trying to make it point at in the bottom picture?

sharp geyser
#

"Order"

#

So I can use that to choose other columns, etc.

static zephyr
#

If you just want the column matrix, you can just put (WeaponSheet, Order), but you want a certain cell? I made a dropdown that referred to a similar table to pull things to another sheet. Let me pull it up.

sharp geyser
#

Well, this is mostly because I'm going to have every other weapon attack available

#

And so if I have something like an Assault Rifle, I can just "order" it's attacks 1-3

#

And then it won't go astray

static zephyr
#

Oh, so you want like an if-then that only shows certain attacks and puts them in order based on a dropdown?

sharp geyser
#

Well, I don't want a dropdown at all lol

static zephyr
#

Oh.

sharp geyser
#

The idea is that the button "1" would act as a mechanism for changing firing modes for the player.

#

Press the button, cycle through the firing modes :)

static zephyr
#

Oh, I see. My example was not going tobe exactly right then. I have been doing everything with dropdowns. I'm about to worry if I can get a drop down in one dynamic table to compare values in the dropdowns in another dynamic table. It's dropdowns all the way down.

sharp geyser
#

Doesn't sound impossible, but would be a lot of screwing around I'd imagine?

static zephyr
#

I don't know yet, but I think it'll take a javascript array function, which will add some time for me to figure out.

sharp geyser
#

IDK wtf it is

#

But me and Dynamic Tables DO NOT get along

#

I've been trying to get this one thing to work for literally 30 minutes

#

It shouldn't be this difficult, but I don't know wtf I'm doing wrong.

static zephyr
#

Can you make the button say 1, 2, 3, 4 independently of anything else?

sharp geyser
#

Well, the button is using "Switch" as its display variable

#

But I don't need it to be

static zephyr
#

if the button can make a variable that matches the numbers shown in "order" then you can do ${fetchFromDynamicTable('WeaponSheet', 'AttackMode','Order','button/switch')}$ and that'll pull the order row that matches, then you can use sameRow to get everything else.

sharp geyser
#

He smol now

static zephyr
#

Weird.

#

Maybe on the switch is not where to put the fetch code?

sharp geyser
#

It was because I had an error in the table

#

But; it's being strange now

#

Then I press the button

#

And it won't fully display until I mouse over any of the "Number Input" on the left

#

@formal goblet

formal goblet
#

Check the console for warnings, there might be uncomputed props

formal goblet
sharp geyser
formal goblet
#

There is already an example-table with some queries in the doc.

sharp geyser
#

I use those and i copied it exactly but still it didn’t work

#

I genuinely think I’m cursed

#

(Even after changing the keys etc, I’m not that clueless lol)

#

(But I’m pretty damned close)

formal goblet
#

Do you also use first()? Because the return-type is always a matrix, so you either have to aggregate e.g. with sum() or pick the first value with first().

sharp geyser
#

I did not 😭

#

If i have two item containers for weapons the player can swap between, how do i get the item stats from one and not the other? :s

formal goblet
#

Do you need the stats outside of the Container?

sharp geyser
#

Yes :(

formal goblet
#

Well, Item Modifiers it is then. No other way around it if you don't want to use Scripts.

sharp geyser
#

So if i have one player who has two weapons, won’t the item modifiers compete with each other? I’d prefer to display each weapons stats separately if possible

formal goblet
sharp geyser
#

I’ll definitely have to give it a look. Out at the moment 😭

wheat osprey
#

Since I upgraded v11, the setting I ported over is having trouble recognizing rolls
From what I can tell the syntax is matching the sameRow('<colName>') change.
But every roll I make (clicking the d20 label) is getting that error.

sharp geyser
wheat osprey
#

${[1d100]<=sameRow('skill_value') ? concat(sameRow('skill_name'), ' was a Success') : concat(sameRow('skill_name'), ' was a Failure')}$

That's what I was wondering, or if they were mispaired, but I found the pair for the parenthases and brackets

sharp geyser
#

I haven’t a clue 😅

raven seal
#

and I assume 'skill_value' is a Number Field and 'skill_name' is a Text Field?

dire socket
hollow dew
#

i'm working on my first sheet with this system, and i was curious if anyone might know why the item icon is acting up on the "heritage" section. i'm guessing this item icon on link thing is new to v11 (on 11.307), so maybe it's a bug, but it seems to be working find in my traits section below. perhaps something about them being in the header?

#

ah, ignore me, i see there's an open issue about it and it's already fixed for next release

#

didn't see the issue section, not used to gitlab 😩

raven seal
#

well I'm really confused then, because I literally just copy pasted the code you posted

wheat osprey
#

That's very confusing

#

My server might be haunted. Something may have happened in the upgrade to 11

sharp geyser
hollow dew
#

yeah, i'm still getting a hang of the formatting, trying to plot out all the function first so i know what i need to contain

static zephyr
#

Is there an easy way to compare a field in a dynamic table to an array of fields in another dynamic table?

sharp geyser
static zephyr
#

I've got two places where users can input a possible skill value. The Pistols in the bottom left lets me know that they can accurately use the Pistol chosen on the right, but I don't know how to compare the inputs of the dynamic tables? Pistols is not necessarily always first. I tried doing array.some and array.filter in js, but I couldn't get it to work.

#

There are 100 skills in SR 4, so I cannot do that.

sharp geyser
#

Was previously what i had before deciding to change to DynamicTables

static zephyr
sharp geyser
#

It’s not alphabetised

#

Uhh, yeah idk man

static zephyr
#

It's 5-6 alphabetized groups.

sharp geyser
#

I think Martin posted something earlier to help me with my dynamic struggles

static zephyr
#

I'll check it out.

sharp geyser
#

It might work - i trust it should, he’s the G.O.A.T

#

Just about to get home and see for myself

raven seal
static zephyr
#

In the bottom left part of the sheet, I let the player input their skill values in whichever of the 100 skills they choose from. Then, they input the weapon on the upper right side of the sheet into a dynamic table that holds weapons. Each of those tables includes dropdowns for skills, and I'm looking for a union between the two dropdowns, like Pistols on one list and Pistols on the other.

sharp geyser
#

Rephrase?

static zephyr
#

In 2 parts:
This is a dynamic table that includes ranged weapons skills, which is a subset of a big skill list.

#

This is where the player tells me his skills. I want to ensure that the skill he is using to fire the weapon in the first picture is located in his skills in this table.

#

I'm firing the gun, so I know that the player has set the first image's dropdown, in this case, Pistol: so I can get that with ${used_rng_skill:=fetchFromDynamicTable('ranged_dyntable', 'rng_skill', 'rng_primary', true)}$

#

but I cannot figure out how to interrogate the second skill list that is Pistols,Athletics Group, Blades. I have tried %{let x=${fetchFromDynamicTable('active_dyntable','skill')}$}% and %{return ${fetchFromDynamicTable('active_dyntable','skill')}$.filter(v => v == used_rng_skill)}%

#

Those are incomplete examples there at the end. I have tried a few things, but I'm javascript dumb, so I don't think I'm formulating it right.

#

I'll tell you when I figure it out.

sharp geyser
#

Seems like a massive problem because the system has so many skills o_o

raven seal
#

I'm not sure I understand, is this the behavior you want?

static zephyr
#

A_Noob, that is pretty cool, but I am trying to compare [Pistol] in the item dropdown to see if it exists in the skill array [Pistol, Athletics Group, Blades]. Like ```const array = ['Pistol', 'Athletics Group', 'Blades'];

array.some(skill => skill === 'Pistol'); // true``` I just don't know how to do that in CSB.

raven seal
#

Does first(fetchFromDynamicTable(skillTableKey,valueToFetch,skillDropdownKey,skillToCheck)) do what you need?

static zephyr
#

I think in this specific case it does, but that's not a guarantee that the player will build the skill list with his primary weapon skill first.

sharp geyser
#

I honestly want to give myself a concussion

#

I'm so sick of not being able to understand these fucking dynamic tables, or their functions

#

I need to attend a ted talk or some bullshit

#

And even still I don't think I'll get it

static zephyr
#

I may have to think of a different way to implement the skills

sharp geyser
#

You're lucky enough to be able to code. I'm stuck playing with dirt and sticks while you've got access to concrete

static zephyr
#

I've done ok so far cheating off the macro-polo channel, but I don't know any js.

#

Gentlemen, I'm going to sleep on this, and I will post how it's done when I figure it out.

sharp geyser
#

If I have any insight by then with how to fetch values from a Dynamic Table, I'll let you know @static zephyr

sharp geyser
#

@formal goblet sorry for pinging but I honestly have no f--king clue why this goddamned dynamic table isn't working

#

It's been ~8 hours of trying to get this f--king thing working

#

And I just CANNOT

#

As I understand it, this is more or less how it should work

#

So why the hell am I struggling so much with this thing

fierce harbor
sharp geyser
#

The Dynamic Table crap

#

fetchFromDynamicTable(1,2,3,4)

#

Sorry

#

Just impossibly frustrated at the dynamic table

#

Not you

fierce harbor
sharp geyser
#

I have wasted SO MUCH time trying to f--king understand this

#

Just to even do a BASIC THING

#

And I feel like I'm further from it

#

THE KICKER?

#

I have a working dynamic table

fierce harbor
sharp geyser
#

AND I COPIED ITS FUNCTION

#

Changed the keys and other garbage it targets

#

NUP. No beuno

#

It no like

#

So I want to kill it

#

But if I give up on it, then I'm going to have to go through this EXACT thing AGAIN when I use any other DynamicTable

fierce harbor
#

Now, how it basically works is: you have 4 args, of which
1 is the table data is stored in
2 is the column you need to extract data from
3 is, if needed, a column you use to 'filter' data
4 is a value in 4 that gives you the corresponding row in 3.
E.g.: you have a table called BirthDates with Name,Month and you want to know who was born on July. You go like:
first*fetchFromDynamicTable('BirthDates','Name','Month','July'))
It reads like: "give me the first Name occurrence of those rows in BirthDates where Month is July"
Hope this helps 😉

sharp geyser
#

I'm actually going to have a mental breakdown

formal goblet
# sharp geyser

1: The Dynamic Table
2: The column you want to target. If you do not specify 3 & 4, it will return all values from this column.
3: The column you want to filter by. It will compare with 4 and check if the values are equal. If not, this row will not be returned in 2
4: The value you want to compare. Each row in 3 will compare with this. 2 will only return those, which match

fierce harbor
sharp geyser
#

With all the actual study I've tried to do to understand this function

#

I actually cannot

fierce harbor
sharp geyser
#

That's all I've been trying to do

#

And I've been having literally ZERO success

fierce harbor
sharp geyser
# fierce harbor So you need the AP cost?

I'll need all of that stuff. They're going to be attack modes which the weapon can cycle through.

Order cycles through 1 - 3 with a button press to choose the 'active' firing mode.

#

So if I don't want a weapon to have a specific firing mode, I just remove the number from "order"

fierce harbor
sharp geyser
fierce harbor
formal goblet
sharp geyser
#

Martin I don't say this lightly

#

But have my babies

#

I could not be more thankful

#

The amount of time this consumed has been problematic

#

Absolute perfection that is this

#

Compared to the nightmare fuel which was this

#

This is literally a gigantic skill issue.

#

(On my side, clearly)

fierce harbor
sharp geyser
#

I can just add Martin to my skill list lmao

#

I swear the ctrl+c and ctrl+v are going to get a good workout today

dense pine
sharp geyser
#

What's the radio group called?

#

${fetchFromDynamicTable('WeaponSheet', 'Rate', 'Order', RADIO_GROUP_VALUE)}$

#

If you're intending to do a similar thing what with I've done with my weapon attack modes, anyway

dense pine
#

can you try if it works? it doesnt when i try

sharp geyser
#

Well, instead of a radio group, I've got a button I press which cycles through variables.

#

${(Switch>=3)?setPropertyInEntity('self','Switch',1):setPropertyInEntity('self','Switch',Switch+1)}$

#

It may not play nice with the radio button

dense pine
#

this is the radio

sharp geyser
#

${fetchFromDynamicTable('WeaponSheet', 'Rate', 'Order', string(group))}$

I think that should be right.

formal goblet
# dense pine

Should be ${fetchFromDynamicTable('table', 'field', 'group', group)}$

#

And each of your Radio Buttons should have different values configured

fierce harbor
sharp geyser
#

It's using the Radio Group Key as a value to use

formal goblet
#

The group key of the Radio Buttons has the value of the currently selected Radio Button

sharp geyser
# dense pine i dont get it.

So for example, you could have a radio button for which dice to use (1d8, 1d6, 1d4). Each radio button would need a different value to make sure that the correct corresponding dice is rolled.

dense pine
#

this is my table

#

in only use 1 radio button group in my template.

#

how can i give the radio buttons different values?

sharp geyser
#

Well, Radio Buttons (if you don't know) work like a group of Checkboxes. Only one radio button within the group can be active at any time.

dense pine
#

i know

fierce harbor
dense pine
#

already did that

sharp geyser
#

Do both Radio Buttons have different values, or are they both "selected"?

fierce harbor
dense pine
#

so how do i do it right? what should i put in the "Value" instead of "selected"?

sharp geyser
#

Ultimately it doesn't matter what the value is, so long as you're going to remember what to referrence it as.

#

For me, I have two radio buttons to display which weapon is displayed (primary or secondary)

dense pine
sharp geyser
#

You could have the value be "Cheeseburger", as long as you remember that when it's selected, you have to say that the radio button equals "Cheeseburger", you'll be fine.

fierce harbor
dense pine
sharp geyser
#

And most importantly whether the Actor whom has those values has Item Modifiers which can be referrenced.

fierce harbor
dense pine
#

i dont get this, maybe im just too stupid

sharp geyser
#

Uhh... So you can have modifiers on your Actor Template for "Strength", items can also have modifiers, which when you have "competing" item Modifiers, you can set how the item will interact with the one on the Actor (being the player character)

#

They're amazing for doing things like races, perks, whole heap of stuff. Even armours :)

#

I believe you can referrence the value of a "key" by using fetchFromActor('target/self/attached',KEY_NAME)

Target = For someone you're targetting
Self = The item/actor to whom the value belongs to
Attached = uh... I think it's the value of the actor who the item is 'attached' to. AKA, in an Item Container.

sharp geyser
brittle moth
#

Regarding the radio button in Dynamic Table issue :
This is a little tricky, and there might be a bug / missing feature behind it all

You need to set a different value to each of your radio buttons. You can do so by using formulas, like ${samerow('field')}$, which will set the value of the 'field' column on the radio button.

Then, you can get which one is selected by just calling the group variable in another formula. This is an exception to the classic Dynamic Table fields, the radio buttons are created as a global variable and not as a row-dependent one.

This is what happens now, and not what I was building it for though, I will need to decide if I want to keep it that way...
A better way of doing this would be to use checkboxes, but it doesn't have the auto-uncheck option...

fierce harbor
sharp geyser
#

I'm planning to make a sort of 'item sheet' which will contain all base stats for all items and using a Dynamic Table for that.

Unsure if this is a good idea, or a terrible one. Thoughts, @brittle moth ?

#

(Mostly due to foundry limitations, if any)

#

Plan to maybe have variable stats which could be randomised within the item at the push of a button

dense pine
#

Ok so im using this now:

#

How do i refer now to the selected row as group has a value now that i dont know as the value of "NK_attack" will be determined later when the Actor is created?

brittle moth
brittle moth
brittle moth
sharp geyser
sharp geyser
#

And should I have them on the character templates? Or visible on a user input prompt? :s

fierce harbor
wheat osprey
brittle moth
brittle moth
fierce harbor
brittle moth
#

absolutely 🙂

fierce harbor
formal goblet
fierce harbor
brittle moth
#

**Beta version 2.4.0-rc3 is now available, with the following changes : **

Features

  • Added 'entity' to script-execution as context
  • Added Dynamic Table functions to User Input Templates triggered from a Dynamic Table
  • Added Formulas to field default values
  • Added Formulas to radio buttons values
  • Added ability to prevent players from adding rows in Dynamic Tables
  • Added ability to prevent players from deleting predefined rows in Dynamic Tables

Fixes

  • [#292] Fixed an issue with keyed-labels in user input templates
  • Fixed an issue preventing the creation of a component with the same key as a Dynamic Table column or Item Container label
  • [#274] Fixed Item image display
  • [#299] Fixed checked by default option

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

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

brittle moth
#

And to follow on this...
**Version 2.4.0 is now generally available, with the following changes : **

Features

  • Added checked by default option to checkboxes
  • Added control style option to number fields
  • [#155] Added Conditional Modifiers
  • Added 'entity' to script-execution as context
  • Added Dynamic Table functions to User Input Templates triggered from a Dynamic Table
  • Added Formulas to field default values
  • Added Formulas to radio buttons values
  • Added ability to prevent players from adding rows in Dynamic Tables
  • Added ability to prevent players from deleting predefined rows in Dynamic Tables

Fixes

  • Fix NumberField hidden on uneditable, non-template actors
  • [#292] Fixed an issue with keyed-labels in user input templates
  • Fixed an issue preventing the creation of a component with the same key as a Dynamic Table column or Item Container label
  • [#274] Fixed Item image display

If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new

brave trench
#

Can't tell if this is a bug or I'm missing something. I Recently got rid of my old deprecated code. One formula is getting odd results now. From sum(table$checkbox) to sum(fetchFromDynamicTable('table','checkbox')). Now with zero table entries/lines it reads 0 (working, because 0 lines is 0 checkboxes), with 1 line it reads true/false (kind of working, but needs to be 1, numeric), and with more than one line it works properly again with a numeric result.

static zephyr
brave trench
#

yep! lol, thank you!

static zephyr
#

That was lucky.

brave trench
#

naaah i call that smart thinking.

#

^_^

wheat osprey
#

What's a good way to setup a large attribute table? I have an attribute table with 5 columns.
My default thought is to create a hidden table with all the values written out as either labels or number values, then reference stats as needed based on whatever the Attribute Value is

static zephyr
#

I did that with dynamic tables. It seems to be working ok so far. The only issue I've run into involved comparisons between dropdowns in dynamic tables.

static zephyr
#

When I try to get an array of dynamic table columns with fetchFromDynamicTable(2 args), I can't figure out how to get that into a notation where js can read it. I've tried %{let array=${fetchFromDynamicTable(2 args)}$;}% but that ends up throwing a group error. Is there anyway to get like actor.dyntable or something to put a dyntable column array into js notation?

frank gazelle
#

Is it possible to use a label button to execute a macro without sending a blank message in the chat?

raven seal
#

It does throw errors into the console though, so I assume this isn't the best solution

frank gazelle
#

Unfortunately that is still outputting a chat message as well

raven seal
#

and you replaced macroID with the ID (not the name) of the macro?

frank gazelle
#

yep

#

It does execute the macro but adds that to chat

#

and leaving the hide formula ${# }$ around it also just produces a completely blank messages

winged sequoia
#

So I have been using Custom system builder to attempt to impliment the one page rules fire fight game, and I"m having issue figuring out how to change the dice behavoir in a way that still lets me even interact with how dice are rolled by default. Curious if anyone has some wisdom i can glean to pick this all into shape

robust wren
zinc verge
#

is there a way to have a label formula count the number of objects in an item container? I'm using an item container as a spell repetoire and in the system I'm importing to CSB you can only have a total of 16 different-named spells, so I want some way to have the sheet track that so players don't have to

topaz coyote
# zinc verge is there a way to have a label formula count the number of objects in an item co...

Use an item modifier that increases a label on your actor sheet by 1 for each item. If you have multiple item containers, you'll likely need a specific item mod for spells so that the label doesn't sum all items attached to the sheet (weapons, etc)
The FAQ instructions for getting item quantities shows how to do this
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Frequently-Asked-Questions#q-i-have-an-item-container-with-inventory-items-and-i-want-to-sum-up-the-weight-of-each-item-but-sumfetchfromdynamictableinventory_container-weight-doesnt-work

formal goblet
formal goblet
winged sequoia
# robust wren you mean, that it looks like that?

Correct I've subverted it through just creating my own chat out put given the modifier effects each dice roll, but nat 1's and 6's ignore modifiers. Making it able to display successes and fails at the same time in the format would be useful

robust wren
#

have to plit it cause text length

${#Art:='Schicksalsprobe'}$
${#modifier:=ref('KK')}$
${#?{Erschwernis|0}}$
${#roll1:=[1d10%10]}$
${#roll2:=[1d10%10]}$
#
<div class="message-content">
//here is the Title (1)
<h3>${!check_type}$ erschwert um ${!Erschwernis}$</h3>
        <div class="dice-roll">
        
    <div class="dice-result">
        <div class="dice-formula">
        //here is the dice Formula (2)
        ${! (equalText(ref('Art'), 'Probe')) ? '1d10' : '2d10' }$
        </div>
        <div class="dice-tooltip">
    <section class="tooltip-part">
        <div class="dice">
            <header class="part-header flexrow">
                <span class="part-formula">
                //part Formula (3)
                ${! (equalText(ref('Art'), 'Probe')) ? '1d10' : '2d10' }$</span>
                
                <span class="part-total">
                //part total (4)
                ${! (equalText(ref('Art'), 'Probe')) ? roll1 : roll1 + roll2 }$</span>
            </header>
            <ol class="dice-rolls">
                //different dices, make sure to put them correct into the css e.g. "<li class=\"roll die d10\">', string(roll1), '</li>" (5)
                Probe unter ${!modifier - Erschwernis}$ <br>
                ${!equalText(ref('Art'), 'Probe') ? concat('<li class=\"roll die d10\">', string(roll1), '</li>') : concat('<li class=\"roll die d10\">', string(roll1), '</li>', '<li class=\"roll die d10\">', string(roll2), '</li>')}$ 
            </ol>
        </div>
    </section>
</div>

        <h4 class="dice-total">
        //dice total again (6)
        ${! (equalText(ref('Art'), 'Probe')) ? roll1 : roll1 + roll2 }$</h4>
    </div>
</div>
#
//Some Text after the dice roll (7)
${!(equalText(ref('Art'), 'Probe')) ? (roll1 <= (ref('modifier')- ref('Erschwernis')) ? '<p style=\"color: green; font-weight: bold; font-size: 2em; border-radius: 10px;\">Erfolg! </p>' : '<p style=\"color: red; font-weight: bold; font-size: 2em;\">Fehlschlag!</p>' ) : ''}$ 

${!(equalText(ref('Art'), 'Schicksalsprobe')) ? ((roll1 + roll2) <= (ref('modifier') - ref('Erschwernis')) ? '<p style=\"color: green; font-weight: bold; font-size: 2em;\">Erfolg! </p>' : '<p style=\"color: red; font-weight: bold; font-size: 2em;\">Fehlschlag!</p>' ) : ''}$ 
    </div>```
winged sequoia
#

Is my or less my cludgy slolution, and was hoping to be able to format it into the roll style if this helps with clarity

if(!token) return ui.notifications.info("no token selected");
const target = Array.from(game.user.targets)[0];
let r;
let dice = [];
let mod;
let critFail = 0;
let critSucc = 0;
let fail = 0;
let succ = 0;
let type;
let rt;

let qual = token.actor.system.props.Quality;
let def = token.actor.system.props.Defense;
let myDialog = await new Dialog({
 title: "Dice Roll",
 content: `<form>
 <div>
    <input type="radio" id="attack" name="type"/>
    <label for="attack" checked>Attack</label>
    <input type="radio" id="defense" name="type"/>
    <label for="defense">Defense</label>
  </div>
 <label for="dnum">Number of dice:</label><br>
<input type="number" id="dnum" name="dnum" value=0 ><br>
 <label for="dmod">Dice Modifier(Default: 0):</label><br>
<input type="number" id="dmod" name="dmod" value=0 ><br>
 </form>`,
 buttons: {
  enter: {label: "Enter", callback: () => {Dice(dnum.value,dmod.value,attack,defense)}},
 },
 default: 'enter',
}).render(true);

function Dice(dnum,dmod,attack,defense){
r = new Roll(dnum+"d6+"+dmod);
r.roll(aysnc=false);
console.log(attack.checked);
console.log(defense.checked);
if(attack.checked == true){
 type = qual;
 rt = "Attack"
}
else if(defense.checked == true){
 type = def;
 rt = "Defense"
}
y = r.dice[0].results;
mod = r.terms[2].number;
y.forEach(myEval);
function myEval(value) {
 dice[dice.length]=(value.result);
 if(value.result == 1){
  critFail++
 }
 else if(value.result == 6) {
  critSucc++
 }
 else if(value.result >= (qual - mod)) {
  succ++
 }
 else {
  fail++
}

 
}
let chat = rt+" Dice Roll Results: " + dice.toString();
chat = chat +"<br>" +(critSucc + " Nat 6's<br>" + succ + " Successes<br>" + fail + " Fails<br>" + critFail + " Nat 1's").toString();
ChatMessage.create({
 content: chat
});
console.log( critSucc + " Nat 6's\n" + succ + " Successes\n" + fail + " Fails\n" + critFail + " Nat 0's");
}
robust wren
#

okay, so you are using a macro, my example is directly in the label roll message

winged sequoia
#

at least as far as I could figure out it was the easiest way to get this behavoir, unless i'm mis understnading

#

I could be wrong though. That was the results of me having to refigure out javascript for the second time and cludging my way through foundries at times at least for me hard to parse api for 12 hours.

robust wren
#

i am no expoert in macro, but as far i understand this, this is the art generating the Chat message:

let myDialog = await new Dialog({
 title: "Dice Roll",
 content: `<form>
 <div>
    <input type="radio" id="attack" name="type"/>
    <label for="attack" checked>Attack</label>
    <input type="radio" id="defense" name="type"/>
    <label for="defense">Defense</label>
  </div>
 <label for="dnum">Number of dice:</label><br>
<input type="number" id="dnum" name="dnum" value=0 ><br>
 <label for="dmod">Dice Modifier(Default: 0):</label><br>
<input type="number" id="dmod" name="dmod" value=0 ><br>
 </form>`,
 buttons: {
  enter: {label: "Enter", callback: () => {Dice(dnum.value,dmod.value,attack,defense)}},
 },
 default: 'enter',
}).render(true);```
#

so you have to modify this part, with the code i gave you. I think that should work. But make sure to Backup your current template or work on a copy.

winged sequoia
#

^ ye i've been doing this just for satfy when trying out various bits of new data I've learned. I'll when I have some time see what I can do.

robust wren
#

oh nope, i made a mistake, the part i marked is for a popout asking for input 😄

winged sequoia
#

I mean I noticed that, but I figured the data that was relevent could still be used just in the different form.

static zephyr
#

I got confused because 4.2.1 of the docs says fetchFromDynamicTable('equipment', 'weight') : Will return a Matrix containing all the weights from the Dynamic Table equipment, here : [50, 2, 30]

formal goblet
static zephyr
#

That's cool. I appreciate your explanation. When I get this working I'll post it for posterity.

#

Is there anyway to get the array of possibilities of a dynamic table dropdown in js?

formal goblet
static zephyr
#

This code is to find an "alternate" skill to use a weapon, so that someone could use a pistol if they have no pistol skill but they have automatics in SR4 ```%{let string ='${fetchFromDynamicTable('active_dyntable','skill')}$';
let array1=string.split(',');
let array2=['Firearms Group','Automatics','Archery','Exotic Ranged','Heavy Weapons','Longarms','Pistols','Throwing Weapons','Gunnery'];

let filteredArray = array2.filter(value => array1.includes(value));

return filteredArray;
}%```

array 1 is the available skills that someone has, while array 2 are all the ranged weapons skills.

thin leaf
#

Hi! I have the following issue. I have a hidden attribute called "complexity" on my sheet with a default value of 0. I have an item that needs to increase that value from 0 to 1 the first time it is adquired, but never again. I am trying to use the following formula on an item modifier: ${ complexity < 1 ? 1 : 0 }$, but if equip copies of the same item, it still adds 1 every time. How can I make a formula that only increases the number once?

formal goblet
thin leaf
#

I can't do that because other items need to be able to increase it past 1

formal goblet
static zephyr
#

If I had to do that, I would make each item have it's own 0 to 1, and then I would add up all the item 1s to get the final number.

#

Like on the character, I'd ahve a thing that says "has he ever seen complex_item 1" 0 or 1, then set it to one

#

It would be lame if you have alot of items.

formal goblet
#

I´d assign the set-operations a higher priority (lower number), so the add-operations are done after the set-operations.

thin leaf
thin leaf
tiny hinge
#

I am trying to assign the name of targeted tokens on the canvas via something like this.

${#target:= @{target|name} }$

#

but that doesnt actually work, returns ERROR in caps

#

how do i go about this problem?

#

@{target|name} do however work though outside of the csb code

dusky mauve
#

Why User able change modifier of the item in item container?
And can I block adding/deleting items for user (Allow it only for master or assistant GM)?

tiny hinge
#

under configure ownership see if that helps

dusky mauve
#

So user must be only Observer and lower of the Actor

#

But for observer user can't add items to dynamic table - only Owner can do that

#

and we have collision here) I set user to be able add custom items to dynamic table -> Owner
and it will be able change item modifiers in item container

it look like permission collision for me and logic issue
OR item container must have same option - allow to change ...
OR dynamic table must allow observers add items

for now such inputs has not the same type of permissions

dusky mauve
#

So it will be in future - when it's time will come? 🙂

tiny hinge
#

how do i remove these wrapper text? I can use !string in some instances but it causes error in longer scripts.

winged sequoia
zinc verge
#

so I have this formula
${CURSE_check==true?floor([:MAG:d:CURSE_base:+:CURSE_multipliedmag:+:CURSE_additive:]):'no post'}$
in a label roll message which is supposed to only roll if the checkbox CURSE_check == true.

Where the formula says 'no post' at the end, what do I need to actually put there to make the formula not post anything to the chat in the case of a false result in the checkbox?

formal goblet
raven seal
formal goblet
#

true == true is true after all 😅

raven seal
zinc verge
#

Even though it’s a checkbox?

zinc verge
raven seal
#

I mentioned this earlier, it throws an error into console but doesn't actually create the message

formal goblet
raven seal
#

I assume this is because I have a script that doesn't actually return anything?

formal goblet
#

Have you updated to 2.4.0?

raven seal
#

no I'm on 2.3.1

formal goblet
#

Well, that's fixed in 2.4.0 😂

raven seal
#

lol, I know it's messy but it does at least accomplish what I want for my use case

formal goblet
#

You cannot really rely on unintended behavior. And errors are most of the time unintended.

#

So expect fixes to come

raven seal
#

yeah, I made sure to thumbs up that feature request so I can do this properly whenever that gets implemented

formal goblet
#

I think that shouldn't be too hard to implement and I can understand the need for that after we've introduced setPropertyInEntity()

dire socket
#

Hello, I updated, and this error comes up whenever I attempt to add a new component to my sheet. It is, just a tad inconvnient, but a solution of some kind would be greatly apprecaited

tiny hinge
#

can you use sameRow() to get values of labels in a dynamic table?

dire socket
#

yes

tiny hinge
#

ah cant retrieve label value if the label value is also generated on run time

#

found the issue

#

thanks

winged sequoia
#

This is probably a stuipd question, but how do I get the value of a formula of an active effect?

robust wren
zinc verge
#

aighty, what am I doing wrong here? 🥴
trying to get the roll message to post my roll result in a, "Success! [roll result]/100%" and it seems to recognize that "ROLL" = the roll, but then doesn't want to put that roll in the result statement 🤔

${ROLL>MAG?concat(' Failed! ',ROLL,'/100%'):concat(' Success! ',PERCENTAGE_final, '/100%')}$```
zinc verge
#

it seems from the best I can tell like it just doesn't like when I try to reuse formula results specifically in a concat() formula

tiny hinge
#

not really sure what's going on but it seems like for labels, once I start initiating more variables, the label display starts showing weirdly. am I using the label wrongly or in an unintended way? all subsequent data is an incremental of extreme0 e.g extreme1 , extreme2 ...etc

#

when i use 1 less variable initiation it works

#

it gets all jumbled up when i put in my full formula

normal ore
#

Hello everyone, how are you doing? I started using the Custom System Builder not long ago, after the lack of updates to the Sandbox. However, I have a few questions. In the Sandbox, I could use items like consumables, meaning that when I used the item, it would update the attributes it was supposed to update and be removed from my character sheet. Is it possible to do this in the Custom System Builder as well?

formal goblet
normal ore
normal ore
formal goblet
normal ore
#

"Sorry for my English coming from GPT, I'm Brazilian lol!"

formal goblet
brave trench
#

I just updated to 2.4 and now a script wants to send "undefined" to chat while before it was quiet. What changed? How can I fix?

formal goblet
tiny hinge
tiny hinge
brave trench
formal goblet
tiny hinge
#

If you use the script to do some stuff (for me is resetting roll tables after randomly picking attack targets), it will return undefined in that chat which you can't really modify.

tiny hinge
#

Not sure if that helps

#

For context I guess random targeting while I do an attack roll. So it's part of the chat card. The undefined looks out of place in it.

tiny hinge
formal goblet
brave trench
scarlet skiff
formal goblet
normal ore
scarlet skiff
#

this only deletes the item you execute the script on. so if you put it on an actor the base item stays. if you open the item from the side bar and click it you delete the item from the sidebar

normal ore
formal goblet
normal ore
#

@formal goblet , @scarlet skiff
Thank you very much. You guys are amazing!!!

robust wren
#

someone here, who can explain a bit to me, how the additionals css works? for example how i can change the background Color of a tabbed panel? i have never worked with html or css, but i am willing to teach it myself if i roughly knew, what i have to do.
do i just have to do something like this (i used ChatGPT), name it like test.css and just put test.css in the field additional CSS classes?

body {
   font-family: Arial, sans-serif;
   background-color: #f0f0f0;
}```
brave trench
formal goblet
vagrant hollow
# robust wren someone here, who can explain a bit to me, how the additionals css works? for ex...

In the „Additional CSS classes“ field you just set a new class for the CSS file from your the CSB settings.

Example: In „Additional CSS classes“ place “mytabpanel”. Create a “test.css” file in your Foundry Data folder. Open this file with a texteditor and ad

.mytabpanel { background-color: #f0f0f0; }

to it. Head to your CSB settings and ad “test.css” into the “CSS Style file” field (databrowser does not work here). Now you have to reload your gameworld for the CSS file to take effect.

tiny hinge
#

just that

brave trench
#

i haven't had any luck getting html to work in chat short of creating rows/columns. Is that because the syntax is different? Online it just says <tr width="100%"> but your syntax looks like it might be interacting with css?

tiny hinge
#

tr is table row

#

div is like an invisible section and yeah its html

#

it should work

#

most of the stuff in csb allows html and css manipulation even the labels i can put a table in it

brave trench
#

yeah i know, sorry, I'm just speaking in general, that when I try to adjust tag properties for my chat it does nothing. Like I'm missing something

robust wren
robust wren
tiny hinge
#

i suspect it might be because of overriding css styles. best way to do it is actually to inspect the chat to see whether your class styles are applying

vagrant hollow
tiny hinge
#

css styles should work tho

brave trench
tiny hinge
#

i know

#

and i agree lol

vagrant hollow
robust wren
vagrant hollow
normal basin
#

Checked in here, saw that an update came out for CSB and hoped that it solved the problem of health and damage not really 100% working but it unfortunately didn't, was it supposed to fix that?

scarlet skiff
normal basin
# scarlet skiff Why isnt it working for you?

I have no idea, no errors show up when attempting to mess with it or anything, damage just stops working after working maybe once sometimes twice, if that but Martin said that it was some sort of bug so I was hoping that it might have been squashed in the most recent update but it seems like it wasn't

dense pine
#

Radio Buttons in Dynamic Table behave strange: The last row is automatically activated. Even is i select a different row, after a refresh it jumpf to the last row gain. Is there a way to prevent that? It want it to stay where i selected.

fierce harbor
cosmic karma
#

hello. First of all, Thanks for the CSB @brittle moth .

#

now my question for everyone. is there a way to create custom checkboxes? i'm trying all kinds of tricks and nothing seems to work

#

I'm pretty happy wit how the Household system in going, but custom checkboxes would add that 'fingers kiss' finishing touch...

fierce harbor
cosmic karma
#

Hi. Purely cosmetic. Want to change the art / elements that build a checkbox. There is a lot of tricks to do this with css but I cannot land anyone of them correctly...

#

thi is the original sheet, for example:

fierce harbor
#

I see. Sorry to say that's not exactly my field 🤷🏻‍♂️

cosmic karma
#

as it is right now I'm fully capable of playing. But as a personal preference I like to have sheets that add flavor...

cosmic karma
fierce harbor
cosmic karma
#

I started with CBS this weekend and as soon as it clicked t made all the difference. 😄

vagrant hollow
dire socket
#

If you have any information on how to do literally any of this, I would love to know if you're able to share.

cosmic karma
#

I have something like this right now...

.heart-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.heart-checkbox input[type="checkbox"] {
  display: none;
}

.heart-checkbox label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-image: url('artwork/Household/sheet/heart.svg');
  background-size: cover;
  margin-right: 10px;
}

.heart-checkbox input[type="checkbox"]:checked + label {
  background-image: url('artwork/Household/sheet/heart-filled.svg');
}```
#

tried also with content instead of images and nothing...

dire socket
#

Oooo

#

Thank you

cosmic karma
#

what I just discovered is that for the trick of using labels as checkboxes (customizing checkboxes are in general always doing this) the label needs no be AFTER the input element. And apparently CSB creates it after (I used a empty space in the label name to force the creation of a label):

normal ore
#

Can I include items from the spreadsheet in the dropdown list? I'm trying to do this using a pivot table, but I think I didn't quite understand it!

sharp geyser
normal ore
sharp geyser
#

Should be able to do it via an option on the Dropdown list.

#

However, trying to do it myself, I believe the Dynamic Table needs to be attached to the actor.

normal ore
#

What am I doing wrong?

sharp geyser
#

Can I see what the template looks like with the dynamic table on it?

sharp geyser
#

Uhh... The template with the Dynamic Table on it :)

normal ore
sharp geyser
#

Hmm... Try without the item container having the same key as the column?

normal ore
sharp geyser
#

I have no clue :( I've been experiencing a similar issue

karmic shell
#

Can we add borders to Custom System Builder character sheets? I'm trying to figure out ways to divide the CS more. Make it easier to find info you need as a player.

static zephyr
#

I think the idea is to use borders in your css files.

karmic shell
#

How do I do that? Like what do I even open up to edit?

fading rover
# normal ore Nothing!

Can you tag me a solution if you happen to work this out, please? I'm trying to solve the same issue.

static zephyr
#

I haven't done it myself yet, it just mentions it in 8.4 of the CSB docs.

latent sorrel
static zephyr
#

Is there a way to break out of a roll early, like, I have several rolls in a row, but half way in there's a condition where I can stop if a certain amount of success hasn't occured. Is there a command to stop a roll message mid-way?

static zephyr
#

I think I may have found a bug? I set net_hits, then I add to it using net_hits= net_hits + stuff, but then later in the roll message, it reverts back to the first value.

formal goblet
static zephyr
#

But it worked for the 14?

#

I'm not arguing. I'm just confused why it worked a little bit, that threw me off.

formal goblet
#

I don't even know how that should even work 😅

static zephyr
#

I'll think of another way to do it. You can't use := in a ternary, I don't think. I errored out alot figuring that out.

formal goblet
formal goblet
static zephyr
#

Excellent! Thank you. I tried all my attempts to the right of the "?"

normal ore
winged sequoia
#

so i've created a custom active effect using a world script, and after 3 or 4 times reading through the read me. I'm still at at a complete loss as to how the modifiers can be used at all. I'm under the understanding that you can't modify a num or input feilds without the use of a secondary modifier or speical key for it. but when i've used the set to a static value, and try to add the two together nothing even winds up occuring.

formal goblet
winged sequoia
#

I'm more or less just wanting a flag that signifies that they have done their turn, or one for a stun that they have lost their turn. Albiet using the same flag in the back ground given function makes sense.

winged sequoia
#

I'm slowly getting this, but currently can't seem to get the key from the active effect to do anything to this new lable

winged sequoia
#

I can at least get lable's to use the formulas but activating a value from an effect just seems off the table unless i'm just trying to access it improperly

sharp geyser
winged sequoia
sharp geyser
#

So could you reiterate what your idea is so I can try and help (If I can :x)

winged sequoia
#

More or less I'm setting up an active effect as a visual indicator if it has taken it's turn for a round, and after deliberation a seperate one for being stunned which is pretty much loosing its next activation(turn)

#

Kinda just want a binary true, false bool that I can pull in other macro's and potentially an initiative tracker if I can get that to set up

sharp geyser
#

Will it be possible to be 'stunned' for more than 1 turn?

winged sequoia
#

no

#

The state that triggers it either leads to instant death, or being stunned as the better of the 2 outcomes

sharp geyser
#

And this is the result of an attack?

winged sequoia
#

sort of?

#

IT is the result of being hit, and then failing a defense save. and if for each 1 of those failed it accumilates a stack that increases the likely hood of death

sharp geyser
#

Mkay

winged sequoia
#

for most things it is 1d6+1(or number of to use the game term wounds) 6+ is dead below stunned

sharp geyser
#

Ah, good ole wounds system :)

#

I don't understand it lmao

#

But:

#

I believe you're going to need to familiarise yourself with the fetchFromActor() to tell the system which actor is going to be stunned, this would work in unisen with the attack roll.
setPropertyInEntity() (for setting the stun value)

#

If you have a button which already acts as a sort of "End Turn" button, you could make that 'disable' Stun when it's pressed.

winged sequoia
#

I mean I'm pretty much implimenting onepagerules GrimDark Firefight in custom system builder

#

if you want context for what i'm setting up

sharp geyser
#

Oh idk what either of those are haha

#

I'm quite basic.

winged sequoia
#

valid valid

#

I've yet to set up any inititive system. at the current i've seen up a macro that forces foundries dice to do what I desire

sharp geyser
#

For me I have no issue with formulas, but, I'm not a coder like most of the other exceptional people who use CSB. The closest I get to 'coding' is actually Google Spreadsheets lmao.

winged sequoia
#

I have a basic of code knowkedge, just 0 html, and css, along with lite javascript experience

sharp geyser
#

You've got more coding knowledge than I do haha.

#

So you'll be able to do wonders with CSB, I don't doubt.

winged sequoia
#
if(!token) return ui.notifications.info("no token selected");
const target = Array.from(game.user.targets)[0];
let r;
let dice = [];
let mod;
let critFail = 0;
let critSucc = 0;
let fail = 0;
let succ = 0;
let type;
let rt;

let qual = token.actor.system.props.Quality;
let def = token.actor.system.props.Defense;
let myDialog = await new Dialog({
 title: "Dice Roll",
 content: `<form>
 <div>
    <input type="radio" id="attack" name="type"/>
    <label for="attack" checked>Attack</label>
    <input type="radio" id="defense" name="type"/>
    <label for="defense">Defense</label>
  </div>
 <label for="dnum">Number of dice:</label><br>
<input type="number" id="dnum" name="dnum" value=0 ><br>
 <label for="dmod">Dice Modifier(Default: 0):</label><br>
<input type="number" id="dmod" name="dmod" value=0 ><br>
 </form>`,
 buttons: {
  enter: {label: "Enter", callback: () => {Dice(dnum.value,dmod.value,attack,defense)}},
 },
 default: 'enter',
}).render(true);

function Dice(dnum,dmod,attack,defense){
r = new Roll(dnum+"d6+"+dmod);
r.roll(aysnc=false);
console.log(attack.checked);
console.log(defense.checked);
if(attack.checked == true){
 type = qual;
 rt = "Attack"
}
else if(defense.checked == true){
 type = def;
 rt = "Defense"
}
y = r.dice[0].results;
mod = r.terms[2].number;
y.forEach(myEval);
function myEval(value) {
 dice[dice.length]=(value.result);
 if(value.result == 1){
  critFail++
 }
 else if(value.result == 6) {
  critSucc++
 }
 else if(value.result >= (qual - mod)) {
  succ++
 }
 else {
  fail++
}

 
}
let chat = rt+" Dice Roll Results: " + dice.toString();
chat = chat +"<br>" +(critSucc + " Nat 6's<br>" + succ + " Successes<br>" + fail + " Fails<br>" + critFail + " Nat 1's").toString();
ChatMessage.create({
 content: chat
});
console.log( critSucc + " Nat 6's\n" + succ + " Successes\n" + fail + " Fails\n" + critFail + " Nat 0's");
}
#

was about 12 hours of me hitting my head against a wall figuring out how all of this worked

sharp geyser
winged sequoia
#

I have yet to mess with those

sharp geyser
#

They're incredible

#

But I'm unfortunately retarded

#

All the time I spent on them, I wasn't using them how they were going to work in the slightest >_>"

winged sequoia
#

weird

#

fetching from actor is either showing up as not a function, or returning undefined

sharp geyser
winged sequoia
#

oh that's a sheet command not something from foundry

#

I was just doing an idle

#

pull this macro to see what info I get from the function

sharp geyser
#

Ah

winged sequoia
#

oh yes

#

progress has been made

vagrant hollow
# cosmic karma would love to try. Can you share?

Sure, here it is:

.sheet input[type="checkbox"] {
    -webkit-appearance: initial;
    appearance: initial;
    background: #fff;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border-radius: 7px;
    outline: 1px solid #000;
    cursor: pointer;
}

.sheet input[type="checkbox"]:checked {
    background: #71cafb !important;
    border: 2px solid #fff !important;
    -webkit-filter: none !important;
 }

Good luck

winged sequoia
#

I've figured out how to pull and computer formulas in a macro, but still can't get the active effect to effect the hidden attribute

#

which is being a pain

cosmic karma
scarlet skiff
cosmic karma
#

@vagrant hollow yeah, you did put in the right track! Thanks again!

vagrant hollow
cosmic karma
#

all your code practically, the most important information was the .sheet class. This is for the butterfly checkbox for example, the same for all others. I just added my custom class (decorum in this case) to the Additional CSS classes in the advanced part of the component in the template

.sheet .decorum input[type="checkbox"] {
    -webkit-appearance: initial;
    appearance: initial;
    background: url(artwork/Household/sheet/butterfly.svg);
    background-repeat: no-repeat;
    background-size: cover;
    flex: 0 0 27px;
    width: 27px;
    height: 22px;
    cursor: pointer;
    transform: scale(1.5);
}

.sheet .decorum input[type="checkbox"]:checked {
    background: url(artwork/Household/sheet/butterfly-filled.svg) !important;
    -webkit-filter: none !important;
    background-repeat: no-repeat;
    background-size: cover;
}
vagrant hollow
lofty lintel
#

I am currently getting some experience with CSB. And I am stuck at calling a macro with an argument/parameter. My Macro is working and for simplicity let'S assume it is called "Testmacro" and its code is ```JS

let param1="This is a test";
console.log (param1);

#

I want to call this macro with a parameter param1 which should be according to documentation something like this from an actor sheet:

#

%{game.macros.getName('Testmacro').execute({param1: 'This is other text'})}%

#

How do I pass that param1 into the macro?

#

I am able to call the macro. The macro it self runs. I should know how to pass the param1 from CSB but I do not know how I need to adjust my macro to receive the param1

robust wren
robust wren
lofty lintel
robust wren
lofty lintel
#

Actually the text is just an example. I will pass a string with informations which I will parse/slice in the macro.

scarlet skiff
#

and of course you dont need the first line

lofty lintel
#

Thats how it looks like with that setup. Also no output of 'MU'

scarlet skiff
#

hmm

#

did you put the macro in script macro mode?

lofty lintel
#

Yes

scarlet skiff
#

for me it works

lofty lintel
#

Hmm .. 11.305 and CSB 2.3.1 maybe I need to make the upgrade step?

winged sequoia
#

I have tried variosu different set ups with this to little effect

scarlet skiff
#

im on this

lofty lintel