#Custom System Builder
1 messages ยท Page 32 of 1
anyone else have an issue with blank sheets after migrating from 3.0.0 to 3.2.5 ?
CSB doesn't appear to be loading but it says it's selected as game.
I need to know the error message in the console
I'm getting: Cannot Convert "Target Armour Damage" to a number.
This worked before i updated to 3.2.5
Can we use js and/or && and || in Item Container filters?
No JS, but you can use and & or-operators, which are equivalent to && and ||
I don't see an issue with this Formula so far...
I'm getting a weird trio of errors when I load into my world. I don't know what the last one is doing, but the first two refer to the formulas for setting the key and value for an Item Modifier. What's weird is that the item modifier seems to be working fine and I don't know why it would be trying to convers 'Stars' into a number in the first place.
The concat() of mathjs doesn't like mixed types for string-concatenation
Same error when i replace it with this
${concat('Deal ', string(headArmourDamage), ' damage to the target.')}$
Passing TrueSpeed through string() solved it. I guess that typing also gets lost in hidden attributes?
Hidden Attributes are always strings. It's just that mathjs tries to convert strings to numbers in the parsing-process
Huh. Weird.
Well, I don't like it either, but replacing it is... so much work...
Oh. No. I'm not calling that specific behavior weird (or even beginning to suggest you should replace math.JS). It's more that wrapping TrueSpeed in string() got concat() to stop trying to turn it into an int, when it doesn't seem like it should have changed anything about the parameter getting passed.
Well, you can dig deep into the docs of mathjs if you're curious. There might be stuff even I don't know
I think I'll pass. ๐
Does PDF Pager not work with CSB anymore?
Did it ever?
I have been using it until recently. Now nothing pops up.
Is there an alternative to use form-fillable PDFs for character sheets?
Not that I know.
You can go to the package page of Foundry and get the manifest for a specific version. Once you got that, you can insert the link into your package manager
I think it was something to do with my setup. Restarted server and used Firefox, all ok now. Weird that it just had no console errors or server errors, just acted as if the game system wasn't loading at all.
Ok. I've got another weird one. I'm currently trying to populate the autocomplete of a field on an item, based off of the names of items from a specific item container on the attached character sheet. I'm using ${fetchFromActor('attached',lookup('Tracks','name'))}$ for the formula, but it's producing an error in both the autocomplete popup and the console.
The part that's really confusing me is why it's saying formula.replaceAll isn't a function, since it's not part of the formula.
I think the sizing and panel layout functions are going to drive me insane. I have two components in a horizontal panel and I want to get them in line with each other. I had them in line with each other and then I did some things that should have made one of them smaller, but for some reason it got larger and they went to two lines. So, then I undid those changes, but they're still on two lines. ๐ซ
I have no idea how spacing is supposed to work, but it causes me pain.
What versions of PDF Pager, Foundry and CSB, and which form fillable PDF?
CSB - 3.2.5
Foundry - 11.315
PDF Pager - 1.1.0
Info sent. Unless you can easily import or recreate the character sheet in CSB. I have a json, but it does not look I can import that.
Does the "Export templates JSON" work? It would be good to have your setup in my test world.
So far, I can see that the "Name" field can be mapped properly.
Are you hosted locally, or maybe on a server with a prefix directory to your normal foundry installation?
Hello group. Looking for help with two questions...
- IS there way to modify attributes of the item which is configured by "configure hidden attributes" ?
I add hidden attribute "equiped" with "owned" as default and can pull that out on container level via simple "${item.equiped}$", but usage of "Label roll message" ${setPropertyInEntity('item','equiped','carried')}$ doesnt change that value. ๐ฆ - how can I change "class" of the item (ie. Label) or "Label icon" via formula on "Label roll message" level?
Also, can you describe the symptoms for it not working for you?
Hello ๐
I'm trying to add a function directly into the .js files for the system but I still get "MyFunction" undefined
I don't know much about Javascript btw
Thats great, will explain a lot of the questions. Thank you @formal goblet
It should be already pined to the thread
I gave you a screenshot of what I am seeing. Trying to install the Character Sheet as a Custom PDF provides the same results.
Hello all, been lurking for a bit. I love the fact that I can implement things so rapidly with this system. However, I'm having an issue. basically I have a dynamic table that has a column that tracks XP for multiple classes- it is set up as a label so I can use the label roll message to prompt for a user input to add or subtract XP from that particular cell. I have yet been able to actually get it to change the value in the label. This is my latest attempt:
${setPropertyInEntity('self',sameRow('colXP'), number(ref(sameRowRef('colXP')))+XPGain))}$```
Labels cannot be changed by Users. You have to use an Input Component in this case
Well that explains it then, thanks!
Is there a way to execute code when the user clicks on an Input Component?
I can't read the error messages
Not without attaching input listeners to it. Otherwise, Labels are the go-to Components for this case
Gotcha
Thanks for the screenshot. I see the issue now.
Hello @formal goblet, short question.
I see in your example that you use checkbox as item parameter to set if item is equiped or unequiped and them from item container level you change it. And even if item will be opened it will not change what was set already.
In my example I use dropdown list (due to 3 levels: owned, carried, equiped). It works well as long as I will not open the item, then status is changed back to default, which lead to change status as soon as item window will be closed.
Any idea why and how to resolve that one?
Exactly explained by Martin. That was due to incorrectly set parameter via "setPropoeryInEntity" as for dropdown it has to be " ' <key> ' "... that it will works well
I have just released PDF Pager version 1.1.1 which should fix the problem that you found.
i need some help with some logic
I have a textfield named "Weapons_1"
I also have several textfields named "Other_Skill_X" where X is a range between 1 and 12.
Now, i want to match the text in "Weapons_1" to the "Other_Skill_X" text (example "Revolver 89") and then find the corresponding Lable "Other_Skill_X_mod" ( it is located two collums to the right. within a table) to get the mod number. this will in the end add up the shooting roll.
any suggestions?
the idea is that the player can add his weapon specializion in any of the 12 fields, and it should autofind the number based on the name
Attribute formula for each of the other skill mod that checks for the value of Weapon-1
@wet heron
You da Man Dawg! That worked! Thank you very much!
Brilliant!
But the actually best solution is to make 12 items called something like weapon specialization, and each of them have the attribute modifier that you want
So you would make labels keyed other skill mod 1-12
And set their visibility to them being != 0
Could someone explain to me how does CSM load Math.js?
Modifying the file itself isn't changing anything in runtime
That means that the value you set is invalid, that's why it resets to the default-value of the Dropdown. The Formula should look like this: ${setPropertyInEntity('item', 'dropdownKey', "'owned'")}$
well wont work im afraid, as the fields are upen for not just weapons, but rituals or other fun stuff
ill tinker with it and come back if i get stuck again
The calculation for whatever number if attributes, be them weapon mods 1-12 or rituals 1-109 of both at the same time would include a +1 / whatever that's conditional on the key for your entry field being equal to whatever corresponds to for them
So for example the formula for weapon_1_total is:
Buff_field== ' weapon one' ? (weapon_1 + 0) : (weapon_1 + 25)
@wet heron
Sprinkle in ${}$ as needed to make the formula read correctly
the issue is that the "buff_field" is not the same field as the textfield, what i need is "get field data two collums to th right in the table"
You can't perform relative operations on normal Tables without a Script
im thinkingabout making a Dynamic table of it and using same row
oh
If you give the table a key, you can access it with actor.templateSystem.componentMap.tableKey. Then you can check in the console what the content is
That would probably be the approach
thanks, always a lifesaver
I don't think I understand why adding a function to my math.js woud not work.
I see the function while inspecting math.js in the console log, but it still says it's undefined if I try to call it.
I don't know if it's more of a Javascript question than a CSM one to be honest
I tried with text and with numbers, with "" and " ' ' "... and its all the time same issue... magic me I believe ๐
EDITed: Exactly explained by Martin. That was due to incorrectly set parameter via "setPropoeryInEntity" as for dropdown it has to be " ' <key> ' " (" and ' has to be used)... that it will works well
math.import({test: () => {return 2;}}) worked for me. But you have to make sure, that you do that in a WorldScript, when the world is initialized. Otherwise the import will be lost after a reload.
It's probably me now knowing how to get around in JS. I'll try to move around my function to see if I find someplace where it works
thank you ๐
Yep that was it. Thank you again ๐
Is anyone facing some stutters when opening the sheets? I don't know which module is giving me this problem. So i'm asking.
specifically when opening the sheet on the canvas(double-click)
@formal goblet I can't thank you enough for making this system/module. I had dove into foundry a while back and hit a brick wall simply because of the fact that I have never done anything with CSS or JS. I did a lot years ago with LUA in Fantasy Grounds, I had more time back then- I don't now. This is the perfect thing for me to get something up and going for my group that isn't already present (in any workable fashion) on Foundry. You are the best!
Shivers because of LUA
Tables, tables everywere... heh.
dragging an item from sheet to sheet just clones it, is there a way to stop that? I've implemented my own "give" plugin for CSB instead so I don't want the cloning
I think that's Foundry standard. All we did is widen the draggable area of an Item. If you want to change that behavior, you'll need to get into Hooks
Cool so maybe I hook into that with a confirm and then use my custom give function, else return false
Err no, return false either way..
can you put an item inside an item?
Nope
i haven't been on in a bit and was wondering if anybody could point me in the right direction. When i was using CSB 3.0 5 months ago my Item Piles + CSB was working flawlessly, but now i updated to 3.25 or whatever and now item piles can't seem to read item quantities or gold values. I saw there was some syntax changes with the update but im not entirely sure what to change for the references here. Any suggestions would be helpful.
I have noticed that the hidden attributes don't reliably update to a change of data on the sheet, whereas if I do the formula on the sheet it is spot on with the changes. Is there something I should be doing to force the hidden atributes to recalc?
I've tried using recalculate() when I reference the hidden attribute key, but it doesn't seem to matter.
The only thing that seems to force it is to reload the template, which works.
Can you give an example? I'm kinda abusing the hidden attributes but haven't noticed any problem
am I using round() the wrong way or does it not do what I think it does? In the following formula I'm getting like 10 decimal places instead of 1, which is what I want.
${round(sum((goldAmount*.02),(silverAmount*.02),(copperAmount*.02),sum(fetchFromDynamicTable('geardyna1','totalWeight')), sum(fetchFromDynamicTable('geardyna3','totalWeight'))),1)}$
Its a new bug after CSB update, @glad spade is looking into it.
thanks, i was trying to figure it out but nothing was working lol
ill just revert until an update
I know.. half my life with these sheets is "Is it me or is it them?" lol
Hello, Im struggeling with the lookup-function. I want it to check for a checkbox called 'active'. I'm pretty shure I'm doing something very wrong here:
${sum(lookup('Armor', 'Armor_Protection_Standard', 'Body_Region', 'Kopf', [active : 1]))}$
Be more clear about what you want to do. Do you want to know which value a checkbox currently has?
I try my very best. Sometimes its very difficult to nail the thing. I hope that helps:
I actually want to display the value 'Armor_Protection_Standard' of all items when 'active' checkbox is checked and 0 when nothing is checked.
${sum(lookup('Armor', 'Armor_Protection_Standard', 'active', true))}$
Or in other words: SELECT Armor_Protection_Standard FROM Armor WHERE active === true
Damn sometimes I feel stupid ๐ thanks
tried it, didnt worked out. It returnes me a 0 whatever 'Activ' is true or not.
The key you enter must match exactly. Variables are case-sensitive
Good evening all. I'm currently using the CSB to build a character sheet; in this game, the standard roll is a pool of dice that is added to if a PC has a relevant trait or quality. Is there a way that I can use a formula to prompt the player to input the correct number of dice? Let's say I wanted to roll 2, 3, or 4 dice and keep the highest.
Thank you for the hard work on this lovely system, and for all the advice I've gotten while lurking.
In the dynamic table, I want the number from the third field.
My table look like
Other_skills
Other_skills_name | Other_skills_points | Other_skills_mod
I need help with extracting the value of Other_skills_mod but I need some help
I have matching information in 'Other_skills_name' and 'name_weapon1'
So far I've tried this:
Lookup('Other_skills', 'Other_skills_mod', 'other_skills_name', 'name_weapon1')
lookup(), not Lookup()
Oh
Hehe that was ny phone autocorrect, I have lowercase
I have tried to hardest now, but still get error
${Lookup('Other_skills', 'Other_skills_mod', 'other_skills_name', CAR 98)}$
Missing quotes for the 4th argument
Still error
Which error?
Don't know, it does only say error, how do I see it il the console?
Press F12 and change to the console-tab. It should be there in red
Wait, which CSB-Version are you using?
CSB v 3.0.0 build 30
Foundry v 11 strable
That's the issue, lookup() came with 3.1.0. You should use fetchFromDynamicTable() instead
Even the latest is compatible with V11
(Y) then ill update
We still haven't switched to V12
perfekt! Neither has the serverowner
Documentation and faq tells you how to prompt the player for a variabile, keeping the highest dice of a roll is for example [2d10kh]
its updated now, and no error, although the field is not showing, can i through the console find the Component key i have assigned the formula?
game.actors.getName('actorName').system.props
Custom System Builder | Uncomputable token lookup("Other_Skills", "Other_skills_mod", "Other_skills_name", "CAR 98", "===") Error: Uncomputable token lookup("Other_Skills", "Other_skills_mod", "Other_skills_name", "CAR 98", "===")
Still cant get it to work
token lookup("Other_Skills", "Other_skills_mod", "Other_skills_name", "CAR 98", "===") Error: Uncomputable token lookup("Other_Skills", "Other_skills_mod", "Other_skills_name", "CAR 98", "===")
at lookup (Formula.js:464:31)
at math.js:26531:54
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:657:27)
at Formula.compute (Formula.js:363:21)
at processFormulas (ComputablePhrase.js:106:35)
at async ComputablePhrase.compute (ComputablePhrase.js:160:34)
at async ComputablePhrase.computeMessage (ComputablePhrase.js:285:9)
at async Label._getElement (Label.js:97:35)
at async Label.render (Component.js:143:25)
at async Panel.renderContents (Container.js:50:25)
at async Panel._getElement (Panel.js:76:33)
at async Panel.render (Component.js:143:25)
at async Panel.renderContents (Container.js:50:25)
at async Panel._getElement (Panel.js:76:33)
at async Panel.render (Component.js:143:25)
at async Tab.renderContents (Container.js:50:25)
at async Tab._getElement (Tab.js:43:33)
at async Tab.render (Component.js:143:25)
at async TabbedPanel._getElement (TabbedPanel.js:56:36)
at async TabbedPanel.render (Component.js:143:25)
at async Panel.renderContents (Container.js:50:25)
at async Panel._getElement (Panel.js:76:33)
at async Panel.render (Component.js:143:25)
at async TemplateSystem.getSheetData (templateSystem.js:333:43)
at async CharacterSheet.getData (actor-sheet.js:49:19)
at async CharacterSheet._render (foundry.js:5812:18)
at async CharacterSheet._render (foundry.js:6532:5)
Your target column name doesn't match
spoke too soon, im still dumb, still not working
What's the formula of the mod?
well the formula is
${Other_skill_points <= 0 ? Other_skill_points -5 :
(Other_skill_points > 0 and Other_skill_points < 6) ? Other_skill_points :
(Other_skill_points > 5 and Other_skill_points < 9) ? 6 :
(Other_skill_points > 8 and Other_skill_points <11) ? 7:
(Other_skill_points > 10 and Other_skill_points <13) ? 8:
(Other_skill_points > 12 and Other_skill_points <15) ? 9:
(Other_skill_points > 14 and Other_skill_points <18) ? 10:
(Other_skill_points > 17 and Other_skill_points <21) ? 11:
(Other_skill_points > 20 and Other_skill_points <24) ? 12:
(Other_skill_points > 23 and Other_skill_points <27) ? 13:
(Other_skill_points > 26 and Other_skill_points <30) ? 14:
(Other_skill_points > 29 and Other_skill_points <40) ? 16:
(Other_skill_points > 39 and Other_skill_points <50) ? 17:
(Other_skill_points > 49 and Other_skill_points <60) ? 18:
(Other_skill_points > 59 and Other_skill_points <80) ? 19: : 20}$
but its broken at the moment and default to -5
omg
if i replace that it works
i tried replace it with just 5, aand then it works
You have to use sameRow() to reference column-data in the same row
that was my next mission ๐ guess i started in the wrong end
Thanks for all the help!
And half of your checks are unnecessary
X <= 0 ? A : X < 6 ? B : C covers the same values as X <= 0 ? A : (X > 0 and X < 6) ? B : C
Because the case with X > 0 is indirectly covered by the previous check
well that would fix that ๐ Thanks
In CSB 3.2.5, has the component Rich Text been dropped?.. can't seem to find it.
No?
Then somethings gone bizzare on me...
tyvm. i knew the question had probably been asked but i couldnโt seem to track it down
The regular console has nothing to say particularly. This is a shot of my Opera GX Issues tab if that helps.
Must have been some kind of glitch. "Off and On Again" fixed it.
Damn, spoke too soon. it's gone again.
The issues tab speaks of "Duplicate form field id"s x6 when I started making a new template.
@formal goblet I'll see if the issue can be recreated in Chrome instead of Opera GX...
how can i get a correct role with this button?
the lookup is not always true, so i want it to revert to Rifles_mod_1 +0
${[1d20x20] + Rifles_mod_1 + lookup('Other_Skills', 'Other_skills_mod', 'Other_skills_name', name_weapon1)}$
This is only a warning by the browser. It shouldn't cause any issues with CSB itself
Use first() with a fallback-value
Problem persisted in Chrome, and survived a reboot of Foundry on the Server.
Thanks!
Hang on... are some components not available for item templates? ..."Actor only"?
Whats the Key in this case? I dont get it.
He means the names you assigned to your variables. 'Active', 'active', 'ACTIVE' are all different from eachother.
try making a label and editing that, it ignores some of the checks, maybe it can help in this case
I see, I checked its 'Active' but it doesnt display the value anyways.
And is it spelled with an Upper A everywhere else?
I ask because I noticed this from the chat...
Yep, we disabled Item Containers in Item Templates
Or Dynamic Tables in Dynamic Tables, but that's more or less it
Which makes sense. Never put a bag of holding into a bag of holding...
...But Rich Text Areas?
RTAs shouldn't be excluded anywhere
I was afraid you'd say that... Am I down to the point of uninstalling and re-installing the system from Foundry?
Well... It would be helpful to know the cause of the issue. Can you disable your modules? You have quite a few active
Trying it... stand by.
Yes I noticed too and corrected IT to suit my case. I think I need to Check again.
had 41 modules, now have none. World restarted, no joy. All components appear present in an Actor Template but Items... ๐ฅ
Wait a second... Is it maybe a user input template? That one actually excludes RTAs
Yes, 'user input template' is the right thing to make templates from, yeah?
I'm sure there's some rationale for No RTA's on items, but if this is deliberate then I'll work around it. Thanks @formal goblet.
In lieu of an RTA, I don't suppose there's a <textarea> available, eh? ... no? yeah, I don't recall seeing that anywhere. ๐
No, that one is only for dialogs ๐
You need to use the equippableItemTemplate for real Item Templates
GAH!! Friggin' mental disability... Sorry to be a bother Martin.
... so when you say that's for dialogs, can I call a user input template from a macro for variables?
You really need to make those links work the first time somehow
You mean because the scroll position is not at the right place? Well...
yep, I know is a problem with the images, but is annoying clicking a link and having to use search afterwards
Go complain to your browser's developers all you want, but being rude here where we aren't responsible won't solve the problem
Sorry it that seems rude. Just saying it's a problem, no idea how to help with that.
Hi someting i hope should be simple but unluckly not for me. how i can add update to field in roll formula, so i cann ad field xdx=xdx+roll
Checked it three times and it doesnt show me a value. I tried it also the other way around:
${Active ? (lookup ('Armor', 'Armor_Protection_Standard', 'Body_Region', 'Kopf')) : 0}$
Also doenst show up. Seems like it doesnt read the checkbox from the Item correctly. When I remove all references to the checkbox it shows me the values.
This is a Swords & Wizardry sheet I'm working on. I'm hiding the thief skills unless the character has the relevant class/level. The assassin has to be level 3 before they will display. As you can see in the first screen shot(where I just set the assassin level to 3), they are displayed but with no values whereas if I reload the template the values are shown. Here is an example of the formula in tsClimbWalls (a hidden attribute):
${first(lookup('tblThiefSkillProgression','colClimbWalls','colLevel',string(numTSkillLvl)))}$
I know it's not a high priority, but I'm a bit curious about this. If I recall correctly, when I asked before, you said the issue was caused by images loading and changing the position of the page. If that's the case, could you add a placeholder element or placeholder image so the screen doesn't need to move as the images load? (This is meant as a legitimate question. I don't know if those kinds of solutions come with to many other downsides or would take too much effort.)
I have a few images on my page. I'm finding that the page starts to render before the images have been loading (which is good), but that the visual effect is not great. Initially the user sees this...
Here at Casper, weโve been working on our front-end performance, primarily focusing on reducing start render time and overall load time. Aโฆ
(I just ctl-f everything, just happy it's pretty well documented)
The docs are a Markdown file for now, I could test this but I'm not sure it would be correctly handled :/
For what it's worth, I agree with BrennKneecleaver's sentiment. This link thing can be annoying, but ctrl+f works well enough and the fact that things are actually well documented is FAR more important than the links being friendly, so I wouldn't lose too much sleep over it if it's not a simple fix.
Sorry to bother again, is there a way to import a dynamic table with the info in it?
I have a secondary page where i want the info to be
Do i make a lookup with just the collunm reff?
I also have this issue. It looks to me like some hidden attributes are not updated unless I reload the sheet manually. Specifically hidden attributes that have formulas that include variables from number fields don't seem to work, not sure about anything else.
Clarification question: Are you saying you want to duplicate a dynamic table from one part of a character sheet to another part of a character sheet? Also, is the information on the table static (e.g. every character is going to have a copy of the table and every copy is going to look the same) or unique to the character?
Oh, also, are you saying you want to duplicate part of a table or the entire thing?
Hi guys anyone gor exampple to make in roll fieldX=Fieldx + roll?
Do you mean a self referential roll?
update other field in a roll
refference pic
and i want it to show the info but in similar
Still a bit confused, but it looks like you have two dynamic tables: One where the details of a skill can be set (primarily the name and the value) and a second that displays the skill's name and value and the name can be clicked to do something. And I take it both of these are on the same sheet (or should be on the same sheet, once you get things figured out)?
they are on the same sheet, just on different tabs, (Roll tab and Level up tab) the one with red lable buttons have a D20+skill.
the number field is calculated and set, and then that number is imported to the roll tab.
Ok. Would you be opposed to handling the skills as items? That way you could just have item containers that reference the appropriate skills?
In a similar vein, is there a reason you need the same table on two different tabs, rather than just including a roll column in the version on the level up tab (or fields for leveling the skill in the version with the roll button)?
Alternatively, depending on how the rest of your sheet is structured, you could also have the skills table outside of the tabs, so it would be visible regardless of which tab you're looking at.
i did it for cosmetic look, as i thought with both point-setting, roll button and roll modifyer did not look good, i think this looks cleaner
i use the dynamic tables for the Other skills, to be able to auto detect Weapon name and add specialisation
Is the name column of the "other skills" section being set programmatically, or is it being manually entered and read/detected somewhere else?
~~Also, I take it there's more to the modifier column then just "-5 if unset (or zero), otherwise the set value"?~~Actually, that's not really important.
What do you think about this solution: Make the modifier label the rollable button (assuming the Other Skills name column needs to stay a text field), then add a visibility formula to the point setting field and a corresponding checkbox, called leveling, somewhere else on the sheet. That way, during play you'll only see the name and modifier columns, and can click the latter to get a roll, but you can make the point setting field appear when it's needed?
they are enterd by the player, as it might be "stone" or "Satanic ritual"
you know what, the "other skills" dont need to be dynamic really.. it can be static, and that would fix the import, and "weapon speciality does not have to show in the roll table
thanks!
I suspect I already know the answer to this, because it's similar to a question I've asked before, but is there a way to take an array or csv of names of selected tokens and display those names, along side some information and selections, in a input prompt template?
I know how to get the names and I can probably figure out how to get the other information. The part I'm struggling with is figuring out how to display them, since I can't know how many targets will be selected in advance.
The only Component would probably be a Label with a Script in it, because we don't have something like a dynamic list component (besides Item Containers and Conditional Modifier Lists)
I figured that would be the case. Unfortunately, I don't think a label would allow me to properly split up the entries or make individual selections for them.
I got a step further. Seems like the function lookup doesnt like richt text formatting. So this works:
${lookup('Armor','Armor_Protection_Standard','Active', 'โ')}$
But I want only the numeric values from Armor_Standart_Protection which have the value** 'Kopf'** in the column **'Body_Region' **and have the value 'โ' in the column **'Activ' **. I tried with filtervalues but I cant get it right. How can I get it to work?
Should it be:
${lookup('Armor','Armor_Protection_Standard','Active', 'โ' , 'Body_Region', 'Kopf')}$ ?
Multiple filter criteria are not possible without a Script: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Dynamic-Tables#2-scripts-for-fetching-values-in-a-dynamic-table
item.WeaponType.includes(lookup('WeaponStack', 'WeaType', 'NameT', WeaponPick))| item.WeaponType.includes("Any")
How is this happening? It seemed to work earlier, but when I moved things around this started happen
Oh and is there a way to hide the name of an item in an item container
So like this then?
%{return Object.values(entity.system.props.Armor) .filter(column => !column2 === Kopf && column7 === โ);}%
I'm trying to change the number with -1 in my number field with a button, the line is ${setPropertyInEntity ('self', "mag_current_1 -1"}$ but nothing is happening, help?
If they did ever need it to be dynamic (i had to do something similar) you could have your first dynamic table, then another with a drop down list that grabs the list of skills from the first dynamic table. Then your other fields in the second table can reference the first table based on whatever you chose in the drop down. If that makes sense.
Looks like you are missing a comma before -1
setPropertyInEntity ('self', "mag_current_1 ", -1)
Well this sets it to -1, I want it to subtract 1 from the number, but I guess I can go setPropertyInEntity ('self', 'mag_current_1 ', "mqg_current -1") and that worked
oh look, its me again!
now im trying to create script to detect the mag-size, how can i incorperate this If-clause?
${[1d20x20] + Rifles_mod_1 + first(lookup('Other_Skills', 'Other_skills_mod', 'Other_skills_name', name_weapon1),0) setPropertyInEntity('self', 'mag_current_1', "mag_current_1 -1")}$
and this
if (mag_current_1 > 0) {
console.log("Out of ammo");
} else {
setPropertyInEntity('self', 'mag_current_1', mag_current_1 - 1);
}
my first idea was
${
if (mag_current_1 > 0) {
console.log("Out of ammo");
} else
{
[1d20x20] + Rifles_mod_1 + first(lookup('Other_Skills', 'Other_skills_mod', 'Other_skills_name', name_weapon1),0)
setPropertyInEntity('self', 'mag_current_1', "mag_current_1 -1")
}}$
But that is wrong
tested it and yea, no
like this?
${'mag_current_1' > 1 ? 'No ammo, Reload! : [1d20x20] + Rifles_mod_1 + first(lookup('Other_Skills', 'Other_skills_mod', 'Other_skills_name', name_weapon1),0)
setPropertyInEntity('self', 'mag_current_1', "mag_current_1 -1")}$
In your case:
%{
return Object.values(entity.system.props.Armor)
.filter(row => !row.deleted && row.Active === 'โ' && row.Body_Region === 'Kopf')
.map(row => row.Armor_Protection_Standard);
}%
everything after [ works
I see multiple issues in that:
- You check a string against a number with a
>-operator. That won't work. You probably meant the variablemag_current_1, so remove the quotes - The expression after
?contains a syntax-error. You have an opening quote without ever closing it. So add'afterReload! [1d20x20]will resolve before the condition gets evaluated, so keep that in mind. It's not an error, just an inconvenience- You cannot write functions next to each other like
lookup() setPropertyInEntity(). You either have to nest them or combine them with an operator. CSB-Formulas should be one-liners
?
lookup(), setPropertyInEntity() is also not allowed, because you don't use them as function arguments like sum(lookup(), setPropertyInEntity())
What I'd suggest is having setPropertyInEntity() in a separate line. You can also handle this one conditionally or you just cap the result to 0
I can't drag and drop anything into a tabbed panel. Is this intentional?
It works so far ๐ So how is it possible to sum the values of the returning array? And can I addionally also return the values of the row.Body_Region === 'Ganzkรถrper'?
I tried to ${sum(...)}$ the whole thing, it didnt like it ๐
%{
return Object.values(entity.system.props.Armor)
.filter(row => !row.deleted && row.Active === 'โ' && (row.Body_Region === 'Kopf' || row.Body_Region === 'Ganzkรถrper'))
.reduce((acc, row) => acc + Number(row.Armor_Protection_Standard), 0);
}%
You probably need a panel in it. But I'd say it is a bug, because you can create other components at this place...
Yeah... Ironically, what I tried to drag and drop was a panel.
This doesnt work:
.recude((acc, row) => acc + row.Armor_Protection_Standard, 0);
}%
When I use:
.map(row => row.Armor_Protection_Standard);
It returnes me the values as an array so I guess it correlates with .reduce.
sry, typo ๐
. Should be reduce()
The reduce() method of Array instances executes a user-supplied "reducer" callback function on each element of the array, in order, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements of the array is a single value.
Anyone know the CSS tags to use if I want to customize the look of when a label is rollable?
Glad that typos also happen to pros, but didnt do the job ๐ It should be an 18
I've edited it
awesome! Thanks alot, I would be complete lost with that without you ๐
Are you able to use the selected tokens info as a parameter?
I dunno exactly what you're doing but it sounds like you need a function that does a cycle and returns your label script so that it can be dynamically formatted around the number of tokens
Martin told me how to do it a few days ago so you can look up my past messages
someone came up with idea for luck/reroll? something like button to comit button to reroll
so i have removed the set property, but still it ignores my check and just roll the die
What's the best method of adjusting an actor's properties by macro again please?
Check 3rd part: #1037072885044477962 message
There are multiple ways, but all of them will have to use Actor#update() from Foundry
My idea was to have a prompt template that could take the array of targeted tokens, put and let the player choose how to treat each one (e.g. split them between allied and enemy groups, or apply bonus damage to some of them). The issue here is that I can't know how many targets they'll have in advance, so I can't do something like prepare a dynamic table with a line for each target. I could have a label (or several other types of elements) display the full list of targets, but that doesn't help with the interaction side of things.
sorry i cant do it, i do not get it.
The only idea I'd have would be a custom dialog you call in the Label Roll Message, but that would require some work ofc
all i have this far is still
${mag_current_1 > 1 ? 'No ammo, Reload!' : ([1d20x20] + Rifles_mod_1 + first(lookup('Other_Skills', 'Other_skills_mod', 'Other_skills_name', name_weapon1), 0))}$
${mag_current_1 > 1 ? 'Pang!' : setPropertyInEntity('self', 'mag_current_1', mag_current_1 - 1)}$
i cant seem to wrap my head around it
${#rollFormula:= mag_current_1 < 1 ? '0' : '1d20x20'}$`
${mag_current_1 < 1 ? ... : [:rollFormula:] + ...}$
...
I may be misremembering something, but I thought all parts of a CSB ternary function get executed, every time, and it's just that one half doesn't get returned, so won't the setPropertyInEntity() always trigger?
That was also a misunderstanding on my part, but it seems that normal functions behave as expected. It's just that special expressions like roll formulas and user inputs are all executed prior
Yeah. My conclusion was that it seems to be one of the few things that's not actually possible in CSB (without coding my own component or something similar). Fortunately, it's just a relatively minor QoL thing, so I can skip it without too much pain.
Can I not use replaceAll in a rollMessage? I get a text.relpaceAll is not a function in the console.
${str1:=replaceAll(string(lookup('invCarried','colAmmoDialog','colAmmoType',item.rangeType)),',','|')}$
and
replaceAll(string(str1),',','|')}$```
both generate that error. If I take the replaceAll out the initial string resolves as expected.
You should be... I'll check that later
Ok, thanks! Off to work for me now ๐ฆ
You wouldn't need a Custom Component, you'd only need to generate a Dialog with the help of the Foundry-API.
It would appear that the initial string passed to replaceAll has to be either a static string or a key to a field (as is stated in the docs). I was just assuming I could use a declared variable with it in the roll message. rtfm moment. I just tried both within the roll message and they worked.
Could you show me the formula for a static example for two targets determined arbitrarly?
Do you mean the formula for getting the targets or how displaying the targets would work, if I knew I'd have specifically two targets?
Yes. Assume the situation is static, what's the formula you want to achieve?
I am assuming you have your array of targets already as you stated
The latter
If I knew would be dealing with n targets, I'd create a dynamic table with n lines. I could use the line number to set the name from the array, ten each line could have a check box for the different groups. Assuming I set it up for two groups, there's be a pair of final formulas that go throw the lines of the table and add the entry in the name column to an array if the appropriate box was checked. Probably something like ${ATargets:=lookup(TargetTable,'name','groupA','true')}$.
I see. My method won't quite work for you then sorry ๐
Why aren't you just making a dynamic table with 20 lines and some of then will stay empty?
Because I'd prefer an elegant solution that I know will work properly over a kind-of clunky and uggly solution that might fail under extreme conditions.
Just wanted to drop this here. A week or so ago I was wanting to pull values from seven stances and put them in a dynamic table that could then be pulled from for drop downs. It was a niche situation, I know, but I figured out a method for doing it that was fairly simple.
In my situation I have seven stances that each have their own name, form, and style. To get the stance name into the dynamic table, I first made a label called "stance_list" which I used ${concat(stancename1,',',stancename2,',',stancename3.... to make a csv string.
Then in the dynamic table, I made a column a label and used this formula:
%{return '${stance_list}$'.split(',').slice(${sameRowIndex()}$,${sameRowIndex()+1}$)}%
This will split the CSV into an array and pull the value that corresponds to the row index number
My situation is one where it is a static situation where there will not be more than 7 stances (unless more expansions to the game allows for that at which point... I will add them)
Wait, remind me, are the stances in your system the ones with fixed names and details or the ones set by players?
Hello, appears the lookup function returns an array, and I can't set that to a variable. Anyway around this?
I could have sworn variables could hold arrays. What are you trying to do with this?
${roll=:lookup('PrimaryEquip', 'itemdamage', 'itemequip', 'Yes')}$ gets an error in the console, saying it expected a string/bool/int
In Panic at the Dojo, stances are built by the players based on certain rules. Stance Name technically should be fixed based on style and form selected, but most go for flavorful names so I have that as a text field where players can type what they want (with certain characters like commas and apostrophes being restricted).
The style is selected from a specific list depending on what archetype they chose (each archetyp has three styles). The form is selected from a set list of 12 or 13 (with a few more coming in a planned expansion).
Once they have selected a name, a style, and a form, the stance generally does not change.
At level one they have access to three stances, chosing each round which stance to go into (so only one stance active at a time). At level 10, they will have access to seven stances and can choose to have two active at once.
So my plan is, feed stance name, style,, and form into a dynamic table, and then for level 10, they will have a tab that has two drop downs that they can select stances by stance names. What they select will flow to style and form labels via lookup(), which will then feed all of the other relevant info
I don't think the issue you're running into is with arrays in variables (I just tested it myself and it works fine). I suspect the actual issue is one of your parameters returning an unexpected value. Maybe try without the filtering, to see if it works and then rebuild the filter?
:= is the operator
I feel silly for missing that.
I'm going to go with martin's solution on this. Why not just make the stances Items, and feed an item container (plus a blank space) into the two drop downs, then fill the appropriate info from the selected item, rather than a dynamic table. You can even stick to a single page of information. Before level 10, they can use one of the dropdowns to see info on their selected stance and leave the second blank (you could even hide it with the visibility field), so they don't have to deal with extra information. Then, once they hit level 10 they can just start using the second dropdown.
My simple answer: I coded myself into this corner in my ignorance and I like it here. Honestly, this works well for what I need in my limited scope of programming. There is also some sunk cost falacy happening here where I have already invested a lot of time building the various tables I reference from and I believe that what I have built is quite user friendly while also enforcing the rules of the game. Once I am done with this, someone else in that community is more than welcome to take what I did and convert it to items or whatever.
I can definitely sympathize with that sentiment. I learned a lot between when I first started building my character sheets and now and a lot of the stuff I did originally does not hold up.
I am coming mostly from a sql and excel vba background. I like tables and vlookup and xlookup. I think my table designs are not terrible.
@formal goblet Sorry to bother you, but is there something going on with the 'Configure Active Effects' screen (when setting up a character template)? I could have sworn there was a blank row, for effects not connected to a defined status condition, but now I'm not seeing it. I think I also recall you mentioning something about that screen being bugged or under development, but I'm not sure.
For context, I want to make a couple of feature request that relate to that screen, and active effects in general, but I want to make sure the information I'm basing the request on is correct, first,
It was fixed with the latest version, so you should be able to create modifiers for active effects again
Thanks for that, the lookup function itself after that := isn't returning any value to be stored. Does this have anything to do with the lookup function returning arrays
In the lookup function, on the 4th input you put a value to compare to something else. If you are comparing it to a boolean, what does the value need to be? I've tried 'true' and 1
I've also converted the label text to show Yes on true, which you can see I also tried
That shouldn't be an issue
It should be true without quotes
Not exactly. It returns ['1d8']
You can use first() to convert it to '1d8'
Not getting it to return anything, even if I take the conditions off. I guess it's not finding the table, but not sure.
The roll label is on an item attached to the actor with the container
Ah, that won't work. Items and Actors are separate by design, so Strength in Item and Strength in Actor can be 2 different things
You might want to use fetchFromActor() to use props from an Actor
Hey, speaking of lookup on Dynamic Tables, how do I get the length? ${lookup('Apt_Spec','Concentration_Num').length}$ is not working.
Surround it with count() instead of using .length
Thank you!
If the lable is in an item container, shouldn't they be able to use item.[key]?
Yes, but that would require the Label to be in the Container, not in the Item
So while this code technically works, I'm sure there has to be a better way to do this. First off it is a blob in the roll message, which isn't a big deal I use Notepad++ and paste but more importantly for a reason beyond my ken (I'm a total noob to js) it wouldn't let me concatenate in " (either by ' " ' or "\"") on the .map line (unexpected non-whitespace character), hence the * and the replaceAll outside the script. This code is in a label on an item list that brings up a menu to allow the user to select the ammo used with a ranged weapon. Any advice would be appreciated because at this point in time js syntax just messes with me.
%{const itemTemplateName = '_weaponTemplate';
const itemTemplateId = game.items.getName(itemTemplateName).id;
const strAmmoType = '${sameRow('wpnAmmoName')}$';
return '|' + entity.items
.filter(item => item.system.template === itemTemplateId && item.system.props.eqpLocation
=== 'Carried' && item.system.props.wpnType === 'Ammo'&& item.system.props.rangeType === strAmmoType)
.map(item => '*'+item.system.props.name+'*,*'+item.system.props.name+'*')
.join("|");}%
,'*','\"')}$}}$```
Good to know. Let me just double check that I understand everything correclty: Active Effects are defined on in a character sheet template and they, effectively, function like Item Modifiers, except instead of being tied to an Item, they're tied to one of the defined status conditions. This means their effects are binary and determined by whether a condition has been applied or not. You also can't add active effects that aren't tied to conditions, nor can you define them on the character sheet or via an item, even if you wanted to make changes to an effect tied to an existing condition.
Does that sound about right?
Yep, pretty much it. I wanted to change that in the future, so that the changes-field in each Effect will have an effect on the props
And I also wanted to see if our current modifiers can be replaced with Active Effects
Ah. I'm thinking about making feature requests for a generic active effect (that isn't tied to one of the conditions), "triggers" field that could be something like "on application, on combat start, on turn start, or on turn end", and the ability to add new active effects (or new entries for existing active effects) from a character sheet or item. That way you could do something like have an item that automatically adds 30 Barrier at the start of combat.
The changes itself are not big, but I also want to have it compatible with most modules, which do things with Active Effects. So I'm missing a concept, which would accomplish that
Honestly, the way foundry, and some of the modules, describe active effects is a little confusing, so I can definitely sympathize. (I'm actually still not sure how they're supposed to work in a regular system and without modules.)
I saw that, but I wasn't sure if it applied to this, since it seems like its template defined and I'm having a hard time picturing how it would be implemented by users. If I understand it correctly, it would be it's own type of effect, with its own menu and I'm not entirely sure how you'd get from there to an active effect, label, or anything else. (Part of the problem is how the "action field" is being defined in a fairly technically way, where as, naively, I think I'd want it to be something like "Trigger this label" or "run this formula I've entered" or "perform the effect listed for this Active Effect". Also, in that last case, it seems like it would be simpler to just have a "trigger" drop down in the active effect menu.
(Just to be clear, that is very likely a result of how it's being described in the feature request, which needs to make more sense to you guys anyways, rather than a deficiency in the proposed feature.)
The framework would be the same with "On which event do I react?" and "What do I do?". In this case, "On every Turn, update the Actor by subtracting 2 from his current HP". Having that configuration in an Active Effect config would be useful
Makes sense and that sounds like what I would have been asking for, so I'm glad I checked.
${setPropertyInEntity('attached', 'mana', "manac - 10")}$
This returns the value I desire, but won't set the property... Am I missing something?
Is it an Input Component you want to change the value of?
number field
Seems fine
I've got a conditional in a roll message but it keeps rolling both and only putting in the chat the one that meets the condition, but the dice for both true and false appear on the screen. Any way to fix that?
O! I've never seen this page. Thank you!
that worked, thanks for the advice. is there a way to make it not go behind the chat box?
Any syntax to refresh a page after a button click, or to cancel the rest of the output of a roll message
Wait, can we now set the current value on number fields? I thought you could only set labels and meters?
Unfortunately, I don't know about that one. It seems like something the module should handle automatically.
Is it possible to format the buttons to be single spaced instead of double spaced? Looking at the rich text formatting options built into the editor, I am not finding it, but I am not sure if it can be done through code instead.
I use custom css module to format things like this
I am not familiar with CSS yet, can you possibly provide an example I can then cannibalize?
If not, I understand
Hello! I'm trying to install Custom System Builder into my Foundry by using the following link:
https://gitlab.com/custom-system-builder/custom-system-builder/-/raw/3.2.5/system.json
But I keep receiving this error! Can anyone help me get a handle on understanding why I'm getting this?
I'm currently using v11 Foundry
You should install it as a system, not module
Bless you. Thank you so much! It's a friend of mine using my Foundry and they informed me it was a module. I will correct them lmfao.
Hi, by any chance anybody has made the template for ryuutama?
hey, as a question, is there a general guide or video or some sort of entry level explanation of the capabilities of CSB?
@formal goblet Is that only my issue? Dynamic table and Item container
Showing irellevant data for values if such values do not exist (I think it takes value from prev item which contain such info)
Some items do not contain field sub_class at all in their template
but Dynamic table showing the data as ENERGETIC_DEFENCE
Try out game.actors.getName('actorName').items.getName('itemName').system.props in the console and check the props of the items
So no field sub_class here
But in table it's showing from other item
which have such value
This one has such field
and such value was populated for other items in a table
Well, I'd say the most important sources would be:
@formal goblet any Idea why that happen? it broking all sorting options ๐ because set incorrect data to NONE existed values)
Seems to be a bug. I've added it to our tickets.
You can work around this issue by specifying a hidden attribute with the same key in the Item Template, which doesn't have sub_class and assign it an empty value
Hate to bother, @formal goblet I've been out of the game for a while. How close is the V12 compatable release?
No estimation for now
Hi!
I'm adding an item that has a dropdown list as one of the components and I want to show the label of the dropdown option on the item_container, but using item.component shows only the key, what should I use?
Thanks!
CSB only saves the option key in the props
Thanks, I'll have to use formulas then
How would I change the font color in a dropdown menu? ๐
Never mind! I found it!
${lowmana==1 ? 'Not enough mana...' : setPropertyInEntity('attached', 'mana', "currMana - 10")}$
I've got this conditional firing and when it's false, the setpropertyentity returns the correct value to be set but in the sheet itself the value isn't changed.
Can properties be set within conditionals?
EDIT after some testing I've found that setPropertyInEntity() doesn't actually change the property. I've tried multiple properties, I seperated the function from the conditional, might be a bug.
example -
${setPropertyInEntity('attached', 'health', 10)}$ I click a button in an item attached to an actor that has this code in its label message. The message outputs 10 but the health property retains its original value.
Hello Group, maybe someone already reach same issue and will be able to help with that ๐
I have same formula added into Label Text and Label Roll Message... for second one I see output as proper result, but for first one is completely empty ๐ฆ
There is no error in debug window...
You're using 'attached' so I'm guessing this is on an item. Is 'lowmana' also on the item or is it on the actor?
Hello again! Quick question. is it possible to make a text field only editable by GM?
lowmana is a temp variable I set earlier in the label roll message
Not to my knowledge. Here's the workaround that I use:
Make a Tabbed Panel with two tabs: one for the players and one only visible to the GM.
Anything that you don't want the players to be able to change, put it in the GM tab. Then make a Label on the player tab that prints what you've set in the GM tab.
Hello @formal goblet, maybe you have any clue why that could happen?
I saw in the Example that you use already simillar approach with old style "fetchTable", so its possible, but...
Is there a way to get the actor sheets to become their own browser tab, or separated from foundry in another way, so that they don't have to be bound to the table top and blocking vision of the game table?
There is module called "Pop-Out" it allows you to put sheets and journals and just about everything else into it's own browser window.
I think you can also set it to make tabs instead.
Does anyone know a way to make four sections of color for a meter? I would like the meter to be green up to a certain number, then yellow if a little higher, then orange, then red.
Is there currency or money in Custom System Builder?
quick Q!
how do you completely clear dynamic table via %{ ... }%? I've been struggling.
I tried setting .$deleted and .deleted for each row to true; the row does disappear, but the data remains. :c
Never mind! Thanks to this post here: #1037072885044477962 message
I don't know if there's an "official" way, but I've found that you can do stuff like this through custom CSS
hi, so i have a dropdown list
I want to concat a few hardcoded options into the dropdown list since it's an edge case, this is my failed attempt so far
${
concat(
fetchFromActor('GM Panel', "lookup('all_skill_table', 'all_skills')"),
',ATK,DEF,EVA,HEA,UTL,ALL'
)
}$```
This is the error
Any ideas or pointers as to how I would do this?
I'm pretty new to CSS. Do you know which tags to use? I've got my meter setup for custom css but I'm not sure how to manipulate the color of the fill.
I ended up having to add a new parameter to the meter component. But it's working!
So I'm using setPropertyInEntity() on a number field from a roll message in a user input dialog. It sets the value of the number field (I know this because if I close and reopen the dialog the field has the updated value) but the display of the field does not update initially.
${concat(name,' rolls a ',string(attributeRoll),' for STR')}$
${setPropertyInEntity('self','numSTR','string(attributeRoll)','3')}$
${%{entity.entity.update();}%}$'```
How do I force a 'refresh'? The entity.entity.update(); shown above obviously didn't work. I'm running into this in other areas of the sheet also and in those instances it's cured by manually reloading the template(which I'm sure there is a way to do in %{script}% I just havent figured out how) but with a dialog that approach wont work because it will clear the dialog. This is the biggest issue I've been banging my head against- how do I get stuff to refresh from code? I've tried recalculate() in instances, but it never seems to work.
You could make an item for each type of coin, with a 'quantity' number field to track how many each player has
Hi again. Is there a way to change the default rotating pause icon to something else? I noticed D&D and Baileywiki both have custom ones. I imagine other systems/creators also do.
Does this work?
${
concat(
string(fetchFromActor('GM Panel', "lookup('all_skill_table', 'all_skills')")),
',ATK,DEF,EVA,HEA,UTL,ALL'
)
}$```
heyo! I noticed that after a recent update to csb, there is a significant delay in updating values to my character sheet's stats. I use an item with a checkbox to determine if it is equipped, send a flat number to a hidden attribute, and then have the character sheet display the value or display 5 if it has gone over that in a label within a table. This number is taking ages to update now (unless I force a character sheet refresh), where before it was instant even without a refresh.
Foundry is sending me this error too:
Is there maybe something with how I have this set up that doesn't work anymore? Or is this a bug I should report?
omg I would love to know that too. I have also experienced this after updating.
I have, for example, a Label element that simply echoes a value from elsewhere (I believe it's just something like ${value_evasion}$) but even when the parameter changes properly, that label does not until I refresh the document. It's so strange.
There's a few modules for that; it's not a CSB thing afaik
Alternative Pause Icon, an Add-on Module for Foundry Virtual Tabletop
Also, is there a way to allow my players to refresh their own character sheets? I'd like them to be able to do that when issues like the delay in updated stats happen
How can I apply multiple conditions to a dynamic table lookup?
I have a table of "gifts" that have a type and value and I want to return the name of those that have a specific type and a value greater than 0
I figured out the reason, this is the fix
${
Math.concat(
fetchFromActor('GM Panel', "lookup('all_skill_table', 'all_skills')"),
',ATK,DEF,EVA,HEA,UTL,ALL'
)
}$```
needed to add Math. to concat()
oh yeah, that's a better different concat function, nice
I feel like this is something I should be able to figure out but I'm not getting it: How do I change the actor sheet background to an image on my local drive?
I highly encourage you to use the Item Piles module. You can make a currency with that, as well as merchants and items that your players can drop and pick up from the map.
Custom CSS. if you have not already done so, enable the custom CSS module in your world. then use the below;
background: url("path to your image");
}```
Is it possible to animate an element only when the player scrolls to it? Decided to animate some of my headers for a bit of style, but the animation ends before the player scrolls down to it.
Thanks! But I'm getting stuck at the path part. I can get an image of the internet no problem but when trying to reference a local file, nothing is working.
This is what I have:
background-image: url("file:///C:\Users\jorda\Desktop\sheetBackground.png");
I noticed this too
%{
let actor = game.actors.find(actor => actor.name === "${name}$");
let actor_skills = Object.values(actor.system.props.skills);
console.log(actor_skills);
for (let actor_skill of actor_skills) {
console.log(actor_skill.proficiency);
}
}%```
Hi, I'm struggling with a bug that doesn't let me access the properties of an entry in dynamic table. `console.log(actor_skills)` works properly but it cannot access any properties inside like `actor_skill.proficiency`. Is there any solution to this?
Above is console.log(actor_skills), below is console.log(actor_skill.proficiency).
Okay, after checking, it seems that if I use ${name}$, the javascript delimiter cannot draw data from a label type field in a dynamic text
Specifically label type field, if its text field it functions perfectly, if its numebr field it functions perfectly
When I hardcoded the name of the actor, it can draw data from label type field
When I use ${name}$, it is unable to draw data from label type field
ahh, yes the image path, that got me stuck for a bit an example below. Notice the slashes in the path are forward slashes not back slashes. background-image: url("/images/anotherfolder/backgroundimage.jpg");
You can remove the first line and use entity instead of actor in the second line.
I can only guess the second issue. I guess you're using this Script in a Label and not in a Label Roll Message. You can do that, but you also have to consider the case, where computable values are not computed yet. That means, you have to work with potentially undefined values. You should throw an UncomputableError error to signal, that the Script doesn't have all props available that are needed. In this case, the system will attempt to recompute this in the next computation-cycle
Currently only with a little Script, because the lookup()-function can only take 1 filter criteria
You can configure this in the game settings
In Scripts, it's entity.reloadTemplate()
When writing in a Label Text with the rich text editor, what is the preferred Source syntax for inserting images? I thought it would be the same as referencing assets with Sequencer, like data/worlds/<worldname>/<nameoffile.xxx> but that doesn't seem to be the case.
I haven't tested the case with having Label Roll Messages in User Input Dialogs
I can't tell exactly, but I'd try to do it directly with <img>-tags instead of going through an RTE.
I'll try that.
FWIW, it worked by dropping the data/ from the beginning of the string.
Now, is there any way to get the image to show without a black border around it?
Set it to 0 with styles or CSS
Aye, I've been working with Judson to get a Panic at the Dojo system setup that has a Global Actor + Item Containers. I don't come from a Dev background.
I've managed to create a Global Actor which has a Dynamic Table with a list for all the Forms as shown on the first image, then on the second image. I've made a stance item that has a Dropdown which fetches from the Global Actor the list of all the available forms, below is a button that fetches all the values from the action_dice_label column...
What would be the way to have it so the button only fetches the action_dice_label from the Row the dropdown has selected?
Extend the lookup()-function to use 4 arguments instead of only 2. The additional 2 are specifying the filter criterium.
AHHH!! Okay, I get it now. Yeah, that makes alot of sense. Thanks for the help fam!
Alright, I've got the basic idea down. Those for the form_selector key, I need to make it so the lookup function references the actor data of the item dropdown which the button is within the same actor.
The last example of this should give you an idea: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#317-execution-context
Sorry to bug, but I'm practically lost. I've tried formulating with the last example, those it only came up with an Error. Any idea what the issue could be?
${fetchFromActor('Global Actor', "lookup('form_table', 'action_dice_label', 'form_name', fetchFromActor('selected', "${form_selected}$"))")}$
Only way I've managed to get it not erroring is through the following code. Those I'm also not 100% sure if it's the correct way to fetch the dropdown from within the item container itself.
${fetchFromActor('Global Actor', "lookup('form_table', 'action_dice_label', 'form_name', fetchFromActor('Stance 1', 'form_selected'))")}$
I've tried it with the slashes both ways. I think that example you are giving me is a relative path. I can't find where Custom-CSS keeps that css file, so I have been trying to do an absolute path.
I've got a Roll Message setup to change a radio button group on a targeted actor. I have 2 issue:
-
I can't get button to fill in as it would if you clicked it, but I do know that stats have changed as if it were clicked.
-
It doesn't work on wildcard tokens whose token isn't "linked to actor data".
Any way to fix these problems?
Remove the second fetchFromActor() and keep the inner Formula ๐
Is it not possible to put premade things into a tabbed panel?
Go into your foundry folder>then the data folder and create a new folder called images inside and inside that a subfolder for your world (if required), copy your image there. The previous link format will then work. It needs to be done this way to work as the image needs to exist within Foundry as an asset. so in this case you created the image on your desktop and have a path to that file, the issue is when your player clicks on the link you created they will get an error as that file location does not exist on that player's computer, so it needs to exist in foundry.
Ohhhh. . . ๐ . Yeah, that would explain it. Now all I need is a way to fetch the dropdown component key from within the same item. Just need to find the right syntax for it.
Uhm... is that even an issue? The component key is static, so you can just use that to fetch the current value of the Dropdown
I've tried utilising the fetchFromActor() function with the Item Name and the Dropdown Component key on a seperate label with no result of the value. I'll put a screenshot out after I finish work.
Thanks!
Awesome! Thank you for your help!
How would I throw the UncomputableError signal? I'm not familiar with exceptions on javascript
Hey folks - I'm just wondering about v12 compatibility (and at a very, very broad timeline). I see it's in the issue tracker, but timeline-wise, are we talking on the scale of "weeks" or "months"? I only ask because I'm helping to playtest an in-development/upcoming ruleset and CSB feels like a great fit for being able to iterate/tweak/etc., but I want to know if I should just go ahead and do it up in v11 or if we should just keep doing it manually until a v12 exists. We're likely not having our first session for a month or so which is why I ask. :p
Or, alternatively, if the expectation is that migrations won't require a big re-do from scratch (as I'm painfully doing for FFG Star Wars for another game) I'll get started with v11. :p
Thanks - and appreciate the work on this, it had somehow escaped my notice for two years and I'm kind of blown away at how versatile it is!
throw new UncomputableError('errorMessage');
We expect to stay a while on V11, but can't give an estimation on how long it will take. But what I can say, is, that you won't really need to migrate stuff from V11 to V12. Either changes will not affect Templates and stuff or the migration process will be handled automatically. So you should be able to start with V11 without redoing stuff for V12
Thank you!
Cheers, thank you - I'll get rolling on it. ๐ Appreciate the response!
I was trying to move a dynamic table into a tabbed panel as it seems to not work, is this a bug or is a specific method needed to make this work?
Has anyone ever succeeded in using automated animations with CSB?
I need some help thinking through a solution for this problem.
I have a list of actors (monsters), each of which has a unique rollable table (loot drops). I'd like for the monster actor template to include a label roll message that, when clicked on each actor's sheet, rolls on the respective actor's loot roll table.
Obviously, I can't include individual actor roll table references in the template [#<rollTable>] because it will only work for the one monster.
You have to create tables and panels within tabbed panel, stuff can't be moved in
You can make the table/panel and move all the contents after though
Does anyone know if you have to do something special with setPropertyInEntity for the function to set a property to a value
Then you need either Roll Tables for each monster or you create your own lookup table (Dynamic Table) with entries for each monster
Each monster already has their own Roll Table.
- The target field must be an input component and cannot be a Label
- Option keys in Dropdowns and Radio Buttons cannot be numbers (is more or less a bug right now)
Then if your Roll Tables have the same name as your monster sheets, this here should work: ${[#${name}$]}$
I've tried number fields, text fields, and the meter. Also through items or on a button right next to the component. https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/380 I made a post of exactly what I did
So if I place that line in the template label roll message as-is, it should look up different monster roll tables?
Which version of CSB is that?
Yup
Does it matter if there are spaces in any of the names?
Dunno, but I don't think so
I'll give it a try later, thanks.
3.2.5, the latest I believe
Try out game.actors.getName('actorName').system.props in the console and check the component key in question
I did so, but the values for the components in this list don't match what's currently in the sheet
the values in the list also don't match anything I've tried to set them to
But these are the values which are stored
Are you working with linked or unlinked actor data? Those work different for Tokens
If you really want to make sure, that setPropertyInEntity() works, you can create a separate Template with a separate Actor (not Token) with only 1 Input Component and 1 Label for testing.
I wanted to let you know that spaces do not matter, and the roll works for each monster individually, so thank you for that.
The only thing (and this is a minor QoL complaint) is that the result in the chat looks different when made from label roll message on the monster sheet compared to rolling on the table directly.
left is the sheet roll, right is straight from the roll table.
I don't think there's any way to make the former look like the latter, is there?
It's possible if you use a Script to work with the Foundry API directly.
Yeah, I wouldn't know the first thing about how to do that. Heh.
Didn't realize the link actor data on the token config, I just dragged over the actor into the map. Thanks for the info
I'm tearing my hair out with an issue I can't get to the bottom of. I'm creating a dropdown list of modifiers during a die roll and it works, right up until I add the final "+5" modifier.
<h2>Psychic Strength<h2>
${#concat(
?{power_level:"Power Level"|"ceil(${psy_rating}$/2)","Fettered"|"${psy_rating}$","Unfettered"|"${psy_rating+1}$","Push +1"|"${psy_rating+2}$","Push +2"|"${psy_rating+3}$","Push +3"|"${psy_rating+4}$","Push +4 (Daemonic/Unbound Only)"|"${psy_rating+5}$","Push +5 (Unbound Only)"},
string?{other:"Other Modifiers"[number]})
)}$
${#psychic_strength:=(power_level + other)*5}$
${!roll:=[1d100]}$ vs ${wp_current + psychic_strength}$<br>```
This behaves as expected, until I add the +5 modifier, and then it does this for every option:
(I also realise the ceil is wrong, I've not gotten around to making that work)
I'm very tired at this point so maybe I'm missing something really stupid but I can't see any differences that would make this specific error happen.
When working correctly it does this:
Which CSB-version?
3.0.0 currently
There was a bug, where if there are more than 10 Formulas, it would bail out a bit.
But that got fixed with one of the newer versions
Awesome, thank you very much
Anyone have any experience with using advanced macros module for animations?
OKAY, I've managed to figure out one of the roadblocks that I was having. Pretty much tldr, you cannot have Underscores in a dropdown component key.
The biggest issue those is that I still can't yet figure out how to get the dropdown to fetch the data from the Global Actor to the Item... I'll perform more stress tests to see if I can make it work.
for (let actor_skill of actor_skills) {
if (actor_skill.deleted || !gm_panel_skill_list.has(actor_skill.skill)) continue;
// If proficiency value is not yet calculated, throw exception that lets it wait until next cycle.
if (typeof actor_skill.proficiency === "undefined") {
throw new UncomputableError('Actor Skill Proficiency is not calculated.');
}
if (actor_skill.proficiency > highest_skill_proficiency) {
highest_skill_proficiency = actor_skill.proficiency;
}
}
I am indeed using the script in a Label and not Label Roll Message. I tried using UncomputableError and it says it is not defined above, any pointers?
For reference, my actor sheet does require two loops to fully refresh
Damn, didn't expect that... Does it work with the Error-class? Otherwise I have to think about a different solution...
throw new Error('Actor Skill Proficiency is not calculated.');```
`Error` works, but well, it just outputs the content of the error message being `Actor Skill Proficiency is not calculated.`.
Guess I'll think about something at a later time (Holo takes priority ๐บ )
That indeed works now, thank you ๐
One thing for sure, drawing data from text field in dynamic table works, drawing data from label field in dynamic table returns undefined
And said label field's value can be affected by third party items
That's because Input Components don't rely on derived data, Labels on the other hand can depend on other fields
has anyone used the submitted deathwatch sheet and had trouble with the weapons page/table and attack rolls? as far as I can tell it displays the corresponding weapon or ballistic skill but no way to roll to attack or for damage. I might be missing something.
Check the console for errors
I believe it's supposed to roll damage at the same time. To be honest I had issues trying to use the Deathwatch sheet as a base for writing Black Crusade stuff so I went in a different direction, it was helpful to get started but I ended up doing things like splitting the attack and damage rolls into separate buttons and using the alternative roll function to swap between melee and ranged.
I'll be patiently waiting for potential solution then ๐
(I'm not saying mine is the best of course, there's probably better ways than my implimentation, but it works lol)
Although speaking of which, I'm trying to have a Success/Critical Success or Failure/Critical Failure display when a roll is made. I've been able to do them seperately, but if I'm understanding this correctly on the gitlab page:
${roll <= target ? (roll % 11 == 0 ? 'Critical success !' : 'Success') : (roll % 11 == 0 ? 'Critical fail !' : 'Fail')}$
I should be able to merge it all into one line, so only regualar or critical successes and failure display? I've tried this way:
${!roll<=ws_current + combat_actions ? (roll==01 'Critical Success!' : 'Success') : (roll==100 'Critical Failure!' : 'Failure')}$
And nothing happens when I make the roll, if I change all the rolls to !roll then I get an error in the console saying it was expecting a value.
So I've not understood something I assume, what have I done wrong here? Thank you.
I suppose whilst I'm at it, is it possible to change the colour of a specific text here, so criticals were in red for instance?
<p style="color: red">I am a red text</p>
Thank you ๐
The conditions in the second example are messy. You want to make sure, that you have the following structure at all times: <condition (usually a comparison between 2 values)> ? <statement if condition is true> : <statement if condition is false>
For clarity this is the entire roll for attacks currently:
<h2> Attack Roll </h2>
${#concat(
?{attack:"Attack Type"|"10","Standard"|"30","All Out Attack"|"-20","Called Shot"|"20","Charge"|"-10","Lightning Attack"|"0","Swift Attack"},
?{con:"Concentrate Action"|"0","N/A"|"10","Aim (Half Action)"|"20","Aim (Full Action)"|"0","Called Shot"|"0","Other (Apply Below)"},
string{?{other:"Other Modifiers"[number]})
)}$
${#combat_actions:=attack + con + other}$
${!roll:=[1d100]}$ vs ${ws_current + combat_actions}$<br>
<h2>${!roll<=ws_current + combat_actions ? 'Success' : 'Failure'}$</h2>
<b style="font-size:18px;">${!roll<=01 ? 'Critical Success!' : roll>=100 ? "Critical Failure!" : " "}$</b>
<p><strong>Degree of Success/Failure:</strong> ${!floor((ws_current + combat_actions - roll)/10)}$</p>
${#tens:=floor(roll/10)}$
${#units:=roll-(floor(roll/10)*10)}$
${#loc:=(units*10)+tens}$
<p><strong>Hit Location:</strong> ${!loc < 11 ? 'Head' : loc < 21 ? 'Right Arm' : loc < 31 ? 'Left Arm' : loc < 71 ? 'Body' : loc < 86 ? 'Right Leg' : 'Left Leg'}$</p>```
I'm happy to take your word for it that the conditions (and more, probably) are messy but I don't understand what cleaning that up entails. In this case the roll is displaying a d100 roll vs the required target including modifiers. It then takes the d100 result + the modifiers to display if it is a success or failure, then takes the d100 roll alone to determine if it's a critical success or failure or not. So I need to be able to separate the d100 and the modifiers if I'm going to display criticals, as far as I understand.
I'm hoping to merge some lines together so that rather than multiple lines to declare a result and then if the result is a critical or not, it just displays the final result, be it a critical or otherwise, which is what I believe the first example in my previous post does. I ideally want to do the same with weapon jams in the ranged version of this too.
How do I pass a variable from a label's roll message to a User Input Template? The template is being called in the same roll message.
good afternoon, an easy question I guess for those who are more in Foundry then me ๐
how I can track back and find specific Items of Actor who is owner of Item from which function shall be run?
If I will run action from character sheet level I can go as Actor.Items and work on collection... but how to identify Owner of the Item and then catch an array of all owned items or all items with specific parameter?
You're missing question-marks there
So I am, thank you, that's working now ๐
Let's say that User Input Templates currently ignore local variables ๐ I'll see if I can include them
The Items in an Actor are always owned by the Actor, who is holding them. If a User owns an Actor, he automatically also owns the Items in this Actor
Thats understood. Maybe I wrote it wrong.
Question question is how to access all items owned by Actor from level of one of his items.
Is it possible to change label text from a roll message? I tried setPropertyInEntity but that didn't seem to work.
So the reference point is an Item owned by an Actor and you want to know, which Items this Actor is holding?
Nope, Label text cannot be changed by Users
Just as a question, will the UncomputableError class be accessible in formulas sometime down the line? ๐
Either this or a convenience method in TemplateSystem to throw this error. Or something else
exactly... background of that is that I'm looking a way to identify list of Arrow Types hold by Actor but from Bow level.
I'd say entity.entity.parent?.items
Thank you so much for the hard work, for now I'll work on a bandaid solution ๐
The band aid would probably be to rely only on non-computable props and do the derived stuff in the Script (again) (similar to how you worked with columns in Item Containers before they got referencable)
Thank you, will try that shortly
If it's not that, you can do a short %{console.warn(entity);}% in the Item and traverse the paths in the console to get the right one
Okay I swear I had the condition changing colour on criticals and now I'm just getting an error, did I just hallucinate that or something, should this be working?
</p>```
(I can apply it to the whole line but like I say I swear I'd *just* made it work on a condition...
entity.entity.parent.items 
<bow>
You can open the console to actually see the error
Funny story in the last session I had
I made this piece of equipment that makes my player able to move twice a turn, and a 5% chance of the player just not moving a single turn at all
ON THE FIRST EVER FIGHT AND THE FIRST EVER TURN
THE 5% STRUCK
๐คฃ
Burn it, this must be cursed!
I checked the code and tested it on the background to see if I screwed the code
Nope, it's really just a cursed RNG
๐คฃ
Custom System Builder | JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 13 of the JSON data SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 13 of the JSON data
Would it be possible for me to get an image of an item and send it along with the scroll of this item?
I am using item.container to scroll through items, I would like to get the image of this item and send it in the chat when scrolling.
Did some testing and you're right. Checked the console and pretty much everything is right. Global Actor's Dynamic Table is being fetched alongside the Dropdown's Component key. Pretty much figured out the "${ }$" needs to be '${ }$', patched it up and I'm good, thank you for helping me out in the right direction fam!
${fetchFromActor('Global Actor', "lookup('form_table', 'action_dice_label', 'form_name', '${form_selected}$')")}$
this may be a bit of a basic question, apologies in advance, but I am diving into the world of CSB for my foundry campaign. I have been unable to find or install CSB through the manifest url. Do I have to roll back my foundry version?
If it's V12, then yes
Uhhm, it depends on from which to which version. For example: Going from 3.2.1 to 3.2.2 is usually a minor update, while going from 3.2.1 to 4.0.0 is usually a major update.
ahhh i see, apologies, I am not very well versed with foundry VTT
This behavior of versioning applies to all sorts of software, it's not just a Foundry or CSB-thing
may I ask a question about systems? I understand that this may not be the right place to do so
Sure. CSB itself is also a system, so...
I was looking into CSB itself because I wanted to emulate the RWBY TTRPG system. Along with CSB, are there systems that would allow just simple roll that's customized?
You'd need to go into details of what you need. What is considered a "simple roll"? How far should the customization go?
Alongside CSB, there are 2 other "do it yourself"-systems: Sandbox and Simple Worldbuilding. I don't know the specifics of those 2 systems, so you'd need to ask in their places or look up their documentation. But depending on your needs, they might also work for you.
gotcha, thank you very much @formal goblet! I really appreciate your help
Yep, did just that prior and it worked perfectly! Now I got everything I need to fill in and make the System on a Surface level. Again thanks for the help!
Are there any math functions that round towards 0? Unfortunately for my purposes rounding up or down exclusively doesn't work. Basically I need to generate a number based on how many full amounts of 10 beyond a target a player rolls.
I thought I had it working but I've realised depending on if I'm using floor or ceil I get inconsistently correct results
Okay, I think I've worked it out.
${!roll:=[d100]}$ vs ${ws_current + ?{Modifier|0}}$<br>
<h2>${!roll<=ws_current + Modifier ? (roll==01 ? 'Critical Success!' : 'Success') : (roll==100 ? 'Critical Failure!' : 'Failure')}$</h2>
<p><strong>Degree of Success/Failure:</strong> ${!(ceil((ws_current + Modifier - roll) / 10) >= 0 ? floor((ws_current + Modifier - roll) / 10) + 1 : ceil((ws_current + Modifier - roll) / 10) - 1)}$</p>```
What that should do, is roll a d100, compare it to a characteristic + any modifiers, tell you success/failure (and criticals), and THEN calculate Degrees of Success/Failure (1 + 1 for every full 10 above/below the target)
If I'm right, then the only thing to cap this off would be changing the colour of the text on Criticals, but that's a very minor thing. I ran into that wall until I finally knocked it down lol
Never mind, and frankly I'm close to throwing in the towel on this specific one and just pushing out a version of BC that uses the Dark Heresy 2e rules on Degrees (just using the tens unit of the roll minus that of the target), it seems much simpler to try and implement.
Okay I genuinely don't fully understand how I fixed it but this revision seems to be working:
${!roll:=[d100]}$ vs ${ws_current + ?{Modifier|0}}$<br>
<h2>${!roll <= ws_current + Modifier ? (roll == 01 ? 'Critical Success!' : 'Success') : (roll==100 ? 'Critical Failure!' : 'Failure')}$</h2>
${#degree:=(ws_current + Modifier - roll)/10}$
<p><strong>Degree of Success/Failure:</strong> ${!degree <= 0 ? floor(degree) : ceil(degree)}$</p>```
Is there no v12 support for this module yet? just checking because it says it's incompatible with my version of foundry
That's right. And also no estimation for the V12-update atm
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
I am a bit confused why this doesn't work within an item. I just want it to show the name of the item and the name of the ritual
<p>${(name)}$</p>
<p>${(sameRowRef(book_ritu_name))}$
I think the console can help you a bit
Uncomputable token "book_ritu_name" i havent touched all this in a month and i am super rusty again
but i have some updates i need to make today. do i need to add item. somewhere
That means that the variable book_ritu_name does not exist
The item.-prefix is only available in Item Containers
Yah i dont know why i made it sameRowRef. thank you
@formal goblet ok this should be my last question for today.
We know thats probrably untrue
<p>${setPropertyInEntity(attached, 'attached.Mana', "attached.Mana - sameRow('item.book_mana')")}$ Remaining Mana
Uncomputable token "attached"
Do you know the difference between attached and 'attached'?
'attached' gives the words attached gives the value? if i remember correctly
Words enclosed in quotes are strings while words without quotes are variables, which hold a value
ok ill be honest i still dont know what i did wrong. i changed it several times with no change in end result. what am i missing
This was my original attempt. with the same error.
<p>${setPropertyInEntity('attached', 'attached.Mana', "attached.Mana - sameRow('item.book_mana')")}$ Remaining Mana
That was only the first part, that was faulty. The second part is your attached.Mana. Is attached a key in your Actor?
ok progress is being made but now it shows up as error with nothing in command prompt.
<p>${setPropertyInEntity('attached', 'Mana', "'Mana' - sameRow('book_mana')")}$ Remaining Mana
'Mana' is a text. <text> - <number> is an invalid operation, because you cannot subtract from a text
can anyone use custom system builder in 12.0ยฟ?
or i must use previous version of foundry
CSB is not compatible with V12
Sorry i tried that i am still getting the same error...
${setPropertyInEntity('attached', 'Mana', "Mana - sameRow(book_mana)")}$
I honestly have tried everything including adding '' to everything and taking them all away one by one. This all being in an item just makes things not make sense. because i have made this string work on character sheets a bunch of times. but i cannot seem to get it to click on an item.
Is book_mana a variable?
how do i install a previous version of Foundry 12.0
so i can use custom system builder
Numbers are 0, 145, or -34. book_mana is a variable. The value of the variable could be of type number, but it's still a difference
You should be able to download the right version from the Foundry homepage
sameRow() only accepts a string, numbers and booleans are not valid there
how do i check what version do i need
then why is it not 'Mana' since that is also a variable?
The latest V11 should be enough. So 11.315
The value of Mana is of type number. Whenever you use a variable, it will be replaced with the value when calculating stuff
so Mana is a variable from the character sheet and book_mana is on the item. does one of them need a prefix like item. or attached. ?
If x = 5, the expressions x + 3 and 5 + 3 lead to the same result
that makes sense... i am following what you are saying
There's no attached.-prefix in the whole system. Only item. and target. exist
If your Formula is within an Item, you generally only have access to the properties of the Item. There are exceptions like fetchFromActor() or the target.-prefix in setPropertyInEntity() you can use to bail out of this limitation
oh do i need to add fetch from actor to mana? even though it is targeting attached?
Then use target.
that was it
I am tried to sort an item container alphabetically by name and I have done something wrong.
name, not Name. The above is only a Label
duh. I should take a break
While on item containers. I have a filter formula that is throwing errors. However it works so it isnt top priority
not(item.equipped)
Custom System Builder | Unexpected type of argument in function not (expected: number or Complex or BigNumber or Unit or Array or Matrix or Fraction or string or boolean, actual: undefined, index: 0) TypeError: Unexpected type of argument in function not (expected: number or Complex or BigNumber or Unit or Array or Matrix or Fraction or string or boolean, actual: undefined, index: 0)
equipped is a check box
Do you have Items which do not have this checkbox?
i think maybe the one i just created
yep... ok made the check box on un equipable items and then just hid it
fixed the issue thank you
Is there a possibility that I can get the image of the item and be able to send it in one roll?
<img src="${!%{return entity.entity.img;}%}$">
tks
she returned the image of the character
Then linkedEntity instead of entity.entity
good, tks
How would I go about exporting what I have to hand off to someone else to run in their game
Like exporting the system
You can simply export the templates in the settings-tab. If you also need Actors and Items, then you probably want to export everything in compendiums and use that in other worlds.
Is it possible to generate some sort of vertical div line?
CSS it is
Is this how that img code supposed to look? Because it is not generating the image in the chat.
You put that into Label text or Label Roll Message
They both already have text in them, though.
The roll message particularly has a formula.
Doesn't matter. Both can have as much content as you like
I see, it needs to be put in HTML. So, this won't work.
You don't need the ! in Label text
But would be required in a Label roll message?
Yeah. The alternative would be:
<img src="%{
options.explanation = false;
return linkedEntity.img;
}%">
What am I missing on this label roll message that nothing displays in chat?
Open the console
Is the Label inside an Item Container?
If not, then you need entity.entity instead
No, I just opened the item directly from the folder of items.
Interesting. Yeah, that seemed to do the trick. Thanks!
If I wanted to include the name of the item in the table as well, would that be
%{return game.items.getName '${name}$'}% ?
Just ${name}$. You can use that everywhere
Oh, simple. Nice.
Hey folks. Is there a way to have the text of a rich text area change to match options in a dropdown list? The game I'm working on has a group of ~22 NPC connections called 'Anchors' that I am creating as Items to drop into a character sheet. Rather than creating 22 different items, I'd like to just have the one with a dropdown to indicate the type of Anchor that it is. The different kinds have different benefits & abilities associated with them, so it would be great to have a text area fill with specific information based on the choice.
Nope, the content of a RTA cannot change automatically
All right. Thank you for the clarification ๐
I have another question regarding formula Conditions in Labels. Let's say I want to have a Label in an Item Container read either 'Major' or 'Minor' based on whether or not a checkbox in the item is marked. I know I should use a Condition in the Label text section, I'm just not sure how to implement it. Please direct me to an FAQ or something if this is a question you're tired of hearing.
would that be something like ${anchor_major_check ? 'Major' 'Minor' }$
Dear @formal goblet recently I have identify an issue (could be after last update of CSB), where I can not move "field" to first available spot. Ie. I have created new Tab and I try to move Table on first available spot but it doesn't work (it's not possible)... even after adding (by click on +) panel there is still not possible to add Table just after Panel.
replying but not pinging, here's the error generated when clicking Attack Roll in the sheet
really new to this but looking at the template sheet nothing seems wrong with the weapon name part of the template
I'm trying to get an item container to filter for label component that has it's text defined by a switchCase function. That doesn't seem to be working. Should it be or is that not an option?
Related question: is it possible to have multiple filters on an item container?
I've run into this, too.
$wpn_name seems to be not defined, so it's something with that
I know about that one, and yeah. It's a bug
It depends on how you did it
This is the label in the item with the key CorMen:
${switchCase(rTrait, 'Cognition', 'Mental', 'Deftness', 'Corporeal', 'Knowledge', 'Mental', 'Mien', 'Mental', 'Nimbleness', 'Corporeal', 'Quickness', 'Corporeal', 'Smarts', 'Mental', 'Spirit', 'Mental', 'Strength', 'Corporeal', 'Vigor', 'Corporeal')}$
And this is the filter in the item container:
equalText(item.CorMen, "Mental")
Seems fine from the first glance
I just saw this in the log:
Custom System Builder | Cannot convert "Corporeal
" to a number Error: Cannot convert "Corporeal
" to a number
at convert (math.js:12242:57)
at Array.t (math.js:6552:67)
at Function.r (math.js:6691:72)
at Function.oe (math.js:6724:82)
at equalScalar (math.js:6740:54)
at any, any (math.js:20192:35)
at Function.oe (math.js:6724:82)
at equal (math.js:6740:54)
at math.js:25781:48
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:657:27)
at ItemContainer.js:589:75
at EmbeddedCollection.filter (commons.js:4192:14)
at ItemContainer.filterItems (ItemContainer.js:578:29)
at ItemContainer._getElement (ItemContainer.js:52:34)
at async ItemContainer.render (Component.js:143:25)
at async Tab.renderContents (Container.js:50:25)
at async Tab._getElement (Tab.js:43:33)
at async Tab.render (Component.js:143:25)
at async TabbedPanel._getElement (TabbedPanel.js:56:36)
at async TabbedPanel.render (Component.js:143:25)
at async Tab.renderContents (Container.js:50:25)
at async Tab._getElement (Tab.js:43:33)
at async Tab.render (Component.js:143:25)
at async TabbedPanel._getElement (TabbedPanel.js:56:36)
at async TabbedPanel.render (Component.js:143:25)
at async Panel.renderContents (Container.js:50:25)
at async Panel._getElement (Panel.js:76:33)
at async Panel.render (Component.js:143:25)
at async TemplateSystem.getSheetData (templateSystem.js:336:41)
at async CharacterSheet.getData (actor-sheet.js:49:19)
at async CharacterSheet._render (foundry.js:5812:18)
at async CharacterSheet._render (foundry.js:6532:5) Object
_
The row with wpn_name is filled out
wpn_name and $wpn_name are not the same
Do you have a newline somewhere? "Corporeal" seems to be a bit weird formatted in the error message
There was newline after the '}$' of the switchCase call.
I started down another less automated path and have gone so far that I can't go back an check without re-working some major stuff. Thanks for taking the time to look at it!
But the error message comes from a filter formula
edit: nvm, could still be related to the switchCase()
this is the attack roll from the sheet, I've tried removing the $ in $wpn_name and get the same error, but the uncomputable token is now just wpn_name. the field in the column keyed as wpn_name is filled out
`<h1>Attack: ${!$wpn_name}$</h1>
${#char_val:=sameRow('ranged',0) ? bs_val+bs_mod : ws_val+ws_mod}$
${#mel_dmg:=sameRow('ranged',0) ? 0 : s_b}$
${!roll:=[1d100]}$ vs ${char_val+?{Modifier|0}}$<br>
<h2>${!roll<=char_val+Modifier ? 'Success' : 'Failure'}$</h2>
${#dos:=floor((char_val+Modifier-roll)/10)}$
<strong>Degrees of Success/Failure: </strong>${!dos}$<br>
<strong>Special: </strong>${!sameRow('wpn_spec')}$<br><br>
${#tens:=floor(roll/10)}$
${#units:=roll-(floor(roll/10)10)}$
${#loc:=(units10)+tens}$
<strong>Hit Location: </strong>${!loc < 11 ? 'Head' : loc < 21 ? 'Right Arm' : loc < 31 ? 'Left Arm' : loc < 71 ? 'Body' : loc < 86 ? 'Right Leg' : 'Left Leg'}$<br><br>
<strong>Damage: </strong>${dam:=[:$dmg:d10]+$dmg_bon+mel_dmg}$ ${!$dmg_type}$ (Pen: ${!$wpn_pen}$)<br>
<em>!!! Check for minimum damage on 1 die (${!dos}$) and Righteous Fury !!!</em>`
to clarify, the Name column's key is {wpn_name}
the sheet is a year old from the github, Were the formula changes after the sheet was released?
very new to using github but judging by the release date of 3.0.0 (which had the formula changes) being 10 months ago and deathwatch being updated a year ago I'll guess the formula is outdated
is there any day tracker mod or something?
You have to use sameRow() or lookup() if you're working with column-keys, a normal variable access is simply not enough
yeah i'll have to change formulas, definitely think the premade sheet is outdated but I'll hopefully get it to work, thank you for the assist earlier
We introduced new functions, but the old ones are still available. So Formulas cannot be outdated
wouldnt the issue i was having come up earlier though?
not necessarily QA testing or whatever but someone running the sheet and not being able to use the attack roll feature
It would come up earlier, yeah
hopefully nothing else is too crazy to fix then
Where?
Like, I am in the settings tab
but not exactly seeing an export button
Note, on version 3.0
No, it's literally a Tab, not a page
Actors, Items, Scenes, Journals, ... These are all in a Tab
i,
its
its ritht there
they are right there
I got em
Found em. Right there.
Sorry to bother!!!!!
๐งโโ๏ธ
A player of mine who is importing the system can't modify existing values on the sheet templates
is there a reason that's the case?
Is he Owner or Observer of the Sheet?
how would they check that?
Right-click the Actor in the Actor-Tab and check permission settings
hello
I see, a duo
there's no gamemaster option
That's what I mean
Alright. Any errors in the console when trying to change values in the sheet?
Oho. Which Foundry and CSB-Versions are you using?
I see so I should wait for an update then?
Either wait or downgrade and wait
how would I go back to v11
Fresh installation from the Foundry homepage
Not sure how or why, but my hidden attributes stopped working.
Ok, any hints in the console?
Is there an easy way to have a roll message display an itemโs image when itโs used?
These are what shows up in the console
I answered that one yesterday. Just scroll up a bit in the chat
One of your Labels contains a Script with the wrong delimiters, treating your Script as a CSB-Formula (which it shouldn't)
That worked, thank you!
Hey I'm not sure where to ask this but I will ask here since this is dealing with a System.
I have created a special world for running Heroquest games using Custom System Builder. Well I updated to Version 12 and I went a head and installed the newest version 3.2.5 which is the Beta Branch. I had to go int he beta because the most recent version doesn't work with version 12 of FoundryVTT yet.
So everything seems to work but I can't see to drap any actors on to the stage. I have been digging through the .JSON file and everything but I can't see to find the cause and I'm not getting any errors to give me any clues. Has anyone else had this problem and if you did how did you fix it?
How would I narrow down which Label?
Do you have contextual information at the bottom of the error message?
So it doesn't work with 12? I'm guessing an update is in the works? atm I'm using the Beta version which does install and everything seems to work besides dragging the actors on the stage on my old game. If I make a new world it works and just my old world that I put all the work into doesn't
So I just tried to drag an actor to the stage on my old world and I get this as the output
Okay so with the help of chat GPT and a bit of coding I was able to get it to work.
If you have the same issue I was having with Actors not able to be dragged on the stage replace your "custom-system-builder.js" file with this one.
Finally was able to figure it out but man that took some work. lol
well crap so it seem to work now when I'm doing it on the server but if I try to login through my domain it doesn't work. lol I need to do some more testing
has anyone had any luck getting Always HP to work with CSB? Sorry if stupid question ๐
Hey guys, have a question that might be a bit tricky.
In terms of performance, is it better to nest data inside an item and drag it on a sheet or is it better if it's directly in the sheet?
Let's imagine I want to create a log for purchases, so I create an item named 'Gold'. In this item there is dynamic tables with all the transaction and then it calculates the current ammount of gc that you have and shend it to you sheet.
Am I better of using an item, or getting rid of the item and directly doing this operation on the character sheet?
I'd say there's barely any difference between those 2, because the calculations remain the same. But only performance tests can give you a definitive answer.
Ok, I've got perplexing one: I have a label (key: woundMod) set to show the max() of seven radio button groups. That has been working. I've got a bunch roll formulas that use 'woundMod'. I recently changed the format of some items and their containers, and now any new actors that use that sheet can't seem to read 'woundMod'.
If I reassign the key to a number field, all the formulas work fine, but I would still like to have the auto-update functionality that came with the way I was doing it before.
Any ideas on what is going on? Here is the error message:
caught (in promise) Error: undefined. Uncomputable token "woundMod"
[Detected 1 package: system:custom-system-builder]
at mathInstance.SymbolNode.onUndefinedSymbol (Formula.js:653:27)
at math.js:26377:89
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:657:27)
at Formula.compute (Formula.js:363:21)
at processFormulas (ComputablePhrase.js:106:35)
at async ComputablePhrase.compute (ComputablePhrase.js:160:34)
at async computeRollPhrase (Formula.js:715:13)
at async Formula.evaluateRoll (Formula.js:726:29)
at async Formula.compute (Formula.js:349:30)
at async processFormulas (ComputablePhrase.js:106:21)
at async ComputablePhrase.compute (ComputablePhrase.js:160:34)
at async Label.js:586:13
UPDATE: I think I've got it. A hidden attribute was failing and I didn't have a 'try' setup. Learning how to do tries and fixing now.
Any tips for checkboxes in item containers and possibly only allowing one checked box in the container
Not without your own Script, which resets the other one
But if you're fine with multi-select, then this here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Checkbox-in-Item-Containers
Thanks, this is better than what I had
I've been trying to fix this error for some time now, and i don't know what is wrong
Here is the Code snippet that isn't working:
${!concat( 'Target Armour Damage ', roll >= 96 ? string(headArmourDamage) : roll >= 56 ? string(thoraxArmourDamage) : roll >= 41 ? string(stomachArmourDamage) : roll >= 31 ? string(leftArmArmourDamage) : roll >= 21 ? string(rightArmArmourDamage) : roll >= 11 ? string(leftLegArmourDamage) : string(rightLegArmourDamage)) }$
and here is the Console Error:
Custom System Builder | Cannot convert "Target Armour Damage " to a number Error: Cannot convert "Target Armour Damage " to a number at Array.convert (math.js:12242:57) at math.js:6567:108 at Array.map (<anonymous>) at Function.r (math.js:6692:90) at Function.a (math.js:6699:66) at Function.oe (math.js:6724:82) at concat (math.js:6740:54) at ...any (math.js:35684:46) at Function.a (math.js:6699:66) at Function.oe (math.js:6724:82) at concat (math.js:6740:54) at math.js:26523:52 at Object.evaluate (math.js:24162:45) at r.evaluate (math.js:24139:55) at Formula.computeStatic (Formula.js:657:27) at Formula.compute (Formula.js:363:21) at processFormulas (ComputablePhrase.js:106:35) at async ComputablePhrase.compute (ComputablePhrase.js:160:34) at async Label.js:586:13
Maybe the newlines are causing issues. But besides that, I also do not see why it should fail
is there a way to transfer items between item containers of different actors?
You can drag them (although it's only a copy and not a real transfer)
it does not let me drag them once they're in the item container. i can drag items into an item container but i cant drag it out of the item container
is there something i must enable to be able to drag the items out of the item container?
Not really. The name and the Icon should be draggable. Which CSB-Version are you using?
2.4.3?
Then only the Icon (not name) is draggable I think
Its really annoying since i have this running a tiny bit earlier in the code: ${!concat( 'You hit the ', roll >= 96 ? 'Head' : roll >= 56 ? 'Thorax' : roll >= 41 ? 'Stomach' : roll >= 31 ? 'Left Arm' : roll >= 21 ? 'Right Arm' : roll >= 11 ? 'Left Leg' : 'Right Leg' )}$
And its quite fine with that
that was the issue. thank you
Hey guys do you know if there is a way to fetch different formulas from a dynamic table in order to rollem?
let's imagine you can put in a spell's dynamic table the type of damage, so you put on one row '1d6' 'poison damage' and the following '2d6' 'fire damage', is there any way to fetch this data to be rolled ?
The sameRow() and lookup()-functions should help you working with data of Dynamic Tables
Hi, just wanna make an appreciation post, with CSB i was able to make a robust and flexible RPG mechanics reminiscing that of my favorite (and hardest) JRPG game, thank you so much to martin and fluush for the hardwork and other people here who have helped me with some of my questions left and right
Yeah, thank you everyone for helping! I'm away from the desktop right now, but I'd also like to post what I've been able to do with help here once I'm home!
I basically recreated FATE Core in CSB, and then proceeded to add all sorts of my own mechanic to the game :)
Mine is still a work in progress. It's from a system I'm creating for solo play, group play, or no-GM games. I gave the Skills tab a "lite" and "standard" mode to support my players' play styles. Lite focuses less on strategy and more on role play with fewer skills.
Started out clueless, then pulled a bunch of sources from here and eventually got to this point. Thanks so much for your patience, Martin!
@earnest imp I love it! Your hard work really paid off
Hardest part has to be making do with status effects since CSB has incompatibility with condition labs but I found a way 
The statuses are basically holding on ducttapes and dreams
Did you manage to have modifiers in active effects, which are not preconfigured in the token?
No, applying modifiers in Condition Lab is not an option
Since the CSB sheet rolls over the changes Condition Lab may have made to a token
I configured the effects of all status effects in the "configure active effects" section of the template
However nearly everything else in Condition Lab is compatible with CSB
I am able to make use of the Triggler feature
I can even make custom statuses in Condition Lab as long as I leave the effects of the status empty
All of the options work
trigglers work
macros also work
its only the "Active Effect" section I leave mostly untouched from possible incompatibility, apart from description of the status
you can technically edit some foundry files to have functional custom effects for csb to use for modifiers and stuff
Hey everyone!
I'm trying to create a roll message that contains a reference to the item the roll is made with. I'm not sure what the right way of doing that would be. Right now I'm trying it with a custom script that will grab the ID from the item in the item container. My Problem is, that the [] always result in it trying to parse them as a roll. Is there a way to escape the brackets, or am I on the wrong track?
Rolling for damage using %{ return `@UUID[Item.${linkedEntity.system.uniqueId}]`; }%
You can check the code of the Item Container to see how to create a link to a Document
And I think the @-syntax works without any delimiters, so you wouldn't even need a Script
I've got a roll message that I think is supposed run the first part before reloading the character sheet to update the label. But it is running the reload before I can click ok on the dialog that comes with the macro. What am I doing wrong?
This is the roll message:
%{await game.macros.getName('Reset Action Cards').execute({actCardHandID: '${actCardHandID}$'})}%
%{entity.reloadTemplate()}%
This is the macro:
async function resetActionHand(handId) {
const hand = game.cards.get(handId);
if (!hand) {
await ChatMessage.create({
content: "Hand not found.",
speaker: { alias: name }
});
return;
}
try {
// Reset the hand
await hand.resetDialog();
} catch (error) {
await ChatMessage.create({
content: `Error in resetting Action Hand: ${error}`,
speaker: { alias: name }
});
}
}
resetActionHand(actCardHandID);
Your Macro is doing the "fire and forget" -tactic, because you don't await the function-call ๐
Amazing! Thank you!!!
Is there any way to set up a system where say I roll sword, it would automatically subtract 1 from the durability of said sword?
setPropertyInEntity() should help you there: https://gitlab.com/custom-system-builder/custom-system-builder#4212-setpropertyinentity
thank you
Is it possible to display data from an item placed inside of an item container?
I have the component key of the column the same as the item's value I want to display, but this is probably wrong right?
Yes, by using ${item.cost}$ on the item container column, it will draw the value of cost from each individual item listed
Much thanks!
how do I change a token's dim- and bright-light values through scripts?
I have a value_light that should be the distance already, I just can't figure out how to sync CustomActor.prototypeToken.light.bright automatically when the value changes.
(The value changes when a player equips and activates certain items, not a button, so I can't do roll message.)
WAIT I'm so silly, I can just put the script in the suffix for the value_light label or something. AHahah.
Yep, works. For future reference, since I saw nothing about controlling token light via scripts in this forum:
%{
const light = entity.entity.system.props.value_light;
await entity.entity.update({
'prototypeToken.light.dim': light,
'prototypeToken.light.bright': light
});
await entity.entity.token.update({
'light.dim': light,
'light.bright': light
});
}%
i believe when it comes to automation on value change, that can be done through hooks
which goes into worldscript territory
#macro-polo can assist you further if its worldscripts
How does one link an armor to a stat, for instance im setting up the armor template but everything i seem to try in the coding isnt having the defense stat update to the correct thing the math should be the foritude skill which has the key of for so i assume thats ${for}$ and then the armor mod of the item. Im assuming it probably has something to do with the item modifiers but ive been on this for the past 3 hours and cant seem to figure it out.
Is it possible to populate an actor with default items upon creation?
I need a bit more details. From where to where should your data flow? If it's Actor -> Item, then you need fetchFromActor(). If it's Item -> Actor, then you need Item Modifiers (simplified version).
It's possible, but it would require a World Script on your side, which triggers on every Actor creation
Where should I look to learn about implementing that?
A-doy, thanks!
I updated to the new version recently, and the formulas i had in item containers bring up an ERROR. The button still works and rolls fine. But for whatever reason the math in the label text breaks the display.
Why is your Label text a Roll Formula? That should only be used in Label Roll Messages
I've done it. I wanted users to see how much they are hitting before pressing it.
[] should only be used when you actually want to perform a Roll. In all other cases, you should stick to normal CSB-Formulas. If both mystic and item.spdiff are just numerical values, then you should just use ${mystic + item.spdiff}$
alright, got it.
Another Question: Since lookup is put into an array, is it possible to add it all together? I want it to add the result to the meter to manage player carry capacity.
The sum()-function accepts an array
alright, thank you for the help.
Is there any estimate on v12 support date?
I'm very anxious for v12 too
Nope
still fixing the attack roll. Trying to get a formula to roll xd10s where x is a sameRow. Is this viable?
I'll get the actual formula later as I'm on my phone currently but I was getting more incompatible tokens for the d10
You could try:
${dieAmount:=sameRow("<columnName>")}$
${[:dieAmount:d10]}$
New question: How would I go about using a roll message or macro to change the checked state of a radio button?
I'm sorry, I'm not sure what property I'm supposed to set. This is what I tried:
${setPropertyInEntity('target', 'rarm2', 'checked')}$
'rarm2' is the key to the radio button.
- The 2nd argument has to be the Radio Button Group
- The 3rd argument has to be the value of one of your Radio Buttons
Unfortunately, that isn't working. I can use that method to set other properties on the target but when I try to apply it to the 'rarm' group, I only get a chat message with the value I tried to set the group to.
Show me your Buttons and your Label Roll Message
The roll message: ${setPropertyInEntity('target', 'rarm', 1)}$
The configuration form looks weird... Do you use modules, which tinker with CSS?
setProp...() only works with non-numeric values for Dropdowns and Radio Buttons atm
Yeah, I got rid of the boxes before I figured out how to localize the change. Just haven't put it back yet.
O! Ok. Changing the value would change the function of a different part of my sheet. But I could probably easily apply a switchCase.
Thanks!
I went to test what you suggested with two new buttons with 'on'/'off' values. I got this error:
Uncaught (in promise) Error: undefined. Uncomputable token "on"
[Detected 1 package: system:custom-system-builder]
at mathInstance.SymbolNode.onUndefinedSymbol (Formula.js:653:27)
at math.js:26377:89
at math.js:26529:60
at Array.map (<anonymous>)
at math.js:26528:55
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:657:27)
at Formula.compute (Formula.js:363:21)
at processFormulas (ComputablePhrase.js:106:35)
at async ComputablePhrase.compute (ComputablePhrase.js:160:34)
at async Label.js:586:13
You forgot quotes around on
It appears to require double quotes.
${setPropertyInEntity('self', 'ONOFF', "'on'")}$
Is there a way to get the name of an item from an itemcontainer? The first reference works just fine, but the second doesn't (presumably because there is no key to reference?)
It's always name ๐
This isn't quite CSB-related, but would any of you guys know which element I need to tweak in the CSS to get inventory items (button-link in containers) to match the rest of my style?
Is there a spot to write Keep highest when i want the roll to find the outcome that is 5 or greater?
Or is it better to do {(:dicetotal:)d6kh} first and then find the outcome on a speperate line?
dicetotal = 6 + str
(:dicetotal:)d6cs>=5
Ooh thank you
Would that fit?
No
Okay. Thanks letting me know. I`ll delay my upgrade
well i would want it rolled as a advantage
When I use setPropertyInEntity('target',...) on a token without "linked actor data" it only effects the original actor sheet, not the sheet of the targeted token. Same is true if I use 'selected'. Is there anyway to fix that so I can actually change a property of the targeted token?
Keep highest, where is the website for these terminology?
The official website and community for Foundry Virtual Tabletop.
do i use samerow if the checkbox is in the same table/row? rephrasing, one sec
is there a way to incorperate a push to the GM when a button is pressed`?
My idea was when the players do an attack and press the "attack button" but before the roll the GM gets a popup to add some modyfiers
Is that possible?
Have been staring at this too long, can anyone see where im going wrong here?
${(${[${MGNoDmgDice}$d${MGDmgDice}$]}$)*${SpellModBon}$}$
The below section works fine
${[${MGNoDmgDice}$d${MGDmgDice}$]}$
Takes a number from a different metric which says how many dice to roll MGNoDmgDice, and another metric which says the size of dice MGDmgDice, and outputs a rollable formula.
Trying to add on to the end a section which multiplies the resultant output by a modifier, however its not outputting anything
Getting the attached error but not overly sure why. The attached formula is SpellModBon, which is checking against a list and outputting a number stored in a series of lables.
It just, never renders the sheet and foundry itself is completely unresponsive, I can still look in the console but nothing is updating.
Seems to be a bug... Well, you could still manage the updates with your own little Script (check the Wiki for more details)
Possible, yeah. But that is usually module-territory, so you'd need to dive deep into it
How about ${[:MGNoDmgDice:d:MGDmgDice:] * SpellModBon}$?
And the Formula in the Screenshot can be simplified to ${ref(concat(item.SpellSource, 'MagicMod'), 0)}$
well holy cow, thats much cleaner... thanks!
Still getting this error. SpellModBon is outputting as a string not a number for some reason, but cant see why. if exchange that in the roll formula for a x2 instead, it works.
The error indicates that SpellModBon is undefined
isnt the component key assigning it a definition?
That's partially true for Item Containers and Dynamic Tables. The structure you get is this:
{
"dynamicTable": {
"0": {
"SpellModBon": "3"
},
"1": {
"SpellModBon": "2"
}
}
}
and not this
{
"SpellModBon": "3"
}
In consequence, SpellModBon is not enough. You should use sameRow('SpellModBon') instead
Right! that makes so much sense, thanks for the explanation. Have implemented it and am still getting an error.
${[:MGNoDmgDice:d:MGDmgDice:] * sameRow('SpellModBon')}$
has the same error i was getting before,
Is that one within the same Dynamic Table or outside?
And SpellModBon is displaying something?
What version of CSB are you using?
3.0.0, still cant update without actors/items becoming unreferencable.
Item Containers are only referencable 3.1.0 upwards
The alternative would be to replace sameRow() with the Formula you have in SpellModBon, basically duplicating the formula
That works perfectly. Not clean, but cant grumble with functionality. Thank you very much.
Hey! Is there a way to access a property of an item in a Item Container that isn't displayed as a row in that container? Lets say I have an item that has a property p_description and I have a label somewhere else in the sheet that should display the p_description property of the first item in that container while the container doesn't have that property as a row?
%{
return entity.items.get(entity.system.props.itemContainer['0']?.id)?.system.props.p_description ?? 'No item';
}%
Wow thats so much shorter than what I tried. Thank you gonna try this out.
Yea I was looking for something similar which is great
entity.system.props.myItemContainer['0'].id seems to always return undefined for me. Do I need to access the id via Object.keys()[0] or am I doing something else wrong?
Object.values(), not Object.keys() to be fair. But I don't think that that is the issue. It's more like this here: #1037072885044477962 message. Unfortunately, there's no fix for that for now
This worked
let key = Object.keys(entity.system.props.c_active_weapon_primary)[0];
return entity.items.get(entity.system.props.c_active_weapon_primary[key]?.id)?.system.props.p_feature ?? 'No item';
Oh I see why values would be smart here.
There are some examples in that direction: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Dynamic-Tables
Mh I'm running into the issue now that the property I'm trying to access is rich text and contains characters that throw a "JSON.parse: bad control character in string literal". I guess its non escaped backslashes and stuff like that? Is there an easy built in JS way to escape something like this "'<p>Test feature text in the dualstaff</p>\n<p> </p>'"?
Heh, that will be fun. I know about htmlspecialchars() in php, but I'd need to look up in JS
@storm stump If you manage to pin down that code, do you mind sharing it with me? I'm in the same boat
Whish I was a webdev sometimes ๐ It's very late so gonna have to look into that more tomorrow. If someone has any ideas, please let me know. And thank you again for the help Martin!
It seems that JS doesn't have a build-in way, so you'd need to do that on your own
Yea my current workaround is for my equipped tool (only ever 1) to have a secret item container that has all the info I need displayed
Am I doing this right? I want the label to display the value only when the text field on the item isn't empty. When it is empty, I want "N/A"
${(item.conditionlevel != undefined | item.conditionlevel != '') ? item.conditionlevel : 'N/A'}$
${item.conditionlevel ? item.conditionlevel : 'N/A'}$ (taking advantage of implicit coercion)
Hmm interesting. That works! Question though, what language is this? My background is Java (not js) and python so I sorta get the gist
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
i found something that could work, the mod "requestor"
I have not looked into it yet, but it might work
will be back
Quick (hopefully) question, can I set the Values of Radio Buttons as dice (d5, d10 etc), and is it possible to have them display in a Label in an Item Container depending on which has been selected in the item?
EDIT: Never mind, had a typo that meant I didn't have the Radio Buttons set up correctly.
I got the JSON.parse issue sorted now and replaced the characters using regex. The whole thing looks like this now
%{
let key = Object.keys(entity.system.props.c_active_weapon_primary)[0];
return entity.items.get(entity.system.props.c_active_weapon_primary[key]?.id)?.system.props.p_feature.replace(/(?:\r\n|\r|\n)/g, '<br>') ?? 'No item';
}%
@formal goblet Would you have any free time within the next week or so to go over this module with me? Im having a hard time understanding how to set everything up.
Can I add dice automation to the Custom System Builder character sheets?
What exactly do you mean by โdice automationโ ?
There are several different possibilities.
For example, if someone clicks on an attribute, it rolls the correct number of die.
Specifically a number of d6's
I usually don't do personal sessions, but you can always ask in this channel here. That's what it is for
Yeah, totally understand. Its just a walkthrough would be a lot faster/easier for me since I dont really understand all the lingo.
But I hear ya
That one is also a good first source for the Formula System: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
So, I've got a value of current_mp, and I want to set up a button that subtracts the sameRow('spell_cost') value from it. Do I use the Recalculate function for this?
As in, Do I do this? :
${recalculate(current_mp=current_mp-sameRow('spells_cost'))}$
current_mp being the component key for a number field, and spells_cost being the component key for a row in a spell list.
I want the number field key **actionpoints **to be regenerated by a number X at the beginning of each character's turn. How should I proceed?
You will need setPropertyInEntity for changing a number field.
https://gitlab.com/custom-system-builder/custom-system-builder#4212-setpropertyinentity
CSB can not react to turn or round changes by it self. You will need a other module or world-script for this.
Ah, gotcha. Will this also ping through any visual updates, such as setting labels to be invisible based on the new value in the number field?
I'm more asking since I'm out running errands and can't test it just now.
Visual settings are just visual. They do not affect functions or calculations.
But the visibility formula can depend on values, so it should work hiding it based upon a stat
So I tried doing a fresh install to revert to foundry v11 but it didn't work (or I did it wrong). How long would I have to wait for this to be updated to v12?
No estimation so far
@formal goblet are y'all planning on making item modifiers able to affect text and number fields?
Eh, big no no
Is there a way to do a mass update of item templates for items that are already owned?
actor.items.forEach(item => item.templateSystem.reloadTemplate())
Beautiful! I should have asked sooner. Thanks!
This one is really stumping me:
I've got an item template that pulls 4 stats from the attached actor onto a label. Works no problem.
${fetchFromActor('attached','strN',0)}$d${fetchFromActor('attached','strT',0)}$+${fetchFromActor('attached','strE',0)}$-${fetchFromActor('attached','woundMod',0)}$
When I try to pull that label's data to another label, I get an error:
Custom System Builder | Bad control character in string literal in JSON at position 8 SyntaxError: Bad control character in string literal in JSON at position 8
at JSON.parse (<anonymous>)
It only happens when I include the bold text from above. Which is another label with the key "woundMod". Here is that label's text:
${max(${nog}$,${giz}$,${larm}$,${rarm}$,${lleg}$,${rleg}$,${gut}$)}$
You should simplify it to ${max(nog, giz, larm, rarm, lleg, rleg, gut)}$
That did it. Thanks! It had been working until I changed the other fetchFrom's, didn't do anything to the woundMod stuff. Thanks, again!
I need some logic help
In fallen Reich when you shoot or stab at someone there is some math.
D20+skill > (10+(distance/weapon range))+ mods
The thing is with the mods they vary alot, such as moving, aiming, or if the target is laying etc.
How can I do this with in the system?
The range is "easy" to do, but can I with the token set to crouch and read that in the code?
I guess I can add a "gm only" field on che char sheet
Is there a way for CSB to read a tokens state/affect?
Or a way to read icons
I will look into section 8.3 for this. I'll be back
Anyway to have the visibility forumla dependent on whether or not a there is a selected target
If there are a lot of modifiers outside of your control (see Lancer), I'd say maybe just ask ( user inputs )? Something like:
-> D20 + Skill (dropdown)
-> Distance to target: [ ] - (value displayed of what the mod is depending on what is written, this would be the 10+/distance stuff value)
-> Checkboxes for certain modifers
-> Misc mods: [ ]
-> Roll!
Hi guys, I haven't been around for a while. I had to stop development for a while
Anyways
I have one question about the way i do something. Basically i saw a problem with the modifiers. they weren't updating in real time (I have to manually update de sheet, sometimes more then once). I noticed a pattern in this problem, all the places of it appears used my global macros, which basically functions in JS
for example the skills
even changing my "sabedoria", "sobrevivencia" who uses, nothing chances until i refresh
forget, the problem is not in the parts that use the global macro. but in the parts that use modifiers
modifiers code
...
which is strange, since modifiers change in real time, but what is derived from them doesn't, why?
if automatically refreshing your character sheet is all you need after your function, you can try reloading the template programmatically
entity.reloadTemplate()```
seems like an interesting solution, i gonna teste. :))
@formal goblet is there a way to get the range between two tokens? (User and target)
That's a question about the Foundry API. I don't know how to do that
Thanks
Please let me know if you find out how to do that!
What would be the best to grab ALL items from an item container and display it to the players? Ideal case is that its a chat message with the rich text links so that they can click on them themselves
I managed to follow the "scripts for items" page and get the names of the items as an array that it will display, but I was sorta hoping for something more
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Items
I have some modifiers that alter the die type of a roll, with the potential of going below a d4. Anyone have any suggestions on how to stop it from rolling below a 4?
This is the conditional I've tried so far:
<p>Damage: ${nDT>=4 ? [:dDN:d:nDT:x] : "Target's armor stopped all damage"}$</p>
What I've done in a similar situation is use max(). In this case, it would be max(4, nDT)