#Custom System Builder
1 messages ยท Page 24 of 1
Has anyone used the FUx dice roller with CSB? I was trying to use FU dice in a label but couldn't get it to work.
Don't think so. What is it supposed to do?
Hi!
Would it be possible to change an item's color (in an item container) based on a modifier or key value that states their rarity?
You mean the link to the Item? Nope. It can be changed via CSS, but that's usually static. It would be possible if we'd be talking about the Labels instead, these can contain HTML (and styling-rules), which can be changed conditionally.
That one is also static ๐
๐ญ
I wish the rarity colors module could work with this system
from what i've seen it's not compatible
Yeah, I doubt it that a module can do that without being dependent on the system
Well, it is mentioned that it can work with other system
You can let the Item Container show a Label with a rarity colour, that would work. But besides that, meh
Well, our path would be system.props.rarity (given you create a component with the key rarity)
I don't see the issue in reading the value. The bigger problem is to apply the right styles to the right elements
Hi there! Quite a silly question: how would one go about trying to set up two stats, say using Dropdowns, that are mutually dependant and both modifiable by players?
E.g.: stat A ranges from 0 to 10 and so does stat B, but their sum must be 12 at all times (numbers here serve just to examplify).
Ok, I fear that was not clear at all ๐
๐คฃ
First of all thank you for even reading the question...I know it's quite mumble-jumble ๐
Second, lets say that we use Number Fields instead of Dropdowns.
Then, what can I add to better clarify the matter?
Let's see...
{
key: "a",
type: "Number Field",
value: 0,
max: "${max - b}$"
},
{
key: "b",
type: "Number Field",
value: 0,
max: "${max - a}$"
},
{
key: "max",
type: "Label",
value: 12
}
Something like this?
Doesn't this generate a circular reference?
Plus, it's not the max that has to be 'controlled' but the current value.
Not exactly. It would be true if we'd be talking about values of Labels, but in this case it's the Formula for the max of a Number Field. What happens is that the max-values reference the current values of the opposing fields (not the max-values)
That would be hard to control, because a field can either contain a derived value or a persisted value
Ok, I get it. I'll test it and let you know what the outcome is.
Thanks a bunch!
So you can change a label's color right? Could it be possible to show a bar, like a hunger bar for example, that would decline or get full based on specific keys like "hunger/maxhunger"?
I did it like that on Roll20 and am wondering how to do it in foundry
That's possible, yeah. Some people here already did that with resource bars
I want them on the character sheet, not the token, is that still possible?
Bar Brawl is pretty good module if you wanna look into it
Yeah, I meant the Label
I know about it but it doesn't affect the character sheet iirc
A Label can contain HTML, so you can more or less do everything in there
Could you provide an example please? I'm not well versed enough in CSB's possibilites as of right now to understand how I could do this
Oh okay we can paste the html and it works
Damn
I thought there was some trickery to do
Yeah, like I said, you can just use plain HTML
This opens lots of possibilites
If one wanted to interact with the "file" var inside this example with a macro or formula, how could they do it? I've not been using VTT for a while and am still wondering how to interact with actors informations
Let's say I want to reduce the value from 70 to 50 for this specific actor
You usually want to couple a progress bar with other Components (like Number Fields). So you just insert Formulas into the right fields of the bar. That's all
<progress max="${HP_MAX}$" value="${HP}$"></progress>
I see, thank you!
Any idea on how to fix the css difference between the app and my browser (firefox)?
Left is firefox, right is the app
Welcome in the World of Web Development, where each browser can have their own rules
My players will use Firefox too, is there any way to have the Firefox result on my app, or the contrary?
I just want it to be consistent
I'm sorry to tell you
That's outside CSB or even Foundry's capabilites lol
That's browser dependent
I can't help but wonder tho
Why is my app bar green when it's blue in the css
Firefox read it right, not foundry's app
๐ค
Foundry is electron app
Its chrome based
May want to crosscheck your foundry's app view with chrome view
You may have to give up some CSS being uniform since its browser-to-browser dependent
There might be additional styles for resource bars from other sources (modules, Foundry, etc...). You shoud check that with the inspector (F12)
I'll have my players use the same browser (firefox ideally), it would just be weird if my app shows something green when it's blue on a different browser (I'll have to write my css around chrome and firefox, I think it was firefox only)
Yup, will check this too!
Yup, if you want your Firefox and Foundry view to be the same, you'll want to develop for Firefox and Chrome too
Yeah, fixed it by applying the same informations but for both browsers
progress[value] {
border: none;
width: 200px;
margin: 0 10px;
border-radius: 10em;
background: lightgrey;
}
progress[value]::-moz-progress-bar {
border-radius: 10em;
background: blue;
}
::-webkit-progress-bar {
width: 200px;
margin: 0 10px;
border-radius: 10em;
background: lightgrey;
}
::-webkit-progress-value {
border-radius: 10em;
background: blue;
}
does the midi-QoL module work with csb?
at some point I'll bother to learn proper from-scratch system development, but right now I'm just trying to get enough on the screen for us to playtest--and I have no idea how to get item descriptions into the chat right now
oop okay, @undone smelt said under my first post that it won't work in other systems--does anyone have any wisdom on how to set up item cards in chat that show descriptions with clickable rolls and such?
I've been trying to get different bars with different colors but I can't seem to obtain it.
Here is what I tried, the label:
<progress class="hunger" max="${HG_MAX}$" value="${HG}$"></progress>
and the css:
.hunger {
border: none;
width: 125px;
border-radius: 10em;
background: grey;
}
.hunger::-moz-progress-bar {
border-radius: 10em;
background: blue;
.hunger::-webkit-progress-bar {
width: 125px;
border-radius: 10em;
background: grey;
}
.hunger::-webkit-progress-value {
border-radius: 10em;
background: blue;
}
The result is the basic progress bar
Any idea why?
You're missing a closing } before the first -webkit- declaration. Could be that.
bad copy paste on my side, the issue is not present on the real css
I see. Can't see anything else at the moment ...
I'm going nuts
someone please help my brain find how to create and use variables inside the ${}$ commands?
I looked it up once but have now forgotten both how and where I found the info
(or just how to reference item stats in a roll message code for an item container, which is what I actually need)
like: how do I make this actually work right?
[[/roll @item.wep_dice]]
I have an item attribute that contains weapon dice as a string like '1d6', and I just want to pass that string to the /roll command--surely there's a way to do this?
You probably want to read this section: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#32-roll-formula-
blessss thank you I couldn't remember which page it was on
okay I've got it as far as here, but I can't seem to be able to use :variables: with deferred [[/roll]] commands
I'd rather it be two buttons, attack and damage, and you click them to roll--is that something that would require a macro at this point, or is there a function syntax thing I'm still missing?
No special syntax from our side. The Foundry-standard should work regardless
so [[/roll :item.dmg_dice:]] is supposed to work?
Nope, because you cannot use :: without [] without ${}$
is it possible to put a deferred roll inside ${}$? I can't seem to figure it out
I think you're thinking in the wrong order. You can insert the Roll-Formula into the Inline-Roll. This will be handled by Foundry afterwards:
[[/r ${item.dmg_dice}$]]
it spits out this
Ah yeah, you need to add ! right at the beginning of the CSB-Formula. This will remove the box
OH!
THANK YOU IT WORKS
that has been causing me problems for months haha
YAYYYY it's all working finally
That's a dumb question, but how could I make it so that checking a certain checkbox in an item will reduce all values from precedent number fields of that item to half of their original value, but then go back to normal if I uncheck the box?
That's tricky / not doable, because a Number Field cannot contain derived values
I can't make it so that if "cat == true" then "cat_tail = 0.5" instead of "1"?
That would be doable in a Label, not Number Field
or just an automatic equation like, if it's true then cat_tail == cat_tail/2
mhm
I'm trying to make it so that if an actor equips an item (weapon, armor) then the weight is automatically halved
Why not just halving the total Weight?
Because it's just equipped items that are halved
let's say they loot a baseball bat but are currently using a sword and only have the sword equipped, the weight of the sword would be halved but not the bat
I wanted to use it for backpacks too (backpacks reducing weight to half or 70-80%~)
Well, you need the base-value in a Number Field and the actual value in a Label. Other combinations are straight up not doable.
#1037072885044477962 message
Base value and actual value?
The issue is, the label needs to be preset right
So I can't set a different weight for each items
I would need a different template each times the weight is different (which is not a solution)
you can if you have the label generate from an attribute, I think
๐ค
Doesn't really matter. It just hides the Label, but is basically the same
true
Base_Weight * Situational_Modifier = Actual_Weight
you might be able to play with the hidden attributes since you can configure them for individual compendium entries, say--but yeah it kind of only distances the problem
This base-structure will never change
You mean I can have a label that automatically updates itself based on a number field/text field value?
yep!
๐คฏ
Or based on Number Field and Checkboxes, yeah
so if you, say, have a checkbox whose key is is_equipped
then you can have a hidden attribute of key situational_mod and set a formula, for example ${is_equipped ? 0.5 : 1}$
then on your sheet you have:
- a
base_weightnumber field set to whatever number - and an
actual_weightlabel that generates its text with the formula martin put up top:${base_weight * situational_mod}$
(the a ? b : c formula is an if-else formula--if a resolves to true, then it executes b; if not, it executes c)
I'll try this, thank you!
Is there any documentation that shows how to setup the speed attribute? I tried a couple of things but I didn't get it right.
system.props.key
Doesn't seem to work :(
nevermind
I'm dumb
it works
Thank you!!
I'm assuming replace key with the key on the character sheet?
Do I have to reload after making the change? It didn't seem to work
actor.system.props.key
Beautiful!
Is there a way to customize the sheet templates themselves? I thought I saw someone with a fun background and different layouts?
Styling --> CSS
CSS is greater than Styling?
No. It's just that if you want to style something, the solution will always be CSS
Oh! I see. Sorry, I'm a bit dense sometimes
Hello everyone. Excuse me if this question was already asked. How can I use the visibility formula for a component? I'm working on a sheet for The Strange, and with that game it would be useful to have some panels of the sheet showing (or not) with the push of a button. But I simply cannot understand how visibility formula works ๐ฆ
Is there any way to link a journal entry on a character sheet? When I drag & drop it doesn't work
The Component will be shown if the Visibility Formula resolves to true. In case of a Checkbox it's either just the key of the Checkbox or not(checkboxKey)
This works in Rich Text Areas (only in Dialog-mode)
Dialog-mode?
Can i just set visibility formula to false if i just want to hide a lebel
Sure
nice
nvm, found it, thank you!
Thank you!!!
Can you add values to a variable?
Var1:= Var1+" 3,"
or something like that?
So I'm trying to output a list of numbers correlating to pieces of armor worn. I kind of got it working.
${!item.chest == 1 ? "2," : ""}$
${!item.back == 1 ? "3," : ""}$
${!item.groin == 1 ? "4," : ""}$
${!item.rear == 1 ? "5," : ""}$
${!item.armLeft == 1 ? "11," : ""}$
${!item.handLeft == 1 ? "12," : ""}$
${!item.legLeft == 1 ? "13," : ""}$
${!item.footLeft == 1 ? "14," : ""}$
${!item.armRight == 1 ? "21," : ""}$
${!item.handRight == 1 ? "22," : ""}$
${!item.legRight == 1 ? "23," : ""}$
${!item.footRight == 1 ? "24" : ""}$```
The problem is that it doesn't show up correctly on the sheet
but it does in the chat
So I was thinking about trying to add the data in variables and print it out?
I'm not sure
I checked the example but couldn't get exactly how you get a "total weight" value on your actor based on the weight of the items he has in his container
Check the modifiers of the Item Template
I did but didn't really get how everything reads everything
I found out, thank you!
What's the difference between Label text and Label Roll Message?
Sorry, I just realized I snipped two different itterations. It was the same either way With or Without the commas. I'll send it here now
${!item.chest == 1 ? "2," : ""}$
${!item.back == 1 ? "3," : ""}$
${!item.groin == 1 ? "4," : ""}$
${!item.rear == 1 ? "5," : ""}$
${!item.armLeft == 1 ? "11," : ""}$
${!item.handLeft == 1 ? "12," : ""}$
${!item.legLeft == 1 ? "13," : ""}$
${!item.footLeft == 1 ? "14," : ""}$
${!item.armRight == 1 ? "21," : ""}$
${!item.handRight == 1 ? "22," : ""}$
${!item.legRight == 1 ? "23," : ""}$
${!item.footRight == 1 ? "24" : ""}$```
Just copied this to both the label and the roll
! is not allowed in Label text
These here are all not allowed in normal Label Text: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#318-additional-syntax-rules-in-label-roll-messages
Is it possible to fetch the names of all items that are equipped (via checkbox) to an actor?
A little Script can do that:
I've seen people post about progress bars. Is there a way to get a bar that has sections that can be turned off/on?
So for example a bar with 5 segments has 2,3, and 5 on and the other two are empty?
[ |---|---| |---]
ehhh... I can't even answer that one ๐
My teacher said there were no stupid questions though....lol
I appreciate it
I'm trying to get something that looks cleaner than what I have to indicate which fields are selected
I found a ghetto way of accomplishing this
@formal goblet Can a dropdown list be used to retrieve all tokens currently on combat?
Using actual javascript scripting
Can you add icons to the Label in a Number field?
Hi all! Anyone played around with Ripper's Mastercrafted Mod? It seems to work just fine, except for one thing... I can't figure out where to look to see why it is able to auto-add the product of a recipe to the item container but not remove the ingredients. 1st pic before craft, 2nd is after.
The after even acts like there are no correct ingredients available anymore.
Try text emojis https://emojidb.org/
Find emojis!
I just discovered items can't have item containers, how do you create backpacks with this system?
Yeah, it can with the right Script. Just be aware that the Dropdown doesn't update automatically when you initiate a combat and add tokens. The sheet only updates with value-changes in the sheet.
Hmmmm using %{}% delimiter huh
@formal goblet Found a bug, having array in Dropdown List that has an apostrophe ( ' ) in one of the string breaks it
Same bug when using string separated by comma
In both cases removing the apostrophes off the names fixes it, but there is no error indication for having an apostrophe ( ' ) so that might be worth looking into
I already reported this to the github. The immediate solution, at least for me, is to use backticks otherwise the quotes break my code. I ended up writing a macro for world scripter that changes single and double quotes to backticks on items when players try to use these in names.
Isn't that a thing for all coding languages?
It depends on how CSB is handling this. Javascript allows for backticks to be used to contain a string the has single and double quotes like 'Bob "Butch" Smith' (using single quotes here because discord is treating them as inline code). However, CSB doesnt like backticks when wrapped in %{}%. Therefore, the single and double quotes become proprietary.
Oh interesting. Learned something new!
Place this in the World Scripter module and refresh the game. It takes about a second for it to change (at least in my overly complicated system) and, depending on your code, the console may spew a bunch of errors until the incorrect name is changes (it does for me).
// Listen for updates to Actors
Hooks.on("updateActor", (actor, updateData) => {
// Check if the name property is being updated
if (updateData.name) {
// Replace single and double quotes with backticks in the name
const updatedName = updateData.name.replace(/["']/g, "`");
// Update the actor with the new name, if it has changed
if (updatedName !== updateData.name) {
actor.update({ "name": updatedName });
}
}
});
// Listen for updates to Items
Hooks.on("updateItem", (item, updateData) => {
// Check if the name property is being updated
if (updateData.name) {
// Replace single and double quotes with backticks in the name
const updatedName = updateData.name.replace(/["']/g, "`");
// Update the item with the new name, if it has changed
if (updatedName !== updateData.name) {
item.update({ "name": updatedName });
}
}
});
Aaaaugh this unfortunately doesn't fit our use case, thanks though 
We have lots of character names that has apostrophe in their names and this script changes them to backtick
Hmmm okay I'm stumped
Anyone has any ideas how to populate the dropdown list with all tokens on combat in the canvas?
%{
// Initialize variables.
let tokens_in_combat = canvas.tokens.placeables.filter(token => token.inCombat);
let label_array = [];
// Get token name for everyone in combat.
tokens_in_combat.forEach(token => {
label_array.push(token.actor.name.replace("'", ""));
});
label_array.sort();
return label_array;
}%```
This is what I got so far, it works in macro, but breaks down in formula field
Oh- I got the workaround
Whats that?
I just needed to move all the formula logic to a module
This is all I had to do
I still can't have apostrophe on the token name but I can just remove that before returning the value to the dropdown list
Better no apostrophe on token name than the formula not working at all
Not useful, maybe, but still...
Can you split it in 5 bars each controlled by a different value/max pair?
That's what I was thinking but I wasn't able to manipulate the size of the bars to fit the area like I wanted so I just went with Filled in or Blank dots instead to vaguely mimic the body AC chart. Not perfect but okay enough.
Hello! I'm asking again since I didn't get any answer, how could I handle backpacks with this system if I can't add item containers inside items? ๐ค
I created separate containers (equipped, unequipped, and dropped) on the actor. Each item has a dropdown with the same option name. I filtered the item containers based on these options. I also set it up so that any modifications from a dropped item (weight, any +'s to values) werent passed on to the actor for dropped items. For unequipped items, weight still applied, but nothing else. Unequipped, for me, covers both a "turned off" status and/or stowed in backpack. I also put icons on the appropriate containers to easily change their status.
Also, the item in an item issue will apparently be fixed in the next release (no ETA).
It's not a fix tbf, it's a completely new feature, which will take quite some time
Thanks for clarifying.
Sounds amazing though! I can't wait ๐
How do you filter "off" and "on" items? With a checkbox?
Placing setPropertyInEntity in the roll message to update the item.
Issue with this method is if a player wants to drop their backpack or share it to someone
You would have to remove or share every single items manually
Hi, is it possible to get the custom system roll to display the dice rolled, rather than putting it in the tooltip?
CSB doesnt have an option for moving items between actors. You can use the module Item Piles to copy items from one actor to another but it wont delete the item from the source actor (Built in foundry restrictions). Also I dont think it supports sending 3 of 5 items to another actor, its the entire item but maybe via its API. You might also be able to use the API to drop a category of items "on the ground" such as ones designated in a backpack and the other player can pick them up. The question ultimately is "how often is this likely to occur". If it's proven to be frequent, then it maybe worthwhile setting this up with Item Piles or plain javascript. If you are just trying to account for a "possible but unlikely scenario", then treat the issue the same way as you would in a face to face game with paper sheets.
I will create an actor and an item for the same backpack and add the item to the player's actor + link the item's actor page
This way they will be able to see quick informations from the item container like weight, durability, etc..
But the actual inventory will be stored in the backpack's actor page and the "total weight" will be stored there
This means that I will need to manually update the backpack's weight inside the player actor's inventory
Could it be possible to link an item's key (like "weight") to a specific actor's key?
If not I will update it manually or could it be possible to write a macro that updates it?
You can use fetchFromActor to retrieve the weight of the backpack items from the backpack actor and add it to the total weight carried. If you use the Loot Piles module, I think it will move (not copy) items from actor to "backpack" actor if the player has the correct permissions (just not PC to PC). This will work well as a backpack
two (hopefully) quick questions:
- currently there seems to be no way to sort things in item containers. am I missing something? if not, is this feature on the way/is there a workaround?
- reloading all item sheets doesn't seem to affect items in compendia or actors. is there a way to change this behavior?
- Not released, but you can clone this branch if you want: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/feature/sorting_for_tables?ref_type=heads WARNING: Be aware that this version reflects the latest code in this repository, and thus can contain untested development, or breaking code. Please back-up your games regularly if you plan to use this version!
- #1037072885044477962 message
thanks a ton!
Hi all! Is there a way to get an item list (in my case, weapons in an item container) in the Prompts? I'm trying to let the user select one of his weapons so I can pick one of the stats to use in the Prompt.
Not without your own Script
Aww, damn! Haha, ok, I'll see what I can do...
is there an existing macro or other solution to pull item descriptions into the chat ร la the midi-QoL module for dnd5e?
I'd really like to be able to have players click an item or ability or spell or whatever and have it pop a little description in chat with relevant attack/saving throw/etc. buttons
(also, but unrelated:
can tokens on the map not use .gif files? my monster test was going great, set the token image, but then it reverted to the cowl on the map...all my other tokens are showing image just fine)
Use a Label Roll Message? ๐
Doable. Just reference the key
so like in an item container or whatever, I could reference item.text_area_key in the roll message, and it would work?
Yeah
I could've sworn I'd tried that already... I'll have to give it a go again tomorrow and see if I can figure out what I did wrong
thanks ๐
Are you not able to place a font awesome icon in a conditional thing or am I not formatting this correctly?
If I print this it works <i class="fa-solid fa-hand-back-fist"></i>
But this does not work (I tried with or without the quotes
${item.all == 1 ? "" :item.armRight == 1 ? "<i class="fa-solid fa-hand-back-fist"></i>" : ""}$
This did work, however (but this isn't the icon I wanted)
${item.all == 1 ? "" :item.armRight == 1 ? "♦" : "⋄"}$
Could someone please export and send me a character sheet where dot based stats are implemented
I would also appretiant that.
Foundry cant use .GIF use .webm instead
Figured it out. This worked
<i class="${item.all == 1 ? "" :item.armRight == 1 ? "fa-solid fa-hand-back-fist" : ""}$"></i>
Do you mean damage-over-time? How statuses are implemented in CSB don't really lend support to that, you'll have to make do with Effect Macro module
No, i mean a character sheet that uses radio buttons instead of numbers to represent attributes . Like a vampire masuarade character sheet.
Like this
You cannot use radio buttons that way, they are mutually exclusive in CSB.
And this is also not standard checkbox-behavior. This would need an own Component in CSB (or at least an extension of the Number Field)
Maybe a label with modified size, borders and bg color?
I mean, you could use that instead of those fillable radios.
Hi! Thank you for this reply, could you provide an example on where to write this formula for it to work? I'm not the most well-versed in CSB or even Foundry for now and I don't really know where I could write something like this
It launches the Freeform Universal dice roller (FUX module). With the module loaded it can also be called from a button in the dice tray and with a chat command:
Command format
/fux xayd
where x is the number of Action Dice and y is the number of Danger Dice
Example.
This will roll 2 Action Dice and 1 Danger Dice
/fux 2a1d
I'd say call the API from the module directly via a Script.
Im trying to get a dynamic table to show the item's classification in an inventory, but I can't get it to do anything but throw an error. When I use the following:
${first(fetchFromDynamicTable('TABLE_SKILLS', 'TXT_WEAPONS_CLASS', 'TXT_WEAPONS_CLASS', item.LIST_CLASS))}$ it shows nothing at all. Am I missing something?
Dynamic Tables and Item Containers are not compatible with each other
Then I'm confused cuz Im following the example.json from the wiki and it works there ?
${first(fetchFromDynamicTable('Skill_Weapons', 'Name', 'Name', item.Skill))}$ Is what it uses in the example.
Hi, I would like to achieve the following:
I have a skill on my character sheet.
And I want it to be represented at two independent cellsboth cells should be syncronized, so if I edit one the other should change too...
like this:
So if I cahnge ballisztika on the top the bottom one should show the same value and vica versa
how can I achieve this?
Well, that one calls a value from the Dynamic Table called Skill_Weapons, that has nothing to do with the Item Container itself. item.Skill is the 4th parameter of this function, which acts as a filter-value. If you want to show the classification of the Item in the Item Container, just use ${item.key}$
Not doable. Either a value is dependent on another and cannot be modified by the user or it can be modified by the user but cannot be dependent on other values.
Ah ok, Thanks.
make one a label, and put a formula =[key] of the other. You will not be able to edit it anymore though
If I make a Dropdown Menu in an Item, can I use a Dynamic Table from my actors for my options?
Yeah, you can use the parent.-prefix. Or you use the Formula-section and combine it with fetchFromActor()
${item.key}$ is not showing up the items classification that I picked out. Im using ${item.CLASS}$ as the key but nothing shows up.
- Are you using it in the Label of the Item Container?
- Is
CLASSa present key of the Item?
Both yes.
Then look at the console with F12 and check for errors
Nothing there either. Its really strange its like the inventory container is 'working' but just not displaying anything.
Does it display the Item or not even that?
It displays the item
and I can make it do rolls from there
but it wont show any lists.
k, did you reload the Item and the Character Sheet?
Yep.
Then show your setup
I don't know if anyone's still looking for a "Vampire: The Masquerade Stat buttons" solution, but I'd make a Dropdown like this: (The characters in the label are the UTF-8 characters Large Circle and Circled Bullet.)
That looks hilarious tbf ๐
Would the end result on the sheet not serve the purpose?...
So from left to right its my Inventory panel > the classification lable in the panel > and the item's drop downbox.
That wasn't meant offensive, it just looks pretty funny and is a creative solution (although my inner developer would cry because of UX-reasons)
Looks fine. Can you do game.actors.getName('actorName').items.getName('itemName').system.props and check if the key is present there?
Thanks for acknowledging the creativity, was starting to get a little salty there. ... and if "UX-reasons" = use of UTF-8 characters... there are other basic ascii characters that would work simillarly. I'm just sayin'...
Sure, where am I putting this at? lol
It's not because of the characters itself. It's about the intuitive usage. What the user sees are Radio Buttons, but in reality it's a Dropdown disguised as a set of Radio Buttons. That's weird behavior UX-wise.
In the console is enough
You should replace the names with your actually used names
Ok, then let it be black hearts and red ones (shrug) ... the original problem was progressively filled indicators, and a Dropdown can mimic that and, imho, rather elegantly.
Anyway, time to get back to the grind... ๐
Is see Class, not CLASS. That's the issue
Weird...
You probably forgot to reload the Item (Reload all items does only reload the Items in the Item-Tab, not the ones already copied to actors)
Speaking of reloading, is there any nifty command or script we can use to reload a sheet?
I mean I have been refreshing on both fronts, but still getting the same result. I even made a new inventory at one point with diffrent keys to the same result.
Ill keep faffing around till I get something. Thanks for the help as always.
item.templateSystem.reloadTemplate() or actor.templateSystem.reloadTemplate().
sweeeet, and can i replace the item with actor with something like game.actors.getName('example name').templateSystem.reloadTemplate()?
Sure, it only has to be an instance of an Actor or Item (CustomActor or CustomItem to be more precise)

So Idk why... but apparently If I use 'class' as a key at all it wont work but if I swap to anything else its fine.
ehhh. Well, if it's only problematic with class, then there might be an internal issue with this keyword in the library... Nothing serious... Just one of the most important keywords in object oriented programming...
lmao. welp either way the issue is solved so I appreciate the help again. ๐
@formal goblet Can I use a dynamic table's value to pass another "formula" to a Label elsewhere? Like so:
This is my current result so far:
recalculate()?
amazeing, yess. can you please export and send me a character sheet template that has this?
it does not work, what do i do wrong?
${=COOL}$ should be like this I think. The ${ }$ is to define it as formula. The key you just literally copy.
gives me an error for some reason
is there any way to determine how long the drpdown list? it looks good but unesesearry long, or too short if i set it to medium, where is the css that determines how long is a medium long dropdown list cell?
Just add a component, make sure it's the type Dropdown List. The options origin should be Custom already.
Area "A" is where you tell the list what the value is to focus on. In any macros or other script references: "A" is the possible values.
Area "B" is just about what people see. That's why I have the series of circles.
One of these kinds of lists starts with no option slots but if you look for the + button on the right edge, that adds more Key/Label pairs, one at a time.
Lastly, I have 0 in the box at the bottom so that the list starts off with the empty dots by default.
If you like those "fake" radio button characters you can copy them here: โฏโฆฟ (They came from https://utf8icons.com/ when I searched for "circle")
I need a script which would populate a text filed with with the UID of the ITEM which contains it.
If I have an Actor Sheet checkbox called is_active and then have an item attached to the sheet that needs to get the value (true or false) of that checkbox, is there anything special that needs done for a hidden attribute key that calls ${fetchFromActor("attached", is_active,0)}$ to return a Boolean? It seems to be converting it to a string in the hidden attribute key
All Labels (including hidden attributes) are basically strings. That's because how ComputablePhrase works
Is there a way to cast it to a Boolean? I assume that within the context of an Item, a checkbox value maintains its Boolean type? Since on the same item, a checkbox with key is_active can use is_active?"true":"false"
Also, hidden attributes that fetchFromActor numbers can be used as numbers
Implicit coercion is a thing
But that won't work for booleans I take it?
And if instead we return 1 or 0 in the hidden attribute formula, would that implicitly evaluate properly as a Boolean check in the statement is_active?"true":"false"
String -> Boolean would be tricky, yeah
That would work
Yeah, types are a bit messed up, I know
For what do you need that?
I would like to create a button on the character sheet which would send the item into the chat when clicked
now it works
But it only works because I have populated the filed with the UID manually
if I could populate this field with the UID automatically then it would be awesome
because it would work with all items that I create
I suggest to not use a Text Field. You should fetch the UUID directly in the Label Roll Message. For this you should read the following sections of this Wiki https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System:
- 3.1.8
- 3.3.2
- 3.3.3.2
These are mandatory steps
it says "This project has no wiki pages"
So uh daft question, is there any way to edit the attribute bar value if attribute is set to attributeBar on the token?
@latent sorrel Heya, sorry for the ping, but I'm looking for references on how to populate a dynamic table with contents from another dynamic table, do you have any ideas or clue?
I have JS code that populates a dynamic table that you can try do dissect, if you like.
This doesn't seem to work the way I expected. I thought if I assigned the hidden value key on the item to be 0 or 1, I could use it as a direct expression for a true/false ternary operator.
Actor: Key on sheet called: power_boost_active (a checkbox)
Item: Hidden Attribute key call: is_boost_active which is set to the formula: ${recalculate(equalText(fetchFromActor("attached", "power_boost_active","false"),"true")?1:0)}$
Also on item: Label to display the following: ${is_boost_active?"True":"False"}$ <== This always displays True regardless of the checkbox on the Actor sheet
Alternative (This works but is a bit messier) ${(is_boost_active>0)?"True":"False"}$
Heyo!
Im looking into a shoot FX sollution. and was recommended JB2A, anyone got a sollution to be able to incorperate it to a button?
is there a way to use a label to roll something like advantage and disadvantage? specifically id be rolling 3d6 in my case.
@onyx jetty There is a way to keep highest or lowest. /roll {3d6, 3d6}kh would do advantage, and kl would do disadvantage. In the roll message, it's ${[{3d6,3d6}kh]}$
wow that's remarkably simple lmao
The dice rolling mechanics can be as complex as you need them to be to get the exact type of dice rolls you need
I'm going to steal this as a workaround for icons in dropdowns ๐๐๐ป
The full code is completely okay with me, I just need extra references to help me, thanks in advance ๐
https://emojidb.org/ Something to bookmark if you need to look out for text icons
Find emojis!
That's a good point too, thanks ๐
The thing is everything returned from ${}$ is a string, that's the issue.
If set as attributebar on the sheet it is ONLY editable via sheet.
If you want it ediable via token, you have to use a number field with a set max. This will automatically produce a attributebar.
Ahhhh thanks for the tips ๐
FX videos need java/macros to call them. I suggest use the module sequencer cause it makes dealing with them much easier. Make yourself macros that call your wanted FX and call the macro from a label-roll-message.
This works fine for me.
I'm noticing that Active Effect modifiers only works for token linked to actor data, basically
Token not linked to actor data don't the modifiers from Active Effects
If the prototype token is not linked to the actor, foundry makes a copy of the actor when it is drawn to the canvas and from this moment ONLY connected to the sheet that opens when double clicking the token and NOT anymore connected to the sheet in the actors list.
But the active effect should work.
Pay attention how you open the sheets.
I'm mostly stumped on why active effects do not work on token not linked to the actor, my suspicion is that when Foundry makes the copy of the actor, it does not copy the list of active effects already defined in its template? This is just me speculating though cause I have close to no idea why Active Effect does not work on nonlinked tokens
Let me poke around with the tokens a bit
Ahโฆyou had an effect already set to the actor bevor you put it on the canvas?
Never tried this myself.
But copied NSCs of mine on the canvas can get new effects and have them working.
So my next question is, if Foundry makes a copy of that actor specifically for the token not linked to any actor data, can we use fetchFromActor() to that copy of actor?
Not fetchFromActor() in the actor list, but to the copy of the actor
It depends. By name, nope. By target/selection, yes
No option by ID? ๐ฎ
I can only say that I never recognised problems with this on my sheets.
If I place different items to different tokens from the same actor, they work fine.
Nope, only with a little Script
Ah, thanks for the info anyway
Ah, it's not a CSB problem, its a me-and-my-tools problem
I developed my damage calculator thingy in a way that can't retrieve a token's actor sheet unlinked to the actor data
So I'll need to overhaul the logic of my calculator
If you donโt need hordes of the same actor attacking your players in your world, you can maybe leave it the way it is. In my steampunk round every villain is a own actor.
Iiii just needed some way to have duplicate of the same mooks attack my players
Like Pirate A, Pirate B, that kind of stuff
I could just make two duplicate actors for that I guess, but that's an alternative for future Nao to mull over
Probably rules me out, but that's fair enough. Thanks for looking at it.
Is there a way to have a formula check inside of a item if a check box is checked or not? Like If inside the item the box is checked it would roll 1d20, but if it was not checked it would roll a 1d10.
Is anyone using the health estimate module? I'm trying to use it in my campaign but it doesn't work, I've tried changing the datapath to "attributeBar.HP_current" but it didn't work. The module is just not compatible with the CSB?
${#roll_formula:= checkboxKey ? '1d20' : '1d10'}$
${[:roll_formula:]}$
It has to be "actor.system.attributeBar.HP_current".
Like in the help text directly below the field.
Health estimate module works fine to me.
Worked just fine thanks!!
This SHOULD be all the relevant portions for using JS to add to dynamic table, hopefully I got all the brackets and code. Also, dynamic table keys dont exist in "props" until an entry is created manually or by code, which this code assumes already exists:
const actor = entity.entity.
let xpJournal = actor.system.props.xpJournal; //get dynamic table 'xpJournal'
let newData = {};
let updateObject = {};
const journalPath = `system.props.xpJournal`; // path to journal key
newData = {
id: itemID,
name: `Bought ${stat} to ${rank+1}`,
XP: cost*-1,
type: type,
sn: 0
};
let journal = addNewRecordToXpJournal(newData);
updateObject[journalPath] = journal;
await actor.update(updateObject);
function addNewRecordToXpJournal(newData) {
// Create a new record with the duplicated fields
let newRecord = {
"deleted": false,
"predefinedIdx": null,
// Add new data for other fields
"id": newData.id,
"name": newData.name,
"XP": newData.XP,
"type": newData.type
};
return xpJournal;
}
Hmmm, I seem to get a weird bug: I have a weaponTemplate, I created a test version. I added the weapon to the character sheet of my player. As I understand, the way I set this up I should be able to get the 'Aspects' in the dropdown menu. It does seem I get the right amount of options (8 + an empty one), but all of them are blank. Creating a new weapon and giving it to the character gives the same result. Does anyone happen to have a solution for this?
No idea if this is right or not but did you try removing the "parent." from the column from dynamic table to use as option key?
Is there a way to have a button on a sheet open up a specific compendium?
Questions about userInputTemplates:
- If I have a variable defined before calling the userInputTemplate, would they also be pulled in if a key is the same as their name?
- Is there a way to retrieve data from a dynamic table when a userInputTemplate is called from a row?
Just fixed the second one, can use sameRow
Im setting up a system that mainly uses 2d6 for its rolls and struggling to set up some of my rolling buttons/lables in the character sheets. is there a way to have the system roll 3d6 and display the highest 2 or lowest 2 ? i know how general advantage/disadvantage rolls work but im having trouble with this
With Journals it works by using a Rich Text Area with 'Dialog' style and dragging the specific journal page onto it. It might be the same with Compendia.
If my memory does not fail me you just need to add kh2 for highest 2 or kl2 for lowest 2 at the end of your roll formula. Anyway, for sake of completeness, check FoundryVTT Knowledge Base about roll modifiers ๐
There is probably a much better way, but you can set each d6 to a variable and then use conditions to find the two highest and the two lowest.
I'll try that tomorrow, thanks!
How do I reference a field in a dynamic table?
That didn't really work but thanks for the suggestion!
4.2.1 explains fetchFromDynamicTable and 4.2.2 explains getRefFromDynamicTable
https://gitlab.com/custom-system-builder/custom-system-builder#421-fetchfromdynamictable:~:text=read them carefully!-,4.2.1. fetchFromDynamicTable,-fetchFromDynamicTable(dynamicTableKey%20%3A%20String
Sorry to hear that. In this channel it should be possible to find how it works for journals, but I cannot seem to find that. You could try searching for it.
When I use a dropdown list to use values from a dynamic table it puts in the key names as options and not the values set in those options. I tried putting the column name in both option key and option label to no effect.
How do I get the actual values as options?
Idk if this will help but the FAQ has a spot that explains dropdown menus use the keys for values and the labels are just for show.
Can a value be set to a string when asking a question? Like if I asked the following: ${#concat(?{aiming:'What are you aiming for?'|"Head"|"Chest"|"Left Arm"|"Right Arm"|"Left Leg"|"Right Leg"})}$ is there a way to say that the head = -5 and so on for each body part?
I believe there is a User Input section in the wiki that has an example like that.
This:
?{name:"Character name"[text]|"Your name"},
?{age[number]},
?{gender:"Character gender"[check]|"m","Male"|"f","Female"|"o","Other, or I don't want to say"},
?{month:'What month are you born ?'|"January"|"February"|"March"|"April"|"May"|"June"|"July"|"August"|"September"|"October"|"November"|"December"},
?{happy:"Are you happy ?"[check]}
)}$
Check the gender part.
Ah thanks yeah I must of over looked it appreicate it.
So, I am able to get the Journal to show up and I can get the specific item to show up, but it's not really the ideal outcome. I'd like to get the compendium to pop-up so I can drag items onto the sheet. Right now it's only letting me look at a sepcific item.
I tried myself and it looks like that's all we can do.
And, from a certain point of view, it makes sense: why embed a compendium in an actor sheet when you can just open it from the menu?
It looks like that capability is only meant to show journals or items.
Ah, yeah I was hoping for something like in PF2e where you click a button to pop up the compendium so that you can select a weapon to drag and drop onto the sheet. It's not the biggest issue in the world, I just liked the fact that the users didn't have to go hunt for it themselves.
That would be cool, I agree.
${#concat(?{aiming:'What are you aiming for?'|"-5","Head"|"0","Chest"|"-1","Left Arm"|"-3","Left Hand"|"-1","Right Arm"|"-3","Right Hand"|"-1","Left Leg"|"-3","Left Foot"|"-1","Right Leg"|"-3","Right Foot"})}$ Is there a way to show only the display I.e Head for instance but still have the value be rolled later ? Like ${aiming}$ is the formula here is there something I can put in it show just label part? so I don't have this occurring.
If I swap the order around it will show the head, but will not return a number as it can't use a string to determine value.
I think I have a work around, but I wanted to see if there something I can do with this first.
Have you tried removing "" from the numbers?
Ill try that now/.
There isn't a way to have an item within an item, right? I've created a Weapon Template and I was wondering if there was a way to add nested item to add Mods. I assume not but I wanted to make sure I wasn't overlooking something.
I don't believe so?
There is not, my friend.
Nah still the same results.
Still shows as -5 or returns nothing.
Tis fine though, I'll just work around it. Thanks for the help ๐
My pleasure.
I appreciate it!
Can you use "Ands" and "Ors" in the compare?
It should be and(condition1,condition2), and or(condition1,condition2).
Oh wow! That will be a game changer for me!
Test it before you celebrate, I might be wrong ๐
Will do!
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
Is there a bug when two seperate drop down lists reference values from the same dynamic table?
Whenever I choose an option from one it resets the other one.
Not that I know. They should't even interfere with each other
Check the keys you used, two could be the same. Or the keys you reference to.
Column key should be without the parent.-prefix
The keys are different so no problem there. Both are referencing the same table and column. Basically I want two seperate drop downs so I can make two seperate choices from the same dynamic table.
Could you post the two Dropdown setup?
I don't know, it all looks good. Just as a test, you could copy the dynamic table and give it a different name, so that each dropdown can reference a different table.
Kinda of defeats the purpose since the whole point is that they both reference the same table. Any other way?
Any errors in the console?
I'm at a loss. It looks like the variable from one dropdown is passed to the other one...quite impossible, in my knowledge.
Can you send your template?
Your key-column is wrong. Should be skill_specialty_number
Thanks! That worked. ๐
OK all, I'm working on a Daggerheart sheet. I'm trying to figure out the best way to model the HP/Stress bars (other than making a series of individual checkboxes) Anyone have any other interesting ideas?
If it doesn't require interaction by the user, then a Label with the right HTML + CSS should be enough. Otherwise it would require your own Component: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Create-Components/Create-a-Custom-Input-Component
It's definitely supposed to be interactive. I'll look at creating a custom input component, but it feels like swimming in the deep end without my floaties.
I need some help making a roll macro for a d12 success-based system. It counts successes normally against a given difficulty, but then if a 12 and a 1 are BOTH present in the roll, they should cancel each other out and not count in the total successes.
Any idea on how to do that? I got the first part down but not the cancelation part.
If it's not possible with the Foundry Roll Formulas alone, then you need your own Script
I asked in #macro-polo and they said it's not apparently.
Well, then own scripting it is
So there's no way this roll could be edited to accomodate that?
`${#concat(
?{difficulty:"Difficulty (DT)"[check]|"3","3"|"4","4"|"5","5"|"6","6"|"7","7"|"8","8"|"9","9"|"10","10"|"11","11"},
?{Modifier[number]}
)}$
<table>
<tr>
<th>${!skill1_roll}$Roll</th>
</tr>
<tr><td>${[{:character_skill1_dice+Modifier:d12}cs>=:difficulty:]}$ success(es)!</td>
</tr>
</table>`
nope
๐ฆ
Ok, what about coloring the dice result (tally of successes in chat). Any way to do that based on the results that are rolled?
I mean like if I roll lets say 4,6,12. Could it color the roll result green, since there's a 12 in it?
Or red if there's a 1 in it?
With cs it colors all successes green
Or black if there's both?
Yeah I get the individual results. I'm talking about the total number of successes.
That would also need scripting ๐
remove {}
Thx
There's no way to use CSS for the color thing is there?
The coloring itself is easy. Fetching the result is harder because CSB doesn't offer additional functionalities for dice-pools
Oh
Also, any idea why it breaks the line between 'Athletics' and 'roll' in the chat? There's no <br> in the macro.
Does skill1_roll contain HTML (is part of an RTA)?
It did. I removed it and it's fine now. Thx
How do deferred inline rolls work in CSB?
I put [[/roll 1d4]] in a macro and it does create a rollable inline roll fine. However, it want it to read the die from a particular character attribute.
How do I do that? Putting it in ${}$ just doesn't work.
Do it vice-versa
?
Reverse-how?
[[/r ${!...}$]]
You need !
That worked! Thx
Any way to make a radio button of a user prompt the default option?
this?
Yes
I think the first one is always the default. Otherwise you could use a User Input Dialog, which has more customization-options
Is it possible to use the ref formula in an item to refer to a field on the player character sheet?
My goal is that at the item (weapon) the player selects the attribute the item uses from a dropdown menu. Then the value of that attribute is shown in a label next to it. Just to test I tried to get a result by hardcoding it, but using both ${ref('parent.Might')}$ and ${ref('Might')}$ in the item template return no value. Using ${ref('Might')}$ in the character template does return the correct value.
Edit: if I understand correctly, to make it actually work, i should use the component key of the dropdown-menu so it would switch the value whenever a different value is chosen. but ${ref(the dropdown-key)}$ didnt work either, since it should amount to ${ref('Might')}$ in this case
One of your assumptions is wrong, and that is that parent is available in CSB-Formulas. And that is not the case. You have to use fetchFromActor() to get information from an actor.
fetchFromActor('attached', dropdownKey, 'No attached actor') should do the trick.
Thank you once again.
This is probably really stupid and there is probably a WAY easier way to do this...but it was a fun challenge to work on during my down time today.
You can format this however you'd like but this rolls 3d6 and shows the two highest and the two lowest.
${roll1:=[1d6]}$
${roll2:=[1d6]}$
${roll3:=[1d6]}$
<br>
${#highestRoll:= and(roll1 > roll2, roll1 > roll3) ? 1 : and(roll2 > roll1, roll2 > roll3) ? 2 : and(roll3 > roll1, roll3 > roll2) ? 3 : 0}$
${#middleRoll:= and(roll1 > roll2, roll1 < roll3) ? 1 :and(roll1 > roll3, roll1 < roll2) ? 1 : and(roll2 > roll1, roll2 < roll3) ? 2 : and(roll2 > roll3, roll2 < roll1) ? 2 : and(roll3 > roll1, roll3 < roll2) ? 3 : and(roll3 > roll2, roll3 < roll1) ? 3 : 0}$
${#lowestRoll:= and(roll1 < roll2, roll1 < roll3) ? 1 : and(roll2 < roll1, roll2 < roll3) ? 2 : and(roll3 < roll1, roll3 < roll2) ? 3 : 0}$
${#tiedHigh:= and(roll1 == roll2, roll1 > roll3) ? 12 : and(roll1 == roll3, roll1 > roll2) ? 13 : and(roll2 == roll3, roll2 > roll1) ? 23 : 0}$
${#th1:= tiedHigh == 12 ? 1 : tiedHigh == 13 ? 1 : tiedHigh == 23 ? 2 : 0 }$
${#th2:= tiedHigh == 12 ? 2 : tiedHigh == 13 ? 3 : tiedHigh == 23 ? 3 : 0 }$
${#tiedLow:= and(roll1 == roll2, roll1 < roll3) ? 12 : and(roll1 == roll3, roll1 < roll2) ? 13 : and(roll2 == roll3, roll2 < roll1) ? 23 : 0}$
${#tl1:= tiedLow == 12 ? 1 : tiedLow == 13 ? 1 : tiedLow == 23 ? 2 : 0 }$
${#tl2:= tiedLow == 12 ? 2 : tiedLow == 13 ? 3 : tiedLow == 23 ? 3 : 0 }$
${#allTied:= and(roll1 == roll2, roll1 == roll3) ? 123 : 0}$
2 Highest Dice =
${and(highestRoll > 0, middleRoll) > 0 ? roll${highestRoll}$: allTied > 0 ? roll1 : tiedHigh > 0 ? roll${th1}$ : tiedLow > 0 ? roll${highestRoll}$ : 0}$
${and(highestRoll > 0, middleRoll) > 0 ? roll${middleRoll}$: allTied > 0 ? roll2 : tiedHigh > 0 ? roll${th2}$ : tiedLow > 0 ? roll${tl1}$ : 0}$
<br>
2 Lowest Dice =
${and(lowestRoll > 0, middleRoll) > 0 ? roll${lowestRoll}$: allTied > 0 ? roll2 : tiedLow > 0 ? roll${tl1}$ : tiedHigh > 0 ? roll${lowestRoll}$ : 0}$
${and(lowestRoll > 0, middleRoll) > 0 ? roll${middleRoll}$: allTied > 0 ? roll3 : tiedLow > 0 ? roll${tl2}$ : tiedHigh > 0 ? roll${th2}$ : 0}$
Please feel free to mock me as much as you'd like lol it was fun either way
Or you can do this (like Torlan said) but it does not use the same dice but it's way easier.
2 highest ${[3d6k2h]}$
2 Lowest ${[3d6k2l]}$
Any reason why number labels can't be used as maximums for number fields that reference them?
They can?
For some reason it ignores it. I tried it with different fields now and it still doesn't work.
Works when it's a number label tho
What's wierder is that it works in a different world.
Not sure what's causing it.
This one uses values from a dynamic table. Maybe that's the problem?
${roll_modifier:= checkboxKey ? 'kh' : 'kl'}$
${[2d6:roll_modifier:]}$
๐
There should be no difference where the number resides. Even the type doesn't really matter, it will be cast to Number.
Maybe. Do you use sameRow() inside the max-field? There was a bug where sameRow() wouldn't work in there, but I don't know when I fixed it and if it is already fixed in the current release-version
I know it was hilariously simply to do one or the other but I thought it would be fun to create logic to roll only 3 dice and determine which of them were the highest and which were the lowest. It's absolutely pointless but it was fun!
I mean it's also some sort of training, so...
I'll take it
Is there a guide somewhere that helps me integrate Item Piles into CSB?
Has anyone used the Party Resources module. I cant get it show up on the player side and I am not sure if its just a CSB incompatibility or something else.
I use Party Resources and it works fine with CSB.
Figured out the problem. If there's a <p> and </p> inside the label text it doesn't know how to read it. Removing it did the trick.
Any idea why this doesn't work?
${#concat( ?{difficulty[:"Difficulty"][check][|7]}, ?{difficulty[:check][|3[:3]|4[:4]|5[:5]|6[:6]|7[:7]|8[:8]|9[:9]|10[:10]|11[:11]}, ?{Modifier[number]} )}$
I'm trying to have radio numbers from 3 to 11, with 7 being the default one selected.
Hi, Is there any way to create a panel that splits the sheet in a 2/3 and 1/3 ratio?
CSS should do the trick
The first option will always be the default. Otherwise you should stick to User Input Templates
Isn't this supposed to be rounding down?
Yeah, it rounds your roll result
Literally just that, no more ๐
So it should only be showing 9 rather then the 9.5 its currently showing then yeah?
or am I missing something
The 9.5 is correct. What it does is "roll, round it, divide by 2" in this order ๐
any idea how exactly? I mean how do i find the file?
Either you use the Custom CSS module or create your own CSS-file and provide the path in the settings
https://github.com/cswendrowski/FoundryVTT-Custom-CSS this coustom css?
yep
I have it installed, got this window
but i have no idea what to write into this wndow to modify this panel
I got the css of the panel form f12
now what?
Sry, but I won't teach you CSS. So figuring out the right styles is up to you.
What I can tell is that you can provide additional CSS-classes to each Component (see advanced config of a Component)
I forgot to say this but you were right and you changed my life! Thank you!
Hi! Sorry to update this again but I can't find where and how I should use "fetchFromActor", would you be able to provide more informations please?
fetchFromActor(actorName, formula, [fallbackValue])
More information can be found here: https://gitlab.com/custom-system-builder/custom-system-builder#4210-fetchfromactor
If the link doesn't take you directly to it, ctrl+F then type in "fetchFromActor"
Does anyone happen to know the default Foundry CSS class names that govern the attribute bar colors for the Token HUD?
I think the Bar Brawl module has functions that let you change resource bar colors, if that helps.
How do I properly set a property using a variable from a script? For example, setting "bonus" to whatever the value is in "i" from a loop.
if(actionSlot[i]){ ${setPropertyInEntity('self', 'bonus', %{return i}%)}$
}%```
Is there a way to limit the number of items in an item table on the actor sheet (letโs say there can only be a maximum of 5 items)?
Use the actor.update()-function instead. Example can be found here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#334-calling-macros
Nope
Good to know, thanks
Kinji was kind enough to provide the instructions for FetchfromActor. To set this up, have a weight field (lets call it "weight") on your backpack actor. This field will receive the item weights from the items in the backpack container via the item modifiers defined on your item (these are all covered in the same doc). On your character actor, have a label with a field label containing ${fetchFromActor('backpack','weight') + carriedWeight}$. This assumes the backpack actor is called "backpack". carriedWeight would be the total weight of other items on the pc actor.
Note: This solution is static. You will probably want to have a way to transfer the backpacks weight between characters. The easiest way, to my mind, will be to use a dynamic table that contains a list of the backpack and similar items (belts, etc) and uses the (unique) name of the item to fetch the weight from the "backpack" and show to weight for that item on each row using fetchfromactor, you can then total these values and add it to the characters carried weight.
How do add a default to dropdown list in a prompt?
${#concat(
?{roll_stat:'STAT?'|"Agility"|"Endurance"|"Intelligence"|"Perception"|"Presence"|"Reflexes"}
)}$
The issue with this is that I would need a new template for each new backpack since the label needs to be changed
This is not a great solution, how could I automate it, with 'target' or something else, to make it so that I can set something like "Blue backpack" to target only the "Blue backpack" actor page, but I want the "Red backpack" to target only the "Red backpack" actor page
You only need one template for all backpacks.
If the target is "Blue backpack" this will only work with blue backpack
I'm lost :(
its just like having a single PC template to cover all your PC actors. You create "blue backpack" and "green backpack" from "_backpack template" and then reference them by name.
Yes, but if the label needs to be changed for each backpack, then it needs a different template
Let's say I have a key on the "Blue backpack" item called "totalweight" that does this: ${fetchFromActor('Blue backpack','itemsweight') + weight}$ and then have the PC Actor page read the "item.totalweight" from that item and add it to its own weight
This would mean that I would need a different label for each Backpack items
No. "Blue Backpack" references the actor of the same name (build from "_backpack template"), if you need to change the reference, then you change "Blue Backpack" to "Green Backpack" (also built from "_backpack template"). You are still only using the same template for both actors.
The question comes down to whether you need an easy way to assign multiple backpacks (or utility belts) to the same character actor.
Yes, but if I want the Green backpack's item to only read the Green backpack's actor page I would need to edit the label as ${fetchFromActor('Green backpack'
This means having a different item template as you can't edit an item's page labels, you can only edit the global template
Yes, one character actor can have multiple backpack items on him
To make it a bit more clear, here is how things work as of right now:
The Player Actor page has an item container that reads the item.totalweight, this is one way for the player to see what is the total weight of their backpack with all the items
Then, there is an actor page for this Backpack that will have the item container and that stores and calculates all the item weights in one specific key: BackpackWeight
In the Backpack's item page, there is a "totalweight" key that reads specifically the weight of the backpack + the "BackpackWeight" of the Backpack actor page. There is also a modifier to add the "totalweight" to the Player actor's weight
The issue with this is that the label that searches for the "BackpackWeight" searches specifically for "Blue backpack"s actor page, not anything else
If I were to create a Green Backpack item, I would need it to read the "Green Backpack"s actor page, which means editing the label
And editing the label for each backpack means having a template for each backpack, which is hell
I hope this is more clear this way :c
And thank you for your patience, really
Try something like this on your player actor
the 'a' should be 'weight" or what what ever the weight column key is called
Weight returns as an "ERROR" for some reason
Here is how I made it, and the label text is: ${fetchFromActor(sameRow('namefield'),'BackpackWeight'}$
Hello everyone, I am spaghetti coding a macro to autoupdate the active effects on tokens based on the health bar. So far, by following the link at the bottom I managed to add effects automatically, the hooking logic works correctly. https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Scripts-for-Active-Effects
I can't understand how am I supposed to remove the active effects when the correct conditions are triggered ๐ฆ I'm trying to follow the official documentation, but all I found is the getEmbeddedCollection method.
Before going down that rabbit hole I was wondering, is there's an easier way?
I already tried with token.actor.appliedEffects.pop(e => e.name === "Wounded"); but it doesn't work, I think due to reference or actor props update issues. Code follows.
Fixed nvm
...
let isDying = token.actor.appliedEffects.find(e => e.name === "Dying");
if (dying) {
console.log("dying");
if (isDying) {
return
}else {
// Effect settings
let effectData = {
changes: [
{ key: "system.props.WOUND_MODIFIER", mode: 5, value: (token.actor.system.props.WOUND_MODIFIER) = 3 }
],
name: "Dying",
icon: "icons/svg/unconscious.svg",
tint: "#ff0000",
origin: token.document.uuid,
sourceName: "Hit",
disabled: false,
description: "This does that...",
flags: { core: { statusId: "Dying" } }
};
// Apply the effect to tokens
let activeEffect = token.actor.createEmbeddedDocuments("ActiveEffect", [effectData]);
// Script when the effect is created
ui.notifications.warn("Effect created");
}
} else if (shocked){ ...
I just posted a part, otherwise I'm gonna have to upload a file. This is how I'm adding the Active Effects. The "dying" and "shocked" variables are bools.
I may have found a solution, writing down your issues is so helpful lol
We're glad we could help ๐
hacky solution for those interested
let appliedEffects = token.actor.appliedEffects;
let effectNames = ['Wounded','Bleeding','Dying'];
let matchingIds = appliedEffects.filter(effect => effectNames.includes(effect.name)).map(effect => effect.id);
console.log(matchingIds);
token.actor.deleteEmbeddedDocuments("ActiveEffect",matchingIds);
the issue with this is that the dynamic table's weight will not update until I remove the name and rewrite it again
for example, the backpack currently returns 10kg but if I update the actor sheet's item's weight it will not update the 10kg until I manually make it refresh (removing one letter and rewriting it)
The sheet needs an update to fetch the new values. Any value-change in the sheet should be enough.
And yeah, that's the limitation of fetchFromActor(), no live-updates
any solution for this then? :(
This means that all of this is for nothing
If I still have to manually update something
The only solution I'd know would be to create a WorldScript, which listens to backpack-changes and triggers actor-changes
I never wrote scripts in Foundry VTT, any tip on how and where I could write something like this?
Well... WorldScripts should be registered via a module (either custom or the WorldScripter-module). And you need a bit of knowledge of the Foundry-API: https://foundryvtt.com/api/index.html. You want to use Hooks to register World Scripts.
Is there an easier workaround like a "refresh everything" kind of button?
What is "everything"? ๐
All actor and item pages for example
oooof, this induces a heavy load. If I'd take my Shadowrun-Campaign (50 Actors, 600 Items), that would take roundabout 10 - 30 seconds
Well, you would refresh those backpacks, but not the weight-values of the actors
I meant the _backpack actor pages
game.actors.filter(actor => actor.system.template === 'templateId').forEach(actor => actor.templateSystem.reloadTemplate()) or something like this. Check the paths of the actor with game.actors.getName('yourActorName').
But in general, it should always be actor.templateSystem.reloadTemplate() or item.templateSystem.reloadTemplate() at the end.
so basically this?
Check the paths & values of the actor with game.actors.getName('yourActorName')
You can type that into the console (F12)
You can expand it and check the properties of it (in this case, check system.template)
And I think that template expects an ID, not the name
this?
Yep, ID
Probably. Give it a go
How can I do this for _backpack item templates too?
I think that's what I need to update actually
because the dynamic table is inside an item page
left is the actor page, right is the item page
and it's the item page value that doesn't update automatically
not the actor page value
Items of an Actor are available under actor.items. Filter them and do the same as above.
I tried this but it doesn't refresh anything
I got the id from "game.items.getName('Sac bleu')"
I would want all items to be refreshed, could it be actor items but also general items
(all items with the _backpack template of course)
I don't think my screenshot has been sent so here is a copy paste:
game.actor.items.filter(item => item.system.template === 'T0i2XYaEWGChQHWK').forEach(item => item.templateSystem.reloadTemplate())
I also tried "game.items.filter" instead of actor.items
Nothing gets refreshed
There's no game.actor, it's always an Array of actors game.actors.
To be fair, game.items doesn't work either
Errors in the console?
I think your image host is dead
even just sending screens through discord doesn't work
discord is dead
add https://
to the link
Nope, that one is something different.
The macro doesn't do anything in the console then
Cut off the part after filter() and check if there are even items that pass the filter.
Execute that in the console so that you see the results directly.
${variable:=1}$
${variable=2}$
${variable}$
Why the third line outputs 1 and not 2? Can't I resssign variables that way??
try
console.info(items);```
The assignment-operator is :=, not =
Hey, back again with probably a question which is probably really obviously stated in the readme in the Gitlab page ๐
I have an item which defines what skill is used from a dropdown. Now I want a label next to it that retrieves the skill rating of this skill on the charactersheet.
I tried
fetchFromActor('attached', "fetchFromDynamicTable('playerSkillsDynamicTable', 'SkillstableSkillRating', 'SkillstableSkills', itemsWeaponsSkill)",0 Result = 0
and
fetchFromActor('attached', "fetchFromDynamicTable('playerSkillsDynamicTable', 'SkillstableSkillRating', 'SkillstableSkills', item.itemsWeaponsSkill)",0 Result = Error
Both didn't work. Can someone point me in the right direction? I am sure the keys are correct.
I wrote this section literally just a day ago and it was worth it ๐
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#317-execution-context
Yeaah, my fault. ๐
I know why this doesn't work
reloading the template doesn't update the dynamic table's value
As you can see here
Consider adding an "update" button that toggles a hidden checkbox. Toggling a check box forces the actor/item to update.
What should be the code inside the button to update the item?
${setPropertyInEntity('self', 'toggle', '${toggle ? 0 : 1}$')}$ where toggle is the key of the checkbox
How do you add buttons again? I forgot :')
Lable > Lable style > Button.
or alternatively
Label Icon > 'dice-d20'> Lable Roll Message <[roll formula here]>
The icon doesnt have to be dice-d20 either, but that is a pretty decent default.
the button updates itself every 0.1 seconds
๐ค
it breaks everything, I'm glad the undo button exists lol
it goes 0,1,0,1,0 infinitely
the refresh is happening so fast that it breaks all pages
You should never use updating-logic inside a normal Label text (if this is what you've done).
Where should I add it in the button?
Label Roll Message
Can I remove the fact it actually rolls something?
like the chat message and roll sound effect
%{throw 'done';}% at the end
I understand the general text, but I am still too noob on this whole formula stuff to truly understand it ๐
Hi guys! (Propably not so) quick question ๐
Is there a way to access and evaluate a roll inside a "Label roll message"?
The system I'm working on right now rolls 2+d6 dice for different actions and the system defines a crit as "two matching numbers inside the roll". So a roll with 3,1,3 would be a crit with the two 3s and I would like to detect that and react to it inside the roll message to add for example 'Crit!!!' to the message.
Thank you so much, everything works as intended now! I just need to remember to update all items but atleast it works :')
I guess I'm not sure how the function can help here? The script doesn't run when I try %{}% within ${}$ within %{}%
Ahoy!
From what I read the number of dice is not known beforehand. Thus you need a macro where you input the dice pool size, evaluate each roll by itself and then compare all the rolls two-by-two to check for critical result.
%{
if (actionSlot[i]) {
await entity.entity.update({'system.props.bonus': i});
}
}%
Hi gang, how would I insert a hp track like the one in World of Darkness, where you have 3 states per checkbox in a character sheet? Empty, marked with a slash and marked with a X
If that is even possible :D
Nope, not with the standard-checkbox (which has only 2 states). You'd need a Custom-Component for that: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Create-Components/Create-a-Custom-Input-Component. Or you try to realize it differently.
Alrighty, thanks!
btw, is there a solution for that? A better way to use a macro script than with that function?
You can suppress the creation of the other Chat Message with %{throw 'done';}% at the end of your Label Roll Message. This is a temporary fix until the next version is available
Nice :D
This Custom Component thing is impenetrable... I wonder if someone else has made one that I can just steal
There's currently someone implementing a Ressource Bar. Otherwise you can check the other Components in the source code if that helps you
Yeah...
It's the same question EnTropic asked. Trying to implement a three or four state checkbox
A different solution is just a dropdown list of options, but it's not as elegant as just clicking a box. And less tactile
Well, you have to know how to program with JS and HTML, that won't change ๐
I can't help with that, that's the minimum requirement for a Custom Component
Yeah, of course
No worries
Other solution ideas... Would it be possible to make a button that cycles through text when you click it?
A Label that'll change its own text when clicked
In a different sheet I had labels that would change their text based on a different component... I guess having it all in one leads to recursion issues
Yeah, you can implement something like that actually. The Example-Template has that: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads
Check out the Armor-Item-Container
Aha!
You cannot save the state in a Label, but it should be fine to save it in a Number Field or Dropdown
Right yeah, that'd work
This one?
Wow I do not get item containers at all, what the heck..
To the documentation!
The import of Item Containers is a bit broken, so you have to reselect the Templates in the Config. And then you just drop the corresponding Item
Oh, I don't have any items to drop though. So it's something that works in tandem with other things I have to make?
Because this is entirely uninteractable
Yeah, you have to create an Item
Hmmm
Shame the example sheet doesn't come with example items so I can see how it works better...
Oh
It does xD
Hmm
hey, there was a thread somewhere on this board that had a bunch of CSS tips and tricks, does anyone remember where that is?
A Discord thread or a wiki?
discord thread
I'm trying to remember how to update the item containers so it shows the item's picture larger, instead of the name
You are looking for this? https://discord.com/channels/170995199584108546/1154507115172466810
Yes! Thanks!!
so a little while ago i refactored my sheet and in doing so, decided I'd remove one of the templates that I'd been using. i forgot to like, delete all of the items from the sheet that use that template though, and now there's a bunch of junk data spitting out warnings to me. i've tried deleting them through the console, like using game.actors.get().items.delete() and going through one-by-one for each item, but it turns out that it's not saving those deleted changes (i am doing this with a shorthand by storing game.actors.get().items in a variable and deleting from there, perhaps that's why?)
in any case, is there a faster way to clean all of this corrupted data off of my sheets? it's basically just a bunch of dead items
Item Container with no template selected and delete them from there
clever, thanks so much!
How does one make "items" that have some kind of action to them? Everything has to be a macro?
Not really. It all depends on what you want to do. You can put code in the Roll Message of a Label inside the Item, for example.
At this point I'm thinking about weapons in general and some gear like night-vision goggles and stuff.
I use an NVG macro from my macro bar but eventually I want to give that to players as an item
If those Items modify actor stats, you can use Item Modifiers.
For the goggles, what do they do?
My system is not on Foundry so I'm struggling in cobbling stuff from scratch
Goggles do this:
const {visionMode} = token.document.sight;
await token.document.updateVisionMode(visionMode === "basic" ? "lightAmplification": "basic")
await token.document.update({
sight:{
range: visionMode === "basic" ? 15: 0,
angle: visionMode === "basic" ? 45: 0
}
});
I'm afraid this still requires a macro.
I am, unfortunately, forced to rely on thralls fueled by whiskey and cookies, called "buddies" for JS knowledge ๐ฆ
well you could put your macro in a compendium and then put a button in the googles item which calls that macro - then players should also be able to use it
What is a compendium? A database?
m'kay... what will it do?
i dont know if it could be called a database but in the end its a collection of things you put there
so e.g. i got a macro compendium (which is free to use for my players) which looks like that
Ok...
in there there are macros which call the real macro like that
let macroName = "Attack Macro";
let key = "world.helper-macros"
let pack = game.packs.get(key);
let macro = (await pack.getDocuments()).find(i => (i.name === macroName));
await macro.execute();
i did this so players cant alter the real macro
but after all you could just put this call also in a label (have to use script expression = %{}% for that)
like, choose how they can attack?
So I have to make a database of weapons and equipment so that the player can use a macro in the compendium to use said entry
for example you could put your googles-macro in a compendium and call this via a button on the sheet
no
FFS, I'm coming to the realization that Foundry was a big mistake if I don't understand Java and coding
thats not true
it just depends how much automation you want
for everything else CSB is a easy starting point
like your task with the googles is advanced stuff which helps with automation but is not required
I want barely any automation, because we play F2F at a table with a screen on which I run the map and tokens
the thing is, I'm trying to go for effects that my players could toggle and functional gear
yeah
thats difficult stuff
for that stuff you need JS - but thats true for every VTT there is
for animation/effects/functions you need programming
later maybe NPC weapons with sounds
playing sounds on a button press = macro = programming
We play Warhammer 40k Dark Heresy 1ed. which is non-existent for regular Foundry.
I'm trying to adapt as much as I can.
i guess all the stuff you want needs programming in one way or another - in foundry that would be JS - for other VTT i dont know
I have a programmer-friend but there are limits to buggering people for help
even with whiskey and cookies
It does look good and stuff but I can't get the functionality I need from it.
OK, all this time using CSB and I've never done this before. I am working on the Daggerheart playtest and I want the player to choose a Class from a dropdown list and have that choice populate another control on the sheet with that Classes Feature ability. Any ideas?
So a Dropdown, that is dependent on another Dropdown?
I can hard code the options using custom, but I'd love to make it more flexible so there isn't a major effort when they change classes
You can put Scripts into Label Roll Message, so executing them from a Sheet is not an issue. About the programming-part: Yeah, you need a bit of JS-knowledge, that won't change ๐
Formula-option?
not sure what you mean.
at the moment the Class Feature is the same for all characters of that class, so I'm trying to have a label in the lower left of the sheet that updates with the correct text for the class feature when the player selects/changes their class from a dropdown at the top.
What about having a class-item, that modifies the right fields?
A Dropdown can contain a Formula, so that the options can populate dynamically.
I could make a Class item and add a Feature field and use a pair of linked ITCs
Is there some template for a 'ranged weapon' that would make a specific roll against a target?
Maybe play a sound with it?
Would be great if I could add an image and be able to give it to an NPC?
Sound -> Scripting.
Target properties -> fetchFromActor('target', ...)
Adjusting Token Image -> Scripting
That's how the char sheet looks like
It'd probably be better to have Weapons as Items instead of using a Dynamic Table. But that's up to you.
I don't know the difference ๐ฆ
I kinda jumped into Foundry to get a great experience for my group but hell, this is way bigger than I can manage
Well, more automations means more work. If you need an Example, you can download the Example-Sheet from here: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads
You need to fix the Item Containers by reselecting the right Item Templates. Besides that, everything should work from the get-go.
Thanks.
Hello. How can I access an owned item's name in a character sheet formula? Can I access the name directly or do I have to have a field on the item with the item's name?
name
Ah wait, from the Actor Sheet?
item.name
Yep
Thanks!
Had a question for @formal goblet . Wanted a roll in a userInputTemplate to populate a field(label) inside the template. The roll works, but I can't figure out how to 'send' it to the label. have "${setPropertyInEntity('self', 'fumble', [1d20])}$" and 'self' returns it properly to the actor sheet, but I want it to return to a different field on the InputTemplate itself and don't know what I should replace 'self' with. Thanks!
Wait wait wait, I have so many questions...
- Roll in a User Input Template?
- Populate a Label inside a Template?
setPropertyInEntity()in combination with a User Input Template?
I advise to be more precise with the words you use ๐ . You can also post an example, that would also help.
sorry, trying to build a full system, something I have wanted to do for a while, but not a coder. So I have on the character sheet a label which pulls up a userInputTemplate. I have a button label which when pressed rolls a 1d20. I want the result to show up in another label on the userInputTemplate. If I use the previous code it will return it properly to 'fumble' on the character sheet, but I don't want it to return there, I want it to return to a label on the userInputTemplate where the d20 icon is in the picture with the key 'fate'. setPropertyInEntity() seemed like the best choice to do this.
Yeah, nope... The current User Input Template was not build to have dynamic value changes. So setProperty will not work there at all. If you have complex Dialogs, use your own Scripts (which can be tricky for a non-coder).
I haven't dug into scripts so much yet, but now I know that is where I have to go, thanks!
That worked, Martin. A bit ugly and needs some styling, but I turned Class into an item, made 2 item containers on the sheet that both referenced on that type of item and displayed the fields I need on the bottom one.
I think I can surpress the <a> link/item card in the bottom box using CSS. (I don't need the "Bard" card in the bottom box)
Why 2 Item Containers? You can set up Item Modifiers, which set/modify Labels on the Actor Sheet
Hi! Does anyone know why my radio button value returns "object Object" when trying to link it to a number field from which the key is also the group key of the radio buttons?
This is a Text Field, not a Radio Button
My radio buttons all are from the group "HP", and all render a value from 1 to 5 (not injured to very injured)
I want to read the value and also be able to change which radio buttons is activated without opening the sheet (changing the attribute from a token bar), but when creating a number field with the key "HP", it does this
radio buttons cannot be clicked and it only renders object Object
I see the issue. Well, Radio Button Groups are only meant for Radio Buttons to share, not for other Fields.
It is not possible to link them to an attribute bar? :(
Probably not how you'd like. You can create custom attribute bars, which can take formulas. But the downside would be that the Token wouldn't be able to change the values directly, it must be done through the Actor Sheet then
I could link them with the props.keyValue on the ressources tag but the dots won't check correctly when editing from the token
However, as seen in the bottom left of the sheet, the value updates correctly
Is there really no way for the radio buttons to read "ok I am 4 now so I should check the button that renders the value 4"?
I think that this is the issue. I'd have to investigate more, because I've never considered this case (which implies that it was never intended this way) ๐
The Attribute Bar was only meant to be synced with Number Fields, not with other Components
You can add conditions with "condition ? true : false" but can you add "else if"?
Like "${HP == 5 ? 'untouched' : HP == 4 ? 'scratched' : HP == 3 ? 'Lacerated'}$" etc..
Ok I didn't think it would work if I wrote it like this, it was just for the example
But it turns out it's actually how you do the else if
lol
I got my answer
I have no idea how to work with Item Modifiers. I'll try to look through the documentation.
I'm having a hard time understanding what one would practically do with an Item Modifier. Is it a way to do things like mimic Active Effects? For example, would that be a way to update a Character's Strength if they add and item called "Ring of Strength" that has an Item Modifier on it?
Yeah, that's more or less how it works
I'm having an issue with the "Heartbeat" module, it cannot read the HP attribute value for some reason
Health estimate works prefectly though
actor seems undefined. Maybe you need a different path (like starting from system instead)
I just fixed it, the solution was "actor.attributeBar.HP.value", I'll keep this post here in case anyone in the future has the same issue
Wait, what? That doesn't seem right ๐
. I'd understand if it was under actor.system.attributeBar or system.attributeBar, but actor.attributeBar is kinda weird.
Yeah, that one is more logical
Do you know any way I can re-do that vision macro into some grainy greyscale 'thermal vision'?
Not really, sorry. Never played around with vision at all. I just suppose you could tinker around and find the combination that suites your needs.
Hi guys, How long, everything ok?
I have a problem with my HP attribute, the maximum hp has a formula, [constitution + (an attribute)d(another attribute) ], I tried to make it work but I had some specific problems with the roll.
How could I do this?
I did it this way but it doesn't seem to be adding up (PV = HP)
"con_valor + inicial_pv = 31"
@formal goblet
Goggles do this:
const {visionMode} = token.document.sight;
await token.document.updateVisionMode(visionMode === "basic" ? "lightAmplification": "basic")
await token.document.update({
sight:{
range: visionMode === "basic" ? 15: 0,
angle: visionMode === "basic" ? 45: 0
}
});
Do you happen to know a way to change this effect to something like grainy monochrome 'thermal vision'?
Macro-polo Channel is your friend there
I tried, no success.
You know what? Iโve felt for a long while that the CSB community is in desperate need of a video tutorial/review/intro thing. As a fellow human with ZERO coding or programming experience, trying to learn how to do any of this over text chat isโฆ [redacted]. So, even tho I mostly have no idea what Iโm talking about, Iโm gonna try to work on making some videos. At least on where and how to find the info needed to start building and using CSB and then some basic stuff that Iโve learned. I wish to at least lessen the amount of floundering Iโve noticed while constantly lurking in here. I have no idea when this will happen, but Iโll try my best.
@formal goblet @brittle moth Please let me know if I might be overstepping by doing something like this. ๐
Anyone write any CSS to shrink the size of a Panel (set to Grid of 3) with each cell only containing unlabled Checkboxes?
We have nothing against it if someone is doing videos about the system. I also had that idea, but I had other priorities.
Nope, that's Foundry-core. That has nothing to do with our system
${#'BOX_ARROWS' ? '${#setPropertyInEntity('self', 'NUM_ARROWS', "NUM_ARROWS - 1")}$' : '0'}$ I am missing something simple here im sure, but this still subtracts even if set to false.
I also tried this ${#'BOX_ARROWS' ? '${#setPropertyInEntity('self', 'NUM_ARROWS', "NUM_ARROWS - 1")}$' : '${#setPropertyInEntity('self', 'NUM_ARROWS', "NUM_ARROWS + 0")}$'}$ but that just reset back to 0 every time. reguardless of true or false checked.
Ah... I see, I swear my dyslexia is getting worse lol thanks as always.
I'm using a dynamic table where I want it to include an optional text field as part of a message, but sameRow is returning 0 when it's blank. Is there a way to get it to leave it blank?
Good question... I don't know why it is even returning 0 at this point... What about if the 2nd arg of sameRow() is an empty string?
Tried '' and ' '. Both threw me an error
You cannot use Roll Formulas [] in Label text, you can only do that in Label Roll Messages
What's the error?
Correction, those still return 0. Leaving the option after the comma blank threw the error
Here's the snippet, if that helps.
<h3>Damage: ${sameRow('roll7',0)}$</h3>
<h4><b>Roll: </b>${[1d10x10] + sameRow('roll3')}$</h4>
<B>Notes: </b><i>${sameRow('roll8')}$</i>```
Is the capital letter at the beginning intended for Roll2?
Yeah. I was sloppy with the keys.
So sameRow('roll8', '') still returns 0?
Yup. Just tried it again to be sure
Heh... Could be a bug
The ones for Roll2 and roll3 do the same when I leave them blank too.
Can you open a ticket for that? I'll look at it later.
Sure
Oh I realize it may have been on your mind. We are all very busy people here, you are extremely helpful, and we appreciate it!
Curious can a specific item be tracked through a label outside of an inventory? Like If I had 5 potions and I wanted that to show in a label on another tab could that be done?
I am trying to set up a roll that can just roll the dice formula under the damage column in a dynamic table
This does not seem to work: ${#dice:= sameRow('weapon_damage')}$ ${[dice]}$
Ok I got it to work, I have to surround the key/variable with :, like so
${#dice:= sameRow('weapon_damage')}$
${consoleLog(dice)}
${[:dice:]}$
How could I make it so that instead of adding items multiple times inside an item container it instead increases the item.Quantity value of that item?
Does not ItemPile do that?
Is my quantity value not setup correctly?
Hmm...I do not remember now. Let me check... Anyway, I think it should be under item props.
well yeah but it mentions not to add the "item." to the path
Can't seem to find the info and my pc isn't accessible at the moment. I know it is the hard way, but you could create an actor and the connected token, then use the console to traverse the data structure till you get to the items.
Sorry mate, I'd like to help really.
This is correct - as long as you provide on the item sheet a number field with the key "Quantity".
You mean in the item?
Yes, I think
Yes
Thanks ๐๐ป
won't stack tho
Ah, just read the above part of your question.
Item piles will not do this automatically and also not CSB.
But you can make the label inside the item container add/subtract 1 if you click/shift-click on the quantity label.
Use the setPropertyInEntity function.
So, not drag/drop one more on the sheet.
How do i do this shift click shenaningan? ๐ค
Mine are:
-${item.name}$${setPropertyInEntity('item', 'quantity', "item.quantity - 1")}$รผbrig
+${item.name}$${setPropertyInEntity('item', 'quantity', "item.quantity + 1")}$รผbrig
I want a chat printout if a player changes his quantity.
I add those in the label text?
No, first in roll message -second in alternative roll message.
I think I have a hiccup in my brain.
I have a matrix that has to be equal for every actor (so no sense for dynamic table) and via two dropdowns (collum, row) I want to get the one exact value out of it for further calculations.
Can maybe someone push me in the right direction how to do this.
Why not dynamic table? I think you can set it in the template, values and all, and that should solve the issue.
Damit, I have overseen the + button.
I know there was a hiccup.
Thank you mate.
Greetings! I'm new to this and there are many things I don't understand about the wiki. I want an object to use a value from the character sheet, but I don't know how. My idea is that from the object sheet, you can use an attack and damage button. I really appreciate your help.
Is there a way to add a row to the top of this table or a way to rearrange the rows ?
Just drag the components to a free slot and switch what you need.
You're a lifesaver
Object Sheet? Do you mean Items? If so, you can use fetchFromActor() to fetch data from an Actor.
TY โค๏ธ I'll try
A question just to save me some time ๐ :how do item containers behave inside a Dynamic Table?
My goal: create a dynamic table in which every line is a unique spell book. Every spell book has a number of spells, a number of so called 'immuto' that affect the spells (change the range or damage for instance). It would be great if I can just use the item containers to add the spells and immuto as items, but I doubt it is possible to add spells to a specific item container because that spell book contains those specific spells.
They are incompatible with each other
Too bad
Good evening gents!
I'm trying to do some math in here for the rolls, but strugling to make this work.
Which formula would be the best to roll from one character and compare the result with target actor atribute?
${roll_result:= [1d20]}$
${#target_ac:= fetchFromActor('target', "AC", -99)}$
${target_ac == -99 ? 'No target selected' : roll_result >= target_ac ? 'Attack hit' : 'Attack missed'}$
thanks, will try that
Worked nicely!
Hey guys, how's it going?
I'm trying to use scroll macros because in the system I'm putting together, there's a test attack scroll, and if it succeeds, there's a damage scroll, and occasionally a status test scroll. All tests use character sheet keys, both for the selected characters and the target characters. I'm having difficulty developing the script. Does anyone have a script as an example that would allow me to build from this example?
The Wiki has some: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/home
You can also check the Example in the last section of the Formula System - Guide
Besides that, I hope you know how to programm, because you have to use Javascript.
I've already looked at this documentation several times, seen the examples, but I think I'm not getting anything by the looks of it haha! Maybe it's because my English is terrible (I'm Brazilian), I don't know, everything seems confusing to me. That's why I asked if there was an example script of a complete scroll using the character sheet keys. Thanks, I'll keep trying to understand this!
My programming knowledge is very basic as well. But it's just that the way I need it, there's no other way; it would have to be done only via macro. Because the custom system builder naturally can't understand a conditional to roll only if that condition is true. It rolls regardless of the result of the condition.
You can start of with basic stuff like %{console.warn(entity);}% in a random Label Roll Message. This will log the whole entity-object in the console, so that you can inspect it with F12. This contains all data an Actor has.
How do I get a dynamic table number field to display the result of a roll? Like I can the outcome I want in chat but it wont change in the Dynamic table. I'm sure I'm over looking something in the wiki =/
Your Formula cannot find something under the path NUM_AMMO. You can test it by using ${NUM_AMMO}$. You'll see that this won't display anything. The reason behind this is that NUM_AMMO is a key within a DynamicTable, so the full path would be something like Ranged_Weapons_Table.0.NUM_AMMO. So you need a function, which can return the path of the column of the same row. And that would be this here: https://gitlab.com/custom-system-builder/custom-system-builder#425-samerowref
Ah ok thanks.
Is there a YT vid or something showing what the Item Type: SubTemplate and UserInputTemplates are for?
Haven't found any.
SubTemplates are basically template parts you can reuse in different templates.
UserInputTemplates are useful if you plan to have lots of user inputs, but this is my '2 cents'...
I guessed as much, but my learning style leans heavily toward Visual over reading. ๐
Oh, I see. Then I cannot be of help, sorry pal.
Maybe there's another way you can help @fierce harbor. is there a console path that would fetch the template used such as:
game.items.getName('thing-0001').wibbly.wobbly.template
As suggested by @formal goblet , you could try putting %{console.warn(entity)}% inside a Label Roll Message of the item and look at the console to inspect it in search of the bit you need.
Hello there! Nice to meet you all!
I wanted to ask, how do I get an attribute from the selected token in a script, as I would in the sheet? For instance ${mp}$ ? For some reason, it seems like token.actor.system.props is always undefined for me.
canvas.tokens.controlled.map(controlled => controlled.actor)
Thanks a lot, that works! Deleted some of my messages since I accidentally placed a template in a scene so it obviously did not have props
Is there any way to sort items that are in an item container? It looks like it's first come first serve atm.
Will come with the next version
Thank you!
okay so I tried putting ${item.textareakey}$ in the roll message for an item container label and all it's giving me is this
oh wait what
it works with one template but not the other o.OOO
okay I figured all of that out--next question:
Is it possible to embed a deferred roll into a rich text area that would then be clickable once that area is put in chat with a roll message?
example:
Ability description says "You can use your action to make a claw attack. On a hit, you deal 1d6 piercing damage." When it goes to chat, you can click "claw attack" and it'll roll your d20, and then you can click the "1d6 piercing damage" and it'll roll your 1d6.
Hi ! Quick question : is it possible to call a macro within the Initiative Formula, or is it only a direct dice roll/actor skill fetch ?
Good question. Can you use %{return 1;}% inside it?
[[/r 1d20]]?
ohhh I'm dumb I was trying to put a ${}$ inside a ${}$
That can also work, but has a completely different effect.
wait really? I've never been able to get it to work--how do you do it?
Last example has such case.
oh oh you do the %%'s for one of them okay!
I'm struggling with building an OSR-adjacent sheet for relatively simple characters. I have probably not done it precisely appropriately, but I have the following:
- One template for use by PCs and henchmen
- One template for classesto store permanent values associated with that class
- A character for each class using classTemplate (classFighter, classMage, etc.)
The PC template has a dropdown to select a class, and then refers to the sheet containing the permanent information (i.e. a fighter would refer to "classFighter" where the attack progression, saves, etc. are stored). This makes it quick to build a custom class since I can just input the relevant values.
Most of the progression for a class can be done with math (saves, to-hit, etc.) as a function of level; however, some things are not smooth and my maximum goal is to declutter the PC sheets because they will have a lot of them. I'm stuck on thief skills which do not progress smoothly. A lookup table is the most obvious solution but I'm struggling building one.
My problems are A) I don't want superfluous information on the PC sheet (i.e., showing thief skills for non-thieves), and I don't want to have to show seven thirty-six row lookup tables on every classXYZ where they aren't relevant. I tried using an Item Container and making each thief skill an Item that could be slotted into classXYZ, but I can't figure out how to, for example, fetch a value from a dynamic table in an item attached to classXYZ corresponding to the row number of the level of a PC, where the item is not attached to the PC.
Having written this out I have one new idea to try, but any insight is appreciated. I'm sure further information would be required for a full answer but I won't continue to blast potentially insignificant context.
(I may have just found it by passing the whole dynamic table array as an item modifier to the classXYZ then using math.js to parse that array by level)
I have passed a 2D array with fetchFromDynamicTable as a modifier on the item pertaining to a particular thief skill, which outputs a comma separated number that doesn't seem to behave like an array, so I'm stuck unless I can parse this long number using array.shift or something else
for anyone who read my tirade above, the magic line was:
%{return Array(${fetchFromActor(ref('class sheet'),'skill key')}$).at(${level}$)}%
had to make the csv string into an array within a js script
this is now solved
It worked, so I tried executing my macro :
The macro did work but the initiative got an error
You have to return a value
yeah it should get the result value from the macro is it ?
Yep
Oof, I think at this point I'd do it completely in JS. Arrays aren't handled well in CSB ๐
I've got a var inside the macro ("totalSuccesses") that returns the final result as a number
how would I fetch this in the formula ?
Just return
And await because macro calls are async
can't believe I didn't find this part on the wiki
thanks !
I noticed. For now I think I will skip the middleman and create comma separated lookups