#Custom System Builder
1 messages · Page 27 of 1
hi gang
i'm looking for combat encounter formula, did someone know how to use?
it's similar to roll 20's "&{tracker}"
i looked on csb gitlab, but don't finded
You can configure the initiative formula in the settings, if it's that what you're looking for.
how exactly?
The official website and community for Foundry Virtual Tabletop.
Do you know where the settings are?
This case has some complexity. You have to know how to fetch the right data from Chat Messages and how to apply damage (without permission-violations, because Users are not allowed to modify Actor Sheets they do not own), so it's actually not a trivial matter.
is there a way to use more than one fontawesome icon in the label icon section of a label?
nope. If you want more, use the icon classes in your own HTML-tags
k thanks
How can I opt in into the beta version of the next CSB build btw? 😛
Has anyone managed to make Token Action HUD run with CSB?
It worked initially without me doing anything, but now it shows no token whatsowever 🤷🏻♂️
I removed it.
for some reason
it is not showing the dice rolls
for
uh
like 2d12kh
it just shows the final resault
do you have any idea what might cause this
I tried installing it fresh, and... it just doesnt show anything when i select a token
No option in the settings and no selectable dropdowns on the top left
Is this the same with u too?
Just to confirm
No, all the normal buttons show up on the token. Alas, no token is added to the action bar, no matter what I do.
Hmmmmm then mine is weird then, it doesn't even consider any actions to exist
Any compatibility message shown on the module after installation?
And...stupid question...is it active?
Nnnope. Nothing at all.
No console message either.
And it is active
I also tried on a fresh install of CSB with 0 modules
The settings doesn't even appear in the option
Hm...I'm at a loss. No idea of what's going on.
Version difference, maybe?
Might be, but it should say something about it in the module window, where all installed modules are shown.
okay it does show the result normally
im just crazy
however it does not for the roll button
it's a minor thing
it seems to be working
but its a little annoying to not be able to see the rolls
and KNOW that its working
does anyone know
how to refrence an attribute within an item container
outside fo the container itself
Not doable, because attributes of Item Containers are not stored in the props.
What you can do instead is referencing Items and their props, if you wanna do that: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Items
I'm trying to make an HP bar, and it just will not work. Both charCurrHealth and charMaxHealth are the keys for number fields, but for some reason, it doesn't pick up their values when they're set.
Am I doing something wrong here?
I've also tried a number field with a maximum value. It recognizes charCurrHealth, but not charMaxHealth. I've even tried putting ${} around it or starting with #, but nothing works. It just will not recognize charMaxHealth even though it's a number field.
maximum value should be ${charMaxHealth}$
Ah, that worked. Thanks!
if a conditional is met, I want an 'offhandequpped' dropdown to go to the blank default value. I am at a loss for what I would call to do this
Is there any way to roll dice pools in custom system builder...?
It's a basic FoundryVTT feature
https://foundryvtt.com/article/dice-advanced/
The official website and community for Foundry Virtual Tabletop.
Thankyou!
so I made a duplicate
of a sheet to test somthing
and in the duplicate everything works
except the outfit
it doesn't work specifically
because of attribute temperance
when I remove that from the function
it works
pictured here
however if I refrence it anywhere outside the item container
it works
does this have to do with it being a duplicate?
if so
why does this outfit still work fine
I have a question that I don't think can be answered here but I'm going to ask anyway: I'm playing around with the Foundry To Discord addon, which will send messages in Foundry's chatbox to a designated Discord channel using webhooks. Cool.
I would like to know if anyone has any ideas why a dice roll accomplished through a CSB sheet using a Label item and Label roll message wouldn't send at all. Like it doesn't even send a blank message, it just doesn't send anything at all
I have never used the Foundry to Discord but just wanna ask... do you need a command or setting or something to send a message to discord or is it by default anything in chat? Maybe you can add a command to your rolls or something.
it's default anything, yeah
I thought maybe I'd need a prefix or something, but nope
Like so
Regular rolls send, too
It's probably some quirk of how the label roll messages are created, it's honestly not a big deal. I'm just playing around with PbP solutions
oh, I wonder if it's just a simple settings issue..
This addon is mostly made for D&D and PF, as all things are
Nope. Alas
All good, this is totally unimportant
where is my mistake on the initiative formula?
Is it possible to put my own system of RPG in the Foundry, because i know there isnt any other system in the database that is similar to mine… So i want to make my own. That way it will make things very much easier to me… Is it Possible?
You can use CSB for that, it's its job so to say 😉
CSB can do almost everything you want, the difficulty will vary as sometimes you will want to design things CSB is not designed to do
You can start by having a look at the project page here:
https://gitlab.com/custom-system-builder/custom-system-builder
And the wiki, too:
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/home
🙂
Like what?
Thx
To let you down early though, CSB is not designed for: stackable items and stackable status effects
No need for an initiative button on the sheet: just add token to the combat then roll init from there.
You will have to use modules for that
CSB can natively do almost everything you want; in terms of complex itemization and stackable active effects, however, you will have to seek alternatives in module 😛
I recommend importing examples to use as your reference
https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
Ok, that will be very helpful
However, passive effects will do fine, right?
yes
@vagrant hollow Hey! Sorry for the ping, but I really need your familiarity with Item Piles, how do you merge items? Buying two items twice causes them to duplicate instead of merging 😵💫
I'll try tommorrow, but i really wanna a button
Does this happen with all items?
It's the only item I have
With very limited variables, only price and quantity
In Configure Settings > Item Piles > System Specific Settings, make sure you have Similarities configured to go by name and type.
just name and type?
oh my gooood that works like a charm
thanks so much!

by any chance do you know how to set the default price of an item, but for secondary currency? xD
like this is where you set default price, but for the primary currency
Any ideas if the same can be done with secondary currencies?
Go to the item, click Configure and it will be under Price Settings. Add a purchase option.
Ahhh okay, no way to set default pricing for secondary currency then?
The purchase options are how you'd do that, unless I'm misunderstanding you.
@half beacon Oh, no, the default price is 1, I'm wondering if there's a way to set default per item
I would like a macro for the following situation:
The player has 100 Mana. He clicks on "cast spell" and enters the amount of Mana he will spend. Then, I would like a macro that automatically reduces the value entered in the Mana attribute of the character sheet.
Can someone help me plz?
No need for macro. You can do this with a label roll message using the “setPropertyInEntity” function.
${#setPropertyInEntity('self', 'mana', "mana - manaused")}$
https://gitlab.com/custom-system-builder/custom-system-builder#4211-setpropertyinentity
Can someone help me with why this doesn't work?
ItemType is a Dropdown List with 3 options, one being ItemWeapon
${Weapon:= 'ItemWeapon'}$
${Weapon}$
${sameRow('ItemType') == Weapon ? 1 : 0}$
In the console i'm just getting "Cannot convert "ItemWeapon" to a number
would this work in the Visibility Formula?
Not exactly sure what is happening here, but one my character sheets when I run a console warn entity to look at the data, the props looks like this image. Sometimes, it doesn't even list all the undefineds and just omits them, but I can't figure out the conditions that that is happening exactly.
Any advice on how to resolve this? Seemingly is on all char sheets and across widely varied label formats. EDIT: I found it. A ternary was missing some quotes and it caused the sheet to render very poorly. No idea why, but resolved, I think.
Change it from 1 to what you want the default to be.
Looking at it a bit more, my issue is on every label, everything else is populating.
For example, if you are using Soul Points as a currency for buying something like Abilities, but using items as Abilities. You can go to the item, click Configure, then set Base Price to 0 in the Price Settings menu. Then add a Purchase Option for Soul Points. Let's say the Ability "Heaven's Cleaver" should cost 5 Soul Points. Change the cost from 1 to 5. Then when you drag it onto a merchant, the selling price will always be 5 Soul Points.
hiya! struggling a bit with my rest button. I want to display current health before rest, when players click a button to restore health. I can make the button work for the mechanic I want, but the html table is displaying stuff weird. Here is the extract and you can see the 6/6 HP is all clunked up. Any idea how to beautify this? Thanks
<table>
<th>${!name}$ profite d'un instant de répit pour récupérer: ${!recupScore}$ HP</th>
<tr>
<td>HP actuel </td>
<td> ${! ref('health_curent_field') }$ </td>
<td>/ ${! ref('health_max_field') }$ </td>
</tr>
</table>
The Component is either visible all the time or not at all, i've tried alot of different things, but now i'm pretty much out of ideas
You might want to set the width of the second table row via CSS.
There's a bug in the current patch with sameRow() in visibility formulas. This is fixed with the upcoming patch
I was dreading this answer 😄
Or use CSS-Grid in the first place 😛
just added <td style="width:20%;"> and this works fine. Thanks for the pointers
Hmm. When I my world, I'm getting a warning that says "Failed data preparation for Actor.. Cannot read properties of undefined (reading 'key')", but I'm not actually sure where it's coming from. Any ideas on narrowing it down?
Unrelated question: I have a dynamic table where players can enter their roles. Most roles have a rank that's set by the player, but class roles are determined by level. Is there a way to have one version of the rank column for normal roles and another for class roles, without having two columns?
Is there a way to remove the scrollbars on a character sheet if I have prevent resizing set?
Optimization question: If an Item, internally, has a dropdown and multiple copies of that item get added to a character's sheet will the sheet end up containing multiple copies of the dropdown or just the selected value?
I'm still struggling to get links to work right. I know they don't work in compendium and you have to update it with the actual copy that's put in an individual's character sheet, but that's still not working. Can anyone help me out?
do you also need setPropertyInEntity in the item modifiers, or is that something else? I'm trying to get it so that if, say, my player adds a species that gives them a walking speed of 40 feet, their character sheet movement data auto-updates when the species is added to it
Are you handling species as an item?
yep!
Then you'll want to use item modifiers.
i know that much, i just haven't figured out how to use them properly
Ok. Well, you shouldn't need to use setPropertyInEntity to make an item modifier modify a variable.
You set them up on the item by clicking the Configure Item Modifiers on the item's template. I haven't used them myself, but the basics seem pretty straight forward, for something like adding one fixed value to another. The key field is the key for the value you want to modify. The formula is what it changes by. In this case, you probably want something like ${Walking-Speed-Key}$ and then you'd need a field on the item with a key of Walking-Speed-Key and I think that should do it?
*Note: I'm not sure if you actually need the ${}$, since there's a bit of inconsistency there and it doesn't specify.
any idea what I'm missing here?
oh wait I got it!
I thought I'd tried it without the @ before but apparently not--just walk_speed worked
thanks for your help!
What's the proper way to make a in-sheet ability macro usable from the main hotbar? I can't drag the roll button, main edit or alt edit button to the hotbar, and I assume "paste the whole thing and then redo all the formatting" isn't the intended method.
Right click.
Then choose one of the "Add as macro" optoins.
There we are.
What were you trying to do with links?
okay now what am I missing? booleans aren't working, and +1 to a number field isn't working
I'm trying to link items so that if there's a skill associated with a species, like a claw attack for a certain monster, a player's copy of the species links to the player's copy of the attack in the species description
https://gitlab.com/custom-system-builder/custom-system-builder You should CTRL+F Item modifiers (I'd give you a direct link, but it has a tendency to go to the wrong part of the page).
Item modifiers can't add to number fields, only labels.
For the proficiencies, how are they being stored on the character sheet?
If you're using the equal sign, it should be able to apply to more things, but that's directly setting them, not adding to them. I don't know if it can apply to checkboxes, but just to be sure, where are those check boxes stored (are they on a different item or in a dynamic table)?
just on the character sheet
After playing with it briefly, it doesn't seem to like playing with Checkboxes.
yeah I'm not having any luck either
and now I'm wondering if the number field for speed actually worked either...I think it doesn't
If it was adding the speed it didn't.
The documentation is a little bit ambiguous, but my guess is that it means the "The set-operation can set non-number labels, but it's still restricted to labels."
Does the console show errors?
CSS should do the trick
Wouldn't that be 2 different Dynamic Tables?
Nope. Class Role is just a different type of role. In the end, I just added a checkbox for it and set the cost column to 0 if it gets checked. Player's will have to enter their rank manually, but 🤷.
ahh gotcha--couldn't tell if that meant it could do other types of component or just non-number labels
For some reason, actor.system.body is undefined in your case. I don't know why tbh
I see token-mold in the call-chain, maybe it's interfering?
is there a way to use the setPropertyInEntity to edit number fields and such when an item is added?
Nope
rip
that's okay, I mostly wanted it for character creation
just to confirm though--that function does work on number fields when it's in a label roll message? or does it only apply to labels, too?
(like, if I have someone deducting spell slots when they put a spell in chat, does the total have to be a label?)
That actually works for only non-labels 😄
schweet okay that's where I'll want it for functionality, so that's great
while you're here, do you know what my issue with item linking is?
no matter what I can think of to try, I get this each time
I had it working once but no more
My guess is that the ID's don't match. What's the raw roll message?
just this
Species Attack. You gain the @UUID[Item.yzF24aanXAMXdguI]{Hoof Attack} skill. Noble Steed. You gain the @UUID[z4v2mAAaEZIr4y6S]{Noble Steed} skill.
clearly I tried both with Item.(ID) and with just the ID 😛
it doesn't work whether I link the compendium ID or the actual ID of the real item copy in the character sheet
Maybe, but I'm not sure why or how it would do that? How did you see it was actor.system.body that was undefined and is there a way to see which character is having that issue?
You can try out this in the console: game.actors.filter(actor => !actor.system.body).map(actor => actor.name)
That's very weird. I'm pretty sure all of my characters have bodies, since that's where most of their character sheets are defined. One of them had an empty top-level key for their body, but I changed that back and I'm still getting the same error. (Not sure why literally only one of my characters had an empty key, which migh tbe another thing to look into.)
I think that just returned an empty array.
Well... now it gets tricky... Can you open the sheets of all characters?
As far as I can tell? Yes.
I mean, clicking on each character opens the sheet I'd expect and doesn't seem to return any errors. So, yes?
I DID IT
Does the Template also work? If so, I have no clue from where the error originates.
Yup.
Check this one here: https://github.com/Moerill/token-mold/blob/ecdcd5a97e295aa7c27947781b077b22f693c10e/scripts/token-mold.js#L948
is there any way to pull the item image into the link?
Don't know, the @-syntax comes from Foundry and not from CSB. Maybe there's a way to define options.
Ok. I disabled Token Mold and that error seems to have gone away, but I'm not sure if that's a coincidence or not, because I started getting a new, weird, error. (It started before I disabled token mold and continued after.) Here's the new error:
This one has the formula and the props attached
There are two things about this that are weird: First, the Mook formula its referencing only exists on characters created with the _Monster template (this character was created before that template even existed). Second, it only seems to happen if I create a token or interact with the token prototype screen when it's set to be unlinked.
It does, but I'm pretty sure those props shouldn't exist on this character.
Oh, also, the actual monster characters don't seem to have that error. Or, at least, the values those formulas are connected to seem to be working fine.
Unlinked Tokens are creating copies of an Actor
So you might have an outdated Token
It happens when I create a new one?
Ok, if it happens when you create new ones, then you should check the formula and fix the error. It should be ... ? ... : ... instead of ... ? ... , ...
Ok. It looks like the _Character Template got its HP values replaced with the _Monster Template values. So that at least is fixed. ... I think.
Alright. The original error definitely seems to be tied to Token Mold, since wasn't their while I had the module disabled and reappeared as soon as I enabled it. Token Mold, in general also seems to be having some trouble with CSB, since none of the values you'd expect are available as bar values. That's unfortunate, but I'm glad I figured that out sooner, rather than later.
Thank you for the help.
That is what I figured, I don't know how to reference the character sheets though, assume I can call it in a macro and have it run on load or something, didn't know if there was an easier way.
Inspect the HTML of the sheet and check which classes it has. Then you can simply add styling-rules for that class. You can use the CustomCSS-module for that.
class was "custom-system-actor-content". Excellent explanation, I almost asked like 6 questions, including "how do I inspect the HTML"... but I got there! You are a king.
I figured out a convenient way to be able to reference an image
(in the hidden attributes)
Hi there,
I am a bit lost with the conditional tests done on CSB. I am trying to create a conditional roll depending of the state from a checkbox (if it is checked, a roll is done, if not, no roll).
When I do a script like this :
${chk_ADV? notify('info', 'ADV coché') : notify('info', 'ADV pas coché')}$
it works as attended : depending if it is check or not, the good notification is displayed. If I replace the "notify" function by a roll :
${chk_ADV? [1d6] : notify('info', 'ADV pas coché')}$
the two conditions are played : I have a roll AND the notification...
If you have any clue on this behavior, I'll take it 😉 Thanks !
Is the notification always sent or only on checkbox being false?
I believe it has to do with rolls always being rolled no matter what the test outcome is.
Not sure, though.
Found this and the wiki:
The ternary will execute all parts regardless of the condition. For example:
isActive ? notify('info', 'This is active') : notify('info', 'This is not active') will execute both
notify()-functions regardless of the condition it will evaluate to. You should use it this way instead to prevent the
problem of double-execution: notify('info', isActive ? 'This is active' : 'This is not active'). This is a limitation
by the system, so be careful with that. Usually it´s not a problem, because most of the time CSB-Formulas are not
performing any active actions, but it will become one if you combine conditionals with actions (like notify() or
setPropertyInEntity()). If you still need short-circuiting conditionals, use
Script-Expressions instead.
What is very surprising is the behavior is not as described in the wiki (that is maybe outdated) : only one part is executed (I have 2 notifications and not 4).
I think you are right on the roll mecanism that is always launched : depending of the check state, the formula will send the roll result (if checked) or "do nothing" (like a 0 result with the dice).
My requirement is essentially esthetical : each time I click on the Attribute for the Roll, I would have only 1 dice (none checkbox), 2 dices (only one checkbox) or 3 dices (2 checkboxes) - but for any activation, I always have 3 dices thrown.
It can be confusing for the players.
If I use this formula :
${#Car:=[1d6+:CAR:]}$
${#For:=chk_FOR?[1d6]:+0}$
${#Adv:=chk_ADV?[1d6]:+0}$
<p>Résultat : ${Car+For-Adv}$</p>
The result is like in the screenshot - that's what I want except there is too much dices thrown 😛
${#dices:= 1 + (chk_FOR ? 1 : 0) + (chk_ADV ? 1 : 0)}$
${[:dices:d6] + CAR}$
So a few days ago, I managed to get setPropertyInEntity to trigger somewhere 'bad', as once I reloaded the sheet, the dropdown it referenced became 'stuck' and I couldn't change the selection. I since found a better way, but now have a want for it to get 'stuck' on something else.
Is setPropertyInEntity disabled in the label message?
meaning if I put setPropertyInEntity in the 'label text (optional)' area, it won't work at all?
nvm, just got it on my next attempt. It will work in that area.
You should only use it in Label Roll Messages. Other places are problematic
Yea, I saw that. In the label text area it forces the set to keep repeating on sheet change. That's what you mean by problematic right? So it will just basically force the set over and over. Are there other problems? Because that is what I want it to do.
It can potentially cycle updates, because sheet-changes trigger updates, setPropertyInEntity triggers sheet-changes...
ok, I understand what you are saying I think, 'cycle updates' will cause a kind of bad looping behavior? something like an infinite loop in layman's terms?
It might, never tested tbf
But it's definitely something I cannot recommend, even if it's intentional. Use Labels if values are dependent on other sources
whenever I try to have a label display to chat using a key or a dice roll command I get the error 'Cannot read properties of undefined (reading '0')'. The error comes up whenever I enclose the Label roll message in ${ }$. So if I have the label roll message be a simple string like 'hello world', clicking on the label will display that text, but if I replace it withj ${[1d6]}$ (or anything else inside the delimiters) I get the above error. Any idea what's happening?
I need the full error message and the Label Roll Message in question
The full error message is 'Cannot read properties of undefined (reading '0')'.
Including additional information like formula & props. You can find that at the bottom of the error message
It happens for any Label Roll Message enclosed in ${ }$. For example, it happens when the Label Roll Message is ${[1d6]}$.
For example, if I create a new world, with no content, create a new item template, and within that template I create a Lable whose Label Roll Message is Hello World. When I make an item with that template and click, it will display Hello World. If I instead make the Label Roll Message be ${[1d6]}$, I get the error message displayed on the VTT. There is nothin else in the error message.
Ok, can you screenshot the stack-trace?
I also need Foundry and CSB-Version and the Browser
Press F12 and you'll see the error message in the console
Will look like this one here: #1037072885044477962 message
is this what you're looking for?
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
at Tokenizer.stateBeforeEntity (/home/ubuntu/foundry/resources/app/node_modules/htmlparser2/lib/Tokenizer.js:584:47)
at Tokenizer.parse (/home/ubuntu/foundry/resources/app/node_modules/htmlparser2/lib/Tokenizer.js:848:26)
at Tokenizer.write (/home/ubuntu/foundry/resources/app/node_modules/htmlparser2/lib/Tokenizer.js:159:14)
at Parser.write (/home/ubuntu/foundry/resources/app/node_modules/htmlparser2/lib/Parser.js:459:28)
at sanitizeHtml (/home/ubuntu/foundry/resources/app/node_modules/sanitize-html/index.js:588:10)
at cleanHTML (/home/ubuntu/foundry/resources/app/dist/database/validators.mjs:1:233)
at HTMLField.sanitizeHTMLField [as sanitize] (/home/ubuntu/foundry/resources/app/dist/database/sanitization.mjs:1:1235)
at Function._sanitizeFields (/home/ubuntu/foundry/resources/app/dist/database/backend/server-document.mjs:1:7729)
at Function.sanitizeUserInput (/home/ubuntu/foundry/resources/app/dist/database/backend/server-document.mjs:1:7436)
at ServerDatabaseBackend._createDocuments (/home/ubuntu/foundry/resources/app/dist/database/backend/server-backend.mjs:1:2611)
Disable Tokenizer and see what you get?
will try
Tokenizer module was not enabled - only active module was chat commander. Same behavior happened with Tokenizer enabled and disabled...
are any modules other than chat commander required for CSB?
Nope, literally the only one
Is this useful?
fetch @ foundry.js:68326
notify @ foundry.js:68223
error @ foundry.js:68260
_handleError @ foundry.js:3468
(anonymous) @ foundry.js:3450
value @ socket.js:532
value @ socket.js:459
L.emit @ index.mjs:136
(anonymous) @ manager.js:207
Promise.then (async)
Nope. Does the error occur with other game systems?
If so, you might want to get help from Foundry-Staff directly.
it hasn't occurred with other game systems. Are the ${ }$ delimiters part of CSB, part of chat commander, or standard JavaScript? (Excuse my ignorance...)
thanks. something about the way foundry is configured for me doesn't seem to like it.
using chrome. I have the instance of foundry hosted on a server from Oracle.
sounds like the exact problem I've had, right down to using ubuntu. I'll try the clean install of Foundry recommended there. Thanks for your help!
Yeah, I remembered that someone had that issue some time ago
Just closing the loop - that worked! Thanks for running it down for me, much appreciated.
Ok, I know that I know this, but... what do I type in the console again to go digging through the props on the currently selected actor?
canvas.tokens.controlled[0]?.actor.system.props
Small 'bug' potentially; when I reset all items, and the checkbox option 'checked by default' is unset, it isn't registering the box as false, but as null/undefined until it is clicked and unclicked, which is causing items to 'disappear' on the character sheet the way I have it setup because of a filter in the item containers displaying only when they are false. Can work around it, just thought I'd let you know.
Already tackled with the upcoming version 😅
Oh nice. I just went through and reversed all the logic to make it work. Maybe I'll switch it back................ ..... ..... ...
It should be enough for most cases to check for truthy values instead of for true
can the item container filters check for truthy?
also, %{throw 'done';}% gives an error, but it stops the message from going to chat, which is what I want, I can just ignore that error, right?
Good question... Don't think so, at least not the old ones
So I didn't waste my time. Nice.
Yep, seems intended
cool
Good thing is that there'll be an option to disable chat message creation with the upcoming version 😅
this is big brain right here
Mmmmh interesting approach...The "ADV" dice result has to be substracted from the result but I will explore it... Thanks 🙂
TADA !
${#dices_pos:= 1 + (chk_FOR ? 1 : 0)}$
${#dice_neg:= 0 + (chk_ADV ? 1 : 0)}$
${[:dices_pos:d6] + CAR - [:dice_neg:d6]}$
Thanks for the help @formal goblet
BTW is there a way to reference sections from an actor in a journal? Like I can link them with the uuid but is there a way to show parts of their character sheet like image, a stat, something in a drop down, etc.
Uhm... I'd say try out the @-syntax to reference props. Otherwise idk, we haven't worked with Journals
is there any documentation for the @-syntax? I was looking like crazy the other day and could not find anything beyond the uuid directly
Dunno, that's Foundry-specific
thanks, yeah, they do not talk about it much I know we are getting embedding in v12 maybe I wait
Hi !
I have an item whose accessibility I'd like to change on the character sheet according to my character's level.
I have a field on my _equipableitem that looks up the character's level on his character sheet and compares it to the level defined on the item's sheet, assigning a value equal to 1 in a field (perso_level). When this value =1, the item appears on the character sheet.
I'd like this value to return to 0 when the character's level reaches 5.
How can I do this?
With Itemmodifiers? If so, how do I use this function?
Does CSB has any component to put in images? Or ways around it?
Label with <img> should do the trick
okay
I did some snooping
on an error
and
I found an issue I have no idea how to fix
so i'm trying to make a way to do rollable stats
and I copy it
and do the whole thing
but this breaks the outfit
specifcally the dice power attribute refrence
for the item container
but not dice max?
and I spent a while doing various bug testing things
and I finally found
the issue
if I use any character sheet templete
other then chracter sheet
even if it's an identical duplicate
dice power breaks
if use any characters sheet other then guy
dice power breaks
if I use character sheet on guy
it works
if I use character sheet on guy2
it breaks
if I use character sheet 2 which is exactly identical to characters sheet
on guy
it breaks
I
I dont know how to fix this
please somebody help me
if you can
no pressure
fetchFromActor('attached', "level >= 5 ? 1 : 0") for perso_level. No need for item modifiers, because you doi not change stats of the Actor with the Item
@tardy rain 2 things:
- Please post only 1 message instead of multiple ones to reduce spamming. It doesn't matter if the Chat Message is a bit longer.
- Please describe the issue in an understandable manner, so that I know at which parts I should look at (what Components are involved (including the keys), what is the expected behavior, what is the actual behavior, what error message is shown (you can check the console with F12 for that))
If I refer to a number field that has a minimum value set and change it from somewhere else, in this case, a dialog prompt, it doesn't respect the minimum value. Is this known? Am I doing something silly?
It's known and is not considered to be a bug, just as a missing feature
Workarounds? just have to put ternary anytime it might be an issue?
Use min() or max() to cap the result
cool, thanks
Also, and totally unrelated, is there a way to add an item to a player sheet without dragging and dropping it?
a CSB way, to be more precise.
Would require your own Script
that's what I thought, didn't see it in any documentation but figured I would check cuz noob
can you retrieve a template name from an item?
what I'd like to do is say, have both weapons and general features in the same item container for a simplified monster sheet
for the roll message when putting the item in chat, I'd like to be able to say, basically "if weapon, include attack/damage buttons in chat; if not, don't"
The template-id is stored under system.template. With that, you can find the template-item and the corresponding name with game.items.get(templateId).name
How would one get a ref function in an item container to search for Keys in the item instead of the charger sheet. Or otherwise a way to display a rich text area from a item to display via a roll on a item container label
You prefix the key with item.
The problem that I have is it doesn’t actually parse the item. Probably, I would assume because refs input is a string
So it just doesn’t have any result because ref can’t find a key with the name “item.outfit_type” at least that’s the best idea I have of what’s going on
You won't need ref() if you have just ${item.outfit_type}$
It also returns a null value if I do that, weather on the outfit or the character sheet directly referencing the variable returns a null value. I assume this is smth weird about it’s data type because it’s a rich text value. Ref was a great workaround but with the container I’m having this issue now
It's still just a string at the end, so there shouldn't be any issues with that.
You can check in the console if the item in question contains the right properties via game.actors.getName('actorName').items.getName('itemName').system.props
Ah that’s super helpful, I’ll try the tomorrow see if I can corner the issue more effectively with this and hopefully fix it. Thank you!
I have a rich text panel embedded into a dynamic table, how do I make it so when I click the item I send it to chat?
Do I add a button? if so what do I need to add as variables to reference the entry on the same row
Normally, you would put something in the roll section of the label to signify this is what goes in the chat window.
If you just want it to read out text it's something like ${"text goes here"}$ if you want it to roll something use the roll commands. I am away from my pc or I would paste some examples for you. Hope this helps -note: I am doing this off memory so check the wiki if it doesnt work
Can anyone point me in the right direction for what the proper call would be to add an item to a character sheet from a script?
Actor#createEmbeddedDocuments() should be the right one. Consult the API-Documentation from Foundry for more information about it
ok, thanks
and to delete items I can use the linkedEntity "%{linkedEntity.delete()}%" in the CSB documentation, right? Or is that only on able to be referenced from an item?
You can use that, yeah. But be careful with that 😅 . delete() works for both Actors and Items. Just be 100% sure that you have the right reference
it won't delete templates though, right? I can just test on a new creation in a copied template
It can delete Templates, because they are also instance of Actor or Item
ok, definitely using copies then. good to know
If you delete a concrete Item with it, it won't delete the Template as well. Only if you explicitly delete the Template
Yep, better safe than sorry
Hello! is there a way to select multiple tokens and pass them all as arguments to setPropertyInEntity, or do I have to create a loop of some sort? I manage just fine with one entity, but I would love pointers to mass setPropertyInEntity
We break it down to the first selected/targeted token. If you need multi-select, you'd need your own Script for that. Also be aware that players don't have permission to update Actors they do not own. The module "Warpgate" can help with that issue, but requires the work with their API
thanks, i'll stick to this one-by-one approach for now
Thank you, I think I will go with having a button that rolls the text!
When referencing text with ${}$ inside a dynamic table, would it be able to pick up the corresponding row's data with just the column ID?
Also, a bit unrelated to the previous question, but is it possible to make dynamic tables extend horizontally instead of vertically?
sameRow() is made for that
Maybe it's doable with CSS, but I can't tell for sure. That's something I have never tested.
Thank you, that's what I was looking for!
I suppose I'll look into CSS for the table flip!
Speaking of CSS, are there any tutorials of how to implement CSS in CSB? I just want to add basic outlines and stuff so my character sheets don't look so hideous.
The way I did it was to create a module that only loaded a single CSS file that I used to customize my CSB sheet.
You can do so from the configuration screen via the wizard, and then add a "styles": ["path/to/your.css"] to the module.json alongside the CSS file.
There is also a module on foundry called ‘Custom CSS’ that is super easy to use and doesn’t require messing with any of the files outside of your vtt session.
Sorry for bombarding this place with questions, but I am looking for a way to add a button inline on a label specifially within a switchCase
I have one set up as such and I want the dice rolls to be clickable and rollable
${switchCase(weapon_1_type, 'small_weapon', '1d4+1', 'medium_weapon', '1d6+1', 'large_weapon', '1d10', 'ranged_weapon', '[[/r 1d8]]。20mまで攻撃可能', 'spell','魔術触媒を必要とする魔術が使用できるようになる', 0)}$
I tried [[/r ]] but it didn't seem to work
Alright, I realized that I could add a switch case to the click field as such
${switchCase(weapon_1_type, 'small_weapon', '${Roll:=[1d4+1]}$', 'medium_weapon', '${Roll:=[1d6+1]}$', 'large_weapon', '${Roll:=[1d10]}$', 'ranged_weapon', 'Roll:=${[1d8]}$', 'spell','${Roll:=[0]}$', "")}$
But when I do this, all the dies are rolled at once on dice so nice, is there a better way to implement conditional damage that I am missing?
${#Roll:= switchCase(weapon_1_type, 'small_weapon', '1d4+1', ...)}$
${[:Roll:]}$
Thank you, that worked!!
Heya, I'd like to ask for one more thing,
I have this roll here that is supposed to use two setPropertyInEntity to set one value to 0 and then update another by half the value that was zeroed.
I am running them in the following order, but when I click the button it fails to set damage to zero the first press, but it successfully sets damage to zero the second press always.
scar always gets updated regardless.
If I change the order then damage gets set to 0 first and it breaks, but I find it weird because I am using a variable which should go around that...
What am I missing here?
<h1>ダメージ治療</h1>
${DamageValue:= damage}$点のダメージを傷痕にしました。<br>
傷痕が${floor(DamageValue/2)}$増えました。
${#setPropertyInEntity('self', 'scar', "scar + floor(DamageValue/2)")}$
${#setPropertyInEntity('self', 'damage', 0)}$
${#recalculate('${damage}$')}$
There's a bug in the current version if you use multiple ones. That's fixed with the upcoming patch.
Ah... gotcha, any way to go around that for a first release before the update hits?
I don't mind if it's dirty so yeah
Thouhg it's weird, I could swear it worked when I was first building this button...
You can write your own little update-script. CSB allows Javascript, check these sections here:
Thank you, I'll look into it!
${#concat(string(?{more:'Spheres?'[number]|0}), string(?{Lock:'Aspect?'[check]|0}))}$
${ref(sameRow('ACCS'))}$ ◄ CS | AD ► ${#Aspect:= ref(AspectLocked)}$ ${AD:= [:Lock:d:Aspect:]}$
So, in this one if the player checks the checkbox "Lock: 'Aspect?'[check" it doesn't register as '1' when using it in the [:Lock:d:Aspect:]
What am I doing wrong?
Also, hi!
It works if I set it to [number] instead of [check] though
how does one embed a macro in a sheet
Is there a diffrent way to append strings in a roll message, + and emptey space both try to convert the strings to numbers
Is that "<p>Info</p>" in a label?
rich text area
can't help you then, I figured a workaround for labels with prefixes and suffixes, but the rich text area automatically applies those even if you take them out in source
Why is intiative not working
When I try to roll intiative
It just shows these d20 symbols
How do I say it to roll d whatever + stat
And when I set it like this the D6 only rolls 0
Use concat() instead of +
[d:whatever:] + stat
oh so only the d needs to be in
the brackets
gotcha
Also for resources
We have HP Max and HP value
But how do I get it so a resource bar on a token would look at both
So like it'll say 90/100
Have a number field with a defined max-value and the system will create an attribute bar for you
does anyone know how I get this popup to stop happening? it's been a long time since I messed with the system and don't understand what's causing it. I think I tried to use items at some point but couldn't do what I wanted with them. I don't have any anywhere as far as I can tell though and I get this popup anytime I click anything on the token. it doesn't hinder me doing anything it's just annoying to see constantly
It means that an Item the Actor owns doesn't have a valid template anymore. You can fix this by creating an Item Container with no filters selected and fixing/removing the Item in question.
awesome thank you
I deleted the item container in the template not realizing the item stays behind
Items are linked to Actors, not to Item Containers
can you use %{ brackets inside a ComputablePhrase?
So I'm trying to get it to add the StatUsed onto the damaged, so if the drop down menu is on str adds str value same with dex and acc ect any advice on how to to it?
I never got an answer to this one..
If anyone knows one
Also, I have a new question, this one I imagine rather simple;
${#concat(string(?{Roll:'Roll'|[2d10],"Normal"|[3d10kh2],"Advantage"|[4d10kh2],"Domination"|[3d10kl2],"Disadvantage"|[4d10kl2],"Submission"}), string(?{CS:'Character Score?'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'Method'[number]|0}), string(?{Sphere:'Spheres?'[number]|0}), string(?{Lock:'Aspect?'[number]|0}), string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= ref(AspectLocked)}$ ${AD:= [:Lock:d:Aspect:]}$
TOTAL
${(floor(Roll + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + ((Sphere)*2) + AD}$
${Energy}$ = ${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
${CharName}$
It works just fine, but I don't know how to make it roll with Dice so Nice.
There was this option:
${#concat(string(?{Dice:'Number of Dice'[number]|2}), string(?{Roll:'Roll'|"kh2","Keep Highest"|"kl2","Keep Lowest"}), string(?{CS:'Character Score?'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'Method'[number]|0}), string(?{Sphere:'Spheres?'[number]|0}), string(?{Lock:'Aspect?'[number]|0}), string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= ref(AspectLocked)}$ ${AD:= [:Lock:d:Aspect:]}$
TOTAL
${(floor([:Dice:d10:Roll:] + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + ((Sphere)*2) + AD}$
${Energy}$ = ${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
${CharName}$
But I'd rather have as few prompts as possible.
Yeah
Check won't return a number
Take the upper ones and replace [] with strings ''
Alrighty, thanks!
Where do you find the attributeBar on custom tokens? I'm super confused and can't find the values at all. I was running:
if(enemy.size == 0 || enemy.size > 1){
console.log('Failure!')
ui.notifications.error('Please target a single token.')
}
else {
console.log('Success!')
console.log(enemy.system.attributeBar.charCurrHealth)
}```
But this just returns an error that 'system' is undefined. If I remove 'system', then it says charCurrHealth is undefined instead...
Also tried this in the console, and it doesn't work, seemingly
Replace actorName 😅
With what?
-Oooh, I seeee.
I'm still stumped on how to find token attribute bars, though - I'm trying to make a simple combat macro that subtracts the damage from the target's health (charCurrHealth).
system is only present in Actor, not Token. They contain different data. But you can directly access the data of the Actor via token.actor from the Token instance.
You also have an additional assumption error. enemy is an Array of Tokens, not a single Token. You should handle the Array accordingly.
Thank you!
Sorry for all the dumb questions, but - how do I handle the array accordingly? I tried to start simple by assigning the first entry in the array to something else, but that just gets me 'undefined' when I console.log it.
let target = 0
if(enemy.size == 0 || enemy.size > 1){
console.log('Failure!')
ui.notifications.error('Please target a single token.')
}
else {
console.log('Success!')
let target = enemy[0]
console.log(target)
}```
The double-declaration of target is concerning. Otherwise I can't spot the issue. Can you log enemy right after the initialization?
Btw, enemies would semantically be better.
Oh god, you're right, I did it again. Sadly, the double declaration didn't seem to be the issue, though -
console.log('enemies: ', enemies)
let target = 0
if(enemies.size == 0 || enemies.size > 1){
console.log('Failure!')
ui.notifications.error('Please target a single token.')
}
else {
console.log('Success!')
target = enemies[0]
console.log('target: ', target)
}```
...Yields the same result:
enemies seems to be some other sort of Collection. Try this approach here: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/formulas/Formula.js?ref_type=heads#L689
Something like this? let enemies = game.user.targets.values().next().value?.actor;
This will directly fetch the actor if present
So if I use that to subtract their health, would that apply to the document and not the token if it's unlinked? Sorry, I'm a little confused >.>
If the Token is unlinked, it will have its own copy of Actor data
WoAH IT WORKS! Thank you so much! 🙏
Which one of these would have the NumberField's current value for this actor? I'm trying to fetch the actor's armor class so I can use it for calculating damage.
...Oh, wait. Would this be easier to accomplish with hidden attributes?
It's in system.props - nevermind, I should've noticed that! 😅
Yeah, this is the internal Component data. That's mostly too deep 😅
Hi. Is it normal that link entries aren't computed within text areas in items ?
Wdym with link entries not computed?
I see: @....
Links only work if you are using a rich-text-area with !important! style set to “dialog-editor”
What a trick ! Thanks so much !
This key does not exist. Maybe it's a typo or it's available in a different entity.
When a player runs a script macro to subtract from an enemy's current health, for some reason it ticks down the value in console, but on my end the enemy's hp bar looks completely the same, and their character sheet doesn't change even if it's linked. I dunno what's going wrong here.
The value persists between uses of the same script, but it resets when the player logs out and logs back in again.
Is it because they don't own the sheet they're targetting?
You have to perform an explicit update-operation, otherwise changes will not be saved
What's that?
See the last line of the last example: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Items
This is an additional problem with users lacking permission to update sheets they do not own
So, like:
item.update({'enemies.system.attributeBar.charCurrHealth.value': enemiesNewHealth})```
this?
Wait, it wouldn't be item, huh? Would it be token?
Ok, I settled on using actor.update instead. Now to find a module to help with the permissions problem 🤔
Warpgate
this
always evaluates to true even when the statement is not true, and I cannot figure out why at all
okay I see now, it's assinging it
but If I use any other amount of equal signs it refuses to compare the strings
and throws an error saying the data type cant be converted into a interger which isnt even what i'm doing
Before I drive myself nuts...how do I assign calculable numerical values to the items in a dropdown list? I'm trying to make a table of skill groups, and each category (Background Skills, Field Skills, and Action Skills) costs 1, 2, or 3 points per level, respectively.
EDIT: Never mind, looks like I'll have to use switchCase.
more specifically how do I compare two strings to see if they are they same, as =, ==, === do not work
equalText(). I know that it's dumb, but don't blame me. It's the library 😅
it worked, thanks for your help, gonna go slam my head against a table now 👍
I have attempted to define a max value however it is not applying for the token
You also have to select the attribute bar in the token. Not props
I see
Does anyone have an inventory sheet? I am having a hard time coming up with a concept and design that works really well. Would love to see others
All right, so I've got a Dynamic Table that I'm using as a list of skills, and I'd like each skill to feature one or more skill specialties that can be selected from during skill rolls, and also which add to the point cost of the skill if more than one specialty is selected. Is there any way to do that?
Does changing attributeBar really update that value on the actor?
let enemies = game.user.targets.values().next().value?.actor
let enemiesHealth = enemies.system.attributeBar.charCurrHealth.value
let armorDO = 1
console.log('enemiesHealth: ', enemiesHealth)
let enemiesNewHealth = enemiesHealth - armorDO
await enemies.update({'system.attributeBar.charCurrHealth.value': enemiesNewHealth})
console.log('enemiesNewHealth: ', enemiesNewHealth, ' charCurrHealth: ', enemies.system.attributeBar.charCurrHealth.value)```
Logs this in the console:
So I'm not sure if I'm using the right thing at all. It finds the correct value for health, can subtract from it, but after updating it doesn't stick at all.
You update the property. Attribute Bar gets updated automatically afterwards.
So I was looking in the wrong place... Where would I find property?
actor.system.props.key. Actor and key are meant to be replaced by whatever you have.
Oh my god it finally works! Thank you so much!
The only Component which allows multi-selects is the Checkbox. But that one is not really dynamic, so you might need your own Script with a Dialog...
All right...then would I need to use %{ }% scripts to separate a comma-delimited string into an array?
Why would you need to convert a CSV to an Array?
For one thing, characters will be able to optionally select a skill specialization when doing a skill roll. For another, the skill point cost of a skill will depend on a combination of the genre of the campaign and the number of skill specializations chosen for it.
Each skill gets one specialization for free, and each specialization after it costs an additional skill point.
Is it always 1 Specialization, that can be selected during a Roll or is it 1 - n?
So...if a character had the Animal Training skill (2 points/level) at Level 3, and had "Foxes, Horses, Raccoons" in its specialization for that skill, it would cost 2 * 3 + (3 -1) = 8 points.
One specialization per roll.
Ok, that makes it easier
At least for the roll part
But there can be endless specializations for 1 Skill, right?
Yes.
Ok, so that one is 1 - n...
And due to the way this particular system works, any number of custom skills or skill specializations can be added.
Yeah, I see the issue
What I'm thinking of is having one Dynamic Table row for each skill, having a text field for all selected specializations for that skill, and having the total cost and the skill roll formula make use of an array made from the delimited list.
You could create a 2nd Dynamic Table, which holds the relations between Skills and Specializations. With that, we can determine, how many Specs a Skill and which it has.
A second dynamic table that isn't a child of the first?
A bit like databasing
The first table would be a list of skills...
The second table would be a list of specializations, and one of the fields is a dropdown list that uses the skills from the first table as its values...
That sound workable?
can one specialization have multiple skills
Seems fine
Please no n - m 😂
No. One specialization is attached to one skill, but one skill can have multiple specializations.
Then that works yeah
Only thing to figure out now is how to count up the cost of the specializations with each skill getting one free specialization.
Seems like a -1 at least 😅
This is so confusing...
X = Amount of Specs
Skill Cost = X - 1 (the easy part)
Well, yeah, but I need to make sure that each specialty gets one free—wait, derp. I think I may have figured it out.
X = number of specs
Y = number of distinct skills in the second table
Cost = X - Y
Well, a Skill with 1 Spec would cost 0.
Wait, you want the total cost of all Skills?
So if you have 10 specializations split across 3 distinct skills, the cost of the specializations alone would be 7.
If it's linear, then yeah
Thank you so much for the advice so far!
What have you tried so far? And what is your challenge?
Sure, np
Question now is, how would one count the number of distinct values in a column?
Would setDistinct() work there?
EDIT: Asked and answered: yes it does!
That didn't work, :/
${#concat(string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}), string(?{CS:'CHARACTER SCORE'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'METHOD/TRAIT'[number]|0}), string(?{Lock:'ASPECT?'[number]|0}), string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= ref(AspectLocked)}$ ${AD:= [:Lock:d:Aspect:]}$
TOTAL
${(floor(Roll + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + ((Sphere)*2) + AD}$
${Energy}$ = ${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
${CharName}$
Now it says it cannot convert the "3d10kh2" and so on.
Another one
${setPropertyInEntity('self', sameRow('CSpheres'), sameRow('CSpheres') + [min(1,(1d2-1))])}$
This does not modify the CSpheres, no errors, it rolls normally.
I may be dumb. Now I'm having a hard time finding an at least relatively easy way of calculating the average of stats depending on which ones are selected via checkbox (e.g. If the checkbox for just the Body stat is checked, it will give the Body stat; if only the Body and Mind stats have their boxes checked, it will average just those two; if Body, Mind, and Soul are all checked, it averages all of them).
To average them out just sum each one and divide it by the number of selected stats. However, I don't think you can set a checkbox to hold a value, in which case you could make those checkboxes be equal to the key of the stat, and make a label that sums them and averages between.
What I was hoping for was a way to check which checkboxes are checked, and only average the stats corresponding to those checkboxes.
I know how to do stuff with radials, since they can hold values, but checkboxes seem to be mostly aesthetic.
I mean, you can use hidden attributes.
So like, if the useBody checkbox is checked, then stat_Body is added to and averaged in the calculation.
I'm not sure I understand your request.
I personally use multiple item containers on the character sheet for several purposes and decided to build a separate sheet for backpacks/carry animals/wagons.
Do you want screenshots or something else?
Yeah, one sec.
You can create a hidden attribute that equals to "body * (Checkbox1Value)"
so, if the checkbox is checked, it's equal to 1.
and it produces the value of Body
When rolling a skill check, this dialog comes up. I was just hoping there was an easy way to do this so I could just use math.mean() or something.
Instead of having to use ${floor((stat_Body * useBody + stat_Mind * useMind + stat_Soul * useSoul) / (useBody + useMind + useSoul))}$
Which...isn't working properly, anyway, evidently.
${concat(string(?{BodyKey:'BODY'[check]|0}), string(?{MindKey:'MIND'[check]|0}), string(?{SoulKey:'SOUL'[check]|0}), string(?{Bonus:'Sitchbonus'[number]|0}))}$
TOTAL
${((BodyKey+MindKey+SoulKey)/3)+Sitchbonus}$
I'm thinking something like this
but I'd have to test it
.
So, if the key of the selection is the same key as the numberfield with these values
it should work?
Hang on, trying to figure out your example.
The roll keeps coming back "ERROR".
IF the checkbox produces a value of 1. Or if the Key1, 2 and 3 there becomes a 1 if checked.
Then you might be able to do:
${concat(string(?{Key1:'BODY'[check]|0}), string(?{Key2:'MIND'[check]|0}), string(?{Key3:'SOUL'[check]|0}), string(?{Bonus:'Sitchbonus'[number]|0}))}$
TOTAL
${(((Key1*BodyKey)+(Key2*MindKey)+(Key3*SoulKey))/3)+Sitchbonus}$
What does the console say?
Main problem with that one is the /3. I want it to divide by the number of boxes checked (not every skill will use all three stats).
Can you paste your entire code here?
?{useBody:"Use Body"[check]},
?{useMind:"Use Mind"[check]},
?{useSoul:"Use Soul"[check]},
?{sitBonus:"Situational bonus"[number]|0}
)}$
<h2>${!sameRow('skill', "Skill")}$ Roll</h2>
<p>${sameRow('skill_Level') + floor((stat_Body * :useBody: + stat_Mind * :useMind: + stat_Soul * :useSoul:) / (:useBody: + :useMind: + :useSoul:)}$</p>```
But if it is not checked, it'll be a 0, therefore it won't divide by it.
There's a difference between dividing 5, 0, and 5 by 3, and dividing 5 and 5 by 2.
Oh, I forgot that, which is literally what I said before
no problem though
just divide it by Key1+Key2+Key3
Oh, that's what you did
So, what's the problem? The checkboxes do not give back a 1 or a 0?
I don't know. "ERROR" isn't very helpful.
Oh yeah, seems like a problem I was having yesterday, Martin had this to say about it.
Ih
oh*
You're missing a bracket
${#concat(
?{useBody:"Use Body"[check]},
?{useMind:"Use Mind"[check]},
?{useSoul:"Use Soul"[check]},
?{sitBonus:"Situational bonus"[number]|0}
)}$
<h2>${!sameRow('skill', "Skill")}$ Roll</h2>
<p>${sameRow('skill_Level') + floor((stat_Body * :useBody: + stat_Mind * :useMind: + stat_Soul * :useSoul:) / (:useBody: + :useMind: + :useSoul:))}$</p>
Try this instead
Oh, at the end of floor()?
ye
But yeah, martin told me yesterday that checkboxes do not return a number
I wanted to add a checkbox to a roll as well
Hmm...
I don't know what the utility of checkboxes is in that case though. I remember using them at some point, where I think they added a +2, and it worked
lemme open the VTT and see if I still have that sheet.
hmm
I do
and it still works
${?{CS:'Character Score?'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}}$◄ CS |
${?{Sphere:"Spend Sphere?"[check]}}$ ◄ Sphere
TOTAL
${(floor(([2d10]) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + ((Sphere)*2)}$
This works, you see, "Sphere *2" equals to 2 in the result
So, what does it say in the console when you use this one in particular?
With the bracket closed
${#concat(string(?{useBody:'Use Body'[check]}),
string(?{useMind:'Use Mind'[check]}),
string(?{useSoul:"Use Soul"[check]}),
string(?{sitBonus:"Situational bonus"[number]|0})
)}$
${!sameRow('skill', "Skill")}$ Roll
${sameRow('skill_Level') + floor((stat_Body * :useBody: + stat_Mind * :useMind: + stat_Soul * :useSoul:) / (:useBody: + :useMind: + :useSoul:))}$
Try this
Same result.
I'm gonna try treating useBody, useMind, and useSoul as if they're not interchangeable with 0 and 1 and see if that changes anything.
${#concat(string(?{useBody:'Use Body'[check]}),
string(?{useMind:'Use Mind'[check]}),
string(?{useSoul:"Use Soul"[check]}),
string(?{sitBonus:"Situational bonus"[number]|0})
)}$
${!sameRow('skill', "Skill")}$ Roll
${sameRow('skill_Level') + floor((stat_Body * useBody + stat_Mind * useMind + stat_Soul * useSoul) / (useBody + useMind + useSoul))}$
I don't think you need the : :, I usually only use them for rolls, I don't know if it's having an impact, but I removed them
!!! That did it! Thank you so much!
:O
I don't know much of JS so I thought you must've known something I didn't to be using them
so I didn't even think of that
XD
No problem
actually, that made me realize that I CAN actually do that thing Martin said I couldn't, :P
so thanks for that.
I usually only use the colons for :keything:d:anotherKey?: instances
Checks returning a number is a good win
I've forgotten what using colons like that is even good for.
Gonna bump my questions back :P
${#concat(string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}), string(?{CS:'CHARACTER SCORE'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'METHOD/TRAIT'[number]|0}), string(?{Lock:'ASPECT?'[number]|0}), string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= ref(AspectLocked)}$ ${AD:= [:Lock:d:Aspect:]}$
TOTAL
${(floor(Roll + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + ((Sphere)*2) + AD}$
${Energy}$ = ${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
${CharName}$
Says it can't compute my 3d10kh and so on.
if I switch their ' ' with [] it works, but it doesn't roll on Dice So Nice, which I want it to do.
AAND
${setPropertyInEntity('self', sameRow('CSpheres'), sameRow('CSpheres') + [min(1,(1d2-1))])}$
This does not modify the CSpheres number-field, no errors and it rolls normally.
This is in a dynamic table.
Hello there ^^
Don't want to interupt you so I can come back later to ask my question.
I started using Custom system builder last week and I'm struggling with one only little thing.
Is it possible to display an image on a roll message ?
I'd like to display an item img when players use that item but I can't figure out how to do it.
.
The image ?
There are a few ways, you could simply add an image to a rich text field in a Label Roll Message, or have it in a rich text field and then just add the key to it on the roll image ${TextFieldWIthImage}$ and it will show it in chat.
I need specifics on what you are trying to do exactly
I'm working on my system here as well, so I have the VTT open, I could exemplify it to you by screen-sharing.
It's surprisingly easy to do that.
i can't right now saddly
I have this at the moment
It's not a problem, I just need to understand better what you are trying to do.
the ${img}$ contains the object image url
Oh, great! So it's from the roll message, it's rather easy then.
So, the easiest way to do this is to have a rich text field in this sheet
do you have that?
The sheet, not the label key.
lemme try and screenshot a gif since screensharing is out of the question
you'll immediately get it
Oh ok thanks ^^
I had a rich text field there, so I just opened it, and pasted an image.
Now, in a roll, all you have to do is refer to that text field.
${TextFieldName}$ will throw it into the roll.
A rich text area is a component type:
You can make it tiny so that it doesn't occupy space, like having just the icon appear.
It's as simple as copying and pasting an image there.
I have to say I don't get it
If i take your example, what I want to display is the token at the upper left of your right sheet.
(My object image is set by the DM, not the players)
You want to show the image of the Sheet icon?
Yep
I don't know if that has a key. But this is fine, in my example you can still set the Rich Text Area as hidden to all players but the GM
So only the GM has access to changing it.
You can just set it as the same image.
Yes but it means i'll have to manually put the image of the object a 2nd time, on hundreds of objects
Yes.
Only Martin would know if there's a key to that
I get what you wanna do, if you learn that it has a key I'd love to know as well.
I haven't even gotten into Item Containers, and I've used this system plenty :P
No problem! I really gotta learn Item Containers sometime. I have no idea why they intimidate me.
Maybe because I'd be making items for a billion years once it's working.
Yeah I started working with item containers 2 days ago
I struggled a bit but it works so fine.
And for players it looks really great
Alright alright. I'll do it
I do need a new way to do the reveals for one of the main features of the system since a module I was using got super outdated T-T
That's sad 😕
I hope you'll find what you need with item containers then ^^
Have a look at this conversation:
#1037072885044477962 message
Maybe it fits your needs.
Oh thanks !
I try this as soon as possible ^^
Oh, that's useful!
<img src="${!%{return entity.entity.img}%}$"/>
Gonna bump my questions again :P
${#concat(string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}), string(?{CS:'CHARACTER SCORE'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'METHOD/TRAIT'[number]|0}), string(?{Lock:'ASPECT?'[number]|0}), string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= ref(AspectLocked)}$ ${AD:= [:Lock:d:Aspect:]}$
TOTAL
${(floor(Roll + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + ((Sphere)*2) + AD}$
${Energy}$ = ${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
${CharName}$
Says it can't compute my 3d10kh and so on.
if I switch their ' ' with [] it works, but it doesn't roll on Dice So Nice, which I want it to do.
AAND
${setPropertyInEntity('self', sameRow('CSpheres'), sameRow('CSpheres') + [min(1,(1d2-1))])}$
This does not modify the CSpheres number-field, no errors and it rolls normally.
Help?
You're missing [:Roll:] 😅
Oh, I have to add the : : ? I tried with the [] before!
And for the second question: The second argument of setProp expects a path, not a value.
I don't understand :/
What does sameRow() return exactly?
I mean, I think I do. But how would the path look?
A number field.
from the same row in a dynamic table
And the actual value?
It's supposed to add a 1 to it if the 1d2 lands on a 2.
Varies, depending on which ability, and how much was spent?
Just tell what the current value of the number field is 😅. Doesn't matter right now that it can vary.
Tell you what the value currently is in a specific ability of a character?
um, let's say 5?
This one worked! Thank you
Ok, so this is what it would like if you'd resolve it a step: setPropertyInEntity('self', 5, 6)
It's meant to add either a 1 or nothing ,depending on a 1d2.
You see that it can't know what it should change
Okay? But we're meant to know.
You see a 5 there, and you can flip a coin and hope that it will increase by one.
but it might be another value?
I'm sorry, but I'm not understanding.
I just need to to add the result of this [min(1,(1d2-1))]
Or, are you maybe telling me to delete the second instance of sameRow()?
We only know to which value it should update, but we don't know, which Component it should change
Because we're missing either a Component Key or a path, if we're inside a Dynamic Table.
Isn't the component CSpheres, which is a number field?
Okay, so, how do I give it a path or a Key, if it's missing that?
I thought that's what sameRow(key) was for.
No, that will return the actual value of the Component in question. What you're looking for is sameRowRef(). Try out both in a Label for testing and you'll see the difference.
Oh, sameRowRef()! Okay, now I understand.
There is one last thing I wanted to figure out Martin, if you would spare a minute, and I'm sorry to bother you.
${#concat(string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}),
string(?{CS:'CHARACTER SCORE'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'METHOD/TRAIT'[number]|0}),
string(?{Lock:'ASPECT?'[check]}),
string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= ref(AspectLocked)}$ ${AD:= [:1*Lock:d:Aspect:]}$
TOTAL
${(floor([:Roll:] + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + (AD*Lock)}$
${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
${CharName}$
In this one, I was trying to look for a way to merge
string(?{Lock:'ASPECT?'[check]}),
and
string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
So that as long as I don't select none it spends 1 point from here;
${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
So I can remove the checkmark, to de-clutter the prompt window
In this instance, Energy is only spent if the ASPECT is being used.
and vice-versa
so it would be great if I could have only one prompt for both.
setPropertyInEntity('self', Energy, "equalText(Energy, 'None') ? ref(Energy) : ref(Energy) - 1") ?
oh man this is a whole new can of worms for me
I can't even read that.
lemme try
Oh, that's where the main issue with this transition comes up
${#Aspect:= ref(AspectLocked)}$ ${AD:= [:1*Lock:d:Aspect:]}$
I need this to still work, so that it knows to roll the Aspect Dice
Cause like this, I couls use the checkmark to tell the formula to roll it
Also, just to test, I removed the whole implementation of the Aspect Dice to see how this worked by itself.
But it gives me an ERROR, it says it cannot convert the CWill CNothing or CStam into a number.
Which are three values within the Energy
${#AspectDice:= equalText(Energy, 'None') ? 0 : 1}$
${AD:= [:AspectDice:d:Aspect:]}$
Did you remove string()?
Oh, I don't even know what that does, i just add it cause it works. Lemme try.
Making e.g. 5 (a number) to '5' (a string). These are different types
${#AspectDice:= equalText(Energy, 'None') ? 0 : 1}$
On this one, how will it pull from the AspectLocked key value in the sheet?
Like I used before:
${#Aspect:= ref(AspectLocked)}$
Do I replace the 1 with it?
I wanna ask you questions, like how is a string different, but I don't want to take more of your time than I already am
You might want to read this one: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
Something has gone terribly wrong at some point here xD
${#concat(string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}), string(?{CS:'CHARACTER SCORE'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'METHOD/TRAIT'[number]|0}), (?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= equalText(Energy, 'None') ? 0 : ref(AspectLocked)}$ ${AD:= [:Aspect:d:Aspect:]}$
TOTAL
${(floor([:Roll:] + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + AD}$
${setPropertyInEntity('self', 'Energy', "equalText(Energy, 'None') ? Energy : Energy - 1")}$
${CharName}$
I get an error at the setPropertyInEntity()
I've corrected that one
and this one is rolling wild dice
${#Aspect:= equalText(Energy, 'None') ? 0 : ref(AspectLocked)}$ ${AD:= [:Aspect:d:Aspect:]}$
I didn't change anything with Aspect. I only added an additional line and changed AD
${#AspectDice:= equalText(Energy, 'None') ? 0 : 1}$
${AD:= [:AspectDice:d:Aspect:]}$
This one? Where does the Aspect value come from here?
Wasn't it ref(AspectLocked)?
Oh, I thought you were telling me to replace it with this
No, AspectDice is clearly a different variable 😅
I couldn't even read this new formula though xD
Didn't even know where things go
but I think I understand it a bit now
Btw, I've also lost track what we're doing
So, I have this one, which works:
${#concat(string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}), string(?{CS:'CHARACTER SCORE'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'METHOD/TRAIT'[number]|0}), string(?{Lock:'ASPECT?'[check]}), string(?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
Aspect: ${#Aspect:= ref(AspectLocked)}$ ${AD:= [:1*Lock:d:Aspect:]}$
TOTAL
${(floor([:Roll:] + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + (AD*Lock)}$
${Energy}$ = ${setPropertyInEntity('self', Energy, ref(Energy) - 1)}$
${CharName}$
And I wanted to have one less prompt in the window for players, since the checkmark is to roll an extra dice, that can only be rolled if Stamina or Willpower are selected anyway.
#1037072885044477962 message I changed that one
I know, I'm just catching you up
So right now I have this:
${#concat(string(?{Roll:'ROLL'|'2d10',"Normal"|'3d10kh2',"Advantage"|'4d10kh2',"Domination"|'3d10kl2',"Disadvantage"|'4d10kl2',"Submission"}), string(?{CS:'CHARACTER SCORE'|CAgility,"Agility"|CDexterity,"Dexterity"|CStrength,"Strength"|CIntellect,"Intellect"|CPerspective,"Perspective"|CPresence,"Presence"}), string(?{method:'METHOD/TRAIT'[number]|0}), (?{Energy:'Energy Spent ='|"CNothing","None"|"CStam","Stamina"|"CWill","Willpower"}))}$
${#Aspect:= ref(AspectLocked)}$ ${#AspectDice:= equalText(Energy, 'None') ? 0 : 1)}$ ${AD:= [:AspectDice:d:Aspect:]}$
TOTAL
${(floor([:Roll:] + (method*2) + ((sameRow('SLevel'))*2))) + (floor((CS)*2)) + AD}$
${setPropertyInEntity('self', 'Energy', "equalText(Energy, 'None') ? Energy : Energy - 1")}$
${CharName}$
Like I said, I changed the last part 😅. It's still not the correct one
oh, that's what you meantr
It's cause I saw you change it once, but you changed it again and I missed it :P
Aaand it works!
Now, just to make it pretty
thank you dear
This helped me bunches
I wanted to improve the sheet for this system, and add a new module I created for it.
It's all working dandy now
I'm starving, so I'm gonna go for a bit
Thank you again!
All the love
I have another thing that I left undone for years from not knowing how to do, or if it's even possible.
How do I make a Roll Text prompt that has a dropdown of options coming from a Dynamic Table?
${#concat(string(?{Odd:'ODDITY'|'(fetchFromDynamicTable('OddityTable', 'CSpheres', "OddityName"})}$
Well, I can tell that this isn't how it works..
GPU: ANGLE (NVIDIA, NVIDIA GeForce RTX 4080 Direct3D11 vs_5_0 ps_5_0, D3D11)
Max Texture Size: 16384
Scene: 20900 x 7700 | Grid Size: 100 | Padding Percentage: 0.05
And yet, my map background is an empty black rectangle.
Have I ovestepped the max size somehow?
I don't think that has anything to do with system.
Nevertheless, foundry uses Browser memory, it doesn't really rely on your graphics card to run.
Even when I am the host?
I would wager that that is indeed too big for Foundry.
Yes, it relies on the sofware's memory, your Ram only influences its smoothness to a point. If the browser can't run it (be it the app or in your preferred browser) then it won't load.
I have often used up to 16k/12k pixel size, but depending on what it is, the browser has a hard time taking it.
Is there any way to know what and where I need to cut to make it work?
So I have lowered it by half recently.
I'm not the person to ask, I only know based on what I've experienced. And this channel is for the CSB system.
You might have some luck on https://discord.com/channels/170995199584108546/486930822465716249!
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Well, I am running CSB right now
Yeah, but the system doesn't have anything to do with that kind of stuff.
It's foundry related.
The problem you are having I mean
ok, I went to troubleshooting
Good luck!
Bumping it back:
I have another thing that I left undone for years from not knowing how to do, or if it's even possible.
How do I make a Roll Text prompt that has a dropdown of options coming from a Dynamic Table?
${#concat(string(?{Odd:'ODDITY'|'(fetchFromDynamicTable('OddityTable', 'CSpheres', "OddityName"})}$
Well, I can tell that this isn't how it works..
I tried creating a dropdown in this Dynamic Table and referring it to the value in the target Dynamic Table.
${setPropertyInEntity('self', ref(sameRow('OddSpend')), "(sameRow('OddSpend')) - Sphere")}$
Then I added this to the roll so it'd pull from that dropdown, but it didn't work.
hi everyone and sorry to bother you. is there a module to display chips on the table, like poker chips for csb? thank you in advance for your answer
Have you tried asking it on https://discord.com/channels/170995199584108546/513918036919713802?
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
thank you for the indication, I did not know too much or post my message. it is now done. 🙂
Are chips physical objects? In CSB they could be actors... or items if you use Item Piles but it is a little hard to configure with CSB
Cards would be smart but I cannot figure them out, lol
I use them for one of my systems, took a lot of work to make it nice though. I'm using Monarch I think to make it manageable.
thank you very much
What does sameRow('OddSpend') return?
I was trying to make it pull from a Dropdown connected to a dynamic table.
I want it to pull a value.
I could also work with a way to make a dropdown connected to a Dynamic Table in the roll prompt itself
I understand that the Dropdown is connected to a Dynamic Table, but that's it. I don't know about the values and what you want to do with them.
The Dialog from CSB doesn't allow to have options from a Dynamic Table.
Oh, I just want to select a dynamic table row to deduct a point from every time I roll a dice in another dynamic table.
Ah, I see. That must be why I never did that.
Alright, I can work with that. You cannot use sameRow() for that, because you can only pull data, which is in the same row of the Dynamic Table of the Label with the Roll in question. So you have to work with fetchFromDynamicTable() and getRefFromDynamicTable() and apply the same principles as before with the discussion we had previously.
That sameRow() was to pull from a dropdown in the same dynamic table that was connected to the target one.
Yeah, but you only did that. You still had no sufficient reference to the target-table
We've had lots of discussions, could you be specific about which principles I need to apply that to?
I apologize for being slow, I have been at this for 18 hours straight now.
The 2nd argument of setPropertyInEntity() expects a Component Key or a path (or reference) in case of Components inside Dynamic Tables.
So you want to use getRefFromDynamicTable() for that
I think I understand it a bit. It's for the "having a dropdown pulling from the target dynamic table" method, right?
I'll be trying that after I eat something.
That's a subpart of it, there's more logic involved with that
Oh.. I hope you don't mind if I ask again about it later
There are a few examples for that function: https://gitlab.com/custom-system-builder/custom-system-builder/#421-fetchfromdynamictable
Kinda random but what would be a best practice to put some roll instructions inside a field that is GM only visible?
I wanna do stuff like reducing your potion count by 1 heals you or using an inspiration rolls a d20...
So I'm thinking like a rich text box with a key like 'command' and then I can roll 'item.command' in an item container?
Oh aweseom!
Maybe I can figure it out from that
So a tooltip for GM only?
So a text field only gm sees (that part is easy) that contains the equivalent of a roll command like ${do a thing}$
A hidden Label with a Label Roll Message?
Yeah, specifically one I could reference in a formula and have it roll so like let's say ${name}$ decides to ${thing}$ and thing is what I want to happen when a button is clicked in the item container like heal 1 hp, roll a d20 or print a message
Well... how good are you with JS?
~ so so most I've done is the item deleter script or looking up math functions
You'll need to work with the CSB-API. Especially with ComputablePhrase and/or TemplateSystem:
- https://gitlab.com/custom-system-builder/custom-system-builder/#721-actorroll
- https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/main/module/documents/templateSystem.js?ref_type=heads#L479
- https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/main/module/sheets/components/Label.js?ref_type=heads#L261
I gotta grow up sooner or later so thanks I'll check that stuff out. No problem rolling a variable but making a whole label happen would be cool.
There's also this helper-function in TemplateSystem, which will be available in the next version. You can use most parts of it. The only thing you'd need to modify is to not post the result into the Chat, instead integrating the result into the Label Roll Message.
Oh nice... and I'm excited for rolls that update fields that do not post to chat in the next version... right now I use them a lot to equip, unequip, etc so chat gets spammed.
Default token settings aren't seeing the complex attribute bar property. Is this a known issue or fixable? Short of duplicating tokens with the preferred settings?
Hi ! im new here and on foundryVTT, i don't have a perfect english sorry for that.
I need help for somthing, i try to make a formula for a roll , after this roll i want the result in the chat and a message who tell "win" or "fail", but i dont understand how can i do that.
For now i have this formula who works but i cant have the result of roll.
${[1d20]<=[:STR:] ? "win" : "fail"}$
Someone know plz ?
Can't tell, haven't worked with that. Might be worth a ticket
${#Roll:= [1d20]}$
${Roll <= STR ? 'win' : 'fail'}$
Maybe that's the good way, just don't knows how can i concatened 'win' or 'fail' with Roll
i finaly found ! Thx
hey everyone, I'm working with User Input Templates right now. I'd like to select a rollable table from a dropdown list within one, and display the description of the table at the bottom of it.
I got it to work right now by hardcoding strings in the dropdown list (for selecting the table to roll on), but the description is currently displayed only on the roll message since there is no way afaik to access the selected value before the whole User Input Template is submitted. Or is there?
to add on this, I tried to use a subtemplate to see if the behavior changes, and indeed I can access the table description from there. The issue is that when I change the value in the dropdown the description does not change 😢
Hey!
I'm trying to duplicate an item through a Label Alt Roll Script on an Item Container component, to basically be able to create a way to "Split 1".
Edge cases uninteresting and aside, I can't seem to be able to duplicate the item, modify its quantity parameter to 1, and append it to the actor.items collection. I always end up with a JavaScript error in my web console and I'm unsure how to proceed.
I for a time thought it was impossible, but Marting seemed to have said it was in this message last year: #1037072885044477962 message so I'm still hopeful.
Would love any help ❤️
You might want to use Actor#createEmbeddedDocuments() for this case. More info should be available in the Foundry-API Doc
question: do number fields work with formulas too to display results? I have 3 number fields that should affect a 4th one but no success. Using the formula: ${dex_base + dex_type + dex_loot}$ worked if the field in question is a label...
No, you can only a have a formula for the default-value, which is taken into account if there's no value yet. Otherwise no formulas possible.
I believe that someone tried to explain to me that there is a way to avoid having things like this on the template, but I couldn't remember how to do it. Its is possible, right?
its ok on the character sheet
in your css, use className:not(._template) or className:not(._template *) . The * affects all elements inside the class (ie nested).
let me try>
I have this class right now in the label with this css, that's what causes the big overlapping letters
.val-atp{
font-family: Alien2;
font-size: 2.5rem;
padding: 0px;
margin: 0px;
}```
how shoud I do it?
.val-atp:not(._template) {}
thanks. I did like you said but it was not working. Some cache thing. After a world restart is ok now. Also I'm now using a hidden attribute instead of the formula, way better
oh: template didnt worked form too. had to use :not(.custom-system-editable-panel *)
Dumb question;
Why does this not roll in chat or with Dice So Nice? It works btw.
${!setPropertyInEntity('self', sameRowRef('CSpheres'), "sameRow('CSpheres') + [1d2-1]")}$
I tried rewriting coming from a ${key:= [1d2-1]}$ and referring the key instead of the formula, but nothing.
I just want the feedback in chat, and preferrably the coin flipping.
What happens if you do the roll separately on a line above it and save the value to use in the setPropertyInEntity. like ${roll:=[1d20]}$ and then use the roll value later.
Is self a reference to the current component when writing Lable roll messages?
Is there a way to get the name or value of the component that was clicked on for a label message roll script to use? IE I click on an attribute on a character sheet. Is there a way to know which attribute was click on in the label roll message script %{this.name}%
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
this in the class will hide it, or for text-overflow, you can clip or 'hidden'
Is there a way to hide the name column in an item container?
Nope
That's what I said I tried there. Still didn't roll
Isn't it just ${'Labelmessage'}$?
Otherwise you could make an invisible attribute to pull from.
So.. anyone has an answer to my stupid question?
Does /r 1d2 in the Chat (not Label Roll Message) roll the coin or not?
Yeah yeah.
If I do just ${Dice:= [1d2-1]}$ it rolls just fine. The moment I use 'setinproperty' though, no roll anymore. Which is super weird
Any errors in the console?
Lemme open it all again. But I don't think so.
Just as a reminder, this all works, it just doesn't throw anything in chat, or roll with DSN
Then there must be an error
I must've been so tired when I did this
I forgot to check the console
Sorry to disturb. I fixed it
It was obvious
Hi, how long next version plan to be on beta?
I'm having a problem, whenever I or one of the players updates something on a sheet the foundry freezes for everyone who is connected. Any idea what could be causing this?
Maybe the computations from CSB are too heavy, but I cannot judge this without more info. Open the console and check how many entries are generated with 1 update
Is there a way that I can reference the properties of a control from within a Label Roll Message? For example, I'm trying to write some Roll Message code that I want to re-use across several skills. So I'd like the message to read like "PLAYER rolls a SKILL check" where the SKILL is the contents of the Label Text field in the same control (which is a Label).
I want to have the flexibility to just clone the code and not edit it with hard coding the skill name
There's no self-reference like this, so you cannot reference the own component key like this
Also, anyone do any work with a dice pool system (like Blades in the Dark) where you need to evaluate the results of the individual die in a roll?
thanks Martin, figured it was pretty obscure use case
CSB doesn't really offer much for dice pools, so you'd have to rely on your own Scripts. BUT you can at least write a Script for that
Some useful links:
- TemplateSystem: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/documents/templateSystem.js?ref_type=heads#L531
- ComputablePhrase: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/formulas/ComputablePhrase.js?ref_type=heads#L102
- Formula: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/module/formulas/Formula.js?ref_type=heads#L149
Hey Martin! Thanks for pointing directions. It did help in theory, I see a little better how the data works in theory now.
I'm just confused about how I could get the currently "selected" item in the Item Container ? It should be ${item}$ ; but it seems to return an undefined instead. I may lack knowledge about some shenanigans of JavaScript here, though.
its %{linkedEntity}%
Oh I'm so stupid. Very sorry for the ping !
Managed to do it! Had to go a bit inside the linkedEntity to find the props to edit, but it works super well. Thank you !
Anyone here have experience with implementing the Active Effects in CSB?
I'm trying to figure out how to have the Active Effects on Items activate when the item is both in Inventory and Equipped.
And if there is a way to use a Text field on the Item sheet to define the effect (as opposed to the UI button at the top of the Item sheet
Is there documentation on Hidden Attributes?
Work like Labels
so, I have a skill called Detect that's currently in Number fieldon a Hidden Table on the character sheet (visible to GM only). For users, they see a Label with the text "Detect" and 4 icons to the right to represent the current Detect score. Depending on the value of the Detect field, the icons are either filled in or are empty (so a Detect score of "2" has 2 filled icons and 2 empty ones.
I want to enable the user to equip an item that might add a +1 to the Detect score when it is equipped. I'm unclear how to do that. the set PropertyInEntity for targetting 'self' and the Detect number field (on the Hidden sheet) doesn't seem to work. Trying to use a Label or a Hidden Field instead, also doesn't work with the setPropertyInEntity.
Any idea how I can get this to work or what I'm doing wrong?
To be clear, the act of equipping the item itself, will add a +1 Detect?
@misty terrace Would something like this works?
player_detect refers to the name of component on your player sheet
This is using Item Modifiers rather than Hidden Attribute
It doesn't, you need to separate your Detect data: to number field and the final value field
CSB cannot actively change the contents of a number field via modifiers, so instead, you might want to do something like this:
Have the modifier change the final value field (rightmost) instead
And leave the number field for either you or players to fill any values you want
It's actually how it's supposed to be, not a workaround 😅
And what do you use to set the original value of the rightmost value field? ${fight}$ ?
sameRow('whateverTheColumnKeyIs')
(never used sameRow() here before)
You need that when you're in Dynamic Tables
not in dynamic table
Then not
Yeah, then you only need the Component Key
this
Works! Thanks @earnest imp & @formal goblet
hey i am about to ask a dumb question i had tpo hard reset my pc and reinstall foundry amd trying to get the gasme system creatir backonline i luckjy save my sheet template but i cant rember were the dependance for it are located ?
nm found the [art i was missing
Hello!
So, I was looking at the github to figure out Item Containers, but I didn't.
Item container is empty and only shows the table's name. It doesn't allow me to add items or anything. It doesn't have a + button.
You add Items by dragging them into the sheet
OH
Alright, I'll try when I'm back. Thank you!
Uhh, does anyone have a guide on how equipment works in Custom System Builder? I already have an Item Container, but I'd like to be able to make custom equipment slots that players can put weapons and stuff in, and I'm totally stumped about how to do that.
Like, equipment slots in an RPG.
Weapon: (insert weapon here), (damage value), (durability)
Headgear: (insert helmet here), (durability)
Body: (insert armor here), (durability)
Legs: (insert armor here), (durability)
Feet: (insert armor here), (durability)
I figured out how to make an item container that only allows certain templates inside, but then that displays every actor of that template in that box, rather than what's actually equipped...
The thing is that Items are attached to Actors, not Item Containers. Item Containers only display them
Oh, I see. So it just filters out what to display? If I wanted to let players pick what they have equipped, and then display only those in a specific item container, how would I accomplish that?
Would that even be possible, or is it way too complicated to make equipment slots?
Have a checkbox with the key equipped in the Item and toggle that accordingly. Then you can have 2 Item Containers, each displaying equipped or unequipped ones.
But then, wouldn't players be able to equip as many of the same kind of thing as they want? I.e., five different swords all at once-
Well, yeah
I guess that could be something I'd just have to make sure the players don't do
If you want to limit that, you would need a WorldScript for that
Oh dear, that sounds way out of my league. I think I'll just stick with that solution then.
And hook into the precreate event
So the field key would be what, ${item.equippedCheckbox}$ to check the field with the key 'equippedCheckbox'?
Just equippedCheckbox without any delimiters. Formula-support comes with the next patch
Thank you so much for the help!
I'm using a collection module to transfer actors from one world to another, but when I do, the item templates all get reset. I.e., everything will be set to the 'Equipment' template, including items that should be under the 'Weapon' template, or 'Armor'. All of the data is preserved, though. Is there some way to fix this, or does it just not matter?
Is it possible to change the value of a dropdown list to an other existing key ?
Something like this: ${setPropertyInEntity('self', 'list', "3")}$
For example from current value (0) to 3
Sorry to add to the chorus of help questions but:
Before I work on a scripting way to do it, I figured I'd ask of CSB has it built in. Is there any way to apply or remove a status effect whenever a specific item is added or removed from a character sheet?
I was playing with this yesterday. It's the Configure Item Modifiers in the item itself
Oooh, actually, not sure if that will apply statuses
Yeah, I'm wondering if there's a way for Item Modifiers to include, like, "Stunned" or something.
Hmmm. You could probably kludge it. Off the top of my head, if you make a table on the character template and hide it from non GM players, add a Number field called "Stunned" and set it to default 0, then use the item modified to set it to 1
and then use the condition triggers to fire when Stunned = 1 on the PC
that MIGHT work
Related to Item Modifiers, is there a way that I can pull the Item Modifiers from equipped items? For example, if I have a sword that gives +1 str when equipped, I want to be able to show the player where that +1 str is coming from.
I'm actually veeery interested in that as well, ways to apply status when an item is added
👀
I know about that, it will need a fix. What you can do for now is reselect the templates.
Basically the right way, but there's currently a bug preventing that when the keys are purely numbers
No built-in way. You'd need the help of World Scripts
@formal goblet to clarify, foundry vtt has this thing named Item-Level Active Effects
does that refer to item modifiers?
No, that one is CSB-specific and has nothing to do with Foundrys Active Effects
hmmmmmmmmmmmm ill go look into it then
Well, I'm curios if it is enough to add an Active Effect as an Embedded Document to the Item
I see, so we'd need to implement it
@formal goblet Less related question, how do you get a list of items from an actor programmatically?
If you have the actor-context, it's simply actor.items
Yeah, my end goal was to have custom status effects that mark the token and that was one way I was thinking of doing it. I know I could just create them as items, with item modifiers, but then they'd only be visible if you open the character sheet, which is not great.
if youre doing worldscript for it
Hooks.on('combatRound', async (combat, update, options) => {
if (options.direction !== 1) return; // Kill hook function if combat round doesn't increment forward.
// Initialize Variables.
let tokens_in_combat = canvas.tokens.placeables.filter(token => token.inCombat);
let equipment_templates = game.items.filter(item =>
item.type == "_equippableItemTemplate" &&
item.name.startsWith("Equipment")
);
let equipment_template_ids = [];
equipment_templates.forEach(equipment_template => {
equipment_template_ids.push(equipment_template.id);
})
// Go down each token in combat.
for (let token of tokens_in_combat) {
let token_equipments = token.actor.items.filter(
item => equipment_template_ids.includes(item.system.template)
);
for (let token_equipment of token_equipments) {
let token_name = token.name;
/* ----- INSERT YOUR CODE TO ADD STATUS PROGRAMMATICALLY BELOW ----- */
}
}
});```
this has been my past focus the past few hours
although the application is kinda different in that i add status on combat round change
you can maybe tweak the hook type to be something when an actor gets added an item
Ohh, thank you, that was actually my next step was to poke around with that exact thing lol! That, or see if I could create a startup script that changes the names/icons of the token statuses so I didn't even have to mess with them as items.
