#Custom System Builder
1 messages · Page 11 of 1
${item.name}$
Bet thank you!!
So you’ve got it set up to reference the attack’s target and declare in the roll message if the attack succeeded or not, huh?
Will be doing yes :)
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.
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.
Is basically what I was going for, but the issue I have with tables in general is that it takes a significant time to re-arrange them. I may well change how I've set this up in the future if I change something (OCD brain likes to alphabetise lol)
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.
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
While I've got you though;
I'm thinking of using a Dynamic Table for tracking XP thresholds for levels? Good idea or no?
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?
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.
I don't think you'd need all that extra stuff? For mine, I just referrenced a property on the actor called "Sequence"
There's an initiative blank in the configuration settings for the system builder, so are you doing something in addition to messing with that?
Hmm 🤔 the initiative roller doesn’t do anything at all when I just do [1d20+<key>]
Nah that’s what I’m messing with specifically
[1d20]+<key> should work?
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.
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
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?
Not really, initiative is just how we determine turn order to begin with so automating that first step is comfy
For my, I took inspiration from Fallout 1 & 2, where your 'initiative' order is just determined by your sequence. In the event of a tie, I guess I'll make enemies go first. Or players, depending on the circumstance.
Plus it also adds more consistency to combat if you know that you're before (or after) one of your teammates.
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.
I do like the idea of AP ammo, but I wasn't able to put items inside containers of item templates. Would've been really nice to be able to do it that way.
I may just have to have an extra space on the table where weapons are for ammo and their sub-types.
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.
I do need to make dynamic tables strictly for referrence because I know in the long run it's going to kill me lol
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.
isn't there a confirm delete checkbox in the options for dynamic tables?
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.
I think that's on the 'player' side of things. Just tried it on a defunct dynamic table I had.
Forgot to refresh the template 🤦♂️
I want the Dropdown menu on the "Skills" table to utilise the "Total" from the SPECIAL table. How do I do that? >_>;
DynamicTable explainations are ... Unfortunately too complicated for my smoothbrain.
(Realised I replied to an unrelated thing just now. Damn it)
I think it is sameRow(dyntabname,totcol,skillcol,skillname)
but I'm checking.
Godspeed! :)
Not sameRow but fetchFromDynamicTable, same args
It should be the skill selected in the Skill table dropdown, if I understand correctly
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.
Yes, basically. The red section gives you a reference skill to use in the yellow (it's yellow, isn't it 😅) section to retrieve the total you need displayed in the blue area.
It is a tad tricky, but with a few hundred cycles of trial-and-error you get the hang of it 😂😉
Please, elaborate 😁
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
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?
Had a similar issue yesterday, I think someone pointed out that they need to be encased in ${ and }$
So you need to double up the existing stuff which was on the document for some weird reason
Right. Same thing I worked out I had to do on my item container damage roller
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.
Thats what i do Right now, But thx!
Literally me trying to do a simple thing with Dynamic Tables :|
Let's see...
When you select, say, STR as Stat in Skill Table you use that like this:
fetchFromDynamicTable(<tableKey>,'SPECIAL Total','SPECIAL','Stat').
That should work.
If Skill Table is a DynTab too, it is:
fetchFromDynamicTable(<tableKey>,'SPECIAL Total','SPECIAL',sameRow('Stat').
Edit: sry, my bad
Hmmm, what is the setup for those labes up there?
Can you post the template of that table?
Ok ty. If you please could post Base and Max setup that would be great 😉
I think you need ' ' around tableSpecial
😢
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 :|
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
I know they're going to be great if and when I figure this nightmare out, but ... My god. The feeling of ineptitude I'm experiencing right now is next level.
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
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.
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 😉
I'll die of old age before I figure this out
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 😉
Nah, trust yourself
It's all good if it gets you where you want 😉
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.
If I'm not mistaken, it is 'sameRow("Stat")' .
Cannot test it and my memory dies not help 😅
I mean it was better than me going in curcles
Is \n still the “new line” character for strings in CSB?
As in to do this?
String1
String2
Correct
I've never used but, have used <p> and </p> on start and ends of lines.
<br> also works
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)}$
Screenshot?
NP
so where it says "Frei Type: Nuclear"
I'd like it to go
"Frei
Type: Nuclear"
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
${concat(<p>ITEM_name</p>,'Type: ',SPELL_type)}$ like this more or less?
exactly
it returned an error 😅
doesn't seem to have affected anything. I think that only controls the size of the component within the template
I pressed enter too early
But, you could also do something like this:
Item: ${(I TEM_name}$
Type: ${SPELL_type)}$
oh huh, I'll try that rq
wait
I fucked it L}
:|*
fixed
Meanwhile I've made two pieces of paper to try and solve this fucking dynamic table idiocy
ah it just makes them separate boxes. That makes sense tho
And it isn't goddamned working
Conclusion: DynamicTables are made by satan
2.5hrs wasted by circling the DynamicTable drain
i think you need the html as extra text so more like this?
``{concat(ITEM_name,'<br>','Type: ',SPELL_type)}$`
don't know if this works please try it
Returned as an error
Break them up into two different functions using ${}$ and place <br> between them
Now if only I could get this stupid function to work
What is your last formula attempt?
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 :|
But you found out 😉
${getRefFromDynamicTable('tableSpecial','tableSpecialTotal', 'tableSpecialName', string(sameRow('tableSkill200')))}$ See this looks like it should work, but it absolutely is not
If I knew I didn't need dynamic tables so much, I would have given up on this.
HALLELUJAH
THERE IS A GOD
Why getRef and not fetchFromDynamicTable?
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
i am reminded why my sheet is so bare-bones 😅
Honestly I don't blame you.
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 🤷♂️
I'm clearly the opposite lmao. Too much creativity but not enough technical ability lmao
By "not enough" I obviously mean non-existant
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
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)
after all CSB is great for creating a sheet with little effort - so a big thank you to the Dev's for that. 🙂
Agreed. There's absolutely no way I'd be able to do this much stuff on my own.
Did you figure this out? It'd be like ${fetchFromDynamicTable('top_dyntable', 'special_total', 'SPECIAL_COL', stat_dropdown)}$ where stat dropdown is not a string.
Yeah I got there in the end
So many things were wrong. I was using a function which hecked, and who knows what else.
I was asleep when you asked. I had just done that for my ammo select.
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.
Got that figured out also. But was good.
Ended up getting it to work exactly how I wanted :)
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.
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 :>
thanks for the welcome
No problem :)
mostly hoping to borrow a toy so I can see how experienced people think when they work with CSB
I spent 3 hours today struggling with something because I was using the wrong function 🤣
There are many examples in the sheet library on gitlab :
https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library?ref_type=heads
You can import a template a poke around with it 🙂
I designed the Warhammer FRP 4E, but there are other sheets & system you can try 🙂
Ooooh awesome
I'm too much of a monkey brain for gitlab, didn't realize there were other files there
@brittle moth Is there planned support for a 'paperdoll' system?
my head hurts from staring at the wiki so this will be a nice break
[startled in smoothbrain]
A kindred spirit haha
Martin, the resident badass, provided an example a few weeks back that I found: #1037072885044477962 message
I don't build systems myself, only the core CSB, so I can't say unless someone is building it 🙂
(Except my own systems for my games, of course)
Ah. That's fair.
And I'm far from using all the features in CSB, some of you make way better use of the capabilities than me ^^
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.
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.
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.
Items will interact with properties if they share a modifier. If you have armour which has the modifier MaxHealth, if it's put into an item container within an actor's sheet, that actor will receive the interactions said Item has with MaxHealth.
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
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.
@brittle moth What is the ideal use of Attribute bars?
Agreed with dynamic tables. They're just tricky to get initially set up.
These are meant to be used in tokens. You can define your custom bars and add them to the token, in the 'resources' tab of the token settings
As it is now, is there any functionality to use an attribute bar on an actorsheet? To display percentage of inventory (as an example)
Can you pin posts to this channel? This example of Martin's is a great example of what the system is capable of, imo. #1037072885044477962 message
You can either define your own attribute bars using formulas, or use automatically defined bars by using a number field with a max value. The second option will allow you to edit the value directly on the token.
No, that is not planned. But you can open a feature request on the GitLab to ask for it 🙂
I'd have to ask @formal goblet If he's alright with that, and repost the template with a better message to explain why it is pinned, but this is not a bad idea 🙂
Sounds like a plan lol
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.
Oh god. I just had a vietnam-style flashback to my exact stuggle with this.
So the "item containers" have filters, but those filters check the key component values within the Item.
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.
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.
I need to make a demonstration world for everyone to download, to show all the capabilities and allow people to test things out for themselves
When I had initially struggled with them, I had tried to influence the containers filters by using non-item values. I kid you not, it was something like 4 hours.
That is a tricky one, and it has to do with the way Foundry handles Items at all (just so you know, Item is the official Foundry name for it, not something I chose)
Short answer is no, you need to configure the Item Containers to show only the item you want
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
Thank you so much @sharp geyser! I'll give that a try. 🙂
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
Thanks :)
Time for sleep now though.
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?
I have nothing against it, but I want to update it a bit to have a demonstration of all features. Or even a new "tutorial-template"
You can use different templates for different types of item, this will allow use them as "PreFilter"
can drop-downs be used for rolls or do I need to use a numeric field
drop downs can be used in roll formulas so long as the keys match up
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
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)
I also would very much like to know how to do this
Instead of pc_clan == Grottan you use equalText(pc_clan, 'Grottan'). Even better would be the use of switchCase() -> switchCase(pc_clan, 'Grottan', 'Grottan-Description', 'Sifa', 'Sifa-Description', 'Nothing Selected')
ooooooooh, that's what switchcase does. OK thank you, I'm off to experiment!
nice, can switchcase just go on indefinitely? like if I had 11 dropdown tabs could one switchcase formula cover each entry?
Yep, as much as you want
excellent
Whoever uses Google-Sheet / Excel, the function does basically the same
Is there any way to determine the grid distance from a selected token to a target token?
Nope, CSB doesn´t provide that information. You´ll have to look for modules / own implementation
Thank you.
Mkay, does there need to be colons or semicolons or brackets or anything in your example? so far not working...
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);}%
Be sure you're using the key of the dropdown and not the value, I think. I believe I ran afoul of that once.
Only the quotes. And the formula-syntax ${}$ around it
ok so far this just displays 'ERROR'.
There are quotes in the sentence 😅
oh goody so I'm guessing I can't have any colons, semicolons, quotations, or other grammar in it?😆
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.
huh ok, this just applies to the quote mark or to all punctuation?
Only quotes
thank you, and sorry for the noob questions but like I said above ya'll are great. 🙏
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.
Now to add a giant text wall of different descriptions🤣
Can you wrap this in three ticks ` so it formats properly. This should be the key to the left of the 1 key.
Depending on the situation you could use items and item containers for the description :)
If you're looking to go the Item Container route.
- Allows for additional modifiers for actors to inherit such as attribute/skill bonuses
there's no way to rename the active effects in CSB currently, right?
I don’t think so but i could be wrong
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?
tbh I just have a number field set up with mine that has the + and - on it for easy editing
set a max value to the field. in FU its lvl 50 then you can retrieve it for bar usage (if thats what you want!)
I’m trying to achieve a similar thing using dynamic tables. But do you want a linear xp progression, or something that is different each level?
oh no, it's something else, just wanted to get attributeBar.char_level so I can use it for a module
not the bar, I just needed the value,
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 :)
If you need it to be referenced by external things, you can also put it in your templates "hidden attribute" and retrieve it using (If it's ${fetchFromActor('self',CharacterLevel)}$
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.
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
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. 😛
Would you like it so all checkboxes don't need to be selected to roll the d8?
(off-topic)
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.
(Doing some figuring out to get it to work, gimme a moment :)
Out of curiousity, what's the far left one?
the little running man?
oh that's the desparation one
Is it s d3 or d2?
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
what exactly is a radio button?
Think of them as part of a 'group' of checkboxes, but only one of them can be active
can you have a 'group' of 1? and how do you reset it on the sheet to be unchecked?
just hypothetical
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
hehe
I may need to work on it more whoops
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
Big mood haha
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
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 😛
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
nope just 8, 6, 4....
no worries I'm in no hurry, gotta go to bed soon anyway and I'll see msgs in the moring 🙂
Heck it
Oh I'm going to work on my own stuff, but you're happy enough with the radio buttons, right? :)
Trying to figure out the roll stuff for some things, when there's a lot of math involved can be problematic :(
indeed
I tried haha.
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?
Post the function?
One sec, loading discord on my desktop
${setPropertyInEntity('self','HP_current','HP_max')}$
putting it in a roll message makes my current health number field read [object Object]
That may be because of a shared key component?
huh, lemme check
wait is that possible? don't all key components have to be unique per template?
They do, but you can copy keys accidently when you control+drag something
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
I think that's the most frustrating part, needing a place to see if it's broken or not, only to discover that the 'type' of thing you're testing it on (ie, label) isn't compatible with the thing you're trying to referrence in.
I'm honestly staring at this documentation stuff for Dynamic Tables and it's making my stupid head spin
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.
maybe try it with: "ref('FiringMode') + 1"
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
work again? Made a backup?
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.
maybe LinkedFluush has an idea. i never worked with setPropertyInEntity
i could give you a macro, that does the job, if needed 😄
I'll take it haha
Honestly, it's going to save a lot of headache
This is my current Sisyphus-tier endeavour
Fixed it
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;
};```
My god that felt like I honestly didn't change anything
i know that feeling 😄
(RE: dynamic table)
I guess it must've sensed my frustration and decided to stop trolling me
I've never used macros, where do I put the macro? lmao
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
klick on one of those. then name the macro, change type into script and paste the macro in. Save it
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;
};```
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.
This will not do anything because you dont Update the value. So this might Work as a temporary Change but doesnt save the new value
ah, yes you are right. it works for me because it is not a problem for what i was using it.
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
Likely what was causing the error I was seeing :x
I think I'll try andfigure it out using CSB stuff so I can troubleshoot and figure other stuff out
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
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
Dynamic tables are actually the devil in terms of trying to figure them out
I'm trying to get better with then, but I can't help if you're intending to get the infomation from a source not within the table.
If it's in the same table, you can use ${sameRow(<column name>)}$ and it should be good to go.
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)
Oh thats very pretty, mind if I ask how you're doing it and what assets you're using?
I believe they're using font awesome icons?
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?
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
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.
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.
I don´t think so
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.
We are listing them here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/home#tips-and-tricks
If you want to add some, open a ticket in GitLab
an issues ticket? or is there a different one somewhere? I haven't really explored git lab, don't know my way around.
Yep
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.
The same way you do it in Discord: https://www.remote.tools/remote-work/discord-text-formatting (Multi line code blocks)
A complete guide on Discord text formatting, right from how to bold, Italicize, strikethrough and underline on Discord to advanced coloring options.
ayyyy it looks like the item sizes have been fixed in the item containers!
Do you mean for the beta? Because for the normal version it is not released yet.
normal version of what? CSB?
Yeah, CSB
I'm a lil confused lol. I was just in my foundry and I noticed the items were small and clean again
Well. That wasn´t me 😅
Yo guys, I´m done with the Example-Template. You can download it here for the time: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads Once it is released, you´ll find it in the regular Sheet-Library. I´ll try to keep it maintained when new features are added.
yes sorry for late reply, but it is what others said. My exact formula for the blue d8 is this pic -- making it blue, slightly bigger than default and moving it to the left so it's not right on top of the number.
Only thing i could suggest is maybe try grouping all the dice within a panel and changing the alignment of said panel to justify? :s
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?
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.
You could handle this automatically. I had a similar formula made for this exact thing.
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."
Are the defences used named after the attacks/elements?
Like Melee vs MeleeDefence?
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.
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)%}$
Thanks! I'll end up using that method for sure.
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
Yeah, getting some javascript in one the first time yesterday took me a long time, because I also suck at js.
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
which cell are you trying to make it point at in the bottom picture?
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.
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
Oh, so you want like an if-then that only shows certain attacks and puts them in order based on a dropdown?
Well, I don't want a dropdown at all lol
Oh.
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 :)
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.
Doesn't sound impossible, but would be a lot of screwing around I'd imagine?
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.
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.
Can you make the button say 1, 2, 3, 4 independently of anything else?
Well, the button is using "Switch" as its display variable
But I don't need it to be
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.
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
Check the console for warnings, there might be uncomputed props
Btw, this translates into: "Get me AttackMode in WeaponSheet where Order equals CostAP"
Could you update the dynamic table documentation to reflect that? I honestly keep struggling with this even though it’s so basic
There is already an example-table with some queries in the doc.
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)
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().
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
Do you need the stats outside of the Container?
Yes :(
Well, Item Modifiers it is then. No other way around it if you don't want to use Scripts.
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
Not really if you define 2 separate modifiers, which target separate Labels. You can check my example with the 2 Inventory Containers, each displaying its own total weight.
I’ll definitely have to give it a look. Out at the moment 😭
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.
I think it’s because you don’t have enough paired parentheses?
${[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
I haven’t a clue 😅
and I assume 'skill_value' is a Number Field and 'skill_name' is a Text Field?
Awesome, thank you. You wouudn't happen to also know how to make if thens/switch cases work with the colors/icons themselves? Regardless this, is extremely helpful. Figured it out, but I'd still like to see it done a (likely) better way.
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 😩
Yes
well I'm really confused then, because I literally just copy pasted the code you posted
That's very confusing
My server might be haunted. Something may have happened in the upgrade to 11
For future reference you can use panels to hold things to try and display them in a better manner
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
Is there an easy way to compare a field in a dynamic table to an array of fields in another dynamic table?
Blocking out like that is a huge help with visiting
Making all the values
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.
Was previously what i had before deciding to change to DynamicTables
It's 5-6 alphabetized groups.
I think Martin posted something earlier to help me with my dynamic struggles
I'll check it out.
It might work - i trust it should, he’s the G.O.A.T
Just about to get home and see for myself
what do you mean by "inputs", what are you actually trying to compare?
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.
Rephrase?
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.
Seems like a massive problem because the system has so many skills o_o
I'm not sure I understand, is this the behavior you want?
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.
Does first(fetchFromDynamicTable(skillTableKey,valueToFetch,skillDropdownKey,skillToCheck)) do what you need?
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.
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
I may have to think of a different way to implement the skills
You're lucky enough to be able to code. I'm stuck playing with dirt and sticks while you've got access to concrete
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.
If I have any insight by then with how to fetch values from a Dynamic Table, I'll let you know @static zephyr
@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
May I ask what those numbers refer to?
The Dynamic Table crap
fetchFromDynamicTable(1,2,3,4)
Sorry
Just impossibly frustrated at the dynamic table
Not you
Oh, got it
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
No worries, mate. I myself had the same hard time
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
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 😉
Appreciate the breakdown but
I'm actually going to have a mental breakdown
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
No need to, think through it and you'll get it to work
I honestly wish that was the case
With all the actual study I've tried to do to understand this function
I actually cannot
It is, trust me. Been in your same boat and made it work. If I can, we all can 😂
So it's to be used within an item template (God help me if that's the reason this hasn't worked)
How would I reference 1, 2 and 3 by the "Order" columm?
That's all I've been trying to do
And I've been having literally ZERO success
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"
Oh, the changing button it is.
If I can just get ONE of these functions to return the thing I want, based off of the Order value. I can sleep for 1,000 years.
But it feels like you got args numbers not right. Each of the columns you want data from will be argument #2 of the function.
Please correct me if I got it all wrong.
${fetchFromDynamicTable('WeaponSheet', 'Rate', 'Order', 1)}$${fetchFromDynamicTable('WeaponSheet', 'CostAP', 'Order', 4)}$${fetchFromDynamicTable('WeaponSheet', 'RangeMin', 'Order', 2)}$ - ${fetchFromDynamicTable('WeaponSheet', 'RangeMax', 'Order', 2)}$
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)
But now you can add 'DynamicTables' skill to your list 😉
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
would you add a simple example of a fetch formula where a radio button group is involved please? the code @brittle moth mentioned yesterday just doesnt work
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
can you try if it works? it doesnt when i try
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
${fetchFromDynamicTable('WeaponSheet', 'Rate', 'Order', string(group))}$
I think that should be right.
Should be ${fetchFromDynamicTable('table', 'field', 'group', group)}$
And each of your Radio Buttons should have different values configured
Why group as filtering value? Not grasping it...
It's using the Radio Group Key as a value to use
The group key of the Radio Buttons has the value of the currently selected Radio Button
Right, I get it now.
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.
this is my table
in only use 1 radio button group in my template.
how can i give the radio buttons different values?
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.
i know
Give the button a value from the table row that you want to have available outside of the table.
already did that
Do both Radio Buttons have different values, or are they both "selected"?
What you wrote will always return selected
so how do i do it right? what should i put in the "Value" instead of "selected"?
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)
in my understanding, if i create 3 rows in an actor then the row with the "clicked" button will have the value "selected", and the other two rows would have no value. thats wrong?
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.
No, you have to assign each button a value you can use. In your table may be Angriff text or a simple number (1 for row1, etc).
how do assign values to elements that dont exist in the template? the rows are created in the actor, not in the template
It depends if they're a dynamic table or a regular table.
And most importantly whether the Actor whom has those values has Item Modifiers which can be referrenced.
I think you can reference a value in the same row, like $sameRow('Angriff')$ in a dynamic table.
If it's static, you can assign all the values at creation.
i dont get this, maybe im just too stupid
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.
I can try and explain better in DMs if it helps? :s
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...
Does this mean that to use radios to retrieve a row from a DynTab it would work like this:
fetchFromDynamicTable('table','column','radioCol',group)?
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
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?
It would be something like fetchFromDynamicTable('table','column','<another_column_key>',group) if the radio button value is something like ${sameRow('<another_column_key>')}$
Based on the configuration you sent, it should be fetchFromDynamicTable('table','field','NK_attack',group)
This is not a bad idea, since Dynamic table have search capabilities, they can work as reference tables
Ah kk. So if I have literally hundreds of items with several columns each, it won't cause performance issues?
And should I have them on the character templates? Or visible on a user input prompt? :s
In this setup it does not work.
Yup, it was haunted. Uninstalled, Reinstalled foundry to actually fix it
It could, but I don't know to what extent 🙂
It's up to you to try it ^^
Indeed it doesn't. Radio buttons are missing formula computing in their values. This will be fixed in the next version 🙂
Oh, so sameRow isn't working atm right?
absolutely 🙂
Ok ty 😉
Well, sameRow() itself does, it´s just that the Radio Button cannot process formulas atm.
Ofc, that' what I meant 😅
Thanks for the info 👍🏻
**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
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
Deeply appreciated 👌
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.
If you do sum()*1 can that trick it into treating it as a number?
yep! lol, thank you!
That was lucky.
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
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.
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?
Is it possible to use a label button to execute a macro without sending a blank message in the chat?
there's probably a better solution, but this does work
%{game.macros.get("macroID").execute();}%
It does throw errors into the console though, so I assume this isn't the best solution
Unfortunately that is still outputting a chat message as well
and you replaced macroID with the ID (not the name) of the macro?
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
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
you mean, that it looks like that?
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
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
It´s not an array at the first place, it´s just a csv as string. You have to convert it to an array.
%{
const string = '${fetchFromDynamicTable('Skills', 'Base')}$';
const array = string.split(',');
console.warn(array);
return array;
}%
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
i hope i made this understandable. i do this by using the Foundry css and alernate it to my pupose. here is a example. I tried to mark the correct spots in the picture and the code:
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>```
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");
}
okay, so you are using a macro, my example is directly in the label roll message
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.
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.
^ 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.
oh nope, i made a mistake, the part i marked is for a popout asking for input 😄
I mean I noticed that, but I figured the data that was relevent could still be used just in the different form.
Thanks, Martin!
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]
How should I explain this... Yeah, the return type is a matrix, so you can normally perform a sum-operation on it. But once something leaves a CSB-Formula ${}$, it will be converted to a number/boolean/string
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?
Oof, this could prove tricky, because system.props stores only the currently selected value. So you´d probably need to get HTML-Element.
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.
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?
How about setting it to 1 instead of adding it?
I can't do that because other items need to be able to increase it past 1
Still doable. Define priorities then
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.
I´d assign the set-operations a higher priority (lower number), so the add-operations are done after the set-operations.
I have literally as many items as the player can come up with so yeah that's problematic
This works wonderfully, I didn't even consider it. Many thanks
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
https://gitlab.com/custom-system-builder/custom-system-builder/#62-property-reference-inside-a-chat-message
This syntax only works outside of a formula in chat messages
ooooh awesome! thanks!
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)?
if i have to warrant a guess you can control that with visbility and permissions
under configure ownership see if that helps
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
It´s a missing Feature
So it will be in future - when it's time will come? 🙂
how do i remove these wrapper text? I can use !string in some instances but it causes error in longer scripts.
${!...}$
so if i am understanding this changing this part (roll1 <= (ref('modifier')- ref('Erschwernis') I should be able to put text there instead of a number?
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?
You cannot suppress messages in the current state.
you also shouldn't need the ==true for the conditional to work
true == true is true after all 😅
I am confused though, because I have labels on my sheet that don't create a message (which is the behavior I want).
Even though it’s a checkbox?
My formula’s in the roll message part of the label, I think that’s why they’re saying it can’t be suppressed
I mentioned this earlier, it throws an error into console but doesn't actually create the message
Well, that's some kind of workaround... Not really elegant imo 😅
I assume this is because I have a script that doesn't actually return anything?
Have you updated to 2.4.0?
no I'm on 2.3.1
Well, that's fixed in 2.4.0 😂
lol, I know it's messy but it does at least accomplish what I want for my use case
You cannot really rely on unintended behavior. And errors are most of the time unintended.
So expect fixes to come
yeah, I made sure to thumbs up that feature request so I can do this properly whenever that gets implemented
I think that shouldn't be too hard to implement and I can understand the need for that after we've introduced setPropertyInEntity()
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
can you use sameRow() to get values of labels in a dynamic table?
yes
ah cant retrieve label value if the label value is also generated on run time
found the issue
thanks
This is probably a stuipd question, but how do I get the value of a formula of an active effect?
Everything on this part is for the text (marked as 7)
It is just a long formula from me to display 'Erfolg' or 'Misserfolg'.
You can put whatever you like or just öeave or blank
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%')}$```
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
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
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?
Not really built in but you can achieve that with a small Script.
What script? Do you have one readily accessible? In a way that wouldn't give you too much trouble?
So, I just couldn't grasp the part in the script about the routine to remove the item after it's been consumed. Could you highlight that for me?
These are just general examples. It utilizes Javascript, so you have access to the whole FoundryAPI.
I'd need to take a closer look how delete-operations work there. So I can't give you a concrete solution for now.
Sure thing!
An example would be for healing potions. You click, it heals you, and disappears.
But I've already provided you with a good amount of assistance. You're very welcome!
"Sorry for my English coming from GPT, I'm Brazilian lol!"
Stat changes can be done with setPropertyInEntity() https://gitlab.com/custom-system-builder/custom-system-builder/#4211-setpropertyinentity, only delete-operations are not implemented in CSB, so you have to refer to scripts to achieve that.
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?
This is intended, because otherwise it would throw an error, which was unintended.
I hide it inside a div to counter act that.
Can I get confirmation that this is unintended? So I that I can just workaround it.
not sure what that means, can you explain?
I don´t even know why this actually works, because you cannot use temporary variables in a Label, it´s only meant for Label Roll Messages.
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.
I did away with the undefined by wrapping it in a div and setting it's visibility to none
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.
Oh dang I hope you guys don't remove 'support' for it LOL
You could return something else in the script or wrap that to a CSB-Formula, which has # to hide this.
yeah, mine isn't part of chat at all, its a button to update the sheet. :/
@normal ore
so for the item deletion (thanks to the new "entity" in scripts - praise the Devs!)
you could use this:
WARNING DELETION IS PERMANENT
%{let item = entity.entity; await item.delete();}%
or if you want only one line:
%{await entity.entity.delete();}%
That works well 🙂 . I´ll also add linkedEntity so that you can also reference an Item in an Item Container
That's wonderful!
But is there a way to simply remove it from the character sheet without deleting the item?
Uhm.. It´s the same?
when you put an item on an actor you create a new item. so the base item in your compendium doesn't get deleted
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
Ahhhh, I see, sorry, it must have been my translation, haha! I understand now. So this won't permanently delete my item, it will just remove the item from the actor's sheet, right?
Wow, that's exactly what I wanted!
It creates a copy once you drag an item to the actor. So you only delete the copy.
@formal goblet , @scarlet skiff
Thank you very much. You guys are amazing!!!
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;
}```
I haven't messed with HTML much, what do I have to do to get this to work? like this? <div visibility="none"> ... </div>
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.
<div style="display: none;"> %{game.tables.getName("Nic and co. (AoE)").resetResults()}% </div>
just that
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?
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
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
okay, thank you very much,
i tried to start it simple, just to test it.
i pressed F5 ( and logged out completly, cause i am using oracle cloud)
but i makes no difference.
I have uploaded the lemantis.css into my worlds/lemantis folder (where also is the world.json to found)
and lemantis.css is in the setting from CSB
did is miss something?
thanks, i can work with that to learn css 🙂
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
Foundry is not accepting every html order.
css styles should work tho
thank you for the div idea, it works. not optimal though, I'd rather have the old 2.3 error where it just quietly let my button function as a button lol. I hope they find a way to silence label rolls soon.
Dann ist die Pfadangabe in den CSB Einstellungen nicht richtig. Die greift auf den grundsätzlichen Data Ordner. Daher muss bei dir dort „worlds/lemantis/lemantis.css“ stehen.
Aber du MUST die Spielwelt neu starten damit das CSS überhaupt geladen wird.
ah super, das mit dem Pfad ist es gewesen, danke 🙂
Du kannst mit der CSS Datei auch ohne das „Additional CSS classes“ Feld fast alle optischen Voreinstellungen von Foundry überschreiben. Ich hatte mir als Ideengeber dafür einige Style Mods geladen und genauer angeschaut.
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?
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
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.
Same here. Help says that if all buttons are selected by default only the last really is. Could it be something along the same line?
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...
Hi. May I ask what customization you're trying to achieve?
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:
I see. Sorry to say that's not exactly my field 🤷🏻♂️
as it is right now I'm fully capable of playing. But as a personal preference I like to have sheets that add flavor...
no worries, thanks for asking
I too was thinking of having some cool graphics, but soon understood that was out of my league 😅
I started with CBS this weekend and as soon as it clicked t made all the difference. 😄
With CSS I made mine into circles. But I don’t know if card symbols or else is possible this way.
If you have any information on how to do literally any of this, I would love to know if you're able to share.
would love to try. Can you share?
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...
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):
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!
You can use a Dyanmic Table as a referrence for dropdown lists which can be really handy :)
I'm trying to do this, but I'm not sure why I'm not able to! Can you show me an example?
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.
What am I doing wrong?
Can I see what the template looks like with the dynamic table on it?
Would this be it?
Uhh... The template with the Dynamic Table on it :)
This?
Hmm... Try without the item container having the same key as the column?
Nothing!
I have no clue :( I've been experiencing a similar issue
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.
I think the idea is to use borders in your css files.
How do I do that? Like what do I even open up to edit?
Can you tag me a solution if you happen to work this out, please? I'm trying to solve the same issue.
You have to drop a css file in the foundry data directory and then you point to it from the CSB settings in the far right menu. Then you can give all of your panels and such css selectors, and style them in that CSS file.
I haven't done it myself yet, it just mentions it in 8.4 of the CSB docs.
For css, I use Custom CSS module, its easier to edit live.
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?
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.
Of course!
Nope
You cannot use the assign-operator = in CSB like in other programming languages.
But it worked for the 14?
I'm not arguing. I'm just confused why it worked a little bit, that threw me off.
I don't even know how that should even work 😅
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.
You cannot really combine Item Containers with Dynamic Tables. At least not with a meaningful use case.
This here should work without an issue: ${test:= var ? 'val1' : 'val2'}$
Excellent! Thank you. I tried all my attempts to the right of the "?"
Oh, I'm glad you warned me. I was racking my brain trying to solve that, haha! Thank you so much!
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.
Only Labels are modifyable.
If you need additional/other status effects, you can use the 'Core Settings Expanded'-Module. This way you can edit the standard status effects.
I did just find this, albiet i'm not sure what you mean by only the label being able to be edited, and not sure how that is super useful in this instance
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.
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
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
Still need help, or did you figure it out? :)
i wound up doing the it is time to step back after trying some more permutations. So assistance would be appreciated
So could you reiterate what your idea is so I can try and help (If I can :x)
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
Will it be possible to be 'stunned' for more than 1 turn?
no
The state that triggers it either leads to instant death, or being stunned as the better of the 2 outcomes
And this is the result of an attack?
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
Mkay
for most things it is 1d6+1(or number of to use the game term wounds) 6+ is dead below stunned
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.
I mean I'm pretty much implimenting onepagerules GrimDark Firefight in custom system builder
if you want context for what i'm setting up
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
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.
I have a basic of code knowkedge, just 0 html, and css, along with lite javascript experience
You've got more coding knowledge than I do haha.
So you'll be able to do wonders with CSB, I don't doubt.
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
Rookie numbers! I spent 8 hours trying to figure out dynamic tables
I have yet to mess with those
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 >_>"
weird
fetching from actor is either showing up as not a function, or returning undefined
You might need to set a fallback value.
${fetchFromActor('target',<KeyName_Of_Value>,<Fallback_Value>)}$
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
Ah
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
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
Thanks, didn't try yet, bit I have a question. The .sheet class is something that you created/assigned to the checkbox or it's a general already in place class?
just tested... a general class..
Huge thank you!!
can you post a screenshot of the active effect, how you set it up and which key it should alter? should look something like this
@vagrant hollow yeah, you did put in the right track! Thanks again!
Very Nice!!!
How you made it?
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;
}
Thanks, will be help full for future projects.
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
Make the text in " instead of ' should work.
That looks pretty cool, I think I will try it, after I got some basics 🙂
I am still getting the hang on java script and CSB. Can you give me the correct code/expression?
I am at my mobile atm, I can do that later, when i am at the PC.
But why do you want to give a parameter and instantly change it in your macro?
I would like to keep my macro generic and build the parameters in the formula on the actor sheet. Otherwise I need to know beforehand where I will store the information to retrieve it directly in the macro.
Actually the text is just an example. I will pass a string with informations which I will parse/slice in the macro.
this should be in the testmacro:
let param1 = param1;
console.log(param1);
everything you pass to the macro you should be able to call directly by the name you give it in the execute object
and of course you dont need the first line
Thats how it looks like with that setup. Also no output of 'MU'
Yes
Hmm .. 11.305 and CSB 2.3.1 maybe I need to make the upgrade step?
and what it is trying to modify
I have tried variosu different set ups with this to little effect
im on this
Ok I will upgrade first. One never knows.