#Custom System Builder
1 messages Β· Page 53 of 1
Check the error in the console with F12
Console is empty :/
I tried to put recalculate formula at some place but it didn't do anything
if I get the value by ${first(lookup('Skills', 'Total', 'Name', 'AthlΓ©tisme'))}$ it's working (all columns in text)
maybe the list Skills_Selection is in cause ?
It could be. Did you populate from a custom list or the DT setting?
What do you mean by DT settings ? π
I've make my own skills name yeah
You could also try ref(Competence)
You can populate the dropdown with a list based on a selected column of a dynamic table
Ok. Try the ref() in the filter value?
in the lookup function ?
Yes
erf, not showing anymore
ref what, name of the DT ? or a skills in particular ?
maybe we could PM, for not messing the channel
Sure, if you like.
Hello everyone!, I was wondering if someone could help me everytime I try to create a new item or feature for a character it keeps spamming me with this, any help would be amazing :3
I scrapped an item concept and the template for it and deleted both but thats when this kept popping up
The game is refreshing the canvas and trying to reload an item that's set to use a template you deleted. You probably still have a copy of the item on a test character.
I've only got one test character and its not on there what I can see, so I don't know
It's kind of a problem, because you deleted the template, so the item won't show up on any of the character's item displayers, since they only show selected templates (which you can't select because you deleted ...)
so should I just purge the test sheet?
The simple way is to create a new template using the same name of the old template.
or you could just delete the character, yeah.
damn it was that simple thank you so much
No problem π
The Item Displayer displays all Items if no filters are selected
So it was purely because it was trying to use a null template that it wasn't showing up?
No, Item Displayers which have selected Templates, will only display those. The rest will be filtered out. If no Template is selected, it will display all Items the Actor owns.
I meant in Adora's case above. They'd deleted the template, and it wasn't showing on the character sheet, but it was still trying to render it, hence throwing all the warnings.
An Item has always a reference to a Template. Once you delete the Template, the Item becomes orphaned and will cause the warnings on every update.
Got it. I was just trying to make sure I had the terminology right for if it comes up again. Thanks.
@formal goblet btw is there a way to block templates from accidential delete?
that could cause heavy problems and can already destroy whole system in worst case π€
The best way would be to export them to a compendium and be able to re-import them if you accidentally do, then prevent players from deleting actors in permissions.
Once the Templates are done, you can just export them to Compendiums or even files.
A backup of the world also helps
Otherwise there's no regular way for a GM to block deletions of Documents
Hello, I'm still improving my Supers RED CSB and I would like how to make a total. Here is my use case. I would like automatication of a chacacter values in Creation Dices. For instance, The Resistance value begins at 1D free and each subsequent Dice is 1 creation dice. So my formula is :
${(COMPOSURE_MAX+FORTITUDE_MAX+REACTION_MAX+WILL_MAX)-4}$ but it displays nothing on my NPC
Here is the NPC I use as a test
I wonder if my formulae is wrong
I also tried ${COMPOSURE_MAX+FORTITUDE_MAX+REACTION_MAX+WILL_MAX-4}$
I have an idea, let me check π
Tried this
${=(COMPOSURE_MAX+FORTITUDE_MAX+REACTION_MAX+WILL_MAX)-4}$
You're trying to sum the values in the Resistances into the Resistances at the bottom?
Could you send a screenshot of the configuration screen for both the COMPOSURE_MAX and the component where your formula isn't working?
@formal goblet I was just poking at things and noticed that math.js has a forEach() function; can you use the callback with CSB functions, or is it limited to math.js functions? I'll experiment with it, but I was wondering if you had any insights with it.
I'm trying to sum all the Resistance score minus 4 π
Could I see the destination configuration as well?
CSB-functions are imported into mathjs, so you can use them. I didn't manage to get it working with loops though, but that doesn't matter anymore anyway with scripts.
Check console with F12
Yeah, fair enough. I was just doing some stuff with the math.js reference and thought it looked interesting.
Hi! Does the fetchFromActor function work if the key is a label with a formula? I originally had a number key (char_ac) where a number value for armor class was entered by the player. I changed the key to a label with a formula where char_ac is calculated as a base value of 9 plus player entered temporary bonus & penalty. The fetchFromActor function worked perfectly with the number key but only return the default value of '0' when I use the label key with the formula. Am I using the wrong function? Any advice is greatly appreciated. here is the snippet of formula that is trying to fetch the Ac value from the selected token: ${char_ac:= fetchFromActor('selected',"char_ac", 0)}$
Here is the char_ac formula.
Is it fetching the ac of the character it's coming from, or like the ac of a target in combat or something?
It's supposed to fetch the AC of the selected token (like a targeted enemy). I'm probably going to change it from selected to targeted.
I switched from having the player enter a number for their AC to using the formula so i could create drag and drop equipment that would automatically update the player's Ac without them needing to make any adjustments.
here is what the chat output looks like
The lackey has an AC of 9 per the formula but the default value of zero is being outputted.
The only thing i can see that I would have done differently on that line (ther than using target, like you said) is that I would have used ' ' instead of " ". Not sure why it's not pulling when it's working fine with the name.
I'm not sure I understand how/where I would use "instead of". is that a type of operator?
You have fetchFromActor('selected',"char_ac",...)
I would have used 'char_ac' instead.
But sometimes you can use " instead of ' without issue, and I'm still sorting out where those places are.
Oh! Thanks. I'll try that.
I'm stumped. I changed it from selected token to target token and it still returns the default value of zero instead of the calculated AC from the formula.
So.. this may seem weird, but have you deleted all the tokens from the canvas and replaced them with the updated formulae from the sidebar? I've had plenty of times where I was using a token with a way outdated actor file.
Good suggestion. I just tried and no change though.
It has to be something simple that I'm missing. Everything works but the fetching of the AC.
i figured it out. I had an unused variable/key in the formula. Once I removed it, everything worked fine.
Nice
Is there a way to have items placed in an Item Displayer to not create a copy within the CSB Embedded Items Folder but instead link directly back to the original?
Is it possible - through script or macro - to add an item automatically to an inventory, without needing to drag it in the player's sheet?
Essentially, what I'm looking to do is to create an item with a modifier on it, and to be able to add it to all the players at once, to be able to set 'global modifiers' for an area.
Hi! I'm Calesella Marco from Winged Lion Games, a small Italian team of ttrpg authors. First of all, congratulations on your fantastic project, it's really well structured and incredibly convenient for transposing game systems for those who are not familiar with programming. I'm contacting you because I created with your addon a transposition of our latest game in development, Purple Reaping, a Sword&Sorcery Horror ttrpg inspired by Conan the Barbarian with a narrative game system whose Kickstarter will start in July (here a link if you want to know more about the project https://bit.ly/43AQEST) . I would like to kindly ask you if it is possible to include the exported file together with the ones you made available in the template link on your project page. If you need anything in particular, there is something to correct or for anything else, please contact me at my email wingedliongames@gmail.com . Thanks for everything!
Martin has a macro that lets you update values on selected tokens, a little script work would allow that to create a popup and allow you to fill in the values if you want it to be more flexible.
How I do that ?
Logger.js:33 Custom System Builder | Value expected (char 1) SyntaxError: Value expected (char 1) (at math.js:27324:37)
at pe (math.js:27324:37)
at math.js:27252:85
at math.js:27253:77
at math.js:27254:73
at math.js:27255:69
at math.js:27256:65
at math.js:27257:61
at math.js:27258:57
at math.js:27259:53
at math.js:27260:49 {formula: '=(COMPOSURE_MAX+FORTITUDE_MAX+REACTION_MAX+WILL_MAX)-4', props: {β¦}}
The pic you sent before was one of the ones being added, can you show me the same pic but of the component where it's going?
The reason it's not totaling is because you're just changing the minimum value, not setting it. If you change the component type to label and put the formula into the label field, it should work.
I will try that thanks π
Remove =
The issue with the label component is that it display the word "resistances" and not the value. Ideally I should have a label and a value
Oh I know π
Well no it was not that ^^
What is the new error message?
Logger.js:33 Custom System Builder | Cannot convert "${(COMPOSURE_MAX+FORTITUDE_MAX+REACTION_MAX+WILL_MAX)-4)$}" to a number Error: Cannot convert "${(COMPOSURE_MAX+FORTITUDE_MAX+REACTION_MAX+WILL_MAX)-4)$}" to a number
at convert (math.js:12242:57)
at Array.t (math.js:6552:67)
at Function.r (math.js:6691:72)
at Function.oe (math.js:6724:82)
at Function.addScalar (math.js:6740:54)
at Function.oe (math.js:6724:82)
at add (math.js:6740:54)
at math.js:25781:48
at math.js:25781:50
at math.js:25781:50 Object
I am watching an (old) CSB tutorial to better understand it
The new Custom System Builder for Foundry VTT (was Modular System)
Custom System Builder: https://gitlab.com/linkedfluuuush/custom-system-builder
Sandbox: https://gitlab.com/rolnl/sandbox-system-builder/-/tree/master
Sandbox Video: https://www.youtube.com/watch?v=V9IXafKPK2I
GRPGA: https://gitlab.com/jbhuddleston/grpga
Using Foundry without a...
(the version is older but that's just for me to understand the logic)
Take a look at the end of the formula. Your closing delimiter is wrong. Should be }$ instead
And you have 1 opening vs. 2 closing parens ()
I see
I'm just starting to get into CSB and I'm not understanding how roll formulas apply to labels. I'm probably missing something basic.
On the left is a label with a roll message on click that runs the 'setPropertyInEntity' formula to modify the label value on the right. It correctly spits out the result of the formula in chat, but it doesn't actually modify the value itself. Other values on the sheet seem to also correctly adjust according to the values already listed on the sheet. But there isn't any way to modify the value of the label directly from what I can tell aside from item modifiers. I know number fields and text fields exist, but they seem to be more limited with what you can do with them in terms of formulas, such as item modifiers not working with them.
Again, I think I'm just missing something simple, that, or I'm approaching what I'm doing the wrong way. Any pointers?
Computable Components (Labels, Meters):
- Allow Formulas
- Values cannot be manually changed
- Can be modified by Item Modifiers
Non-computable Components (Input Field Components):
- Don't allow Formulas
- Values can be manually changed
- Cannot be modified by Item Modifiers
Sounds redundant, but by manually changed, does that include through formulas? Thats the main issue I seem to be having. Any formulas I set in a label seem to refuse actually changing the actual value of the label. The value it returns in chat is correct, but it doesn't actually change the label value.
Formulas are calculated automatically. The usage of setPropertyInEntity() on the other hand is equivalent to a manual change.
Ah, that'd explain it then. Is there another function I should use instead or a better way to approach modifying label values?
Item Modifier, Active Effect or a Formula within the Label itself. There are no other ways.
Lets say that I had a stat value such as Strength, and I wanted to have it be easily edited manually on the sheet, but I also wanted to have it be edited by modifiers. Would there be a way to approach that, or would I be better off just going with one or the other?
You need 2 Components. A Component cannot be modifyable and editable at the same time by design.
Gotcha. I'll have to figure out a new layout then. Thanks for the help. :)
Could someone give me a hint of whats wrong here?
${roll > [:Skill_Aim:]? 'Failure' : 'Success'}$
${roll >= fetchFromActor('selected','Exploit', 20)? 'Exploited' : 'No Complications'}$```
Basically enemy has a numberfield with the component key Exploit. When a player targets the enemy and rolls, it should check if the roll is equal or greter than its exploit. Problem is right now its always defualting to the 20
(tryna use this for the first time, so still lernin)
Are we talking about selected or targeted?
targeted. (im basing my code off some other peoples messages here so that was a slip up.)
however changing the 'selected' to 'targeted' does not fix the issue, its still defaulting to 20
Because targeted doesn't exist. It's called target
Is there a way to only have item modifiers applied from equipped gear?
Modifier formula: ${equipped ? 1 : 0}$
trying to use this to check if a checkbox is checked, and if so, multiply a stat by 1.5, wasnt working so i used a label to test it but the value isnt changing when the box gets checked: ${ checkboxTransform ? '1.5' : '1' }$. even tried reloading the sheet and it still didnt change
Check with fromUuidSync('uuid').system.props in the console
?
You must enter the actual UUID in there
same error basically
Then you haven't use a valid UUID
what am i supposed to use? the component key of the checkbox?
No, the UUID of the whole Document. You can retrieve that from the header of the sheet
?
Huh? Try it again and leave out .props
found the checkbox, it seems to be fine as far as i can tell, dont know why it isnt being noticed when its checked
The key of this Checkbox is Transform though, not checkboxTransform
yeah it works now, sorry, the github page led me to believe i needed the checkbox there
No, keys must match exactly in all cases
Is there a way to change a label's visibility/CSS class depending on if a number is above 0?
I'd like to make the AVAST! text look normal until the count is above 1 to signal to my players that there is a resource available that they can (and should) use.
They are utterly blind, nothing short of animated neon clown-vomit will make them remember that they can use this thing and even then i'm thinking about implementing airhorns just to make sure.
@formal goblet I'm not sure if that was recently touched, if so please let me know and I will do better search π but do we have possibility to set template in Roll Message to which we will pass some specific information?
LIke I have chat msg for test done for skills, attributes, attach, damage, etc... but most of those msgs are same and in case of change right now (with my approach) its necessary to change every single roll msg instaed of jsut one part of common template..
Are you looking for a more generic approach regarding Label Roll Messages? If so, try this one out here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
Or you use a Macro, which will be called from your Label Roll Messages.
but macro will be encapsulated from data normally available in Roll Message formulas or they could be used?
You can pass whatever data you like to a Macro
π
give me a try π
Ok, that will be an answer for more Object oriented approach π
Thank you π
Only a question... why MSG which use Macro callout is one colour and one made in formula has different colour? π€
Different roll modes (public, private, gm-only) have different colours.
but... what is correct way then to pass information about "item" at "item displayer" from which "roll msg" macro was called? π€
eaither I have item is not defiend when "... item: item, ..." or unexpected identifier 'Object' when "...item: ${item}$, ..." π¦
ok... I'm sorry that I didn't read that with understanding... thank you
please, does anyone know how to hide this from chat?:
%{${item.Sound}$}%
And yes, I have tried %{${#item.Sound}$}%
I just want it not to appear in the chat message
${#%{${!item.Sound}$}%}$
Is there a way to copy and paste things like lables and such in the character sheet?
i feel like i'm being a massive dumbo by making a copy of the character sheet and dragging over things i want to copy :p
CTRL + Drag
I HAVE BEEN A FOOL FOR SO LONG!
Thank you!
can we already call for macro via macro.execute() within Roll Label without trigering "roll sound" and "sending msg to chat" ? π€
or maybe someone has already good experiance and example with templates with chat message results to be called from Label Roll Message via Macro to avoid changes in too many places in case of change of result view?
You can disable Chat Message creation in the Component config of the Label
of course π
by doing that through macro I have my dice so nice rolling dices back !
or not π¦
when 2 rolls are triggered then dices are not rolled π
How do i make equippable items work? i'm looking at the custom system builder documentation but i can't drag equippable items on to character sheets to make them appear.
you have to have:
container (item displayer)
item
you have to define:
your item displayer have to have set Filter Items to item template you want to add/see
then drag item on char sheet
Right! that makes sense. thanks!
So, when i try to apply the modifier to the sheet it becomes NaN. The default is 0 so when i untick the conditional modifier selector it returns to 0.
I'm assuming my formulation is wrong but i'm not entirely sure in which way.
Well, item_weight is not a number, just a random text π
OH I FORGOT THE [${$ thing!
I swear, this dosen't usually happen (it happens a lot)
The worst thing about computers and code is that it does exactly what i tell it to do, and i'm the last person i would listen to for suggestions of how to do things. :p
But it works! (even if i thought that inventory_weight had to have the curly-bois around it too but this is a learning experience)
Thanks!
Is there a FAQ or something I can look things up on? I am just moving to CSB after a Sandbox catastrophe destroyed all of my data... Everything looks like it is similar, but improved here. Maybe not quite as simple, but better... There is 1 thing I haven't figured out how to do yet though, which is kind of essential to my goal...
I am making a system similar to World of Darkness in that it has visual representation of scores in the form of "dots"... That was the radio button function with a max higher than one in Sandbox, but that doesn't seem to be the case on CSB...
Hello there!
Iβve been trying to use the Show Drag Distance Module with the system that I am currently working on. The problem is that I have little to no idea how to relate the movement capacity of my system with the data that the module uses to determine the base speed movement of the actor.
I would really appreciate it if anyone can help me out!
Thanks in advance!
Looking at some walk throughs, some of them say there should be a button to launch some type of UI inside of foundry for CSB... Is this accurate? I have options to create actors/templates from the create actors button, and the Equippable Item, Equippable Item Template, Subtemplate, User Input Template options in the create items button... foundry says I am using 4.4.2... Is something corrupt?
I only know the Dragruler module, so I can't help without you providing more details (e.g. what configuration the module expects)
The entity types are correct. What are you looking for exactly? I don't know which kind of UI you mean
I'll try to use that one and see if a can work something out. Thanks!
I suspect I was looking at a bad walkthrough.
As stated above (#1037072885044477962 message) I am trying to figure out how to make World of Darkness style Attributes and Abilities.
Ah, well there's no Component as such in CSB. You'd have to create your own solution for that (e.g. your own Component).
Normal Radio Buttons behave in a different way. They only allow you to select 0-1 options of all options in a group.
I've been trying to figure it out with the Dragruler but I can't make it work
The path is actor.system.props.key
While it surprises me no one has done this already, I certainly accept this answer. The way radio buttons worked in Sandbox confused me to no end as well. Anywhere to find an example of how to do so? I am a novice at javascript at best.
@formal goblet as mentioned there is a way to pass item as en object for further fetching, but is there some better way to pass dynamic table information than pushing every column through parameters?
in case when script was initiated from dynamic table label
Check options.reference and the content of the Dynamic Table
what do you mean by 'options.reference'? I tried to identify such tandem but so far nowhere console, actor, dynamic table as CSB comoponent options nor through console... π¦
options is a global variable, which is part of every script %{}%
${#%{return await game.macros.getName("RollChatMsg").execute({type: 'skillCheck', entity: entity.entity, options: options});}%}$
gave me an error inside macro:
const props = entity.system.props;
const options = options;
console.log(props);
console.log(options);
Generate an console error:
Uncaught (in promise) ReferenceError: undefined. Cannot access 'options' before initialization
[Detected 1 package: system:custom-system-builder(4.4.2)]
Remove this here: const options = options;
for itemContainers and linkedEntity it work (with changes) like a charm as per your guide...
when I remove options from script I can see reference "dt_A.0"
With this, you can use foundry.utils.getProperty(props, options.reference) and it should retrieve the data of the whole row
but same script was used for dynamic table and item displayer... for linkedEntity it is possible to assign even if its empty via
const item = (linkedEntity && linkedEntity.system && linkedEntity.system.props) || {};
but when same approach I set to options it raised an error... or... let me check one more thing
Can be shortened to const item = linkedEntity?.system.props ?? {};
when I run macro from itemDisplayer it raised error due to missing options
I saw that shorter one also, but it cause an error
ok got it π
Ok... not it works as should for Skills (dynamic table) and Weapons (item in item displayer)... and most important Dices are back π
thank you very much Martin for your help and patience π
Thank you!
Hello I'm using the CSS for really basic stuff and have only basic technical knowledge with computers and code, I've looked through the documentation and I can't seem to find a way to make an if statement.
From what I understand putting a condition in a formula only works for boolean, so the number you input is either considered false if it's 0 or true if it's anything else, how do I do something that would work like "If [Thing you want to read] is equal or higher than X then [Return]" ?
sorry if this has already been answered a thousand times
Take a look at comparison operators: https://www.w3schools.com/js/js_comparisons.asp
that's very handy, but I just don't know how to code something from scratch, I've only gotten so far by finding example code, dissecting it and modifying the right pieces to have it do what I want
I only learned right now that CSS works with javascript
a >= b ? y : z
If a greater equals b, then y, else z
HTML, CSS and JS are the 3 pillars of web development
I think I get it, thank you
Question about roll modes: When doing private Rolls, other players and GM see this in the Chat Messages:
Any way to get rid of all these lines with question marks?
If I am using a custom macro for dice rolls, how is it possible to include a reference to a componentKey within the macro?
For instance, toward the bottom after the text "makes an attack" I'd like to make it "makes an attack, dealing componentKey text damage."
Do you need to see the macro text?
Do you guys think it would be possible to play a sound for each player when they move items from their inventory?
I tried with this module but it struggles a lot to find the player ID and completely breaks with Item Piles
You need the context of the entity you want to target. Based on that, the path is entity.system.props.componentKey
Macro-polo is a better place to ask, because the functionality you're asking for is not system-dependant or related to CSB
Would it be posible to post an item to the chat by creating a buton at the item with a string of code that takes the UUID from the item an instert into chat in the right formular ?
Are you talking about a clickable link to the item or something? Like the rich-text-area links from journals?
I think I saw in some systems that on chat msg have possibility to click and then it will popup you journal, item or even continue roll base on original poster attrs... so somehow its possible, but its more like foundry feature not CSB i guess π€
Is there a way to have items placed in an Item Displayer to not create a separate copies within the CSB Embedded Items Folder but instead link directly back to the original?
No. Ne default behavior is to always create a copy for embedded documents
Ah, Fair. Thanks for letting me know.
More so that a player could post the item to chat, since they canβt drag and drop it to the chat.
Can anyone help me out please?
Get Hide GM Rolls.
Its a module that does it for you.
Hello there! Can anyone help me on building a iniciative button on my character sheet? By helping I mean how do I create an order of action while a combat encounter is happening?
Hi there. I have a question. If I use setPropertyInEntity() and setValues() in same code, some things updates only after I update them.
Code:
${#hasammo:= item.wpnHasAmmo}$
${#ammoval:= item.wpnAmmoCount}$
${#ammomax:= item.wpnMagazine}$
${#ammoitem:= item.wpnAmmoItem}$
${reload:= fallback(fetchFromUuid(ammoitem, 'ammoQuantity'), 0)}$
${ammorel:= reload <= 0 ? '0' : (ammomax - ammoval) > reload ? reload : ammomax - ammoval}$
${setPropertyInEntity('item', 'wpnAmmoCount', "hasammo ? ammoval + ammorel : '0'")}$
${setValues(ammoitem, 'ammoQuantity', "target.ammoQuantity - ammorel")}$
after click on button with this code, updates wpnAmmoCount in item, but dont ammoQuantity in ammoitem, after that if I open and close ammoitem sheet ammoQuantity updates
Are there errors, even warnings like uncomputed props? Is the ammoitem an item-in-item? I don't know the answer offhand, I would need to model it to see the behavior.
no errors or warnings.
ammoitem is dropdown in item with key-options ${fetchFromParent("lookup('itemsGear','uuid','gearType','Ammo','~')")}$, and label-options ${fetchFromParent("lookup('itemsGear','name','gearType','Ammo','~')")}$
gif for understanding
I think that it's not updating the new dropdown values until you render the item again, thus reloading the item and updating the prop.
but im not trying update dropdown values
It might be a use-case for the recalculate() function?
${setValues(ammoitem, 'ammoQuantity', "recalculate(reload - ammorel)")}$ nothings change
I meant recalculate the ammoQuantity field as a separate line-item in the roll.
it doesn't seem to be that the value isn't being updated, just the field on the sheet.
Because as soon as you open the item, it's already correct in the number field.
yeah, maybe, but..
if we swap ${setPropertyInEntity('item', 'wpnAmmoCount', "hasammo ? ammoval + ammorel : '0'")}$ and ${setValues(ammoitem, 'ammoQuantity', "target.ammoQuantity - ammorel")}$, will not updating ammo in weapon (the red numbers), only ammo in gear
add ${recalculate( fallback( fetchFromUuid( ammoitem, 'ammoQuantity'), 0) )}$, not helped
What happens if you change that number field into a label? I know it's harder to edit later (requires something like a button control with another number field to add ammo) but it could be something with processing the change from a number input field.
that number field meaning the Quantity feild on the ammo item
into a label? or text field?
One sec while I think more about it. It's 2am here so I'm not totally awake.
changing into text field didnt work
I'm not rushing you. π
i can share system with you, if you want of course. but in some place you can find Russian π·πΊ languages (keys in eng)
if the keys are in english I can sort it out, but it'll have to wait until morning my time. I don't mind taking a look at it tomorrow.
or.. later today I mean.
ok
do you want to just DM me the JSON and I'll load the sheet and see what I can do with it, or should we get together later?
Is there a way to keep a dice roll in a variable? So that you could chose after to keep the lowest or highest.
EG: [3d20] places in the varHat. Then use varHat to give the player a choice to only keep the highest 1 or 2 dice.
The way my system handles iniciative rolls is by using this formula ${roll_formula:= dexterity_level == 1 ? '1d20' : dexterity_level == 2 ? '2d20kl1' : dexterity_level == 3 ? '2d20kh1' : '0d0'}$ ${[:roll_formula:]}$. Unfortunately it doesn't work into the Iniciative Formula in CSB, even if I try to remove the ${}$ of the second formula. I want to know if there is any way to make it work
I would put the first formula in a sheet hidden attribute keyed roll_formula (so that you can call it in the initiative formula), then just put :roll_formula: in the initiative setting.
It's working perfectly! thanks!
No problem, good luck with it!
Actually, if you know any way to make a iniciative button in the sheet it would be great
Initiative is handled by Foundry, not by CSB separately, so it would require an initiative roll macro; just a label set to button mode then one of the various macro formats in a script to execute. It's a lot easier to just train your players to go to the sidebar and roll it through the interface when you're setting up the combat.
@formal goblet When you get a chance, can you look at the behavior in the .gif and see if that's something expected? His formulae seem to work fine, and it doesn't throw any errors, but the ammo item seems to need to be opened and closed before the ammo count display will update. Is there some kind of refresh script that he could add to the roll formula to either bypass or automate that?
@limpid gull I poked at the JSON and I couldn't figure out a way to accomplish what you're doing without the same thing happening, so I thought I'd ask Martin.
There should be a message from Linked in this chat regarding rerendering
Got it: #1037072885044477962 message
Looks like exactly the same situation, thanks!
anyone got an idea why my css is turning out like this? With a strange space on the left side.
.mcss-attributes-score-entries{
border: 2px solid #54544f;
border-radius: 8px;
background-color: rgba(232, 228, 216, 0.3);
width: 140px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0px;
float: center;
margin: 0;
}
The components inside the panel seem to be pushed a little to the right.
aligned to the right and left,
Found the answer. Its a class called "custom-system-field-root" that gives everything a 10px margin-left.
I'm unsure if its the intended behavior, but if you have a negative value on a number field with relative modification enabled, and you click off of the field, it will subtract onto itself. It can cascade pretty quick. lol
Semi-intended. I always forget to block relative modification for number fields with min-value < 0 because of that reason
Fair enough, just thought it was something you should know.
Is there anywhere that key values are set in the actor object? I see in the actor object that actor.system.hidden[x] is where hidden attributes are located. For example, I have a hidden attr 'STR' that is equal to ${STRCore + STRMod}$ -- how would I go about getting the value of STR? -- This is in reference for macros
hi guys, I'm trying to grab the value off a dropdown on the sheet for a macro, but I can't find the right term, I have tried;
nDice = actor.system.props.drop_name.value;
I know it should be something like drop_name.selectedIndex but I don't know exactly
Without .value
actor.system.props.key
is that returning an int for the key then? I'm juts getting NaN as an output
Hello, i'm new and trying to implement an old French RPG in FVTT with CSB but I have encountered a roadblock.
I need to link an actor of one type to another actor of another type (for example: linking an NPC actor as a mount to a a Player actor), but I can't find how to do it in the doc or the example module.
No, a string of the key
Weird. I just get nothing in my message output for it then
You can try out fromUuidSync('uuid').system.props in the console and see what's in there
should it need parsed in some way to output in a chat message?
https://foundryvtt.com/api/classes/client.ChatMessage.html#create
https://foundryvtt.com/api/interfaces/foundry.types.ChatMessageData.html
Documentation for Foundry Virtual Tabletop - API Documentation - Version 12
Documentation for Foundry Virtual Tabletop - API Documentation - Version 12
Alright, it was coming back null, even tho the sheet has a selection chosen. Ugh I'll just use something else instead of dropdowns.
The first thing I'd check is if the actor context is correct (e.g. checking the name or comparing UUIDS)
dunno. If I make it a numfield it works just fine
it's fine, i'll just use that instead
Anyone know how to link an actor-type to another actor-type for mounted combat in CSB ?
You can only use fetchFromActor() or fetchFromUuid() for that. There's no other built-in way. For everythings else you'll need your own implementation like scripts or even custom Components
Thx for the answer. How do I go about creating a custom component ? Is there any documentation for that ?
The implementation of all Components in CSB is here: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/src/module/sheets/components?ref_type=heads
A short guide is here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Create-Components/Create-a-Custom-Input-Component
I'm running into a weird issue. I have a lot of item instances already placed inside my characters and their spawns. At some point, I added new functionality that relies on a field which doesnβt exist in these previously deployed instances (saved characters, etc.), and now Iβm getting errors because of that.
Is there a way to force-update all existing instances to match the new version of the item? I found a button that sounds like it might do that, but it only seems to affect presets, not the actual instances.
Sorry if Iβm not using the right terminologyβhope this makes sense!
The Button to reload the Templates of all Items only reloads those in the world collection. Meaning only non-embedded Items will be updated via this way. If you want to update embedded Items, you'll need a little script that will do so (item.templateSystem.reloadTemplate() for each item instance). Just bear in mind, that Items can be embedded into Actors, Actors into Tokens and Tokens into Scenes. So if you really mean ALL ITEMS, you'd need to iterate over all scenes -> all tokens (filtered by non-linked actors) -> all actors (indcluding the ones in the world collection) -> all items (filtered by the Item Template).
And this can take several minutes to do so depending on the complexity/size of your world
lets the ryzen go brrrrrrrrr!
will this code do it for all?
can you ade me with such atomic script? i think it may be usefull for more people
Probably something like game.scenes.forEach(scene => scene.tokens.forEach(token => token.actor.items.forEach(item => item.templateSystem.reloadTemplate())))
will try thank you. Can i somehow access how far token is moved in combat? for example to track action points?
Dunno, CSB has nothing to do with that
so i cant for example limit movement in combat to spped in character sheet?
I can't tell, how and where this is tracked. CSB simply has no own implementation for Token movement. You better ask in a different channel.
ok
Is there a way to get the image path of an actor using a fetchFromUuid() ?
%{return entity.entity.img;}%
Thx that seems to work for getting the current entity's image path, but i'm trying to get the image path of an actor from another actor from whom I have the UUID.
For example, i'm in the player character actor sheet and want to show the image of an NPC actor that serves as his mount and for which I have the UUID.
Then use fromUuidSync('uuid') in the script
That worked perfectly, thx.
The doc for the fromUuidSync() function and other are in the FVTT API right ?
Yep, part from Foundry. The only 2 classes that you might use from CSB are TemplateSystem and ComputablePhrase. The rest is basically all Foundry
Guess I'll have to actually learn how FVTT to do what I want then. ^^'
Any advice on what to read ?
This is a good starting point. It also contains links to other useful sources: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#33-script-expressions
Thanks a lot, now I know what my bedtime reading will be for the coming weeks. x)
I'm looking to automate damage dealing. Is there a template somewhere I could look at for rolling a dice, checking a value in the target sheet, and if the roll goes over it, reducing a value in the targe sheet?
I have two dynamic tables with matching name columns between them, one on an actor, one on an item. Is it possible to make a single item modifier that adds from all the rows on one into the other, or do I have to make one item modifier for each row?
Hello, could I have some expert help on this roll-message? It is supposed to work like a radio button that sets all of the Item Displayer's Active checkbox within the item to to 'false' and then if the Active_Key that you are clicking on is 0, it sets it to 1. If the Active_Key was a 1 however it would set it back to 0 leaving no Active items in the Displayer.
I feel like there is a better way to go about this, especially when it comes to two different formulas here.
Is there a way to have vertical text?
Heya! Is it possible to add buttons to chat formulas? I.e. a re-roll button that appears after the result?
Why is my attribute bar not adding woundedCurrent like the other two health types?
They are copied identically (other than changing key values of course)
Is it expected behavior when using fetchFromUuid(X,Y) where Y is a key that point to a boolean value of X it returns me a String value of the boolean ?
(Example: I use fetchFromUuid() from an actor to fetch the 'Equipped' value from an item on the character sheet, it will return me either 'true' or 'false' as a String instead of a boolean.)
I'm using Custom System Builder + Foundry v11 and I keep running into this issue where I can't create a new actor because the type field is missing and throws an error. Has anyone encountered this issue before?
Is there a way to either show an item, and, more preferably, turn a formula directly into a string instead of a button that shows the formula, inside a roll message?
You can prevent the formula to generate a white bubble by prefixing the variable with a ! in the roll message.
Example:
<strong>Initiative :</strong> ${!init}$ will produce the value of init as a string (image 1) while not adding the ! in front of the variable,
<strong>Initiative :</strong> ${init}$ will produce the value of init as a clickable bubble in the chat (image 2).
'Eyyyy, nice! That works great.
Just to double check, though, this isn't a dumb way of doing item references?
This, specifically, I mean. @UUID[${!sameRow('uuid')}$]{${!item.name}$}
You can add HTML & JS script in the roll message to show any element in the chat, including the image of the item but you will need to use a script %{...}% to get the image path to add in the <img> element.
Example : <img src="%{return fromUuidSync('INSERT_UUID_OF_ITEM_HERE.img;}%"> will add an image to the chat message
Can't tell you much about your way of using item reference in chat, but it's seems OK to use the UUID as long as you intend to show a specific instance of the item.
I'm still learning myself ^^
Actually, I didn't even knew you could use that formula to produce a clickable data-link, I was using direct HTML code in my messages to replicate the same thing but adding the picture of the item like in an itemDisplayer.
Oh, turns out you don't even need to do the {${!item.name}$} part. @UUID[${!sameRow('uuid')}$] alone works.
It seems so indeed, where did you find the reference to the @UUID[...] trick in the Doc ? there might be a way to add the image from the item with just another argument instead of using an <img> element.
I didn't. I just clicked and dragged an item into the chatbox and saw what it gave me.
oh, must be a FVTT API function then
Then I went looking for "uuid" in the docs. Apparently there's a hidden column in the item displayer for it.
You can see these info in the console when you display them in there
You can use the command fromUuidSync('REPLACE_WITH_ACTOR_UUID').system.props in the console and it will show you all the elements from the components in you actorsheet such as the item-displayers.
and you can get your actor UUID by clicking on the little book icon on the upper left side of the actor sheet
Still want to know about this. Morseso now, because I have more than one thing for which this is important.
I would be interested in that as well. Haven't yet dug the doc too much on that front though
I am struggling with the implementation of a fairly simple function. I want to create a hidden attribute based on a label cs_skmod. if the cs_skmod is 5 or less, the hidden attribute should be -1, from 5-10 it should be zero, from 11-15 +1 and from 16-20 +2. I tried it as in the instructions with a table with two columns and
${lookupRange('cs_table', 'Modifier', 'Score', cs_skmod)}$
, but it always returns ERROR.
I tried it with and without single quotes.
Modifier and Score, are those component names, or column labels?
Column labels
There's your problem.
I am so confused, I tried to replicate the example in the documentation. How do I get it to compare cs_skmod to the first column of cs_table and return the second column if it matches?
I don't have enough context (or experience) to tell you much more.
thanks anyway for the hint
Is cs_table a dynamicTable or an itemDisplayer ?
Cause lookupRange() only work on those 2, otherwise it will throw an error
it is just a normal table, that might be the problem
That is the problem yes
normal table are nothing more than fancily displayed labels
They don't really have any relationship between their columns in the eye of the system
So you will have to change your cs_table to a dynamicTable if you want to use lookupRange() on it
I just did it, the ERROR is gone but now there is no result at all.
Really wanting for a way to have variable width panels and not have them vertically centered.
You could make a css class with in a custom .css and add the class to your panels in the advanced configuration
Well that much I know. Was hoping not to have to break out the css for it, though.
Yeah, me neither, but sometime you don't really have the choice...
Did you give your dynamicTable columns the proper key you are calling in the lookupRange() function ? You should check what error the console gives you.
Thank you very much! I needed to provide the column keys, not the column names.
As a general principle, names are only for display.
Uhm, have you edited the system.json-file or why is it different to ours?
Yeah I think I edited it to the point of breaking it, I'm starting from scratch
Everything in the custom-system-builder folder in the system-folder is not meant to be edited by users at all if you don't exactly know what you do
Try to redownload the system
A combination of fetchFromActor() and setPropertyInEntity() should do the trick. But be aware, that users don't have permission to edit Actors they do not own
setValues() and setPropertyInEntity() are not applying the changes immediately. They happen all together at the end of the Label Roll Message
Possible, but requires quite a bit of scripting (including listening to Hooks). Do you want to continue?
Normally it should cast to the next best primitive
So fetchFromUuid() can only return a certain subset of primitive, of which boolean are not part of ?
It should include booleans
Oh, so would you say that warrant an issue on the gitlab ? I was not sure if it was a bug or intended behavior.
Test it with typeOf(fetchFromUuid())
It returns as String
k, then probably a bug
Ok wait a sec, I think I have found something off
Ok, if I first use fetchFromUuid(...) and store the result in a hidden attribute variable and then do a typeOf(...) on said value it returns me String but if I do typeOf(fetchFromUuid(...)) it returns me boolean.
Example:
If I defined an hidden attribute weaponRCrit with the following formula ${fetchFromUuid(weaponRight, 'critDouble', false)}$ and then do a typeOf(weaponRCrit) ==> return boolean.
But if I just do typeOf(fetchFromUuid(weaponRight, 'critDouble', false)) ==> return String.
That should be correct. Labels and hidden Attributes will always store strings
Even numbers will be cast as string when declared in hidden attributes ?
Yeah. But usually not an issue with numbers, because the usual operators coerce them back to numbers
Was wondering why I was not forced to use equalText() for equality comparison on numbers stored in hidden attributes yeah.
Yep, and there's no string concat with +
So if neither labels nor hidden attributes are 'safe' place to store boolean result, any idea of where I could store them on an actor sheet without having them turn into string ?
Ah, maybe hidden checkbox I guess
Actually nowhere besides Checkboxes. The system is missing stricter type controls for now
'1 year ago', yup definitly in the todo list then. π But wouldn't this change risk breaking systems developped using workaround in previous versions of the CSB ?
Like if I use equalText() to circumvent the issue of my boolean hidden attributes turning into a string, would that be problematic in the future ?
Can't tell for sure, but what I've imagined for Components like Labels would be an additional field for type-selection, where you can select between string, number, boolean and auto (with auto being the default for newly created Labels and string for old Labels)
So I guess hidden attributes wouldn't be affected by this change then.
They work the same way as Labels, so adding a type selection field for them is also no issue
Guess then with the old labels & hidden attributes defaulting to 'string' like you said should be enough to ensure backward compatibility.
Yeah, that should be enough
I do π
Do you have some good insight and/or tricks&tips for that?
Heyo, long time no post! I've finally come back to running my home system and wanted to make some incremental upgrades. Hit another wall (I've forgotten most of what I learned over a year ago now π ). I'm trying to roll dice using a text field in a dynamic table... I'm getting errors and I just want to know if I'm missing something super obvious or whether this just isn't a viable function.
${sameRow('WEAPONNAME')}$ : ${sameRow('DAMAGEDIE') + ref(sameRow('WEAPONABILITY'))}$ ${sameRow('DAMAGETYPE')}$
Currently outputs with the Weapon Name : ERROR Damage Type.
I've tried a few different things but this is the closest to outputting what I'm looking for. Take mercy for I am no keyboard wizard π
Could someone help me get my head around css. I've built the css in notepad, put in in the data folder and saved it as a .css but now, when I go to select it in the CSS style file in Game Settings, it won't show up?
Known Foundry bug β the file browser is not able to recognise .css as a legit filetype.
Write in the game setting the path to your file yourself.
CSB will use it.
Hint: you have to reload your gameworld afterwards to give CSB the possibility to use your CSS.
Huh, I actually thought to try that already but still doesn't seem to be working, unless I'm making a very nooblike mistake?
typo in directory name
Ahahaha I'm such an idiot
Is there a simple way to get the number of entries in a Dynamic Table?
count(lookup(...))
Oh I didn't see count in the Repository
It's part of the mathjs-library
Yes I just saw that. Thanks π .
man looks like i've been missing a lot
How do i fix this, i was told to delete the item ID but idk how
Hi @formal goblet ,
I don't know if it's a bug .. but everytime I use "use an extended text editor" in a chat message, all my > and < in an ${value}$ transform into < and >, and messed up all my condition π
Hello! Is there a way to get the system to pull up the radius tool when you click a button on the sheet? I know in other systems if you cast fireball or something, as part of the chat log it will automatically get you to select a circle template with a predefined radius to drop where you'd like.
Has anyone created a HeroQuest system on Foundry? I am just loving this game and it would be fun to play online with my out of state friends.
Due to copyright stuff I would think we wouldn't be able to have adventures and stuff like that built in, but if we simply had a system where we could have the character sheets and NPC sheets and the dice rolls then users would just have to manually enter there adventures and PCs/NPCs and upload maps. But just to have the system available would be cool. Maybe it could even include the free download adventures from HQ. And there are people who make their own adventures that they could share.
Hasbro Heroquest or Chaosium Heroquest (aka now Questworlds)?
Yeah, i think i've seen it somewhere too
it seems you delete the _template of the item ?
fromUuidSync('uuid').delete() in the console with the UUID of the Item (the upper one). The lower one is the UUID of the Actor. Make sure you use the right one, otherwise the Actor will be gone.
Well... More like an UX issue, because that is more or less the intended behavior of the Rich Text Editor. The conversion happend because of htmlspecialchars (you can look that up online if you want to know more)
That has to be scripted by yourself, CSB doesn't help there
I'm using it for making the roll output more readable π if it's an UX issue, well..
Thanks!
How would I make a roll label set initiative for that token?
please help. I have macro to randomize NPC it worked realy well and fast for long. but since updating csb it started to work reaaaaly slow like minutes to proces 3+ tokens. Do i use something depricated or something? please help
How would I add a modifier if the die roll was a certain number?
One result, use the Roll in a ?: conditional. For a bunch of results, use a switchCase()
Open the console and see what happens there. An Actor Update can be quite expensive depending on the complexity of your sheet
Hi, I'm kinda unexperienced with Custom System Builder and I want to set up an inventory kinda like pic related (You click on the container in the inventory to look inside it). This is for an OSR system, so the backpack/belt pouch/whatever would have its own weight added to that of all the items inside it, and then the weight of the container added to the character's total encumbrance. I have no clue how to accomplish this or even if it's possible lol so I was wondering if any of you guys could give some pointers.
Based on what you have there, you would probably do most of the math in the item, then just pull the total weight value to the character's item displayer.
Have you read the wiki about setting up labels and then using the formulae to total them out? The value in the Total Weight label would look like ${sum(sum(lookup('<contents key>', '<Weight key>')),<base weight key>)}$
in the picture you have there, it would return 110, because you don't have a weight set in the base weight label.
@formal goblet Is it possible to add an option for coloring jauges ? for skills points,action points etc. π
That's usually done with CSS, Scyrizu has guided a couple people to it in the past.
Arigato π
Maybe an option for it will be easier for beginners π
If you have time @sinful spade can you take a moment to explain me your css class ? π
What's wrong with this item filter?
equalText(item.PerkType, "Advancement") and equalText(item.PerkCategory, CategoryA)
It works without the second term. CategoryA is on the item sheet as a text field.
Says it's an uncomputable token.
hey sorry for the delay π
i haven't been active in this chat very much since I've been putting most of my time to building my company's website rather than the character sheet.
what did you need?
always appreciate you pointing people my way!
o -- just recoloring a meter?
background-color: rgba(0, 0, 0, 1) !important;
}```
replace .meterclass with whatever class you give your desired meter(s) π
I try to know my limits, I can advise on formulae, but CSS isn't something I'd say I'm proficient with, whereas you're an actual professional π
haha i'm actually not though!
i cant even code a single line of JS -- which i think bars me from any actual web dev job haha
I want to make a uniform size system, and I have information about it in one place.
But I need that information on every item and every character. Can I somehow access a dynamic table from another sheet?
Or can I make some static constant info and not be afraid of deleting it?
what is a uniform size system? if it's always the same information -- why a dynamic table?
{rather by same information - i dont mean values , but the same fields}
Uniform size system, like, 1 = 2-5 meters no matter if it's an item or a creature
And stater is 0 = 1-2 meters, like a human and also a longsword or a greatsword.
I have values from -13 to 62 rn and redacting them in two or more places would be such a pain.
And a dynamic table to hold the relation of size number to meters it represents.
ok im following so far.
do you need to reference that in formula or something?
i'd think you could use a subitem template and place that into all your items as needed
-- or an item for actor sheets
as far as referencing it outside of the actor... I know i've seen others do it with JS but that's out of my league.
- i suppose a CSB function would work as well find, lookup, etc... depending on your usecase
i've referenced dynamic tables from the parent actor in items before
I need to get the data from a table by key, i know how to do that, but the table has to be in some way connected to the field, either it has to be on the sheet, or through parent-child connection.
Subitem template is not an option, as i can't update it properly, as i want to add new sizes up to -100.
Yes, i am crazy
And also, can I update dynamic tables with code? So they can update on their own, when i do a specific thing
I feel like I must be missing something, here.
I have a perk in a class as an item. So long as you have the permission, if you try to move the perk to a character sheet, it removes it from the class. It seems like there's not even a modifier key to make it a copy.
So is having items in items that you're expected to copy over to your sheet not intended, or is there something I can do to make it so you don't have to go looking through the items list for a fresh copy?
i've updated values within a dynamic table. idk about adding new rows tho
setPropertyInEntity('self', lookupRef('attributeTable', 'attributeBase', 'attributeName', 'Motor'), (ref('ccMotorAdd') + ref('motorRef')))
chance the value fo the motor score to the old motor score + the additional value
now that's within sheet, you'll probably have to identify target actor somehow outside
and how are you looking up a field and not it's value?
how understanding this is harder than an actual code?!
i cant code lol so idk - but this isn't that bad
hold control when you move it to copy?
idk if i follow correctly but sounds like your classes arent items themselves?
Doesn't work and yes they are, respectively.
referecing a field and not its value?? idk what you mean?
like how do i get 'strength' and not the value of strength>
so your perks are subitems? where are you movng them from and to?
i've found a wiki paragraph for that command, thank you
i can't find a way to replicate that bug, can you show us how it works?
Perks are items, classes are items, the perks are in the classes, the class is on the actor, and I'm trying to copy the perk from the class to the actor.
Note that I opened the class from the actor.
i've found how to replicate it
thank you for the demonstration
It's not a template. The template doesn't have any items at all.
it works like that only if you have that parent item on the item sheet
i think it does that to prevent duplication
I mean ideally none of these things would get fully cloned without explicitly telling it to, and everything would be references, but I am given to understand that that's not something CSB does.
if you need to avoid that, you can use a UUID link:
@UUID[Item.mgY46jgoqYJGqO0U]{aaaaa}
So... What, have a big rich text field instead of an item display?
it works in rich text
yeah... Something like that
it's not pretty, but
Hm... Maybe I can use a dynamic table, and have it look up the item by UUID for the description.
Let's find out...
and also it shouldn't work as references because it's items, that can in theory be changed(like durability of an item), so that it doesn't change the durability of all items of that type
what i hate is, it can't see items inside other items to update them, when you reload all sheets. But i think it's a bug. (items inside actors too)
is it working?
So close.
it's not a rich text, is it?
That's a label, there.
TIHI
Rich text is... Interesting.
what the hell is that
is it rich text or is it a label?
That's rich text.
so we can't put it on item container?
Oh wait what
that's what I was supposed to do? Uh, hold on...
nah, you can't
Just labels and meters.
yep
In any case, this isn't a half bad compromise. Dynamic table where you put the UUID in and it gives you the reference and description.
Can hide the UUID for players.
i just want to shoot that mf item container
It's certainly special.
it's so handicapped, that i want to put it at rest
i just want a checkbox, is it that much i'm asking for?!
i hope that next update would make item containers better
So, are you gonna leave it like that?
Just make the UUID field seen only by gm, so players can't break it
Yeah, probably.
I know i would)
Has anyone figured out how to edit item displayer tooltips?
I'd love for there to be a display under there saying basic weapon properties rather than needing to open it (quick view)
Tbh, I've never even looked. It seems like I remember seeing a tooltip option somewhere..
there are tooltips for template components, for example i could put one over the entire item contianer, where if im hovering over something it'll show whatever's in the tooltip. This doesnt allow for per-item tooltip changes and has a weird double effect since there are two tooltips being called
it's defined in the itemContainer.js file, about line 700, it specifies item.name as the content.
right, it's defined within the CSB system --
so i suppose it'll have to be done with a world script or something?
I was hoping for a ready-made way to edit that haha. i wasn't kidding about not knowing JS
it's a one-line change if you create a tooltip field in your items and change that line to item.tooltip. You just have to go back and change it when they update, or like you said, add a world script to change it on load. If an item doesn't have item.tooltip it already has a fallback of just showing Item in the tooltip.
oh i see what you're saying, change the tooltip from pointing to name by default to a label with my custom HTML.
That's a pretty neat workaround.
Honestly that sounds like a perfect 'bite-sized' first javascript project if anything to learn how to make a worldscript
i'll put that somewhere on my todo list.
The world script answer is definitely the better choice, after all, the other way you're mucking around under Linked and Martin's hood directly.
it's bound to happen eventually tbh π€£
This section right here is the one generating the item on the item displayer: (the highlighted line is the tooltip instruction)
That's line 700.
Yep, just recoloring a meter π
I just put that line in the css section of my meter and voilΓ ?
the css section of the component is just where you put the class 'meterclass' or whatever you're replacing that name with.
you'll need to make a css file and use that to actually add css code to components. unless you hard code them using pure html in labels.
you'll need a css file eventually, best to just do that.
or use the customcss module, i'd have done that in hindsight if i had known about it
Thats what i do, but the only css I'm using right now is just turning the title bar text red for no real reason
And I choose the css file in the module's option right ?
Honestly, it's fantastic that you can edit the css and see changes in real time with that module. sure beats what i have to do since i just manually edit my css file.
save, go back to browser, refresh, go back to file make changes... repeat .
though, it can be a bit annoying to navigate once you start getting large amounts of css in there.
maybe i should edit in custom css module then save it to my normal file once i'm happy with that 'component'? i wonder if that'd work.
im not sure what you're asking but that sounds ... right?
In the csb settings options.
Sorry, english Is not my native language and it's early π
lol its late here and i've got a headache from trying to get the dice code shifu provided working π¦
my concentration is very low atm
So, in the meter I put "name of the class" in the css field, and I create a css file with the line of code you give me ?
yep.
just dont forget to name the meterclass in the code provided as well
also -- 0, 0, 0, 1 is black so . change that to whatever
why would you ever π
you can but i'll be very disapointed in you.
background-color: coral;
It feels easier, I'm really sorry, π
bro out here color coding with 2012 minecraft color codes π
@deft sluice haha sorry I thought that'd be better received. Just pulling your chain. Whatever works for your sheet and time allows.
I'm not the only one who found it simpliestπ
True enough. And you can always go back and change it to get more customization later.
It's already complicated for me, I will stick to a simple recoloring π
"keep it simple" like they said
(π for your sheet, it look awesome)
im new to CSB's formulas, & am trying to figure out how to make the meter on the left hand sheet for the item "Vessel: Cat" equal the "Vessel Body" on the item
the meter seems like the best way to do hit points, but im struggling to figure out how to make it work?
What left hand sheet?
sorry the image didnt attach
Ah so how to make the meter value == a number value?
yeah i made an item template for "vessels" which have HP ratings called "Vessel Body"
but im just struggling to figure out what formula would link it to show up in the left sheets item displayer
Thanks! π And remember I'm available for commission!
I'm not sitting at my pc rn so off memory may be a little odd.. there's a premade component for meters in item displayers right?
im not sure, ive not worked with these formullas before. last time i set this up a friend did it so I'm completely green to this aspect
If so, we can just set the meter value to
${item.VesselHP}$ assuming that vesslehp is the component inside vessel: Cat
so you need to do the item. before the tag you set it up as?
Pretty much!
succcess on the rating one!
hmmm, the label text for rating worked, but the meter isnt
Btw just a UIX question for you,
But you are aware that if your hp is nested in an item you'll need to either code a button to modify it, or you'll need to open sub items every time.
It may be worth the time considering if that structure is best long term
it is, since this game allows for multiple "bodies" in the form of vessels
is there a way other then meter that might be preferable?
OH it did work
It wasn't the meter I was bringing up but the actual number field value that may be irksome.
A dynamic table may be easier depending on your usecase
i just didnt update the item on the sheet
And it looks fine? You just set it to be the max not the current π
oh thats an idea
Oh good! Glad it worked
yeah i forgot the item on the sheet wasnt the one i had opened
yeah the meter has the look id want but adjusting it would be a pain.
You can put a meter in a dynamic table with a bit of work fyi
would i put that in the item or the item displayer?
i only see the option of a label or meter
I meant not using vessle items at all, switch to a dynamic table with columns for all the stats you need so you have easier access for editing
Or if you're good with JavaScript you could just write a macro that updates health values for you, thought idk anything about that
Only for css or for entire sheet coding ? π
Depends on your usecase though. If you're using the vessels as tokens for example, that's a whole other story. But then you're looking at actors and not items anyway
Lol both π just not JavaScript. Can't do it won't lie about it
No custom macros here haha
Maybe later, I will call you, I'm thinking of my magic system
There's damage multiplier for each magical element, weakness and resistance, etc.. ..
yea vessels are numerous & more like items that have HP then anything. so it wont be tokens so much as just a way to track home damaged their current meat suit is
items just make it easier because there are tons of different vessel types for people to purchase, & drag/drop onto the sheet
Doable! Let me know.
Absolutely, and especially if you want say, a human vessel that can equipt weapons or armor.
Items can hold sub items no problem
Will PM you π
thats actually very relevant too, im reading through the chapter on them now, they can get "roles" & other options added to them. vessels are very complex. and this is just the core book for In Nomine, ive got like 5 more books of content to add to it once i get the base sheet ready π
im wondering if there is a way to setup buttons that might adjust a vessels body HP up & down. hmmm
ugh that would be complicated
I'm not sure what system you're running, but it's almost sounding more like vessels should be actors in their own right, tokens and the 9, where the angel acts more like a 'party sheet' for most of the game?
I've done something similar. Not too hard but then you're limited to 1 and 5 intervals for example... Not ideal and slower to update in the actual sheet (there's a lag for some reason for the item to update)
Well I say 'slower' maybe the same time overall
sadly thats a bit too clunky, given that everything else other then HP, & some equipment is rolled from the primary sheet.
π€ interesting
i might have to give up on having an identifier for each vessel
and instead have a "current vessel HP"
heres how the pen & paper sheet looks,
Nah you can absolutely have the meter and it'll work no problem
I'm just obsessive about not having to click through tabs or open sheets I don't have to in my system
Also just workshoping ideas with you.
so in this case they only use 1 vessel, but as a campaign goes on they will get more. like animals & other mortal forms.
Yeah I think you're on the right track with using items for vessels then... Opening their sheets isn't the worst thing
Well I guess it really depends on what tokens / actors you end up needing.
ok i got it tracking the active HP vs max now
But anyway whatever what you want it to work.
You can absolutely have the meters displayed for shorthand in the item displayer for a quick view and have buttons for adding / removing 1 hp at a time (+1 additional interval of choice)
yeah i think the buttons might be the best bet. maybe i can set up a table to "select current vessel" from a dropdown of all available vessels
the mind & soul HP would also benefit from that as well, but thankfully those are just static so i can figure those out later. i mostly wanted to get vessels figured out since they are the more complex of the 3 types of character options
thanks for your help on this @sinful spade. im slowly figuring this out
Dude I get it haha.
I only got to where I am because of how helpful everyone here is, especially martin.
π€
You could stack all three on top of each other to display but that may get kinda cramp
Something like:
Mindvalue mindmeter
Soulvalue soulmeter
Bodyvalue bodymeter.
In either two columns or one column showing a 2x3 table with the content
yeah im gonna move onto some other basic sheet organization for now, but thats stuff i can figure out when my brain is a bit more awake
working on organizing the skills now.
ok so now im running into my radio buttons for skills not being clickable effectively
so ill click one & sometimes it will select the one i clicked, but other times will just jump the selected one to another
I think that may have something to do with your radio key values
But I'm not sure, check for errors in the console
that fixed it! the left hand side ones had it set to 0 vs the others just being blank
the way the game works this is really useful to have them laid out like this, because every skill comes with an untrained penalty. so these are the defaults if someone doesnt buy a skill up
I may have to look into that system at some point, it looks interesting
oh its alot of fun. its In Nomine by steve jackson games. same people who made gurps. you basically play angels & demons good omens style.
How would I make a roll label set initiative for that token?
hey gang - I did my first session in CSB yesterday and ran into an issue where some actors' health and other resources were uneditable outside of their character sheets, like as values attached to their tokens. This even applied to me as GM. Any idea what's going on and how to fix it? You can see in the screenshots that the one on the left has the text for their health and other resource greyed out and uneditable, but the enemy on the right's health is editable.
It would have to be through a script, initiative is handled through Foundry's interface normally, so its not a set function of the sheet. A way to do it could be to find a macro that does just that, then use that text along with some csb formulas to set the values it's looking for from the sheet. Encompass it all in a ${#%{}%}$ and it'll happen invisibly on the roll label. It's not something I've personally already done though, so outside that theoretic direction I dont have any hard examples.
hey i have a quick question i created a dynamic table for armor locations i want to sum up the armor value of all rows that have the specific locations checkbox ticked if the checkbox is not ticked it should just add 0 how would i do that? what i have so far is this for the head for example:
${(sum(find('armor', 'head') ? lookup('armor', 'av') : 0))}$
the problem is it adds the value of all rows even if just one checkbox is ticked
Assuming the checkbox is in the same Dynamic Table as the value you want to add. You could try something like sum(lookup('dynamic_table_name', 'column_name_where_the_value_is', 'column_name_of_the_checkbox', true))
jeah it is i*ll try
now it prints an error in the label
${sum(lookup('armor', 'av', 'head', true))}$
nevermind had a typo
sorry XD
thank you so much
You are welcomed π
It depends on how your Attribute Bars are set up, because there are also read-only Bars
I think I figured out the issue - the ones that I can edit are essentially custom values, while the uneditable ones use a health attribute bar that's based on their max and current health values, which are established directly from their sheet. What would you recommend I do to make a functional HP attribute bar that directly ties to both a character's current_hp and max_hp variables? As far as I can tell, I can't tie a bar to two variables at once.
The current value cannot be a variable and editable at the same time. They just eliminate each other
Sure, okay. So essentially I won't be able to have a character's HP on their sheet? It'll just have to be an attribute bar and that's it?
Assuming I want the bar's values themselves to be editable on the token rather than having to open the character sheet to edit them, I mean.
If you define a Numer Field with a max-value, it should automatically create an editable Attribute Bar, which only needs to be selected from the Token
Perfect! I literally just realized it as you sent the message. Thanks a ton!
Is there a method to get one Dynamic Table to show as 2 columns? I can't think of any shortcuts to make it happen, figured I'd ask here.
wdym?
This table is quite long as 1 column, but there is enough space to its right to have it show as 2 columns, half where it is now, and the latter half continuing at the right of it.
Kind of like so:
I see. Not that I know though
Hm, very well. Thanks.
I had tried adding additional columns and naming them the same (e.g, 2 checkbox keys), but CSB really didn't like that. It would display correctly, but if I tried ticking any of the boxes, it would select everything.
I will keep it as is.
Related: I haven't been keeping up with CSB lately, but is it yet possible to have a table with, say, 3 columns display a component across more than 1 column?
For instance, column 1 would be one component like a Label, and columns 2+3 have another component, maybe a table or whatever.
You can just make a second table, no?
He might be doing an operation on the column, like a lookup()
I could, but I have another section that references ticked checkboxes.
Precisely
That COULD be less efficiently done with individual checks, (I did it recently) but it's not very pretty, code-wise.
I'm already not great with the coding aspect of it, I'd prefer to keep it as simple as I can.
if(${equalText(WepTypSel,"BW")}$){
if(${equalText(BWBV,"inf")?true:BWBV>1?true:false}$){let BV = '${concat("BV",${BWBV}$)}$';WepTyp.push(BV)};
if(${BWWU>=1?true:false}$){let WU = '${concat("WU ",BWWU)}$';WepTyp.push(WU)};
if(${not(equalText(BWWiA,"None"))}$){let WiA = '${concat("WA ","${BWWiA}$")}$';WepTyp.push(WiA)};
if(${BWAMiss}$){WepTyp.push("AMiss")};
if(${BWVAMiss}$){WepTyp.push("Var. AMiss")};
if(${BWAPers}$){WepTyp.push("APers")};
if(${BWVAPers}$){WepTyp.push("Var. APers")};
if(${BWAllPur}$){WepTyp.push("All Purpose")};
if(${BWFrag}$){WepTyp.push("Fragile")};
if(${BWMega}$){WepTyp.push("Mega-Beam")};
if(${BWHydro}$){WepTyp.push("Hydro")};
if(${BWDisr}$){WepTyp.push("Disrupter")};
return WepTyp;}%```
Spits out an array of the various selected checkboxes, when they're checked.
They're contained as individual checkboxes on the sheet, which allows them to be moved around.
That could work, but I'm not sure the juice is worth the squeeze.
You could also double up the lookup with the and, or functions
Or if you're looking for css solutions, you can just add a max height to the table and a scroll bar
It's fine, I can keep it as-is and just reorient the visual formatting.
Relative to this question, no, it's not.
I didn't think so, but thank you.
Unless CSS can make a div overwrite a following div, Scy?
Not sure why you'd do it that way, you could just make two columns and make the second column twice as wide? Same effect no?
You can't necessarily overwrite a div in css, but you can use pseudo selectors so select where things should be in a hypothetical div?
Like row 1 row 2... Row 3 doesn't exist but
Row-2::after
No because 1. resizing the window screws that up, and 2. there is no way of setting a specific width. There is only the guesswork of "Tiny" > "Gigantic"
Resizing the window screws up a wider column taking the same space as 2 columns?
Side note, you can set specific width with css, the csb just gives you quick access to predetermined values for ease.
From what I've tried, yes.
Heck, their 'grid panels' are just basic bootstrap principles, you can just manually change the values and what not.. I have several '2 grid panels' where it's split 70% 30% not 50/50
In case it isn't clear, this is what I'm talking about. Blue is a 3 column table, orange are two components where one takes up one column and the other takes up 2.
So you're not even using rows
No, just columns
Then don't use a table, use a panel and set the width
Make it 70/30 instead of 50/50
How? Setting a panel with X columns still doesn't allow you to have something take up more than its column
Actually depending on what comments you're putting in there, you could just do a horizontal panel and let the components figure their own spacing out
Please show me, I'm not sure it's possible
You'll need to specify it in css.
Do a grid of 2 columns
Do you have a css file?
Yeah
Probably something similar as this: https://tailwindcss.com/docs/grid-row
^ pretty much
Cool, thanks much. Cheers
except that's tailwind, never used it so -- does it work in standard css or csb limits?
No, but the normal style attributes are also listed there, so you can just map them
grid-template-columns: 75% 25% !important;
gap: 0px;
}
had to go digging for what class it was haha
@velvet heron this is exactly what you need, just replace the class to whatever class you give you panel and cahnge 75/25 to whatever values work for you.
the gap controls your 'grid margins'
I will give it a shot.
pretty much how i've been using bootstrap haha
anyway Teld, it seems that using a dynamic table for your list is what's limiting you in terms of horizontal spacing. Why not use a regular table with 4 columns? or even just 2 columns with a panel in every cell that contains the checkbox and label?
I hear that you want to use lookup functions but not sure how using a bunch of sameRows is better than just checking the value of the checkboxes
I need to have an extra option to manually type something in which necessitates the dynamic table over a regular one
Which.. I suppose could be possible now that I think of it
So the way I've handled that is, max-height tables with scroll bars that only the GM can see... the players just see the resulting list of everything that applies usually.
Oh, that's already exactly how I have it. the dropdown list/dynamic table is only for the GM to select. The players will only see the selections. I was just trying to make it nicer for the GM haha
Hey @formal goblet , how many steps can a template's undo button go back? Is there a hard limit before it can't undo any more or does something else?
I think it was 10 steps in either side
Hrm, okay. Thanks
I do this all the time.
Create a panel of three columns
Create two panels within that panel.
Set one to span 2 'columns'
So if you want it like in your diagram, set the second panel to 'span 2'
To do this, give the right panel a class name (I use 'snarlyright' in this example).
In your CSS file, add this:
.snarlyright {grid-column: 2 / span 2;}
Hello guys, I would like to know if you had any YouTube tutorial videos to recommend For someone trying to learn how to use CSB ?
How can you catch an 'ERROR' and/or replace it with a '0'?
fallback() could work for that, depending on the error.
Ty that seems to have got it to work.
there's a very old and outdated one... so probably best not to use it
real quick, i'm trying to get an item filter to work based on names containing a partial string -- anyone have any ideas?
not even
equalText(item.name, 'sword')
is working
I have a thought, but let me try it out first and get back to you.
What's your desired use? A lookup?
nah, item displayer filter
i'd love to get all items with 'sword' in their name ideally
Ah, right. You said that.
I'm thinking something with compareText() might work for it, but I want to see what the output looks like.
is that not the same as CSB's equalText?
nope.
and it's math.js's equalText(), they're both from that library.
And.. nope, that's a miss.
same output for 'Mace' as for 'Sword, Long' from its perspective (compared against 'sword')
It could be done more indirectly with a script, but I don't know that's what you're after.
it's sort of frustrating, tbh. Like if it would just look at a script form, something like %{let text = "${item.name}$";let result = text.toLowerCase().includes("sword"); return result;}% should return true, but it doesn't seem to want to nest the formula delimiters.
Aha! I did it!
I looked at the actual HTML for the item reference, copied it over, and stripped out anything that didn't look important and didn't make it break when it was removed.
<a class="content-link" draggable="true" data-link="" data-uuid="${sameRow('AdvancementUuid')}$"><i class="fas fa-suitcase"></i>${fetchFromUuid(sameRow('AdvancementUuid'), 'name')}$</a> This, in a label, works.
Sometimes I can't leave well enough alone. I got it working, with two caveats that make it a bit sub-optimal. The first is that you need to create a checker label on each item template. The second is that the code is for exactly one item displayer that can be filtered. The result though, looks like this:
Nice!
I figured it'd be helpful to players to be able to sort their invi by 'swords' and 'bows' for example
The code on the item (key = itemFilterMatch) is: %{let text = "${name}$";let result = text.includes("${fetchFromParent('filterValue')}$");return result;}%
And then the filter config is just:
itemFilterMatch is the code on the item.
well.. it doesn't SORT them, it just hides anything that doesn't match the filter. And it's limited to one filter, so having multiple ID's with their own filters won't work for it. It's not a perfect solution.
but if you blank the filter it does show all the items.
god you're beautiful π
i'll be snagging that and making it beautiful soon
What does the final outcome look like?
GM Side:
Player side:
Items can be clicked and dragged into sheets without removing them, and it doesn't create any item embeds.
Wish the item references in the description labels worked, though.
Those links only work in chat cards, journal entries, and RTAs, unfortunately.
Looks really nice though, congrats on overcoming!
Hey still want that YT tutorial?
Ho ok, thk's for the warning :D
you're like the 10th person i've seen in here askin
yt upload times probably mean check back in a few hours
and it's not comprehensive or anything, just a strong set on the basics - most middle level stuff. didnt cover csb functions or anything. that's for a later date.
I've been browsing the wiki for six hours, but a video really helps !
And the basics are already good; this is stil a good starting point !
I feel you --
Even when i was still in school i struggled to read documentation
I'd always setup my pdfs in a reader and tolerate the awful ai voice before i read anything lol
I think this'll get you pretty dang far. Some to be desired with dynamic tables - mostly because i avoided getting into csb functions and what not.
at least, i think this'll get you far enough that you're in here asking the right questions while i work on another video if there's demand for it
This tutorial covers the basics to intermediate functions of CSB without the use of JavaScript. We cover item / actor templates and sheets, as well as what most of the components do at their core.
We do not cover CSB provided functions, or advanced uses of components (aside from the label), which will be left for another tutorial if there's en...
@formal goblet consider pinning this if you approve? may eliminate a fair chunk of your repeat questions
Also even if you know csb please interact with the video π help get it to the top of the list for new visitors
Hi HWhat is the old command fetchfromdymanictable command been replaced with, as I am getting errors.
lookup(), or find() for single values.
Thk's again dude, realy, you just spared me so much headhache on brute forcing the system tu understand how to use CSB.
You's the GOAT.
Heyo, been a couple of days. Wondering if there was anyone who could help me with this one! π
Can you give a little more context? Generally you can't use rolls in anything outside a chat card.
Like if a value in a dt was set to :1d8: it would reroll that every time the sheet refreshed
This was my suspicion. I essentially want to set up a way for my players to input the dice they want to roll when using their gear. For example, the damage die for their weapons. I know there is a more sophisticated pathway of creating the items and having things run through there, but I'm currently in the playtesting stage and would rather have a more flexible way of inputting and processing that information.
A.k.a, create text box for players to put 1d6 + 2, click a button and it rolls that out.
This is how I have it set up currently.
Managed to get everything else working other than the rolling of the damage die.
OH, that's much simpler. You want to take the text of the Damage Die field and have it roll that. Not what I was thinking at all.
and this is your actual formula?
${sameRow('WEAPONNAME')}$ : ${sameRow('DAMAGEDIE') + ref(sameRow('WEAPONABILITY'))}$ ${sameRow('DAMAGETYPE')}$ ?
And what you're looking for is the text output line, right? So you'd like to have a text output that says "Sword : 1d6 + 1 Slashing", correct? You have the rolling part covered?
or do you need the whole damage roll handled too?
Yes, that's precisely it.
Yes this is what I'm using right now.
I need the damage part handled.
Working on an example for you to go off, essentially you're not rolling anything there. One sec and I'll be done and then you can edit it however you like π
This is how it currently outputs for reference.
Happy with the top row, need the error section to roll the dice from the text box.
${[:sameRow('DAMAGEDIE'):]}$
The reality being I actually had it like that before makes me very upset.
That's what I was getting at as far as "not actually rolling anything."
Here's what I was going to show you:
${#modifier:= sameRow('WEAPONABILITYMOD')}$
${#type:= sameRow('DAMAGETYPE'}$
Weapon Damage for ${sameRow('WEAPONNAME')}$ : ${[:damage:]+modifier}$ (${type}$)```
I did guess about the key for the Ability Modifier, so fix that if it's something else.
This is all perfect.
Got it rolling how I want it now.
πͺ glad it got you started.
Did we miss anything you ended up needing? I'll need to write a list for the second part if I ever get around to it haha
How do I show a custom stat on a character sheet in a Rich Text Field
Cause I know that when I drag and drop an item or chacater into the Rich Text Field it show as this: @UUID[Actor.8GnUu61ZlIiJcJ2z]{Talion v2}
So how do I get it to recall a Label that has the key of CON
Outside of the actor, right?
inside
fetchFromActor('John', "Strength")
Oh, inside the same sheet? Just reference it normally
${CON}$
Honestly I never use rich text areas, since there's no premission to stop editing.
You can try to be more explicit with ref() but I don't think it'll help.
You may just need to use a regular label with inline styling
I just want my players to be able to take notes about there characters here, and be able to make it where it can auto recall a stat in said notes, so it will change as they lvl it
Hmm... You could put a stats area above the rta...
You could also try playing with the escape quotes function to see if it lets anything through
yeah i think you're stuck with a stat section somewhere either above, to the side, or below the rich text area.
you could try a journal which should support both... Give them a link to their journal page they have control to edit in their sheet.
Yeah, I would have to do that as a work around.
RTAs don't resolve Formulas
Would an enricher-like system be a feasible feature request? I see that there's a mod (MoreJournalEnrichers) that lets you set a variable enricher with key, which I assume (I haven't played with it yet to be sure) can be tied to a document value. I can see how an additional system of delimiters would be confusing for some people though.
Hi everyone. I will inevitably be back with questions later, but for now I wanted to say CSB helped me complete NaGaDeMon (National Game Design Month) last year in November and I just wanted to drop in and say thank you for giving me the tools to do that and run my game in Foundry.
Hi, is there any way to present the current status of a charcter that I choose from a dropdown menu on the character sheet at the token... so i mean like a health bar.... but with text.... it would say, wounded, blodied, dyeing, dead?
Nope, not with CSB itself.
hey so i am wanting to trry and use the UESRPG 3e (the unofficial elder scrolls RPG) and im wondering if this system would be a good base for it?
Thanks for this. Has worked π
Another question. The character templates seem to be getting larger due to template history being stored in them. This seems to make the actors and world slow to load. Is there an easy way to remove this besides editing the Jason file?
"Json" file
Its been a while since I looked at it, but overall this is a good system for just about anything if you're willing to put in the work. However, there's a system for uesrpg available in Foundry, have you looked at that?
a day later, but here's all the HTML color names
https://www.w3schools.com/tags/ref_colornames.asp
Have a look at this module: https://foundryvtt.com/packages/healthEstimate
Health Estimate, an Add-on Module for Foundry Virtual Tabletop
π€«π€«π€«π€«π€« Don't put these here , you will awake the terrible @sinful spade and his rgb colors
I havenβt no I didnβt know it existed! Is it under the same name?
I got to come here for help again. Cant for the life of me figure out how to get the desired result.
${roll > [:Skill_Aim:]? 'Failure' : 'Success'}$
${roll > fetchFromActor('target','Exploit', 20)? 'Exploited' : 'No Complications'}$```
I want to change this so that the ```${roll > fetchFromActor('target','Exploit', 20)? 'Exploited' : 'No Complications'}$``` only activates if there is a targeted token with an Exploit variable
<span style="display: ${!fetchFromActor('target', 'Exploit') ? 'inline' : 'none'}$">Your Content</span>
<span style="display: ${!fetchFromActor('target', 'Exploit') ? 'inline' : 'none'}$">
<p>
${roll > fetchFromActor('target','Exploit', 20)? 'Exploited' : 'No Complications'}$
</p>
</span>```
This at least isnt working?
> -> >
uh... what?
Check your formulas again. Your > got converted
ah okay, thank you
Is there a way to get a button to appear in the chat box to activate a different roll? Like if I do an attack roll from the sheet can I get it to create a damage roll that you can use in the chat box? Is there an example?
It's not a full blown button (looks like a link) but I managed it with this (which is the foundry chat commands)
Hello, [[/r 3d10]]
it gets you this
I imagine you could replace the dice text with a specific formula too, as long as it results in the standard dice format "[number]d[sides]"
oh, the button's kinda easy actually (in this example I connected one to a chat macro to test it, and one for just a roll formula)
Thank you! That worked for me!
Is there a way to rename the button? I tried <button name="Roll Damage"> but it displayed the actual formula instead of the name
I don't know if you can do it with just the roll command... you can do
<button>Roll Damage [[/r 3d10]]</button>
and that would say "Roll Damage
3d10" on it , but I don't know about replacing the roll text...
Here's the chat commands page
https://foundryvtt.wiki/en/basics/Chat
I'm bored and too lazy to work on my own sheet right now - system design road block.
Anyone need any help with anything?
Okay thank you! I can live with this!
Do you have anything that deals damage to a token? I have damage rolls and attack rolls automated but I haven't done anything to decrement health.
I don't -- Shadoghast was working on something for that tho.
It'd require javascript
I'll start trying to tackle that! Thanks! If shadoghast reads this an example will help go a long way!
Does it require to adjust the stats of a Token the player doesn't own?
I don't think so. I'd have either the GM or the player that owns the token to use it
The system is kind of big and clunky and each body part has AC and Health so it would speed up combat a LOT to be able to apply that with a tool.
Then you can just use setPropertyInEntity() from the sheet or actor.update() in a script.
Perfect! I'll see what I can get cooking!
If an item placed in an actor sheet contains a dropdown list (only numbers), the sheet should still display the dropdown selection if there is a label on the sheet referencing that, no? I keep getting an error.
Actually, it appears it still displays ERROR even on a brand new actor with no items on it, so it must be a wrong formula.
That doesn't look like an item displayer, you have to be using one to use the item.key format. If it is, sorry, just my observation from the pic.
Correct, it's not an item displayer. I removed item. from the formula and at least now the sheet shows blank, no error, but still does not show the value I'm looking for.
Welp, part of my issue was that I was looking at the wrong component, so wrong key. DERP. Corrected that but still blank readout.
Here is the item (middle), the item template (right), and the dropdown component w/ key.
So if the character sheet contains this item, then what formula should I be using for a label on the actor's sheet referencing this item key?
Is there a way to check if an item has a parent?
And on a less specific note, is there a standard way to mark where a particular item is? Eg equipped, dropped, specific bag...
The easy way to get it on a sheet is to have the reference in an item displayer, then pull it from that. The item displayer can have the item.key format, and then you can use first(lookup()) or find() to pull it from the item displayer. The alternative is that you have to use a fixed fetchFromUuid().
isNull(fetchFromParent('name'))?
Doesn't seem to work.
Neither does isNull(parent)
isNull isn't defined.
There should be something like that from the math.js library, one sec.
${equalText(typeOf(fetchFromParent('name'),"null")?"no parent":"parent exists"}$
I was clearly adding functions to math.js in my head again.
Seems like it always returns false.
If you call a function in a chat bubble can you pass values to it? So if I roll 1d6+5 damage can I pass that value to the funtion to know what to subtract?
chat log I mean
${[${RollFormula}$-Penalty]}$
Right, so I'm doing most of the Attack and Damage rolls in the character sheet. They then appear in the chat and I can create a button to roll the damage right in the chat so I don't have to go back to the sheet to roll damage. Now I'd like to pass that damage value to a script so I can select an actor and have the script decrease their health. Is that possible?
I don't know about that exact sequence of events, but there should be away to get the current targeted actor.
I'm using this to get the AC so I'm sure I can grab the Actor ID.
{#targetAC:=fetchFromActor('target',bodyValue,'99')}$
But I'm just going to have the GM select the token and have them decrease the HP. The real issue I'm having is how to pass the damage to the script
@cerulean adder You said you put a button in the chat message? How'd you do that?
Oh, I just wrapped it in <button>. I wasn't able to change the display of it though
<button name="Roll Damage">
[[/r ${!item.damage}$+${!strengthDamageBonus}$]]
</button>
</span>```
Looks like you don't need to wrap it in a button.
you'll need to give it a class and style it in css.
You're right. An item displayer was the correct choice. I'm just confused about how the item filter formula works, even after reading the directions about it on gitlab. It says The Item Displayer will only display those Items, for which the Formula resolves to true.
But does this mean if the filter formula resolves to true, it will display the item in the container, or will it just display the value for the filter formula? Because it appears to be the former, but the wording makes me think the latter.
It's the former. You type in a formula in the filter that has a boolean result (true/false or 1/0) without the normal ${}$ delimiters, and if the formula, from the Actor's perspective (meaning that if you're looking at keys on the item they have to be worded as item.key) resolves to true, the item appears.
Bet. Now, if I only have the one label column inside this item displayer for the value I'm looking for - which does display correctly - how can I make just the value appear and not show the boxed item name?
I wasn't in front of my computer then, and I'm awful at coding when I can't type and see what I'm doing wrong, so I probably jacked something in the code there. Did you get it working?
On a related note, any item without a parent of some kind (either an Actor or a parent item in the case of item-in-item) can't really interact with anything, what are you trying to make happen?
That's a CSS thing. You need to change how the item is displayed in the div. Not my area of knowledge, really, but @sinful spade can probably walk you through it. Essentially I think you just go in and define that specific item displayer's div, then set up how the items in it are shown, but that's likely a gross oversimplification.
Hide a field that's only relevant when you have the item in your inventory.
Unless you know a better way to store metadata about items on the sheet.
Lmk if you need help.
You can have the item property to change a hidden label to +1 and use that to change a visibility formula in the panel that you want to toggle
hello guys,
i have a problem with weapon damage.
i entered the damage as two data (string and number):
base dice count ${item.Weapon_Damage}$ - e.g. 2d6 and a calculated modifier (number), which can be + and -
there is no problem with the - value, because it is stored with a sign.
but i can't insert the + value. everything works fine separately, but not together.
The calculated modifier (this is in one of the lines of an item displayer):
${item.Weapon_Level == 0 ? item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_DamageMod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_Level == 1 ? item.Weapon_damage_mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_Damage_mod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_damage_mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_Damage_mod', 'Weapon_Level', '${(item.Weapon_Level)}$'))}$
So what I was able to achieve was to insert the line ${item.Weapon_Damage}$ into the label prefix.
I inserted the calculated modifier into the label suffix.
The result is that e.g. it calculates and displays the value 2d6-1 correctly, but instead of the value 2d6+1 it displays 2d61. Skips the + symbol for positive numbers - which would normally not be a problem.
I tried to enter a condition like this in the label:
`${#DamageModNumber:=[${item.Weapon_Level == 0 ? item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_Damage_Mod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_Level == 1 ? item.Weapon_damage_mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_Damage_mod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_damage_mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_Damage_mod', 'Weapon_Level', '${(item.Weapon_Level)}$'))}$]}$
${DamageModNumber > 0 ? '+' : ' '}$
`
this works by itself, but... the result will be e.g. 1+, because I do the analysis at the end, and I don't know how to hide the calculation before it, or change the order.
If anyone has any insight or solution, I'd love to read it.
Why do you even use nested Formulas? I see no need for that.
You could try out, if 2d6+-1 works as a Roll Formula. If so, your issue should be gone
oh, thank you! It took me a while to figure out what you meant, but I got it and it works! π
PM sent
^ Solved π
and you solved the + not showing up as well, right?
Okay, I was able to get a script going that allows the user to input the damage, select the body part targeted, and input how much to modify AC by. It works great but I was wondering if there was a way to pass results from a sheet roll to the script? Instead of inputting damage and all that would be awesome to click a button and have all of this information autofill and apply it to the selected token.
Has anyone sorted Dynamic Party Sheets yet?
Had all sorts of ideas to get a sheet where i could drag actors onto it like an item displayer but just realized that I cant actually do that lol
I could put an item in all character sheets that reference their stats, but then how do i real time clone those to a mirror item in the party sheet
A DT that has a "Name" text entry field that then looks up the Actors and Uuids by that name and uses their uuid to import their information? It could even set values if it's a GM-only sheet.
I was thinking about that, i may be able to
fetchFromActor(sameRow())
that'd let me get most of their important stats, not nearly as convient as just a dragdrop actor dispalyer
but it's doable
It would only need to be set up once.
i meant less convenient since it'd be based on actor name (MAYBE UUID) but if player changes the name, even accidentily since it's a big editable bar at the top... it'd break
idk how spaces interact with the name field
may cause issues in diagnosis
I've never had a player accidentally change their name lol.
π€· i plan for worst case senario. play players sent me on a 15m bug hunt because the info they entered int he character creator wasnt shown on their actual sheet.... they never hit save on the rich text areas
they're not computer-y people
honestly a part of me is worried about my stats being dynamic tables for the same reason
one errant click and space into the name field? oops there go all my refs
Maybe i'll hide the input and show a ref label there lmao
That's going to be an issue you just have, unless you have the whole sheet locked down with a checkbox to allow editing.
I wonder if there's a way to auto populate a drop down with all existing actors
ALL the actors? You could write a script that selects all the actors that are controlled by players and then populate it with that.
Nah, all actors. No reason to not have npcs included if they have hirings or what not
Probably a case of using a formula that gets all actors using a given template plus another template (players vs npcs)
The + symbol was fine in the end. I simply added it to the label prefix π
you can see the result in the picture, and the code behind it looks like this (ugly, but it works):
label prefix:
${item.Weapon_Damage}$+
label suffix:
${item.Weapon_Level == 0 ? item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_DamageMod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_Level == 1 ? item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_DamageMod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_DamageMod', 'Weapon_Level', '${(item.Weapon_Level)}$'))}$
label icon:
dice
dice code:
${item.WeaponName}$ damage: ${[:item.Weapon_Damage:+:${item.Weapon_Level == 0 ? item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_DamageMod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_Level == 1 ? item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_Damage_Mod', 'Weapon_Level', '${(item.Weapon_Level)}$')) : item.Weapon_Damage_Mod+(item.Weapon_Type == 1 ? Strength_Damage : 0)+(lookup('Weapon', 'Weapon_Damage_Mod', 'Weapon_Level', '${(item.Weapon_Level)}$'))}$:]}$
I did the same thing at one point.
you can also force CSB to recognize the + as a string with either
- '+'
- }$ + ${
- or string('+')
Thank you, it's always good to learn something new. It could definitely be coded better and more beautifully, but I only started getting to know it a week or two ago. Special thanks for your YouTube video - I learned/am learning a lot from it.
%{return game.actors.filter(actor => !actor.isTemplate).map(actor => actor.name)}%
Custom System Builder | missing name after . operator SyntaxError: missing name after . operator
I tried
actor.name!isTemplate
still no shabang
oops, wrong position of !. Try it again
Cannot get a button to roll with my Strength mod following your tutorial @sinful spade and I cannot figure out what I've done differently from what you demonstrated.
It's literally just this and I've double checked that it's making the right reference to the component key... There's so little here idk how I'm screwing it up?
${[!1d20]+STRmod}$
nvm, just tested the ! does indeed go inside the bracket.
are there any errors in console?
I get one about a minimum screen resolution, but I don't feel like that would matter. I don't see any other errors.
oh wait, duh. Yeah there is, I forgot I refreshed.
You've included text inside the strmod label, it needs to only be a number. If you'd like it to have words before the number include them in the prefix or suffix πͺ
Ah it's trying to convert the whole label, not just the number part.
Yeah, I get it now. Lesson learned, look at error logs.
π all good, martin caught me slacking too many times for me to shame you
Thank you so much. For the tutorial and helping me out.
No problem, happy building!
Martin, i've got a function that's working fine as a label but when added to a meter is errors out. no error in console?
${fetchFromActor(find('memberList', 'actorDropdown', 'tableIndex', 1, '=='), 'healthCurrent')}$
when placed in a label it outputs: 6
in a meter it comes back as just 'error'
Thank you so much! That's exactly what I was looking for! I'm a bit burnt out with all the changes I've made this week but the next time I get the hankering for tinkering I will absolutely dive head first into this guy! Thank you!
Do Panel titles allow for formulas or fontawesome icons?
Second question. It looks like the timing of the mouseover tooltip for components is about 1 second, is it possible to change it to be faster/instant?
No. Look for the $ symbol for where you can use formulae. You can't in titles.
Shame. Thanks, still.
I don't remember if there's a delay baked into the base CSB code, but you would have to edit the system files to change it.
Ahh, no thanks, heh.
I feel like this might be possible, but I'm not smart enough to figure out the coding part of it.
If I have two checkboxes, can I get it so that if one checkbox is ticked, the other becomes untickable somehow, and vice versa?
That's how Radio Buttons work
I realize that, but once you select a radio button, it remains permanently selected until you select another one. I also need to be able to deselect a radio button, which AFAICR, is not currently possible.
Make a third button with "None"
Damn, that's one of those solutions where I smack my forehead and go, damn that was so simple, how did I not see it?? lol
You can hard code a div in a label and do the same thing?
Also if you really want to use check boxes, you can have them set the other ones visibility formula to false. That way if one is checked you can't see (and can't click) the other.
Dunno why you'd want to do it that way, but you 'could'.
I don't think that would work when I need the panel to collapse.
<details>
<summary>Panel Name Here</summary>
<p>details here</p>
</details>
depends on what you're putting in it i guess, you'd be limited to hard coding the contents within that label as well which'll eat your time.
You could use a label with a collapsible panel right below it.
[label]
[panel]
then css style them to look like it's one element