#Custom System Builder
1 messages Β· Page 46 of 1
When will it be there? Weeks or months? π
There's no timeline in the project
Im already hyped
It's already in the beta btw: #1037072885044477962 message
... And it's now in the stable release !
**Version 4.3.0 is now generally available, with the following changes : **
Features
- Added ability to add items to other items
- Added function
fetchFromParent(), which will replacefetchFromActor('attached', ...) - Added new functions
alookup(),lookupRange(),fallback(),fetchFromUuid(),setValues(),array() - Reworked the function
concat() - Added the possibility to have multiple keys inside 1 modifier (separated by comma)
- Adjusted
lookupRef()to return an Array instead of a single value due to the change above - Adjusted parameter
propertyNameinsetPropertyInEntity()to also accept an Array due to the change above - Switched all Rich Text Editors to ProseMirror
Fixes
- consoleLog() and consoleTable() now actually let values pass through as they should instead of returning
undefined - Fixed an issue, where user-defined properties could collide with Token-properties
- [#409] Fixed a bug, where Template IDs wouldn't be exported
- Fixed a bug, where local variables in Label Roll Messages wouldn't be considered when calling user input dialogs
- [#379] Fixed a bug causing undefined values in Item Displayers to be populated with the values of previous items
- [#418] Fixed Dynamic Tables & Item Container sorting system
- [#397] Fixed Dynamic Tables default value handling, correctly computing default values & formulas in default values
- [#417] Fixed an issue with text editors opening too small
- Fixed an issue, where names of Active Effect wouldn't be displayed in ActiveEffectModifiers when using a custom configuration
If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Is there a section on the wiki about how to proceed with the update to the newest stable version? I remember reading something a couple of weeks ago
Ah, thank you! β€οΈ That would be a major part of my problem. That part is at least resolved now
Hi, CSB is awesome. I would really love for the future to have a value/check box or dependency for status effects. If we could use setPropertyInEnmity to activate and deactivate status effects it would be incredible!
Haha and after remembering proper syntax, it's fixed! Tytyty
Now to do that for every stat
Which bring me to my current problem. I'm trying to find a way to activate an ActiveEffect (status) via command. I try to used the workaround explained here https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Active-Effects but unfortunately it seems like the "status icon counters" module was updated and I get a legacy notification. Unfortunately I do not understand their new command. Is there any other way to get it running?
Alright, new feature, and I couldn't find documentation for this specifically (apologies, I'm very new to this). I have a table that I'm already pulling bonuses from based on stats, in the first screenshot. Currently it doesn't consider checkboxes. It pulls the sum of the "Bonus" column, filtered by the "Attribute" column and sets that value as a hidden attribute with the following formula: ${sum(lookup('DT_ATT_BNS', 'BNS_NUM', 'BNS_ATT', 'BRAWN'))}$.
The documentation doesn't say anything about filtering by multiple criteria, is there a way for me to modify this by only rows that have their "Active" boxes checked?
If you are on the regular system (stable) already, you just need to update CSB in your Foundry Setup. If you're on the beta version, you can switch back to the stable by following this guide: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Switch-to-Beta
does "Dfreds convinient effects" work with CSB if I only rely on custom build active effects? Want to later use the API to apply and remove effects
Hello everyone, I have a question about CSB (Custom system builder). I have special dice in my game that I would need to implement into the game. They have their own walls with special markers (d6), I would need a rolled one to subtract 1 success, a two and a three are empty walls, a four, a five is for one success and a six rolled gives two successes. But I can't get over the fact that VTT evaluates all my achievements one by one, or none of them as it should.
I'm done with this one for now.
${[:hodz:d6cf=1:cs>=4]}$
Which counts anything rolled over a four as a success and a one as a failure, but nothing else. Any advice?
If there is an easier way to show cube walls in the program's chat, then I'd appreciate it too.
I am newbie for all of this, but for the play i need just this one dice π Thank you for all advices guys.
I found this system last night and I'm wondering how to make a stat a dice size like in the savage worlds system. (Strength = 1d6 Dexterity = 1d10) and also how to call that function as an attack.
I have something that bugs me a bit (it's not an issue, just something, that could make life a little better): currently I don't see any option to replicate existing element on the character template (like copy and paste). It would be helpful, if there would be such option. @formal goblet, is this something planned?
CTRL + Drag
So wonderfull, thanks a lot π
Hey folks. Sorry if this is a stupid question.
I have been trying to use Object.values(ui.windows).find(w => w instanceof ActorSheet)?.actor?.uuid to get the uuid of the actor that is linked with the current character sheet. This works in console and macros, but I get either a value expected (char xyz) error or a left hand assignment error if I try to assign this to a variable inside of ${}$. I imagine that math.js is concerned about the type it is being passed.
Is there a better or more suitable way of referring to the uuid from inside of character sheet context? I have a roll to basically decrement ammo count in response to the roll, i.e. it expends ammunition:
Ammo Count Updated For: ${
ref('universal_roller_ammo_choice')
setValues("uuid", ref('universal_roller_ammo_choice').concat(" -1"))
}$
It works if I give it a static uuid for a character. But I am not sure what is the best way of inserting the uuid corresponding to the char sheet it is invoked from in a way that works with CSB.
Thank you!
some players might control multiple units, so I don't think that I can refer specifically to the linked character
%{return entity.entity.uuid;}%
Is there a way to display a label in the item displayer before the item reference button? (i.e. an item count) (including possibly using custom CSS)
I basically want a nice way to have things like arrows that have their count removed every time you shoot (with a macro) and the display should reflect that
Thank you so much!
**Version 4.3.1 is now generally available, with the following changes : **
Fixes
- Fixed issue preventing creation of an item inside an item in an actor
If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
What does an item inside an item mean? π€ sounds like it might be useful
Items can be anything you want. Items inside items is a very versatile (and new) feature, allowing you to (for example) :
- Create backpacks and add items inside them
- Create enchantments and apply them to other objects
- Create attachments and add them to weapons
- Create symptoms to attach to a "disease" item, to then apply on a character
- ... I don't have more ideas but that's not bad, I think ^^
Do you have anything that could maybe change how items on actors are displayed in the item displayer (to add a picture, count before the name, or format things better) (or a way to drive a dynamic table with the actor data using a macro or something - not sure what I'd hook that under to make it refresh when needed)?
You can add HTML in the labels of the Item Displayer, and / or reference item's properties, like an inner "count" you'd have in them.
You can also use CSS to customize hox the Item Displayer is... displayed.
You can even, if you want to, create your own components using a module and add them to CSB !
I might restyle the main item reference button to be a constant-width button without text with CSS and use the labels then, sounds like it should work
seems to be working
how can i add multiple checks to an item filter for a container? && doesnt seem to work.
say, i want to check that a dropdown has a certain key selected and a checkbox is ticked
putting a space between the clauses seemed to just work? would appreciate confirmation on that tho
Is it a formula? Try or or and (math.js)
Good evening!
Just a quick questionβhow do I call my own active effect through a macro?
I do have an example macro, but the issue is that the modifications I made to the template sheet are not being applied. I created an Active Effects container to check, and the effect isn't showing up.
I think my macro is creating a new effect, whereas I actually want to call an existing effect that I've already created so I can make use of the modifiers I set up in it.
How can I do this?
I achieved!
Is there a way to reference a variable in a rich text field? [[/r @variable]] works since it gets the rolldata correctly, but only when you press it to send to chat. [[@variable]] does not appear in the text field as anything but 0.
${variable}$ doesn't work either
A Rich Text Area isn't meant to contain Formulas, because it isn't a computable Component
Why doesn't the [[@var]] values work though, they do in other systems?
And it's in the rolldata since it works if you do [[/r ]]
I can't tell you why. We never tested this syntax
That's surprising, I've used it in basically every system I've played
Is there a method to detect a certain die roll value and highlight it? Looking at raw die values. If a d10 rolled = 10, show extra text in the roll value. Ideally this would work to detect against multiple dice (checking each) rather than combined.
Ok thank you. I've been informed there is an official Foundry system on the works so it's not a big deal
Thank you for the help anyhow
I second this. It would be great, if this would be possible π
Question about These βsub-Itemsβ. In my actors Item displayer, Can i directly Access properties that are inside a βsub-Itemβ of my displayed Items? Like item.item.prop
Keep in mind, that each Item can contain an Array of Items, so simply item.item.prop wouldn't work by design. You have to either work with Item Modifiers, lookup(), fetchFromUuid() or scripts.
Can you not use a script %{}% or a macro for that?
Thanks, but can you help me with the default value?
I am able to generate the dropdown with the list of skills that the character possesses.
However, I would like it to recommend the skill of the weapon the player is using by default.
In the weapon's sheet, there is a field called "periciamodeloitem", which references the name in a text field for the recommended skill.
In the dropdown of the user input template, I need to reference this variable "periciamodeloitem" in the default value. How do I do this?
I'm trying like this, but it's not working
The field with the key "periciamodeloitem" is basically the name of the skill, in a text field.
I tried to use lookup to compare the name of the skill inside the weapon with the name of the skill on the dynamic table but didn't work
Never did something like that, sorry I'm not sure how to do it. My guess is that since your formula is in a dialogbox and not in an item displayer, you can't use item.xxxx syntax. I would try to set the name of the skill in a variable in your roll message, before calling the dialog box. something like that:
${?#{Dialogbox}}$```
I added a key called "defaultskill" placed before the dialog appears. It takes the skill level that has the same name as the weapon's skill name, with the lookup
However, if two skills have the same level, it picks the first one that appears, and then the name becomes incorrect, even though it pulls the correct skill level.
Any tips?
Can you share your rollmessage ?
Oh, I did it
I was using the dynamic table option key with the skill levels, so if one skill had the same level as another, the first one to appear would show up as the default.
Now, I changed the option to the skill names, so the correct skill will always appear, and I just adjusted the code. Thanks!
@formal goblet i created my own custom Status Effects with the Script in CSB Wiki. I would like to know how to find the UUIDs of These Effects as i would like to activate them with a Script and Therefore i Need the UUIDs. Any idea?
You mean those in the CONFIG?
Ja
These don't contain any UUID, they are not Documents. Just some configuration data
Ok thx!
Hello! I am creating a system and most of it is ready, but I have a question that I haven't been able to solve yet. I want a roll that asks for the number of d6 dice to be rolled and requests the attribute value and bonus value. The result should be the sum of everything. However, while it asks for the dice and values, it doesn't actually roll the dice.
Here is the code:
<table>
<tr>
<th>Technique</th>
</tr>
<tr>
<td>Roll</td>
<td>
${DiceNumber=: ?{How many d6 dice do you want to roll? (Maximum 3)|1|2|3}}$
${Roll=:[DiceNumber]d6}$
</td>
</tr>
<tr>
<td>Attribute Modifier</td>
<td>${AttributeModifier=: ?{Attribute Modifier[number]|0}}$</td>
</tr>
<tr>
<td>Bonus Modifier</td>
<td>${BonusModifier=: ?{Bonus Modifier[number]|0}}$</td>
</tr>
<tr>
<td><strong>Result</strong></td>
<td><strong>${Roll + AttributeModifier + BonusModifier}$</strong></td>
</tr>
</table>
Any Tips?
Should be ${var:= value}$
And Dialogs already store your data in local variables
I'm not sure I understand, sorry. I really donβt know much about how it works, but through trial and error, Iβve learned the basics. Where exactly should I put ${var:= value}$? Do you have an example of how the code should look? Like, just asking for the number of dice and rolling with the attribute?
is there an equivalent in CSB to the set() or =Unique() function. Like returning every different value in a list ignoring the repeating one ?
Example [A, A, B, B, C, C, C, D] ==> [A, B, C, D]
What is teh deal with "CSB - Embedded Items Folder"?
Why doesn't this work?
%{return ${sameRow('macro_invocation', '')}$;}%
these both work
%{return "aa";}%
${sameRow('macro_invocation', '')}$
I want to do an eval on a user-defined JS (basically call a macro with arbitrary number of params I guess)
I'm making a dynamic table with user-defined macros for items that players can use to e.g. attack
Im getting this on the first one
So I can add items to items now. Can I also add itemmodifiers to to added items which then change Values of an actor?
Thank you all for help.
One more question: is there any way to mark somehow the result of the dice roll? I'm preparing CJ Carolla Witchraft, which use 1d10 for testing, and usally sum up with the attribute + skill. If on the d10 is 1 or 10, there is some special effects to be displayed. But for the ${[1d10]+attribute+skill}$ the result is a sum, so I need to click on the roll to see, if there aren't any 10s or 1s.
Is this something that can be done? I would be fine with a message (but condition don't work for the numbers I guess) or mark the roll with some colors.
Duplicating any item makes copies of every item now...great.
and now I have to go back through and remove all the duplicates, and fix all the dead links in my notes and on sheets, because there is no way to know which "duplicate" the link is linked too.
I shouldn't have updated.
@formal goblet Does Dynamic Table iterate over deleted elements?
because I got an issue - its give me an error on the already deleted element
dynamic table dt_cleric_gods
{
"0": {
"god_name": "GOD_MISTRESS_OF_CROSSROADS",
"god_points": "5",
"$deleted": false
},
"1": {
"god_name": "GOD_LADY_LAKE",
"god_points": "0",
"$deleted": false
},
"2": {
"$deleted": true,
"god_name": "GOD_NO_GOD",
"god_points": "0",
"$predefinedIdx": 0,
"$deletionDisabled": true
}
}```
Formula on field `Max` :
```${CLERIC_GODS_SERVE > 0? max(lookup('ic_cleric_cults', 'level','god_key', '${sameRow("god_name")}$')) * ${CLERIC_EFFICENCY}$ + ${CLERIC_EFFICENCY}$: 100}$```
error:
```CLERIC_GODS_SERVE > 0? max(lookup('ic_cleric_cults', 'level','god_key', 'GOD_NO_GOD')) * 25 + 25: 100```
Do any of you guys have problem with duplicating items? When I do it duplicates all of my items several times
Yep, Just spend half an hour deleting duplicates, now it will be much longer going into all my notes and fixing item links...
I'll not duplicate my items Till hotfix π
what's up with duplicating? I thought duplicating an item always made an independent copy π€
It does...now it just makes three of them...and three of every other item of that template type.
is there a way to get the n-th element from the dynamic table? (something like ${lookup('item.rolls', 'roll_description')[1]}$, this index syntax doesn't work however)
Nope
That's where sub-Items of Items in the directory are stored.
${}$ returns an unquoted bareword, thus you need quotes around it, if you expect a string-return.
What's the error message?
How about lookup().at(n)?
This works, thanks β€οΈ
Seems to work for alert (but I have to refresh the template twice - something with synchronization?), but eval consistently throws the same error still
%{alert('${sameRow('macro_invocation', '')}$');}%
the row contains this (raw html) <p>console.log("hello");</p>
hmm
okay it works after I replaced the rich text area with a text input, rich text was adding <p>
Your URL is in there
Yey it works - a button to roll an item's 'macro' (using eval on a string) directly from the actor
fixed, sorry about that π
I was so excited I didn't notice π€£
Why sorry? It's not illegal to dox yourself π
technically it's not even my server π
lol
there was no identifiable info there but I suppose if you went and probed on the server maybe you'd find something on my friend idk
the worst that could probably happen is something not being password protected correctly and you could delete files off of it maybe idk
Not really. Just saw the URL in the screenshot and warned you
yeah, thanks anyways π
Im attempting to use a dropdown list in a user input. I had the dropdown list working off a dynamic table and it worked fine, but since I wanted to do something different with the sheet I changed it to a custom dropdown, but now it wont call the values despite the keys being in order. Any advice?
When I roll the relevant skill it gives no response, but when I removed the dropdown list from the third pic it worked fine, so i know its the dropdown causing issues
I decided to create the same dropdown list in the sheet proper incase an issue with the user input was the culprit. As you can see when it attempts to simply add the selection plus 1 it returns an error. staskill is the component key for the first line in the second pic, which returns "1" but doesn't complete the equation at the bottom
Alright I figured it out. When using a dynamic table its sufficient to just reference the component key of the dropdown list, but when using a custom table you have to use ref(tablename) to call the value instead
How do you reference a checkbox thats contained within a dynamic table?
Good Morning, is it possible now to use an item inside of an item with Itemmodifiers? Which property is then modified, the item or the actor? How can I change a property of an actor with an item inside an item?
The item is modified. A direct modification of the Actor is not possible at the moment
Okay, still awesome
Like any other Component in the Dynamic Table with find() or lookup()
Ok thx! Whats the Workflow here? Do i Need to Store items that are meant to serve as sub-items here manually to work? I tested some βnormalβ items and put them in other items. Series to work. I did nothing with this folder.
CSB manages the folder, so you basically don't touch it
Soo, I have a skills as items currently. But item displayers don't have checkboxes to track if they have been used. But they do have meters,
How would I write a reset script to turn all "meters" back to 0?
I can't even find how to reference them...
π€ Would I be able to make the amount of checkboxes dynamic then?
I assumed the html was static
You should be able to plug javascript into the formula with %{} %
And generate as many as you want
Tho they're all in the same column
Though I'm not sure why you need to have multiple checkboxes per item
No, I meant a checkbox per item, so there's as many as items. Though I don't know how to create CSB objects via JS
Just make a label as part of the item displayer and write the html into it
Into the label text
You can also use custom css to style it
That was so easy... Still unsure how to reset them though.
Although that's extra, it would be nice.
At long rests
I'd like to write a button that resets all of them
I just don't know how to reference them
If you have a macro or something for long rests, you can hook it there, but I'm not sure the exact syntax to get to the checkboxes quite yet
Wait
They just represent the item value, so just set the used attribute on the item to true
Or false
Or whatever values you're using
It should redraw the table/row
Is it possible to pull data from a dynamic table to a macro? I have my damage rolls pulling from sameRow into a roll currently, but would like utilize a macro and foundry API to format the roll and catch things like when a damage die rolls a 10
I would just do the formatting adjustment within the roll macro, but I have to account for multiple d10's. If you are familiar, I am looking to format the way that pathfinder 2e highlights when a d20 roll is a 20 (indicating a critical)
You can send data to/through a macro. But the macro itself can't pull data out of CSB.
As in, you could make a button on a sheet that sends data to and runs a macro then simply pull said button to the hotbar. It will then act as a macro.
macros can pull data from CSB actors/tokens, but idk how to do it for a dynamic table
here's a simple property getter
Is there a fix for the all items will be duplicated two times when duplicate any item?
What version?
4.3.1
4.5. Scripts
...
-
%{return options.dynamicRowRef}%This will return the row-reference of the Dynamic Table the Script was executed in. This can be helpful in Scripts, where the reference of the current row is needed.
Extend the error message
Tried this but no luck. Does the formula remain the same as when you reference a normal checkbox?
${#partial_mod:= find('armor', 'partial') ? 1 : 0}$
${#full_mod:= find('armor', 'full') ? 3 : 0}$
${lookup('stattable', 'score', 'Ability', 'PER') - partial_mod - full_mod}$
Hey peeps, a friend wants to collab on a system I have been working with, how do you suggest I set it up? Should I use git?
We're gonna create actors, items, etc
Is there a way to limit the amount of items an item displayer can hold?
item displayer or actor/token?
because item displayer doesn't hold items, it just shows what the actor has
Item displayer, its a itemdisplayer inside of an item
okay I don't know how items inside items work yet so I can't help any further
Is there a way to duplicate a component, such as a finished table, within the same sheet?
I copy it to a 'donor' sheet, copy it back and delete from the donor sheet
Is it possible to change the token status icons to have your own status icons and remove those you don't want?
Yes, I installed Condition Lab and Triggler module for that
Trying to get Griddy (inventory management module) to work. I have troubles getting the items stacked there and browsing this Discord I found old messages that explained that item stacking in CSB is not possible yet. Is this still true?
I mean... You can make an amount property and macros, but it's not supported natively
Great! Thanksπ
@modern hemlock Thank you for the reply. Having extremely limited computer skills I never know if it is about lack of skill or stuff simply not being possible at all.π
That worked, thanks!
Is there a way to populate a dropdown with a list of character names? Even if it only pulls from a specific character folder?
Or is using a FetchFromActor-Target kinda the best way to pull a list of selections from another character sheet?
%{return game.actors.filter(actor => !actor.isTemplate)}%
I'm just getting started and I'm reading about Meters; I'm a little bit confused about the Value field. The documentation says if the gauge has the key it can be used in other formulas, but I'm not sure what exactly I'm supposed to put in there. Is that supposed to be its current numerical value or something else that I'm missing?
Also, I'd like to use checkboxes or radio buttons to have traits which can modify the Max value, for example, of my meters. Is that possible? I didn't see a way to have a checkbox recalculate other fields, and I'm not sure how to reference specific fields in my meters either
Is there a way to change the color of meters
Like specifically, I'm not sure how css would interact with the component
Bump
I don't see CSB involved in there. When does the error appear?
lookup() returns an Array of elements. You have to surround it with first() if you expect only 1 value.
Git would be a good idea, yeah
Only possible via a world script, which intercepts the creation of items. Item Displayers can't do that.
updated the line as follows, still returns no response
${#partial_mod:= first(lookup('armor', 'partial')) ? 1 : 0}$
${#full_mod:= first(lookup('armor', 'full')) ? 3 : 0}$
${lookup('stattable', 'score', 'Ability', 'PER') - partial_mod - full_mod}$
A Meter is a read-only Component, which adjustes automatically via Formulas. The value-field represents the current value.
Check console with F12
Your Formula in the max-field has to decide, what value should be in there. You can make it dependent on a Checkbox:
${50 + (CheckboxKey ? 5 : 0)}$
Is that a Label text or Label Roll Message?
label text
it happens when i reload all items in all actor. i use the macro you gave me some weeks ago:
I found that the lookup function is working fine, for some reason CSB just doesn't like it when you use the lookup function within the creation of a value like I was doing
So I just created a place on the sheet to store the lookup function and called the value from it
Heya, is there a way to copy a component. Just made a dropdown list with like 18 things in it which will be used elsewhere and really don't wanna have to type it all out again π
You can draganddrop it somewhere else
Hold the handle at the top of the component
Ctrl + Drag
Ahh keyboard stuff, luvly
Is there a big list of this in the documentation I'm missing?
I think it's mentioned somewhere at the top of the readme
Otherwise Readme and Wiki are the 2 big sources of CSB
Righto, ty π
Wait, ctrl+drag makes a duplicate?
Hmm seems like the Ctrl doesn't work to put it in as a dynamic table field
Wait no that makes sense if the inputs are the dropdown but not the column itself
Y
That's neat, I didn't know that
Also, any way to make a panel / vertical layout with several input fields in a dynamic table row?
Currently not
is there any way to reroll the initiative every turn?
even modules aren't system agnostic.
edit: found one
Any chance we can get the item duplication fix released within the next few days? I'd really appreciate that
I saw it's been fixed in a commit so shouldn't be too hard
Well then rejoice !
**Version 4.3.2 is now generally available, with the following changes : **
Fixes
- Fixed issue with item duplication duplicating way too much
If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Damn... π π₯³
How should i "export" the content?
I have no idea how to go about this
The official website and community for Foundry Virtual Tabletop.
Insert "it works on my machine" excuse here
What are your steps ? can you provide a reproduction scenario ?
The issue that was pointed out originally was on item duplication : Right click on an item -> duplicate
This should be fixed, and should no longer cause issues.
But maybe your issue is something else
custom system builder just vanished from my foundry, i downloading it doesn't do anything
how do i fix it?
Do you have errors in the uper right corner?
I upgraded from 4.3.1, launched the world, duplicated existing items > it duplicated 3 copies and 2 'non-copies' (as above)
I also deleted every item and created a new one using the template that existed in 4.3.1 and tried duplicating that, to the same effect
by duplicating I mean this
and I have nothing in the console either, no errors
I'll try creating a new world and new templates and try there a little later
a few
That's a lot. What's in there?
I made a fresh world with nothing else enabled but CSB 4.3.2, and made a new template, new item, duplicated said item and error still persists.
The template has a label and a number field if that's of any relevance
Try CTRL + F5
can you embed formulas inside rich text fields?
Cuz that would be nice for a DM to make spell descriptions and stuff
Not in the Rich Text itself, but you can display the content via a Label and resolve it there
mostly "unknown type : author" nothing for custom system builder
beta version installs normally so i have no idea what could be the problem
When you try to install the main version, what happens ? Can you find it in the system explorer ?
I have a question-
I am trying to have an item holder where I can drag and drop an item with their own dice rolls.
does anyone has an idea of how to go about it? I saw some youtube videos, but none that i watched actually covered this aspect
i can call out labels, but not rolls.
I have that
I have items with user defined roll macros
And the 2 first rolls show up in the displayer
that would be great for me to take a look and see if i can reproduce something close to my needs
Yeah, if you can remind me in about 16 hours that would be great, I've just turned my pc off for the day
I can send you the entire thing
is it possible to add an image box?
You might be able to do something with custom css and background image/js macros maybeeee
but no simple options
I don't think there are any simple options
Going back to this, quick summary: you need to have something defining your roll. I have a text field with javascript. I use eval('${roll1macro}$') to call it, and I have another input field with a short title that I put in the label that's styled as a button
You can use {item.roll1macro} to call it from the item displayer label that is also styled as a button
i thought i needed a label/key to call it
but i didnt know exactly how
those are, like, actual macros then?
i see i see...
No, I only use a macro to define the rolls behavior
You can use a formula/script formula to do everything else
And you could use it to define the roll too, I just wanted it to be extra flexible
ok I have a quick question... ${%{
linkedEntity.templateSystem.roll('item_roll', {postMessage: true});
}%}$
Why is this rolling twice with an error "roll" then a normal one"
i am sorry, i dont get it =/
i am really, really out of my element here
so i will just pray that the actual files later make some sense to me
comparing it to the abomination that i have should shine some light somewhere, hopefully
You can put javascript into a formula
And call a macro or something that uses stuff that's not available in math.js (the math library used for normal formulas)
Also, you got some nice art on your deviantart page!
βΊοΈ thank you!
1 Message from the Label Roll Message and 1 Message from the Script. You can disable the first one in the Component config
I thought i had tried that but it worked like a charm
You can create a Rich Text Area with the content of the Roll Message and call that inside a Label Roll Message:
${${!richTextAreaKey}$}$
Just be aware, that the Roll Message will be computed with the properties of the entity with the Label (instead of the props of the entity with the Rich Text Area)
Let me give it a try and see if I can make it work
If I update the Custom System Builder to the new version, will it effect what i have already designed?
From which version are you updating?
4.2.0
It shouldn't effect anything. But backups are always advised
Ok. I can just keep the version I have. What benefits from updating?
how whould one do a d100 roll where a success is <= targetnumber
${d100cs<=:tarnumnum:}$ is what i have right now and in getting an error
${[d100cs<=:tarnumnum:]}$ is now working but id like it to show me the rolled number and weather it is a success or not its showing a 1 for success 0 for no success but not showing the roll
How do I change the message type of a label message? For it to be self, blind, to GM etc?
under advanced config for the field
should work in 4.3.2 (it's the version I'm using)
I don't see it?
Thank you very much, you are very kind! I will give it at try.
i am having a hard time importing it
is an actor, yes?
ah, i did it!
somethinf like minimum role to see
actor and item
they should work together
yes yes, i imported it
now i am trying to figure out how to make the roll work
gives me an error
ah I need the macro
name this item_equipper
(it's for items that cover multiple slots and preventing multiple of the same slot from being equipped)
stares at screen
...and this is why the common folk shouldt try to do whatever witchcraft you all are on about
i have no clue of what this all is or how it works
but we press on!
i created a script macro, copy and pasted the text and named it item_equipper
was thats what i was supposed to do, yes?
yeah
that should be enough
(this is purely some automatic rule enforcing for item equipping, nothing else)
good news! the button is there!
bad news! its not rolling my humble ${[2d10]}$ command
yeah it uses JS
hold on Im gonna change it and tell you what to do
hmm, actually, I don't know how to evaluate a formula from an external place π€
cuz I'm pretty sure something like ${${item.formula}$}$ wouldn't work
oh-
(I'm intending on calling macros with it so eval with JS works fine for me)
maybe i should try this instead and keep it simple since i know jack about js
shoot i think i pinged them, forgot to hit the button to not to
hmm, or maybe you can do that π€
apologies, but thank you very much for your help
It does
hmm, you gotta change these then, and put ${${item.roll_1_macro}$}$ (and roll_2_macro for the other) I think
okay that works
but inside the item, put [1d10] instead of ${[1d10]}$ if you do
and enable roll msg to chat option
Should be ${${!key}$}$ to be fair if in a Label Roll Message
what does ! do? (I suspect it's not the NOT operator)
It removes the <span>-wrapper around the result in the Chat Message, otherwise you'll get issues reparsing it.
also, any way to do something like this in a roll message? (including with JS/macros)
fancy message visuals
It's all HTML, so sure. But don't ask me, how to style it this way π
I am doing something wrong...
Put that into Label Roll Message
yeah, not label text
It shows!
but it doesnt roll
try removing the outer ${}$ from the roll definition inside the item
i.e. this
HAHAHAHA
It rolled!
An error XD
let me try
Can't drag and drop item to the compendium.
Lol, my VSCode just crapped itself trying to update
though, if i enable roll msg to chat can i still call out things like 'strenght' and 'endurance' keys?
it deleted the entire folder without pasting the update I guess
it's strength btw, t before h
gosh darn it english
yep, I didn't know that at one point too
hm, it really doesnt want to roll
i tried a fell different ways to type it in the rich text
but it refused and called my mother names
very rude
Check the console with F12.
What's the key of the rich text component?
add another ${}$ in the actor
Where's the content?
and yeah, where's the roll content
Nvm, that's the template
Won't help, the result is undefined, so parsing it a second time won't achieve anything.
Try out ${consoleLog(item)}$ in the Label Roll Message
there's a formula for console.log? π
ok, let me try
Yeah, we do have that
another error
i am probably just doing some important, simple thing wrong
Just item
And watch the console
nothing popped in there
Huh? Did you reload your Actor?
i did?
i F5 now and them because sometimes the changes dont seem to go through
how the hell can you even tell wtf
Our last resort would be %{console.error(entity.entity)}%. If this doesn't show up, then the changes didn't apply.
${
$[[/roll 1d100]] >= 95 ? "β Failure (Auto-Fail)" :
$[[/roll 1d100]] > targetKey ? "β Failure" :
(rankKey == "gold" || rankKey == "diamond" || rankKey == "transcendent") ?
β
Success (Degree [[ 1 + floor((targetKey - $[[/roll 1d100]]) / 10)]]) :
(rankKey == "silver" && $[[/roll 1d100]] <= 4) ?
π― Critical Success! (Degree [[ 4 + floor((targetKey - $[[/roll 1d100]]) / 10)]]) :
(rankKey != "silver" && $[[/roll 1d100]] <= 10) ?
π― Critical Success! (Degree [[ 4 + floor((targetKey - $[[/roll 1d100]]) / 10)]]) :
`β
Success (Degree [[ 1 + floor((targetKey - $[[/roll 1d100]]) / 10)]]), this is the basic roll formula im looking to get to work in csb, what would i have to change?
keys changed for simplicity cause they will be diffent for a few rolls
Can you format that in one block? It's messy
shruuuuuuuugs
i will just play around and find out now
surely there is something funky going on
oh, i got a new error at least
@formal goblet ill give it a go when i get back to the house
That's still the old Label Roll Message. You have to hit the reload button right next to the Template selection
i did it though...
i tried a few more things in the item text field too, but the results are the same
refreshed the page as well
oh well
i think thats enough head hammering for today
thank you very much for you all's help
Hello, im new at CSB, trying to create basic healing macro
What's wrong with this syntax?
${setPropertyInEntity('self', 'HP_Current', "HP_Current + [1d6]"}$
HP_Current is a number field with number like 5 and max number like 999
you can only set labels and/or hidden attributes, not input fields
Vice versa
@formal goblet im trying to make a simple inventory where i can display the item and its description in the chat. So far i have an itemdisplay, items and the label. How would i go about making my idea work?
There's nothing wrong with it
This is a console log after using macro, maybe it will help
foundry-esm.js:4621 Error: You are accessing ChatMessage#user which has been migrated to ChatMessage#author
Deprecated since Version 12
Backwards-compatible support will be removed in Version 14
at logCompatibilityWarning (foundry-esm.js:4609:19)
at ChatMessage._logDataFieldMigration (foundry-esm.js:12119:14)
at get user (foundry-esm.js:14117:24)
at checkChatMessage$1 (aa-chatmessage.js:11:13)
at Object.fn (aa-chatmessage.js:7:51)
at #call (foundry.js:632:20)
at Hooks.callAll (foundry.js:589:17)
at foundry-esm.js:56440:17
at foundry-esm.js:56445:43
at Array.map (<anonymous>)
at #handleCreateDocuments (foundry-esm.js:56445:33)
That seems to come from your Macro, not from us
Okay, anyway thanks
Thats different from the message type though
I just wanted to know if there was a way to self-post the message or blind do it to the gm
Check around the Chatbox, there's a toggle
What do you mean with the Chatbox? The default toggle?
I meant if there was a way to send label roll messages using one of those modes
Like how you can use
ChatMessage.applyRollMode(message, mode);
Surely there's a better way of doing this, right...? (values pulled from a dynamic table)
62 modifiers for 31 stats (flat + percent)
Ah, that's currently not doable within CSB itself. Only with the toggle that you've posted
Which doesn't affect roll messages, sadly.
So I'll add it to my wishlist of features π
It does?
You might need to set it in the settings, but that should be possible
is that "Expand Roll Visibility to whole Chat Messages"?
should be
Hello, I return with a simple issue: I wish to make a button appear when a specific combination of two dropdown lists is chosen (WeaponClass == 7 and Status == 2). Either this, or a dropdown list and a checkbox. Is there a way to do that?
In the visibility formula of the button: WeaponClass == 7 and Status == 2
And here I tried to experiment with ? and : , thank you!
Look up math.js expression syntax
I'm looking for help with setting initiative. We are using a variant initiative system where initiative is rolled per character and can be rolled in one of 3 ways: normal, fast or slow. Normal initiative is 1d20+Dexterity modifier; Fast initiative is 1d20+Dexterity modifier+10; Slow initiative is 1d20+Dexterity modifier-10.
Is there a way to add buttons on the character sheet to allow it set initiative in different ways?
Any way I can (with a JS macro) group items embedded in actors by the sidebar item they were created from, or do I have to give them a separate id property? (for automatic combining of separate documents (that have amount property) into stacks)
I don't think there's any standard property you can use to trace back from which Item they were created from, so you have to create your own prop for that.
Or you merge by name
yeah I was thinking of that too but idk, I might want to have several items with the same title
Inside an item displayer i would like to check if a text field in my item has text and if yes i want to display it. If this field is empty i dont want to display anything.
Whats the correct formula for this?
${item.waffe_DESC2 != ' ' ? concat(string(item.waffe_DESC2)) : ' ' }$
throws an error (Cannot convert xyz to a number
${item.waffe_DESC2 != '' ? string(item.waffe_DESC2) : ''}$
same error
${item.waffe_DESC2 != '' ? item.waffe_DESC2 : ''}$
same error
use this field
it'll show the element if it evaluates to true
unfortunately that does not work in this case, as the field holds some more formulas that i want to display
so i need to ref a drop down in a label formula, what i have so far is Power Target: ref (dropdownkey, key (which is a number)), its just giving me the formula instead of the value on the sheet, how do i make it give the value what am i doing wrong
nvm got it to work another way
Is there a function/something to update the specified item from its template (using a JS macro)?
I want to update all items attached to an actor when the GM clicks a button on that actor's sheet
basically a way to call this button's listener via JS
Is there's a way to use JB2A Animation in CSB?
Sure, with the module sequencer you can arrange every videoanimation in a macro, and these macros can be called via CSB.
can items effect number fields, like a talent which is a kind of item that can effect a number field that is used to calculate hitpoints, like stone body that would give 1 armor and 10 max hit points
In an item you can set item modifier, but these can not effect a number field directly, but they can effect a label. So have a label witch is sowing the value of the number field and can be modified though an item modifier.
I'm asking for your help, because I've been trying to solve the code for the two rolls below for a day and a half, but it doesn't work π€
the first roll is on the character sheet, and it works fine.
it compares the roll with the Skill_value1 Key, and also displays it in the Chat window.
${[1d100cs<=:Skill_value1:]}$ #Skill Check
my problem with this is that the result is a not very informative 0 or 1 - and depending on the result, it would be good if it would print Success or Failure.
The second macro:
Here the result was formatted successfully, and the roll is running in its current state. The problem is that the difficulty level is written in it - and it would be good if it used the value of the key: Skill_value1 from the character sheet of the selected character.
I think that's why it needs to be started with a check:
let actor = game.user.character || canvas.tokens.controlled[0]?.actor;
if (actor) {
console.log(actor.getRollData());}
else {
ui.notifications.warn("Please select a character!");
}
then using the Uuid of the character sheet template (Actor.UN6TYJNxbKCmghKg) need to retrieve the value of the Skill_value1 key and compare it with the result of the roll. I couldn't solve this with this macro.
I hope you can help!
can an item added to an item template modify it?
...or can items modify items at all?
hey, so I'm trying to create a Short Rest button for my game, but I'm finding that when the button puts the current HP and Energy over their maximum values, it won't correct the issue until the button is pressed again.
The formula I'm using is as follows. Is there some way to make it say, "if this formula resolving puts the values over their maximums, set them to their maximums"? As it stands it only corrects if the values were already over their maximums when the button was pressed.
Evening Guys! Just updated to 4.3.2 and my Attribute Bars don't seem to work anymore. They cant read the component key reference, only the numbers directly. E.g., i have my current health points in a number field (component key "custom_hp") and my maximum health points in a label (component key "max_hp"). I put these two components respectively in the "Value" and "Maximum" fields of the Attribute Bar Editor, and named 'HP' the bar in the "Name" field (which is a simple string to identify the bar). However the fields of the attribute bar won't populate, as shown in image. If i put in those fields simple numbers (e.g. 182 in the value field and 200 in the maximum field), the bar shows up, but i need it to change dinamically as the field on the character's sheet. Any ideas why is this?
Quick question. What formula should be used to find the durability of an amor piece (item) and apply it to a number field either in a Table or Dynamic table.
Would it be find or?
Please ping me when someone can answer. Thanks. :)
entity.reloadTemplate()
${#result:= [1d100cs<=:Skill_value1:]}$
${result ? 'Success' : 'Failure'}$
- It prioritizes
game.user.characterovercanvas.tokens.controlled[0]?.actor. I don't know if this is your intention or not.
Items modify the direct parent entity, so Items can modify other Items.
You have to explicitly use min() in the formula to cap your result, because there's no safeguard-mechanism preventing that.
I don't see a need if you put ${max_hp}$ into the max-field of the Number field. This will automatically create an Attribute Bar for you.
And the reason why it's not working for you, is that you forgot the formula delimiters. There's probably an error message in the console telling you that.
Number fields cannot be changed automatically, you need a manual trigger like a Label Roll Message. Is that fine for you?
I wanted to provide more context to my original question: #1037072885044477962 message
I am trying to take the durability of the listed armor items shown in the image and apply them to the other table. For example, taking the helmet durability and putting into the total armor.
I am actually doing that already within my system.
I didn't know if there was a new way with the system's updates to fetch the durability number from the column and apply it to the number field.
For reference on how my players are equipping armor currently.
I'd use find() on the Item Displayer to fetch the right value and setPropertyInEntity() to override the corresponding Number Field.
Why not just an equipped-property in the Item itself?
Can you elaborate a little further? I currently have a equipped checkbox within the item itself that players can toggle.
I see, and for what do you need the Table?
The table shown in the screenshot is used for combat purposes. Players subtract their armor and then health when taking damage.
I see, you have zone hitpoints
I do indeed.
My players enjoy having a more "complex" system for rp purposes.
I have a majority that like to do medical based roleplay within my campaigns, which leads to the zone hitpoints coming into play.
My thought process behind the formula Iβm trying to create is as follows: If an item is equipped, its value is pulled from the item container and applied to the total armor value.
For example, if a Cloth Helmet is equipped and has an armor value of 10, that value is retrieved from the item container and transferred to my Combat Table, where it is applied to the corresponding fieldβHelmetβs Total Armor.
Not sure if that explanation helps.
I've tried this afternoon with and without delimiters but with no result. Putting ${max_hp}$ into the max-field of the Number field did the trick and unlocked a long list of Attribute Bars that weren't there before (perhaps i should have reload the application after the update). Don't know why, but the important is that now is working. Thanks Martin!
Ping me whenever you get the chance to answer Martin. Thanks for the help as always.
aaaah perfect I completely forgot about min() thank you
Then change Armor in your Table to a Label instead, so that your Item Modifiers can modify that. You can't modify Input Components otherwise.
What formula would I be using exactly to do so?
Table or Dynamic Table?
Item to Table.
I can always make it a Dynamic table if needed.
How is HP of the zones calculated? Are these static?
Its pulled from a seperate section in the sheet.
Its in my GM/DM section.
But these are different per zone, so they're not equal.
And your value in your Number Field won't update automatically. You can try that out.
Correct, the overall health is entreated into PC total health. Then divided as needed to reflect the actual health of each body part (zone).
So pull from the item and feed it into a label is what I'm gathering, correct?
Yeah, but it makes a difference if the Label is in a Table or Dynamic Table.
I'd use a Dynamic Table to reduce redundancy, but that's your choice at the end
If Dynamic Table, then I'd create an additional (maybe hidden) column to reflect the percentage of the total HP for each zone.
And then I'd use fetchFromParent("lookupRef('dynamicTableKey', 'armor', 'Body_Part', '${Body_Part}$')") in the Key of the modifier to select the right Label.
May I ask why create this column? I would love to find ways to better optimize the system I've created.
So that a formula can determine, how much total HP the zone should have
Is the dynamictablekey the key of the new "combat" table or the item container? I'm assuming it's the new "combat" table but I'm making sure
Gotcha ya.
The Dynamic Table, that should replace your current Table.
Your Armor Items should have a Dropdown to allow the selection, to which body part they apply. This way, we can select the right row to modify later.
I'm guessing within the item.
Can I default that value per item just to make it easier?
Dropdowns can have default values, yeah.
Perfect. Would I be able to feed the label value of Total Armor into just a number field for armor? (I'm assuming no.)
Is it possible to pull the number field value within the item itself into another number field within the sheet?
Number fields cannot depend on other Components per design (aside at the time of creation).
Fair enough.
I was just trying to think of a way for a repair button. That will pull from the total armor equipped and place that number within the number field that the players use.
I'll work on this more tomorrow and poke your brain again if needed. Thanks Martin.
A repair button would be something different, because you'd use a Label Roll Message for that. And these allow you to override the current value of any Input Component
Could I pull the value from the Total Armor label?
Sure, read through setPropertyInEntity() and setValue()
Oh interesting.
See I have something like that going on now with the labels I showed you prior.
But that was to equip the armor pieces originally.
You'll run into consistency issues if your players decide not to use your button to equip an Armor Item.
My players have been good so far, but I have been trying to think of a way to avoid that.
how would you, ref a drp down in a roll formula that would decide on which skill to use for that roll,
what i have fpr one of my rolls is
${#?{tarnumnummod:'Roll Modifier'[number]|0}}$
${#tarnumnum:=sum(powrankpc,powscorepc*2,comskilldd_unarmed)}$
<table>
<th>Roll Results</th>
<tr><td>Target Number:</td><td>${!rolltar:= min((tarnumnum + tarnumnummod),95)}$</td></tr>
<tr><td>Roll:</td><td> ${roll:=[1d100]}$</td></tr>
<tr><td>${#degsuc:= roll <= 5 ? 4 + floor((rolltar - roll)/15) : roll <= rolltar ? 1 + floor((rolltar - roll)/15) : 0}$</td><td>${!roll <= 5 ? "Critical Success!" : ' '}$</td></tr>
<tr></tr>
<tr><td>Result:</td><td> ${roll <= rolltar ? concat(degsuc, " Degrees of Success!") : 'Abject Failure'}$</td></tr>
<tr>${#setPropertyInEntity('self', 'lastDOS', 'degsuc')}$
<tr></tr> <tr><td>Base Damage:</td><td>${!basedam:=item.damagedrop}$</td></tr>
<tr><td>Total Damage:</td><td>${!(basedam * degsuc)}$ ${!item.damagetypedrop}$ ${!item.damagetypedrop2 ? concat("and ", 'item.damagetypedrop2') : ' '}$ damage</td>
where would i add a drop down chk to this to decide on weather to use this which is unarmed skill or one lets say set up for melee, ranged or casting
If your Dropdown option keys match with Component keys , then ref(dropdownKey), otherwise use switchCase()
hey martin
long time no see
im working on a character creation process within the sheet, but am having difficulty figuring out how to make buttons that give players items (e.g. choose race), and update fields elsewhere in the sheet.
So entering your characters height in the creator updates it elsewhere in the sheet.
Any suggestions?
Creating items must be done with a script, there's no formula for that. Updating fields can be done with setPropertyInEntity() or setValue()
not creating a new item but adding it to a character sheet, does that make a difference?
There's almost no difference, because in both cases a new Item is created. It's just that one has initial data and the other doesn't.
i see... π€
i checked the FAQ for a prewritten give player script but there isn't one.
I'll see if GPT can help write one
Check Foundry documentation, because it's their functionality
Look for createEmbeddedDocuments() or something similar.
I've been trying to get some rollable stats for a system. The problem is the way the system works the GM sets the difficulty of the roll and then the player compares the character stat to the roll then depending on the difference that tells them what dice to roll. As an example if the stat is = to difficulty of the check, the player would roll 2d8, if the stat is 1 higher than the difficulty then they roll 1d8+1d10, if its 1 lower then they roll 1d8+1d6. The system can go all the way up to 2d12 and all the way down to 2d4. I was orignally trying to make a dynamic table to do something like a find function where the filter was (CharacterStat - CheckDifficulty) to pull the result from the coresponding row. However, I kept getting the reading '0' undefined error. Even trying to pull the stat number via component key gives me that error. I'm at a loss as to what I'm doing wrong. I'll try posting some of the things I've tried tomorrow, but help would be appreciated if anybody could help me with this.
Make a popup on roll that contains a dropdown that searches the value on a dynamic table with the values, then compare those values against the stat selected in another dropdown which calculates the roll, rolls it, and displays the outcome in chat
i've been trying to change the value of the dropdown for about 3 hours now using JS, the built in functions, and console and nothing is working. π€ Is it just because it's a dropdown?
you good @clever patio ?
yup, just typing my question. Thanks for the asking π
Sorry if I disupt the chain. Does the "dynamic table" mentioned in dropdown is the same "dynamic table" in Component library? Coz I am a bit confused and don't know how to put a salection from a dropdown list into a formula.
Using the DynT in the Drop just means the options in the dropdown are generated from a selected DynT.
For example, I have a dropdown that auto populates with a list of all cosmetic titles unlocked, so players can choose which one to primarily display on their charactersheet for funsies
I think I also used this function for reputation levels, as well as selecting what skill / attribute a player is using to attack with given a weapon
I see. My idea is something like: Selecting skill + attribute + weapon.
So I have made a few dropdown lists form players for their attack.
you can do it that way, though i made the attack a part of the weapon itself, and the selection of skill and ability as well
Sorry for my bad wording, I was referring to damage. My idea is that the damage is base on the Magic class and the Gem a PC is holding, it create a multiply factor (listed in the photo) and multiply to the attribute. So I am thinking about making a formula that will involve three dropdown list (Magic class, Gem, attribute).
are the gem and class static?
Yes,
I see, in that case I'd make a dynmaic table, reference the column and row to a label outside the table and reference the label whenever i needed that information
waht if they are not ststic? Like a PC can change the class and gem.
i mean as long as it's not every roll for example then i'd do the same thing
if it's something that happens on occasion you'd just need to change the items and the label should update.
and by items i mean however you're telling the system to check what column and row, dropdowns, radio buttons, whatever.
if it's frequent then i'd have a dialog prompt asking for that information each roll
Thanks! I will try to make it then.
Over 12 hours of work getting these buttons to work so far, but I feel like we needed a win in the chat
havent really done much of the css yet - and i need more input fields but. so far so good ^^
im running into a problem with items, so with equipment items id like the modifiers they give to only be active when equiped right now they do the adjustments when not equiped an just in the inventory page how can i fix this
Hello Community. I'm strugling with an item-modifier. The modifier should increase a label-value in a dynamic-table in the actor which holds the item. i tried lookupref in the keyfield but it doesnt work. if i enter the datapath in keyfield it does work. if i use a hidden attribute in the actor to check if the lookupref works it does. the lookupRef would be lookupRef('TBL_Basic_Skills','Basic_Skill_Value','Basic_Skill_Name','Sneak'). Im realy clueless how to get it to work as intended. Maybe someone can point me in the right direction. Thanks!
fetchFromParent("lookupRef(...)")
${equipped ? 1 : 0}$ in the modifier value
Is there a way to add a label button to a sheet that will activate a macro?
Hmmm...I think I figured out how to do it.
Thank You. It didn't work right away. I had to add ${fetchfromParent(..)}$ . Written as formula it worked perfectly!
can an item added to an item template modify it?
...or can items modify items at all?
Items modify the direct parent entity in the hirachy. So they can modify other Items.
@formal goblet, is there a way to do something similar in the new version?
I tried it this way, but it didnβt work!
Okay - thank you!
I wasn't getting the result I was aiming for, and wanted to make sure it was even possible before digging in deeper to solve it. Basically, I want to provide upgrades to armor.
Nope, only 1 - 1 and n - 1 is possible, not n - n
thank you!
Hi ! Do someone know how I can send an actor ID to a macro in CSB? I talk about the _id field in the json of the actor. Here is the code i'm trying to run, I wrote HERE where I want the actor id to be added
%{return await game.macros.getName('JetCaractΓ©ristique').execute({actorId: 'HERE'})}%
Thanks !
entity.entity.id
Thanks π
Any idea why if I use $ {label}$ with label being the component key of a Label element gives me an error?
With an actual error in the console or just ERROR without any console error? Because the later is also produced, when the result is either undefined or null
Uncaught (in promise) Error: undefined. Uncomputable token "magmagialab"
magmagialab being the component key
Do you have uncomputed props-warnings?
like this?
Error: Failed data preparation for Actor.hrwYKCEiNaitDuIt. Invalid left-hand side expression in prefix operation
ah yes, I just saw what you said
Nope, but maybe also something you have to consider
Is the Label listed there? If so, that's the reason
If you have a dependency chain, then you have to go down the whole chain until you find the root cause
@formal goblet Hey, I wanted to follow up from our conversation from a day or two ago. I decided to stick with a regular table after getting some feedback from my players.
I am changing my "Total Armor" number fields to labels to pull in the total value of the durability per armor piece.
However, I am a little confused on how to use the find and setPropertyEntity in this case. I am trying to find the durablity value of an armor piece that is equipped, has the name helmet in it, and then apply that durablity number to the label in the table.
How exactly would I be combing these formulas to do so? Are they going to be separate formulas in different places?
I'll provide pictures as well for reference.
You don't need setPropertyInEntity() if the goal is to automatically adjust a Label, simply find() in the Label will suffice. HOWEVER, looking for something, that contains a certain text, is something, that can't be accomplished with find(). And also, searching with multiple criteria is also not doable with find() (but can be done with alookup(), but suffers the same issue with the contains). It would be the best, if your Items would contain a Dropdown, which selects the Zone for which the Armor should apply and you reflect that in the Item Displayer. This way, we can use alookup() and sum() or first() (If you want to allow stacking or not).
Could I use the lookup as well to make sure it pulls in the item that is equipped? Is there a comparison I can use for that?
What do you mean with pulls in?
Pulls in meaning it takes the durability value of the equipped item and not a random item within the item display that a player is holding onto.
Ah, yeah. It only depends on the filter
Gotcha ya.
I'll add the dropdown in and get back to you.
Thank you.
Quick follow up question. Could I make it a label instead of a dropdown?
ππ Are if statements in label roll functions nest-able?
(Or do I have to go mingle with macros?)
They are
Cool ty Iβll just be getting some of the logic wrong then
Monk Enchanted Journal adds currency to an actor but I can't write it out ,
Does anyone know how to output a number from an attribute in the currency folder, currency.BI to display the amount of currency the character currently has or some alternative? ,
My attempts only gave only NaN or Error results , maybe am stupid or something or this module don t work great with CSB .
What's the data path in which those custom properties are stored?
How do i check that to be sure , I don t get a wrong one ?
game.actors.getName('actorName') in the console and then you can look throught it. CSB stores them under system.props.
Wait my friend gonna send this
the server host here
is this the right thing?
I think this currency is not stored in the props but only in the currency(folder) in the actor , or maybe am stupid enough.
thats, interesting
Yeah, but it's a hassle to look that up on mobile.
But I can tell, that the folder-prop at the top doesn't come from Foundry or CSB.
See if there's currency in system.props
You should have access to it with %{return entity.system.currency;}%
I have a label component that is a die (e.g. 1d4, 1d6, etc.) I want to roll that die by clicking on the label, but all I get in the chat message is the die (e.g. 1d4, 1d6, etc.) but not the result of the roll which is what I am aiming for. How would you type that formula?
${[1d6]}$ or ${[:componentKey:]}$
[::] was what I was missing - THANK YOU!
Does anyone know why using
${[1d6]+9}$ as a defualt number doesn't work?
it comes back as not a number
Does anyone know a macro to reload all item template inside a compendium?
Hi does anyone know if there is a way to move item between actors without duplicating them?
odd
it works for me, did you put it in a roll formula?
Because Roll Formulas are not allowed outside of Label Roll Messages.
Hello again. Is it possible to trigger an individual userinput inside a rollmessage only if a certain condition is met eg ${equaltext(Skill,'Sneak')?<call userinput>:<do smthing else>}$
The random function also didn't work, so I had to use another label and a manual button to push that change to the dyn table
Personally in this use case I'd just use the alt roll to prompt the user input. π Too many weird situations come up in game to not just have it accessable.
But you :should: be able to do that. Doesn't hurt to try at least
Can someone tell me what's wrong with this:
${?{Oddity:'Oddity?'|"${!fetchFromDynamicTable('OddityTable', 'CSpheres').join('"|"')}$"}}$
It's part of a roll macro in the sheet. It's meant to create a dropdown in a roll prompt window, which will later be used to lower the CSpheres value from the referenced dynamic table.
Later in the roll that is
I'm on version 3.0.0
It just gives me an ERROR in a text box instead.
The name of the Table is 'OddityTable', the name of the numberfield to be modified is 'CSpheres'
Hello
I have an item displayer on an equippable item, but when I try to display the item in that container on the character sheet it is showing up as [object Object]. Is there a special syntax needed to get these to show up?
Hey everyone! Hope you're doing well.
I'm facing an issue and would love to hear any suggestions.
I have attribute bars set as numeric values in CSB, which allows me to modify them using the setValues formula. This works fine for direct adjustments.
However, some of my items need to increase HP or MP by a specific percentage, such as 10% of HP or 10% of MP. The issue is that these attributes (HP and MP) are set as numeric fields in CSB, rather than labels.
Because of this, I'm unable to apply the percentage-based modification correctly. Has anyone dealt with this before or have any suggestions on how to fix it?
Ok so I've made the dynamic table for the rolls, and now I need to figure out how to set a proper popup to populate the options and compare the stat numbers to the check difficulty.
popup asking what the difficulty is, what the player skill is, find the difference
get that value from the column and on the same row get the dice?
yeah. also here is a look at how one of the stats is on the sheet, I want to make sure that the way I have it setup won't cause problems
The system uses a progression sheet so I have a bunch of checkboxes that you click when spending exp to buy the stat. I have those added together on the stat lable.
since it's a boolean value and goes from 0 to 1 when checked it seems to work to add them all together, but I can't help but think I might be doing something janky.
So would I use something like the find function or would I use lookup for the dynamic table?
I cannibalized the popup example, but I think I got the first part right.
ok, I'm just trying to get the a number that is the checkdifficulty - statchoice number just to test it and nothing prints.
${#Roll(
?{checkdifficulty: "Check Difficulty"[number]},
?{statchoice:'Which Stat'|"MEstat","Mind"|"BEstat","Body"|"CEstat","Community"}
)[(:checkdifficulty: - :statchoice:)]}$
where am I going wrong?
actually I can't even get it to print a stat number to chat. In the roll message I just tried
${BEstat}$
and it won't print that stat to the chat. Am I doing it wrong?
Check the console with F12
Is there a way to make an inventory similar to the 5e sheet (attached)? It seems the item displayer only displays items with a way to edit stats by clicking on the item itself, but I'd like to have a number field on the same row as the item so players can edit the item count on their sheet. I don't want something where players input items in themselves, I want the ability to drop items onto the sheet to add them.
If it's not possible with the current tools, is there a module that could help me achieve this? Thanks!
Currently not possible.
Thanks for the response!
Is there any way to apply a penalty to all rolls without having to edit each roll formula on the sheet?
not that i could think of. you would need to edit all formula and add a generic modifier which you could then apply itemmodifiers or effects to. eg ${[:rollformula:+:custom_mod:}$ custom_mod would be a hidden attribute that you could target with other formulas.
I'm not sure how to word this question so I'll give context. In regards to an actor with a bow (item on an actor) with various arrows (items on items). Is it possible to have the various arrow options show on the actor sheet? Or am I limited to opening the bow item then rolling the attack/dmg dice from the list of arrows there?
Thatβs what I figured, just wanted to ask. Thanks for the reply!
Hey, when I try to drop an item from an actor to my itemfolders I get an error.
Whats this and how to fix? I dropped an Item on an actor and want to drop it back to my folders because I delelted it there
Think of the item as a blueprint and the item in actor as the real build. You cant disassemble the item to get the blueprint back. Sorry for my bad english.
It worked all the updates before with no trouble, so its not working anymore?
I really need that item as blueprint, It contains alot of work...
possible workaround. try to export the actor (right click on actor in folder), search for the item, cut it out in a seperate .json-file and try to import back in itemfolder.. maybe that could work.
I'll try
Judging from your Consol-Log-Picture: Gern geschehen. π
Still I dont understand why the whole thing changed the way it worked. I had no trouble before moving items around.
Heya, looking for some help with the Custom System Builder... been trying to figure out how to make a button to roll attack/damage dice, and other things like that, any helpful answers? π
Someone can help me? I wanna make an item rollable just by clicking in the name in an item holder, this is possible?
Yes. Use a Label with a roll value. Label text is the name of the field. Label roll message is where you put the roll expression. Or do you mean an item in an item container? In which case I don't think it's possible from the name as clicking it opens the item. However in item template you create a label (for example rollLabel) use icon only and include the roll expression, then in the item container add a column with a label with the label text pointing to the item roll label. ${item.rollLabel}$ this would then be a clickable icon next to the name of the item, The colums can be moved so the icon could be before the name
Use a label, the label style can be changed to Button, the label text is written on the button, Label roll message is where you put the rol expression. If you prefer an icon leave the label style as the default (ie don't use button), leave the Label Text blank and in Label Icon include the Font_awesome Icon name
Yeah it's not possible to say remove the item if quantity hits 0, but I don't see why you couldn't have a number field reflected within the item displayer's line from within the item sheet.
In mine i've referenced damage values and exported them to a button that rolls that quanitity of dice and relevant modifiers.
I'd be pretty confidident in making buttons that increase ore decrease a quantity value being possible π€
I have it where it rolls when you click normally, but if you shift click it prompts for user input on how to change the modifiers.
It'd be possible to make an advantage system or change the dice quantity with the same concept.
you could include a dropdown list of the arrow types within the item, and have your roll button use conditional logic to figure out which is selected, check for quanity, then roll the appropraite dice
within my items i check if the player wants to use an attribute or ability (skill), and which of each to roll with using a radio button and dropdown combo
erm, not necessarily the name? but I've made dice buttons appear next to items with an attack feature that can be clicked, see the image I attached responding to Lavaman.
I suppose using css you could disable the pointer-event that would open the item info and make the button span the entire width... though then you'd be also making a button to open the item info, which wouldn't be too bad but eh.
i dont have enough information to help you but your code looks incomplete.
you reference checkdifficulty - statchoice but never export that number or use it anyway?
But specifically to answer your question, I know there's better shorter ways - but I always use
ref('stat')
or
lookup('table', 'column', 'filter', 'filterValue')
ok its where I suspected... but how do I make it automatic to roll for example... attack/damage? and it be based off of the other values in the row... like if I use a code or whatever I am oblivious to it... π
is it an item or a table?
like I used a table, not dynamic table just regular table, and am putting skills that include attribute scores, ranks, and other bonuses...
and you want to roll those skills correct?
yeah, like later wanna do the same for attacks but rn just figuring out the rolls for skills
is it a dice pool? or a d20+mod system?
rn just using the custom system builder... didn't add other mods or systems
nono i mean like
what value are you referencing? the quanity of dice? the face of the dice (d4, d6, d8...), or a modifier like say D&D where it's diceroll + strength modifier
like adding strength mod yeeeee
to a flat d20 yes?
ummm yes the skills of this are all flat d20
then it would be plus mod, plus rank, and plus bonus, ill put picture reference
${[1d20]+ref('Strength')}$
erm is the bonus already on the character sheet or do you need to prompt to ask for it?
have yet to have players make characters so number is not decided if thats what ur asking π
so if you want to ask as a popup at the time of roll:
${#?{bonus[number]}}$
Rolling ${roll:=[1d20]}$
<br><br>
Result : ${roll + ref('Strength') + bonus}$
idk what your rank system is but same concepts apply
but is that to the point that it will auto update if any of the numbers (rank, mod, bonus) were to change? π
like refering my screenshot there is button in bottom right, can it be set up to whatever the values are in the 3 surrounding areas will auto be put in? if that makes sense π
it actively asks for the bonus that the user inputs at the time of roll, and gets the strength value at the time of roll from the character sheet. No value is pre-defined before the roll
i mean you can 'get' the roll stat referenced in the dropdown.
ill put in the code real quick to get a visual π
it doesn't seem to be working...... π₯²
like it gave prompt for bonus and thats nice... but how to have it actually roll... cuz it didnt roll
i just ran that code on my system, it works.
the issue would be the component key 'Strength' isn't in your system.
change it to be your strength value
ok so its the mod dropdown in the middle that has the value that needs to be added to the roll...... what exactly from the dropdown component do I need to input the value it is on...?
I do apologize π
π I am new to foundry as it is so I may not be doing things correctly, but like the value for example would be 12, thus making the mod +1
I made it dropdown cuz its all I could figure out to do... π π ... π π
ehh? so is the dropdown selection values +1 +2 +3...?
essentially, its not automated either, just manually done cuz I didnt know how to make it automated based on the value π₯²
i mean how is it caluclated?
the mod based off the value? π
π
so 10/11 is a mod of zero...... every two up or down in value equates to (+/-)1 mod
so like 9 and 8 value is both -1 mod
so dnd 5e?
yup pretty much π
er,
%{floor(${(ref('Value')}$-10)/2)}%
where do I plug that in???
gotcha
ok apparently referencing math JS isn't showing me love but doing it through CSB is fine
${floor((ref('Strength')-10)/2)}$
put that in label text, replacing the dropdown by strength
change Strength to the component key of strength's value number field
π± ITS WORKING!!!!!!!!!
lemme try that with the rest to make sure I got it down real quick...
I Understand how it works... thank you so much it looks so much nicer!!! π€©
yeeeeees, first the skills cuz again I got none setup for attacks cuz players havent setup anything yet lol
what is rank and how does it factor in?
so this right here
so rank is depending on lvl of characters... it can be manually entered in so thats not my current concern... just on the number in the rank text to be auto added to the roll
cuz the skills go up by one every 2 levels automatically, but when favored go up every level(+3) so at lvl 1, unfavored is rank 1, favored is rank 4
again not that it matters much but just thought I'd answer the question π
right but how does that impact your roll
a level 1 'atheletics' check vs a level 2 for example
just adding it to the roll, just like the mod is being added to the roll
so if it rank 4, then its a +4 to the roll, straight forward : D
you still want the bonus popup? or you wanna grab it from the numberfield you have
if it can be grabbed from the number entered in the bonus field that would be great yes π
${ref('skillSelect') == 1 ? [1d20]+ref('Strength')+ref('rankValue') : ref('skillSelect') == 2 ? [1d20]+ref('Dex')+ref('rankValue') :
[1d20]}$
checks the dropdown, if the selected key = 1, roll a d20 add strength, add the value of the rank number field, if it's == 2, roll d20, add dex, add value of rank number, if it's anything else just roll a d20.
add ref('bonus') if you'd like
i guess you could also just roll one dice at the start - and save the value to be added rather than having multiple hidden dice rolls. that may be cleaner.
so
<br><br>
${
ref('skillSelect') == 1 ? roll+ref('Strength')+ref('rankValue') : ref('skillSelect') == 2 ? roll+ref('Dex')+ref('rankValue') :
roll}$```
that didnt seem to work...
brudha
you need to update the component keys
the things in the 'apostrophies'
idk what you called your shit lol
is the skill select the mod from the table you helped me with? π
ahhhhhhhhh
Apologies for the long delay, I had to go to bed for work.
martin wont be on for a while, it's some crazy hour in the morning for him
gotcha. It's kinda late for me, so I can check tomorrow when I get up.
so it rolled a flat d20, and said error... I put all the correct key components
also I just now saw your message.
check your dropdown values.
your 'Key*' needs to be set to 1, 2, and soforth, and you need to exand the logic the = the number of keys you have
so i think I'll go to bed and hit you all up earlier when I'm awake and I have enough time to walk through the proper steps.
again, refer to the image
sleep well mate
Thanks, have a good morning/afternoon/night!
I put the 1 and 2 in the same places as you... what is the logic? π
.
capitalization matters
skillSelect != SkillSelect
and what's the error coming up?
nothing was added to the d20, I even put '3' in the text for the rank and it wasnt added
ok so it rolls the d20 fine but there's an error where the addition occurs. You are referencing the component key 'STR' is that the component key for the strength modifer value we made earlier?
the key component on the mod in the table correct?
mhm
Im not sure if it is working correctly but its not error and is actually showing result now π
Scratch that it is working, had to make sure by playing around with it
Ill now test it with one more from the table to make sure I got it down
I Understand it now, it works Loevely... now to try and add bonus to the equation like you prompted earlier...
I GOT DOWN THE BONUS!!!
you can include a "value" line then a total line if you want.
just duplicate the logic less the roll.
<br><br>
Adding ${
ref('skillSelect') == 1 ? ref('Strength')+ref('rankValue') : ref('skillSelect') == 2 ? ref('Dex')+ref('rankValue') :
roll}$
<br><br>
Total ${
ref('skillSelect') == 1 ? roll+ref('Strength')+ref('rankValue') : ref('skillSelect') == 2 ? roll+ref('Dex')+ref('rankValue') :
roll}$```
you can (again optionally) clean up the logic as well
<br><br>
Adding ${
ref('skillSelect') == 1 ? strMod:=ref('Strength')+ref('rankValue') : ref('skillSelect') == 2 ? dexMod:=ref('Dex')+ref('rankValue') :
roll}$
<br><br>
Total ${
ref('skillSelect') == 1 ? roll+strMod : ref('skillSelect') == 2 ? roll+dexMod :
roll}$```
something like this, though i already deleted my test character so idk if that's the exact syntax
I mean I'm not picky about how clean it is... π Like its working now and I have no prob duplicating the process
lol π€£ yeah im the same way
you don't actually have to call ref('key') like I do.
martin had a fit when he was i do that haha
but it makes it readble for me and it's how i learned, now im too lazy to fix the habit
i think you can just 'componentKey' in most cases
yeah its working out for me so no complaints here π
I will say tho its past midnight where Im at so me brain is not gonna be able to go on much longer, Ill prob finish doing this for the rest of the things that need it, and then might come back asking bout attacks when needed lol, but seriously I appreciate the help m8, my dumb butt has such hard time understanding code as is, thank you for you patience with me π
lol all good.
I can't code either π
just learning as i go along building my sheet.
I rely heavily on chat gpt to get most of my more advanced features to run.
I've spent the last 4 hours trying to make a 'random' button for selecting a dropdown value if the players want to tempt fate
if it takes me more than another hours im telling them to roll a d12 irl and manually put it in fuck it
π π I feel that man
but anyways I do bid thee a Good Night/Day, happy travels π« and much luck in your endeavors
dont cry m8 π
my css file just hit 850 lines long and my random roll button only works on one dropdown but not the other
i have rightfully earned a few tears.
fair enough π«‘
ok do not hit me with sad tennant at 12:30 in the morning
or i will return fire
if sad wilfred doesnt make you actually sob, you may be broken inside
"... You taught me the courage of stars before you left ..."
Wilfred was one of the best characters. I love him for his sincerity and kindness. He was a real hero, who believed in miracles.
I want to say THANK YOU Dara Emory and Shan Wickremesinghe for...
wooo!!
It doesn't seem to be an issue with CSB from the error message
yeah.
bacgrkound-image: url("") !important;
the url can be a directory inside your world folder strarting with ../
Martin π₯²
this code gives no error but doesnt work any ideas?
'self',
first(lookup('attributeTable', 'attributeBase', 'attributeName', 'Physical')),
(first(lookup('attributeTable', 'attributeBase', 'attributeName', 'Physical')) + ref('ccPhysicalAdd')))}$;}%```
Why the script delimiters with %{}% and await?
CSB logic wont let me do as complicated as a thing as i need
for some reason any time I try to do multiple thigns within ? : notation, it wont work.
i need to check if all stats are distributed (pointsum=0), then get the correct stat value (lookup...physical), then get the number of points added (or removed from) that stat in the creator (ref('ccPhysicalAdd'), then sum those values and then override the initial value in the dynamic table
maybe switchCase() could be a better fit for multiple choices? just thinking that might be better..
im getting a value from a numberfield, adding it to the original value, then overriding the og with the sum.
not sure how switchCase would do that
well, i guess short of
if value in number field = -2 get origional value -2 set value..
hmm.. i would build an item with itemmodifier that uses lookup in keyfield and in valuefield ccPhysicalAdd. then build in a hidden attribute as flag in actor when flag set then add modifier if unset add 0.
ok i had to made a display label that referenced the physical value in the table.
%{await ${setPropertyInEntity('self',lookupRef('attributeTable','attributeBase','attributeName','Physical'),ref('ccPhysicalDisplay')+ref('ccPhysicalAdd'))}$;return "";}%
I guess getting a original value then modifying it may have been a recursive error or something.
im not sure what you're suggesting haha im pretty novice at javascript. but i got it working so far.
got to ensure that my 'lock' works now so it cant be spam clicked for an anime level training montage
you might want to look into gitlab-readme the part about item and itemmodifiers. i use items in my project to modify basevalues in actor.
do you happen to know how to get this lock working?
%{if(ref('editStats')==0){return "";}if(ref('ccAddPointsSum')==0){await ${setPropertyInEntity('self','editStats',1)}$;(etc...)}%
if editStat==0 do nothing, doesn't appear to be working as intended
i can pres this button as may times as I want lol
if(${ref('editStats')}$ inside a script you use csb with ${}$ so the value gets resolved. i used that in another script. worked fine.
also, Martin, if setPropertyInEntity is used to adjust a number-field, you can set it above the maximum value defined in the field, refreshing the sheet does not adjust back to max.
There needs to potentially be a check maximum values on template reload.
and yes there's more after that and it ends with a }%
i've massively simplified the logic to
if(${ref('editStats')}$===1 && ${ref('ccAddPointsSum')}$===0){...} return "";
}%``` but it's not working still π₯²
is editstats a number or booleanfield or is it text?
number
just a numberfield that's either 0 or 1. Could do a checkbox to ensure that fact
i meant that I could do that.
it's currently a numberfield
I really want to avoid doing one liner CSB logic or external macros if possible
I may have to just...
${ref('editStats') == 1 ? ref('ccAddPointsSum') == 0 ? setPropertyInEntity('self', 'Phsical', Physical + PhysicalBonus) : '' : ''}$
...```
just like 15 different CSB conditions built per line.
@sinful spade mind if we try step by step?
to get to the error: first i would try to just log the first variable to console and check if i get the right values. e.g.: %{ const checkvalue = ${ref('editStats')}$; console.warn(checkvalue); }%
if im not wrong this could also work: %{ const currentActor = entity; const currentProps = currentActor.system.props; console.warn(currentProps.editStats); }%
sorry didnt see your message.
I was knuckle deep in writing this monstrosity:
${ref('editStats') == 1 ? (ref('ccAddPointsSum') == 0 ? setPropertyInEntity('self', 'editStats', 0) : ' ') : ' '}$
${ref('editStats') == 1 ? (ref('ccAddPointsSum') == 0 ? setPropertyInEntity('self', lookupRef('attributeTable', 'attributeBase', 'attributeName', 'Physical'), (ref('ccPhysicalAdd') + ref('ccPhysicalDisplay'))) : ' ') : ' '}$
and add about 4 other stats to that lol
outputs a warning sign and a green 0
chat puts out an undefined error if enabled
ccPhysicalAdd output a green 2, error still in chat
neither had an error in console.
editStats is a hidden Attribute?
yeah, just a numberfield that's visibility is set to 0
it has a value of 0, but can be "toggled" to 1 by other buttons
using CSB internal logic it works, though i still have no idea why the if statement didnt work
if you are curious (i surely would be) you might try my answer above and check console for output: %{ const currentActor = entity; const currentProps = currentActor.system.props; console.warn(currentProps.editStats); }%
just a warning sign and a green 1.
if i set it to 'off' aka 0
its a warning sign and a green 0
so try adding the other fields to check.
they all just output their expected numbers
great. so no problem at this point.
so time to extend on that.
define a const for every value that you need. e.g. const local_editStat = currentProps.editStat; and then try a simple if like if (!local_editStat) {return "editStat not set";};
%{const local_editStat = entity.system.props?.editStat; if (!local_editStat) {return "editStat not set";};}% returns nothing at all lol
if i enable it to go to chat it does say editStat not set tho π€
o.O unexpected. i tought ! means not? so !local_editStat would return true if editStat would be 0 (zero) ?
0 vs '0', one is falsy and the other truthy
hey martin
so is that why the lock wasn't working???
also do you know of an easy way to find where an error is coming from π€£
i just realized on compiling a sheet i get a ton of:
Custom System Builder | Uncomputable token "lookup('attributeTable', 'attributeBase', 'attributeName', 'Mental', '===')" Error: Uncomputable token "lookup('attributeTable', 'attributeBase', 'attributeName', 'Mental', '===')" for example, and that could really be anywhere on my sheet
Take a look at scope in the error message and look after undefined values.
You can expand that as well...
And uncomputedProps is also important, so check that as well
scope only appears in the warning though and not the errors?
seems like burrined in the mess there's a
Custom System Builder | Value expected (char 7)
Custom System Builder | Cannot convert "ERROR" to a number Error: Cannot convert "ERROR" to a number
They may be causing the other errors
Not sure if it is linked to CSB, but I just updated to 4.3.2 and I get an error when I try to insert an EquipableItem in a compendium . Do someone have experienced something similar.
Try again after CTRL + F5
Worked, thanks a lot π
I saw that when I add an item B in another item A, the item B goes to "CSB - Embedded Items Folder - DO NOT RENAME OR REMOVE"
My question is : what if I add this item A in a compendium, and then use this compendium in another world? Do I need to import the CSB Folder too ?
i tried to write a script that calls a userinputtemplate and returns its values. first screenshot is when i execute it with standard CSB. Second if i call it in script. in script i dont get return values. it says returning undefined..
i was running it from a label ( button ) if that matters
Item B will be lost when moving Item A to a Compendium. It's currently not supported
Yes. i should have written that. i was running both from a label-button. π
im geting errors / undefines from this code.
yet it displays fine?
attributeBase is a numberfield in the dynamic table
Why donβt you use find() instead of first(lookup()) ?
because i didnt know that'd work lol
even with that the issue is unresolved
weirdly enough
Custom System Builder | Cannot convert "physicalRef" to a number Error: Cannot convert "physicalRef" to a number
only one of these should be showing at a time.
they have visability formulas of:
ref('physicalRef') == 1 and ref('physicalRef') != 1
weirdly enough updating any field manually resolves this - buttons do not count.
Hi, wanted to join this report here, I cannot drag items from NPCs to a compendium. I tend to modify weapons/abilities inside a character sheet, then drag it to the compendium after I'm done - but since the latest CSB update, it just doesn't work. Any way around that? Console outputs this error:
Uncaught (in promise) TypeError: undefined. document.toObject is not a function
[No packages detected]
at ItemDirectory._createDroppedEntry (foundry.js:74055:27)
at ItemDirectory._handleDroppedEntry (foundry.js:73516:28)
CTRL + F5
Then you set the value to a non-number with your button
Give me the output of any row of fromUuidSync('uuid').system.props.attributeTable in the console
No change, the same thing happens
@brittle moth probably a case we didn't consider. And I think the same happens when dragging from a sheet to a game directory.
Thatβs freakin cool to be on a sheet π¨π₯
i try π₯²
all to hear that damn
that's so cool!
and those damn smiles from the players.
Question, is it possible to make a blank Actor sheet, then you can attach an Item sheet that has data to fill it with?
I meant not truly blank but with 'undefined' values. Yes.
Seems fine. I need the full error message with uncomputedProps
Custom System Builder | Uncomputable token "lookup('attributeTable', 'attributeBase', 'attributeName', 'Aware', '==')" Error: Uncomputable token "lookup('attributeTable', 'attributeBase', 'attributeName', 'Aware', '==')"
Object { uncomputedProps: {β¦}, scope: {β¦} }```
Hello Martin,
Thanks for your help last time - it works great π―
but today I have a dynamic table...
one of the elements of the table is a radio button, by selecting which row (KE column) the data is needed.
But
the radio button takes the specified value (1) in every row in the dynamic table - therefore the lookup returns every row. π€
How can I set the radio button so that it takes the specified value only in the actually selected row in the dynamic table?
Or
any tips, how could I solve this differently?
This would be the combat value of one of the weapons used, which the player can swap at will. But the values ββchange depending on what weapon he is using - and the combat value is made up of the character's attributes, skills, weapons and other modifiers. The initiative roll
, which is rolled every round in this system, changes. That's why the radio button seemed like a good idea - because the player can only choose one weapon.
Use a Dropdown instead of Radio Buttons. These don't work well with Dynamic Tables
Can't spot anything there. Any other relevant errors?
not really honestly, there's just a ton of repeats and i dont see where they're coming from.
the few that had locations / objects with the formula where i could find what it was talking about all seemeed to reference my stat references such as physicalRef (to get info out of dynamic table easier since it's called so often) yet there doesnt seem to be any issue with the code.
this code
How may I get the value from a text field maked in a sheet in CSB module and use this value to execute a Macro?
Example: %{return await game.macros.getName(toString(MacroName)).execute()}%
I have done a Chinese translation for the system, where should I put it?
I have another question: %{return entity.system.props.Health}% Will return the value of Health in the triggering entity, but if the component Health it's included in a Dynamic Table? How can I get it?
It is possible combine scripts %{}% with ${}$?
Hell yeah dude. Maybe the gitlab so it doesn't get buried
I've done buttons css coded to be the full size of the container, and a duplicated container containing the text positioned behind it.
Yes you can nest %{ in ${ or vice versa
not sure the structure of your system, but once you have your actor selected somehow
//get table
const myTable = actor.system.props?.tableName;
//get row
const thisRow = Object.values(table).find(row => row columnToFilterBy === "valueToFilterBy");
//get cell in row
const entityHealth = thisRow.componentKeyOfColumn;```
so
//get the player stats table
const myTable = actor.system.props?.playerStats;
//get the row containing the stat name Health
const thisRow = Object.values(myTable).find(row => row.statName === "Health");
//get the cell in the currentValue column of the Health row
const entityHealth = thisRow.currentValue;
Can I somehow move the actor from a scene to the sidebar? (I copied+edited an actor and want to include that copy as a new actor in the panel on the right - what is the panel called btw?)
My dear Ms Everdeen. The actor in the Scene is not an Actor anymore. It is an Icon with a linked Actor. So as far as i know you can't copy the Icon back to the Actors-Folder. But what you can do. You can right-click the Actor in the Actors-Folder and duplicate it. It should contain the edited information. With Kind regards. π
@waxen thorn is absolutely correct, updates to a charactersheet accessed through a token updates the actual character sheet.
If however, you mean that you've updated a token and you have two tokens that are different, those are absolutely unique and if you want to keep the second token - you can duplacte the origional actor as lewell advised and then click prototype token, click the new token, and assign token. This way you have two of the same actor with the two unique tokens.
I have an unlinked actor assigned to the token and I want to create a sidebar actor from it.
Sorry I don't know the proper terminology to use
The 'represented actor' is not the actor attached to this token, the token has a duplicate actor that has been edited and doesn't exist anywhere other than when you doubleclick on the token
I see, and if you relink it... it'll update to the sheet rather than the token. Interesting.
One minute
yeah short of someone who's better at javascript than me making a macro that gets the infromation the actor is referncing and imports that over the existing template that NPC Na Szybko uses - your best bet is to duplicate NPC Na Szybko, manually make the same changes you did to the token using the token as a reference.
Well I could make that macro, I was just hoping there was a way to do it built into Foundry
@sinful spade I've got a problem with item-modifiers not updating keys in actor. i got actor a item b and item c. item c is linked to item b which itself is linked to actor a. itemmodfiers that should update keys in actor a dont get apllied even if i target fetchFromParent ({top: true}). any idea on that matter?
I'm gonna be so real with you haha you seem like you have more of a grasp on this software, or at least computer science than I do π€£
If you want advice on how to make shit look pretty then I'm your guy!
But as far as I know CSB doesn't link items through eachother to an actor, but I cant even say that confidently.
Have you tried updating item b using item c?
but honestly, i'm a bit worried about your workflow there - what's the usecase?
the use case would be a piece of armor that applies armorvalue to actor. and then it can have different properties (each property itself an item) e.g. Enhanced Hearing +10 so the property when dragged into the piece of armor should add +10 to hearing of actor.
Interesting.
Why not just apply the enchanced hearing modifier straight onto the armor in that case?
i would have to build alot of item/property-combinations.. and im lazy so i prefer a modular system
I felt that in my soul
i know martin mentioned it would be very taxing on the system to do it this way (because i was trying to this earlier)
But i had a template with all the modifiers i was likely to use in that category already made and set to 0, that way when the item was created I could just change the values.
and my idea is even further down.. some properties can only applied once even if multiple items would grant them. if each pΓΌroperty is in itself an item i could check that and rule out duplicate or multiple bonus.
π€
i think to minimize resources and maximize usability
i'd personally create an template for those modifiers individually, as well as a item container for those items and just set it to GM only view.
Especially given in the new versions of CSB you can create items that house other items (still havent updated to know how it works for sure) but effectively use the armor to give the player those other items directly like a trojen horse lol
exactly that! that would be my goal. items applying other items. π
ok so not that you want item c to influence b to influence a
you want item b to give a player item c
exactly.
so to say a passthrough. if you wear a helm of hearing it is a helm-template with template enhanced hearing applied to it. advanced hearing affects actor and not the helm itself.
effectively we're gonna need to find out if "items in their container can impact the actor" π€
that or, you're back to giving every item template (e.g. armor, weapon, etc) 1,000 "blank" modifiers that the items can influence and pass onto the actor through item b.
or i would have to manually drag those modifier-items on the actor as gm.. but as i said earlier.. im lazy i dont like that.
@sinful spade oh. @formal goblet helped me to write the script i needed to conditionally open a userinputtemplate and get the values back to work with them. would that be intessting for your project?
I actually have a similar usecase for the current system i'm working on.
Professions come with a bunch of bonsues and a lot of times they overlap. rather than creating "+1 strength" as a modifier for each profession, having the professions act as a backpack of bonuses would be nice.
Let me look into that for a second, I havent gotten that far yet but I'll need to figure it out eventually so imma dig for a sec
im confused what you mean π€£
what user input template, and work with what values how
in my actortemplate there is a dynamictable containing basic skills every playercharacter has. the table can be edited by players to add custom skills that must be learned. i included a dice-script-label so the players can roll for skilltest from the dynamic table. but some skills like Awareness need more specific details in this case the sense you are using eg hearing, sight etc. so i made a template for awareness that only gets called if the skill is awareness.
this template has localvariables that i can evaluate to pick the right sense for awareness from hidden attributes and roll this hidden attributes instead of plain awareness-skill.
you are blind.. no sight-sense my friend. you got item with enhanced hearing.. your awareness for hearing is +10.
Oh i see that's nifty,
I sorted that problem a while back by having "abilites / skills" reference "attributes / stats"
So like in 5e having a high dex score makes you better at stealth, but you can increase specifically stealth with proficency, or expertise.
i just made a second dynamic table that links to the first and called it a day π€£
so in your example,
i'd just have a Perception (Hearing) skill that's based on the Awareness attribute
awarenesskill is based on perception in deathwatch-ttrpg. and i needed to roll on specialised awareness-sense and didnt want to add 5-times awareness to skilltable..
I hear you haha, and while it would be cool to go a level deeper- at some point it'd bog my players down in mechancis they'd need to learn. Two levels is plenty, especially given i can specialize further just by naming it.
E.g. a player may have 3d6 awareness, and +1 with Perception (Sensory), then if i wanted them to hear really well but be poor-sighted it'd be Sensory (Hearing) +2 and Sensory (Seeing) -2
okay. that sounds interesting. any chance i could get a peek at your csb-template-code?
I mean it's an entire homebrew system
is there a specific thing you're interested in?
for example, currently I am working on a minigame in character creation that determines character background.
@waxen thorn
very bare bones since i just started on it yesterday but we're getting there lol
the fundamentals are in place.
hello, I would like to replace the icons of EFFECT.Status. In which file can I find which icon is used for an EFFECT.Status?
edit: I found the Condition Lab module π
π© finally done with the visuals.
next up... items, buttons, and general function.
Hello
is there any prefix, similar to item. I can use for Dynamic tables? Specifically I want the label project_cost to be the formula for (project_scope + project_misc) * project_resistance for each item in the list
No, but you can use the samerow reference.
How would I do that?
just samerowref(('project_scope' + 'project_misc') * 'project_resistance') ?
Sec, I was on my mobile, let me find the reference.
I think that wouldn't work as well. More like ((sameRow('project_scope', 0) + sameRow('project_misc', 0) * sameRow('project_resistance', 1))
and maybe include fallbacks.
Gotcha, thank you
Current formula that worked for posterity
${
(sameRow('project_scope', 1) + sameRow('project_misc', 0)) * sameRow('project_resistance', 1)
}$
can actor sheets retrieve data from an item in an item that is on the actor? Something like this: find('item.ammoDisplayer','dmgTotal','equippedCheck','true','==')
There's two ways to do it. One is to pull the data into an item displayer that filters to show the item, then you can do the above, or you can find the uuid from the item in a displayer, then use that for a fetchFromUuid() command.
yeah it can.
i havent done much with that functionality yet, but here's the code i used to check if the player already had a race and classification during character creation (to prevent adding multiple if you need to go back for some reason).
const actor = game.actors.get(entity._id);
if (!actor) {
ui.notifications.error("Could not find the current Actor!");
return;
}
const classificationUuid = "Item.HDfSD8Jc6R6uaOeO"; // Humanoid
const speciesUuid = "Item.kpwc8ShKA5Yzu7p3"; // Human
const classificationItem = await fromUuid(classificationUuid);
const speciesItem = await fromUuid(speciesUuid);
if (!classificationItem && !speciesItem) {
ui.notifications.error("Could not find Humanoid or Human items by their UUIDs.");
return;
}
I would like to grasp how exactly you build the specialisation of skills with a second dyntable. it might solve some problems i might get into in the future.
oh i see.
i made a second dt, and referenced values from the first.
I used a dropdown that got its values from the first dt, then did a samerow to lookup that name within a lookup function to get the values i wanted.
That way you select the base stat, and the other rows reference the values from that row on the parent table before modifying them to match the subskill's changes.
thank you. now i got a new tool in my toolbox how to solve problems like that. cool!
This uuid stuff is new with the recent update and I don't understand it. Where/why is it needed specifically?
You can use it to directly reference an item.key without having to pull the information out into a keyed entry in an item displayer. As a case use, I have a sheet with an item displayer that only ever displays one item. I want it to have the description of the item in a verbose format below the item container on the sheet, so I used this:
${fetchFromUuid(find('Ability1','uuid'),'AbDesc',"None")}$
Which resolves to:
