#Custom System Builder
1 messages · Page 45 of 1
None of those seem to remove them from that menu, I can add new ones in like three different ways, but I can't remove those defaults...
i asked the same question a while ago, see here
Hi hello Aldo, this is Yann, your french Supers Fan, I have not found any Supers module for Foundry so I'm trying to learn Custom System Builder for Supers
Hi, Yann! Cool! Lemme know how it goes! If I figure it out, I might take a stab at making something for SUPERS myself at some point. We should compare notes.
My best friend @thorn spruce tried to help me Friday night to help me better understand Custom System Builder (I suck at coding really, it's like Chinese to me)
After he created some templates and objects and explained me how it worked. It was still difficult but a bit less, I have understood what I didn't manage to understand the first try
Still I would prefer a Supers System in Foundry but I know making a game system take time and people doing this on Foundry usually do it on their spare time so I cannot be disappointed if no no one has really the time for this.
I should probably learn JavaScript and do it myself but these days I am pretty tired and not really in the right mindset to learn coding.
I get it. I’d throw myself into that project, but remember - I don’t have ownership of SUPERS!, Hazard Studios does. If I were to develop something for it, it would be as a fan, and it’s not my primary focus, since I’m not currently running it. Besides - I don’t have the skills to do it well. Not yet, anyway.
Thanks for the reminder, I tend to forget that even if you are one of the game designer, you are not the owner of the IP. I don't think Hazard Studio will produce a character sheet for any VTT. I don't know the company personnally but Supers RED was conceived in 2014 and it's 2025 now. If nothing has been done in 11 years, I don't thing Hazard still care about Supers, but you know them better than me 🙂 .
I have asked my players if we should switch to another superhero system I own and which has a Foundry system, that reduces the number to Mutants & Masterminds, Tiny Supers and Wild Talents. Of all these three, the first is the one I know better but character creation is quite a work. I think Tiny Supers is too "Tiny" to game with it in my Necessary Evil campaign and at last, Wild Talents, I haven't read the rules for a long time and the Power Creations are still a mystery to me.
Besides the players don't want to switch. They like Supers RED.
I did the same thing, removing all the default icons and making my own with a world script:
//... snip
"esmodules": [
"my-script.js"
],
//...snip
//create my-script.js (or whatever you want to call it) then add or create
// a setup hook
//remove and change status icons
Hooks.on("setup", () => {
CONFIG.statusEffects = []; //remove all icons
CONFIG.statusEffects.push({ id: "defeated", label: "Defeated", icon: "path/to/desired/image.png" }); //add new icon
//... add more push statements for other icons
}); // close the setup block```
Hope that helps 🙂
Note: The id used to reference the effect in code and the label is what you will see in the UI.
Well, I know they care about the game, but Walt is busy with other projects, and there’s limited resources.
sooo i am trying to post a document link to a chat. like @Item.[e1GENaKeXG7mmi9q]
It will always try to evaluate this as a roll. Is there a fixed way to handle [] without the system trying to evaluate a roll?
Hi folks! I'm trying to create a Dynamic Table with two columns. How do I accomplish that? The idea is that I can use it for traits. I'd like one column to be a text field where players can enter the name of the trait or ability (in bold) and the second column to be a text field where they can write a description for the trait (not bolded).
Must be outside of ${}$, because it is Foundry behavior
ahhh that makes sense! thanks^^
Good evening, i wrote this formula in a Spell-Item Text Label {fetchFromActor('selected', "level")/2}$d4: the purpose is to show the damage dealt from the spell increasing with the character's level. The fact is more often than not the program doesn't update the value when a different character is selected. I mean, the roll and the formulas work correctly because the number of dice thrown is right, but "visually", on the spell item sheet, the damage label doesn't show the right value because it "remebers" the previously selected character's level. Rarely the value is upddated though so i don't understand why the program sometimes updates the value in the label and sometimes doesn't. Is there a formula, a script or something to force CSB to update spell item sheet on opening? I've already tried 'reload template' and this sometimes works and sometimes not....
You create a Dynamic Table, click on the +-Button within the Table and create a Text Field Component in there.
You can create a Checkbox in the sheet, which would trigger an update on every press.
Thank you!
Hey so, pretty random and serious issue. My custom system builder seems to have just stopped working entirely. Like my sheets are blank and only show items and this are the onyl errors I get.
sheets look like thsi
That's the first time I see this error message
It's very weird, I just happened upon my game in this state after taking a 4 day break from a session where everything seemed to work just fine
I am on Forge, if that helps. The issue persists between games so maybe it's the system itself somehow?
Don't think so, otherwise you wouldn't be the first one experiencing that error
Which browser do you use?
Chrome
Any modules?
A lot, but its still like this when theyre all off
And does a new world trigger the same error?
This appears in a blank game, so I guess it's different, I think that first error appears in the other ones too
There's something corrupt with the system file
Ah I see
Or your browser is doing weird stuff
Should I try reinstalling the system?
Yeah that seems to have worked, that's very weird
Thank you
So it was the browser cache
Got it, I'll keep that in mind
Reposting this one. I still don't understand why it's erroring out. It's not a critical issue but I like to understand what I'm doing
I suspect you forgot quotes around ${item.cooldown}$ at the top
Otherwise I also can't spot a syntax issue there
Hello - I am building out a custom system (no pun intended) that I originally had built out in Sandbox. I am moving through the wiki well enough, but I cannot find an answer to what is something I think should be easy. How do you pull into two different variables from a dialog? For example, I have a popup dialog asking for a bonus and a penalty. I want to add the bonus and subtract the penalty from a roll, but I cannot find how to do that. i can get it to do one, but not both.
Whatever key you define in the dialog, will be available in the rest of the Label Roll Message. You don't need an assignment to a local variable at this point.
Okay...got the roll calculating correctly, but how do I get the bonus and penalty to appear in the chat vs. the word modifier?
Show me what you've got
Hopefully I post this correctly:
<table>
<tr>
<th>Agility Check</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[1d20]}$</td>
</tr>
<td>Agility</td>
<td>${agility}$</td>
</tr>
<tr>
<td>Modifier</td>
<td>${?#{Modifier}}$</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>${Roll + agility + bonus - penalty}$</strong></td>
</tr>
</table>
Move ${#?#{Modifier}}$ to the top.
And then replace the hole with ${bonus - penalty}$.
Thank you!
It works as long as item cooldown evaluates to a number, if it doesn't it errors out.
Seems to be the intended behavior, because you expect a numerical value
Follow up question: How do I prevent the word Modifier from appearing at the top of the chat output?
Disable the gm visibility in the settings. Those are actually hidden for yours players
Ah...now I am feeling a little stupid. 🙂
My intent was to check if it evaluated to a number or not.
Hello, I am having trouble creating the token in the scene. I pick up the actor, drag it to the scene, and release it, but nothing appears. I asked for help in _troubleshooting and they told me to come here, explain the issue, and show this image because it apparently is a game system issue. Can someone help me?
hey! currently running on V12 - there seems to be no percievable difference between Tiny and Smaller for number fields. havent tested if its the same on the other fields, but thought i should let know as Small isnt the right size for me, but tiny is, well, tiny!
This worked great, thanks a lot :)
Which versions are you using?
Greetings, is there a way to fetch the ID ${fetchFromActor('Steven', "1236449256419")}$
I'm trying to grab onto the name under the id, since it's returning [object object] and display it in a dropdown list label formula.
But obviously I need the ID first that I assume is randomized.
It's item.id in an Item Displayer if you mean that.
If you want the names in a Dropdown, then ${lookup('itemDisplayerKey', 'name')}$
Yes this worked thank you!
i know this isnt a CSS classroom but i'd appreciate some help - does anyone know how best to target the sliders for CSS modification? I've been reading This but have had no luck at getting them to change so far.
not quite sure what class(es) i should be trying to modify
Hello, I have a question. If I want to add an existing template for CSS, like this one for instance : https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Deathwatch . How do I add it to my world or my dataset ?
Figured it out!
So I managed to input in to Formula for Key-Options:
${lookup('pc_weapon_list', 'pc_weapon_damage')}$ which turns pc_main_weapon = pc_weapon_damage
While displaying the dropdown label with the name of the item in Formula for Label-Options:
${lookup('pc_weapon_list', 'name')}$
Is there a way to store multiple items in the component key or is this a limitation? I've got another value I wish to track to determine if the weapon is ranged.
When I fetchfromActor something is there a way to have a default value for the variable in case the item is not in the sheet yet ?
tiny achievement but its an achievement of my own nonetheless - scrollable meters!
@formal goblet 4.2
And Foundry? And do you have any modules installed?
The 3rd parameter of it
Any modules, i'll turn on the pc to see the foundry version, but is think is version 12
Foundry
System
Try out if Ctrl + F5 fixes the issue
@brittle moth
Related to #1037072885044477962 message
<h3>Damage</h3>
${Roll:=[:roll_dice:]}$ ${#Strength:=fetchFromActor('attached', "str", 0)}$ ${!Strength==0 ? '' : (Strength>=1 ? '+' : ('-'))}$ ${${!Strength==0 ? '#' : ''}$Strength:=fetchFromActor('attached', 'str', 0)}$ ${#Protection:=fetchFromActor('target', 'protection', 0)}$ ${!Protection==0 ? '' : (Protection>=1 ? '-' : ('+'))}$ ${${!Protection==0 ? '#' : ''}$Protection:=fetchFromActor('target', 'protection', 0)}$
<div>${! concat('<br><strong class=\"result\">', string(Roll+Strength-Protection), '</strong><br>')}$${roll_type}$</div>
</div>```
this is the roll formula i ended up with which conditionally hides resistance/protection/defense unless it's a non-zero value, and which provides a clickable-formula-description that matches the other values
and which includes a dice-roll icon in the result
now also hides stat/strength/ability boosts/bonus/score damage unless it has a value which would actually modify the roll, and works in character sheets and in the item compendia
can the fallback value be non numerical?
Is there a way to restrict an item displayer to only 1 item?
Any value is allowed
Is it possible to do something like this from a item displayer within the actor?
find(item.ITEMTABLE,item.ID,item.NR,roll)
I want to filter the dynamic table i got on a item sheet. the roll is a value from 1-20, and the item.NR field contains only those values. I keep getting the error:
key.split is not a function or its return value is not iterable
Which i cant seem to understand sadly...
this would be the ITEMTABLE
item: DICE: "1d20" ITEMTABLE: 0: {$deleted: false, NR: '1', LEVEL: '1', ID: 'm5zON9iqBF9QlnGr', TYPE: 'Weapon', …} 1: {$deleted: false, NR: '2', LEVEL: '1', ID: 'nrg2QRZ5Ewggeb1w', TYPE: 'Weapon', …} 2: {$deleted: false, NR: '3', LEVEL: '1', ID: 'aPAA1atUOy450az4', TYPE: 'Weapon', …} 3: {$deleted: false, NR: '4', LEVEL: '1', ID: 'eDEi70FRovGvCYFH', TYPE: 'Weapon', …} 4: {$deleted: false, NR: '5', LEVEL: '1', ID: 'nDSpIA5apjwc27VW', TYPE: 'Weapon', …} 5: {$deleted: false, NR: '6', LEVEL: '1', ID: 'nDSpIA5apjwc27VW', TYPE: 'Weapon', …}
find(item.ITEMTABLE, 'ID', 'NR', roll)
tried that - it says: Uncomputable token "ID"
With quotes?
But - we are back to key.split error with quotes :/
Thought it would be because i gave the column the key "ID" but that isnt it either...
I would like to display the value of a variable in a userInputtemplate that i defined in the same roll message right before i call the input template. How do i do that?
Both
${ZUSTAND}$
${fetchFromActor('attached', 'ZUSTAND'}$
dont work
Ah nvm I found it. https://gitlab.com/custom-system-builder/custom-system-builder/#4-formulas
Blessed be this is so great.
Is "ZUSTAND" defined on the Actor as attribute, or just a variable you create before the call of the inputtemplate. Because if not might try that. i am not sure if there is another way though. Just my five pennys since i am here. ^^
it is created in the roll message, please see first screen
then my idea stays the same. Try to use a hidden attribute or another value that is saved inside the actor data. Because if i understand correcty what the wiki says, you can use actor or item data. But i am not sure if you can use data you create inside the message. i might be wrong - but worth a shot i guess.
These attributes already exist, but i would like to re use the input template at around 20 different roll messages and each time it needs a different value. so i could create 20 different input templates or just one and hand over this one value that i need to display inside. but you are right, this seems to be not possible right now
Currently not, I'd consider it as a bug
Even when i try it from within the item i always fall back to the key.split error. thats really strange. used it a while back with another system and it worked just fine. Is it a bug maybe?
ahh good to know ^^ thanks :)
there you go - seems to be a bug ^^ - thought would answer you so you know
Ah damn - alright - i found the issue. The target table of course also has to be a string. I can do it from within the item now. But i got no idea how i would be able to get it down inside the actor....
It shouldn't be an issue to pass a string though
Yes - i am doing it like this right now:
@Item[${!find('ITEMTABLE','ITEMID','NR',roll,'==')}$]
That works like a charm. But i dont know if i can reference the table from within a actor.itemDisplayer. Normally you would do find(item.ITEMTABLE...).
But if i do that, it would give me the key.split error. My guess is, that it does that because "item.ITEMTABLE" isnt exactly a string? How would i create a reference through here to the dynamic table within the item. I hope i explained well enough... ^^
Shouldn't 'item.ITEMTABLE' work though? It uses foundry.utils.getProperty() internally
that just returns "ERROR" but without console error and all. which turned out was because i was using the standard "===" and not "==" works now - very much thanks for your help!
That means, that the return is undefined, which will be converted to 'ERROR'
Why are the new "RichTextAreas" so small, both in label and text compared to the old ones? Is there a way I can change their size?
Hey everyone!
So, I need an Input List in a dynamic table to fetch entries from another actor called "Lolvard." However, its filter is another Input List in the same item row of this dynamic table called "category." I'm trying something like this:
${fetchFromActor('Lolvard', "lookup('dynamictable_configpericias', 'pericia', 'categoria', sameRow('categoria', 'Geral'))")}$
But it's not working!
What am I doing wrong?
Do you have any idea when he might respond to me?
As you write, it increases
Doesn't seem true
write more
for now, maybe you could use setPropertyInEntity to set a temporary field that is overwritten with each roll?
https://gitlab.com/custom-system-builder/custom-system-builder#4213-setpropertyinentity
But I don't want loads of text, the old ones are still large and proper. Besides the label isn't going to enlarge is it?
Is there a way to see CSS changes realtime without needing to exit/reload the world?
If you do it via the CustomCSS-module, then you'll only need an update of the sheet
Killer system, btw, ty!
ok so dragging items between a character and an item in the CSB beta is VERY buggy lol
have pushed an issue through on the GitLab <3
for those not on beta: here's what im dealing with here lol
Is there an easy way to throw a logo above the name on the actor sheet?
you can modify the css of the character name with h1.charname{}, in there im sure you could do some kinda content::before modification like explained hereand here to get the image in, and after that you'd need to do some flexbox/grid modification to align them but i think you could get there!
I would like to have all my images in CSS (the only way I know how is to put them in as background images).
But the problem in this solution is you can never let the div take the size of the image...
CSS has a property called content. It can only be used with the pseudo-elements ::after and ::before. It is written like a pseudo selector (with the colon),
this is the first solution that came to my mind but there's likely another better path - this one should work tho :>
a basic example that i did to modify my sheet:
h1.charname {
font-family: MontePro-NormaleUltra;
color: black;
font-size: 26pt;
input {
background: rgba(0, 0, 0, 0);
border: none;
text-align: center;
}
}
Aha, killer idea - thank you!
Yep, totally worked.
Hi, I have Dynamic Table (dt_cleric_gods)
and other field which refer on it ( ${find('dt_cleric_gods', 'god_points_max','god_name', '${item.god}$')}$ ).
and got an error
UncomputableError: Uncomputable token "find('dt_cleric_gods', 'god_points_max', 'god_name', 'GOD_WHITE_FLAME', '===')"
because such Record not present in the DT, is any possibility to suppress such error exist? - Some kind return default value if not found.
Guys, I'm having trouble putting the token on the battlefield and I don't know what to do. I don't understand much about programming. Has anyone experienced a similar problem?
Is there any pre-configuration that I need to do for the token?
There will be something for the next version
Does this issue persist in a new world?
I hadn't tested it before because this is where I did everything, but I tested it now and it worked. What could it be?
Is it possible to transfer the templates I made from one to another?
There's an export button in the settings-tab
I have a question: Is the World Scripter module mentioned here (https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Scripts/Scripts-for-Active-Effects - Section 4) available from the module portal? I am unable to find it.
Nope, not anymore. But you can just google "world script foundry" and you'll find enough ressources.
I tried here and now the tokens from here gave an error. The template creates the token, but if I make a character using the template, the character doesn't go.
Yeah, the workaround that I found was the vanilla world-scripts. However, when I check the modifiers for the active status effects I see that the list contains no names.
Status effects from the tokens menu works fine though
Do you have any errors when updating a value in an Actor?
They should be shown though, because CSB just reads those from the Config. Make sure you don't have a typo there
If I put the actor without choosing the template, it works. When I choose, it show up this.
Fix those uncomputed props I'd say
And how I do that?
Just checked with an online js validator and threw no errors regarding the syntax. The configuration for world.json is also correct according to the foundryvtt documentation.
im trying to do some basic crap and for the life of me cant get it to work, im trying to ref a key and then mutiply that by a constant to get a total, what am i doing wrong
Remove both :
is giving me a 0
Does lifeforcex have a value?
Yeah, you need to reload the sheets after modifying the template
Not really necessary but shouldn´t be the cause
isn't multiplication x?
Do the field and the variable you are using have the same name? No typos?
Nope
lfpcnum is the key where the value is to go, lifeforcex is the key for the constant
Show the definition of lifeforcex please
It shouldn´t matter, if you type ${lifeforcex}$ what do you get?
Remember to reload the sheets after modifying the template
Can you take a snip of the sheet where it is used?
its 0
sheey on left is a sheet, template on right
Life Force is lifeforcex?
ah I c
You want Life Force to show the multiplied number?
Alright so whats going on inside Life Force?
What happens if you leave "Life Force" input field blank? What does it default to?
In the sheet I mean
0
${lifeforcex}$ but im just trying to get it to report the multiplier before i add the constast im multipliing by
Just a question, is this a value that you want to be updated every time you update the multiplier?
Because you are using the default value
what field should i use
in the end yes but for now im cool with it not the multiplier will change but slowly as the game proceeds
but it will be another mulipyier i will add to the formula later after i get base formula working
should i also make it the max formula cause its max lifeforce umless players have a way to go over thier max which is not done untill a higher rank
what is autocomplete formula are these ones that update
I'm surprised, you'd think that default value would show what ever is placed there so long as it computes.
huh
Something strange does happen
WHen you modifie the field
if you give it a 1 it will do the calculation
i switched to a text field and now its just showing blank
Oh you can do Life Force: ${lifeforcex*20}$
But the number field works as well as long as you change the number from 0 to 1
and then for trcking wounds i just make an mumber box with damage taken
ugg gunna take some rework but thanks for help i like the way its gunna go
Yeah I feel you buddy hang in there. You can use the number field as well as long as its multiplying by anything but 0.
If you want to keep your style that is
its been up in the air on how i want to do it the tracking damage will work better for my mostly manual sheet anyway
i think
There are info-icons at some fields (like the default-value). These contain useful information, like that the default value is only relevant at the creation of the Component
You can click on uncomputedProps and check the formula. The formula doesn't work with the supplied values, so you have to do changes there. scope can help you tracking down the error.
Confirmed bug in the system
Hey, I’m working on a custom world script, and I need some help figuring out how keys like ${key}$ are turned into their actual values.
For example, in chat, a message like this:
dmg..${item.final_dice_qte_neutral}$;${item.dice_value}$;${ref(item.characteristic)}$;...;${item.hands}$..dmg```
ends up looking like this:
dmg..8;10;3;6;...;1..dmg
I’m trying to set up an event listener to take these values and use them from my world script. problem being that the event listener does not understand the value returned by the keys. Maybe with some insight about how it's done I can fetch them in a better way
Which Hook?
I think the fastest would be to do CONFIG.debug.hooks = true in the console and check the arguments of the Hook that you're interested in.
Hooks.on("chatMessage", (chatLog, messageText, chatData)
I'll try that
Testing here, I deleted the formulas, but the token still didn't appear and the same error as before showed up.
This error message is not really helpful to be fair.
It works in a blank new world, so something must have happened in between to fuck that up. But the big question is, what caused this
So I really have to keep testing until I find the error?
In English, this phrase sounds more aggressive, sorry about that.
Actually, you can edit the JS-file. Let's see what you get, if you replace actor.getTokenDocument() with this:
async getTokenDocument(data = {}, options = {}) {
const tokenDocument = await super.getTokenDocument(data, options);
const rollData = this.getRollData();
console.warn(tokenDocument);
console.warn(rollData);
// Prepare character roll data.
for (const prop in rollData) {
tokenDocument[prop] = rollData[prop];
}
return tokenDocument;
}
That should print some log messages in the console, which will tell us, with what data it computes
Okay, thank you
It's still showing an error in "tokenDocument[prop] = rollData[prop];"
Yeah, that's expected. I need the additional logs above
They are in yellow
In the version without formulas, nothing appears in yellow. Do you want me to get a version with formulas for you to take a look?
Whenever the error appears, there must be additional yellow log entries above. Otherwise you haven't changed the code
You have to reload the world after changes in the code
I had forgotten to restart the world, I did it, but nothing in yellow appears yet.
I mean you can verify your changes by clicking on actor.js in the error message
That's the same old code
Yep, that's what I need. Expand the second arrow
The first one has only this.
sorry
take the print
The second warning.
Rename your key data to something else. That seems to cause an issue. And there's highly likely also a bug in the system, because it doesn't seem right that the properties of the actor are on the top-level of the token instead of being rightfully in props
I had to leave for a meeting, came back now and changed the 'data', and it worked. Sometimes I forget that the default programming language conflicts with mine.
Thanks for the help.
Never installed this module before, it's not showing up in the foundry module manager and using the repository link doesn't work either? Foundry is up to date and I can install other mods just fine (including the CSB example). Am I missing something?
What module are you talking about?
Custom System Builder, are there different modules?
Eh... system
oh my god
CSB is not a module 😅
oh ym fucking god
i have been doing this for 30 minutes
Why did I not
Nevermind, thank you for your help lmao
TIL I've been doing a lot of ${concat(victories, ' Victories')}$ when I could just have done ${victories}$ Victories. 
this sounds awfully like a certain MCDM project.... 👁️
Yeah. Someone on the MCDM Discord actually made a basic CSB implementation a few months ago, I'm just cleaning it up and adding some stuff for funsies.
Until the full system implementation is ready.
MCDM is an indie RPG company, they're putting out an RPG called Draw Steel.
western rpg? always looking for a good one
hasnt been a good one since deadlands imo
swade jusr didnt do it justice
The game sells itself on the four pillars of "Tactical", "Cinematic", "Heroic" and "Fantasy", so you can expect a game more akin to DnD 4e, however it stands very distinctly apart form the core tenets which D20 Fantasy lives and dies on.
God, the things i'd do to sit in a voice chat and have someone who understands this tool well walk me through a problem i'm having
if you post the issue ppl will get to it in time
oh i know, the issue isnt that people wont help, the issue is that this issue is very complex and hard to put into words!
i usally post screen shots with questions when i find my self in that predicament
might have to record a little video on it honestly lol
nevermind - decided to just rewrite my system to make more sense LOL
is there an intuitive way for me to check if an item displayer is empty?
??
what action are you taking on your sheet to cause this?
Beats me, I'm trying to figure it out. Probably a module
does it just appear? and nothing seems broken?
if so, move on and pretend it doesnt exist 😂
bugs arent bugs if you can see em /j
It seems like it could be causing a previous error. Not sure though since it kinda resolves if I just ctrl f5 in a clean game
and so true haha!
from the looks of it, the program isnt expecting the error code as text, there's probably a missing quote somewhere. if you click on the VM6251:1 bit, that should vaguely guide you to the problem
Ah it's Dscryb
peeps, apparently CSB examples module requires CSB 4.30 but CSB won't update past 4.20
what could I be doing wrong?
Nothing, the example is ahead of the system. Either use an earlier version of the example or set the min required version in the module down to 4.2.
how do I do that?
also whyte version issue?
Its not an issue, the example is up to date with the beta version.
You have to go to the module in the ..\foundryvtt\modules folder and open the module.json file in a text editor. change the realtionships.systems.compatibility.minimum to "4.2.0" and it should stop complaining. Some of the things in the example sheet may not work, depending on if they've implemented them in there in preparation for the main release going to 4.3.0.
if you do that and you have a problem with something related to it, you should probably uninstall and reinstall the module and check again before bringing anything to Martin here though, because you'll have changed the code, a sort of 'voided the warrantee' situation.
Is there a way of making tab titles bold or larger font?
How does this work?
CSS stuff.
You type in a formula that resolves to true or false. True entries will show, false won't.
could you show an example please?
something like closed ? true : false
?
Any knowledge of how to do that. I just want the tab titles in bold and maybe a font size larger? No problem if you don't, but thought I would ask 😀
As long as closed is a key, you can just type in 'closed'
Alright, thanks!
Not while I'm on my phone instead of sitting in front of Google.
Ok. No problem. Thanks anyway
Hello !
**Beta version 4.3.0-rc2 is now available, with the following change : **
Features
- Added function
fetchFromParent(), which will replacefetchFromActor('attached', ...) - Added new functions
alookup(),lookupRange(),fallback(),fetchFromUuid() - Reworked the function
concat() - Added the possibility to have multiple keys inside 1 modifier (separated by comma)
- Adjusted
lookupRef()to return an Array instead of a single value due to the change above - Adjusted parameter
propertyNameinsetPropertyInEntity()to also accept an Array due to the change above
Fixes
- consoleLog() and consoleTable() now actually let values pass through as they should instead of returning
undefined - Fixed an issue, where user-defined properties could collide with Token-properties
- [#409] Fixed a bug, where Template IDs wouldn't be exported
- Fixed a bug, where local variables in Label Roll Messages wouldn't be considered when calling user input dialogs
Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta
If you want to switch an existing world to the beta version, you can follow this guide : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Switch-to-Beta
If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Enjoy !
I almost released a full version, but @lone patrol logged an issue with the items in items feature, which I did not see (Thank you for testing it and finding that, I really appreciate it !)
I'll look into the issue quickly and work to release a full 4.3.0 as soon as possible 🙂
Hi, I'm working on my first sheet for CSB, and I'm trying to increase the spacing between two text fields. Is there a way to do this within CSB, or will I need to use CSS?
The cleanest way would be with CSS. You can do stuff like adding components to move stuff around, but not with any fine detail.
I would like to create a component that shows a 'score' that is based on the average of 3 others numbers. What is the best way to do it?
In the "Label" section of whatever type of component you need, you can have a formula like ${(KeyA + KeyB + KeyC)/3}$
If you need it to be a specific type of component it might vary slightly, but you could do it with a keyed Label component if you need to access the number elsewhere and don't want to be able to directly edit it.
Thank you! I was on the track, but messed up the formula which made it look out of whack and I thought I just chose an incorrect component or something of the like. Formula writing is going to be my kryptonite.
No problem, good luck with it! I recommend using VSC or Notepad++ to write your code then copy/pasting it into the label areas, it lets you review it a bit and makes debugging easier later.
Hey, I seem to have broken something. I'm at wit's end trying to figure out why, but when I add an item to a character sheet, all of my hidden attributes are unset. When I remove the item, they reset. Any help appreciated.
Hello, I'm trying to modify a value on an item (from an actor context, not an item displayer) with setPropertyInEntity but what I understand from your previous message is that it is not possible at the moment, but would be doable with fetchFromUuid. Could you point me on the correct syntax to do it?
Would something like this work?
${setPropertyInEntity('self' , 'Actor.lvY0dry6JyqNG5ym.Item.tGR1MQ0OWL9UTsS1.key_of_the_field_to_set' , 0}$
And would it work only on the beta which was released yesterday ?
I've seen there is a script on the wiki that would do it, but i'm a total "javascript-illiterate" and can't make it work for me.
@brittle moth Question about the upcoming Version 4.3.0:
Will the itemDisplayer inside an item be able to display items that belong to its parent (actor)?
For example: My actor has an inventory with different kinds of arrows (items) in it. i would like to display the arrows that he owns and are compatible with his bow inside the bow-item again as options to choose from which ammunition he uses right now.
${fetchFromUuid('uuid', "setPropertyInEntity('self', 'key', '${value}$')")}$
No, it won't. Only items, that are within the entity
heyy i have a problem with the custom system builder
${[1d100]}$+@{target|FIRE_RESISTANCE}
so i'm trying to make a formular like this work but whenever i put the @{target|FIRE_RESISTANCE} into the ${}$ formular brackets it just spits out an error
You have a fire resistance key?
That's a relic. Use fetchFromActor() instead
${[1d100]}$+@{target|FIRE_RESISTANCE} so this would actually work but not calculate the d100 + my key they would just be printed next to each other
${1d100+fetchFromActor(target:FIRE_RESISTANCE)}$ correct?
No
one sec
${[1d100+:tgtFire:]}$```
You can put a # in front of the first instance of tgtFire in order to hide that line if you don't want it to be in the message.
Or simply ${[1d100] + fetchFromActor('target', 'FIRE_RESISTANCE')}$
I thought that would have some weird interaction between the roll and the fFA?
funnily enough both formulas seem to be just printing the values right next to each other
or not
only the first one
The 34 is the total, the 6 is the reflected fFA.
second one works
ah it shows it seperately?
That's what I meant by inserting the #, that would hide the 6.
But Martin's method is simpler, if you're just after the total.
i am just after the total, the calculations will get more complex from here on out
Not really. The Roll Formula acts like a function with a proper return
how does the fetchFromActor('attached', 'DAMAGE') work it doesn't seem to take the key from the defined items and just spits out an error
attached fetches from the Actor the Item is attached to. So it's Item => Actor
ahh so it's the other way around
good to know
no way to get the stats of an item for a role via the charactersheet?
If you're rolling from an item displayer you can use item.key to reference the item you're creating the roll on.
in your case item.DAMAGE
you just use that in the place of any other key in the formula.
hmm ok i'll try
convenient
Is fetchfromactor( selected) only for tokens selected on the map or does it fetch from the sheet directly
Sorry I can't make it work, it always throws an error.
${'fetchFromUuid('Actor.xPLwN2iETnNareFE.Item.E0LJwBwxiLKO6uG4' , "setPropertyInEntity('self', 'armure_tete_actuelle', '0')")}$
Remove the first character in your formula
Ok, no more error, thank you! but it doesn't update the value on the item...
@formal goblet To clarify what I'm trying to do, i need to update the value of one field of an item attached to a character. The trigger of this is a roll message is a label (button) wich is on the character sheet, but not in the item container. It should be doable on v4.3.0-rc2 If I understand correctly what you said here : #1037072885044477962 message
clarifying question: is the button a static button on the character sheet, or is it in an item displayer?
a static button
how does it determine the item to be changed? The uuid for an item changes between the uuid of the base item (in foundry's Item selecter panel) and the one that's attached to a character (two items attached to different characters will have different uuids from each other and from the item in the selector panel..).
I use the 'lookup' function with a filter ${lookup('item_displayer_armures', 'uuid', 'asp_tete' , MAXSP, '==')}$
${setPropertyInEntity('selected', 'ACTIONPOINT_BAR', "target.ACTIONPOINT_BAR - ACTIONPOINT_REGENERATION")}$
i have a problem i'm trying to add to a numberfield with this so that i can modify a meter but for some reason this doesn't work when executing it from the character label .
This Formula works when executed from an Item actor label
${setPropertyInEntity('selected', 'ACTIONPOINT_BAR', "target.ACTIONPOINT_BAR + ACTIONPOINT_USE")}$
for some reason the first formula works when i don't use a meter component as an input but a seperate numberfield
pls help
Sry, I forgot there something. I'll add that possibility
See what ${ACTIONPOINT_REGENERATION}$ returns
${setPropertyInEntity('selected', 'ACTIONPOINT_BAR', "target.ACTIONPOINT_BAR - ${ACTIONPOINT_REGENERATION}$")}$
has the same issue as before, when i click the button nothing happens
${ACTIONPOINT_REGENERATION}$
has also nothing happening
this is the meter and its current value
should return 20 when i click it
but just nothing happens
no text message no nothing
i don't understand other keys from meter components work
i'm copying this one from the keyname
and it just does nothing
Check the console with F12
game.actors.getName('actorName').system.props in the console and replace the actor name with your actual actor name
Show me the config of the Meter
You have a typo in FORTIDUDE
NOOOOO
it still had a value so i thought it was correct
goddammit
i'm very sorry
🙏
but thank you very much for your help
i was really confused there
probably would've taken me another hour
it works❤️
Sorry to pester, does anyone have any idea what I'm doing wrong here? #1037072885044477962 message
I deactivated all of my modules and the problem persists.
Is there any error in the console?
foundry.js:655 Error: Failed data preparation for Actor.LHo4jJqDlz94kus5. item is not defined
[Detected 1 package: system:custom-system-builder(4.2.0)]
at Hooks.onError (foundry.js:654:24)
at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54)
at CustomActor._safePrepareData (foundry.js:10801:15)
at CustomActor._initialize (foundry.js:10630:19)
at CustomActor.reset (foundry-esm.js:10369:12)
at #handleCreateDocuments (foundry-esm.js:56444:15)
at async CustomItem.createDocuments (foundry-esm.js:11423:23)
Logger.js:33 Custom System Builder | item is not defined ReferenceError: item is not defined
at eval (eval at processFormulas (ComputablePhrase.js:128:40), <anonymous>:3:1)
at processFormulas (ComputablePhrase.js:128:132)
at async ComputablePhrase.compute (ComputablePhrase.js:157:34)
at async ComputablePhrase.computeMessage (ComputablePhrase.js:257:9)
at async Label._getElement (Label.js:107:26)
at async Label.render (Component.js:143:25)
at async ItemContainer._getElement (ItemContainer.js:262:33)
at async ItemContainer.render (Component.js:143:25)
at async Panel.renderContents (Container.js:43:25)
at async Panel._getElement (Panel.js:97:33)
at async Panel.render (Component.js:143:25)
at async Panel.renderContents (Container.js:43:25)
at async Panel._getElement (Panel.js:97:33)
at async Panel.render (Component.js:143:25)
at async TemplateSystem.getSheetData (templateSystem.js:344:41)
at async CharacterSheet.getData (actor-sheet.js:49:19)
at async CharacterSheet._render (foundry.js:5838:18)
at async CharacterSheet._render (foundry.js:6572:5)
at async CharacterSheet._render (foundry.js:7158:5)
You have an issue with one of your Item Displayers. I can't tell which one exactly, but it is a Label in an Item Displayer.
I'll see if I can't hunt it down, here's hoping
Oh my goodness. That fixed it. I think I had mistyped the handles on one of the variables with & or % instead of $. Thank you so much.
Hello !
**Beta version 4.3.0-rc3 is now available, with the following change : **
Features
- Added new functions
setValues()andarray()
Fixes
- [#421] Fixed an issue with item dragging within the same actor or within an item containment tree
Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta
If you want to switch an existing world to the beta version, you can follow this guide : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Switch-to-Beta
If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Enjoy !
It's now part of rc3 with setValue()
hi, I'm having a problem to make the roll in my dynamic table work properly. I have a dropdown option in the last column, that have a custom origin (that lists the keys of my other attribute table), so the player can select a skill before rolling (as skills can use different attributes). However, when I apply the roll, it sends it to the chat, but with an error result.
Check the properties with game.actors.getName('actorName').system.props
You open the console with F12 and enter the command (with replaced actor name)
Ah, try out ref(sameRow('attributevalue'))
Because you only get a static text from a Dropdown
bingo, solved the problem
thanks
can u help me with other question? 🙂
how I make the roll be with advantage when the check box is checked?
You are awesome ! I'm upgrading to RC3 to do some testing, Thank you.
And it's working !!! Thanks again @formal goblet , I've been struggling with this for a few weeks now, it is a relief! ❤️
Something like ${samerow('training')?[2d10kh]:[1d10] + .... }$ should work from what i can see there.
That will roll both. You have to construct the roll string beforehand
how?
${#roll_formula:= sameRow('training') ? '2d10kh' : '1d10'}$
${[:roll_formula:] + sameRow('attributevalue')}$
Is there a way of delaying the messages printed by a macro until the dice has finished rolling? I don´t know if this is a weird interaction with "Dice so nice" module but the messages printed by the macro are being printed (correctly though) before the table from this formula is shown
${?#{DamageRollTemplate}}$ <table> <tr> <th colspan="2" style="text-align: center; vertical-align: middle;"><img src='${!%{return linkedEntity.img;}%}$' width="48px" height="48px"></th> </tr> <tr> <td colspan="2" style="text-align: center; vertical-align: middle;"><strong>${item.name}$</strong></td> </tr> <tr> <td>Damage dice roll </td> <td>${damageRoll:=[:targeting_advantage_option:]}$</td> </tr> <tr> <td>Extra Damage dice roll </td> <td>${damageExtraRoll:=[:damage_extra:]}$</td> </tr> ${#damageModifier:= (damageRoll+damageExtraRoll)<10 ? round(((damageRoll+damageExtraRoll)*0.05)+0.45, 2) : round((damageRoll+damageExtraRoll)*0.1, 2)}$ <tr> <td>Raw Damage </td> ${#damage:=${round(equalText(item.item_basetype,'Physical') ? (pc_totalstrength*item.item_damage*damageModifier) + (pc_totalstrength*item.item_damage*damage_type): (pc_totalmagicpower*item.item_damage*damageModifier) + (pc_totalmagicpower*item.item_damage*damage_type))}$}$ <td>${damage}$</td> </tr> </table> ${#%{ const macroCompendium = game.packs.get('world.utility-macros'); macroID = macroCompendium.index.find(t => t.name === "CalculateTargetDamage")._id; return await macroCompendium.getDocument(macroID).then(m => m.execute({damageType: "${item.item_basetype}$", rawDamage: ${damage}$})); }%}$
I don't know how the delay is handled at all
Nothing serious though, just weird seeing the final damage values before the dice has finished rolling :v
hmmm dont worked... when I try to roll with this, nothing happens
Check the console
<h1>Skill Test ${sameRow('skillname')}$</h1>
<p style="text-align: center;"><strong> ${#roll_formula:= sameRow('training') ? '2d10kh' : '1d10'}$
${[:roll_formula:] + ref(sameRow('attributevalue'))}$</strong></p>
Adjust the column key then
aaah foundit thanks
worked 🙂
I'll publish the system next week, is for Battle Century G-Remastered
there is anyway to block the text field camp to it cant be edited by players?
Hide it and let a Label display the content of it
Yep, formula must resolve to true or false. You can set it to false without any logic to hide it unconditionally
thank you so much!
I can't seem to call a custom user input from a template. I've been using the formula, ${?#{<userInputTemplate Test>}}$, which returns "A user input template was not found."
Any ideas?
You should not include the '<>' in the name of the user input.
It should be ${?#{Test}}$
You should only include the name of your UserInputTemplate object
Just ${?#{Test}}$
Beautiful! Thanks
Follow-up, what formula might I use in a roll message to get the larger or smaller of two rolls? Like for advantage/disadvantage.
You need some basis, on which you can do a decision (be it a Checkbox or something else). You then store the roll string (or just the roll modifier) in a local variable and use that in the Roll Formula
What does "Store it in a local variable" mean? I'm sorry, this stuff is not my forté.
You can create local variables in Label Roll Messages to store results and use them later on.
${result:= 1 + 2 + 3}$
My result is ${result}$
Using that, we can use the ternary operator (a conditional operator) to decide, if we either use the kh (keep highest) or the kl (keep-lowest) modifier:
${roll_modifier:= checkboxKey ? 'kh' : 'kl'}$
${[2d10:roll_modifier:]}$
Ok, starting to understand. Let's say I have two check boxes, one for advantage, one for disadvantage.
Or would that not be the best way to handle it?
A better way would be to use Radio buttons, one for advantage, one for default roll and one for disadvantage. That way your players cannot select both advantage & disadvantage
From the UX-perspective, I'd use either a Dropdown or a Radio Button, so that only 1 thing is selected (either nothing, adv or dis)
Ok, so use a radio button. How would I use that in the above sample formula?
${#roll_formula:= switchCase(radioButtonGroup, 'Advantage', '2d10kh', 'Disadvantage', '2d10kl', '1d10')}$
${[:roll_formula:]}$
Some explanations can be found here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#315-conditions
Yay! Made it work
That last '1d10', what is that for? Is that if neither are checked? I can't seem to have none checked.
You need a third radio button for the regular roll
Just figured that out lol
Thank you guys for the help, and thanks for making the system in the first place! Keep up the good work
how do you do soething like this in CSB? I mean how do you use icons on the character sheet?
I'm trying to make a specific roll in CSB. The characters roll a certain number of d10 dice. I would like to separate all the "1"s rolled from the rest of the roll, counting as critical failures. Does anyone know how I can do this?
And is it possible to double the successes of the "10" rolled?
Going to ask this again, why are the new "RichTextAreas" so small both in label and text compared to old ones? Is there a way I can change their size? The font is different too.
Fontawesome is integrated into CSB, so you can use those for your Labels: https://fontawesome.com/search?o=r&s=solid. Just enter the name of the icon into the icon-field (e.g. dice-d20)
That's basically the only way right now if you want to use the CSB-message output: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
@brittle moth did we even change there something besides the TS-migration?
What do you mean by "new" ?
I haven't changed anything drastic lately, but maybe Foundry Core did, since I'm using the core's functionality to generate these editors.
I'm sure we didn't change the font-size.
The editor size on editing is an open issue (https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/417) on which I'm working (not easy to fix, btw... automatic height is not easy to manipulate...)
I'm still on foundry11 due to most modules not updating or working properly on 12 yet. I updated from... some older version of CSB to 3.2.5 and it seems all rich text areas that were empty now have both their label and text drastically reduced. Also affects any new such richtext
Existing and filled areas were not impacted ?
There has been some tweaking to Rich Text Areas in v3.x versions, but I don't remember modifying the font size
Like in my screenshot, there are 2 text areas. The upper one looks as before, the lower one is new.
It also seems like a different font? Or at least greyer.
I am pretty confident saying CSB is not the culprit then. Any update we would have done on component display like this would have impacted every text area equally.
Is your game accessible from the internet ? I would like to take a look to help you 🙂
Give me a moment to setup a user
I'd also like to add that I hate that discord doesn't have any real forum features, or actual functional search.
I wish there were actual posts I could look through to find what people have done/asked instead of asking myself or being a discord-detective
Oh
Found it, you stumbled into an interesting case x)
Your field is keyed "notes", and the key is added to the CSS classes of the field in the HTML render. And Foundry Core has a specific style for elements with the CSS class "notes", which results in the greyed out and smaller text you're seeing
If you change this key to anything else, you should not see the issue again
Ooh. Let me try.
Word of warning though : if you change the key in the template, you'll lose all the data associated in the field. Please make a backup or create a new Rich Text Area beforehand
Yep that did the trick, so used to CSB warning me about any key thats already in use. Maybe its good to add a warning for this one too?
yep, I'll add it to the list of reserved keywords ^^"
Thanks so much for your help, you're all stars around here
Seems reasonable for now, but what about prefixing the class, so that these can't clash with other classes? I'd do that in a major version update, because it could break some custom CSS from users
Is there a way to check how many spaces an actor moved in a turn?
Uhhhhh... At least CSB can't help you there, but maybe there's some API endpoint in the Foundry core.
The module "Drag Ruler" can help you out
Ah yeah, that one displays it
can i use the amount it shows to calculate things?
Not as far as I know. You may be able to use it by using scripts in CSB, but I never did that and I fear it would be too complicated for the system :/
unfortunate but the module is still useful i'll just add a numberfield where you can type in your squares walked and then i'll add a label to apply it
Drag ruler is really useful, I made my own mini-module for it to implement the different speeds for my csb system
for some reason when using drag ruler it doesn't let me move the tokens anymore and just says they are locked while creating a ghost token on the map
is there any way to insert a Rolltabel into the character sheet?
I think you can drag it into a RTA
Hello, I decided to try out Calling macros from the sheet per 3.3.4. and just simply execute the script the only thing I change is what my macros are named. Why is it displaying an error? Because it's giving me the character sheets name I assume the error must have something to do with the sheet and not the macro? I dragged the macro into the quick buttons slot and same error occurs. I feel like something is being added to the script causing the error. The roll is executed just fine and seems to work, the console displays no error to my knowledge.
no return => undefined => error
Oh so the script needs a return.
I think this is essential, as it is not only Foundry CSS that can clash like this. I created a CSS class called '.wounds' to apply to a numerical input component, and that worked nicely - but a Dynamic Table with the key 'wounds' also picked up all .wounds formatting! I guess if this behaviour is known and documented it's possible to carefully work around the issue, but still…
Just found something about the items-in-items while testing CSB's Beta branch - you can put something inside of another item, and then if you dont have an item displayer, you dont actually have a way to get it out!! Would help having a "can store items?" toggle somewhere that prevents something like this
Yo, so I'm using Custom System Builder in a fairly minimal way; essentially, there is a Google Sheets file that is already scripted and ready for use, and I want to piggyback off of it, as it is a very complex system that would take very very long to make.
I found a module that allows me to add the Google Sheets to the Character sheet and add references to specific cells, but I cannot get this to work.
When I try to add HP to the bars, it does not allow me to add a "maximum". Is there a way to have Custom System Builder reference a different Attribute for the maximum HP?
How can i access the max value of a meter?
Is it possible to create a dropdown list, with labels that have Labell roll messages ... So i want to select a text from a dropdown list, and if i click on the text, i want it to roll 1d6 for example
?
help, CSB has somehow completely stopped working for me on Forge. no updates or anything, tried reinstalling the system, doing a new blank world, all that. character sheets are blank and look like this, CSB settings don't show up in the settings
We could add a menu in the sheet, gm restricted, to see all items linked to the entity and add a way to delete them, would that work for you ?
I don't know how the module you're talking about works... How is the HP field created ? What type of component is it ?
From a formula, you can't. You must recalculate it on the fly, there is no built-in way to get it otherwise in Formulas
You can create a Label next to the dropdown, with for example only a dice-d20 icon, with a roll message linked to the dropdown value. I'd need more info to help you write the roll message, like what is the configuration of the dropdown, but this should work
Which version of CSB do you have installed ? When you open the browser console (F12), do you have any error message ?
thank you, i have snet you a PM
4.2.0 updated today according to Forge. One red error message on load appears at the top of the console
Uncaught SyntaxError: missing } after function bodyDropdown.js:320:9note: { opened at line 270, column 32
That's weird, 4.2.0 has been out for some time now, and I never had complaints from Forge Users on it...
Which browser are you using ?
Anyone familiar with the Modul Status Icon Counters and made it work with CSB? This module allows to display COunters for Active Effetcs (that works) and to multiply the Status Modifiers according to the Number of Effects. The later Part doesnt work for me
eg a status effect gives you Attack -1 , so 3 stacks should result in Attack -3.
that doesnt work
maybe part of the problem is that when you configure your custom active effects in your template these effects have no name as seen on the screenshot
i defined the names beforehand via a world script.
I've been using CSB on Forge for a while and it's been fine, was fine just yesterday.
Browserwise, I normally use Firefox. I just tried out Chrome and it works correctly there, which is weird but there you are 🤷♂️
I'm using firefox as well, and I have no issues with 4.2.0 :/
maybe clear your cache ?
Nothing. I find this extremely weird but guess I can use Chrome for now
Bugfix time, we are close to release !
**Beta version 4.3.0-rc4 is now available, with the following change : **
Features
- Switched all Rich Text Editors to ProseMirror
Fixes
- [#379] Fixed a bug causing undefined values in Item Displayers to be populated with the values of previous items
- [#418] Fixed Dynamic Tables & Item Container sorting system
- [#397] Fixed Dynamic Tables default value handling, correctly computing default values & formulas in default values
- [#417] Fixed an issue with text editors opening too small
Please refer to the README BETA for instructions on new features : https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/README_BETA.md
FYI, Manifest URL for the beta version is https://gitlab.com/api/v4/projects/31995966/jobs/artifacts/beta/raw/out/system.json?job=build-beta
If you want to switch an existing world to the beta version, you can follow this guide : https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Switch-to-Beta
If you encounter any issues with the beta version, please open issues on gitlab and specify you are using the Beta in the issue title !
https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new
Enjoy !
Currently a bug
That's not it. It only works with Foundrys Active Effect Modifiers (these, which you can see via the Active Effect Displayer)
Ah ok, so which side would be able the make it compatible? The module developer or could you guys on CSB side make it work?
Hello!
I am having trouble with an initiative calculation:
${ceil(attributeinitiative+professioninitiative+insightinitiative+gearinitiative+miscinitiative)}$
Everything calculates correctly except attributeinitiative which is based on another calculation: ${ceil((agilty+intuition+aura)/3)}$
I figure that is what is causing the issue, but I don't know how to resolve it. How do you include the result of calculation in one label in the calculation of another label?
Probably a rework on CSB's side
Do you have an error in the console?
The results of Labels can be used in other Labels like any other Input Component
hmm...says unresolved StringTerm, but I am seeing the calculation correctly in the original field...just can't reference it for some reason
Remove the Formula delimiters in the initiative formula in the settings
Um...I am not super savvy on the coding thing (...yet!). Can you be more specific? 😦
Do you use this ${ceil(attributeinitiative+professioninitiative+insightinitiative+gearinitiative+miscinitiative)}$ in the sheet or in the game settings?
sheet
Alright, what are your values of your variables?
Apologies - is this what you are looking for?
agility = 1
intuition = 2
aura = 2
the average coming out to 2
I need those values you used in your formula
Knowing the value of agility doesn't help me, because you haven't clarified the dependency to it
The first is from the template and the second is from the sheet
Alright, show me the props in the error message. You can click on the arrow in the error message to expand it
is this what you are looking for?
Do you use [] somewhere?
no
i tried it with [] at one point, but took it out
Because it tells you, that you do and that the values inside are not valid
Did you reload the sheet?
yes - several times
Is it possible to write a formula that would automatically populate a text fielf with the items UID?
like this?
No. All Input Components cannot be computed at runtime (only at creation-time)
You can use setPropertyInEntity() in a Label Roll Message though, that would update your Input Component.
Check what game.actors.getName('actorName').system.props returns in the console (replace actorName)
i only need it to populate once, it does not have to "refresh", even creating a macro which would populate this field in all my equippableitems would be fine.
All my equippable itmes has a UID field like this and i dont want to copy paste all the uid-s into all the fileds all the time....
These UUIDs will change if you copy Items to an Actor
yes I know, thats not problem
You can replace entity.items with game.items
Just make sure that you have a backup before executing. You might unintentionally delete data
That’s basically what I’m doing for now - just adding a GM only debug panel, so an implementation of that which is always there would be nice. I think in the long run it would be more useful to be able to disable storing items within an item on a per-item basis.
yeah, I had to dig around and figured as much, got a solution though :)
const itemTemplateName = '_Test';
const itemTemplateId = game.items.getName(itemTemplateName).id;
game.items
.filter(item => item.system.template === itemTemplateId)
.forEach(item => {
...and then what?
_Test would be the Template name, not the name of the Item
yes I know, thats what I mean "created _Test category" I mean template...
so here is an item belonging to the :test template
Then it's just:
//...
.forEach(item => {
const uuid = 'yourUuid';
item.update({'system.props.ID': uuid});
});
This will update all Items using that Template with the same UUID
I get the message:
Uncaught ReferenceError: Testing is not defined
at <anonymous>:1:21
I deleted that actor and created a new one (just in case something was off) and got a similar error
Did you use quotes for the name?
Because you always need those when using static text values
actorName => variable
'actorName' => string
No... 😔
Did that and got this:
{
"name": "Testing",
"agility": "1",
"finesse": "2",
"might": "3",
"influence": "3",
"intellect": "4",
"intuition": "2",
"aura": "4",
"power": "1",
"resolve": "1",
"labelphysical": "PHYSICAL",
"labelagility": "<p>Agility</p>",
"labelfinesse": "<p>Finesse</p>",
"labelmight": "<p>Might</p>",
"labelmental": "MENTAL",
"labelinfluence": "<p>Influence</p>",
"labelintellect": "<p>Intellect</p>",
"intuitionlabel": "<p>Intuition</p>",
"labelspiritual": "SPIRITUAL",
"labelaura": "<p>Aura</p>",
"labelpower": "<p>Power</p>",
"labelresolve": "<p>Resolve</p>",
"labelorigin": "ORIGIN",
"labelcareer": "CAREER",
"professioninitiative": "1",
"insightinitiative": "2",
"gearinitiative": "3",
"miscinitiative": "4",
"professiondefense": "0",
"attributedefense": "1",
"insightdefense": "0",
"geardefense": "0",
"armordefense": "0",
"miscdefense": "0",
"professionoffense": "0",
"attributeoffense": "2",
"insightoffense": "0",
"gearoffense": "0",
"miscoffense": "0",
"totaloffense": "2"
}
I don't see attributeinitiative. Did you forget to declare a component key for that?
Found it in the 'Some props were not computed section':
{
"name": "Testing",
"agility": "1",
"finesse": "2",
"might": "3",
"influence": "3",
"intellect": "4",
"intuition": "2",
"aura": "4",
"power": "1",
"resolve": "1",
"labelphysical": "PHYSICAL",
"labelagility": "<p>Agility</p>",
"labelfinesse": "<p>Finesse</p>",
"labelmight": "<p>Might</p>",
"labelmental": "MENTAL",
"labelinfluence": "<p>Influence</p>",
"labelintellect": "<p>Intellect</p>",
"intuitionlabel": "<p>Intuition</p>",
"labelspiritual": "SPIRITUAL",
"labelaura": "<p>Aura</p>",
"labelpower": "<p>Power</p>",
"labelresolve": "<p>Resolve</p>",
"labelorigin": "ORIGIN",
"labelcareer": "CAREER",
"professioninitiative": "1",
"insightinitiative": "2",
"gearinitiative": "3",
"miscinitiative": "4",
"professiondefense": "0",
"attributedefense": "1",
"insightdefense": "0",
"geardefense": "0",
"armordefense": "0",
"miscdefense": "0",
"professionoffense": "0",
"attributeoffense": "2",
"insightoffense": "0",
"gearoffense": "0",
"miscoffense": "0",
"totaloffense": "2"
}
it shows undefined
You have a typo in agilty for your attributeinitiative
ARGH! I am going to go stand in the corner now. That is such an easy fix!! Thank you for the assist. And thank you for the work you put into this. I see the potential and am diligently working to learn how to use it.
const itemTemplateName = '_Test';
const itemTemplateId = game.items.getName(itemTemplateName).id;
game.items
.filter(item => item.system.template === itemTemplateId)
.forEach(item => {
const uuid = 'yourUuid';
item.update({'system.props.ID': uuid});
});
So the code worked, but I dont want to update each item with one specific UID, but I want to update each item with its own UID
If it's just that, then you can use a Label with %{return entity.entity.uuid;}%
This will always point to the UUID of the own entity
its hard to explain what I am trying to do but I keep these items In a item container, and one of the labels of the container has this label roll message: ${item.ID}$
and the items had an ID text field
that contained uidis @UUID[Item.oEuhab2vtVhGbZTW] like this
so when I clicked the button it sent the ide into the chat
the goal is to have a button on the character sheet that send the item into the chat
%{return entity.entity.uuid;}% will give me the uid
but the format is not okay @UUID[ ] is missing
Does this work with your current setup?
yes
Then it's just:
%{return '@UUID[' + entity.entity.uuid + ']';}%
I have figured this out,
Then why the Text Field, if it contains the same value as the Label?
because the label updates when i copy it to a character sheet...
so the palyers will not see the ability if i send it to the chat, unless i give then visibility to the character sheet, meaning they will allways see all the abilityes of the enemy, also all other stats...
...
Aslo if I do this:
then the text field will be populated with the ID of the TEMPLATE
huh? Interesting
so every other ID will link to the template.
just tested this
I either need a button that "refreshes" the text filed, filling it with the ITEMS ID instead of the TEMPLATES.
or I need to stop the Label from refreshing.
//...
.forEach(item => {
item.update({'system.props.ID': '@UUID[' + item.uuid + ']'});
});
const itemTemplateName = '_Test';
const itemTemplateId = game.items.getName(itemTemplateName).id;
game.items
.filter(item => item.system.template === itemTemplateId)
.forEach(item => {
item.update({'system.props.ID': '@UUID[' + item.uuid + ']'});
});
like this?
Yup
As a Macro ofc
one small problem...
i assume this will update all the items that are already belong to a character right?
I love you man...
thank you
is there a way to apply this on multiple template at once?
const itemTemplateNames = ['_Test', '_Test2'];
game.items
.filter(item => itemTemplateNames.map(name => game.items.getName(name).id).some(id => item.system.template === id))
.forEach(item => {
item.update({'system.props.ID': '@UUID[' + item.uuid + ']'});
});
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
The some() method of Array instances tests whether
at least one element in the array passes the test implemented by the provided
function. It returns true if, in the array, it finds an element for which the provided function returns true; otherwise it returns false. It doesn't modify the array.
Hey Team CSB, its possible to use JS with component keys? When I try at first it didnt work and just returend me an empty field. After I added another value with + it worked but as soon as I recreated my character sheet it blew up everything throwing me errors everywhere?
It is, but it highly depends on what you're trying to do ofc.
${%{ return Object.values(entity.system.props.Armor_Container) .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); }% + AP_Mod}$
I have this and I want to assign a custom key: AP_STA_H
And recall that key in a label. Last time I tried it threw me errors everywhere and my complete actor-sheet became unuseable.
So it's within a Label text?
Yes
Is that the issue?
Kinda... The thing is, that the order of computation is not always ideal.
In the system, if a dependent property is undefined, the formula will throw an internal error and postpone the computation in a later cycle, hoping that the property will have a value until then.
The same issue applies to scripts, which depend on values of computable Components like Labels and Meters. For those cases, we've added entity.throwUncomputableError(message, source). So it allows you to check for an undefined property and throw and error to postpone the computation. In the context of an Extensible Table, you'd need to check all cells within the columns you need.
I understood kinda but also kinda not. So is there a way I can get it to work then?
It adds quite a lot of boilerplate code though... @brittle moth how about adding an API-endpoint (public function in ExtensibleTable), which does these checks and returns the cleaned properties (considering uncomputed props and the $deleted-rows)?
I can also do it by just copy the label again, but it would be nicer to just refer to the key and the label shows me the value
This is possible, but would be hard to use, since one would need to get the ExtensibleTable instance to call the function, and there is no easy API to get that
Isn't it part of TemplateSystem#componentMap()?
It is.
But thinking about it, I'm not sure it would work. More specifically, if called in the sheet, it would always be one update behind : the values it could compute would be the ones before computation, since it would be in the computing process
True, probably an issue
From what I read, you're trying to sum all Armor_Protection_Standard from rows where active === '✔' and Body_Region is either Kopf or Ganzkörper
You can do this using only standard formulas
- Set up an additional column of type Label, keyed
Active_Armor, with text${sameRow('Active') == '✔' ? sameRow('Armor_Protection_Standard') : 0}$. Hide this column from your players using the Advanced configuration - Rework your
AP_STA_HLabel with the following text :
${sum(lookup('Armor_Container', 'Active_Armor', 'Body_Region', 'Kopf')) + sum(lookup('Armor_Container', 'Active_Armor', 'Body_Region', 'Ganzkörper')) + AP_Mod}$
Your Label should be reflecting the right value, and will be correctly computed each time (because it will check for computation order)
I had to change it to
${equalText(sameRow('Active'),'✔') ? sameRow('Armor_Protection_Standard') : 0}$
But besides that it seems to work
ah, yeah, sorry, I keep forgetting this ^^"
Well something isnt working as intended. These values should return me a 2 in all rows and columns but they dont update at all
Anything in the console?
Und "Standart" gibt's im Deutschen nicht, ist immer "Standard"
Ich werde das sofort ändern
There is like a whole bouquet
Seems like you have issues in the Costs and Total-colums of your Skills-table
Check scope, if your values are correct
Base is missing and you have a whitespace at Mod (probably not really an issue, but it's better to be clean)
Hello!
First of all, thank you so much for your work, it makes it so easy to make actually usable character sheets.
I am currently having major issues with performance, some actions taking a full minute to resolve, and opening items taking up to 30s.
I tried many things that improved performance a bit: disabling field controls, delaying entity saving, reducing numbers of item containers (by putting everything in one and filtering), disabling log, etc.
My main issue is that sometimes (very rarely) items open without any issue, but most of the times it strangely recomputes all items tens of time ("All props for _ computed in 1-4 loops" for all items, computing the same items tens if not hundreds of times), and it makes it a real struggle to play.
My items either modify the character sheet (equipment) or are modified by the sheet (spells) but not both at the same time.
Do you have any idea of where this issue may come from please? I am at a complete loss.
Thanks in advance for any help! 🙂
I dont know what to do with that
Also the whole armor-thingy is throwing errors on me when I create a new Actor and give him an amor
Hello again.
Can you add to a number field with a formula? And if so, how?
For example: a healing potion adding to the life score.
Check the conversation from this point onwards: #1037072885044477962 message
Show me the config of Base and Mod
This is the function you want to use in a Label Roll Message: https://gitlab.com/custom-system-builder/custom-system-builder/#4213-setpropertyinentity
You mean the formular of the Label?
Whatever Component it is. If it's a Label, then the Formula
Oh. Not what I wanted to read tbh, but thank you for your fast reply.
I guess I will try to refactor my sheet to use fewer items...
May be useful to others to have this as a note in the items' documentation, I was not aware that Foundry worked like this 🙂
Although, why is that a Formula instead of a Number Field, if it is the base value?
I'll do tomorrow. Im about to Go to bed and slighty frustrated. Base is a number fiels and mod a label
Me neither until Linked replied. To be fair, the update-lifecycle can be quite complex
To be fair, show me a simple update-lifecycle in any framework...
Yeah, I guess that being dependent on Foundry's lifecycle doesn't help.
I was wondering, recomputing all items once or not is Foundry's whim, but can recalculating everything multiple times be avoided?
(I understood that I could reduce the number of loops by items, but the maximum I've seen for some spaghetti-coded item types is 4, so I guess it is not my main issue)
Maybe you'll get better results, if your Items wouldn't be dependent on the Actor at all. Otherwise I have no clue how to reduce the amount of loops
I have never run these kind of performance tests
I guess, but removing modifiers from equipments would defeat their purpose...
Not modifiers, because it's vice versa (Actor depends on the Item)
I talk about stuff like fetchFromActor('attached', ...), where the Item needs data from the Actor
I see, but my equipments only interact with the sheet through modifiers (and item containers of course), they have no fetch, and still get recomputed tens of times (each in 1 loop).
My spells have multiple fetch so get computed in 1-4 loops, but my problem is that it is doing the same things tens of times in a row....
Then idk. Finding the cause will be troublesome
Foundry itself announced a performance-update for V13 regarding this topic. So it might be completely on their side. Until then we have to take the meat.
Hm. I'm a bit comforted that my spaghetti code is not the source of the issue, but sadened that I can't really do much about it.
Thanks again, I hope you can make CSB work on V13 (when it's out) without too much pain 😄
Hope so too. I haven't seen anything on V13, that should break anything on CSB. But that's only an analysis based on the feature list of V13, not an actual code test.
The joy of impact analysis 😛
Btw, I was wondering about loops (for, while, ...), any plans on implementing them?
You mean in Formulas? Not planned. You can use JS if you need those
Yeah that's what I did, just wondering if this was planned, as it is basically the only case I had to use straight js
Thank you for the info 😉
Interestingly enough, mathjs has these but I've never seen someone using them: https://mathjs.org/docs/expressions/syntax.html#foreach
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 remember trying something like that at some point and not getting it to work, I will look into it a little more then, thanks!
Why aren't my changes being saved?
I got this issue with the "Delay Entity Saving" option in CSB parameters, had to chose between delaying saving and rich text fields....
That was it! I disabled it and now it works!
Thank you very much!
But is this a bug?
I saw in the 4.3.0 beta changelog that they stopped using rich text fields "Switched all Rich Text Editors to ProseMirror", maybe that'll help, haven't tried yet
It is and I also don't know if ProseMirror will fix this: https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/404
Thank you
@formal goblet ,
So, is it recommended not to use the "delay entity saving" feature?
Could this feature be impacting other areas, or just this component?
No clue. @brittle moth you probably have more insights on that.
I have this up and have been following along, but I am not getting the result I am looking for. I put in something simple like setPropertyInEntity('self', 'vitality', 20) on a button label as I was looking to add 20 when clicking it, but all that is happening is that I get a chat with that information and no changes to the sheet.
This will change the value of an Input Component with the key vitality to 20 in the same sheet, where the Label Roll Message is executed.
If this was your intention, then you should take a look at your key if that is correct. If not, then I'll need to know what.
this is my key and the maxvitality is 500
Keep in mind, that values are set and not added. You have to adjust your values by your own.
I would love to add, but looking through the documentation it looks like you can do it by pulling in the reference and then adding to it in a setproperty...
at least that was my takeaway when reading this:
Decrease the value of the key Health (target) by the value of the key Damage (self) in the current target: setPropertyInEntity('target', 'Health', "target.Health - Damage")
Yep, you can pull the current value and peform calculations on that. The function will take the result of these as expected.
I recommend to use a default value for number fields, but that shouldn't be an issue for your test case.
ultimately that is where I am heading, but I am just trying to use each formula at its basic to make sure I understand it before adding more complications to it
I had the default to 0, but took it out thinking it may be causing the issue (which it wasn't)
The default value is only considered when the Component is being created. At all other times, it's useless
The only thing I can think of, are that your Label Roll Message and your target Component are not part of the same sheet.
Actors and Items are different sheets
This is the actor sheet. The button is where i put the SetProperty formula and the vitality number component is right next to it
Is that a Dynamic Table?
no - just a regular one
console looks good - no errors
I am going to try backing up and just creating somethign simpler first and see if I can get to the conclusion on why this thing is doing what I want
simplifying did the trick - I found the culprit
is there a way to remove the default d20 from appearing when you use the label icon? I have both icons showing up
Remove the one in the system settings
got it - so I just need to put a d20 in manually when I want to have that.
When i use the SetProperty... formula it is not recognizing that I have a max value in a number component. If I try to enter manually an amount greater than the maxvlue, I get a warning message and the entry caps out at the max. If i click on the button and add an amount over the max, it just adds it regardless of the max
That's normal and we can't prevent that without additional checks
You can use the min()-function in the formula to cap the result
Can I create a function or formula that returns the 'uuid' of the actor I'm currently using? I'm asking if this is possible with CSB formulas ${}$ and not like this one
%{return entity.entity.uuid;}%
I believe that fetchFromAcror() can have uuid, and I think (not at my computer atm) that uuid might be one of the reserved keys on the csb documents. Did you try it out?
Yes, I tried. I tested it in several ways, and it didn’t return anything!
The feature is non functional at the moment, I probably will disable it for now. It causes issues in Text Areas, and in Dynamic Tables last time I checked
It is really recommended
Just found out I did a syntax error in my forumular. Seems like I was too tired to work productive. But as always, you my everyday-hero martin 🙂
I have been using this feature for months now and half of my components are dynamic tables, haven't noticed any bug apart from rich text fields. What is the bug you're referring to please?
It has honestly been a while, but I remember not being able to create new rows in Dynamic Tables. If you haven't encountered it, then I guess I fixed it somehow ^^"
Hello again!
Just tried a few more things to resolve this, and it seems to not be happening (or way less at least) on recently created character sheets: one of my players was heavily affected by this issue (looping hundreds of times), I just recreated his sheet (drag&dropping items from original sheet), and the issue has disappeared.
Could it come from updating character / item templates too many times? Or editing items too many times?
Edit: duplicating all characters sheets looks like an ok workaround for this
In the Bush, The Military RPG Prototype (01/27/2025) In the Bush is a mixture of using the historical material in the military tabletop roleplaying game known as PATROL and its ideas. Alongside the actual system in play is the Year Zero, Twilight: 2000 tabletop engine alongside add-on additions...
Open to any suggestions and criticisms of what to improve on, rn trying to outline fixable things and sorta a dev-timeline
This is a dirty hack but I just have a hidden attribute on all of my templates named "uuid" with the value from the %{}% formula, it's not reserved and works fine (I think)
Do radio buttons in dynamic tables not pick up row data in value formulas? Mine don't seem to be doing so but I could be doing something wrong
hi, i'm new to this stuff and i've been trying to make this work for the last 50 minutes and can't solve it. why is it not showing me the number?? always just []
Ataque à Distância: ${roll1:=[(:bonus_ranged:+:agility:-1)d6]}$ + Dado Doidão: ${roll2:=[1d6]}$ = ${result:=(roll1 + roll2)}$
Resultado: ${(:dd:-result)}$
${(roll2 == 6 ? "Sucesso doidão!" : roll2 == 1 ? "Falha doidona!" : "")}$
${dd - result}$
Radio Buttons are not really functional in Dynamic Tables. Use Dropdowns instead
thanks!!
Perhaps a dumb item-related question:
Let's say I have a 'subclass' item type. I want to limit most actors to having only one item of this type on their sheet, but under some conditions (based on a formula) they might be allowed two - one primary and one secondary.
-
Can I limit the number of items of this type that can be added to an actor sheet based on a formula?
-
If so, can I reliably identify which is 'primary' and which is 'secondary'?
The way I'm thinking about this is 'slots' on a character sheet, but I don't see an obvious way to create a field that references a single item.
The only solutions I can think of are:
-
Intercept the item creation hook and run some logic, but idk where to put this logic outside of a custom module.
-
Create a button on the sheet that calls a macro that both adds the item to the sheet and runs some other logic. But then, no way I can think of to prevent players from just dragging the item over anyway and doubling up.
Is there any tricks to edit or add something without the UI ? I need to add a table with 45 skills, each with 5 user editable modifiers.... Doing it by hand with the UI seems like a lot of work... I have the table in html already.
You'll need a World Script to listen to the Hook. That's the only safe way.
I think the fastest approach would be to edit the JSON of the export
I was afraid of that, but it makes sense, thanks.
As long as I'm building a custom module anyway, can CSB sheets be easily imported via script? I assume the button in the UI is doing something I could just find and more or less copy, distribute all the things together.
I have a label that acts as a button. The player clicks the button and selects some options. You know that field where the user inputs choices? For example: "Enter the difficulty," and then the player types it in.
However, I have an Item Displayer that shows "Skills," such as Stealth, Deception, etc. The player adds items (skills) to this Item Displayer.
Now, regarding my label that acts as a button, is there a way to display a dialog with a dropdown list so the player can select a skill from the list to make a roll?
The skills (items in the Item Displayer) have a field called "level," a number field, and I need to reference this number to use in another roll.
You can create your dialog box with the user input template. Inside you can create a dropdown witch will retrieve the skills & levels using lookup().
Is it possible to roll an item's label directly from a script? E.g. have a button in an item displayer that rolls the "Use" label on the appropriate item
is it possible to make a macro for a label button inside the character sheet?
It is, should be something similar to this one: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Handling-Dice-Pools
thanks bud!
uhhhhh, the template stopped working out of nowhere
templateSystem.js:544
Uncaught (in promise) Error: Trying to reload entity with undefined template : undefined - Actor.ze2k2eZR65YcwkzS - c
at TemplateSystem.reloadTemplate (templateSystem.js:544:19)
at HTMLAnchorElement.<anonymous> (templateSystem.js:892:26)
at HTMLAnchorElement.dispatch (jquery.min.js:2:43184)
at y.handle (jquery.min.js:2:41168)
What are you trying to do in the Macro?
it's very complicated. My plan is
- attacker marks a target and presses the attack button
- the DC is calculated based on the distance between the attacker and the target
- it then activates a macro that asks the target if they want to dodge the attack
- if yes, they roll :agility:, if the result is higher than the previously set DC, it takes its place, if not, the DC continues being the same
- then the attacker rolls, the result gets subtracted by the DC to get the difference
- it checks on a table based on the difference, how much damage that would be (for example 4-9 deals 1 damage)
- shows on the chat if the attacker hit the target and how much damage it dealt
(it also has a crit mechanic based on separating one d6, with 1 being critical failure and 6 being a crit)
Show me the output of game.actors.getName('actorName').system
Console is enough
i didn't use game.actors.getName('actorName').system, i tried to get the target by using an array
(i'm really new to coding js sorry if it wasnt a good choice)
It's for this error here
Does point 3 include to display the dialog in a different client?
ye
well actually it didn't work, cuz it showed in my screen, so i probably fucked up
This is advanced territory, cause you have to send web-requests to a different client
hmmmm
API documentation for the Socket functionality available to packages.
But back to the actual error. Open the console with F12 and enter this command: game.actors.getName('actorName').system (replace 'actorName' accordingly)
you want the info of the template, right?
Of the Actor using a Template
CSB expects, that template includes the ID of the Template the Actor is using. But you overrid that somehow to the string "undefined"
That's why it can't find the corresponding template anymore
You can fix that with await game.actors.getName('c').update({'system.template': 'idOfTemplate'}) in the console (replace 'idOfTemplate')
And here a guide: https://github.com/GamerFlix/foundryvtt-api-guide/blob/main/README.md
What do you get with game.actors.getName('templateName').id?
That is the ID. Idk what your 307... represents
probably me being dumb
let me try
no way i'm this idiot
wait, i see the different, i accidently deleted the space
same thing wth
should i just start over?
Ok, how about game.actors.getName('c').templateSystem.reloadTemplate('lfonOxKVy9ghW8OY')?
IT WORKED!!
thanks dude, you're the best
and also thanks for the patience
i started coding 2 days ago
i just know basic coding from a few courses i did so most of the things are new to me
You should be able to do much with knowledge about basic object oriented coding
Start with basic concepts like variables, operators and functions and continue with classes and methods
ok!
again, thanks dude
i'll stick to the simple things for now
uh oh, it isn't fixed yet
cuz the buttons (that had nothing to do with the macros) isn't working
What's the Label Roll Message of that Button?
It's trying to get x from something, that is undefined
``Ataque à Distância: ${roll1:=[(:bonus_ranged:+:agility:-1)d6]}$ + Dado Doidão: ${roll2:=[1d6]}$ =
${(roll1 + roll2 - %{
let baseToken = canvas.tokens.controlled[0];
let targets = Array.from(game.user.targets);
if (targets.length !== 1) {
ui.notifications.error("Please target exactly one token.");
return;
}
let targetToken = targets[0];
let gridSize = canvas.scene.grid.size;
let distanceInPixels = Math.hypot(
baseToken.x - targetToken.x,
baseToken.y - targetToken.y
);
let distanceInMeters = distanceInPixels / gridSize;
let distancePenalty = distanceInMeters * 2;
return distancePenalty;
}%)}$
${(roll2 == 6 ? "Sucesso doidão!" : roll2 == 1 ? "Falha doidona!" : "")}$``
it was working yesterday
Seems your baseToken is undefined
Do you know, what canvas.tokens.controlled[0] does?
it refers to the first token currently selected
Correct
That's a different button, right?
The error indicates a different Label Roll Message, because it tries to read IC from something, that is undefined
but there's nothing that does that in my code
The console says otherwise, and that one is always true
hmmmmmmm
did my "macro" also overwrite something else too?
like it did with the template
Depends. Did you use update somewhere within it?
i didn't
Because that is more or less the only way to persistently override a value
but didn't use update, how come it got overwritten?
is this what they say about coders being a bunch of mages doing magic stuff?
is it possible to create a text tile on a scene canvas that updates according to a stat on the character sheet?
"Ohh look, it's Archivist again, bet he has another janky-ass crazy weird question!" 😅
So... Got an idea I'd like input on.
Game designer for a 2d6 system is looking at working with 3(+)d6kh2, and now wants to experiment with 3(+)d6kl2 as well
I'm thinking my best idea to implement both of these side by side is to have the "+d" choice assign to a variable, and the "-d" to its own variable, perform the math, then shove that result into my actual roll formula?
That way if you have the same +/- counts it just cancels out.
The other thing I'm looking at is the "-d" won't be using numerical points, it'll be a list to choose from (from a dynamic table), but there isn't a super good way to have multiple choices on a User Input template is there? Dropdown is the cleanest, and I don't want to have a whole list with checkboxes on the user input, that could get lengthy... though checkboxes might work. 🤔
@formal goblet
I don't know if this has already been noticed or if it's actually a bug.
But if I try to assign a key to a label, the result of this function does not display on the label. However, if I create a label without a key, then the result appears normally.
Is this behavior expected?
Hi guys! I have this macro i use to import adventure items and equipment from an excel table i own. Altough the macro is able to select the right template (_Inventario) when transforming the data i paste in the dialog box in Foundry items and correctly populates the approriate fields in the item's sheet, i have to manually click on the "reload template" button and load the template _Inventario before the macro can populate the fields. I weren't able so far to find a way that automates the action of loading the template instead of simply select the right one in the dropdown list at the top of the sheet. I mean, i don't care nothing of manually clicking 'reload template' if i have to import a few objects, like 5-10, but think of importing 50-100 items and clicking 'reload template' on each of them when the macro creates the item's sheet.... well, it's very annoying! Do you know a couple of code instruction that i can insert in a macro to tell it to automatically not only select, but also actually load the item's template? Thanks!
async TemplateSystem#reloadTemplate(templateId?: string) does this. To get an instance of TemplateSystem, simply doing entity.templateSystem is enough (where entity is either an Actor or Item).
@flat hazel tu masz
Is there anything in the console?
I'm not sure if I just missed it. With a dynamic table I can add items to an actor like to add weapons or equipment to a character. But it is possible to add actors to other actors too? For example if I create a spaceship as an actor and want to add other actors - characters in this case - as the crew of this ship (so some values of the ship are depent on its crew).
Not directly. You can create Text Fields, where you can enter the names of the crew (or the UUIDs) and then use fetchFromActor() or fetchFromUuid() (v. 4.3) to fetch necessary data from your crew.
Otherwise there's no Component for Actors, that acts like an Item Displayer
How do I hide a script in a roll message from showing? I still want the rest of the roll message to be shown
%{return await game.macros.getName('Add Alert').execute({argAlert: { label: '${name}$: ${item.name}$ lands', message: '${name}$: ${item.name}$ lands', userId: game.user.id, roundAbsolute: false, endOfTurn: false, phase: "Squad Phase", myDuration: parseInt('${item.delay}$'),} })}%
There's a Checkbox below
A wait, you mean something else
Because that little box at the beginning is ugly (the script)
${#%{
return await game.macros.getName('Add Alert').execute({argAlert: { label: '${name}$: ${item.name}$ lands', message: '${name}$: ${item.name}$ lands', userId: game.user.id, roundAbsolute: false, endOfTurn: false, phase: "Squad Phase", myDuration: parseInt('${item.delay}$')}});
}%}$
No error was generated in the console
Do you get the same issue with lookup()?
I don't know
I don't remember testing it. Let me test
Look:
A detail I also noticed. When I put the recalculate function before the find function, it works!
Question - for when you are setting a roll that includes a prompt for a modifier, is there a way to program this to instead provide a drop down. I am working with a system that deals with d100 rolls that has consistent modifiers like +10, +20, -10, etc
The Month format from the simple prompts example covers that.
?{month:'What month are you born ?'|"January"|"February"|"March"|"April"|"May"|"June"|"July"|"August"|"September"|"October"|"November"|"December"},
Forgot to tag in the reply, see above.
Hey, is it possible to setup custom status effects? Besides that given from foundry? Or modifiy the already given ones in foundry? Is that in developement?
Is it possible to remove the status effect from the world again if I may fuck up ?
You need to override the default ones on every client-startup, otherwise you'll get the default-ones back
Ah Okay. TY
Hello! I'm working on changing the look of my character sheet using some CSS, and I'm a bit confused about how to access things on the character sheet. I have tabs (Basic Info, Features, Items), and in Basic Info, I have a panel (Wounds) with four checkboxes (w1,w2,w3,w4). This is the CSS I'm trying, but it's not working (though other formatting in the sheet is working). Anyone know how to access specific objects in a emplate using CSS?
#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w1"],
#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w2"],
#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w3"],
#my_tabs .tab[data-tab="Basic Info"] #wounds label[for="w4"] {
color: red;
}
EDIT: It worked! I just had to delete #my_tabs and it automatically got the right one.
Hi sorry for the delayed response. The HP field is created by creating a Reference on the window to the left. You assign a name to it, and it fetches the information from an Excel Sheet cell, in this case it would be the HP or whatever. However the Bar won't let me assign the second number (You can see it here on the right, it just says 50/ instead of, say, 50/100
I don't know what type of component it is.
Is there a way I could find out?
Hi there ! I'm trying to add a button to roll damage in the chat message created by my hit roll macro 🙂 Do you know if it's possible or if I'm losing my time ? I'm currently looking at something utilizing the requestor module but it doesn't seem to work 🤔
I think the issue lies within the module, which doesn't tell Foundry, which fields have a max-value. It don't know the specifics of the module, so I can't really help you there.
I have no clue about the module, but it's possible (although a bit tricky):
Hooks.on('renderChatMessage', async (chatMessage, content, speaker) => {
content['0']?.getElementsByClassName('world-apply-effect-on-targets')['0'].addEventListener('click', async (ev) => {
//Do stuff
});
});
The world script could be optimized, but it works. You have to make sure, that you tag your Button with a CSS-class or something else, so that you can run a selector through it and add an event listener.
Thanks, I'll look into that ! I also understood why the module doesn't work, and it's because it's supposed to be used through macros, and not chat messages 😅
I'm very new to this though, can you tell me where I should add a world script pls ? 🙂
Thanks, I actually didn't know about this wiki 😅 That's gonna be handy ! 😄
just created a new world and got this error while trying to reload the character sheet
i just changed the template using this
but same thing as before, when i press a button, this pops up
bruh, i just fixed it
i uninstalled CSB and installed it again
hello, sorry if this has been asked before, but how do i acess values from a charachter sheet in a macro?
i'm trying to make an attack macro and for that i would need to access elements on the sheet such as int, but i cant access it
Look under actor.system.props I believe.
Hi. I have a question. Do the number of existing items and actors influence foundrys performance?
Im asking because I wonder if I should delete the items which belong to my systems previous versions... or can I just drag them into a folder and keep creating new ones?
Oh my, this time i'm in need (but not about a macro, for change 😅 ). In particular i cant' ger an item modifier to set the value of a Label in my character's sheet. As you can see the Label 'Valore Arma' (Component key VAL_A) on the actor's sheet is empty. I have this item in my inventory (Bastone Orientale) in which i've set an Item Modifier: if the weapon is in Slot1 and its size is 'Piccola' set VAL_A equal to the value contained in the field Valore Arma (P) of the item (component key WPNDMG_P), and if the size is 'Media' set VAL_A equal to Valore Arma (P) of the item (component key WPNDMG_M). This is the formula of the modifier: ${Slot1?(equalText(WPNSIZE, 'Piccola')?WPNDMG_P:WPNDMG_M):''}$. I've tried also a much simplier formula, like ${WPNDMG_M}$ to set VAL_A directly and simply as the value of the medium sized weapon (without conditions or referring to slots), but with no results. Why item's modifier doesn't work as expected?
They increase the initial load of Foundry, but that's it. If you put them into a Compendium, then these wil not be preloaded
is there any way to create a character template which comes with pre equipped items when selected?
Or is there any way to add multiple items at onece to a selected character?
Has anyone ever tried/succeeded with a dynamic initiative system?
Hey, is it possible to create items with itemdisplayer? Like nesting the items?
Hello!
I have an item with checkboxes that I would like to put an item modifier in to reduce a number field based on how many checkboxes are checked. So far I keep arriving at NaN (not a number).
Numberfields cant be modified like this. You can modify labels.
I tried it with a label too, and didn't get anywhere. Let me switch it back and tinker around.
Seems like something is with your formular
You need something like:
${(Checkbox1 ? 1 :0) + (Checkbox2 ? 1 :0)}$ and a - as operator
This is what I have in the value formula:
${5 * ((fatigue1 ? 1 : 0) + (fatigue2 ? 1 : 0))}
Went back step by step and found the culprit
Perfect 🙂
How do you get the checkboxes to show up in columns on the item display?
Add element, label: ${item.fatigue1 ? 1 : 0}$
You can add of course diffrent values or even symbols from fontawesome
Do I put this in the item itself or on the sheet as a label?
A element in the itemdisplayer
I get this error: No access to property "fatigue1"
Scratch that - I see what you were getting at.
How do I set the value of each option in the dropdown?
I simply have a system that has a value, something like "AC" in D&D. Then, I use the dropdown to select the "training level" for this AC. I want to have options to add +2 / +4 / +6 / +10. For this type of "Armor Class". I will also do this with skills, so at the moment I am completely lost as to how. The problem is that there is no option in the Dropdown to add a value for each of the options in the Dropdown.
(Ignore the names in Portuguese, I'm Brazilian...)
How do you get an item modifier to reference a checkbox on the character sheet?
What are the keys of the Dropdown and how's the Formula for the AC?
fetchFromActor('attached', "Checkbox"), because Item Modifiers are calculated with the properties of the Item, not Actor usually
Rename your key btw, that warning is not without a reason there
And check the info box of the default value of the Number Field. The default value is only relevant, when the value of the Number Field is undefined (basically only at the creation time of the Component). Otherwise it's completely useless, because Input Components like Number Fields aren't supposed to be updated automatically.
If your value is dependent on a different Component, then you either have to use a Label or a Meter
And now regarding to the Dropdown. Your Dropdown will return the option key you've selected, meaning if Treinado (+2) is selected, the Dropdown will return 'treinado_ref', which is not a number.
To get rid of the issue, your Label, which should depend on the Dropdown, can use the switchCase()-function to compare the result of the Dropdown and return a number respectively. For example switchCase(graduaco_ref, 'treinado_ref', 2, 'veterano_ref', 4, 0)
Is it very complicated to create a script that sends a button to the chat, and this button contains a CSB formula?
You need this: #1037072885044477962 message
It does seem complicated (at least for me).
Honestly, I didn’t understand it very well (blame my English).
Would I have to add this macro to the World Macros compendium?
And from there, call it within CSB formulas?
You can't have a CSB-Formula in the Button (except if you want to store data in the data-attribute of the Button, but that's it). Everything else must be handled by the script. And yeah, this is a World Script
Obrigado! = Thank you!
Ok, I'm not sure if I understand correctly, should I change the AC component type to "label" or "meter"?
Then I'll put the key for each of the dropdown options as a numeric value? Like Key = 2 / Label = Trained (+2) for example. Is that it?
Probably a Label. And you can use numeric values as keys in your Dropdown options, no problem. You only have to make sure, that Dropdown option keys are unique to each other.
I don't want to use numeric values as keys, because it can get really confusing. What exactly would I have to do? I mean, I understand that I have to use the switchCase() formula, but I don't understand exactly how. And to add the value inside the AC, would I still have to put a ${graduacoes_ref + 10 + mod_dex}$?
AC/REF = 10 + dexterity mod + the graduation level (selected with the dropdown). So where exactly would the switchCase() come in??
You add the function to the formula of your AC, if the final value should depend on the Dropdown
You replace graduacoes_ref with that, what I've written for switchCase()
Hullo shipmates, happy to have found this channel, hidden away as it is. I plan on making My Father's Sword by Nordic Skalds, as I don't see it anywhere, on any platform.
Hopefully I won't need to ask too many questions. 😜
Hi.
I'm trying with the Custom System Builder to create a sheet for the CJ. Carella WitchCraft rpg. I was able to create several labels for rolling for each attribute and skill, but can't combine both of them. So, as an example, let's say that the Stealth roll is usually combined with the Perception attribute or Dexterity attribute. Could anyone give me a hint, how to create either:
-
A field with a Dropdown for choosing an attribute, and based on the chosen attribute it would combine 1d10+skill value + attribute value
-
Or prompt a player for choosing the skill for the same combination
As an example, if the player would choose the Perception, then the roll would be with 1d10+Stealth+Perception, if he would choose Dexterity, then 1d10+Stealth+Dexterity.
If the Dropdown contains the exact Component Key of the Attributes, then ref(DropdownKey) is enough
Thank you.
I'm still not sure how to implement it, sorry, I'm not very tech-savvy...
I did this: Created a Dropdown Component with the component key as "attribute_select". In the label next to the skill, I've added Label roll message "${[1d10+:Athletics:+ref(attribute_select)]}$", but it's now working (I wasn't counting that this might work actually, this doesn't seems right and I'm sure that I did something wrong there). Any advice, how to make this work?
Ohhh, almost worked.
Got some strange results with this though. I will try to figure out, but if anyone could advice, I would be greateful 🙂
Got this working after all, but still this needs to be adjusted. How to make this go away (this long part of dispaying message for the whole code)? I can live with this, but it would be neat if I could display only the line which is true...
${[1d10] + Athletics + ref(attribute_select)}$
Great, worked like a magic 🙂
Thank you
Is there any way to implement it for a dynamic table? (I don't think so, but it's worth to ask).
I have a question related to pulling data from a table, I'll try to explain myself clearly.
So I'm using Kids On Brooms as a base for what I'm making, and adding some features on top. The attributes pane is working fine, select the die size from the dropdown, add your permanent bonuses, click the button, and it calculates exploding and everything pretty well.
The issue I have is that I want to pull additional, temporary bonus from a dynamic table as in the second image, and add them to the final output roll.
The formula currently for the roller looks like this: Brawn Roll: ${[:DIE_SIZE_DROPDOWN_BRAWN:+:BONUS_BRAWN:]}$
I can't for the life of me figure out how to pull just the sum of the brawn bonuses from the table, and I may be using a function wrong, but I've tried using reduce in both the roll formula and as a hidden attribute formula and it just gives me errors
I guess the question is, with the Dynamic table, how do I pull the sum of all values in the "Bonus" colum, filtered by the value of the "Attribute" column?
I need some help understanding the new functions in the beta.
I'm trying to return, in a label of a dynamic table within an item, a reference to a field from a dynamic table of the actor that owns the item. I'm using the following formula in the item's dynamic table label:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', sameRow('arma'))")}$
I've checked the keys multiple times, and when I tested placing this formula in the roll message in the chat, I got an error (which I attached).
I don't understand why the error is happening since all the keys are correct—I verified them individually!
Where am I going wrong?
There are, but I need more details. Especially, if the Formula is within the Dynamic Table or outside. Because that changes, how you should fetch values from the Dynamic Table (sameRow() vs. lookup())
sum(lookup()) it is
fetchFromParent() resolves the Formula within it with the properties of the parent, thus you have a different execution context.
You're missing quotes around the inner formula probably
Do you mean inside sameRow?
Directly outside of it
Ok, so basically I want to add new values to the dynamic table with Level of the power. The roll should be composed of the 1D10 + Attribute level (which will be fetched from another dynamic table by ref(attribute_selected)) + Power Level (which should be fetched from the Power Dynamic Table).
So I guess that this will be something like ${[1d10] + ref(attribute_selected) + fetchFromParent(PowerLevel). I didn't tried it yet, but it's something like this.
BTW, how to set up the dice type based on the dropdown? I also want to set-up the dice type for damage based on the chosen value, tried with the [1d:Nameofthedropdown:]...
Try it like this:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', 'sameRow('arma')')")}$
and like this:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', string(sameRow('arma')))")}$
But it didn't work 😦
I fouuuuuuund it! Thanks to your tip about putting quotes on the outside! @formal goblet , you’re amazing!!!!!
I wrote the formula like this:
${fetchFromParent("lookupRef('dynamictable_mecanicasdearmas', 'permissao', 'arma', '${sameRow('arma')}$')")}$
The formula is in the same dynamic table
sameRow worked perfectly, thanks for the tip 🙂
All I'm missing is a set-up for a different dice type based on the dropdown (BTW, how to set up the dice type based on the dropdown? I also want to set-up the dice type for damage based on the chosen value, tried with the [1d:Nameofthedropdown:]...) 🙂
Skratch that, actually the ${[1d:DamageDice:]}$ worked 🙂
Thank you for all your help 😁
What do I write into the labell roll message, if I want it to decrease the value in a number field (key name: rex) by one when clicked, and send a text message "spent" into the chat?
Hey, is it possible to create items with itemdisplayer? Like nesting the items?