#Custom System Builder
1 messages ยท Page 39 of 1
"estado" by itself should just return true or false with out needing to check. but I could be wrong on that.
ok, im gonna see
in the visability forumlas I have been doing I just write the key by itself or not(<key>)
its because the (i) button explanation
the double conditional here seens to be necessary
ok
i will make it with a radio button where i can change the numbers
Same
why setProperty only works for the first conditional
I just used this script and it worked to set and unset a checkbox. It does take a second for the sheet to refresh on its own though.
${is_awakened ? setPropertyInEntity('self', 'is_awakened', false) : setPropertyInEntity('self','is_awakened', true)}$
it seems you maybe using too many "${}$"
Thank you so much
It's possible to change the actor image with setProperty?
Not sure I am inspecting the data on an actor I have and I am not finding a protperty for it yet.
it does not seem so. it looks like you can only set properties in the props of the actor and the image is likely stored elsewhere.
Martin, do you remember this one? I think the problem I'm having is that when the function calls the camp and it has no key, even with the empty option of the dropdowns that don't have default setted, it bugs the whole sheet. It will only work when I do some extra steps in a paliative solution, and as soon as I edit anything else in the sheet, it stop working again. Could you help me? Even if you tell me the CSB don't do what I want it to do.
alright, so I figured it out.
It seems that while the roll message scripts are running, it stores the variable in a localized scope of variables.
The concat querries are stored in the variable names provided and the customUserInput is stored in variables that are named the same as the keys in the template.
I could then call on those variables inside my javascript and use them as needed.
Also, the SameRow fallback is not working
is there a code formula that can automatically adjust a sum based on the largest of three variables?
like lets say i have a skill that can be based off strength, charisma, or luck
You could probably write a script for it using the Math.max JS function if it is available in the API otherwise, use a small bubble sort using if-else staements. then use the setPropertyInEntity function.
Sort using if-else:
if (num1 >= num2 && num1 >= num3) {
return num1;
} else if (num2 >= num1 && num2 >= num3) {
return num2;
} else {
return num3;
}
Math.max:
Math.max(num1, num2, num3);
would I need a formula to call the values or is it enough to use the component key?
the component key is how you will access the values in the script.
so you would write the script using %{}% syntax and put the component keys in ${}$ syntax.
%{
const num1 = ${strength_key}$;
const num2 = ${charisma_key}$;
const num3 = ${luck_key}$;
if (num1 >= num2 && num1 >= num3) {
return num1;
} else if (num2 >= num1 && num2 >= num3) {
return num2;
} else {
return num3;
}
}%
it will be something close to this, but the "return" will be wrong. You need to call the setPropertyInEntity function from in the script or pass the variable out once you find it. but I don't remember exactly how that is done off the top of my head.
it is possible it's just a matter of getting the right combination. someone more knowledgable could probably get you something more efficient but I think a script is probably the way to go.
I'm ran into an interesting issue. I have some code in a Label Roll Message that is
A) Supposed to update an item.
B) Supposed to update some fields in an actor.
C) One of the fields in the actor updates based on the item.
It does A and B. However, C doesn't happen unless I refresh the character. I think that it's updating the character and then updating the item, but then not updating the character again until something else changes on the character sheet.
Any suggestions on how to force it to update the character again?
use the floor function
so floor(MATH EQUATION)
thanks!
So, my characters attribute bars are overflowing of old values that no longer exist (they created themselves, I hadn't touched the attribute bar button before) is there any way to clear it? Or am I just stuck, with a long row of clutter?
Nope, the setProp-function is only limited to actor.system.props. Other fields of the Actor have to be changed with a script by using Document#update()
Number fields and Meters can create Attribute Bars on their own, so keep that in mind
I'd use a script for that and do the following steps:
- Create an Array with the entries
- Sort descending
- Slice on the first 3 elements
- Reduce
I'll take that as me being stuck with dead bars unless I wanna remake the template ๐ซค
To be fair, these should be cleared automatically if removed from the template, so might be a bug involved
Is it possible to create custom active effects from the character template? It seems it is but I'm not able to find where.
Is it possible to pass a condition to a checkbox so it toggles automatically? Or to achieve a similar result within csb? I know a simple label would hold a true/false value similarly, but in this case it would be more cohesive to the system if it is a checkbox.
Edit: This is a good way to achieve what I needed
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Checkbox-in-Item-Containers
I have a roll message that just sends a skills description text to chat. That skill description is on an Item. I know I can do [[d10]] inside the text, and it will roll dice for the chat message. But is it possible to do something like [[${skillRank}$d10]] in the text, so that it rolls X d10 based on the skillRank number field on the Item.
This might answer some questions there
https://gitlab.com/custom-system-builder/custom-system-builder#46-add-rolls
you can set the property of the property of a checkbox in a script, if that is what you are asking.
this uses the SetPropertyInEntity function.
This was one I used a bit ago where the checkbox was toggled when I clicked a button.
${is_awakened ? setPropertyInEntity('self', 'is_awakened', false) : setPropertyInEntity('self','is_awakened', true)}$
If you want to do this whenever an event happens that would require some sort of event listener which is not in my knowledge base at this time but from what I understand it is still possible.
is all you are doing is rolling a dicepool?
cause that is exactly what I am working on now and I may be able to help
I think the problem is that section works fine in label roll messages. But I'm rolling straight from inside a text box sent to chat. it doesn't seem to pick up ${}$ formula brackets only basic [[ ]] roll brackets.
That is a deffered Roll inside a Rich Text Area
Thanks. Actually, I'm trying to have an automatic checkbox behavior without clicking anything, if possible
Example... is there a way to add a formula to the d4 roll, or is this the limitation of rich text area?
ah, not what I am doing right now, my bad.
What key should I provide to fetch a value from a dynamic table using the item's name as filter? item.name?
${fetchFromActor('attached', "lookup('dynamic_table', 'desired_column')").includes(name)}$
in case someone needs this
Oooh I see, I don't think rich text areas support formulas. You might be able to pull off a workaround by splitting it into two different rich text areas (one for the first half before the formula and one after). Just a theory.
I'm having trouble in a label roll that is supposed to update information inside of an item and also information inside of an actor. It will only do the one listed first in the macro. Though, the second will occur if the sheet is updated or refreshed. How might I get around this and force the sheet to update again at the end of the label roll?
I think what's happening is that the macro is only updating the actor once and only refreshing once, and for this niche instance, I need it to do this twice.
heey, so out of curiosity
Which version?
how would you update a singular item across the entire game? so that tokens on board as well as every actor in the game is automatically updated as well?
say you want to have the Fire spell have +1 more damage
4.1.1
but then you have to update:
- all the actors that use "Fire"
- all the tokens on canvas that has "Fire"
has anyone ever figured out a way to just, across-the-board update all of them without manually updating everything?
And I thought I fixed this...
I'm sorry!
Reference vs. Copy. Foundry by default copies Items when used as Embedded Document
And copy means new instance
That's definitely the issue I'm having
Any way I can do things by Reference instead of by Value/Copy?
A macro comes in mind where I can do a game-wide search of the name of an item and update the value to what I want but
Then comes the issue of dynamic table making the data complicated to update en masse
It would probably be easier to do a game-wide search of the name of an item and replace it with a whole new item
A Label with the Item Link, so all Actors would share the same instance in the game-tab
But you'd lose the context of the executing Actor
Then a link
I guess it works for items where it don't need any values from the actor/token but that's already under the bridge
You can look at the code of the Item Container on how to create a clickable link
Like in the documentation or in the source code?
Source code
Should be at the bottom
Can you show the content?
Hello CSB is giving me a strange behaviour again. I have this formular in a label:
${sum(lookup('Attributes', 'Costs_Bonuspoints'))}$
Which returns me se sum of an array: 0,0,0,0,0,0,10 = 10
But as soon as I enter a key for the label the sum returns me a 0 and the last value just vanquishes. Any idea what going on there?
I am no expert, but what other properties do you have set on the label and is the sum being applied to set the property or just doing the summation.
Could be when the sheet refreshes it is going back to the default setting of the label cause the sum was not stored in the instance of the label.
No other properties, just the summation. Actually when I remove sum and just show the array the one value is still missing when using a component key.
Check the console for uncomputable props
How would I go about making a dropdown that contains options from two different dynamic tables?
Is it possible to create an item slot (Hexagonal Shape) where I can equip items by dragging them into it? The slots need to inherit item data, such as icons and descriptions, which can be used as modifiers or simply displayed illustratively.
I have items like potions that have a number field called "quantity".
I want to use SetProperty so that, when the player clicks on the actor sheet label, SetProperty removes 1 from "quantity" of the item in the item sheet. How do I do this?
Hello. It looks like I don't understand parameters \ keys inside dynamic tables?
fetching directly from the actor attribute works as seen at the bottom of "TestWeapon", but it doesn't if it's inside a Dynamic Table using somewhat the same method.
I'm on the latest build detected by Foundry
Formula option: ${lookup(...)}$,${lookup(...)}$
There's an example in the Readme if you navigate to the description of this function.
It seems like you forgot the formula delimiters
I'm not showing ${}$ in the label because it would turn blank (idk if there's an escape character or what)
but the actual Formula for that label's ${Key}$ is
${fetchFromActor('attached', "lookup('Attacks', 'AttackValue', AttackName', '${AttackSkill}$')")}$
If formula delimiters are something else then I apoligize but I don't understand ๐
AttackSkill from the formula above is the key picked from the DropDown -> Strenght
The first one prints as 2, the second one doesn't
It's probably because of that ${AttackSkill}$ now that I look at it closely ๐ I'll try in a min without it
Documentation says:
Get value of key Skill_Value from dyamic table Skills where Skill_Name equals Lock Pickingfrom the current target:
fetchFromActor('target', "lookup('Skills', 'Skill_Value', 'Skill_Name', 'Lock Picking')")
I manually added the skill name as 'Strenght', so the formula is now:
${fetchFromActor('attached', "lookup('Attacks', 'AttackValue', AttackName', 'Strenght')")}$
It's showing empty.
I'm assuming that "Skills" is the key given to the Dynamic Table, while Skill_Value and Skill_Name are two keys given to two different columns of said dynamic table
When i log into my game I can't se anything on my sheets and i can't create a template to make a sheet? seems like the world is broken or the system
just say
this also happens if i make a completely new world with your system. Please help!!
Hey Tim, you either have to go into the game settings for Custom System Builder and set the "minimum role to reload sheet" to Player, OR have players create the blank sheet then as a GM force the sheets to refresh. Of course this is after you have created the character template. I had the same issue myself.
When making the template just check that when creating the new actor you select "Template" instead of "Character". If that options isn't available then the answer to your question is out of my depth. Sorry.
Iโll tryโฆ thanks
Check the error in the console
trying to figure out radio buttons
so the radio button im trying to do has three choices, advantage, disadvantage or normal
adv and dis give bonuses, normal doesnt
What you'll do is make three radio buttons, all with the same Group name. "Label" is what the player will see, and "Value" is whatever value that you want to assign to it (depends on how you use it in other scripts or formulas).
yea im just trying to figure out the part i put in the boxes since i didnt see an example on the site
Quick example
Group stays the same. Value will be the value of the Component Key when you use it in a formula or script.
ok so you dont give it a component key, instead its based on the group
You do give it a component key. I was just rushing because I'm hosting a game :p
ah ok
so if i assign them each a number and then write a script to compare the component keys
that should work then?
Hello. I have an Item Displayer which doesn't consistently refresh.
The items have a checkbox component, and a column in the Item Displayer changes that checkbox from False to True. Another column in the Item Displayer displays the value of that checkboxโฆ sometimes. If I refresh the sheet, the Item Displayer shows the correct values. If I click on the item name to open the Item sheet and then close the Item sheet, that also makes the Item Displayer show the correct values.
Is there a way to programmatically refresh the Item Displayer without having to do those things?
well iirc
items once added to a character exist independent of the source item
so if you make changes to the item displayer that should update based on the values of the items in them but if you make changes to the item or the template, that can break the item in the displayer
I'll give a proper example. Gimme a sec.
I believe I misspoke in my rush. What you'll use is the Group name for the formula. For example, with this, having advantage adds 5 to your roll, but disadvantage takes away 5. Normal rolls have no change. I have normal checked by default, since that's what will be used most often. This is the formula for the roll:
${[1d20] + rollAdvantage}$
rollAdvantage will apply the value of whichever option was chosen at the time that the roll button is clicked.
hi guys doe anyone know if anyone have done something for panic at the dojo?
I'm having a very strange behavior happening in my system and I can't figure it out. I have three fields that are supposed to become gray-ish in case no ammunition was spent. The problem is that in my own client one of the fields behave in the opposite way, where in a test session as a player using the web browser this works as expected. Any clues? The fields on the bottom share the same dynamic table and the field on the top is located in a tabbed panel, and the 'ammunition' check retrieves that value from a checkbox. It seems like a reload issue, cause it corrects the color once I change another field or when I reload it manually
what game settings are you talking about. I do not have access to the template sheet as it also just show the weird sheet
only get this error in console. And it's also in new "clean" world I create. same setup. No templete avaibleable to edit
Did you check css classes? Maybe wring class assign for value?
This is from the forge log. Can i somehow reinstall the system files?
In a completely new world with no modules enabled the template look like this
- Try out to clear the browser cache.
- Reinstall the system
- Pray ๐
oh no ๐
But it worked :=
Thanks, man!!! very much appreciated!
The color updates after manual reloading or changing any field in the sheet. And it works fine for other players.
Is the Import JSON still working? I used it quite a bit a while ago, to learn from what others had done. Now the import completes, but nothing appears in Actors or items. CSB 4.1.1
There are 2 different ways of importing/exporting JSONs. Basic foundry way within the actors/items/journal tabs and the CSB way via the settings tab. The JSONs exported by the one way are not compatible to import by the other way. If the JSON you try to import was from the other source, it will just end without any error or result.
Thank you sir, much appreciated.
Hey again. After taking a break, I tried to do what you've suggested. Sadly, I cannot get the specialisation chosen in the field to stay on the character sheet. What am I doing wrong?
where are you trying ot display the specialization? in the dynamic table or on the item container?
In the item container. The dynamic table is just showing how I would like the item container to display everything
Ok so the button colum fo rht eitem container should be seperate from the view into the item container
Right, I already did this
Sorry, I misunderstood. I thought you were referring to the roll
if you want I have time this morning and we can voice chat in one of the dev channels so we can work through this. I planned on working on my system all day today anyway.
Thank you, that would be grand! In which Time zone are you living? Morning is a relative term^^
oh it is morning now for me I am in central US
Ah I see. Central Europe here ๐
I have a radio button group to determine which initiative the character is using. When I click on one of the buttons it selects the radio button, but when I close the character sheet the button no longer visually looks like it is selected. using my data inspector that value of the selection is still there so all the formulas work but the button just visually looks like nothing is selected.
Is this fixable?
That's the first time I hear about that.
Are your values within the group distinct from each other?
yes
Good afternoon. How do I make it so that when a player makes his roll and after the other makes his, the difference in the result is automatically calculated in the damage?
Example: Player 1 rolls 2d6+3 and gets 10 and Player 2 rolls 2d6 and gets 7, so this 3 difference I wanted to be automatically calculated in the damage. Is it possible?
Another thing, is it possible to have a question box when making a dice roll, to kind of have some options?
Example: x2, x1.5, +1d6 and etc?
each one takes its value from another Text field so that the initiative for the sheet rolls correctly in the encounter Tracker.
so the initiative formula in Configuration is set to:
[${selected_initiative}$]
Each radio button has a group of "selected_initiative"
and then the value of each button is set with:
${$physical_initiative}$
${astral_initiative}$
and so on.
so the system when I roll my initiative allows the player to click the type of initiative they want and this radio button grabs the correct initiative from a text field and rolls it through the system roller.
All of that works, but the radio circle itself stop display what is selected when the sheet is closed and reopened. The data value is still set correctly but it just doesn't display as selected.
for the second one you can possibly use a user input template. you just need to set up the template like you would anything else by creating one. then you can call the template and use the things returned by it in your scripts.
I don't know about the first one.
I don't quite understand, how do I do this?
There are 2 ways to achieve this (each with pros and cons):
- You save the attack roll in the Chat Message in a data attribute of a Button, which can be used to roll a reaction. In this case, the contextual data can be used to calculate the difference. But this approach requires knowledge about Javascript and a bit about the CSB-API.
- You save the result in the targeted Actor. This way, the targeted Actor will have all needed information to calculate the difference. But the big flaw is that Foundry doesn't allow players to change stats of Actors they don't own. So you have to work up a solution with Scripts of you want to have that for players
You can write [:selected_initiative:] in the initiative formula. It basically does the same.
Are all Radio Buttons unselected after opening the sheet?
yes every time I open the sheet they are all unselected.
but the variable that stored the selection is still set to the last radio button selected before closing the sheet.
And if you change something else in the sheet?
it now displays the selection. then when I close and reopen it is back to being blank.
could it have been a rendering issue.
though thte data is still set so it may be something i just have to live with.
so I tried restarting the server and now it won't come off of one of the selections and keeps refreshing to that selection.
Use static values in the Radio Button values instead. You'll get issues when you have identical initiative values in there (violation of uniqueness)
The values need to be able to be updated by the player though as they may change iniative based on what equipment they are using or if they take combat drugs or not.
Static value could only be set by me correct?
All you need to change is to remove the formula delimiters for the Radio Button values and use ref() whenever you're using the Radio Button Group
so it then looks up at execution of the initiative roll instead of evaluating on the sheet, correct?
Wherever it is. It would even work in a Label value
But yeah, it would be resolved somewhere else and not in the Radio Button anymore
well that seems to have fixed all the issues, thanks you
I'm looking for some help on formulas.
Inside a label roll message, I'd like to use the := assignment operator to save the result for later.
For example, something like this
${(AttackRoll == 20) ? CritDam:=[:DamageDie:]: ''}$
When I try to do this, I get an error. Is there any way to make this work?
(Note, I don't want to precompute the variable CritDam because I want to display it as a rolled result)
The assignment must be the first thing in a Formula, you can't have it within.
so now for a new issue it seems to have now broke rolling for initiative from the encounter tracker.
You also need ref() there
it doesn't roll as it throws an error that iniative needs to be a finite number and then just displays ref('physical_initiative') in the chat box.
Seems like it didn't evaluate it. You probably missed delimiters
${CritDam:= (AttackRoll == 20) ? [:DamageDie:]: ''}$ works mechanically. But I would rather not display the roll if there is no critical. Is there some to make both (1) show the roll only if the condition evaluates to true, and (2) keep the result of the roll.
ffs, internet in germany...
Yup. I'd looked at this. I think the key suggestion is this: "To circumvent the issue of
rolling unwanted dices, you should build a Roll-Formula before executing it (so doing 2 steps instead of
only 1)."
Unfortunately, I'd hope to avoid doing this because it means displaying a single roll, not two rolls. i.e. my current code says something like ${DamageRollFormula:= (AttackRoll == 20) ? concat(DamageDie,' + ',DamageDie): DamageDie}$, then evaluates DamageRollFormula later.
This is then displayed as a single roll, regardless whether it is a critical damage or normal damage.
I'd hoped to figure out a way to make that critical damage roll display two little dice icons. Alas it doesn't look like its possible
I just started getting this error trying to open four different NPC sheets (some NPC sheets are working)from canvas or Actors tab: foundry.js:655 Error: An error occurred while rendering ActorSheet5eNPC2 27. cls is not defined
[Detected 1 package: system:dnd5e(4.1.0)]
at Hooks.onError (foundry.js:654:24)
at ๐Hooks.onError#0 (libWrapper-wrapper.js:188:54)
at foundry.js:5795:13
Caused by: ReferenceError: cls is not defined
[Detected 1 package: system:dnd5e(4.1.0)]
at npc-sheet.mjs:77:31
at Array.map (<anonymous>)
at npc-sheet.mjs:76:100
at Array.reduce (<anonymous>)
at ActorSheet5eNPC2._prepareItems (npc-sheet.mjs:59:43)
at ActorSheet5eNPC2._prepareItems (sheet-v2-mixin.mjs:280:13)
at ActorSheet5eNPC2._prepareItems (npc-sheet-2.mjs:162:11)
at ActorSheet5eNPC2.getData (base-sheet.mjs:187:10)
at ActorSheet5eNPC2.getData (npc-sheet.mjs:24:33)
at ActorSheet5eNPC2.getData (sheet-v2-mixin.mjs:136:35)
at ActorSheet5eNPC2.getData (sheet-v2-mixin.mjs:96:35)
at ActorSheet5eNPC2.getData (npc-sheet-2.mjs:75:33)
at ActorSheet5eNPC2._render (foundry.js:5838:29)
at ActorSheet5eNPC2._render (foundry.js:6572:17)
at ActorSheet5eNPC2._render (foundry.js:7158:17)
at ActorSheet5eNPC2._render (sheet-v2-mixin.mjs:76:19)
at ActorSheet5eNPC2._render (npc-sheet-2.mjs:61:17)
at ActorSheet5eNPC2.render (foundry.js:5793:10)
at Token5e._onClickLeft2 (foundry.js:61477:17)
at MouseInteractionManager.callback (foundry.js:30834:17)
at #handleClickLeft2 (foundry.js:31057:15)
at #handleLeftDown (foundry.js:31016:83)
at #handlePointerDown (foundry.js:30981:58)
at vh.notifyListeners (EventBoundary.ts:1454:26)
at vh.notifyTarget (EventBoundary.ts:662:18)
at vh.propagate (EventBoundary.ts:299:14)
at vh.dispatchEvent (EventBoundary.ts:210:14)
at vh.mapPointerDown (EventBoundary.ts:683:14)
at vh.mapEvent (EventBoundary.ts:231:28)
at ra.onPointerDown (EventSystem.ts:373:31)
Here an example of conditional display:
${${isCritical ? '#' : ''}$'This only shows if it is critical'}$
This is not the channel for the dnd-system
do the values of a radio button group have to be different?
Yeah
in the [] of a roll formula can you add text to be output to the chat?
Ehhh... Whatever the Foundry Roll API allows
But I don't think you'll get it to display text
couldn't get the ref to work no matter what I threw at it so I went back to the original system I had that worked. made sure that the values would always be unique and going to just deal with the rendering issue. so long as they can roll initiative.
Thanks for your help, I'll study what you said later.
How do I hide a result from a macro? And then show.
That's too unspecific, do you have more details?
So, I made a macro where it runs the 151 Pokรฉmon randomly, but when I run it, it already shows which one it is. I wanted to rotate the NPC trainer's number of Pokรฉmon beforehand, so he could organize himself in the battle order, and then I would show the roll to the players.
Does anyone know if there's a way to refer to the component key of the component which is executing a formula? For example, if clicking a Label component executes a formula, can I refer to that label's component key dynamically?
Nope, that context is not provided
Damn. Unfortunate. Was hoping it was possible to avoid having to rewrite certain references for every single button using the same formula
${value:=ref(concat('number_', 'force'))}$
Force:
${value == 0 ? [(2d6kl)cs>=4] : [:value:d6cs>=4]}$
For some reason, this formula is evaluating the result of :value:d6 before the 'cs', rather than computing for example 1d6cs. Any idea why?
Example error:
Uncaught (in promise) Error: Unresolved StringTerm 3cs>=4 requested for evaluation
This was working before, seemingly only if I don't utilize the conditional
Because it's in parens
The error came from the else in the conditional, not the one with parenthesis
[:value:d6cs>=4]
Value in this case is equal to 1, and so it seems to be rolling 1d6, taking the result, and then trying to cs it.
Causing the error
This only occurs if using conditional ? :, otherwise it works fine. For example the following formula works:
${value:=ref(concat('number_', 'force'))}$
Force:
${[:value:d6cs>=4]}$
Keep in mind that both ones will be executed, because Roll Formulas have an higher order compared to the rest of the expression (including conditionals). More details here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#315-conditions
Thanks for the help, got everything working ๐
Thanks
Now your game did it again... It breaks until i reset the browser cache. It's a little bit annoying as it also resets some of the settings in the other systems i have. Why is it doing this? and it's not a module error as it also do it when all modules is disabled.
A cache only saves things temporary (like Images, Fonts and Scripts). They are usually deleted after a day or so. The issue should only occur when updating a version, because it doesn't flush the script in the cache for some reason.
Your client-side settings on the other hand are stored in cookies. Except for session-cookies, these are usually saved for years until they expire.
It sure what that means. When I deleted the browser cache yesterday it fixed the problem. Now the problem is back. You saying I should not delete cookies?
Delete cache, keep cookies. You can also press CTRL + F5 for a full reload of a site.
The problem is only known to appear when you update the system. If you didn't update the system version, then I don't know why the issue arises sometimes.
Ok thanks for your time. Maybe itโs a Forge thing.
Neither cltr+F5 or clearing cache worked. But i did accidentally delete the cookies also yesterday when it fixed the problem.
Well... Dunno... I had some bizare cases with users using Forge and I still don't know why. I can't really help there
well ok. at least it seems to be a cookie thing ๐
Maybe it's when modules are updated or something
Could also be, but updates only happen manually. There are no auto-updates
But I still don't get why it would have issues with cookies...
I am using forge currently for 24/7 uptime.
and I have seen some weird interactions, but all of them have been from me doing something wrong instead of a forge interaction.
That is not to say there won't be a forge interaction coming for me in the future.
One thing that I am trying to figure out currently is how to do styling for my module with the forge file structure as I can't seem to add it to the directories at the moment or point CSB to those styles
I do update modules manually often due to my other games being D&D - this a pet project ๐
There's a CustomCSS module. Just use that
do you have a link to this?
Not sure about the cookies, but it worked ๐
Uhm, nope. But should be that name in the package manager
thank you I will look into that when I get to that point.
I have been wanting to add some classes for styling but didn't have a way to do it. hopefully this will help.
Yeah yeah, it works. That's what I'm doing
great to hear
I have currently been using inline styles, but my inner web dev is screaming at me. lol
I made a system to show some checkboxes that are stand-ins for charges/spell slots depending on the class that my players choose. However, I can't get a way for it to not reset after every re-opening of the sheet. I have tried everything that I can think of, here is what I have been trying;
Hooks.on("closeActorSheet", (app, html) => {
const actor = app.object;
if (!actor || !actor.system || !actor.system.props) return;
updateCharacterCharges(actor, app);
console.log("Charges for ${actor.name} have been saved on sheet close.");
});
These shouldn't even reset to be fair... Are you changing the state via a script somewhere?
I have two, one that handles if they change levels/classes, and one that changes if they hit a button "Long Rest".
Hooks.on('updateActor', (actor, updateData) => {
if (updateData?.system?.props?.pc_class !== undefined ||
updateData?.system?.props?.pc_level !== undefined ||
updateData?.system?.props?.proficiency_bonus !== undefined) {
updateCharacterCharges(actor);
}
});```
and
```// Function to handle Long Rest logic
function handleLongRest(actor) {
if (!actor || !actor.system || !actor.system.props) {
console.error("Invalid actor data structure.");
return;
}
// Reset all used slots and charges
let charges = actor.system.props.charges || {};
if (charges.usedSlots) {
for (let slotLevel in charges.usedSlots) {
if (Array.isArray(charges.usedSlots[slotLevel])) {
charges.usedSlots[slotLevel] = charges.usedSlots[slotLevel].map(() => false);
}
}
}
// Hook to render the Long Rest button functionality
Hooks.on('renderActorSheet', (sheet, html) => {
const actor = sheet.actor;
const button = html.find('.long-rest-button');
button.on('click', () => {
handleLongRest(actor);
});
});
I'm interested in updateCharacterCharges(actor). Also, what type of Component is under the key charges?
I have passed the problem on to The Forge.. see what they say.
Here is what I go;
if (!actor || !actor.system || !actor.system.props) {
console.error("Invalid actor data structure.");
return;
}```
as for as for charges;
```// charges based on the class, level, and proficiency
const charges = game.getCharges(characterClass, level, Number(proficiency));
const mainModInfo = game.getMainMod(characterClass);```
``` //chargeData or initialize it if it doesn't exist
let chargeData = actor.system.props.charges;
if (!chargeData) {
chargeData = { usedSlots: {} };
}```
Hmm, you're pretty deep with your own stuff in there, it's hard to spot the issue at the first glance
Do you persist the changes of the charges via Document#update()?
Only mutating the Actor will not save changes in the Database
I found this in a previous post, but when I use it it doesn't roll 3d dice from dice so nice. Any way to fix that?
${#concat(?{Type|'1d20','Normal'|'2d20kh','Advantage'|'2d20kl','Disadvantage'}, ?{Modifier|0})}$
${Roll:= [:Communications:] + [:Type:] + Modifier}$
I have an actor with multiple hit points (a squad of infantry to be precise) and I'm trying to conceptually figure out how to handle damage.
I get damage as a lump sum and I want to apply this to my individual HP values one by one. Filling up one before jumping to the next with any remaining damage and so on, until all damage has been applied or all HP values are full.
For example:
Incoming Damage=25
HP1=10
HP2=8
HP3=9
I want to apply 10 to HP1, 8 to HP2 and then the final 7 to HP3.
It's been way too long since my I studied programming so my ideas on how to tackle it are very fuzzy. Could I make the Damage into an array, loop 1 point of damage from it until HP1 is full and then skip to HP2 etc?
You are hiding the roll with # sign in the beginning
Hi guys, I am thinking of set up a milestone system for the characters. Which is once a character achieve certain achievement, the character can reach a milestone and get some bonus points for attributes.
I am think about puting a list of milestones in the character sheet so players can update themselves.
Does Checkbox is a good way to do it? If so, how do I write the code?
Thanks a lot!
Hey I am trying to use the item piles module, and use the currencies I have made using this module but it doesnt seem to be working... any ideas?
it gave an example from DnD 5e that is uses actor.system.currency.gp
but not sure how to attach custom ones to it, though it does say that is possible
How can you edit the "limited" user role?
like allow it to use checkboxes for example
You can currently only set core-permissions, not CSB-specific stuff (except for template reloading and item modifiers)
what does core-permissions permit?
I want my user to be able to use the inventory system and use checkboxes, but not everything else
so no text editor
no number/text field
Go into the game-settings. It's the first setting
in which folder?
There's no folder, it's in the settings directory of Foundry when running a game
wait you mean this?
Yeah
so this is not possible?
Yep
alright, how can I disable modifiers access to players then? :(
it breaks my CSS
(shoud look like that)
Check the settings of Custom System Builder
is it a 4.x+ settings?
No, that was also present in v. 3.2
I'm in 3.0.0
Ahhh
(for now)
Well
alright, another reason to update
it's sad I can't prevent users to edit items they have in their inventory :(
Not at that version, yeah
Actually, you can make all Input Components only visible to GM and let your players only see Labels
Can't do this for names
But yeah, I did that for a lot of values
(mostly because of modifiers tho)
Can someone share a simple macro for the CSB where the user enters an amount, and that amount is applied as damage or healing to all selected tokens?
is there a way to set the actor window size?
every time I reload an actor it resizes the window to smaller than I would like, so I would liek to change that.
You probably can search up a similar solution there, because your requirements are not system-bound: https://discord.com/channels/170995199584108546/699750150674972743
how do you make items stackable?
There's no definition for that. You could implement your own logic by intercepting the creation of embedded documents in Actors, but requires some scripting
All user-defined values are stored under system.props. If you have a Component with the key Health, it should be system.props.Health
Thx
For some types of items, I have a text field that is sent to the chat when the player clicks the label button. However, when I put a formula in this text field, itโs sent to the chat without calculating the formula.
For example, if I put ${[1d6]}$ in this text field, thatโs exactly how it appears in the chat.
Is there any way to make this formula be calculated when it's sent to the chat when the player clicks the label button in the sheet that shows the field in the chat?
**
**This would help me, for example, to create items that send different messages to the chat without needing to create a new item container with different messages in the label button each time. This way, I could write the additional line of code (and text) in the text field, and it would be sent to the chat more easily.
Another question: is there a way to "reload" the template for all items at once that are already in the players' sheets? Normally, reloading the template only works on items that are displayed in the system and unequipped. Is there a way to reload all items equipped by the players?
I'm trying to display text from a Rich Text Field into the chat window as part of a Javascript, but any time I try, it doesn't work. Even if it's something like %{return "${itemEffect}$"; }%
${${!textFieldKey}$}$
game.actors.filter(actor => !actor.isTemplate).forEach(actor => actor.items.forEach(item => item.templateSystem.reloadTemplate()))
%{return entity.system.props.itemEffect}%
actor.system.props.<componentKey>
It gives me an error.
It is not working :c
Also,
Any tips to make the character sheets lighter so they load faster?
And what exactly makes a character sheet heavy? Is there any specific field that contributes to this?
Corrected
Deep dependencies and the amount of formulas increase the computation time.
What is your current setup? Can you take a screenshot of your currencies?
How can I get the index of a chosen option of a dropdown menu?
Why do you need the index of the option? ๐
lazy way to use > < instead of equalText ๐ณ , cause it would work for various cases
See what you get with game.actors.getName('actorName').templateSystem.componentMap['dropdownKey'] in the console
Thanks
How would I translate the existing active effects? Is it possible to achieve this in a non destructive approach?
They should already be localized in the statuseffect config
Where can I check that exactly? My prefered language is set to Portuguese Br and it doesn't appear localized to me
I think it was CONFIG.statusEffects
Yeah, everything is in English
Am I missing something?
Nevermind, is it localized. Turns out there are two ways to set the language. One in the main screen configuration and another in the world configuration
Just for curiosity, Is it possible to disable or remove some of the effects?
Man, I am so inept when it comes to syntax, especially with scripts.
For the life of me I cannot get the Dice Pool Wiki example to work for me.
Even changing it over to getCustomRoll() I must still have some of the parameters wrong and can't get it to perform.
Scripts are JavaScript right? Is there a good tutorial for how to define the (), ... options, etc for that call?
There's a little change for that method, it now expects some arguments. The signature is the following:
function getCustomRoll(rollKey: string, options: ComponentRenderOptions): SendToChatFunction | undefined;
type ComponentRenderOptions = {
source?: string;
reference?: string;
customProps?: Record<string, JSONValue>;
linkedEntity?: CustomItem
};
type SendToChatFunction = (postMessage: boolean, options?: ComputablePhraseOptions) => Promise<ComputablePhrase>;
Old
const phrase = await entity.getCustomRolls()[labelKey]['main'](false, {
...options,
explanation: false
});
New
const phrase = await entity.getCustomRoll(labelKey, {})['main'](false, {
...options,
explanation: false
});
And yeah, this is Javascript. You might want to look into object oriented programming
Thanks for everything you do here Martin!
I appreciate the guidance
Okay, I have fully removed all errors even warnings but CSB still throws an increasing number of loops on me
Example: Custom System Builder | All props for Share Memories (xRyBeiinslHJvsbu) computed in 1 loops.
It increases each time I reload something, and it's now up in the hundreds making the game freeze for multiple seconds
What can/should I do?
Even going +1 on the freaking healthbar kills the game!
That shouldn't be... Do you have a circular dependency somewhere? (Spotting that might be pretty hard)
Explain further, what is a "Circular dependency"?
Do you mean a value depending on itself indirectly? If so, no.
Do you use setPropertyInEntity() somewhere, which is not a Label Roll Message?
Otherwise I have no idea, what would increase the amount of computation loops after each update
Okay, so I found a workaround at least. It only seems to happen on "old" characters. As in if I changed some part of the template after their creation.
New ones work as expected
(On beta branch fyi)
Any ideas why this isn't working?
It can't be that entity.system is undefined. Where do you use the Script?
It's a script from an item being used on an item sheet, not from the actor sheet
Should still be defined. What do you get with console.warn(entity) in the console when you use this in the sheet?
Is the best way to pass any variables to a script by "const"ing a new variable to equal it?
Say for instance, I need to modify the "crit" filter on the result to match the highest face on the die rolled (say they roll d20s and d10s, and both can crit), is there a way to reference that dice size in CSB? or do I need a 'const dicesize = 'skilldie';' (where skilldie is either 20 or 10, in this example.)
Also partially relevant to the same question:
If I'm using the script-roll for a custom dice pool, if I'm using a sameRow() in the Label Roll Message to grab some parameters do I need to have that (hidden) Label with the actual message in the dynamic table too? Or what's the best way to interact with CSB&scripts in a dynamic table?
%{
const weight = '${weight}$';
const weight = entity.system.props.weight; // Basically the same, but be careful with values coming from Labels/Meters/Hidden Attributes (potentially undefined in the current computation loop)
}%
Ahh, okay, so I was kinda close!
Is labelKey just special in that it doesn't need the ${}$ like weight does in your example? (sorry, I'm like 2 hours deep into learning the scripting and still way over my head ๐ I feel like I should be paying you and recording my class credits here, haha)
// The key to our Label, which holds our original Label Roll Message.
// The Script assumes, that the Label is in the same Entity
const labelKey = 'phrase';
It's just a static key, which is defined at the beginning of the example. We don't need the resolved value.
I think I understand!
I got it working! (mostly)
I can get it to run through pretty well normally, but if I'm trying to run it from a label inside a dynamic table it's throwing up an error
I think I need to... better define the speaker entity so it looks for that stuff in the right spot, it seems? ๐ค
Just updated everything to V12 and added back all my little CSS/HTML edits here and there
still got a couple things broken
I'm not gonna work on it today but tomorrow I will may need help, just saying this to prepare yourself mentally

You probably passed undefined to getCustomRoll() or so
Yeah, there's gotta be something that grabs just fine when both labels are on the sheet, but doesn't parse properly when I shove them into a Dynamic table,
does sameRow() or lookup() work inside of scripts to make sure I'm grabbing the right stuff?
Hmm, or I wonder if it'll be easier to keep the roll label outside the table and the script inside.
If I move the label out of the table I'll have to change some things around so I can still grab the data currently being grabbed by sameRow()
I think it's best if you show what you've got
Haha, fair!
<!--Mind Roll Action-->
${#skillname:= (sameRow('player_mindskill_name'))}$
${#skilldie:= (sameRow('player_mindskill_status'))}$
<!--Rollcard-->
<h3 style=font-size:20px;padding-top:10px;padding-right:10px;><i>${!skillname}$</i></h3>
</tr>
<table>
<tbody>
<tr>
<td style="color:MidnightBlue"><b>Successes:</b></td>
<td style="text-align:right">${[${player_mind}$d${skilldie}$cf=${skilldie}$cs<4]}$</td>
</tr>
<tr>
<td style="color:Green"><b>Criticals:</b></td>
<td style="text-align:right">crittext</td>
</tr>
<tr>
<td style="color:DarkRed"><b>Failures:</b></td>
<td style="text-align:reight">failuretext</td>
</tr>
</tbody>
</table>
%{
const labelKey = 'Mind_Roll';
const phrase = await entity.getCustomRoll(labelKey, {})['main'](false, {
...options,
explanation: false
});
const rolls = Object.values(phrase.values)[0].rolls;
const results = rolls[0].roll.terms[0].results;
const crit = results.filter(function(result) {return(result.result == 1);}).length;
const diemax = '${(sameRow('player_mindskill_status'))}$';
const failures = results.filter(function(result) {return(result.result == diemax);}).length;
phrase._buildPhrase = phrase.buildPhrase.replace('crittext', crit);
phrase._buildPhrase = phrase.buildPhrase.replace('failuretext', failures);
const speaker = ChatMessage.getSpeaker({
actor: entity.entity,
token: entity.entity.getActiveTokens()?.[0]?.document ?? null,
scene: game.scenes.current
});
phrase.postMessage(speaker);
}%
So, the actual variable still need cleaning up, but this interaction works when I've got both labels just sitting fine in a sheet, (well, except the sameRow()s, obviously)
Its when I add them into a dynamic table to get those sameRow() parameters that the script then breaks in the getSendToChat
ohh, I messed with the Script there, I was using a passed-through ${skilldie}$ down in the diemax but started messing with it when it didnt work to test if sameRow() worked in scripts
I feel like I'm trying to do two things a specific way that only one works.
If I move the skillname/skilldie off onto a lookup() with a User Input Prompt, I feel like I could get them to talk to each other
I've never seen someone using a filter-function this way...
This is how it's normally done: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Items
The sameRow() should work if your executing Label is inside a Dynamic Table
That... filter was stolen from RadLad's dice pool, ๐ it seemed to work well enough so I didn't start messing with it
Cause I was trying to set the exact parameters to filter, and his was pre-composed for exactly that, lol.
and it did work... under very specific situations ๐
but I see where it can be cleaner, maybe better
And you can keep the roll template outside of the table. You'll need only 1 instance of it anyway
Yeah, if I move the skilldie fetch (the dice size) from a sameRow() to getting it from a user input prompt, I can stick that label anywhere
Eh, you know that the roll template is literally just a blueprint? The formulas will be resolved by the executing Label (which also contains the sameRow-context).
I do, but I need some way for the player to choose which skill they're rolling, because the size fo the dice in their pool will change.
Originally, sticking both the roll and the script in the dynamic table seemed best because then every skill just has a little roll button, triggering the script to trigger the roll label which can just sameRow() that info.
if I'm moving the roll label outside the table, there needs to be some way to select the right skill to roll... I'm seeing user-input?
Unless... the script label inside the table can pass that information out to the roll label...? ๐ค
Wait, your script is already handling the execution of the Label Roll Message
... yes...
The Label with the content of the Roll is literally just a blueprint, there's no reason to roll from that directly
Correct, but you gotta have that label hidden somewhere to trigger right?
And that label is grabbing a variable from a dropdown in the dynamic table to determine the dice size. Which it uses to make the roll, and passes to the script to use to determin crits/failures...
right? ๐
That Label with the Roll content cannot grab anything as long as you don't execute it (which you don't, because a different Label with a Script grabs the content and executes it)
mmmmmmmm
Martin, I love you.
Never before have I been so turned on by being made to feel like an uneducated child ๐คฃ
I think I'd be better served to just continue pushing on actually learning the language rather than trying to find what I need and piecemeal some kind of gibberish spanglish out of it just to get what I want done.
I'm running into walls I don't even know exist, lol
Well, you picked the hardest example of the Wiki ๐
You might be better of starting simple and trying to progress one step at a time
Maybe my need would be better served finding a way to roll 1dX and looping it as many times as I need for the pool ๐
Hey! Nobody asked for things like logic or rational approaches in here! haha
Suuuure. You could also try to adjust our parser, so that it can handle custom asynchronous functions. That might be a real challenge ๐
is there a way to make initiative roll a d10 plus whatever would add to that instead of a d20
CSB has a Initiative setting in "configure settings"
Simply link it to whatever calc you need
Sure, my formula for example [2d10]+ini where ini is a attribute from the character sheet.
Hello everyone!
I'm trying to make a button, that will add +1 to the Skill. How I do that?
Trying to setPropertyInEntity, but that not working much.
It's the right solution though
How did you do it?
setPropertyInEntity('self', lookupRef('attributes', 'base_value', 'name', 'dexterity'), "min(first(lookup('attributes', 'base_value', 'name', 'dexterity')) + 1, 0)")
It looks pretty good, can't spot an issue in there
See if lookup() and lookupRef() return something. You can wrap them with consoleLog() and spectate the log when executing the Label Roll Message
It worked when I done that
setPropertyInEntity('self', lookupRef('attributes', 'base_value', 'name', 'dexterity'), lookup('attributes', 'base_value', 'name', 'dexterity') + 1);
I'm using item piles and filtering out CSB items that are skills/spells etc. The easy way to do this is to create a label and give it a name. (example filter, system.props.lableKey:abilities) is it possible to just do the same thing in the hidden attributes? I tried but didn't seem to work.
Hey, can I update to V12 and then just update the CSB, keep my worlds or how is it gonna work?
Yep. Just do a backup prior
What is your item filters with the hidden props?
Everything works fine with item piles. The question is more about how hidden attributes work. In the image, the left circled is what I'm doing now. Its a label hidden to players that item piles filters perfectly. Mostly curious if it was possible for the hidden attributes (right circled) to be configured similarly, just... hidden lol. I don't know how to set up the formula box because there isn't a formula really. or maybe there is and I don't get it.
No big deal either way, was just curious if it was possible.
Hidden Attributes work the same way as Label text (just hidden, lul)
How would I setup a hidden attribute the same as a label keyed itemType with the text as "innate" Whats the formula? I tried the above, with ${}$ and got an error. Let me guess, I'm missing quotes? I always mess those up lol
Yours is already correct
A formula is optional
Ok it does work. Sometimes I have issues with a script that is supposed to mass update items/tokens/actors etc. i think that was actually the issue. Redropped a fresh copy of a token(item pile) and works fine. smh thank you for helping to clarify that lol.
Is there any way to script all values from dynamic table to show them on other page? Or I need to create them by hand?
I think the devil is hidden in the detail. Especially the detail , which entries of the Dynamic Table should be considered and how it should be displayed
I will explain.
Just want to make a fancy-looking for attributes and skills, that related to them, but there's just 1 change between each attribute. Is CSB able to iterate on Dynamic table and reuse code, or I need copy-paste it by hand?
If you want reusability, then you'd probably need a second Dynamic Table (2 columns: attribute name like "Charisma" or "Strength", Label with the lookup-formula you have + a sameRow() to fetch the attribute name)
Undestand. Thanks!
Unrelated question. What is the 1st attribute in the screenshot translated to english?
Vitality
I see, thx
I'm facing a wall right now, how can I edit the CSS of this particular input text?
I just wanna apply a simple margin-left
there's no places to add a class
and using .perktechnique or .perktechnique input doesn't work
Click on Advanced configuration and enter your CSS-classes as barewords (without the dot)
I added "test" and then added in my css:
.test input { margin-left:10px !important;}
didn't detect my class when I inspect it
nevermind it works now
Why is it always like this
๐ญ
Thank you
np, Kohai
Just saw you can sort table categories, how do you reset this?
๐
? :(
is it not possible ?
It's like a Radio Button. Once selected...
Possible with a script and it's client-side only, so others won't see it
any way to make the sort server-side?
uh, no
:(
<p>${setPropertyInEntity('item', 'Equipped', '${item.Equipped ? 0 : 1}$')}$</p>
this doesn't work anymore since v12 and 4.1
I checked and it's not deprecated
any idea why?
it's a check
You should set it to true or false
oh 0/1 doesn't work anymore
I see
I'm coming from 3.0.0 so lots of things to learn
Yeah, many things changed
I see, remove the throw-part ๐
oh right there's a button for that now
Updates with setPropertyInEntity() are deferred, until the whole phrase is parsed
I wanna sort items based on if they're equipped or not, making equipped item on top, I set this but it doesn't seem to work
it's the component key
It works on my end
And I spend several days to ensure that it works that way ๐
That is an Item Container... You sure, that your pseudo-checkbox has the value true or false? ๐
well it works to check it/uncheck it
Yeah, but the state is saved in the item, not in the column of the Item Container. The column data contains an HTML-tag
which value should it be then?
Something like <i class="fa-regular fa-square-check" style="color: green; background-color: white;"></i>
And yeah, that is technically a value if that is inside the Label text
If you want it easier, just select ASC or DESC-sorting. You have only 2 distinct values anyway
What does it change?
I tried <i class="fa-regular fa-${item.Equipped ? 'square-check' : 'square'}$ " style="color: green;"></i>
doesn't work :(
Don't forget that the final value has resolved formulas
I tried <i class="fa-regular fa-square-check : 'square'}$ " style="color: green;"></i> too
That's still not completely resolved
Whatever, just use ASC/DESC-sorting. Easier anyway and you don't need to specify a value for those 2
Only a column-key, but that seems to be correct already
it still asks for a value tho
It shouldn't?
Doesn't ask
i've set this but it still doesn't react when I check
oh
I get it
it's not asking for the component key
it's asking for the checkbox key
๐ญ
Ah yeah, I forgot that ๐
Sorting came before Item Containers even had their own data like Dynamic Tables
Thx
I have a meter meter_life I want to reference its Value and Max fields in another module, is it possible to achieve this with props.meter_life? Something similar? Or should I create individual fields to hold those values? I imagine this would work as well
Some weeks back my 'Custom system builder' system worked like a charm - now suddenly it only show this on all sheets and it seem that the system is not correctly installed as it doesn't show up in the configure settings. I have tried to delete browser cache and cookies and it worked the first time, but now it doesn't work. Need some help to get this system back online/delete my system settings on the server so i can import my back up or something. Please help, my players are about to string me up in the nearest tree ๐ It also happen if I create a blank world with 'Custom system builder'.
What's the error in the console?
when players own an item there is something in the page that changes that adds itself and breaks a little the css, any idea why?
(left is owned, everything is ok / right is not owned, css is a bit too high)
There's a difference? ๐
Dunno, I don't even know where I should look after
If you're making a ? statement based on a dropdown, what's the parameter for if they didn't select anything in the dropdown (empty)?
is it 0? 'False'? I had it on the tip of my tongue and knew it like 4 weeks ago but have totally lost it, lo
so like for "false" here:
tool_use:= tool_choice == False ? 0 : 1 or similar
Empty string:
${equalText(tool_choice, '') ? 0 : 1}$
ahh! lit, that was it. Thanks.
I just could not remember and it felt like I needed something like 0 or whatnot in there
And just to confirm, since it's been like a year since I last asked,
There is currently no way to display dice faces in CSB like the default Foundry Multi-Roll cards?
You can. You just have to use a script instead to trigger a roll via the Foundry API
Haha, I was just pulling up that page!
Mmkay, if I'm passing CSB variables to a script to build a dice,
const t1 = new Die({number: 4, faces: 8};
if I want to reference those variabes for the number and the faces... How do I get that data in there?
Would it be better to come at it with a fromData rather than constructing it for a fromTerms?
Okay, I got that working, now to get it to actually roll properly ๐
Why doesn't this work?
Ah, sry. I think it's sameRow('id') instead
Or the little Script
I am a bit at my wits end and hope that someone is able to help me with this. I am currently using a Item Displayer where the final field calls a macro like so:
%{
return game.macros.getName('Get Action Summary').execute({
isCollapsed: linkedEntity.system.props.mcdm_action_collapsed,
title1: linkedEntity.system.props.mcdm_action_extra_effect_title_1,
text1: linkedEntity.system.props.mcdm_action_extra_effect_description_1,
title2: linkedEntity.system.props.mcdm_action_extra_effect_title_2,
text2: linkedEntity.system.props.mcdm_action_extra_effect_description_2,
attack_type: linkedEntity.system.props.mcdm_action_attack_type,
description: linkedEntity.system.props.mcdm_action_description,
tier1_melee: entity.entity.system.props.mcdm_kit_melee_low,
tier2_melee: entity.entity.system.props.mcdm_kit_melee_mid,
tier3_melee: entity.entity.system.props.mcdm_kit_melee_high,
tier1_ranged: entity.entity.system.props.mcdm_kit_ranged_low,
tier2_ranged: entity.entity.system.props.mcdm_kit_ranged_mid,
tier3_ranged: entity.entity.system.props.mcdm_kit_ranged_high,
rollType: linkedEntity.system.props.mcdm_action_roll_type,
tier1_extra: linkedEntity.system.props.mcdm_action_low_text,
tier2_extra: linkedEntity.system.props.mcdm_action_mid_text,
tier3_extra: linkedEntity.system.props.mcdm_action_high_text,
tier1_type: linkedEntity.system.props.mcdm_action_damage_low_type,
tier2_type: linkedEntity.system.props.mcdm_action_damage_mid_type,
tier3_type: linkedEntity.system.props.mcdm_action_damage_high_type,
tier1_damage: linkedEntity.system.props.mcdm_action_low_damage,
tier2_damage: linkedEntity.system.props.mcdm_action_mid_damage,
tier3_damage: linkedEntity.system.props.mcdm_action_high_damage,
cost: linkedEntity.system.props.mcdm_action_cost,
distance: linkedEntity.system.props.mcdm_action_distance,
target: linkedEntity.system.props.mcdm_action_target,
keywords: linkedEntity.system.props.mcdm_action_keywords,
type: linkedEntity.system.props.mcdm_action_type,
trigger: linkedEntity.system.props.mcdm_action_trigger,
use_kit: linkedEntity.system.props.mcdm_action_kit,
})
}%
You can see the result of the macro in the image. However, this results in 3 'some props were not computed' warnings, with all the uncomputed props being this field in the Item Displayer. In the end, it takes 3 whole loops to compute all the props. Which all in all results in a rather laggy experience using the character sheet whenever anything changes.
I thought it was because the macro itself is rather complicated, but the same occurs if I make the Macro immediately return a preset value. Does anyone have any idea what can cause this?
Ok, that are quite a lot of fields. Just to make sure, do you use the Script in a Label Roll Message?
And execute() is async
It script is placed in the Label text field, as as far as I understood, the Label Roll is specifically for putting things in chat, although I could be wrong.
...I just realised I did indeed completely read over the warning in the Guide that says execute is indeed async... darn. I hope there is a way to make them execute synchroniously
Nope ๐
I mean, you could place the content of the Macro into the Script. That would work
But you also have to take into consideration, that certain values are potentially undefined, because they didn't go through the computation yet. With entity.throwUncomputableError(message, source) you could instruct the system to wait for the next loop if you spot undefined values. Or use nested Formulas, which handle that automatically
Good to know, I indeed saw that in the wiki. Got to be careful with null checks. The fact that I was returning a promise was indeed the issue, as just placing the entire script in the field did fix it. Bit of a bummer as it makes it less reusable between different sheet types since I now got to remember to place the newest version of the script in each one every time I make a change, ah well. I am already happy it isn't frantically looping until the promise is ready anymore.
Thanks for the help ^^. I was afraid I was being a bit to extreme with having a big script run inside the Item Displayer and had to scratch the entire idea.
I think you could make a function and save that somewhere and just call that
But don't ask me about the details, would also be my first time in this direction
Smart idea, I could probably experiment with that a bit. I am already running a personal module to extend functionality where CBS can't so I can just add a global function in there.
Actually, I think you can just append math-js with your custom function and you would be able to use that even in a normal formula
I just got one question left. Does CBS recalculate/recompute all items an Actor has when the Actor's props change? Say I move the script logic to display the item summary to the item template itself in the Item Displayer and remove any logic that requires some actor fields and just do the old ${item.summary}$, would that result in the item script not being re-run whenever I edit some fields in the actor as the script now doesn't require fields from the actor?
I think it still triggers a recomputation for embedded Documents
Alright, then I won't bother doing that, it would be quite an undertaking ๐
Thanks for all the help ^^
Np
Helloo, I am using CSB to make a new system, and I was wondering if there is any way to attach behavior to both start of encounter and on player turn start?
I found the custom initiative formula, and I have that set, but that's all I could find
To give context, I am making a 5e-esque system and I have actor properties detailing actions, bonus actions, reactions, and I would like to set these to full on the start of initiative and start of turn. I currently have a button that does the same thing but would like to link it to Foundry's inbuilt encounter system
thanks! Where do I register the hooks? Just anywhere on the actor page?
Thank you so much for this! It should seriously be pinned.
As an addendum though, the components on items and actors need to be Number fields. (spent two days figuring this out ๐ญ )
Ok following up on this, how do i access the CSB component fields from the foundry API?
Trying to achieve behavior where 'current_stamina' and 'max_stamina' are both component keys (see pseudocode below)
actor.update({'system.props.current_stamina': actor.system.props.max_stamina});
Hello i would like to know, how i can program 3 buttons on my charctersheets
the buttons should contain:
Disadvantage Roll: 1d6 a 5 or a 6 on the die is a success
Normal Roll: 2d6 if a 5 or a 6 is on one or two dice its a success
Advantage Roll: 3d6 a 5 or a 6 on one or two or three dice is a success
The rolls should get transferd to the chat.
thx for your help
Hi. I have issue with using number field and setPropertyInEntity . If i change number in field then setPropertyInEntity command just dont work. But if i change another template and change it back then all starts working
The way I'm doing it its to formulate the roll, count the successes then do something with the result. IE: Disadvantage ${myRoll:= [:1:d6:cs>=5]}$ counts successes on a 5 or 6 on one die. ${myRoll:= [:2:d6:cs>=5]}$ or ${myRoll:= [:3:d6:cs>=5]}$ then test for the number of successes needed. So for Normal and advantage you are good as long as one success is rolled. Should have added that your buttons would be labels and the code goes in the label roll message.
For the "modifier" to count successes or something else see https://foundryvtt.com/article/dice-modifiers/
The official website and community for Foundry Virtual Tabletop.
I hope this helps ๐
Example: since each of your rolls require only one success, this should work just sub in the number of dice: ${name}$ Rolls Disadvantage ${myRoll:= [:1:d6:cs>=5]}$ resulting in ${myRoll>0 ? 'success!': 'failure'}$
Thx the biggest part worked, now i would like to have the roll in the chat and not with this icon and this special message? ๐
You need to use either a '#' ot a '!' in front of myRoll. the '#' hides the roll and the '!' just shows as text. So: ${#myRoll:= [:1:d6:cs>=5]}$ hides the result and ${!myRoll:= [:1:d6:cs>=5]}$ will just give you a text result.
if I understood you correctly ๐
Nice, thanks alot, we are really close, i would like that the text 1d6cs=5 isnt visible, is there a way?
or isit only visible for the gm?
what is the code you have for the roll?
${!myRoll:= [:1:d6:cs>=5]}$
ok, so the ! turns it into text. what you can do to hide it is use # then follow up with something to display the result like ${#myRoll:= [:1:d6:cs>=5]}$ ${myRoll}$
now i have only a 0 for failure and a 1 for a succses, i would like that it shows the dice
sorry for the complication and thanks for the patience
Unfortunately , that's beyond me at the moment. I'm doing something similar with exploding dice and I just live with not using ! or # so players can click the icon button and see the dice.
sorry
it works for what I need and I just tell the players to ignore the gobbledygook and look at the little squares ๐
ah okay, thank you alot you brougth me a lot further ๐
Glad to help!
in the same vein, how would one keep a JS roller form outputting to the chat window.
To implement my rolling method I have to use a JS script to build the roll as it needs to build an array of exploding dice. each die has to explode individually and then check against a Target number to determine successes. This is the code I am currently usinng to do so.
const val = html[0].querySelector("#num-of-d6").value;
const target = html[0].querySelector("#target").value;
const formula = `{${Array.fromRange(val).map(i => "1d6x").join(",")}}cs>=${target}`;
return new Roll(formula).toMessage();
This outputs to the chat the array. I would like ot have that look less technical or not output the array at all.
After searching and a bit of testing on my end, also assuming your script is inside %{..}% then something like ${#%{.. code..}%}$ should hide any output from the script. Note: I only got it to work if the ${#%{ part had no spaces, but maybe i've not had enough coffee...
I searched and couldn't find the answer here (based on keyword search) and in the documentation as far as I could tell, but I'm sure I missed something. How do I reference a dropdown list choice in a visibility formula? What does it return? I tried 'choice' is true but that didn't work.
equalText(dropdownKey, 'choice')
awesome thank you!!
This does not work, does the element have be placed on the actor root?
or should it work regardless of where the component is
It has to be in an Actor and not in a Dynamic Table or Item Displayer.
You can log the actor to make sure, that you target the right props
ok cool after looking into how to debug got everything working, ty
I'm trying to pop up a dialog for some user input containing 2 fields as follows ${#concat( ?{testval:maxpump[text]|"0"}, ?{luckyD:"Use A Lucky Dice?"[check]} )}$ wich generates the following error when the dialog is closed (see pic). If I separate the 2 elements out as in ${?{testval:maxpump[text]|"0"}}$ ${?{luckyD:"Use A Lucky Dice?"[check]}}$ it works without the error, but I get 2 dialogs. Anyone know why the separated elements work, but the concatinated throws the error? Thanks in advance. Edit: maxpump is a string which is built before the dialog, but replacing it with a fixed string still generates the error.
It probably doesn't like the newlines
hmmm. doing the following removes the newlines from the error, but still generates the error:${#concat(?{testval:maxpump[text]},?{luckyD:'Use A Lucky Dice?'[check]})}$ Same error, just no \n's in the message.
Then surround the dialog-parts with string()
Thanks! doing ${#concat(string(?{testval:maxpump[text]}),string(?{luckyD:'Use A Lucky Dice?'[check]}))}$ seems to have worked (putting it here for anyone else meeting this error).
I wanted to know if its possible to get rid of the "see hidden attributes" and "see attributes bar"
You should be able to hide them with some CSS I think
This is a free website for learning CSS and how to use it. I highly recommend that anyone starting to learn take this course. You don't have to go past the first module, Responsive Web Design- to learn what you need to learn. You can go further if you want to learn more about other technologies like JavaScript and so on, but I only recommend module one if you wish to know HTML and CSS.
Say I have a label with the key 'roll_arcana', is there anway in its roll message formula to retrieve the key ?
Nope, there's no context-data for self-reference like this
any suggestions if I have a skill list but I do not want to manually enter the roll formulas for each them?
Dynamic Table
ok
You only define column-data, so that each row is handled the same way
is there any way to pre-enter data in the dynamic table?
Yeah, you can create predefined rows in the Template
Hi.
I want to use the fallback value of the fecthfromactor:
${equalText(fetchFromActor('target', ref('latt_cib'), 'QUED'), 'QUED') ? 'ko' : 'ok'}$
In my case, latt_cib is set to empty string ('').
So i except the fetch to return 'QUED'.
Which i compare with 'QUED'
So i should get ko, no ?
This formula will fetch the value of latt_cib from the current Actor and pass the result to the target-actor, which will try to resolve the result
And if it can't resolve it, it returns the value of 'QUED' of the target actor ?
I'd need to check for which cases exactly the fallback-value applies, but it might be.
Thank you.
The fallback value is a sort of second choice if the first one doesn't return something.
Or if the actor context couldn't be found (e.g. no target)
Strange because the wiki says:
The value to return if the referenced actor couldnยดt be found or returns no value.
Returns the value of the field which has the key pointed by valueRef, or fallbackValue if valueRef does not point to a valid field.
When i test ${equalText(fetchFromActor('target', "name", "pouf!"), "pouf!")}$
- if i have a targeted token it says true.
- if not it says false.
Is there a way to use a custom character sheet for players
My 2 cents with my test-gatling:
${#a_une_cible:=not(equalText(fetchFromActor('target', "name", "notarget"), "notarget"))}$
${a_une_cible ? "true" : "false"}$
<br />
Test: token selected ?
${#est_selectionne:=not(equalText(fetchFromActor('selected', "name", "noselected"), "noselected"))}$
${est_selectionne ? "true" : "false"}$
<br />
By reference:
${nom:='name'}$
Test: is there a target ?
${#a_une_cible:=not(equalText(fetchFromActor('target', nom, "notarget"), "notarget"))}$
${a_une_cible ? "true" : "false"}$
<br />
Test: token selected ?
${#est_selectionne:=not(equalText(fetchFromActor('selected', nom, "noselected"), "noselected"))}$
${est_selectionne ? "true" : "false"}$
<br />
Test: variable exists ?
${#variable_existe:=%{return entity.system.props.mavariable !== undefined;}% ? true : false}$
${variable_existe ? "true" : "false"}$
<br />
Test: the field exists on the target or on the selected token ?
${nom:='name'}$
${#champ_existe:=or(not(equalText(fetchFromActor('target', nom, "nofield"), "nofield")), not(equalText(fetchFromActor('selected', nom, "nofield"), "nofield")))}$
${champ_existe ? "true" : "false"}$
<br />```
Hi, would it be possible to change an item's color based on a "rarity" label set in their sheet?
I tried using the "rarity color" module but it doesn't work with CSB
(more info here)
I have this for a label roll message but it's not hiding the the prompt result. In chat I get 1d200 when I give modifier of 0 then below I get the actual roll. Any fixes?
${#concat(?{Type|'1d20','Normal'|'2d20kh','Advantage'|'2d20kl','Disadvantage'}, ?{Modifier|0})}$
${Roll:= [:Type:] + Modifier}$
I think something else must be adding in the extra zero somewhere else. Perhaps a module or some code elsewhere? I say this, because I just plopped the code you gave into a label roll message and it worked fine. I also tried initializing Modifier before your code and it also worked fine just to ensure Modifier had a value going into the pop-up like:${#Modifier:=0}$ ${#concat(?{Type|'1d20','Normal'|'2d20kh','Advantage'|'2d20kl','Disadvantage'}, ?{Modifier|0})}$ ${Roll:= [:Type:] + Modifier}$
Note: using Foundry 12.331 and CSB 411 with Dice So Nice. I can enter 0, negative and positive values or nothing at all into the Modifier field and the math works.
so i need to call values from an item displayer table. What line of code would i use to do that and is there a way to select a specific item using this code as a qualifier?
<i class="fa-regular fa-${item.Active ? 'square-check' : 'square'}$" style="color: ${item.Active ? 'green' : 'red'}$; background-color: white;"></i>
Can I create a kind of Fate Point? Like Bene from Savage and such, for the players?
Still waiting for a heads up on this one 
found out using html code can affect name color but I can't find a way to hide the html code on the name of the item
Ok thanks, yeah it was working before and now it's doing that. I'll look through the recent modules I've installed for problems.
Hello, a stupid question - I created a very simple way to make an actor auto-roll a saving throw using a chat extension, which is:
[[ceil(1d20 + ((@{target|con}- 10) / 2) + @{target|con_mod})]]
The issue is, if a player attacks an actor that they have no ownership (Not Limited/Observer), the system cannot see the "con" stat and the calculation is simply pasted into the chat instead of calculating the roll. I don't want to give Observer ownership to actors that my players haven't met yet, but I know I will forget to give them visibility later and it will create issues in the long run.
Is there a way to go around it, or will I need to experiment with fetchFromActor?
Trying and failing to do a simple roller for Jackals, a great Osprey game which suffers from the same lack of VTT stuff as other print-only publishers. I've got "craft" set as a Label which gives the roll message Craft <p>${roll:=[d100]}$</p>. But I'd like that to lookup the "craft number" field and see if the d100 is lower than the value, in this case 30. Can I do that with Number Fields or am I barking up wrong tree?
Roll: ${roll:= [1d100]}$
Is lower? ${roll < craft_number}$
fetchFromActor() is able to fetch values from Actors, where your players have no permissions set for.
So that's the only way - well, back to the pit of gritted teeth I go, thank you
Thank you kindly Martin. Can I use โค for less than or equal to? It's not my strong suit but enjoying all the cool sheets everyone else is making. Never mind I found the correct operator <= ๐
You can either perform a lookup() on the displayer like on a Dynamic Table or you use a little script to fetch the necessary data: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Items#1-scripts-for-fetching-values-of-specific-items-in-an-actor
I don't know what you mean with that. CSB is a template-based system, meaning that you need templates for sheets to work, because these define how your sheet should look like.
Hello. I'm starting a new campaign and think is a good moment to upgrade to new versions. Does the last version of the Custom system builder work with the new foundry 13? Is there any potentially breaking changes since version 3.2.5?
Hello, I am still on 3.2.5 and have encountered an issue where the character sheet progressively has a harder time to update values. What I mean by 'progressively' is that this is my 5th iteration on my character sheet, and somehow the formulas update worse and worse.
For example, I have a very simple link between my item's weight (using an item modifier) to connect to a label on the sheet. That works fine, however as soon as I extend the link by using the value of the label in a different label (which I have to do because a modifier only takes the one key) it does not update until the sheet is manually refreshed, which is also impossible to do from the player's side.
Thing is, it didn't use to be like that and I was previously making even longer chains of labels and other components. Does FoundryVTT or CSB use some kind of caching of sorts? Its the only explanation I can come up with for this issue.
Here is a demonstration of my issue. (Also, not sure if its relevant, but each item on my character sheet takes 2 loops to compute, plus another loop if an item's value is updated, and my character sheet itself only uses 1.)
CSB works with V12. We haven't tested V13 yet. And yeah, there are breaking changes (check the README for more info)
It should be better in later versions, but given the complex nature of crossdependent values, there might still be uncovered bugs in the computation-loop
Dang so I have to transition my project again? Oh well, thanks for your hard work by the way.
Ok, using the nonbeta version. Fixed one forgotten fetchFromDynamicTable and everything seems to work
I have one last error in what is probably a design mistake from my part
In a item template, I have these formulas
They throw an error since there is no Actor yet until the template is used in an item and the item dropped in an actor sheet. Is there a better way to do it?
Couple of quick questions - do we know if Active Auras work with CSB? When trying it now nothing shows up in the token settings.
Also, is it possible to add a status effect icon to a token when equipping a certain item? I can see how to do it in a slightly roundabout way of it updating keys in the actor that then triggers a script for the icon, but thought I might be missing a simpler way to add the effect to an item by itself.
Ah, one more: is it possible to add actors to a sheet in the same way as an item list? To have passengers in a vehicle for example.
Define a fallback-value
- Dunno, never worked with that
- You'll get easier options for that with the next patch (Active Effect Displayer)
- You can create links in Rich Text Areas by dropping them there. Or you create a Label, which fetches the Actors and shows them in a list. Besides that, nope (if you don't plan to create your own Component)
Thanks, working fine now
Ok, thanks! Might try out a custom component in the future perhaps. But good to know for now.
Something else just occured to me - can I define the duration of an active effect in CSB somehow, or would that be a script with a hook to disable/remove the effect?
The TimesUp module does that automatically if you have a defined duration in the Active Effect
Hmm... but where do I define the duration? I can't find it in the Configure Active Effects window.
Turns out I am stupider than I thought
I've created this incredibly simple fetch:
[[ceil(1d20 + (${fetchFromActor('target', "wis")}$ - 10) / 2)]]
What it should do is roll a 1d20, then add the targeted token's "wis" attribute + math.
However, no matter what I do, it doesn't. It either rolls a 1d20 and nothing else or it outputs a flat 0, regardless of the dice roll.
I really don't know what to do with it, can I ask for help?
you could test this
${dice:=[1d20]}$
${wisd:=fetchFromActor('target','wis')}$ (if you thrown dice from token) or ${wisd:=wis}$ (from caracter sheet)
${Result:=ceil((dice+wisd -10)/2)}$
if is from caracter sheet you could use directly wis without ${wisd...}$
@rapid hare
Seems like there's no luck, it just shows the formula now
I'm throwing it from an item sheet, it's an Item that targets an enemy and pulls the target's attribute (from their character sheet)
I don't know if this needs to be a label, a text field, a rich text field or something else
for me the target attribut is a "number field" with the label wis. So you could use ${wisd:=fetchFromActor('target','wis')}$.
Still the same thing, just outputs a chat message, but I think I figured out what the isuses
My attribute is a number field, but the ${formula}$ is a Text Field instead of a Label. I made it a Text Field so that I could easily swap the "wis" to any other attribute I wanted, on a per-item basis, but it doesn't pull a thing. If I put it directly into the cast, it works as intended.
Is there a good way to go around that and have an easy, selectable "attribute picker", or am I doomed to make a thousand templates?
I'll be honest, my knowledge about all this is really low, I'm still trying to figure that ref() out with the wiki documentation
If you have a formula in a text field and want to resolve that in a Label, use recalculate(textFieldKey) or just ${${textFieldKey}$}$
I've been trying these, but it either doesn't add the attribute, or it makes the whole roll a 0, and usually, if I put ${${Double Formula}$}$, it just stops working altogether and outputs plain text
Then open your console with F12 and check the error message. That's better than trying stuff blind
If my console gave me any errors, I'd be REALLY happy. The issue is, it shows "All props for X computed" and nothing else.
${fetchFromActor('attached', "first(lookup('inv_munitions', 'AMMO', 'name', '9mm Magazine'), 0)")}$
still doesn't work in 4.1.1
How about this?
[[1d20 + ${!fetchFromActor('target', "wis", 0)}$]]
Open the config form of the item displayer and save it. It might be, that the Component needs to be saved again.
same error, I opened this and just clicked "save" then updated the sheet and item
game.actors.getName('actorName').system.props then and check if the item displayer has props you can use.
I don't really get where I'm supposed to place this
is it because the value is named "muns" in the inv_munitions tab wherehas it's noted as "AMMO" on the magazine sheet?
yup
it was that
I thought it could retrieve the data from the item sheet itself
Nope, column data and item data a different
I can only retrieve column data this way?
This way, yeah. Otherwise you need a script
alright
I'll figure out something around that
thank you!
also I tried the "item_id" but it sent an error, is there an easy way to get the ID of an item automatically directly from their sheet? (like retrieve it from a label)
I tried this
${fetchFromActor('attached', "first(lookup('inv_munitions', '${item.id}$', 'name', '9mm magazine'), 0)")}$
oh "id" worked
how could I add a condition that the item has "loaded" as true? (it's a checkbox)
I tried this:
${test_load ? ${fetchFromActor('attached', "first(lookup('inv_munitions', 'muns', 'name', '${ammo_type}$'),0)")}$ : 0}$
and then adding this at the bottom called "test_load" :
${fetchFromActor('attached', "first(lookup('inv_munitions', 'loaded', 'name', '${ammo_type}$'),0)")}$
but it did not work
The first one has a syntax error. You have no conditional check there without the ternary-operator
Hi.
Is it possible to make the roll in a chat message private or blind, as selected in the chat options of the player ?
Sorry it's a matter of Dice so Nice because the results are well hidden.
Still nothing, but now that I'm a bit less frustrated, I'll briefly explain how I wanted it to work - maybe I made a mistake elsewhere.
- There is a button called "Use" that triggers a Label Roll - it's just flavor text and image 1
- c_roll is "Caster Roll", a text field that uses the simply "Fetch stat from caster" - it works
- e_roll is a label on the bottom - it takes data from "e_roll_calc", or the "Enemy Roll" text field. I remember that Formulas like Labels the most, so I made this "hack" of sorts
- When I press Use, everything works as intended, except for the e_roll, which just outputs a chat message
Fresh to the Foundry server and already diving straight in; currently working on building up a CSB template set for Celestial Bodies: Titan Edition, despite the fact that any code/function beyond Microsoft Excel's =SUM fries my brain at the mere sight
Any shortcuts to get number cells and checkboxes to interact with each other with minimal code? The current stage is to have a number cell to increase its maximum value by 1 if the checkbox adjacent to it is indeed checked
${... + (checkboxKey ? 1 : 0)}$
Oooh, quicker response than I ever expected
Will give it a go when I'm back at the computer
Hello i'm trying to setting up hp for the character, they have like 4 stat (from 1 to 100), the hp is the value of the stat divide by 10 round down + other formula for each stat. I tought about using the hidden attribute to calculate the hp, its my first time using a custom system, how to you use the value of a number field?
And is there a way to make a label clickable? Like one the the stat is Body, and i want to make it that if someone click on it then it roll a d100 and if it is under the body attribute it pop up a success message
#package-releases message
Hi everyone ๐
**Version 4.2.0 is now generally available, with the following changes : **
Features
- Added new Component
ActiveEffectContainer - Added function
find(), which does the same asfirst(lookup(...)) - Added more Icons in component config for easier indication (e.g. if a field allows formulas)
- Added Effect Change Data-handling of Active Effects
Fixes
- Fixed a bug, where 'See hidden attributes' was missing in Items
- Fixed deprecation warnings
- Fixed Label message style to In Character
- Fixed Item Displayer computation system to compute name and id even if no other column is present
- Fixed performance issue in function importation
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
Whenever you define a Label Roll Message in a Label, the Label becomes clickable.
For the Roll-Formula part:
${roll:= [1d100]}$
${roll < body ? 'Success' : 'Failure'}$
Check the Wiki to see how Formulas work: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
I see what you did. Remove the [[]] from your Text Fields and make sure, that only Roll Formulas like 1d20 are surrounded with []. And also make sure to not use @, the key name is enough in formulas. You should also remove ${}$ from the Text Field.
c_roll
ceil([1d20] + (dex - 10) / 2 + dex_mod)
e_roll
[1d20] + fetchFromActor('target', "wis", 0)
Label Roll Message
<br>
Caster's Roll: ${${!c_roll}$}$
<br>
Enemy's Roll: ${${!e_roll}$}$
<br>
I created a table roll from a compedium (which I created from a folder of items). When I roll it, although the dice roll works, it displays null as result in the chat. Is there a way to fix this?
It probably cannot resolve the own reference when it's in a Compendium. If you want, you can create a bug-report in GitLab
Thinking, what I ought to do is diagram out the functions I want to implement
Is it possible to view the script of the active effect created through this component? I tried checking via the console, but I couldn't find it!
Or do you want to find the Active Effect data?
I think it would be the data. To include it in my global scripts.
I'm not sure if I made myself clear!
exemple:
{
id: 'fogoabsorcao',
name: 'Fogo Absorรงรฃo',
icon: 'worlds/legend-of-lost-rings-csb/assets/icons/fogoabsorcao.png'
}
If I built this active effect in the component, Iโd like to know where I can view it in this format.
actor.effects;
actor.appliedEffects;
actor.transferedEffects;
Check the prototype chain of the Actor to make sure.
Wish I were better at this but here's all the essential boxes down for just the Pilot
It'd probably be smarter to move Premonitions and Rage out from the Attribute table to make it a dynamic table, but I can't wrap my head around dynamic tables
LETS GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
Two versions of the same table. Is there any major benefit to using the Dynamic Table that isn't merely streamlining of setting up functions?
Hey hey. could someone explain to me how the item filter formula works. I have been through the README and cant find a fix.
I am trying to use a drop down table to set the slot the item is supposed to be sorted into but I cant seem to get it to do anything.
Also this seems to resolve as true but I cant work out why.
it appears that most everything defaults to true unless the result is specifically false.
I think there is a bug here that causes the last radial button to always be selected regardless of the one picked as when I close and open an item window or an inventory item window the item's radial button resets to the last slot.
is there a documentation of what this ActiveEffect thing does?
That did it, thank you so much! Now that I know how it works, I can use fetchFromActor on both c_roll and e_roll and not risk any anomalies.
How can I programmatically create an item and attach it to a token's actor?
The behavior I want to achive is that when conditions in my module code are met, I want to simulate opening a tokens actor sheet, drag&dropping an item on it (I know the item's id and name). Ideally I would want to first modify that items default props and then attach it to the actor.
https://foundryvtt.com/api/classes/client.Actor.html#createEmbeddedDocuments
const item = game.items.get(id);
// ...modify stuff in item...
await actor.createEmbeddedDocuments('Item', [item]);
Documentation for Foundry Virtual Tabletop - API Documentation - Version 12
The official website and community for Foundry Virtual Tabletop.
Ok so this is only for people who are proficient with Javascript it seems
You can also create Active Effects through the Active Effect Displayer. That one is easy to use
whats that? an addon?
That's the new Component with the update
Hello !
I'm using
game.actors.forEach(actor => actor.items.forEach(item => item.templateSystem.reloadTemplate()));
to try to reload all the item of my world. But it doesn't seem to work unfortunatly. Is this macro depreciated?
It's still valid
It will only update Items inside Actors (within the Actors-Tab), it won't actually update all Items
Yes, that's what I meant. It's odd cause I have like several instances of items that were not updates inside my characters' sheets
and that's hours after executing the macro
Try this one here:
const documents = game.actors.filter(actor => !actor.isTemplate);
for (let i = 0; i < documents.length; i++) {
const items = documents[i].items.filter(item => item);
for (let j = 0; j < items.length; j++) {
SceneNavigation.displayProgressBar({
label: `${i + 1} / ${documents.length + 1}: ${j + 1} / ${items.length + 1}`,
pct: Math.round((i * 100) / documents.length)
});
try {
await items[j].templateSystem.reloadTemplate();
} catch(e) {
ui.notifications.error(`Couldn't reload Item with UUID ${items[j].uuid}`);
}
}
try {
await documents[i].templateSystem.reloadTemplate();
} catch(e) {
ui.notifications.error(`Couldn't reload Actor with UUID ${documents[i].uuid}`);
}
}
SceneNavigation.displayProgressBar({
label: 'finished',
pct: 100
});
tjx I'll try it
seems like it always gets stuck around 7%
Try the edited one
let's give it a try
Hello guys! I'm trying to build a character sheet with this feature. In a tabbed panel I have a checkbox on tab 1 and an item container in tab 2. I'm trying to create an automation that shows to the player the item container when the checkbox is checked and when the checkbox is unchecked the item container should disappear. I tried a lot, but I fail every time ๐ฆ can you help me?
under "advanced configuration" for the item container, you should just be able to add the checkbox's key to the "Visibility formula" field
Hi. I made a primitive button that deals damage to the target token. This button changes the target's health to a number, and can lower the value below zero. How to prevent the number from decreasing below 0?
Some code ๐ค
${
setPropertyInEntity('target', 'HP', "target.HP - [1d:DMG*2:]")
}$
does "max(target.HP - [1d:DMG*2:],0)" do what you need?
Yes. I was just thinking that there must be some way to follow the example of min max like
Thank you, it worked!
Do the radio buttons work for everyone else because mine seem to be bugged? Open an closing the item window seems to always result in the last option being selected.
I checked the read me and it says that it would happen if you have more than 1 default selected but in my case I don't have any set to default. I have tried it with 1 set to default but its the exact same issue.
You have to make sure that your values within the Radio Buttons are distinct from each other in the same group
Amazing thank you
it works now
Quick question. I see that there is a Replace function that I can use in the Custom System Buider. Are other string functions available, too? Looking for basic stuff like substring, instr... stuff like that. Any idea where to look or what they are?
Some prototype functions are possible within CSB (like Array.prototype.join()). I just don't know, which exactly, so you have to try it out. Or you use scripts %{}% instead of classic formulas ${}$
O.k. I haven't used scripts yet. Lemme give it a try.
Here:
Bumping this question
It's convenient for lookups. And you only have to define column-components instead of components for every cell.
Full disclosure I only understood maybe half of that ๐
Also dynamic tables can be expanded more easily, good if you characters may be picking up extra skills down the line depending on your system
Alas, not an option here
(I say 'alas' like it's not sparing me the headache of having player-defined custom variables)
...Suspecting there has to be a better way
Yeah, that's getting out of hand. You're probably better of with Items in this case
The question is whether or not that would even work here, and how, as this nightmare table is supposed to reflect the system's base 'to hit target' mechanic
I can't answer it without knowing the details of the mechanic
But in most cases, Items and Item Displayers have more options than Dynamic Tables.
You can also download the example-module in the package manager. It contains solid examples of how you can structure your system.
I have indeed done that, and it's been a major help in setting up the basic attributes table!
so i'm using this with sheexcel and when i do /r @sheexcel.AV it gives me the correct result, but if i put [@sheexcel.AV] in the initiative formula box, it's always 0. what am i doing wrong?
Looking at the items, the only way I see it working in this case is if I make 36 different items for each character, including NPCs
I'll explain after I shower
Because the @-syntax doesn't work within CSB Roll Formulas
how would i access sheexcel.AV then? all the stuff i was reading went way over my head.
Where is this data stored?
Try the approach for Macros and use that within script-delimiters:
%{return entity.entity.sheet.getSheexcelValue('AV').value}%
You do? ๐
... no
Create a random Label and copy-paste the content and see if you get something out of it
"oh cool so this lets me use spreadsheets i can link them together instead of rebuilding them and save time"
takes a step into a puddle and starts drowning
6 seconds ยท Clipped by A_N00B ยท Original video "I Gave My Goldfish $50,000 to Trade Stocks" by Michael Reeves
I think it's more complex trying to get your system work with Excel instead of building it entirely within CSB in the long run
like this?
when i click AV test nothing happens ๐
Label text would be enough, but that's also fine.
Check the console for errors
every click gives me this
Try out console.warn(entity.entity.sheet) and check, what functions are available in the prototype.
i found this
It's good to know but not what I was looking for. I literally mean the functions in the prototype of this instance.
oh hey
i moused over value and used what it said in the pop up for %{return entity.entity.flags.sheexcel.cellReferences[2].value}%
and it worked
Yeah yeah, that will work, but is not a clean way to be fair.
Nope, I mean [[Prototype]]
The top-level one
eh?
Yep, looks better
i'm sorry i'm not good at this ๐
But that's the prototype of the PrototypeToken. I need the prototype of the sheet (the top-level one, probably ActorSheet).
i see a CustomActorSheet with an ActorSheet inside it
Should also be fine. Show me that
Ok, I don't see the getSheexcelValue() anywhere, so the module fails to inject the function into the prototype of the Actor Sheet.
See if the second macro code works for you:
%{
return game.sheexcel.getSheexcelValue(entity.entity.id, 'AV').value;
}%
it does!
Then work with that
Not really, it was one of the easier issues ๐
i applaud your abilities
Back, system explanation time.
The way Celestial Bodies works is that every character in combat is represented by a 6x6 grid, with a portion of that grid being a 'valid build space' determined by the class of that character. In this provided example, the valid build area is 3x5. Within that valid build space, parts may be installed, with each part having a listed set of dimensions on top of their listed functions.
When attacking a character, you roll 2d6, determining column (10s) and row (1s) in that manner. After applying modifiers to the roll, the remaining co-ordinates is the square that's being targeted. From there, these checks follow in order:
- Is the attack within the build area? If not, the attack misses.
- Is the attack targeting a space covered by a shield (cyan area, generated by the blue Shield Generator)? If so, check if the Shield Generator is also in that space; if so, double the damage, otherwise/then apply damage to the shield. If the shield is destroyed and there is remaining damage, move to 3
- Is the attack targeting a space covered by armor or reinforced armor (brown-red area, standard armor)? If so, reduce damage by 1 for armor or 3 for reinforced armor. If there is remaining damage, move to 4
- Is the attack targeting a space that is damaged or a part that is disabled/destroyed? If so, activate Critical Hit effect.
- Apply remaining damage to target's HP total
This is a rough outline and isn't perfect, but I do hope it outlines the mechanical crunch the system has
All this considered, I don't know how using items to represent the grid itself would work out
Using CSB's item system to represent the items in this game is something I definitely want to do, as that can be used to easily store range/damage values, weapon tags, etc - hopefully even the grid dimensions but that might be going even further beyond my capacity to make this work
Yeah..... this will get complex with the grid. You'll need to rely on custom scripts to get that working, for sure. And that would require some knowledge with Javascript.
So, for now, I think I'll drop including grids in the character sheets and we'll just draw them out into the vtt play area
Hello! I am, completely new to CSB and in need of some help making a character sheet that is probably more then a tad complicated to compile. Would anyone be available for me to drop a lot of questions?
this one worked !
thx!
Is there a macro to create a character actor using a predefined template? ๐ค
You can use actor.templateSystem.reloadTemplate(templateId) after you've created an Actor.
hi, just one question
i did not understood how to put the text in the middle (example trauma)
the trauma text is a label btw
Put a c into table layout. There's l for left, c for center and r for right.
bruh, my caps lock
thx
You can always ask here
i'm a bit of a newbie, can someone explain why this two sheet are not synced?
the one on the left is the one that open when i double click on the token
the other is the one that i open from the actor tab
Because the Token is not linked to an Actor. That means that each time you create a Token, it will also create a copy of the Actor
Go into the Prototype Token and change that
thx
peraphs i'm blind
Link Actor Data
thx
i'll not enter too much in detail but i have a problem in this macro, the problem is that i cant fetch the DEX value, i dont know what's wrong honestly, it keeps reading 3 for some reason
The right path is actor.system.props.dex
Okay, I have (probably stupid) question - if I want to use value from sheet in initiative calculation in Settings, how should I write it. I tried [1d10+KEY], din't work.
[1d10] + KEY
Thank you so much
now it works thx
last question and i should be ok, do you need to check the link actor data each time you drag a new token on the map?
would it be too hard to make a stat block importer macro?
Once the character is created
No, you configure this once in the Prototype Token of the Actor in the Actor-directory. All Tokens created afterwards will be linked to this sheet
It hardly depends on the data formats. You can export an Actor and look into the JSON. You must make sure, that the imported data matches the format
You'll probably need to write your own mapper, which can take up a lot of time
I see... in this case, sounds like it would be easier to structure from the exported actor json and simply import it normaly...
thanks
Heya everyone. New to the club, currently trying to create an acteur sheet for Cities Without Numbers since the stuff on Foundry doesn't work with v12. It's been ages since I last coded something and I'm probably stumbling in way head over heels.
Currently I am trying to create a simple stat block that returns certain modifiers when you enter attribute values.
You can find the modifiers in the attached image.
Now I've created a dynamic table (attached as the second picture). The third column of the table should output the correct modifier for the corresponding row. I've tried some switchCase shenanigans, but I guess my code just is wrong.
$switchCase(sameRow('attribute_base'), 3, -2, > 3 : <= 7, -1, 8 : <= 13, 0, 14 : <=17, +1, 18, +2)$
(It's okay to laugh, I gotta learn. ๐ )
I'm having trouble with an item container and a formula in an item modifier. For some items the desired effect works (to change 'working' to 'destroyed'), like for ECM for example. But for some it doesn't work. When I change the name filter to for example 'Backup Fire Control', nothing happens. I can't figure out why some are working and others aren't. What am I missing?
This works: ${fetchFromActor('attached', "lookupRef('perks', 'perk_destroyed_actual', 'name', 'ECM')")}$
This doesn't: ${fetchFromActor('attached', "lookupRef('perks', 'perk_destroyed_actual', 'name', 'Backup Fire Control')")}$
switchCase() only checks for equality. For other types of conditional checks, use the ternary operator
Thank you very much.
lookupRef() returns a single path to a single entry. Item Modifiers are not designed to modify multiple components at once
Sorry, I wasn't clear. I just want to modify one item, but I can only get some of the items in the container to work, even when using the same piece of code. Whatever I try I can't modify the working/destroyed label of "Backup Fire Control".
Am I missing a filter?
Try out in the console game.actors.getName('actorName').system.props.perks and verify that the name entry is correct
Hello. I'm getting the error above when choosing an option called "Test" from a dropdown.
The dropdown is configured as such: (it's from an item owned by the character)
And this is the dynamic table 'Attacks' on the actor:
It's getting the attack label instead of the attack value like I thought it would
what am I misunderstanding please? ๐
That is not the full error message. These are the props, that were present when the error occurred.
So I assume you want the value of Test instead of the string 'Test'. Use ref(dropdownKey)
I thought that the option that says "Column from the dynamic table to use as option key" (in the dropdown element) meant that it should get that value
but it was my own guess not based on much
Do those two option just mean that it's either one or the other based on what I fill in? and not both
I wanted to show on the user end the Attack Label, and get the Attack value inside the key of that dropdown
does that make sense?
It should, yeah. If the column labels in the Dynamic Table are the same as your column keys, then the Dropdown options keys should be numeric
So the attack value is numeric (it's a 9 in the screenshot) while the label is a character
but it's trying to transform the attack label into a number instead of using the value
the dropdown key let's say it's "Attack_dropdown" I wanted to set Attack_dropdown to 9 instead of setting it to "Test" and I thought that's what those two options in the dropdown element would do
I'd rather not show the keys on the front end because they get uglier than what's shown here
It would, yeah.
Alright at least I'm doing something right if you say that. I'll try making new sheets from scratch to see if there's something else messed up idk
the error is happening because I'm using Attack_dropdown is a formula (by adding it to other numbers) but it's trying to add the label
You can try to verify your values with game.actors.getName('actorName').system.props & game.actors.getName('actorName').items.getName('itemName').system.props
is it possible that dynamic tables that have labels in them don't quite work?
because it's not showing the attack value but it's showing every other row in the dynamic table here
just guessing because it's the only row that's a label in there
They should work like other Components, I didn't have issues with them so far
I changed it to a text field and it started working... however the result was showing correctly when it was a label (9)
ugh I'll stop for a bit and triple check everything else because I don't want to throw you for a loop when maybe I missed something else obvious
You also have warnings with uncomputed props. Are your labels present in there?
Because that would be a valid reason
Ooh silly me. yeah the label formula for that field wasn't going off correctly
๐คฃ
I apologize
Btw, you have to make sure, that all Dropdown option keys are distinct from each other, otherwise they will be treated as the same selection
option keys as in "Test" not being duplicate?
btw the above was my fault but it's weird that it was showing me the result even if it wasn't computing everything that's part of the formula, isn't it?
like, decide if the label is good or bad ๐
I was hoping that since the user picks by option label, I could have duplicate values in the keys
No, it's vice versa
option keys shouldn't be duplicates, while the labels are... it doesn't care about labels at all
so this is good
Yep, doesn't care at all. But your users will be confused ofc ๐
of course lol
Now that I think about it
of course if the keys are the same it's as if they're the same selections..
right?
because it is.
Yep, technically it is
I mean if they get to 9 by a different formula it's still a 9
But that could result in displaying the wrong label
Ohh ok
That's fairly inconvenient if I was making a product
but I'm not ๐
Thanks for the warning. I'll keep it in mind. Dunno how to solve it atm to be honest but it's for another day
I'm back to working on the system. thanks again ๐
It's usually a good idea to have component keys in the option keys, because these are distinct by default
I wanted to leave it open because the system I'm working with is a bit open ended so new stuff might come up where you have to make your own custom attack for example
I am trying out the brand new, all exiting feature of active-effect-displayer and ran into some points I do not understand:
When I drop a fresh token on the canvas and via status-effect submenu add its first effect, this is not sowing up on the token. I need to ad a second effect, then the first one shows up as well. Seams to happen only once with every token. Bug or old man stupid?
I donโt understand the function of the โActive Effect Reference Column Labelโ. What other possibilities beside โNameโ exist? Can several be placed beside each other (divided by , /- or similar)?
When I hit an effect shown inside the displayer, a new window pops up I have never seen before and I was not able to find any description for this inside the CSB or foundry Wiki. What are itโs possibilities?
If I change some values in this last window, this will not used by an other token if it gets the same effect and the changes will be reset once the effect is closed?
I'll concat the end value with the row line number * 0.001
then round down the result
- I have to check that case
- It's just a column label, nothing more. There's currently only 1 fixed column for the Active Effect link
- That's the default configuration window when working with Active Effects. That is Foundry-standard
- Yep, you can only work with Active Effects, that affect the current Actor. If you want to pre-configure certain Active Effects, then you should check this section out: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Active-Effects#4-world-script-for-adding-custom-status-effects-in-the-config
Thank you very much for the answer and this feature
Hi, is it possible to insert an item modifier that give you back a text on a label on the player sheet?
For example, i have insert a label under "Professione" and i want that when i put an item in "Professione", it will show the text i can set on the label.
@formal goblet
Yeah, use the Set-Operator =
Really thank you! Can i use the rich text in the text that is showed in the label?
Wdym with "use"?
sorry for my english, i mean "may i put a bold text in the item modifier?"
for example when i put a profession on the item container and it shows something like that: TEST - Congratulation, you have a profession.
Idk, try it out with <strong>Test</strong>
Yes, it works!
Thank you very much Martin! The more i go deep into CSB more things i discover โค๏ธ
Yes... this is amazing. Thank you.
i add that you can use even <b> </b> and it still works
I don't know all tags out of my head, but generally speaking... as long as it's valid HTML, it should be fine.
yeah, i told you just in case you need to test it, it works even with deprecated bold text html code ๐
I have a complicated roll formula... and rather than writing a version of it for every attribute in my system, I wrote the following:
${score:=AWR}$
${[${switchCase(ddRollMethod,'Default','${switchCase(score>=12,true,'${floor(score/3)-1}$d6kh3+${score-(3floor(score/3))}$+2','${floor(score/3)}$d6kh3+${score-(3floor(score/3))}$')}$','Straight Up','${floor(score/3)}$d6kh3+${score-(3floor(score/3))}$','Remove d6','${floor(score/3)-1}$d6kh3+${score-(3floor(score/3))}$+2','${floor(score/3)2}$+${score-(3floor(score/3))}$')}$]}$
So far so good. But the assignment of AWR to the score variable causes Foundy to output AWR in the roll output.
I am not expecting the 10... just the 16. What am I doing wrong?
Just prefix the beginning of the formula with #. That will hide the result.
That was it. Thank you.
Otherwise, everything, that is not hidden, will be shown
It was a mother to write... glad I don't have to do it again. ๐
Is there a different method for inside a label?
${#score:=PUNCHscore}$
${floor(score/3)}$d+${score-(3*floor(score/3))}$
Once again... not expecting the 3.
Try out
%{
const score = ${PUNCHscore}$;
return Math.floor(score / 3) + 'd' + score - (3 * Math.floor(score / 3));
}%
NaN.... I think the script doesn't like converting numbers to strings....
In case anyone else is trying to do this:
%{ const score = ${PUNCHscore}$; return Math.floor(score / 3).toString() + 'd+' + (score - (3 * Math.floor(score / 3))).toString(); }%
Just had to do a couple of explicit datatype conversions....
Thanks for your help!
Weird, it should coerce the number to a string when encountering a string for the +-operation
I kinda thought that, too. I am a programmer, but this is a new language to me... so I figured it was just some syntax-thing.
I found the issue. It was the part with the - and the order of execution. The left hand side was a string...
I cannot believe how far I have been able to take CSB... it's pretty damn cool.
Hello everyone. I'm trying to understand the syntax and make a hit button whose damage is equal to the value from the number field.
Some code ๐ค
${
setPropertyInEntity('target', 'HP', "max(target.HP - sameRow('STAT_VALUE', 0), 0)")
}$
But I want to output sameRow('STAT_VALUE', 0) separately to a variable. Help please :3
Then use fetchFromActor() if you need to store that in a local variable
And a little warning. Your players don't have the permission to update the stats of actors they don't own.
TT_TT
Well. We have a problem.
What should I do then?
if I just have a number and need to subtract it from the target's health
Well, either you adjust the stats manually after an attack or you write your own script, that lets the update go through the gm-client
I've never stepped into the 2nd path, so I can't assist there
I remembered one way
In SWADE system damage is dealt only after the GM clicks on the button in the roll message
player generate, gm approve
Yep, like I said, the final update must go through a GM
Because players simply are not allowed to
Well. Now I need to make a button :/
But how? Panic...Panic...Panic...
I'm still sorting through the options, I'm getting scared.
Well, I also have no framework ready for a Button within a Chat Message, that executes a Label Roll Message with contextual data ๐
๐ซ
Are you familiar with Javascript?
๐ค
I made a character template in obsidian based on the plugin
there are a lot of lines, not very good code, but it's an honest job.
Well, this would be my concept:
- HTML-Button with data-attributes (target-uuid, changes-array with key-value-pairs, that represent the changes) and an onclick-handler
- The onclick-handler fetches the target-uuid from the data-attributes, fetches the Actor according to the UUID and then updates the props of the target according to the changes in the Array
I'm not sure what exactly an array is needed for the changes. Or maybe it's worth it anyway. It looks very specific. in my opinion
it would be possible to simply add more buttons for each change and press the necessary ones
I'm thinking about reusability, that's why I thought about an Array. But it can also be a single value, no issue with that.
The time for talk has passed. It's time to press the BUTTONS!
I also realized that right now my damage calculation button only works with 1 target.
That's not good
An Array of target-uuids then ๐
arrays of arrays ๐คฃ
Nah, we're not that deep yet
fetchFromActor get 1 target, yep?
Yeah, that's always 1
Check game.user.targets in a script
actor = game.user.targets.values().next().value?.actor;
It's time to modify it
๐
That's our source code, I can recognize this ๐
- no array of targets from fetchFromActor (which is not very pleasant, but it is not necessary as long as there are no buttons)
- no buttons for roll message (which is certainly difficult to implement [for me])
- but stats buttons work very well on my character (because I began to understand the syntax of the system even better)
- I'm tired after the game and it's time to sleep
What do you tell me about this, friend?
Haaa, it's 1 am here and I have to wake up at 7 am while reading a Manga instead of sleeping. Who needs sleep ๐ฑ
The weak need ๐
but it's already 3 am for me. And something inside says it's time to stop
Hey all, working on a project and I'm trying to use dynamic tables for some automation and I'm unsure how to have the options but not have them editable when it's suppose to be used. Thank you for suggestions and direction.
Hi again, i'm trying to manage the "weight" of an item in an inventory (in this case 3 items with 0.1 value each) but when i put 3 object of the same type the measurement of weight goes crazy. How can i solve this?