#Custom System Builder
1 messages · Page 18 of 1
I'm certain there is a better solution, but here's what I came up with. I made a Script macro with this command:
let actorprops = scope.actorprops;
let item = scope.item;
let phrase = new ComputablePhrase(item.system.props.use_text);
await phrase.compute(actorprops);
return phrase.result;
Then, in the item container, I made a rollable label that does this:
Used ${item.name}$.<br>
%{return await game.macros.get('5xbMAF0eVhslZ8rX').execute({'actorprops': entity.system.props, 'item': linkedEntity})}%
The biggest downside of this implementation is that it removes the ability to check the roll, but as much as I love form, function is more important
is there a way to make the sheet roll macro work with multiple selected tokens?
let rollMessage = await actor.roll(
'AttributeLabelBrawn',
{ postMessage: false}
);
let speakerData = ChatMessage.getSpeaker({
actor: actor,
token: actor.getActiveTokens()?.[0]?.document,
scene: game.scenes.current
});
rollMessage.postMessage({speaker: speakerData});
Currently this only rolls the first token it sees
actor.roll()... You have to repeat that for every actor.
sooo is there a way to put all that in a box that runs for every token selected?
Im not good with scripting
I guess its more of a macro question I can ask there
It's just a foreach
Where would I place a custom css file for template styles?
1 Box means only 1 Chat Message. This means, that the distinction between multiple actors must be handled in the content of the Chat Message.
- If you want to have separate Chat Messages for the actors, then a simple foreach-loop is enough
- If you want to have only 1 Chat Message, then it´d require quite some logic programming-vise
Im good with separate chat messages. Just trying to trigger one for each token selected
let actors;
let currentProperties = new Map();
let updatedProperties = new Map();
// Get the selected tokens. Default: currentPlayerActor
if (canvas.tokens.controlled.length > 0) {
actors = canvas.tokens.controlled.map(a => a.actor);
} else {
if (!actor) {
ui.notifications.error('Make sure that you select atleast 1 token or that you have a configured actor');
return;
}
actors = [actor];
}
for (const a of actors) {
let rollMessage = await actor.roll(
'AttributeLabelBrawn',
{ postMessage: false}
);
let speakerData = ChatMessage.getSpeaker({
actor: actor,
token: actor.getActiveTokens()?.[0]?.document,
scene: game.scenes.current
});
rollMessage.postMessage({speaker: speakerData});
}
Did I frankenstien that correctly?
Nope
@bright berry why do you have a second string? ${attbon != 0 ? attbon : string('')}$
you could also string them together
${! attbon != 0 ? string('Attack Bonus: ') : attbon != 0 ? string('') ? attbon : string('')}$
This would give the same problem as before though, where I lose the grey box around number being shown
That errors out, too
The second string is because I needed both a string and a variable showing up
No worries, what I figured out is like 99% what I wanted. I'm happy with this
Btw, '' is already a string (empty-string), no need to wrap that with the string()-function 😅
Oh, I know
I did that for me
I'm dumb when it comes to code. This means I'll be able to go back and know what I'm doing
I will say, I did figure out how to make it do advantage/disadvantage based on whether it's in Fight mode or not by myself and I'm friggin thrilled about it
I wrote this with very little help, and I have very little code experience.
// Function to roll a 1d100
function roll1d100() {
return Math.floor(Math.random() * 100) + 1;
}
let Chance = replaceMe; // Replace with your Skill Value (Chance)
let roll = roll1d100(); // Roll a 1d100
let SL;
if (roll >= Chance + 170) {
SL = `SL -5`;
} else if (roll < Chance + 170 && roll >= Chance + 120) {
SL = `SL -4`;
} else if (roll < Chance + 120 && roll >= Chance + 110) {
SL = `SL -3`;
} else if (roll < Chance + 110 && roll >= Chance + 60) {
SL = `SL -2`;
} else if (roll < Chance + 60 && roll >= Chance + 50) {
SL = `SL -1`;
} else if (roll < Chance + 50 && roll >= Chance) {
SL = `SL 0`;
} else if (roll < Chance && roll >= Chance / 2 ) {
SL = `SL 1`;
} else if (roll <= Chance / 2 && roll > Chance / 4) {
SL = `SL 2`;
} else if (roll <= Chance / 4 && roll > Chance / 4 - 10) {
SL = `SL 3`;
} else if (roll <= Chance / 4 - 10 && roll > Chance / 4 - 20) {
SL = `SL 4`;
} else if (roll <= Chance / 4 - 20 && roll > Chance / 4 - 30) {
SL = `SL 5`;
} else if (roll <= Chance / 4 - 30 && roll > Chance / 4 - 40) {
SL = `SL 6`;
} else if (roll <= Chance / 4 - 40 && roll > Chance / 4 - 50) {
SL = `SL 7`;
} else if (roll <= Chance / 4 - 50 && roll > Chance / 4 - 60) {
SL = `SL 8`;
} else if (roll <= Chance / 4 - 60 && roll > Chance / 4 - 70) {
SL = `SL 9`;
} else if (roll <= Chance / 4 - 70) {
SL = `SL 10`;
} else {
SL = 'Invalid Chance'; // Handle invalid Chance values
}
ChatMessage.create({
speaker: { alias: name }, // Who is speaking
// What it displays and how
content: `<table>
<tr>
<th>Standard check</th>
</tr>
<tr>
<td>Roll</td>
<td>${roll}
</tr>
<tr>
<td>Chance</td>
<td>${Chance}
</tr>
<tr>
<td>Success Level</td>
<td>${SL} </strong> </td>
</tr>
<tr>
</tr>
</tr>
</table>`
});
neat
I have a really stupid question
Is all the scripting in CSB java?
am I secretly learning javascript?
CSB-Formulas are not in JS, but it's quite similar. Script-Expressions on the other hand are indeed in JS.
I see, cool
still, I'm learning something I didn't know before. That's worth something
I'm having this as a value formula in an item modifier, but it's not working as it always result in -1, not matter how high crew_actual is. If crew_actual is 11 or more it should round up to 2, right?
${(max(1,(ceil(fetchFromActor('attached', "crew_actual") / 10))))}$
Test if fetchFromActor() is even working in an Item Modifier
Ah... yeah, that might be the trouble.
Is there a way to round/floor/ceil the formulas in item modifiers?
The top one here I'd like to divide by 2, rounding down. But seems tricky to do...
Nope, this has to be taken care of the actor
ok, thakns
How do I pass a variable into this?
${fetchFromActor("crew roster","fetchFromDynamicTable('crew_chains', 'chain_heat_left', 'chain_name_left', 'VARIABLE_HERE')","missing: crew roster")}$
You can inject another CSB-Formula into it. Or you use concat() to build the formula-string.
${fetchFromActor('crew roster', "fetchFromDynamicTable('crew_chains', 'chain_heat_left', 'chain_name_left', '${VARIABLE_HERE}$')", 'missing: crew roster')}$
${fetchFromActor('crew roster', concat("fetchFromDynamicTable('crew_chains', 'chain_heat_left', 'chain_name_left', '", string(VARIABLE_HERE), "')"), 'missing: crew roster')}$
Would anyone be willing to share what their character sheets look like?
like, a screenshot?
i have different types depending on the character, here is the first tab for a PC
Look Here
#1037072885044477962 message
and here for bunch of others. The Example forlder has pretty good example sheet of most functions (I think)
https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library?ref_type=heads
Yup. I've looked through all the ones listed there.
Thank you :)
I'm just looking for a few more examples.
Yup screenshots! If you have more I would love to see them.
i didn't name some of the columns in the dynamic table because of this bug https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/335
okay, can someone help me here? I have 4-6 items in an item container. I want the actor sheet to draw values from the items. What is the identifier that the container uses? Like say I have Desk, Chair, Table, Lamp in the container. How do I identify the first item in the container in a formula?
is it "Containername 01" or something?
There´s no identifier, you need a completely different approach: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Frequently-Asked-Questions#q-i-have-an-item-container-with-inventory-items-and-i-want-to-sum-up-the-weight-of-each-item-but-sumfetchfromdynamictableinventory_container-weight-doesnt-work
okay. so to make sure I understand this: On the actor template create a label called "Armor", key "total armor". On each item click on configure item modifiers and add an item modifer with key "total armor", Op +, Value Formulae $5$ (for example) ?
The term key is used many times in this doc. It refers to an identifier of fields or tabs. It must always be a string
composed of letters (upper and lowercase), numbers and underscores only. Keys must be unique throughout the sheet.
No empty spaces allowed in component keys
But basically yeah
why is it giving me NaN when I add the item?
Is your formula correct? It´s either just a static number or like this: ${5}$
currently formula is $Move$. Should it be ${Move}$ ?
Yeah, just $Move$ is not valid and will be interpreted as normal text
You aren’t by any chance building the DC20 System Alpha by the Dungeon Coach, are you? If so, we should join forces! He’s also got a 4 action point system. They’re SO HOT right now!
How do I use a radio button in an if statement?
I've tried radiogroupname = 'radiobuttonvalue' (with and without quotes) but it doesn't seem to work
=, == and === have different meanings 😅 Just check this guide here about conditions and take a look at the common pitfalls. https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#314-conditions
I'm just not sure what type of value the radiobuttongroup returns. I would assume that it returns a string but equalTo() also doesn't work
You need equalText()
I meant equalText(), sorry. I'm getting the value button from an userinput template, but when I set equalText(radiogroupname, 'radiobuttonvalue') it does not work
#modules message
As stated above, I'm having some issues with attribute bars not working correctly on my end. I'm fairly certain text fields should generate an attribute bar but it doesn't seem to be working at the moment for me. If possible I'd like to find a way to make it track a value from the character sheet directly to save me some trouble down the line.
Since I'm new I don't actually know if this is a bug with the system itself or I'm not doing something right
Nevermind, I figured it out. It was user error on my part. Sincerest apologies!
The arrows only appear when PCs have enough XP to buy a higher rank. Skills are items, and the dice pool is a combo of attributes and skill ranks. Talents are all individual item containers with a filter (and javascript) to determine what column they go in. Question marks are tooltips containing talent description due to space limitations. Just noticed that I have to get long talent names to wrap.
Awesome sheet. Thank you for sharing!
Thank you for sharing!
This is a fantastic sheet @latent sorrel. I would love to get a copy of it. I see elements that I would implement into my own sheet. Plus yours is pretty
There is a lot of JS behind the scenes either because I didnt fully understand CSB command structure when I started or because this game system (Genesys) is a pain to code the logic. The "pretty" is CSS that is either lifted directly from another similar setting or heavily inspired by it. Its also not be live tested yet as I need to finish one last macro (he says for the 4th macro) before populating with talents, gear, careers, etc. and seeing what I need to tweak or add. It also relies heavily on items for everything (skills, careers, gear, injurie, etc) and there is communicate between items. I can give you what I have but you have been warned 😱
Are you using dynamic tables for the items like Backpack?
It appears that item containers are being used. The green checkmarks tell you that the item template hasnt been deleted (accidently or on purpose).
How would you mkae the picture appear bigger than?
Css?
Yes, I use Custom CSS module for all my css. easier
As am I
Hahaha i get it, i am learning js and have been writting some of my sheet in it. I planned on using the items, races, sex, so on as item as well. Either way would love it all so i can pull it apart and learn from it. Also, steal pieces that make sense on my side
I'm just getting this at the moment. So I need to work on removing the border and increasing the picture.
@ornate junco this is correct
My inclination would either exclude the picture for the race and class and use the actor image to define these or just use a head shot to give the idea. Personally, I have a journal with full images and details with a button so the Player can drag the item onto the sheet. Once its on the sheet, the player knows what a wookie (or whatever) looks like. Those images aren't meant to have a lot a detail IMHO and big images eat up screen real estate.
Hi. Is there a way to make things hidden in a chat card only to the GM, visible again when you reveal the card ? For now, texts are shown anyway, forumals with ${! }$ too, and ${ }$ stay hidden. ❔
thank you for the very detailed answer. might be cool to put these examples in the main docs
I think you need a world Script for that? Dont know If this could also be done with CSS?
Thank you
how can I turn a matrix/array into a table? either html or component.
say I can convert a matrix into an 2d array using a custom function.
I tried to return html data but seems to cause error from the <table> html through using something like ${%{return Mything.doMyTable()}%}$
Non-coding question: how would you go about creating an 'armour set', i.e. something that when dragged to an actor adds a specific grouo of items to the inventory?
With a feature, maybe, like in D&D 5e?
This would require a world-script. There's no functionality in CSB for that.
Oh well, my players will have to go the old way 😄.
Thanks.
Is it possible to get some kind of item stacking in CSB? Like piling up identical items (ammo for example)?
hi guys, i'm new on foundry, you guys are probably tired of hearing this, but when i try to install CSB, foundry ask's for me do some manual installation, i already read the how to install section, and still doens't understood how to do it, can someone help me?
i have the .json, but how exactly i import on foundry?
You are probably missing the "Chat Commander"-module. Just install that and it should be fine
Nope, not implemented
can I call fetchFromActor() globally in a script? I can't work out the parent class name for it.
It´s a function, which gets imported into the math.js-library. If you want to process CSB-formulas, you can do that over ComputablePhrase.computeMessageStatic().
Question for you. Is there a max height and width you can make this image?
Also for the item containers that you have where the image is on the left and text is on the left. How exactly are you achieving that?
I was referring to this
That's in the tips and tricks thread. I think it was the post I linked?
Look at the one that says bigger item icons
Like what column is being referred to here?
When I make an item container am I not just placing the item with in the container? Where is the rest of the text coming from exactly?
Every actor/item has a key called name. It's just the name of the object. You will also need to create a key called info on your item, this should be a brief description in a text field
Okay, I see now. Thank you for the clarification.
You should be able to place this in any column, it doesn't have to immediately follow the icon
Apologies for all the questions. I'm just trying to get a handle of all this.
Would you be able to provide a visual example as well for one of your item containers?
In a minute, I just got home
here's a simple one
when i remove the delete button
this one is a bit different, im using css grid to put numbers over the icon (check the sword, shield, and supply)
CSB really likes using css flex for everything, but that doesn't work for this - in flex, the number slides all over the place instead of remaining fixed over the icon https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/315#note_1557760139
Out of curiosity, since you have numbers displaying quantity, how do you manage that mecanism in your world?
Is there a way to equip/unequip an item on an actor with a checkbox ?
Yes, set a Equiped property (checkbox) on the item and show it in a item dropable table 🙂
@blazing ibex is there a way you can share your templates ? So interested in the the designs you set up (the flex one 🙂 )
My sheet looks like this right now 🙂 🙂
Between WotC's scandals and other (better, imho) systems catching my eye a long time ago. I don't know the 5e behaviour you're talking about, but some simple html might achieve what you're hoping for:
Damage Resistance <details><summary>Read More…</summary>You have damage resistance to the type associated with your draconic ancestry.</details>
everything still is WIP
Thank you so much for sharing your work 👍
Thank you for all the help.
my solution to that: #1037072885044477962 message
Thanks man, I don't care if it is a whacky solution, from my point of view, it is much better than what i've been doing until now XD
Anyone got Item Piles to work with this?
It actually does work to an extent but I don't know the path to the item attributes. Any ideas?
I since realised I should do it internally in the script from system.props and entity like %{return RustHulksHelpers.chainsTable(entity)}%
Is there an easy way to make a button that links to an actor sheet via a key? I'm trying to get the _id to use in a href link but I can't get the ID, only the name of the actor.
oh am using fetchFromActor(ship_actor_name,'_id')
should be entity.entity.id
fetchFromActor only looks at the props. The id is outside of the props
yeah 😅
so %{ return stuff }% instead?
got it. %{return game.actors.getName('${ship_actor_name}$')._id}%
So I'm doing buttons that link to another sheet like this, is there a better way?
<!-- ${#crew_id:=%{return game.actors.getName('${crew_roster_name}$')._id}%}$ --><a class='content-link' data-uuid='Actor.${crew_id}$' data-id='${crew_id}$' data-type='Actor' data-tooltip='Actor'>CREW RELATIONS</a>
Ok so I got currency to work with item piles, just not quantity.
system.props.item.item_count is the number field for quantity of an item, but it doesn't want to read it for some reason. Currency works fine (which is system.props.item_value).
Any ideas what could be wrong?
there´s simply no actor.system.props.item, items are stored under actor.items (as a collection, which is also an important difference).
quantity is bugged with CSB, Wasp was working on a fix for it
search for in:#diy-systems from:wasp
Figured as much. Haven't found anything with a solution through search.
Got any idea how to seperate items in the trade window though?
Right now it classifies everything as TYPES.Item.equippableItem, including stuff like abilities and stuff (since they're also 'items').
yea, one sec
when you create an item, you have to go into the item pile settings for that item and select a category. you can configure those categories in the the module settings
New to Custom Systems, how exactly would I reference a drop-down selection that uses data from a dynamic table?
for example: Each score should be (1 + species_mod + talent_mod) and both species and talent are selected by drop-downs using data from a dynamic table
Ouch.
Well it does work, but I have like 200+ items right now. Any way to this in bulk or do I have to each one seperately?
Just ${dropdownKey}$?
oh my god that was right under where I was reading in the docs
i dont know of a way of doing it in bulk. i was doing my own items by hand
maybe if you export as json, you could use a text editor to do a find + replace
Sorry if I misunderstand, but the following returns null no matter the option
And what component key has your dropdown?
speciesName
Well, that has to match with the one in the formula
Yeah, I'm sorry I just don't get it. The dropdown has 'speciesName' as the key, and that's also what I want to use right before dropdownKey, right?
The 3rd argument in the function is for the filter-column of the dynamic table. The 4th one is the actual filter-value. So you should replace that with speciesName
Okay, for some reason whenever I include speciesName and species_bodyBonus in the same formula it doesn't return a value no matter where they are positioned.
Your final formula should be ${fetchFromDynamicTable('speciesList', 'species_bodyBonus', 'speciesName', speciesName)}$
I am terribly sorry
Thank you so much for your time
It works
I feel like a moron because I was literally using dropdownKey instead of the actual key
If I have items with the same value categories (attack bonus for example), am I correct in assuming that even putting them into different containers would not allow for those valued to be displayed independently on the actor sheet? (EX container 1's item shows it gives a +4, container 2's item shows it gives a +1)
I don't get your question 😅. But maybe it helps if I say that all items are stored in the actor directly instead of in an Item Container. Those containers only have the job to display the right Items.
okay, let me try to explain it again. Let's say I have 4 items. Each of them has a value labelled "AttackBonus". I want these 4 bonuses displayed independently on the actor sheet
Question. How would I roll a standard d20 and add in the strength modifier?
On the actor sheet, not the Item Container?
Yeah
I mean, if the values can be displayed individually in/on the container without opening the item that could work too
this is what I'm going for, really
Well, you can use Item Modifiers, which target different Labels in the actor sheet. Or you try to do that via a Script, which iterates through all attached items.
Then shouldn't a standard Item Container be enough? Each row displays the information of the corresponding item.
I have an item container but all it's showing are the item names
${[1d20] + StrengthMod}$
Thank you, sir!
You also have to add Labels to the Item Container, so these can display additional information. Try out ${item.name}$ e.g..
Question for you. Is there a way disable the text input box that appears around a number input when you click it?
Just disable it in the number field component
Through CSS, correct?
No
Open the component config of your number field component and remove a checkmark (somewhere at the bottom)
Thank you. Do you know if there is a way to decrease the size of the plus and minus sign for the number input?
@formal gobletthank you, this is almost perfect
Probably with CSS. But it will be up to you to find the right css-class to adjust.
Fair enough thank you once again.
Also your system is amazing. I am so happy I switched over to this.
Is there anyway to set a label name in a dynamic table?
Like have different names.
Shouldn't that be a text input component?
I should change it. I was trying to experiment with something.
I am trying to mimic this currently. Any suggestions on how to do so would be amazing.
I thought a dynamic table would be good.
Would a regular table be better?
Both have pros and cons, so I can't clearly say that one is better.
Fair enough. I'll try a table for now and go from there.
I use the Data Toolbox module for importing bulk items. Is not hard to do but there is little bit of a learning curve.
@glad spade can we ask if you figured this out? Do you need help?
I wonder if anyone can help me here with a formula. I am trying have it to when a player selects a modifier from this dropdown it calls the modifier number and then adds it to a d20 dice role.
I have this currently.
When they click Acrobatics it should roll but I am getting nothing.
Would anyone have an idea for this formula?
Is here any way to make a workaround for sorting items in an item container before the update lands?
What did you put in the roll messge?
Maybe I'm crazy, but could a script do that? Thinking of a button that when clicked triggers a macro that accesses Item Container structure and modifies it...
This can be done with javascript as the actor holds all items in the order items are dropped. If you have different containers and you want them sorted different ways, instead of only by name), this will get tricky. I believe that the next system update will have this option, but there is no ETA for this.
I know this formula is wrong but I am trying to figure out how to get it to work.
${skills_mod == 'Str' == [1d20] +str_mod}$
I suppose you have a modifier field for each stat, like strMod.
So it should be:
${[1d20]+equalText(dropdownKey,"Str")?strMod:(...)}$ and you nest a conditional for each stat you have.
I do. Let me give that a try.
So its giving me an error. Apologies as I am not well versed in mathjs syntax.
What would I be placing in the equalText and after str_mod: (...)
Like this:
${[1d20]+equalText(dropdownKey,"Str")?strMod:(equalText(dropdownKey,"Stat2")?stat2Mod:(equalText(dropdownKey,"Stat3")?stat3Mod:0))}$
0 is the default value if dropdownKey does not match any of your stats.
Use switchCase() if you compare 1 value against multiple
True that.
That would be:
${[1d20]+switchCase(dropdownKey,'Str',strMod,'Stat2',stat2Mod,'Stat3',stat3Mod,0)}$
is there any way to changer how item containers show items, the default is vertical, but i want them to be in horizontal order. Is there any way to achieve this?
Maybe with CSS, otherwise no.
thx
You're amazing. Would you know how to change what the chat looks like after you make a roll?
It looks like this now.
Glad to be of help 😉
How would you want it to appear?
What are my options here. My players tend like to see the number big.
You can use html for that, so many options are available, truth be told.
Try this, in the roll message:
${roll:=(your formula here)}$ <p>Your result is: </p> <p style="font-size:20;">${roll}$</p>
It should work, to some extent.
Is there a way to list all component keys or a limit of how many you can have?
I have a component key that for some reason isnt being referenced called PAB. Its in a table so I am confused why its not populating.
Try out in the console game.actors.getName('YourActorName').system.props. And no, there´s no limit of how many component keys you can have.
Let me look, i am jusr confused on why nothing is populating
How strange, yep, the component doesnt show up on in the sheet
It is however on the sheet
Any errors when saving?
No
PAB field has been on the sheet since almost the beginning
Its also labled in the json
Actually more I am looking at it, almost every lable in this table is missing
PSD isnt listed
Are we talking about a normal Table?
Huh..... Dunno...
There are no limitations about any counts
I wonder if that is part of it
Try to move it out of the Table and see if it appears again
Actually... Is the table hidden?
no its not a hidden table
Moving the table out doesnt fix the issue
Going to recreate the label and see if that fix it
Nope, going to recreate the Table now, this is very confusing
I don't suppose anyone has made an English version of the RM2 templates?
Nope, only german. The creator of this template is @vagrant hollow if you need him
@formal goblet - even after recreating it didnt work... Idk what is going on
It´s hard to find the issue if no error is thrown in the console. Any modules active? Are you using Forge?
nope no modules
Which versions are you using?
3.0
I do have some errors in sheet but its only placeholder base code
It should effect anything regarding the Key
bummmer. Looks like I'll be spending some tim e in Google Translate... 😝
Still, that can be important because errors can stop further execution of other components. So solve these first
I will attempt to but the Key is reference to other formulas...
You're a saint dude. Thank you so much. Another question for you. How would you let's say add a plus one to a roll when a checkbox is checked?
Does anyone know how to target the css for one checkbox and not all of them?
Just happy to help, that's all 😉
Add to your formula +(checkbox?1:0)>
In the checkbox setup interface you see an Advanced section and in there you will find something like additional css classes: add the classname you want to use and that's it.
Having trouble with concat() in a roll message. I've used it this way before to mix chat text with variables, but here it doesn't work. Why does it want to convert the text within the ' ' to numbers?
${#mos:=sensorstotal > threshold ? sensorstotal-threshold : threshold-sensorstotal}$
<br>
${!sensorstotal > threshold ? concat(' success! MoS: ', mos) : concat(' failure with. MoF: ', mos)}$```
Error:
```js
Error: Cannot convert " success! MoS: " to a number
at Array.convert (math.js:12242:57)
at math.js:6567:108
at Array.map (<anonymous>)
at Function.r (math.js:6692:90)
at Function.a (math.js:6699:66)
at Function.oe (math.js:6724:82)
at concat (math.js:6740:54)
at ...any (math.js:35684:46)
at Function.a (math.js:6699:66)
at Function.oe (math.js:6724:82)```
Just this works fine:
```${(sensorstotal > threshold) ? 'success!' : 'failure!'}$```
Ah, it's the old string() thing again. I didn't think that was the solution as it worked in another spot where I didn't use it. Oh well. 🙂
Is there a way to have a dice roll out of a rich text field?
Normally its [[1d6]] but thats not working on my item sheet.
Hello,
How to update value in dynamicTable outside the dynamicTable?
I can:
- get value
- get path to the cell
but can't update it.
${ fetchFromDynamicTable('dt_test_table', 'colum1','colum2','value1') }$
${ setPropertyInEntity('self', "getRefFromDynamicTable('dt_test_table', 'colum1','colum2','value1')", 'NewValue') }$
You can initiate a dice roll only via label-roll-message or via macro.
Ok. Trying to get a button in the description of an injury item to roll a D6
The RTA has to be in Dialog mode to display links & Inline Rolls
Double-quote the last arg as well. Otherwise... any errors?
Remove the quotes from the 2nd arg.
Is that something I can change or is that just the reason its not working?
Yeah, you can change that in the component config
Ohh awesome thank you!
@formal goblet
${CURRENT:=first(fetchFromDynamicTable('dt_cleric_gods', 'god_points','god_name','god-one'))}$
${getRefFromDynamicTable('dt_cleric_gods', 'god_points','god_name','god-one')}$
${setPropertyInEntity('self', "getRefFromDynamicTable('dt_cleric_gods', 'god_points','god_name','god-one')", "CURRENT - 1")}$
Remove the double-quotes from the 2nd arg
Now it works)) quotes is always frustrating me 😄
It gets clearer if you know what strings are
Trying to get a text field in a dynamic table to put its contents in the tooltip
Is there a way to do that where it references itself? Goal would be whatever they enter in the text box is also what pops up when they mouse over so they can read text easier that is too long for the box on the sheet
What I put in the picture there just says ERROR
Its close with ${fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription')}$ but it doesnt filter out the other fields. Not sure how to do that
anyone know how?
Nope, sorry.
Hello, maybe I'm dumb but, is it possible to interact with those value with CSB ? https://foundryvtt.com/api/classes/client.Token.html
Documentation for Foundry Virtual Tabletop - API Documentation - Version 11
Yes, depending on the task you have to do it one way or the other
Oh.. I'm not finding the right way to do it I guess then.
I just want to emit light on active effect trigger
I'm editing the active effects of a actor template but nothing seems to work 😦
Just putting 'emitsLight' to 'true' in the active effect modifiers but when the right active effect is toggled, nothing happen... The syntax is probably wrong but I can't find the right one
For such a task im pretty sure you have to create the effect with all the propertys with a Script(csb) or a macro (foundry). To get an Idea what you have to do you could try asking in macro-polo Channel (If macros/JS is new to you)
Oh. If you want to do this (on/Off Trigger) for every effect toggle you have to do a world Script. Macro-polo Pins for what that is
So e.g. you can create a world script which has the Hook on effect Update (Not sure of the right Name) and check If a certain effect was toggled. Then you can on/Off the light automatically
Btw. You cant do this with the active effect modifiers of CSB!
I need help launching a macro differently based on where on my sheet it triggers from
right now it shows a box that reads all the data from the character sheet of the selected token. it sees what skills have ranks and lets me select them from drop downs and pair the attribute I want to use with them, my goal is to have it pre-select the dropdown options based on what you clicked on your sheet. so like if you click melee the skill dropdown is melee etc.
this is how it pops up if you launch the macro on its own. this macro handles building the dice pool and all the fancy visuals for the chat message so itd be cool to have the sheet just modify the defaults of all the forms in the popup window somehow
Can you use the compare 3 values with the if else then fuction?
If not, I can write a script to do it but how do I execute it via label consistantly
Can a key inside a Label Roll message be handed over to the UserInputDialog to be displayed there in a Label field?
In my example the key is "auto" and would like to display it like this:
In the roll message auto is defined aus follows: ${#auto:=[:MUT_erschwernis:]}$
I know you can reference in the roll message the key, idk if it can be called but suspect it could
@dense pine Are you attempting to assign ${auto}$ to always be MUT_erschwernis ? or just temporarly assigned? I am looking for use case so I understand. I am in a meetin for another hours but happy to look after.
nope. depending on the attribute that does the roll, auto always gets the value of the variable (XXX_erschwernis) that holds the modifiers for this specific attribute. there are 8 attributes, all of them have a var like this that starts with the name followed by _erschwernis. IF that wasnt the case and it was always the same Var i could write it directly into the UserInputDialog. So auto is just ment as a placeholder
I have a roller that will replaces a value with another during that action but doesnt retain it.
So something like %{return await game.macros.getName('rolling').execute({ replaceMe: ${Target_Number}$});}% ....
My use case is that a target would = Target_Number, and in the script I have a varable replaceMe that gets replaced on the roll
You maybe able to do the same pushing to the field
Heyo! How could I make a /r add a value from the sheet? Like /r 2d10+[@attributeBar.CStrength]]
Using it in chat
automating Dice-tray
but I heard it's impossible, was about to come back and say I'm using a work-around: 2d10+2*@attributeBar.CStrength.value
interesting
I put a roll on each modifier so something like this
<tr>
${sameRow('Name')}$
<th>To Hit</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[2d10]}$
<strong>${!Roll >= Crit ? '<br>Critical Success' : Roll <= Fumble ? '<br>Fumble' : ''}$</strong></td>
</tr>
<tr>
<td>Ability Modifier</td>
<td>${sameRow('SMod')}$</td>
</tr>
<td>Misc. Modifier</td>
<td>${sameRow('SMisc')}$</td>
</tr>
<tr>
<td><strong>Result</strong></td>
<td><strong>${Roll}$</strong></td>
</tr>
<table>
<tr>
<th>Weapon Damage: ${sameRow('WDice')}$</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[${sameRow('WDice')}$]}$
</tr>
<tr>
<td><strong>Result</strong></td>
<td><strong>${Roll}$</strong></td>
</tr>
</table>```
${sameRow('SMod')}$ <-- Str Mod
Whatever the lable is
But, do these work on chat messages?
Here are some images for reference.
I was just adding more easy ways for my players to interact with the game.
I need help with tooltips on a dynamic table
I want a text box's tooltip to say whatever is written in it
${fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription')}$ has the right info but IDK how to filter out the other fields, it lists all of them seperated by commas
${fetchFromDynamicTable('InventoryItems', , INFORMATION YOU WANT LISTED, 'InventoryTableDescription', FILTER)}$ <--- try something like this
${fetchFromDynamicTable('table', 'value', 'reference', 'filter')}$
Thats how I remember it
You will need 2 more pieces of information based on that... Right now your saying hey, give me this value off this table.
You may need to add first at the beginning of it ${first(fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription'))}$
Right idk how to reference the current line its on
Show me your table
right now with ${fetchFromDynamicTable('InventoryItems', 'InventoryTableDescription')}$ as the tooltip, it puts 0 for everything thats empty and the text in the one. but they all have the same tooltip
ok question
so each one that I mouse over shows "0,0,0,0,Tools that.....0"
Are you trying to references inside or outside the table, and what are you trying to filter to?
I want it so when you mouse over the description of an item, it has a tooltip of whatever is written in that text box.
So try
sameRow('InventoryTableDescription')
You normally only use the fetch if your trying to get data out of the table or your referencing somewhere else in the table
It's in the module configs! Although it doesn't select any images that were not in the folder itself if you pick them in the file explorer, you have to write the path/copy-paste yourself. I just screenshoted the images from fontawesome.com
And edited them.
It was meant to reflect how they appear in the sheet:
${sameRow('InventoryTableDescription')}$ like this?
Its giving me an error
Hang tight let me test on myside
@runic condor - I dont know, I have attempted multiple times to reference the cell while in the cell in different ways and its not acting like I would expect it should
Thanks for trying, yea ive been stuck on this
sameRow() should be the key, I am confused why its not working...
If you can pull a table you should be able to filter it.. but cant do even that
@formal goblet - Can you help Savory, I am stumped on why its not resolving correctly.
That's a known bug with the tooltip
At least we arent crazy lol. Thanks!
On an item container, how can I hide the reload button based on if the ammolabel column is 'N/A'?
Hi. Is there a way to test if a variable is set or not ? (not empty or not but set)
Check if variable is undefined via a script: %{return entity.system.props.variable !== undefined;}%
You're killing !!! 🙂 Top ! Thanks 👍
A Label in a Dynamic Table might be able to do that (Labels support HTML).
Can anyone see what I've not done?...
This is a Label with a roll message on a Dynamic Table row.
What errors do you get?
No Errors, it just throws the entire text un-processed into the chat log as a message.
Missing ${}$ around it.
3/4 $'s ... thanks Torlan. There's also a way to not enclose the result in an 'explanation', isn't there?
Is it ${! instead of ${ ?
You're welcome.
That's it 👍🏻
Huzzah! My brain's not running on fumes!!
Mine is...
I'm trying to update actor resources via macro and it works...but the resource bar on the token does not update unless I open and close the actor sheet...
Any hint?
Sometimes just explaining the problem "out loud" helps take me down different tracks. Do you find that too or am I just "special"?
First off...we're all special, one way or another 😉
Then, I agree with you completely.
You mean like HP? ... what is your HP built like, a single number field with a defined max value?
Number field with min=0 and max as a formula.
Do you mind showing the code you have? ... it sounds like you're ahead of me in my own project and may want to steal... take inspiration from it. 😉
Also, have you asked in #macro-polo ?
Not yet, I will thanks
There you go, feel free to st...ehm...get inspiration 😉
Can you add in a recalculate to your macro?
I just mentioned it in macro-polo...
Haven't...I'll try 👍🏻
Hey Torlan, I've got a neat trick for you, in case you don't know. You can wrap lines of code in these in discord and it makes it all pretty 'n' stuff.
```js
Lines of Code
These are called Backticks.
They're on the button left of the 1 key on a standard keyboard.
```
if (test) {
do stuff
}
Thanks pal, I know 😉
But this time could not copy-paste the code 😅
oh... ok, then ... is there any more after else {ui.notifications.warn... ?
Nope, but I'll try and add recalculate as soon as I can.
Always call actor.update() if you´re changing something in an actor.
Nothing changes, still have to open/close actor sheet to see the bar change.
Do you maybe also have to update the token?
token.update() is it?
Dunno, I´ve never worked directly with the token before
Ok, I'll tinker around. Thanks.
And what if the variable is set in a userInputTemplate ?
The UserInputTemplate has no own entity, so that would be not possible. You´d need a different approach, but I don´t know which myself
Add +(saveCheckbox?mod:0) to the roll formula.
Same thing, Just add that to the formula you are using.
Building such an array is quite possible, with labels, but I'm not sure to understand what you need here.
There´s currently no multi-select-component. The next best thing would be an Item Container (with modifiers) or a conditionally hidden Panel with Checkboxes
Tried all token methods, but none worked. Only thing I found is putting the whole data modification code inside actor.update(), but have not tested it yet.
Solved:
system: {
props: {
hitsV: newVal
}
}
});
Can be shortened to actor.update({['system.props.hitsV']: newVal})
Thanks 👍🏻
You have Roll-Formulas in conditionals, this should be avoided at all costs. Only the bonus should be conditional in your case.
${[1d20] + (acrpr ? agimo : 0)}$ This makes sure that the Roll is performed only once and that the bonus is applied if acrpr is true, otherwise it will add 0 to the roll-result.
More on how the formula system works can be found here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
And an example-sheet if you need examples: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
Hey! On the most recent V11 version, radial is still not working for Dynamic Tables, right?
I have just updated everything and ported from the latest Unstable V10
The orange color does not come from CSB. The icon can be hidden with CSS I think
What is radial? 😅
The checkboxes that uncheck when you tag another one in the same key?
The radial checkboxes.
Ah, the Radio Buttons. Yep, not working with Dynamic Tables
Alrighty, thank you!
The formula in the Label of the Item Container has to contain the item.-prefix
The Label is just a visual thing, you can only retrieve the key.
Is there anyway to move it so the name is on the top, bottom, or on the left?
I'm assuming you're using Monk's Enhanced Journal? I believe this is what has made your items look this way. The visual of items and other elements that show up orange like this can be edited from the Monk's Enhanced Journal settings
css
unrelated: is it possible for a rollable table to create items in CSB
In an actor sheet, I have a label fetching a number field in another actor sheet but it actualize itself only if I reload the first sheet. Is there a way to do it automatically ?
You mean that if you change that value on the sheet it fetched from you don't see that change on the fetching sheet?
yes
Can you show the label formula, please?
${fetchFromActor('dkpool' , "currentdk")}$
Hm, nothing strange, as far as I can see
That is a known issue, which cannot be solved easily.
What if you do that via a macro triggered by the fetching label, like the one you suggested to update token resource bars?
The issue is that the macro won't be even triggered, because Actor A doesn't know when to update when Actor B gets an update
Right, did not think of that. Thanks for clarifying this.
There are only 2 solutions. Either Actor A sets up an Event Listener, which triggers on Actor B - Updates or Actor B gets the responsability to trigger the update of Actor A.
the second solution might be the best for me ^^
Actor or user?
One second
I believe its Actor.character but I could be wrong
<tr>
<th>${sameRow('Attribute')}$</th>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[2d10] + sameRow('Total')}$
</tr>
<tr>
<td>Dice Mod</td>
<td>${?{Modifier[number]|0}}$</td>
</tr>
<tr>
<td><strong>Result</strong></td>
<td><strong>${Roll + Modifier}$</strong></td>
</tr>
</table>```
Is what is in my roller, and the already pulls the card in chat
<th>${sameRow('Attribute')}$</th>
Something like that, OR use name
name: Contains the name of the entity (actor name or item name)
so ${name}$
I've searched a bit, and come up dry:
Is there a way to export a built system into a standalone?
Nope, you need the core of CSB. You could create a module, but I don´t know if you´d encounter issues there.
So I am trying to create a formula for when a item is added to a character sheet it increases the ability score of certain abilities. Would anyone have any idea how to go about that?
using "Item Modifiers" on the item. In there you set the reference to the field on the item and a label on the sheet (I hide these labels in a GM only tab). Then I add the field to the stat. Its covered the system builder docs cover this and I may have this slight wrong so definetly look there..
I'll take a look again. I think I glanced over it. Thank you.
I managed to implement a walk-through with lot of suffering 😂😭😂
I populated a dropdown inside an item with the key from a dynamic table in its parent actor. So far so good. Now i would like to display values from this Table inside my item next to the dropdown. It it were in the actor itself, the following code would do what i want:
${fetchFromDynamicTable('nahkampftalente', 'talentwert', 'kampftalent', talentauswahl)
}$
How do i need to change the syntax of my label?
You only need fetchFromActor('attached', "fetchFromDynamicTable('nahkampftalente', 'talentwert', 'kampftalent', '${talentauswahl}$')")
I'm very new to coding in CSB so please forgive me if this seems like a very simple problem, but I'm currently trying to make it so that a panel disappears if a certain dropdown option is not selected (in this case the "Firearm" option in "Item Type")
Frankly, I have no idea what I'm doing and I've been throwing random code at it hoping that one of these equates to an "IF" statement of some kind.
Should be equalText(Item_Type, 'Firearm'). If you want to know more about the Formula-System, check this article here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
Tysvm, I've been wracking my brain looking at the CSB wiki this whole time and didn't know this existed. This is gonna help me so much in the future.
Is there a way to have a clickable dice to roll from an item containter? The item works if you look at it seperate but not on the sheet:
Is it ok? if I set vision permission by role GM
and visibility formula at the same time, the permission by role stop working
User start to see content that was only for GM
I need to be able to capture the ID of the last dropped item that is dropped on an actor sheet as stored in the actor. I have figured out to get the ID of the source item from the sidebar using Hooks.on("dropActorSheetData"but I can figure out how to capture the ID of the "just dropped" item? Does anyone have any ideas on this?
@formal goblet Gibt es eine Möglichkeit, Würfelausgaben (z.B. ${#concat(?{trade:'Roll type?'|"Leicht"|"Mittel"|"Schwer"|"Sehr schwer"|"Fast unmöglich"})}$) nur GMs anzuzeigen?
I have a system where a certain stat references a dynamic table to pull a dice formula.
Open Legend, using a similar system, also uses a popup, which can add or subtract advantage from the roll (functionally having you roll another dice from the dice formula and dropping the highest or lowest dice from the outcome, for disadvantage and advantage respectively)
Is there any way to add this sort of popup or some other additional step so that a player can add advantage or disadvantage to their check when they click on the label that has all the dice roll code in this way?
Are all system.props stored as strings? Trying to access it in js and I need to parseInt() 🤷
Probably not
I actually found this bug yesterday by suprise because I've worked on some enhancements there. It will be fixed with the next release.
Gerade nicht, musst du dich selber mit einem Script darum kümmern
I think a combination of recalculate() and setPropertyInEntity() will do the trick.
You can construct User Input Dialogs, which ask for the data. With that, you can construct your Label Roll Message accordingly to consider the user input.
When do you expect the next release to happen
This will probably take a while because the creator has currently no time for development. Expect a few months for the worst case.
Gotcha
If you need to have a macro do something when you drop an item onto an actor, the following will allow you to do this. I put this in the World Scripter module. In this case, I have ~30 item containers that are used to show talents in a specific arrangement which is based on a filtered value. The macro sets the value determined by existing talents and the dropped talents rank. I used to use a button to place each talent but this is automatic.
//sort talents by tier when dropped
Hooks.once("createItem", async (item, options, userId) => {
const itemTemplateId = game.items.getName('_Talent Template').id;
const droppedTemplateID = item.system.template
if(itemTemplateId != droppedTemplateID) {
return;
}
await game.macros.getName('Add single talent to Journal').execute(
{actor: actor, item: item, itemType: "talent"})
await game.macros.getName('Add to XP Journal').execute(
{actor: actor,itemType: "talent",item: item})
});
});
Fun fact: The new feature will allow automatic and manual sort for Item Containers 😅
I need a way to return the 2nd value in an array....
%{return '${yourArray}$'.split(',')[1];}%
Been fighting with that all day, let me try that
Will that work through a actual label?
Yeah, just the comma-splitterator is important
Ok that sorta works, gotta sort it now so i can pull the second largest
%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%
How do I add this into the middle of a CBS formula?
basicly looking to do the following:
(MAX(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'))*SecMult + (%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%)*SecMult)
sort() is not a CSB-Function, that comes from JS
That works? lul
%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}% <-- this does
It sorts and provides me with the second largest
MAX(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'))SecMult + (%{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%)SecMult <-- I am not sure I can nest the % in there
MAX() shouldn´t be valid, function-names are case-sensitive
max() works
basicly taking a excel formula and converting it over to CSB formula
=(MAX(PCF_SkillRange_Start:PCF_SkillRange_End))*SecMult + (LARGE(PCF_SkillRange_Start:PCF_SkillRange_End,2)*SecMult) <--- this is the value
max() != MAX(), that´s what I want to say
Correct
What is LARGE?
LARGE is the same functionality as %{return '${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$'.split(',')[1];}%
it produces the value of [n] so in this case it calls for the 2 value which is what I was looking for
I see, looked it up in Google Sheet. Works the same way
Correct
max(fetchFromDynamicTable('PCF_Table', 'Skill_Rank')) * SecMult + (%{return "${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$".split(',')[1];}%) * SecMult
You had quotes in quotes. To prevent strings to be cut of, you have to use both " and '.
Btw, using syntax highlighting helps a lot spotting those issues
LOL Yeah it does
${max(fetchFromDynamicTable('PCF_Table', 'Skill_Rank')) * fetchFromDynamicTable('Variable_Table', 'Value', 'Variable', 'Secondary Multiplier') + (%{return "${sort(fetchFromDynamicTable('PCF_Table', 'Skill_Rank'), 'desc')}$".split(',')[1];}%) * fetchFromDynamicTable('Variable_Table', 'Value', 'Variable', 'Secondary Multiplier')}$
Fixed it, it works kinda, gotta figure out the values and match to the sheet but it works and pulls data!! Thanks for helping Martin, you have saved me a bunch of work
Going to have to figure out nesting a bunch of if else statements later but its bed time for me..
This formula looks like a nightmare 😅
Hahah its not the worst one i have put together
I know but I am trying to simulate the Genesys talent pyramid from the paper character sheet. It has a grid of 5 columns (Matching 5 levels of talents) and theoretically unlimited rows. Talents are placed on the grid based on their level. A lower level talent must be purchased before a higher talent (moving left to right on a row). Also some talents can be bought multiple times, and each one of these counts as a higher level talent. There are other placement rules that I have left out for brevity. So its not quite as simple as sorting alphabetically by name or by other columns.
Additionally This code would be useful when trying to drop an item onto a sheet for purposes other than populating an item container.
Hey guys. I thought this would work in the Default Value of a Number field in a Dynamic Table...
${sameRow('srALevel') * sameRow('srACPL')}$
... but it just puts that text in, then throws a fit about it not being a number. Any thoughts?
Also what would I put in a Label that would be the equivalent of "=sum(DynamicTableColumn)"?
If I remember correctly it is sum(fetchFronDynamicTable())
Use a label not a number field. That will fix your issue. Number fields can only use min or max for formulas.
Is there a way to check a checkbox from outside an item container?
Like can I have a button be clicked and it checks the check box?
Havent figured out items yet, so no clue red
It it's outside of an Item Container, then you need a Script which updates your Item.
Thank you
Is there any plan to include checkboxes within an item container?
There's a feature request to mirror components in the Item Container but I don't think that has any priority. So don't expect it in the near future.
But you can simulate a Checkbox with a Label. Just take a look at the Example-Template.
Thank you for the help.
not sure what works with CSB.
Core Settings Expanded is the only module which can tinker with Status Effects without issues afaik.
What so you mean automation?
Only modifiers can be automated by the system. Concepts like Damage over Time are not implemented, so you'd need to implement all that by yourself
No
Idt dots are implemented in a system to my knowledge
"Damage" is a permanent stat change, which can be done via actor.update().
"Over time" is something like an Event, so you have to work with Hooks, which listen to time-changes for example. When the event emits, you have to check if an actor is currently affected by a status effect. If so, you can apply the damage part.
That's all I can say.
using a Label instead of a Number Field sacrifices the ability to enter a manual override. 😕
try a text field
Yeah not able to do that
You can use a number field and use default as a formula field
but thats about all I can help with
that's my original idea as well, but something's derpy about the formula 'cause it's not getting evaluated. not at my machine to test right now anyway. (shrug)
Did this work?
You can either have an input value or a derived value, not both at the same time. If you need both, use more components.
When you say more components what do you mean.
e.g. a Label, which uses the value of a Number Field if a Checkbox is checked, otherwise it uses the normal formula. That's how an override would work.
I havent used anything like that. I would be interested in looking at it
I found a wholly different work-around, so I'm ok.
Is there anyway to make a field not editable by players and only editable by DM?
Make the field viewable by a gm only, it will be hidden from players but the dm can edit stuff or what not
I would still like players to see the value though.
Then makr a reference field as a lable if you want the player to see it
Have it call the hidden field
Thank you
Is there a way to do this on a character sheet? - I have one field with the quantity of an item (1, 2, 7, etc.), a second field with the weight of the item. Can I have a third field that shows the total weight? e.g. item weight x item quantity = total weight.
Sure
How?
Inside an Item Container or outside?
(Lurking, hoping for an example of 'outside')
The example with the "outside" is literally just using item modifiers. That one is explained in the FAQ.
Also outside. I'll check the FAQ.
What is the correct macro formula to check if an active effect is affecting a token?
Thanks man !
So, since items can't be stacked in inventory, what do you do to your system? Only one item per pile? Or have you found other solutions?
There's simply no stacking-mechanism. So the only thing I do is defining a count-field and update that when needed instead of dropping a new item.
Fair, ty for answering
For inside would you just store the quantity in the item's keys ? or would you do it differently ?
I´d do it in the Item keys
Is it possible to use the Effect macro module in CSB? I can't find a way to access the active effects settings other than in "Configure Active Effects" on the character sheet (to set modifiers).
I don't know that module, so 🤷♂️
Basically you can assign a macro to an effect so it runs it when you gain/lose the effect, but you have to set it on the "classic active effect board", but I can't find it in CSB so my guess was that it is fully replace by the effect modifiers board.
Is it system-independent and has it dependencies?
"The module works in every system that has Active Effect support, however it can leverage system-specific hooks as well, if added." But "active effect support" is kind of vague to me, that's why I was asking. https://foundryvtt.com/packages/effectmacro
Effect Macro, an Add-on Module for Foundry Virtual Tabletop
As far as i know this Module doesnt Work with csb
Or at least Not properly Like in other systems. Maybe you could be able to get IT to Work but then its the question If its worth the hassle
Only the target-actor-name (with fetchFromActor('target', "name")), not the target-token-name (that one requires a custom-script).
Anyone knows how to access/modify status of a character ? Thanks
is there a function to keep the highest value from a list of given keys ?
Like having an attribute only return the highest value between strength, dexterity and reflex
Are they in a dynamic table?
Or you could use nesting if statements
Or switch() statements
All depends on how you have it broken down
Try max(key1 , key2, key3, etc) see what that produces
If in a dynamic table you could refernce the max(fetchFromtActor(table, value) )
seems like "max" formula does not work
nvm nvm
I forgot to change one Math.max by max so obviously it wasn't gonna work
thanks bro
Hi, quick question, how can I change the roll formula depending on a value from the table?
I'm not sure I understand the question
Yeeep, sry, not good into foundry stuff
I have a dropdown list for a number of characteristics, with a non-numeral values (I used letters from E to A)
So, if a char has a characteristic of A - he uses 3d10kh2, D - 2d10kl for a roll formula and so on
${key = "A" ? 3d10kh2 : key = "B" ? 2d10kh2 : key = "C" ? 1d10kh : 2d10kl}$
try something like this
I'm not 100% about the " " actually I think there is another way to do it
but I can't recall it
Is there a way to store a system.props as number instead of string??
Because even number fields are stored as strings.
Could also use switch()
I know about the ways, I'm mostly confused with unfamiliar syntax
${ switchCase(KEY argument, 'A', '3d10', 'B', '67d4', ect)}$
Doing this by phone and by memory but its listed in the wiki
Its similar to if statements
Thank, ill try this one
can someone explain what the conditional modifer list is for or what the use case is? i was thinking of creating something like a list of active effects but apparently for it to show the list of modifier groups, you need to first administer the effect from the token first. ticking all the groups also doesnt list down the groups until the status is applied from the token.
if i have to apply the status from the token then tick the modifier group, then there is not much use for the list isnt it?
or its a wrong use case thing?
Confused on this bit on how to call a macro with arguments. %{return await game.macros.getName('dXroller').execute({name: '${name}$'})}%
If I wanted to do /macro dXroller total=4 dX=8 how would I work that into that last bit with multiple arguments?
Hi everyone, I wanted to ask when it came to dynamic tables. I was wondering if anyone knew how to set a label value for a row when making one in the initial template. I'm trying to make a skill table with the preset skills in. But I can't see how to set premade instances to certain values? So they'll all be already on the sheet straight away. I've been trying user inputs but they don't seem to trigger on creation.
A text box would work, but I've seen others peoples skill lists that seem to use labels for the skill names, so I was curious as to if that's being done simply by inputting some values somewhere I'm missing, of if it's CSS work?
Not sure, but try separating them with , or ;.
Im not sure what to do for a single argument either on the name bit
is it %{return await game.macros.getName('dXroller').execute({total: '${4}$'})}% ?
Try something like this:
%{return await game.macros.getName('mavroName').execute(
{1stArg: 1stVal, 2ndArg: 2ndVal, 3rdArg: 3rdVal})}%
got it to work like this: %{return await game.macros.getName('dXroller').execute({total: '${4}$', dX: '${10}$'})}%
Now is there a way to make it hide the output like when you do ${#stuff}$ ?
That's some pretty cool CSS, how did you manage to upload these icons?
I tried putting the # and it still shows "undefined" in the chat bc the macro isnt meant to return a value like that
you can specifiy image URL (host it at imgur for example) or just drop it into your directory. for the directory path i forgot how it works but it should read from where your CSS file is.
The list only allows to show modifier filtered by group I think
yeah i ticked everything it doesnt show anyways unless i apply the status effects from the tokens. was more hoping i can just check it from the sheet and it applies
Hopefully one day
yeah i just re-enabled DAE
Hello there !
I'm new here and i'm a total beginner on Foundry (and JS) and i have a question :
I have an item in an item container and i would like to use some attributes from the character on the item for a roll.
here is my formule so far :
<H2>attaque : </H2>${[1d100] + %{return entity.system.props.attaqueval}%}$ + ${%{return entity.system.props.strval}%}$
the attribute "attaqueval" is on the item and "strval" on the character but, obviously, "strval" appear undefined.
can someone explain me how to recover the value from the caracter please ?
Normally it´s entity for actor and linkedEntity for items (in Item Containers). But you can also just use ${[1d100] + item.attaqueval}$ + ${strval}$ 😅
oh.
Thank you ^^'
I'll try that now
Many thanks ^^
Are there any good tutorials or resources for getting started with CSB? I am completely new to Foundry and am trying to implement a medium-high crunch custom system that I'm working on.
I don´t even know why they are strings in the first place. But even then, it shouldn´t be an issue to cast it to a number.
Well other modules are looking for numbers and this lead to compatibility issues
Add %{throw "Done";}% at the end.
is there a way to trigger a macro with a roll message without outputting anything to chat? It always puts a blank message
It still puts out an empty message in chat, scrolling up it looks like this is a known limitation
Does it put unknown or blank?
The thrown done above should prevent the undefined as well
Hmmm
oh now its working, I think I had a typo, I re-pasted into a new label
sweet thanks
Np!
So I am trying to get a formula that calculates all my weights.
All of my weights use decimals as well but its not calculating the one weight that is showing a decimal.
Does anyone know how to get this to work?
${floor(Total_Weight_Weapon + Total_Weight_Armor + Total_Weight_Pockets + Total_Weight_Wallet)}$
This is the current formula.
Do you see the value of the one weight in a Label prefix?
Yes
I see the value of all the other weights.
Besides the one that is displaying a decimal.
So that one isn't even showing up. Errors in the console?
No errors that I can see.
Warnings?
Yeah, and your formula should show 11
Thank you
floor() rounds down to the nearest inferior whole number
Thanks. Martin just said the same thing.
I have a question. I know that for dropdown list a specific label can only have one key linked to it. but what if I want to update two values depending on what is selected in a dropdown list ? How should it be handled.
Example : A dropdown list lets you chose between a easy, medium or difficult skill. depending on that, you would need to update 2 values in a label : (1) the number of points required to level it up (2) the time you need to spend studying to level it up.
If you had only one of the two to update, it would be pretty straightforward: you just put the value of one them as keys in the dropdownlist. But now that you need to account for two variables, how should it be handled?
When I have to do it, I set the keys to 1, 2, 3, 4.... and then use ${dropdownlistkey == 1 ? value1 : dropdownlistkey == 2 ? value 2 ...}$ but I feel like it's not very efficient. So I wonder if there is an easiest/more efficient way to acheive that
Ok so, it sounds like the drop down contains text not numbers, if this is the case use equalText('key', 'easy') ? 1 : 0 then nest them
You can always use the and() to compare 2 values as well if needed but it doesnt seem like that is needed
Are these on dynamic tables?
Nope, I just manually enter the values of the dropdown lists. The thing is, the way I do it works, it just seems a bit overcomplicated to me, so I thought that maybe someone knew how to it differently
You can move the keys of a dropdown to a Dynamic Table and handle that like a Lookup Table. Otherwise there's no other solution to that.
Yeah that was my next thought
Make a dynamic table that has the list of things you want on it. Then have the dropdown used to select what options your wanting
I am a fan of helper tables
In this case say dynamichelpertable hase the following,
3 rows 3 columns
Difficulty, multiplier, bonus
Easy, 6, 9
Medium, 3, 3
Hard, 1, 0
Write the other fields to look at this table and all fielda will update accordingly.
Then you can add to the table if needed later on
thanks for the insight guys 😁
Not sure about status effects.
It´s just the key-name of your Label (Label must be a number).
Templates are independent from each other, so you have to do that for each one
You can do one trick and copy your configs from the export-json
- Source-Template: right-click, export
- Target-Template: right-click, export, copy & paste relevant parts from Source-Template, right-click, import the edited file
Grüß Gott,
so my problem is this:
I want to equip/activate only one weapon/item at a time, unequipp the others
Use a Label to then roll the damage with the damage-value of the equipped weapon
I know in theory how to calculate the total damage-value of all equipped weapons, same procedure as _Template afterall.
But if the damage-value of a weapon is "2d4" e.g. it returns with "NaN" since i assume the item modifier dont like the D
Wouldnt it be :2d4: ?
Moinsen,
the issue is that 2d4 is not a number, so you cannot just do 2d4 + 1d3 mathematically. It only works in a Roll Formula, because Foundry knows how to interpret them.
I am travelling so i dont have access to my sheet but i have it so whatever is in that field is replaced in my roll mechanic.
2d4 then reference the field ${DAMAGESIZE}$ in the roll to replace the dmg
You´re ignoring this part here: "total damage-value of all equipped weapons"
so since a picture says more than 1000 words
Hmm maybe i am a bit confused on what is trying to be achieved
Yep, and that´s correct. 2d4 is not a number (NaN).
is there another way to get my damage_value out of the item?
Items are outside my knowledge. But dont you have to reference the container not just the key?
Item Containers are unreferencable.
Didnt know that
Suggestion then, break down the dice size
Add of the total amount of dice and reference that instead of the 2d4 it would be 2 d4 and when you roll base it off of the weapon type? Idk what your weapons are designed around
Yeah, but the strategy is completely different.
- We won´t add damage-rolls together (doesn´t work). Because we have strings, we will join them with a
+. - Joining strings doesn´t work with item modifiers, so we have to get the values of the items by a Script. This example here illustrates how to iterate throug the item-collection: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Script-to-update-multiple-items. Set the right filters and join the remaining ones with a
+
I will be back into town on Sunday, i will poke you with what and how i do it. It might or might not help
wait, could i refference a roll table with my numerical damage-value and have my calculation then go with correspoing roll table?
Sounds like a good thing to try
I have my weapons do that, if its this type and equaltext of this name give me this roll
many ways to rom after all, lets see what i will do
Rock on man, i am new to this as well, but try to help as where i can. As my friend would say be the rubberducky
now that the easy problem is dealt with,
how do i get the distance from actor to a target and us it to calculate bulletspread and accuracy.
bonus points if a missed shot is able to hit tokens on the path to or behind the target
Ehhhhhhh. Scripts, CSB has no functionality for that
Hört sich nach nem guten Plan an
mine is easy to handle, only problem is his inability to express coding-stuff into a human language
Lol i actually do that for a living, code to human translator.
My coding skills are limited unfortunately but i manage
i copy from _Template and am very, very happy about the thorough documentation and this channel
Thats where i started as well. The system i am making a sheet is all about d100 rolls on a success chart. Using skills as the target. Getting the math to match the excel sheet has been a challenge but I am almost there.
The second sheet i am working on is taking the book dungeon crawler carl and putting a character sheet together for us to use. That one has been a bit more straightforward since its being developed as we play
Hello! I have a question I'd appreciate some assistance with!
I'm trying to make a macro that can look at an actor's item and toggle an "is this equipped" value. I'm able to grab the information I'm looking for, but I can't figure out how CSB wants me to update it.
I just want to confirm that I should be trying to edit the value in item.system.props and not item.data.system.props, since I see there's a item.data.update() but foundry says that's no longer used
for reference, the script on the left is the macro in the label, and the macro on the right is what's being called
oh wait, looks like this could be done with setPropertyInEntity
ok yeah that was a lot easier, never mind!
Thank you!
One other question - is there a way to use setPropertyInEntity to update things like radio buttons or checkboxes? For example, I currently have a checkbox and I can use setPropertyInEntity to change it to true or false, but doing so doesn't seem to change the state of the original checkbox. When testing with radio buttons, setPropertyInEntity could change the value, but doing so would remove the dot from the center of the selected button
For example, the item container here reads that it's equipped and it appears in the correct filtered item container.
However, by setting the property to false, it correctly moves to the other filtered container, but doesn't update the original checkbox when it should be unchecked
update - it looks like set property will update a checkbox if the value is currently false and is then set to true. However, it won't update the checkbox if the value is currently true and you set it to false
try setting it to '' instead of false
so that does uncheck the checkbox, but then it looks like the value of the checkbox isn't false which can break formulas if you're expecting true/false
i'm using my checkbox value in a ternary to see if it's true or false and it works for me
ok so with some testing, it looks like setting the value to 0 almost works. If you set it to 0, it'll clear the checkbox but the checkbox won't read as false. Once you update the item again (in my case I selected an unrelated checkbox), the 0 will turn into false and will read as false
Instead of checking for true/false check for truthy/falsy, that includes empty strings and 0
hello guys, do you know how to make a 1/3 2/3 panel?
like one column of the pannel occupies twice as much space as the other
Custom CSS is the way to go
OKay thanks
Does updating a template and selecting update all update items in compendiums too?
I think only the ones in the tab
Does anyone happen to know how to include multiple sheet elements in an attribute? I'm trying to set up an attribute that adds all the users protection hit points into one attribute. Is this possible?
Current formulas tried:
First Attempt: ${armor_min}$+${shield_min}$+${aura_min}$
Second Attempt: ${[:armor_min:+:shield_min:+:aura_min:]}$
${armor_min + shield_min + aura_min}$
thank you
So i'm trying to make an item where you can input which entries on a dyn table to modify on the attached actor.
The item has a text (skill_name) and number field (skill_bonus), and the following modifier:
${fetchFromActor('attached', replace("getRefFromDynamicTable('skill_table', 'total', 'name', 'name_rep')", "name_rep", ref(skill_name)))}$
which just adds skill_bonus to the result
I'm using replace because it occured to me that functions in a string won't trigger, but it sadly doesn't seem to work. Anyone know what i'm doing wrong or a neat workaround ?
Remove ref() from ref(skill_name)
oh that just works. I don't even remember why I did ref there
Thanks !
May I ask please what is the expected use of the userImputTemplate, I don't think I get how they work. Are they like dialogue boxes when you want to a roll ?
Sort of. The user input template defines the fields in the dialog, on which the Label Roll Message can refer to.
Okay thanks 😄
Has anyone been able to get two labels to be side by side in css with a border box around them?
You could put the two labels in a table and border the table.
Thank you.
Would anyone know a way to achieve something like this:
I want the boxes next to eachother
I am not at my PC at the moment but if you drop two items onto one table location (+) it puts them in the same spot, not sure if horizontal or vertical though.
Let me give that a test thank you.
Let me know how it goes
Kinda works.
They aren't close enough.
My issue when it comes to moving them with CSS. Is that it fucks up the entry field.
Seems to be working though even when moving them.
I like this.
It creates a panel on the table. You could change the item padding in the panel or the item margins in the panel.
Prior to me using the tables and just doing the number fields it wasn't working. Changing the margins or padding still caused issues with clicking into the box.
Sorry no other ideas at the moment.
Its alright. The tables are working great.
Ok that's great
I have the following JS in a label
%{async function main(){
const desc = await game.macros.getName('SC Description V2').execute({actor:entity.entity, itemName:"${FormDropDown}$"});
console.log("bbb");
console.log(desc);
return desc;
}
return main();}%
Which calls the following macro:
async function main(){
const items = game.folders.getName("Species Generator Items").getSubfolders(true).flatMap(f => f.contents); //would be all items in a folder + subfolders.
const nameList = await items.filter(i => i.system.props.name == itemName).map(i=>i.system.props.description)[0];
console.log("aaa")
console.log(nameList)
return nameList;
}
nameList in the macro (second function) returns the correct value to console but the returned value as seen in desc (first function) is undefined. Does anyone have an idea as to why? Thanks
in a label roll message, is there a way to conditionally roll a dice without showing the unrolled dice in chat ?
or a way to individually roll a variable number of dice ?
You´re returning from the function in the macro but not from the macro itself.
If you pass 0 to the roll, it still shows up in chat as a roll of 0dn, instead of being ignored
unless you mean to dynamycally call the dn part as well, i will try that
quick question, does csb make use of the Scrolling Status Text feature in core, I want there to be text feedback on the token when changes are made to hp/mp field in the sheet
For some reason, I have container on an actor sheet that will only accept non-unique items from a specific template. There are no errors but foundry generates Item creation prevented during pre-create.
What variable is used to store HP and damage? I'm trying to spawn a damage/healing counter over the token when there is any HP change
CSB doesn't keep a history of hp/damage.
Is make item unique ticked in the items?
I don't think so
The reason myself and Dark Magician Girl are asking is because we're both trying to have damage/healing numbers pop up over tokens
like so
OK, I'm making assumptions based on an earlier conversation I had with DMG, but yeah 😛
I see. I'm actually a bit surprised that this is not done by default by Foundry.
I believe it's under the Scrolling Status Text feature in core, which was added in.... v10?
but CSB seems to disable it
I don't think we are actively disabling it, we would have no reason for that. It's more probable that it requires an implementation.
When that box is checked. Only one item is allowed, at all, in the container from the template. When it is unchecked, I can drop multiple things from the template. However, I think I may have found the problem. I have a macro which contains several JSON databases. I am creating items in bulk from this JSON by duplicating an existing item with a new name and then updating the relevant fields on the new item via JS. I think it may be relating to the issue.
Yeah, you have to override an id-field. The system checks if the id is already present and prevents Items from creating if this is true.
So the duplicated item is retaining the ID of the original somewhere within?
Yeah, just check the JSON, it should be obvious there
It looks like sourceId needs to match "_id"
I think that is the right one if I remember right.
I have turned a panel into a scrollable div with an item container. I am using code to populate the item container which seems to force a re-render (using Custom System Builder) of the div and I loose scroll position. I can scroll the div via a button with
const speciesCreatorDiv = $('.speciesCreatorMain');
speciesCreatorDiv.scrollTop(200)
However when I capture the initial position, after re-render, the div not reposition to the captured position. I have tried await -> then and long setTimeOut without success. Does anyone have any ideas.
There is efficient way to implement checkboxes that add +1 to an attribute?
Not really, you have to get the current state of each checkbox in the final Formula. So it will be something like this here: ${currentValue + (checkbox_1 ? 1 : 0) + (checkbox_2 ? 1 : 0)}$
Small hint. Your Number field cannot have a Formula as value, so you cannot add +1 to a Number Field. It has to be a Label in this case.
At least I don´t
Could also do a drop down box to do +1 2 3 ect
Helper field if you need to do calculations behind the scenes
yes
i know it. but thanks
What formula would I use to pull a value from a number field and show that formula in another number field?
You're on track. I should have specified, so this is on me. What would the formula look like?
I do understand what keys I'm using, but I'm confused on what formula to use exactly.
let me start at the beginning, are you just trying to pull the data from the number field? What is the use case?
Hehe np
Thank you for giving me a hand Drag!
Anytime man
Took me a minute to understand what I was trying to do.
But I am just trying to pull a number from my GM tab and put it in my body section.
For example, its being interjected into the total sections.
Agreed. Some times I have to spit words at others to figure out my own shit lmao
Yep thats how i work lol wife hates it
My girlfriend listens and then just goes "Did you figure it out finally?"
Mine says, can you go in there your talking to yourself again
I need to buy a picture to hang on the wall to just spew shit at.
Another question for you. Is there a way to pull a value from a specific item and place that value in a number field?
Like when you equip a piece of armor that gets added into a number field
Hmm
Could that be done within a item modifier?
Check that out
It might help a bit, i am not good with items but you should be able to reference the item, not the container
Interesting.
Yeah I have done it before for the weight of my items.
Let me give this shit a shot.
You SHOULD be able to since thats the purposes
Would you know the formula to check if something is checked?
Like if checked add value?
Similarly to if and then statements
About as best i got atm, will need to do some testing myself to help you further and i am traveling until Monday
If anyone else gets a chance to chime in I would really appreciate it. I am stuck on this one.
You cannot modify Input Components like Number Fields, Text Fields and so on, only Labels are modifyable.
If you want to modify a Label, then the instructions in the Readme and Wiki (FAQ) should be enough.
So I'm not really trying to modify it. I am more trying to pull a value from within a item and add it to a number field. If that makes more sense?
I was trying to accomplish this within item modifiers.
Well, still the same answer. An Input Component cannot have derived values.
But I've some what already accomplished this already when adding total weight.
By doing this.
That one modifies a Label. A Label contains only derived values.
Would I be able to send the value to a label and then pull it from the label then?
Then it would derive values from a Label. Still no
Is there anyway to have a system that where a player can equip a piece of armor and that armor is then added to a number field?
No
You can add those values to a Label without a problem but Input Components are a big no no
Is there any plans in the future to add that type of functionality?
Uhh, no. This would require some massive changes in the core-functionality. And would also lead to bad design. That's why even Excel doesn't allow this. You can either have an input value or a formula in a cell, not both.
Fair enough.
Fucks up my plans for automation, but I can make my players just input the data themselves.
Thank you for the insight.
Why not just combining it? The base value is in a Number Field while the total is captured in a Label
So I need my players to be able to edit their armor number field.
In my system I use it as a padding to their health pool.
Well, that's what the base-value is for
Apologies, I am not fully understanding what exactly you are suggesting.
Can you explain a bit more in-depth? I am still learning the system's full functionality.
Let's see...
I'd create 2 Components for tracking armor. A number field for the base-value of the armor (freely changeable by the player) and a Label for the total armor (base-armor + modifiers, not changeable by the player). That's all you need or am I missing something?
Some what... So let me explain what my old workflow was in Sandbox that I was trying to mimic with CSB. I use to have armor (items) with their durability number and when the player equips that armor its added to a number field.
The player would then substract from that field each time they took damage. There was then a button that would repair all armor from the items durability.
It was a fully automated process involving the items.
But from what you were explaining earlier. What Sandbox had was bad practice when it came to the design itself.
Which makes sense and explained a lot of the issues I use to have.
I see no need to have a number field at all then.
Do you have the Example-Template? That one also works with Armor-Items.
That one provided in the Git? Yes, I do! Unless there is another one.
Nope, only 1.
If you add Armor Items to the Actor there, it will adjust the total armor value automatically (summing up the armor values of all equipped armor items). This value can then be used in other places (like damage rolls).
And that is be added to a label, correct?
Yep, the total armor value is in a Label
Hmm, gotcha ya.
Once again thank you for all the help.
For now I think I will just have to remove my dream of automating it the way I envisoned it.
And have my players just do some basic math.
Well, what you explained can be fully automated
My only issue it takes away the full durability of the equipped armor being moved to a number field for them to freely edit. Does it not?
Current durability would be a Number Field in the Armor Item itself, so that it can be changed by players and rolls.
So okay, hmm.
I do have the current durability of the armor in the armor itself. My players are lazy and they like it all in one section. So for example....
They would want the durability of their helmet to show up here and not within the item itself.
Create a Label, which shows the durability then. It would be read-only, yeah, but it would at least display it.
I'll most likely end up doing that.
Follow up question for you. Is there a way to see if a check box in an item container is checked and if its checked pull a value from another number field within the sheet to another number field?
The only time it would be interacting with the item is to see if a check box is selected?
Only doable with a button (Label Roll Message), so not completely automatic.
Could I use a button to trigger the check box and then send that message to the number fields?
You can change every Input Component with the button, so yeah.
This most likely wouldn't work but my dumb idea was to list all the armor's individual durability in the gm tab, and then when they equip the armor using the button it calls back to that number. That number field then feeds the value into the box I showed above.
Doable, but meh. You have then 2 Number Fields, which express the same thing, but can contain different values (breaking the principal of "Single Source of Truth").
Very True.
Apologies for spewing all of this at you.
I was just dreaming of a lot of automation.
Is there a place I can donate to the development of the system?
There's a Ko-fi - link in the Readme
Thank you. I'll throw you guys a few bucks.
Besides this setback everything you have created has been amazing.
Thank you for all your hard work.
hey i got showed to come this way i am trying to make a sytems and sheets for mekton zeta and i dont now how to do codign or were to start dose anyb one now were a good place for me tpo figure it out in detail,? i got to make genric items and stuff
Visibility Formula: Would like to show a field only if one or another condition is true. can i use "OR" operator here? Maybe my syntax is wrong because it doesnt work:
OR(typ==3, typ==7)
https://gitlab.com/custom-system-builder/custom-system-builder
Especially have a look at:
https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/sheet-library
and
https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/sheet-library/Example
And don't miss:
https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Supported-modules
that worked, thx!
@vagrant hollow hey i am looking at your links ands tying to figure out the system tell am i am trying to build the template it dosent really give of an example of hoe to input the key to get a block of info to appear in it
Hey all, I am trying to add a static bonus if a checkbox is checked in a dynamic table. How would I do this? Very new to JS in general, thanks!
What would the formula be when a player rolls and you want it to substract from their spell slots or uses?
Like it substracts the value that is set in a label.
Hey RED, anybody can correct me if I'm wrong, but that might be a script thing, not a system thing. Have you picked the brains of the people that hang out in #macro-polo?
I have not.
But I think that would be a lot for a simple substraction.
... triggered simultaneously with a Roll event, w/o manual intervention... right?
They click the button for a roll damage and then it subtracts one or two from something.
They could also potentially give you something that checks for a slot available to give up before rolling...
Yeah, you're basically talking about 5 uses of Magic Missile or some such, right?
Anyway, if/when you approach Macro-Polo, it'd be a kindness to volunteer quickly that the system is CSB.
I'm talking more the substraction of a spell slot after the use of a spell.
Ok, perhaps I could have worded it a little better "5 level one slots powering the use of something like Level 1 Magic Missile." right?
A macro can check first if we're not already at zero slots remaining, roll the dice or complain that you are spent, then (if the roll was done) spend a slot.
I don't really use the levels for spells.
When a player casts a spell they delete that number.
So it's more like they have energy points and each use of Spell X costs N energy?
Sure
Then, a macro could:
- see if theres enough energy to power the roll
- if there is, subtract N from Energy...
- ... and roll the dice
- if not, describe how the spell fizzles.
What would that formula look like?
((Doing all that in the same breath is beyond CSB's scope by itself. But again if someone more skilled than I can correct me, I'd love to know better.))
In the template that is provided it seems to already be occuring
Then one of two things is going on, the template provided is already using a mostly correct macro, or I should stop confusing the matter.
In any case, very often the folks at #macro-polo are happy to offer their insights. Especially if you can provide lots of details, without writing a small novel. 😁
Sorry, just read your question.
You can build a formula in a label like this:${[1d6 + (checkbox?bonus:0)]}, where checkbox is your checkbox name amd bonus is the fixed number you want to add; the label would then show the total . You'd need JS only if you used a macro.
much thanks!
This will still roll if they can't pay for it at the time though, right? And the resource being subtracted from isn't handled here...
You can do so that the macro returns without rolling. The resources can be handled, too.
With some kind of 'metacode' it would look like this:
if(resource >= cost)
{
resource_new = resource - cost;
set resources value to resources_new and update actor;
roll for spell;
write funky little flavour message;
return;
}
else
{
write funky little message to let the player know ther's not enoough resources to cast spell;
return;
}
You can use setPropertyInEntity() to do that: https://gitlab.com/custom-system-builder/custom-system-builder#4211-setpropertyinentity
here is a simple CSB-method to do this (with a check if there is enough ressource to do the spell)
the following is put in the "Label roll message (optional)" of a label component
${yourRessource>=ressourceCost?[1d6+:yourModifier:]:'Oh no'}$
${yourRessource>=ressourceCost?setPropertyInEntity('self','yourRessource',"yourRessource-ressourceCost"):'You dont have enough Ressource to use this.'}$
just replace the parts with your keys
yourRessource: Replace with the key of your number-field (<-- important) which holds the spell slots
ressourceCost: Replace with the key of your component where the cost of the spell is stored. or just replace it with a fixed value e.g. 1 or 2 etc.
yourModifier: Replace with the key of your damage-modifier-component if the spell has a damage modifier (e.g. INT, etc... if not you can delete it) or replace it with a fixed value e.g. 1, 2,....
this is a way how to do it with CSB-formular. with scripts you can do much more.
How do I get rid of a hidden item? I have an item that won't show up in any containers but is still applying its modifiers
Create an Item Container with no selected Templates.
That shows nothing, I'll try updating to see if that helps
my templates, actors and items suddenly stopped working and look like this. anyone know what to do?
Mine too...
Could it have been timed along with an update?
Haven't updated to the last version yet. It looks like the page is still loading, though.
Have you tried a shutdown/restart to fix?
sure
Take a look at the console, there´s probably an error somewhere.
No errors, but an advice says it could not load CSB template-functions.js. Other advices about fonts and glyphs and nothing else.
Well, it´s bad if it cannot load template-functions.js. That one contains part of the core of the system
I kind of figured that's a tad bad, ant word of advice?
Uninstall / Reinstall?
There was no Update from CSB or Foundry... Did a module get an update at that time?
There was the v11 stable update for Foundry...may it be that? Haven't done that, though
What´s your current Foundry-Version?
I’m on 3.13 and the error happened 30 mins ago
I´m also on 313 and no issues. Any modules loaded?
Did no updates and 5 mins before everything worked