#Custom System Builder
1 messages Β· Page 57 of 1
Is it possible to create a kind of user input where the user inputs how good the roll was? Like the interface when you activate a nested effect
Creating Active Effects through Label Roll Messages will require you to use a script. There's no CSB-function for that atm
dont need a roll message. player activates the effect manually
So it's a self-cast?
aye
The STR-Modifier can be preconfigured in the Active Effect. The DEX-Modifier is more complex. You either have to adjust that manually or you use a script to modify that
Is there any way to tell a module/macro to display a chat message roll the same way as CSB does? Is there something I could point to to utilize that behavior? The CSB tooltips for rolls are great, I can mimic the look with the class, but not seeing how to get the tooltip to populate.
Uhhhhhhhhhhhh... That's quite a bit of work you'll need. I'll lead you to the relevant parts in the code, the rest is up to you:
- https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/src/module/formulas/Formula.js?ref_type=heads#L481
- https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/src/module/formulas/Formula.js?ref_type=heads#L664
- https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/src/module/chat.ts?ref_type=heads
- https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/src/templates/chat/chat-roll.hbs?ref_type=heads
- https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/src/templates/chat/chat-roll-tooltip.hbs?ref_type=heads
Thanks! I will work on it. Would have just liked to do it in CSB but the macro is too complicated.
I don't know your macros or modules, but if you can, you could use ComputablePhrase.computeMessage(), which is used for Label Roll Messages
Check these 2 here:
Documentation for custom-system-builder
Is there a way to format the initiaitve roll chat message? I'm trying to do it with custom CSS but I can't figure it out.
And by format I just mean centering the text, removing the d20 icon, changing font family, size, and color.
Or maybe to set initiative from a rollable field from within a character's sheed (which I could then format)
I'm not sure you can do much with just CSS. Maybe with a world-script, intercepting the message and re-render it how you like.
You could use the "renderChatMessage" hook, and target any message with the "core.initiativeRoll" flag set
Initiative is really the bare minimum for now, there are many improvements that can be done with it ^^
Fixes and QoL !
**Version 4.6.1 is now generally available, with the following changes : **
Features
- Added filter system for Active Effect Displayers, based on tags set on Active Effects
- Added special status effects configuration
- Added documentation on the tagging system and special status effects configuration (https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Component-Library/Active-Effect-Displayer)
- Added readonly option to the count column of Active Effect Displayers
Fixes
- Made Convenient Effects passive by default
- Fixed modifier conversion to include tags by default and disable active effects according to active modifier groups
- Fixed global template reloading to not crash when token references a deleted actor
- Fixed active effect toggling in User Input Template
- [#455] Fixed active effect handling for other modules
- Fixed an issue with ActiveEffect creation triggering an error message on other players screens
- Fixed an issue with transferred ActiveEffect trying to be computed wrongly
Full documentation : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Home
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
Enjoy !
And here we go... Released, and the first bug arises instantly !
**Version 4.6.2 is now generally available, with the following changes : **
Fixes
- Fixed active effect creation not setting the correct flags
Full documentation : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Home
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
Enjoy !
Lol. Just updated
Noob question regarding visibility: How do I say: Hide this number if another stat is equal 0, otherwise it should be visible?
attPoints != 0
Im a bit afraid to click this button.
@brittle moth could you explain what will be the consequences? Dont want to kill my system. are all modifiers deleted and automatically transfered to an activ effect that will be created on the fly?
You can do a backup and try it out.
Modifiers will be converted to Active Effects and deleted
Hi, I would like some help. Is there any way to create a MACRO or something like that to insert a created item directly into the sheet (directly into the item displayer)?
For example, I have a standard item that I would like my players to be able to insert into their sheet whenever they want without having to drag it from the items tab, just by running a macro.
The process involves creating a new Item (with copied item-data), that is embedded into the Actor.
How can i do this? I have no ideia how to start kkkk
Does anybody here know how to point to a specific row in a dynamic table? I know I must be missing something very basic, but I can't for the life of me figure it out.
So far I have
${find('skills_table', 'skill_col_3')}$
which is properly finding the table and returning the result in the first row, I just can't find the syntax to specify which row to pull it from.
Ideally I'd like a relative reference that returns the result in the same row as the function, if that's possible.
bless you, you're a godsend
π
const actor = fromUuidSync('Actor.l0x2mLz0HHzzMLuZ');
const itemData = fromUuidSync('Item.EzhdAHLSAtEC7AfR').toObject();
await actor.createEmbeddedDocuments('Item', [itemData]);
This Macro is the bare-minimum, which does one job: Create an Item with specified Item data into a specified Actor.
I have been away from CSB for a bit and now I am trying to understand the implementation of the Active Effects "feature". I have not delt with this thing in other Foundry games. Specifically, I want to define races as items and allow them to assign bonuses to certain fields when dropped on the actor. I have looked at the wiki but I am baffled. I have defined an active effect and assigned it to an item, placed the item on the actor, but I can not figure out how to get the value to be applied to the actor.
Quick question: Can this method be used on chat messages?
Yeah. You can use HTML and CSS however you like in the Chat Message. Just to give you an example with HTML: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/FAQ/Frequently-Asked-Questions#q-i-want-to-make-my-roll-messages-look-prettier
What have you done so far? We also have a Wiki-page covering Active Effects: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Guides/Active-Effects
Hmm, the concat is working but the HTML isn't - Can someone tell if I am missing something obvious here?
Semicolon must go inside "" ("color: red;"). And use ! at the beginning of the formula
Perfect!
You can also shorten it: degress_value > 0 ? 'green' : degrees_value < 0 ? 'red' : 'black'
Thanks for the assist. I have seen the wiki but it is not clear to me.
The image is from the created effect. There is a number field with key "test1" (also tested with a label) on the actor. I added the Effect displayer to the item and selected the effect. I dropped on item the actor. The "test1" numeric field (or label) does not update. I have no idea if any part of what have I done so far is correct as far as reaching my goal.
You can only modify Labels and Meters
Also, if the Active Effect comes from an Item, there must be 2 conditions met:
Apply Effect to Parentmust betrueEffect Suspendedmust befalse
These conditions were already as indicated. When the label key is "test1", the value is not appearing within the label. I changed the label text value to 0 incase a base value was needed. This also did not work.
To double check, earlier you said test1 was a number field - is it a label now?
The condition is active on the sheet you're testing with?
Yes, "test1" is a label. I am not sure what you mean by "active on the sheet". If you mean that is selected in the Effect Viewer on the item, yes.
The new version has broken something on my sheet, and I'm trying to figure out how to fix it.
Here is the code:
The label is supposed to be +1, as you can see, but, instead, it's:
It's resolving to just plain 1 for some reason. So, what do I need to change to make it be 1 again? Thank you! π
Fixed it. It seems that using the standard + works fine.
The equality check for true is unnecessary btw. item.qualityOwned is already either true or false
And I suspect that the + got eliminated because numerically +1 and 1 are equal
Let's say that this is a monkey-patch for our Active Effects until the Components and their properties get proper type-control
If you put an active effects displayer on your sheet you can toggle whether it is active or not
Can someone who knows the backend a little better explain the change to active effects over item modifiers, and why it happened?
Also - will item modifiers still work or will they need to be done from scratch?
Perhaps I am going about this the wrong way. I want to define an item as something like "Elf" and when this item is dropped on the actor, "Agility" label is increased by +1. This is possible under the "old system" but I want to do this under Active Effects so it automatic on item drop
Got it. Sounds good. It makes sense why this would be necessary anyways, and I don't know why it took me more than 30 seconds to figure out how to make it better:) That's on me! Thank you!
Item Modifiers are unchanged. They will remain for a while, but are deprecated for now. We shift everything to Active Effects, because these do the same job as Modifiers
understandable, but if they do the same thing, is there a reason for the change?
better data structures? module integration?
im not familiar enough with the backend of foundry to understand the changes and why i'd want to update and redo things
Mostly compatibility reasons. Basic Active Effects are defined by Foundry, thus modules mainly work with that. On the other hand, modifiers are something that only CSB knows about
makes sense, external compatability is a good reason thanks
Since I can't get squeeze any effects out of Active Effects. I guess I will stay with Item Modifiers and re-evaluate when their function is removed.
Is there a way to write a formula so there are commas between numbers? As in, so 3000 is displayed as 3,000?
Not with regular functions, but a little script can do that: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat#using_locales
Where would I put the script? Sorry, I don't have any coding experience
Hello?
Was just trying to import the CBR+PNK template from the template library here (https://github.com/RemyAllegro/CBR-PNK-CSB?tab=readme-ov-file) into a game hosted on the forge. I uploaded the export.json to my forge assets library, it is located at (https://assets.forge-vtt.com/60931aa72763f04a1fb41a8a/export.json) but when I click the file in the file browser and choose select file, console shows this error (Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON) and nothing seems to happen. Suggestions? I have no idea what is wrong.
I'm getting some weirdness when using the Upgrade or Downgrade modes on the active effects. They work as expected when the value would replace the previous value. However, if the new value is equal to or less than the previous value for Upgrade, or equal to or greater than the previous value for Downgrade, the value becomes undefined. I'm on 4.6.2, and this happens in the simplest test case I can put together of an actor with a single property of 0 being Upgraded to 0.
So some entries in my dynamic table are marked as deleted, but still exist and throw errors due to not being computed?
How would I get rid of them?
In your Label, where the format number should be displayed:
%{return Intl.NumberFormat('en-US').format(${componentKeyWithNumber}$);}%
The export might have a syntax error, I don't know. That's user generated content, so we don't do anything with that.
Can you open a ticket for that pls?
When something is marked as deleted, it should be ignored by the computation system. It seems that those marked as deleted are also predefined from the Template, so you can't really delete them. They will be reapplied once you do so
I'm trying to adjust the format in a Meter component, here:
Uhhh. I'm not sure if the Meter allows formatted numbers
Ah, that's too bad. Thanks for the help either way.
I'm just not sure. It might still work though
Where's the format number? Do I just put the formula in the visibility formula box, or the label box?
You place it into Value like you did
What is the reason some actors take multiple loops (3-4) to compute? And doing it several times (3 loops 3 times for example?)
That one is a pretty complex topic you're opening up π
Just wondering why it differs so much, and if theres performane issues I should be worried about that I've caused.
Not asking to understand the technical side π
Dependency chains cost performance. The bigger they are and the more you have generally, the more time it'll need to compute everything
CSB can't know which properties should be computed in which order, so we just do it without an order. If something fails to compute because the dependent property wasn't computed yet, we postpone it to a later cycle. And that costs quite a lot of performance.
You can enable debug-logs and skim through it when you update your Actor
That tracks, I think the most I have is 3 orders deep so 3 loops would make sense
Fixes, fixes, fixes...
**Version 4.6.3 is now generally available, with the following changes : **
Fixes
- [#457] Fixed Active Effect side-effect when coming from an Item
- Optimized computation by not computing disabled Active Effect keys unless needed
- Fixed Active Effect application when using a key not present in props
Full documentation : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/stable/en/Home
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
Enjoy !
I am so so sorry. what dose this mean for the Active Effect Displayer?
Open the console. There's more info
it won't let me even make it. So i am not sure what is happening. XD;;;
So weird... NOW i can make it. I have NO idea what caused it not to work
So sorry again, just trying to figure out how to use this before the next update and how to transfer some code XD;;;
Ticket created.
i was wondering, how do i reference the dropdown menu? Lets say I have a label and i want it to say whatever i select on this dropdown menu.
${itemCategory_Armor}$ only returns the KEY* instead of Label.
hah! i was coming here for a similar question π
i have an item display that has a field for magic type but it shows the text of the key column instead of the lable column from the item dropdown in question
I cannot get the following to work with the filter for an Item Display. It returns a blank. "Vaulted" is the value in a text field on the item. Does anyone have any suggestions?
${alookup('imSpellsVault', 'domain', 'Vault', '===', 'Vaulted')}$
The label in a Dropdown is purely for 'cosmetic' purpose. You can only get the key for your item displayers.
Two solutions : make key & label identical in the dropdown or use a switchCase in the item displayer to transform your key in a meaningfull text.
I usually use the first solution, less things to code & less risks of mistyping something....
Try out fromUuidSync(uuid).system.props.imSpellsVault in the console
That works. Thanks
Will do that, thanks!
Hi! How can I extract a parameter from an Item Container? For example, weight - I downloaded an example, and the character sheet calculates it, but instead of a formula there is just 0.
Earlier when the example was created there was only one way: with item modifiers. Open the modifiers of the item and you'll see how.
The other way is with the lookup()-function, which can be used on extensible tables (dynamic tables and item displayers)
Thank you!
At the moment I am making the functionality of equipping items (armor, in this case) via Item Container (I took it from example template). I figured out how to extract the values, but I ran into another problem: I plan to have 8 types of damage with 3 values ββfor each type. Is there a more convenient way to output them to the Item Container for subsequent extraction and use than using 24 columns?
For example, can I access the prefix and suffix in an Item Container via lookup?
No, prefix and suffix are purely visual. They aren't stored in the properties. If you plan to have so many damage types, how about using Dropdowns in the Items to select the corresponding damage type?
Not sure how Dropdown applies here. Armor can (and usually will) have protection against multiple damage types, and as I understand it, I need to display all the values ββin the Item Container so I can extract them to the main character sheet and use them for damage calculations later.
I have no problem displaying eight columns - it makes a cool table. But when all 24 values ββneed to be displayed for items in the list... Well, it's not a big problem, but I was curious if there was a more convenient option.
I see. Well, this can get tricky if you want to avoid so many columns π
I'm trying to reference data from one dynamic table in the cell of another with the find() function, but it doesn't appear to be working and is returning null. Is there something limiting the scope within a dynamic table?
That should work. What's your setup?
setup?
Yeah. Your Dynamic Tables with formulas and such, so I can take a look at it
nvm I think i fixed it, the key I was searching on just needed a .toString() attached
I would like to open a predetermined Journal Page when i click on a label. Is this possibly? What is the code for the Label Roll Message please?
%{await fromUuidSync('uuid').sheet.render(true)}%
Works for every type of document
How did you do that? I copied your exact line and it doesnt show the skull
sorry i must have mispoke, that's for normal panels, tabbed pannels only interpret as strings.
Now, I'm sure you could use CSS' ::before selector and content: tag to get what you'reafter
.
hey, do you mind if I dm you on this subject?
Hey, I have two types of health in my system (grit and health), damage subtracts from grit first before subtracting from health. It's very similar to temp hp. How can I handle this for applying damaging to tokens?
In which way do you want to apply damage?
Ideally relative modifiers. Lets say I have 10 grit and 15 health, if the user types in -15, it should set grit to 0, then health to 5.
Positive modifiers should only apply to grit
Ok, that's basically overriding the behavior of the Token. Usually you can only modify 1 attribute bar at a time from the Token
I see
Is that how it's handled in other systems (say 5e's temp HP vs HP)?
If so I can probably just copy them
Can't say, I've barely played 5e
Also, is there a "right way" to load custom script file? Does it need to be done as module?
What could also work is to intercept the update to the Actor and reset the negative value in grit to 0 and subtract the difference from HP
Yes
I have some general foundry development experience though it's been well over a year
When it comes to Hooks, you should use either the world script module or you modify your world.json to point to a script
Basically this: https://foundryvtt.wiki/en/basics/world-scripts
That's helpful, thank you. Also, can I use this to define options? Like I have some properties used though out my system (ie color of mana). Which each item, spell and creature share from the allow. Can I define a const in the world script file and use them in the CBS scripts, ie const ManaTypes = ["Red", "Green", "Blue", .... ]; Then reference it like this: ${ManaTypes[i]}$
Or is there no-script way for CSB to handle this?
Formulas read their variables from system.props, you can't change that. But that's not a real issue, because you could just use JS if you use these delimiters %{}%. Or you use math.import to import your function, which handles that.
Ok, I'll look into that. Thanks again.
The data should be somewhere, where you have access to it from the console
A simple variable declaration in a file won't do because it's not globally available
Hey im struggling to make items and subtypes work.
EX: item > subtype damage
Currently trying to make a sword (1) with the subtype that holds damage values (2). (3) is my item template, (4) is where id like to have the item damage subtype (5) that holds info (6)
Im trying to use the itemdisplayer (7) but no templates are available in the filter (8)...
Not sure where im going wrong, I was following a tutorial. If theres a good tutorial for creating items lmk!
I imported Custom System Builder - Example but i dont see anything in my project. On website it says its compatible with 4.6.3
Its an 'adventure', look in the compendiums tab.
Which document types are your Templates for the Items?
I am not sure if i found a bug or i am doing this the wrong way:
- Created an Item Template for Ability (spell)
- Inside there is a dropdown menu (that only GM uses to set the item properties) that uses formula with comma separation to fetch the information from parent. What i am referencing is the label/number that can be changed by player or an item.
- Inside the same item i have another label that is referencing whatever was selected from the dropdown menu and it is used as information for player.
All of this works when i open the item from the inventory of the character. It looks at the stat of the character and it references it inside the item as information.
Bug:
When I change the the referenced stat. e.g. +1 to it, when I go back to item, the information is still the previous number. When i refresh the item it loses the information from the dropdown menu (it goes back to default which in my case is blank). Then if i close and open the item, it also loses that information for the player. Its just blank like in dropdown menu that was changed with hitting refresh button.
You are doing this the wrong way ^^"
Dropdown save the selected key in the item data
Let's say basicRange_final = 10 and halfRange = 5
The way you are doing it, your dropdown generates two options :
10 => Basic Range
5 => Half Range
When selecting an option, let's say Basic Range, the Item will have in its values :
RangeType => 10
Then, when changing the value on the parent, let's say by making basicRange_final = 12, your dropdown will generate
12 => Basic Range
5 => Half Range
And the item, when displaying the dropdown, will try to select the option with key 10 since that is its value, and since it doesn't exist, select the blank value by default.
The way I recommend you do it is to set the option keys to the parent keys, i.e. : basicRange_final,halfRange, and calling fetchFromParent when needed. Or better yet, add a hidden property with this value :
RangeTypeValue => ${fetchFromParent(RangeType)}$
Which will automatically fetch the correct value based on what it selected on the dropdown
hi, I don't know if i should ask here or there is a different channel.
I'm using Custom System Builder, and I'm having an issue where duplicating a sheet doesn't copy it exactly. Some things in dynamic tables are shuffled.
Does anyone know the cause and/or a solution to that?
(Both screenshots show a part of the original and duplicate sheet. Just a list of traits, but for some reason some traits and spaces(placed for convenience) are ending up at the end of the table...)
The sorting is client-specific to avoid performance-issues with sorting
Is it possible to turn it off?
Nope, no such option
Trying to create an effect in an item that fetches a value from parent actor.
With item modifiers this works fine, but how can i reproduce this with an effect please?
It's the same. You can even use the target.-prefix to target the properties of the entity the effect is being tranferred to
FollowUp Question regarding effect creation: I have a good amount of items (Skills) that change Values in the Parent Actor in lots of different ways: Is it good practice to precreate every single effect possible and just drop it in my items or would it be better to create an empty effect, eg. called "Bonus" and define its effects later when it is copied to the item? Do lots of effects bloat/slow down my system?
I don't know how to search within threads, so forgive me: CSB work with V13 yet?
Sorry, but i use the same formula and it doesnt do anything. No error/warning in the console
not yet
The Attribute key should stay as it was. The prefix is only usable in formulas
Can you show the details-tab?
Give the effect a priority
Cheers, thanks
No effect
Ok, try it with a static effect value
tried ${fetchFromParent("target.CHARISMA", {fallback: 0})}$
and
${fetchFromParent("CHARISMA", {fallback: 0})}$
both dont work.
static vales work, already checked that
I can at least confirm that fetchFromParent() works in there
Adjust the fallback-value to something else
fallback triggers
Confirm that CHARISMA is a valid key
it is
Best would be fromUuidSync('uuid').system.props in the console
Try out ${target.CHARISMA}$
used:
${fetchFromParent(target.CHARISMA, {fallback: 3})}$
now it doesnt trigger fallback, gives error message