#Custom System Builder
1 messages · Page 16 of 1
Alright... And where does effect_value come from?
One moment...
I've tried only one mod that does that sort of thing. It doesn't do drag 'n' drop, but Rideable has proved to be quite satisfactory.
I had an error in the key description. That's why I had received the error message...
But the result is the same:
Only one value is set in the item container, even though both have been updated in the item sheet.
Only when I recalculate or perform another action, like opening the ITEM sheet, the second value is updated....
I made a video of this effect to explain it better...
hey, how do i do two side by side panels?
put two panels inside of a single horizontal or 2 column panel
Alright, I know its been a hot second, but I figured out what caused the bug with active effect modifiers. If I had anything in the "Group" spot, its active effect wouldn't work
That's not a bug, it's intended to work that way (see conditional modifier list component)
Gotcha
Sorry, forgot to mention: Add a key le_display to the label. You can use different keys (... or CSS classes) to quickly switch between different colours of the fills this way, by adding a new rule with just a setting of ---bar-fill in them.
Apparently a bug, because now I just changed the order of the instructions and now it works.
This is what works:
<h2>Calculate effect (${item.key_item_effect_name}$)</h2>
<p>Cubed duration: ${duration_value:=[:item.key_item_effect_duration_cube:]}$</p>
${#setPropertyInEntity('item', 'key_item_effect_duration_label', "duration_value")}$
<p>Cube value: ${effect_value:=[:item.key_item_effect_cube:]}$</p>
${#setPropertyInEntity('item', 'key_item_effect_active_value_label', "effect_value")}$
This doesn't work:
<h2>Calculate effect (${item.key_item_effect_name}$)</h2>
<p>Cube value: ${effect_value:=[:item.key_item_effect_cube:]}$</p>
${#setPropertyInEntity('item', 'key_item_effect_active_value_label', "effect_value")}$
<p>Cubed duration: ${duration_value:=[:item.key_item_effect_duration_cube:]}$</p>
${#setPropertyInEntity('item', 'key_item_effect_duration_label', "duration_value")}$
Strange behavior...
Hey there,
${sum(fetchFromDynamicTable('InsightDynamicBonus', 'value', 'active', 0, '>'))}$
This formula works in a label roll, but not in a label text (it returns the right answer in the roll, but always 0 in the label text)
What did I miss?
'active' is modified by an item modifier, if it helps
Is there some baseline reset CSS file somewhere? The amount of margin: 0; border: 0; padding: 0; height: auto; display: initial; and so on I have to do just to get the character sheet into a tabula rasa state slowly gets really annoying.
Oh, and border-radius: 0; too. so much of it.
I don't think so 😅. And to be fair, I avoid CSS as much as possible 😅
In case it can help, because I'm currently stuck on this and can't really continue :
${sum(fetchFromDynamicTable('InsightDynamicBonus', 'value', 'active', 0, '>'))}$ This is inside a basic Label component, in the Label text.
InsightDynamicBonus is the key of the Dynamic Table I'm fetching from. It has 3 columns: name [Text Field], value [Number Field], active [Label with ${0}$ as a label text]
I'm modifying the value of InsightDynamicBonus.active using an item modifier, with this formula as a key : ${fetchFromActor('attached', "getRefFromDynamicTable('InsightDynamicBonus', 'active', 'name', 'buff 1')")}$ and ${1}$ as a formula (with the + Operator)
As said, the first formula works perfectly as a roll, but not as a label
The foundry basic CSS are in your “foundry\resources\app\public\css” folder.
But modules can change your CSS also.
I meant something that changes the default character and item sheets in custom system builder to be essentially "only built-in browser styles".
I can of course copy systems/custom-system-builder/css/actor/character-display.css at the start of mine and replace every single CSS statement with initial values, but I was hoping somebody else did that already.
Feel free to hit me if you need more in the list: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Supported-modules
CSB could really use its own version of configuring active effects (what I tried to use combat utility belt for, and failed miserably).
This is already scheduled for a future update. #systems message
Oh, good.
The current alternative is Core Settings Expanded, if you need custom active effects. But yeah, CUB should be avoided because it breaks the active effects in CSB.
There's a few things I need, but looking at the road-map, it looks like the Actor component (drop actors in there, you can access their props in other components directly) would be one that's not there and which I can use for vehicles and so on. So that's where I'm looking, in addition to styling the char sheet.
Core Settings Expanded really doesn’t work. I tried to explain this once before but existing effects cannot currently be turned off. Issues have been posted for that module but it’s not really recommendable in its current state
You sure it's not possible? Because I have a world with only custom effects there
How did you manage to overwrite existing effects? When I tried it basically all the buttons for editing existing effects were grayed out
I just removed all and added new ones.
I remember that the UI was a bit weird but it should work with adding new ones (not overwriting existing ones)
I’ll give it another swing then. I remember asking about it in module troubleshooting and no one seemed to know how it worked in there 💀
it seems it doesnt like you using the same image for 2 or more effects
Do you have any idea why it would be graying out the edit options before I touched anything though? Like this was fresh install
did you guys try Dynamic Active Effects? It seams to let you at least add Effect Descriptions an a round timer for running out
Personally I really need to be able to remove existing ones otherwise the UI’s basically unusable. Im also personally fine waiting for CSB’s update at this point tho, I was only commenting on issues with CSE
I'll check that once I'm home. I'm pretty sure it's doable
alrighty, I appreciate it 🙏
so how do i make it so that an attribute bar fetches data from number fields for its current and maximum value?
Open "Core Expanded Settings", select the active effect you want to remove, untick "Status Effect Active" and click on "Update Status Effect".
Just define a number field with a max value and the system will create an attribute bar for you
so, the system i'm using will have rolls for max health at the start of each session so my idea to get around this is by setting a number field's maximum value to be the current value of a different number field but i'm not sure if that's possible.
I'll double check when I'm home, but I believe when I tried this before my issue was that "Status Effect Active" was one of the grayed out selections when I would select an existing effect
Yeah, doable. The min and max-fields accept formulas
so do i just have to put in "${maximumhealthpoints}$" or do i have to add these "[" "]"
The following Code checks a Var and changes color of the text according to its value. Everything works so far. But now i would like to add a second Variable in the equation. The check should add the Value of "MUT_mod+MUT_mod2" and see if it is greater than 0. What needs to be changed?
Tried ....(concat((MUT_mod+MUT_mod2) > 0 ? ... but this didnt work
You can leave out concat() and change it to MUT_mod + MUT_mod2 > 0 ? 'darkgreen' : MUT_mod < 0 ? 'darkred' : 'black'
hmm nope this doesnt work either. Result is always colored red, although boths vars together are > 0
There is a comma (syntax-error)
oh wait i see, now it works. Thank you Martin!
@formal goblet as the topic was about Active Effect Changes with Version 3.1, would you mind give us a sneak peak what exactly is planned with the next update? The Info on the Poll Page is quite vague about this.
It´s basically this issue here: https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/141
Configuring Item Modifies: Is it possible to create a Formula that is only applied if the Actor is from a certain template?
Lets say i have a template for Humans and Animals and the Items modifiers should only affect human actor, not animals if applied to both.
Set a hidden number field in both templates with different defaults (1/0).
In the modifier test if the number field is one or zero.
${fetchFromActor('attached', "die-geheime-nummer") == 1 ? 'dein-modi' : ''}$
Sorry for my English, I'm using a translator. My problem is that I'd like the Numberfield to be calculated automatically in relation to my list of disorders, but I can't find where to enter the formula t if I'm using the right one.
I've also tried putting the formula in Default Value but it doesn't work either
Unfortunately, still the same problem, although I now assume a bug:
Partly fields do not update or only when I open and close the template of the item.
Can someone tell me what I can do about it? 😕
The number field is an input component, it is not meant to store derived values. Derived values should generally go to Labels instead.
Any errors in the console?
Donc je dois rentrer le calcul où ? ou alors ne pas mettre en case nombre ?
Not really
Should go to a Label instead
ok, but can I use a label for a calculation afterwards? because my shock roll is made from its total strength - the malus, or do I use the penalty calculation part at the bottom?
Ah, Forge...... have you tested it in a local instance? 😅
No, I only use Foundry through Forge. Is it a known Forge problem?
I think Forge doesn't like CSB (had some cases with users with unknown problems, but it worked every time in a different environment)
Can you recommend another server if I don't want to host myself?
Kp
I'm using a PI as a server, so I'm hosting it myself
I think the knowledge base of Foundry mentions some dedicated servers.
The selection is not really big here now... 😉
Well, whatever fits you more. I have no experience with the other 2.
If you like you can also write a support ticket to Forge asking what's going wrong (if you have confirmed that it works in the local instance)
I will install a local version and see...
Can a fresh set of eyes tell me why this isn't working?
Missing colons. You are in the context of a Roll Formula, so you need colons for CSB-Parts
so [:speed... ?
... Yep. That's what's what... thx Martin.
Sure, your label component key „MalusPer” will be the result of your label text (formula) for other funktions.
Lets say my health attribute has a number Field for Health-current and for Health-Max. That should be quite common in many systems. How Can i automate attacks to automatically apply damage to my Target if number fields should Not be modified? If i make Health-current a label, then i cant adjust Health by Hand anymore. How do i build a structure That Allows both automation and manual modification of my attributes?
setPropertyInEntity() lets you change the input data of a component
Jep i know, But @brittle moth once mentioned That this should be avoided, because an item an the actor that applies this would do it again every time the sheet is reloaded. Although im not quite sure what That means. Is it only when i press the small grey reload Button in the Upper Right corner or every time i Start the game/ press F5/ change map etc.?
You have to differentiate between the Label text and the Label Roll Message. The Label text gets recalculated with every sheet update (if you change a value or reload it). The Label Roll Message in contrast is only executed when you click on the Label.
What that means is that it´s intended to be used in a Label Roll Message (otherwise we wouldn´t have created the function at all because there would be no purpose).
i'm working on an implementation of the advanced tiny dungeon system, and i'd love some advice from the experts before i start trying to implement something. my main contention right now is implementing the rolling system. prior to using CSB, i created a macro for rolling, which generates the dialog attached. the choices on the top row are amount of dice rolled, middle row decides if the test is hard, normal, or easy, and the bottom row indicates the target number.
i'd like to transition this to the roll message system in CSB, but i have a few questions. first off, can i generate a dialog like this? my current macro is a bit long (mostly from the svg data), and keeping the graphical representation isn't essential to me. if so, can the starting values be modified by parameters? the main thing i'd like to try to implement is deriving the target number from a targeted token's AC variable, even if the players dont have ownership of the token. some rolls (like mastered weapons) would have a different amount of starting dice as well.
not asking someone to do all the work for me, but i wanted to check if the CSB roll infrastructure can support these things before i start attempting it
i did check the documentation on the github, and from what i understand, the dialog itself should be doable, my question was more about using variables to adjust what is selected before it renders
You can pass the needed args to the macro if it´s called from a Label Roll Message.
i was thinking of ditching the macro altogether, since it was really just rolling xd6cs>=target, and trying to work solely through the roll message
Well, your choice. At least the dialog looks fancy 😅
the other reason was because i noticed that it was rolling twice when i called the macro via a roll message, one blank undefined chat message and then the actual macro result
Yeah, the blank one is normal because there is currently no way to suppress that. It comes with the next version
ah. also, i guess i could use fetchFromActor to get the AC of the targeted token, and then feed that into the macro to solve that issue
alright, thanks! i'll tinker around with it some more
Hey, is there a way to hide the item card (the grey clickable box that opens the item sheet) in an Item Container?
Probably not if you do not want to utilize CSS
I can use CSS
Well, then probably yeah, but I cannot really help there
Problem is that I don't want to hide it on every tab
I have a tab that has Talents where the player can drag the talent (an item)
and a main page that has "shortcuts" where I am currently using an item container with a subset of the fields
I'm at my wit's end here. Can someone please point out what I'm doing wrong?
I have an item that has a dropdown selection that I can set to a particular option. These are the keys (formula):
${[fetchFromActor('attached', "PCarchery_die")]}$, ${[fetchFromActor('attached', "PCbrawling_die")]}$, ${[fetchFromActor('attached', "PCexplosive_die")]}$, ${[fetchFromActor('attached', "PCfirearms_die")]}$, ${[fetchFromActor('attached', "PCmagical_die")]}$, ${[fetchFromActor('attached', "PCmelee_die")]}$, ${[fetchFromActor('attached', "PCthrowing_die")]}$
The labels are just names for each one (Archery, Brawling, etc.).
The thing works for the most part in that when I select the first option for example (Archery) and close the item then reopen it, it stays on that option. This also works for the first 3 options (up to Explosive).
But if I select the fourth or further options it resets it to a different one for some reason that I can't figure out. No errors in the log that I can see and the actor keys are all valid, I tripple checked.
Why is it doing this?
These are roll-formulas and not normal formulas. Remove [] from everywhere.
If I do that, the roll formula from the actor that uses this selection doesn't work.
I tried removing the brackets, still keeps switching for no reason.
Oof, I see what you did and that is not really optimal. You should think completely different.
The keys of the dropdown should only contain the target keys of the actor, nothing else. No functions, quotes or formulas. Then you go to your Label Roll Message and adjust your Formula:
${[:fetchFromActor('attached', dropdownKey):]}$
Let me try
What do I put in for 'dropdownKey' if I have two different dropdowns in the same formula?
Nevermind lol
Let me test it
Here's the problem. This is my roll formula that references the item dropdown:
<table> <tr> <th>${item.name}$ Attack!</th> </tr> <tr> <td>Result:</td> <td>${[{1d12,1d12,:fetchFromActor('attached', item.weapon_proficiency_selection):}kh2]}$</td> </tr> </table>
Wait, if this is called from the Item Container (which belongs to the actor), then why do you need fetchFromActor()? You already have the context of the actor, so you can just use ${[:ref(item.dropdownKey):]}$
Let me try
You mean like this?
<table> <tr> <th>${item.name}$ Attack!</th> </tr> <tr> <td>Result:</td> <td>${[{1d12,1d12,:ref(item.weapon_proficiency_selection):}kh2]}$</td> </tr> </table>
Doesn't work.
It's called from the item label, yes.
} too much
Where?
After the colon
The kh2 doesn't seem to work without it but I can try.
Ah wait, that's grouping the roll
Yes
What does console say?
Btw are the keys in the dropdown supposed to be like this?
${PCarchery_die}$
No
Console says:
caught (in promise) Error: undefined. Uncomputable token ref( ) [Detected 1 package: system:custom-system-builder]
I said only the key, nothing else
Ok, sec
Console says:
caught (in promise) Error: undefined. Uncomputable token ref( PCexplosive_die)
I also removed the ${}$ from the list.
Which list?
The keys in the dropdown list. You said it should just be the keys.
Yeah, that's correct. I'm just wondering why there's an empty space right after ref( in the error message.
Are the keys in the list supposed be just comma and no space or comma and space?
No spaces. Just the keys
Ok let me try
You are GodSend!
If you switch it back to the static options, then you don't even have to put the commas inbetween.
How would I go about creating a popup that asks why type of roll you want to make. The user selects the roll from a drop down and the roll is made after click the check mark at the bottom of the pop up?
`${#concat(
?{trait:'Roll type?'|"Basic"|"Competence"|"Incompetence"|"Reliability"|"Struggle"}
)}$
${switchCase(trait, 'Basic', {[2d6] + AGI})}$`
This is what I have but it is not working.
I just get the error "items is undefined". I assume I am not accessing the variable correctly or that the roll cant be outside like that and still access the variable?
I think you just need to delete the brackets:
${switchCase(trait, 'Basic', [2d6] + AGI)}$
The general steps you would want to take would be:
- Select a Roll Mode
- Construct the Roll Formula based on the selection
- Process the Roll Formula
- Print the Result to Chat
It is important that you separate step 2 and 3 logically.
Okay, so I mostly successfully implemented my own "actor" component which lets you drag&drop an actor on itself, and have that actor's ID available for other components under the key. There's some issues with getting it to update quickly, but oh well. But now comes the weird part ...
- Why the hell does
_getElement()get called so often, even if nothing changed? - How can I implement it so that it simply returns the current HTML element to spare the browser redrawing it again and again for no good reason?
Never mind ...
async _getElement(entity, isEditable = true, options = {}) {
if(this._element) {
return this._element;
}
this._element = await super._getElement(entity, isEditable, options);
let wrapper = this._element.get(0);
/* do whatever I need to do with wrapper */
return this._element;
}
This seems to work just fine.
Is there a way to define the possible walk distance of a token?
Define the calculation in the sheet and use the drag ruler module
What do you mean by "use the drag ruler module"? Of course I don't want to check the distance manually at every turn, but I want to define at the token that it may move e.g. max. 5 fields per turn. Or do I understand this wrong?
Foundry and CSB itself do not limit token movement distance
All right... strange that such an important function is missing in Foundry...
Thank you!
It's not important, it's more than enough that it just gets displayed imo.
no dice. Pun intended.
`${#concat(
?{trait:'Roll type?'|"Basic"|"Competence"|"Incompetence"|"Reliability"|"Struggle"}
)
}$
${consoleLog(AGI)}$
${consoleLog(trait)}$
${switchCase(trait, "Basic", {[2d6] + AGI}, 0)}$`
not sure where I am going wrong. The log shows that "trait" has the value of "Basic" so not sure why this doesn't return true and roll the dice. It gives an error of "Symbol or string expected as object key"
This won´t work. {} will declare an object in this context (which is not what you want). What you want instead is this:
${#roll_formula:= switchCase(trait, 'Basic', concat('2d6+', string(AGI)), 0)}$
${[:roll_formula:]}$
The first part constructs your Roll Formula while the second part executes it.
TIL: math.js doesn't allow property access to non-plain objects (in particular not to CustomActor either). That's an unsolved problem since 2017. FFS. https://github.com/josdejong/mathjs/discussions/2746
The annoying part is that while the conversion to plain Object is easy enough (let obj = Object.assign({}, whatever);), now I need to find out how to watch specific actors for value changes. Hopefully there's an easy event to hook into.
I´d also like to know if there is any, because fetchFromActor() suffers from the same problem.
Can't you just enforce it for CustomActor and CustomItem? Replace an Actor's system.props with an object that keeps track of changes and emits events as necessary?
There's also this (protected) method, though the documentation for it is so vague that it borders on useless: https://foundryvtt.com/api/v9/Actor.html#_onUpdate
Documentation for the client-side JavaScript API in Foundry Virtual Tabletop.
v9 😅. Guess I can try if it works to listen to that event. Would be nice
can i have an item container contain a filtered list of another item container? for instance, if i had an item container for the inventory, and wanted an additional "weapons" item container that only had the weapons from the inventory container
without just dragging the same items to that other container
oh wait, it just does that out of the box with the filters 😅
It's still in there, I just checked.
The "fun" part is that it does the barest minimum possible. Like ... it generates (internally) a list of changed attributes. Which, if you change system.props.whatever and system.props.thatOtherOne and such, just says you changed system. Least useful data delta algorithm I've ever seen.
😅
I'd just use Redux
Well, the Item Containers are technically not holding the items, they just display them. The actor is the holder
that's actually ideal for me, i was assuming they were holding them individually
It does end up calling render() in the CharacterSheet class in CSB's modules/sheets/character-sheet.js eventually, with the options argument telling you what was exactly changed when options.action === 'update'
{
"action": "update",
"data": {
"system": {
"props": {
"own_vehicle": "5lbOko4BhOc1F6cC"
}
},
"_id": "3M0nSyRBhu6ICJEL",
"_stats": {
"modifiedTime": 1697634451622,
"lastModifiedBy": "ObNcoEGmx1gRZWEj"
}
}
}
This then goes through a few more super.render(...) calls, carrying the options argument through, until Application._render() finally throws the data away. But rendering is way too late to do anything useful with data delta anyway, and this only gets called when the sheet is displayed. In particular, changing system.props properties in the background gets a "proper" _onUpdate(...) calls - once you open the sheet.
So yeah, system.props needs to stop being a plain object.
can i modify the selected value of a dropdown list with item modifiers?
No. Modifiers can only modify Labels, nothing else
can i determine the default value in a userInputTemplate by feeding in some sort of parameter instead of only duplicate keys? i have an input template that i'd like to be able to reuse, and i think setting the default via duplicated keys might be very difficult if not impossible.
Does anyone know if I can access the Label Text field in a roll message formula?
Dunno what it's called in the backend
I have the feeling that the whole sheet re-renders when I'm changing just one value, even parts which don't use that property. That's weird.
I mean, it still works, it just adds an annoying flicker to everything when even one value changes.
"Everytime a field is changed, Foundry sends all the data to the server for saving. Everytime the server saves data, it recalculates the values of the sheet (all of them).
This is done in a not-so-effective way of : I try to compute everything in no defined order (I can't predict the order which will be used at runtime). If something can't be computed, it's likely it needs a value which will be computed later. So I put it apart, and retry it later.
When I don't compute anything new, meaning all computable things have been computed, I stop. If some values were not computed, a warning message pops up in the Console.
Now, here is the issue : To be more efficient, I'd need to compute things in the right order, first the values which don't need any computed values, then the values which need only the previous one, etc... But I can't generate the order because of the ref and recalculate functions, which are "unpredictable", so to speak. So I'm kinda stuck at the moment, I can't find a better solution..."
What I mean is not just the values, the whole structure is being redone. HTML tags and all.
Since this is async (as it should be), this results in a bunch of DOM reflows, and "flicker".
Right now, my components _getElement() method creates the element once, and re-uses it. The whole structure has only a few places which can even change, so on subsequent calls it updates those and returns the same object it did initially. This is blazing fast even when I'm switching an image's srcattribute to something non-cached. And then the Panel the component is in seems to remove all its contents, and re-adds them one by one back in.
Fair point, but I cannot tell if the restructuring is necessary at some point or not. But it´s worth asking @brittle moth
That could be due to how I notify the sheet/actor about the value change whenever I drop a new Actor into the component, to be fair. I'm still investigating how to do that best.
Yeah, you can just use the key of the Label to read their value.
Not really
unfortunate. is there an example of how to set the value with the key method on something like a radio group? i'm not really understanding it from the docs
i tried creating a variable with the same name as the group and assigning that with the value i want, but didn't seem to work
After some debugging, I can see what happens now. Panel, near the end of its _getElement() method, appends new stuff to itself:
internalContents.append(await this.renderContents(entity, isEditable, options));
Since normal components create new HTML elements, the old ones stay visible. Mine doesn't bother, for efficiency, so that here just removes it from the currently rendered DOM and attaches it to the invisible internalContents one. Hence the pronounced "flicker".
Almost like I want it to work. The text below is a simple Label component.
The way this works is that this component has two keys, one (the default, saved to the server) is for the actor ID dropped in there, the other (dynamically calculated) holds a plain JS object copy of the actor's data. So the label simply accesses the latter.
${vehicle.name}$ - ${vehicle.system.props.tonnage}$t - Move ${vehicle.system.props.move}$${vehicle.system.props.move_mod}$
Thank you for this.
Also, is there a way to add a modification box to add like a +1 or -1, etc?
Number fields have those settings at the bottom, did you try them out already?
Inside of the popup
is it possible to, by just using CSB, make a dynamic dropdown list where the shown options are depending on the chosen value of another dropdown list? Is there an example on how to reference the specific drop down value?
for example: dropdown list 1 has the values a and b. dropdown list 2 has the values c, d, e and f. If value a of dropdown list 1 is chosen, dropdown list 2 only shows values c and d. If value b of dropdown list 1 is chosen, dropdown list 2 only shows e and f
I found how to put in a modifier field, but now I have two questions;
- To clean up the switchCase code a little bit, is there any way I can put it as a held variable and then use that variable in a Roll Formula?
- What's the method I would use to retain what's in the user input [number] field inside of the Popup for the Roll Formula?
-
You can move parts to other variables if needed, that's not really an issue. Just make sure that you construct a string at the end, which can be parsed by the Roll Formula.
-
The key gets available automatically in the Label Roll Message, so you can just use that
This is what I have so far but its a very hackmead attempt I admit.
?{trait:'Roll type?'|"Normal"|"Major Obstacle"|"Minor Obstacle"|"Minor Edge"|"Major Edge"}
)
?{Modifier[number]}}$
${#DiceRoll:= switchCase(trait,'Normal',2d6,'Major Obstacle',4d6dh2,'Minor Obstacle',3d6dh1,'Minor Edge',3d6kh1,'Major Edge',4d6kh2,0)}$
${#roll_formula:= DiceRoll+string(Soul_Stat)+string(Modifier)}$
${[:roll_formula:]}$```
Use the formula option of the dropdown and use the switchCase()-function to determine which keys should be shown: ${switchCase(dropdownKey, 'a', 'c,d', 'b', 'e,f')}$
Colon-delimiters are only allowed inside Roll Formulas [], not in ${}$
Still think I'm doing something wrong with the variable portion. To test I stripped out everything not relating to the switchCase and its still not working right.
?{trait:'Roll type?'|"Normal"|"Major Obstacle"|"Minor Obstacle"|"Minor Edge"|"Major Edge"}
)
?{Modifier[number]}}$
${#DiceRoll:= switchCase(trait,'Normal',2d6,'Major Obstacle',4d6dh2,'Minor Obstacle',3d6dh1,'Minor Edge',3d6kh1,'Major Edge',4d6kh2,0)}$
${[:DiceRoll:]}$```
Should I be wrapping the "dice rolls" in something within the switchCase?
Your 3rd, 5th, 7th, 9th, 11th argument in switchCase() is invalid (should be strings)
How do I make them a string? I've put them in string(), ' ', and " "
Also, sorry if the series of questions is annoying. Don't intend to be.
It's usually single-quotes
And if you don't know what goes wrong, then the console is your friend (F12)
I swore I put all of them in the single quotes before messaging you. Try it again after you send that, and it works.
Any way to stack items in an item container? For example, if I add 20 torches, can I have them in one row with a number next to them indicating their amount instead of having 20 identical items in the list?
Nope.
Really?
Yep. If you need some sort of counter, then you should create a number field in the item which does that. Otherwise, nope
Hm, I'll try to work something out.
Thank you Martin for your help and patients. Once that piece worked, the whole thing was simple from there! Appreciate it!
But... I don't have patients... I'm not a doctor 😅
So you're the inverse of Dr. Bones lol
Wait for the next update
what is the key of the label? I'm looking to target the same one in the component, without having it's ID
Ah, wait, I misunderstood your question. Prefixes and suffixes of components cannot be referenced in the Formula-system.
To be clear, I mean “Label Text”, not the prefix field
So, styling question;
Is there a way to make the grey boxes in the first image look like normal text and the dice roll to look more like the second image?
So I put setPropertyInEntity in a roll field of a button. Any way I can hide the roll message from popping up (just want it to change the value)?
you can use the ! modifier to make something in a roll formula display normally. not sure about the other question, curious about that myself
Where would I use that?
!${[2d6+:Body:]}$
Like that?
inside, so like ${![2d6+:Body:]}$
there's also the # modifier if you want to hide something
I see! Thank you. That'll help with stylization a bit.
no problem. been figuring out all this stuff today as well 😅
Same here. Made so much progress in a very very short time though. Super satisfied.
same, though i have to credit martin, he's been helping so much
Will be possible with the next update
Already possible actually. Just throw an exception at the end of it, like with %{throw "Done";}%.
If you're not comfortable with JS, forcing math.js to throw an exception works too. For example by accessing something that's not there, with ${x.done}$
Well, that´s possible but... not really state of the art 😅
I code in Java since Java 1. I've seen some things people use exceptions for, man. This isn't even particularly bad (though a simple stop() method would be nicer).
1? Holy moly, that's a time span 😅. I came into contact with it with V13
you should join the team and help develop CSB 👍
Well, we are always open for contributions, so feel free.
I'll send you any components I have that are working as I want them to, for sure. But I just barely started three days ago, don't know the code base that well yet.
Hello everyone, How is your day currently ? I hope it is wonderful because mine is balancing on the edge of madness...
I'm currently trying to use CSB to create a roll on a character sheet that will use a text in a Dynamic table textbox to roll what's inside.
I created a label with the formula : ${roll:=["getRefFromDynamicTable(weapon_damage_ranged_value)"]}$
I created the textbox with the roll in the same dynamic table : 4d6
I tried to change it in many ways but I can't find any manners or form that will apply the formula as intended.
I just want to roll a wha'ts inside the text box. Did I miss something ? I'm not really a hardcore IT guy, but I manage sometimes...
Please, help me.
And have a nice day my wonderful Explorators of wonders !
Hi.Is it possible to repeat a die roll as many times as the player has input?
For example, I would like to repeat "2d20+10" as many times as the user input as follows and output each number in chat.
User input: "3"
Chat: "2d20+10 -> 16+10 -> 26 , 2d20+10 -> 7+10 -> 17 , 2d20+10 -> 2+10 -> 12
Would it be better to use a script? Sorry if there is a similar question somewhere else.
Is the roll button inside or outside of the table?
If you need loops, then you'd need a Script
Button inside
Thanks, I'll give it a try.
Then ${[:sameRow('columnKey'):]}$ it is
Check the Guide in the Wiki about the Formula System if you need more explanations.
trying to make a roll message inside an item work: want it to add a value that i entered in a number field "wert" to a number field
I'm litteraly crying over my cake... THANK YOU SO MUCH !!!!
Bet it has something to do with the " "quotes
Probably. Try "AUSDAUER_current + wert1" for the third argument. Though I have no time to test it right now.
looking at this example from the wiki: setPropertyInEntity('target', 'Defense', "target.Defense * 2") that is probably the fix you need
encapsulate the last formula parameter in double quotes
nope doesnt work
How do I change the background of the character sheet?
Ausdauer is a value from the target while wert1 is a value from the source. If you take a look at the doc from setPropertyInEntity(), you'll see that there is a target.-prefix for values, which should be taken from the target and not from the source.
Provide your own CSS to accomplish that
Go to the game-settings, navigate to the CSB-Settings and check where CSS is mentioned. In there you can put the path to your file (you have to paste the path manually, the explorer will not work).
Or you use the Custom CSS module
I got the custom CSS module. All I'm trying to do is make the background of the character sheets white for now.
Do you know how CSS works? If not, try to read some online tutorials. They are better than whatever I'd tell you.
I dont understand it very well. I'll look into it.
Figured it out I think. Does this look like itll break anything?
Just try it out 😅
It's just styling, you can't break the internals of CSB with that.
Ok cool. Working how I wanted.
Thanks for suggesting that module, that's way easier to me than what I was messing with earlier lol.
i've been bashing my head against the wall for a few hours trying to get this one aspect of a userInputTemplate working. the documents say Any input field using a key already defined in the triggering actor or item will use its value as default value, but will not be saved in the actor or item.
i want to use that feature to set which radio button from the top group is selected when the input opens (group key is rollType). i've tried everything i can think of, adding the key to the triggering item and setting its value to the radio button i want, adding a variable with the same name to the roll message and doing the same, using a switch case or ternary operator to try and call one of three userInputTemplates (each one having a different value manually checked as the default), and nothing works. i'm not sure if i'm misunderstanding this functionality or just been staring at a screen too long
this is my usecase, taken from the readme:
when i change the formula to: ${ setPropertyInEntity('attached', 'AUSDAUER_current', wert1) }$ then this works, but i dont want to set an absoulte value
You should also check the examples and compare them
but why shouldnt i be able to add +1 to the value if the above code can set it to 1
The context is really important in this case. The formula is executed from an item, so by default you'll access the values from the item. But because you also need a reference from the actor, you have to tell the formula that you want to access a different context. That's why you need a target.-prefix for values, which come from the attached actor (I hope that this prefix is allowed for attached, I'm only sure about target & selected)
I can't figure out the right way to write this roll message:
${r1:=[1d12]}$ + ${r2:=(SkillTrainedAvoid? [1d4] : 0)}$ = [[${!string(r1+r2)}$]] ${r1 === 1 ? "Complication" : r1 === 12 ? "Crit Success" : ""}
That bit at the bottom, I want it to check what the D12 result was.
it rolls the dice and displays the rest correct but I cant get it to output "Complication" on a 1 or "Crit" on a 12
Use == over === so that it can be coerced if it is saved as a string.
You can also remove string(), it`s barely needed
still not working it just outputs that entire last line in the chat
If it's doing that then the system isn't recognizing your last line as a Formula, because the delimiters are not setup right (check the end).
Is there a way to get the rolls to look more like the original rolls or flare up what's there? See the two images for what I mean.
You could use your own Script, which creates the Standard-Roll-Output
Nah, just gonna tell my players I made a system, used my limited CSS to make it look pretty as I can, matching the style of the character sheets from the book, and if they wanna complain they can learn to script lol Thanks! Would not have been able to complete this project without your help.
can i put a condition inside the "true" part of another condition?
hoped this would work, but i doesnt: (inside Item Modifier)
${is_effect ? fetchFromActor('attached', "VORLAGE") > 0 ? ref('wert3')*stack : 0}$
There has to be the false part of the first condition.
Thanks for your help, worked like a charm. But now I have a follow-up question, and I would be thankful for an answer:
I implemented the dropdowns via switchCase. But if I want to work with the keys (in this example 'c,d' and 'e,f'), it will only recognize the first letter of the strings, here 'c' and 'e'. If I want to check for 'd' or 'f' in a switch, it will show nothing. For example: ${switchCase(dropdownKey, 'c', 1, 'e',2}$. It will give me the 1 if the Key is 'c' but won't show anything if the key is 'e'. Any idea?
Any errors in the console?
No, no errors were thrown
ref('wert3') is equivalent to wert3
Then provide me the full example
The dropdown I'm trying to get the keys of has the following formula:
${switchCase(field_rasse, 'rasse_mensch', 'Averländer, Hochländer, Middenländer, Nordländer, Ostmarkler, Ostländer, Reikländer, Stirländer, Talabecländer, Wiesenländer, Bretonier, Norse, Kislevite, Estalier, Tileaner, Arabiar', 'rasse_zwerg', 'Gebirgszwerg, Imperialer Zwerg, Nordzwerg', 'rasse_elf','Hochelf, Waldelf, Seeelf', 'rasse_halbling', 'Mootland Halbling, Imperialer Halbling')}$
The Label which assigns a number given a key looks like this:
${switchCase(field_kultur,'Averländer', 1,'Hochländer', 2)}$
If I select 'Averländer' it returns 1. If I select 'Hochländer' nothing is shown
But the dropdown itself is working
Liegt an den Leerzeichen.
Tatsache. Ich danke dir. Daran hatte ich gar nicht gedacht. 🤦🏻♂️
@formal goblet Ich habe nun mal Forge aus der Gleichung genommen und Foundry lokal installiert. Also an Forge liegt es anscheinend nicht, dass Felder nicht aktualisiert werden.
Auch ist mir aufgefallen, dass es einen Unterschied macht, in welcher Reihenfolge man setPropertyInEntity-Anweisungen schreibt:
Das funktioniert:
<h2>Effekt berechnen (${item.key_item_effekt_name}$)</h2> <p>Gewürfelt Dauer: ${dauer_wert:=[:item.key_item_effekt_dauer_wuerfel:]}$</p> ${#setPropertyInEntity('item', 'key_item_effekt_dauer_label', "dauer_wert")}$ <p>Gewürfelt Wert: ${effekt_wert:=[:item.key_item_effekt_wuerfel:]}$</p> ${#setPropertyInEntity('item', 'key_item_effekt_aktiver_wert_label', "effekt_wert")}$
Das funktioniert nicht:
<h2>Effekt berechnen (${item.key_item_effekt_name}$)</h2> <p>Gewürfelt Wert: ${effekt_wert:=[:item.key_item_effekt_wuerfel:]}$</p> ${#setPropertyInEntity('item', 'key_item_effekt_aktiver_wert_label', "effekt_wert")}$ <p>Gewürfelt Dauer: ${dauer_wert:=[:item.key_item_effekt_dauer_wuerfel:]}$</p> ${#setPropertyInEntity('item', 'key_item_effekt_dauer_label', "dauer_wert")}$
Anscheinend hat die Position des Ziels im Bogen einen Einfluss darauf, ob es funktioniert oder nicht.
Mach mal nen Bugreport-Ticket und schick die Templates mit.
Wo mache ich das?
Unter "Issues" neues Ticket erstellen
Ok
Ich kann keine Tickets anlegen, da ich die Rolle nicht besitze: "You're unable to run this command:
You need at least one of the server whitelist roles: Foundry Staff"
Ich poste das Thema jetzt einfach im Channel...
Auf der CSB-Homepage 😅
Hello, how would I go about making a formula that add a specific number if a specified checkbox is selected?
Any way to force labels to not split words into two rows?
is there a way to check what the name of an item's template is?
i thought it might be an accessible property of the item, but i didn't see any such property when logging the item object in console
you could define a hidden attribute
yeah, that'll be my backup. i just figured, item containers have a way to filter by template type, so there might be some way to get that info
You can get the template-id in the console. Not sure if there is a method to convert the id to the name
Is there any way to make a checkbox inside an item appear in an item container? So I can just click the box in the container without opening the item?
wie würde die syntax mit der verschachtelung dann richtig lauten? folgendes funktioniert auch nicht
${
is_effect ?
fetchFromActor('attached', "VORLAGE") == 0 ? wert3 : 0
: 0
}$
Ergebnis ist immer "NaN"
i dont know about that, but i have a hacky solution that could work for you. this is the info in the Equipped column. code for copy pasting purposes
<i class="fa-regular ${item.isEquipped ? 'fa-square-check' : 'fa-square'}$"style="color:black; background:white;"> </i>
${#setPropertyInEntity('item', 'isEquipped', "item.isEquipped ? '' : 'true'")}$
%{throw "Done";}%
replace isEquipped with the key name of your checkbox. the %{throw "Done";}% is a little hack to avoid the roll message from outputting until that functionality comes out next update.
${checkboxKey ? 1 : 0}$
Probier mal ${isEffect ? (fetchFromActor('attached', "VORLAGE", 0) == 0 ? wert3 : 0) : 0}$
I have a general question about items and templates. Are templates meant for types of items or each item? I have several different guns in my system that each have the same types of stats but just different numbers that I dont want players to be able to edit.
Templates are blueprints for specific entities (actors & items). So each actor / item includes a template.
You can create components, which are only accessible by GMs. This way, you can create Input-Components, which are only editable by GMs and Label-Components, which are by default read-only, which can be displayed to your players.
Ok, trying to wrap my head around the Items, I've made several character sheets but never used items.
So Im trying to make a bunch of weapons that all have these stats locked. Ideally I could have players just click on the damage value and it rolls their damage dice. I'm confused on if Im supposed to make a new template for each different item or one template for each item that shares the same type of properties
one template should do it, if they have the same type of properties
you're going to want to make another table, set up in a similar way, but open up the advanced configuration and select this
Actor and Item Templates act the same way. You can have multiple concrete entities referencing the same template
then, use number/text fields in that gm hidden table, and give each property a key
in your original table, make labels that reference those keys
${damage}$ for instance
i do something similar with my heritage items
The Example-project does the same with the _Spell-Template
Awesome ok I get that now
Thats what I need, having problems getting the damage dice to roll though
What´s the formula?
Im not sure what to put I just have ${WeaponDamage}$
It just outputs "3D4" but doesnt see it as dice
you're gonna need to use [] to encapsulate the roll
Awesome that fixed it thank you
Is there a way to reference the name of the item for a roll? Does it have a key?
You can acess name everywhere.
Ah I had it capitalized which wasnt working. Thank you
I'm a bit confused what the different variable mean here, are you able to break it down a bit more for me?
If it helps my goal is to make a formula that checks if a specific checkbox is checked. If it is it adds a specified variable (level bonus) to the total. If it is not checked it adds nothing to the total.
~~has something changed as to how you roll on a rollable table inside a label roll message?
I have ${[#roll_die|3d4]}$ (copied from other examples in here) and the table name is "roll_die".
all I get is an empty square thingy instead of my custom image. edit: and it always only rolls 1 die never more. the table works perfectly fine when used from the rollable table menu.
for a bit more context I have the "dice so nice" module and I can hear and see the die rolling~~
solved the problem
I have an actor template that I am using to track two opposed meta currencies. I would like the sheet initially appear a specific location relative to the lower left browser window but remain draggable. My efforts have removed the draggability. Is there a way to do this?
Not with CSB itself. You´d need your own solution.
Hi, I am having some trouble with the ref() function. I keep getting null returns. Specifically, in a label in an item container, I am trying to use a Dropdown list on an item to referance a Number field on the main character sheet. The Dropdown list keys match several Number fields on the character sheet and I am trying to display the numerical value from the number field. Any assistance would be greatly appreciated.
Oh, btw, the ref() function works fine on the character sheet when I use a static string value instead of the component key of the dropdown.
I'll give you a hint: ${ref('dropdownKey')}$ is equivalent to ${dropdownKey}$
So, I suspect that I am doing something wrong here. I have a Number Field with a component key of sk_sar. I have an item with a Dropdown List with a component key of wpn_skill. in my Item Container, I have Label with a Label text of ${ref(item.wpn_skill)}$. On a test sheet sk_sar has a value of 3, wpn_skill has an option that corralate to a value of sk_sar, and the label is displaying nothing (I assume a null return). If I add a fallback value to the ref(), I get the fallback value in the Label.
The Formula is correct. Can you show the Dropdown?
Oh, and when I change the label -> label text to remove the ref, it displays sk_sar.
Well... The comma is a delimiter, everything before and after it will be taken as is (and I literally mean everything)
So what do you have exactly between your first and second comma? 😅
Ah, there should not be a space after the comma then!
Thanks!
Exactly
I am still getting used to the whitespace rules.
I suggest to use the Custom Options origin if you don't have a formula in the dropdown
That makes sense. I was using the Formula, because I am reusing that same list in several places and it made it easy to copy and paste.
Thanks again.
Hello... I need a litte help, please... I understand I can $ { [#rolltable] }$ to make a rol in a rolable table... is there a way to roll several times in the same table with a command? something like the [: key :d6] command?
Hi ! soooo, after a bit of fiddling I seem to have encountered an issue (I'm not saying it's a system issue, just that I have an issue, probably because I didn't set up things properly ^^)
Basically, I have 4 attributes (number fields, that represent d&d like attributes), those attributes are grouped as an array with an hidden attribute keyed "Attributes", and another array that groups their name (so : Attributes : ${Key}$, ${OtherKey}$, ect.... and Attribute : ${'Key'}$, ${OtherKey}$,ect...)
On another part of the sheet, I have dropdowns lists, with Attributes as the key options and Attribute as the label options, for things like "This skill uses STR to roll"
The only problem is, those attributes (lets call them STR, DEX, INT and WIS) can be the same value based on character creation, and when it is, the dropdown keeps reverting to the first value (So let's say the attributes are STR : 4, DEX : 6, INT : 8, WIS : 8, if I chose WIS as a skill's selected attribute, any refresh of the sheet will revert it back to INT, wich on paper would still roll the same, but you'd need to remember the revert any time INT's or WIS's valu is changed so that it does use the good attribute)
Is there any workaround or fix for this ? I know the template uses a dynamic table for such attributes, but I've been avoiding to untill now for the sheet's organisation/presentation (of course if it is the intended/best practice way, I'll juste chew my wanna be sheet layout designer hat)
Your dropdown should only contain the blank keys of your attributes, not the resolved values. That is probably your issue, because the keys of your dropdown have to be unique at all times.
Hi, question. I couldn't find any info on this.
Since you can make your system of your own design, are we allowed to use CSB commercially?
If not, is there a way to prevent players from downloading the .json?
I found out that with downloading an actor's file, you get the entire template code with it...
Hey! What am I doing wrong here? value_prof does exist on the attached actor. :value_prof: doesn't seem to work either.
the code: [[8+:fetchFromActor('attached', 'value_prof', 0):]]
the roll message using it: null
roll messages are only a single set of [] brackets, maybe that
and i think they still need to be wrapped in ${}$
When I wrap in ${}$, it just returns the text itself with ${}$.
Single brackets do the same.
Though, now that you mention it, I wonder if it has to do with me using the richtext editor? or it's how the roll message is being made? hmm.
ah, yeah, i'm not sure how they interact with the richtext editor
Hi all, looking to tap the hive mind. I am working on implementing Twilight 2000 2nd edition using Custom System Builder. Right now I am working on implementing the initiative system. In Twilight 2000 a character has a fixed initiative value of 1 to 6. A turn consists of 6 phases, starting at 6 and descending down to 1. A character can act in the phase matching their initiative value, and each phase thereafter during that turn. Any suggestions on how to implement this? At the moment I am using a workaround with the "Reverse initiative" module (it adds a right-click option to duplicate a token in the initiative tracker) and manually adjusting each token's duplicate's initiative value so that it gets the correct number of actions each turn. This is a very cumbersome workaround, so I am hoping that someone has a better idea? Any suggestions are welcome.
You'd need your own implementation of initiative and combat rounds.
RTA don't allow Roll Formulas
@brittle moth you should answer that one
Hello 🙂
You are technically allowed to use CSB commercially, as long as you credit me and add a Link to the repo in your package.
The second question is more of a Foundry issue, but as far as I know, there is no built in way to prevent the backuping of characters (i.e. downloading the JSON)
Thanks, any suggestions on where to start? I have never tried that before.
You´d basically implement your own module, so check some Foundry-pages on how module-development is done.
And check if there is already an existing solution for this problem
Thanks!
Will definitely credit you and add the link!! Thank you so much!
Regarding the JSON files, I guess I'll just accept that people can get the system from me. Was already planning on putting that one out for free and since you say that there is an option for commercial use, I can probably find a way to still do that!
Thank you again!
Can anyone tell me about the Conditional Modifier List component? What it's for, why/how I want to use it, etc. I know the wiki has a large page that talks about all the components and there's even pictures, but I learn best from practical examples over essays.
Just create a Conditional Modifier List (no further configuration needed). Then go to one of your Items and create a new Modifier. The process is the same with normal modifiers, but this time you also specify the Group and the Description of the Modifier. When done, check the Conditional Modifier List again 🙂
You guys work really hard at making this 'goof-proof' don't you? 😉
Well, one of the first things you´re getting taught in university is that you have to expect everything a User is able to do. So it´s important to limit as much as needed 😅
Anyone know how to do item duration? Like temporary effects that tick down with initiative or something like that
That's currently out of CSB's reach. I think the Times Up module does that
Ohh interesting, I'll look into that. Just wondering if there was anyway that could streamline the current way I do it. Thank you
Hi ! thanks for anwsering and I'm terribly sorry for the delayed response
that does fix the selection problem~~, however now, I'm not sure how to get back the selected attribute's actual value
so basically write a formula that says "take the blank key selected in the dropdown and go find it's resolved value"
(that seems to be the point of filterValue in the "fetchFromDynamicTable" function, if I was using a dynamic table, any workaround with an array ?)
~~
EDIT : Ok, I found out ! It was just "ref(sameRow('dropdownKey')" !
can i put links to jounal entries in a Label text?
Yes, dragging them in if i remember correctly.
My bad: that works for rich text area 😅
Like this? Doesnt work either
that definitely should work
Can you Test in your System?
I mean that it works for the component Rich Text Area, not in the rich text field of a Label. Sorry for not being clear.
Anyway, try copying that text in the Roll Message field without using rich text editing
the reason I'm saying it should work is because it does work in my system and I actively use it
but also what Torlan is saying is correct. Has to be a rich text component specifically
You have to set Style to the middle one. Can not check for right Titel now.
Hey, is there a way to make a number field so a player can see it but not directly interact with it?
Oh well, looks like I'm not in good shape today...
What you posted IS a Rich Text Area component...
I cannot check my system now, but it works for me
like for making the stat total untouchable directly but have the default value be a combination of the various modifiers elsewhere
Use a Label, they cannot be edited by players.
and just tell it that lable name = the formula?
Not the name, the Label(optional) field.
ahh, so lable text (optional) is what I meant 😛
sorry lol
probably easier to do in the background with a hidden stat and have it just display that hidden stats total, that way I can reference the hidden stat for computing the bonus as well
Stupid question: have you saved the changes(the button with an arrow) after putting the value in?
That, also. Just whatever you seem fit 😉
that would be done in the label with ref(attribute) right?
I think you can just use the hidden stat key w/o ref().
ok nice, trying to finally get a sheet together for the old legend system
not OpenLegend
it's pretty basic D20 but with a few interesting twists
like the stat you use for attacking and defence can be totally different depending on class
which makes a muscle wizard hilariously entirely possible 😛
That would be a fun char to play 😜
This will be my next Wizard...if ever
yeah, it has a really cool system where every class has 3 'paths' of abilities that you just auto advance down as you level, so multi-classing is just swapping out one of those paths for another and gaining its abilities at the same rate as the one you replaced.
and similarly powerful races can be played that way by swapping out one for a racial path
Cool
plus taking a page from 4e where casters weapons can add special effects onto spells, like a flaming sword would turn a melee types attacks to fire damage, a flaming wand will suddenly make that magic missile fire damage
which means they don't really need to make a whole ton of elemental spells
just a 'this spell hits one person really hard, this one goes boom, your equipment determines the elemental effect'
or you just take brutal thee times and hit like a truck 😛
Not possible, "Error: No Form element found"
I use the middle, dialog editor, pull the Entry in and klick the bottom Save Button.
Just displays this:
What about adding $ before and after the string?
no change 😦
Oh shoot...need to check my system. I'll let you know.
im missing the "anchor" text
did you just drag and drop or did you press any key while dragging?
Just drag, I remember . But you can type in the anchor part.
any idea how I'd setup a 3.5 style multi-attack? so BAB, then BAB -5, -10, etc
just so its relatively automated
Either a macro or a user input via display message. Like the example in the wiki.
Maybe you could add a radio button group on the sheet, so players select the attack type beforehand.
yeah that's what I was thinking
My memory has more holes than it should, mind you...but maybe you have to delete a few parts from the link you obtain dragging until you get something like that on the image.
I might just loot the MM3 sheet that exists for some mechanics because... D20 system be D20 system 😛
@formal goblet can you help me out here?
OK I have a drop down list and I am trying to get it to reference another value and then fire it to anything that references the drop down
because it's just displaying the key text from the drop down
instead of the actual numerical value that should be associated with that key from elsewhere
so its just showing STRMOD instead of say, 4
${ref(dropdownKey)}$
can a macro be used in the initiative formula? I have to translate the system's pool of symbol dice into numbers and I would like to use my existing dice rolling macro to do this.
still no success. anyone have an idea why i cant link to journal notes in my rich text area?
Having a hard time figuring out Item Containers.
Not sure how to reference item properties with the columns
I was working with that yesterday. You use the label text ${item.weight}$ or whatever the property is you want to show.
Is it possible to reference the value of a characters initiative in a roll?
Thanks, I just figured that out. Now I'm stuck on the type, does it have to be a label or is there a way to reference an editable field like a number box?
Weapons have ammo that Id like to be able to change from the container rather than having to open the sheet
Custom columns in an item container can only be labels. They can only display information.
Say, is there a way to change the names of the built-in statuses in Foundry?
Or add new ones, or whatever.
I guess it's Combat Utility Belt or nothing, which has known issues with CSB. Sigh.
Core Settings Expanded
Is there a way that I could set a label to reduce its value by one when I click on it?
I have an Item container and it would nice to be able to click on the Ammo value to reduce it by one.
I htink that would need to use the setPropertyInEntity function. Never used that before, dunno if it will work in this scenario.
Hello all... Maybe you can help me with a thing I'd love to put into my sheets...
- I have an actor who has an item containter. That container, by game design, have only one item in it.
- This item has several fields inside it.
- I have a label in the actor sheet which text I need to be one field in the item in the item container.
¿Can this be done? Thanks!!!
(its kind of pre-fill the sheet when equiping a item)
Absolutely! Just give the label a component key, then reference it like usual. ${hello_world}$
Yeah I did that, I have all things with key id's... but i don´t know what to write in the label message. I tried ${ itemcontainer_key.field }$ but it gives me an error
I assume as, itemcontainer is kind of collection, I have to access to "first" element prior to that... but I can't locate how to do it
(some kind of itemcontainer[0].field or so...)
Hey CSB team! Is there a way to have a resource reset to full at the start of a combat turn? I am developing a system that uses action points for a characters abilities. Every round they should have 4 action points. I would like to set it up so abilities remove the points but at the beginning of their turn they are replenished. Is this within CSB's capabilities? I could always have it managed manually by the players but i think it would be cool to have it automatic.
Hope you find a solution... mine is a label with roll message that resets the values. It's not automatic, because everyone has to push it, but... "it's something" 😦
You´d need your own world script for that, it´s too specific for CSB
The Item Container itself is not holding the Items (Actor is the only holder). So you have 2 options:
- Use an item modifier, which sets the Label of the Actor to a specific value of the Item
- Run through the whole item-collection with a script: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Script-to-update-multiple-items
Only with a Script
- RTA has to be in "Dialog editor"-mode
- The format is something like this:
@Item[Z2xDKDVgbMyd50vq]{Verwirrung}
Thanks a lot. I didn't know where or how to search... thanks for the patience
I apologize, I had it backwards -- thought you wanted a label from the actor reflected on the item container. Here's what you can do: using the component key of the destination label (on the actor), go to the item template and add an item modifier with the same name as the label. Set the operation to =, and -- this is important -- make the value formula a function so it will automatically be copied to items that use this template.
So the item template's modifier would be something like:
Key = armor_name, Op = "=", Value formula = ${name}
Using Op =, that will set the label to the last item that was added to the list. Since you're only expecting one, that should work fine.
I did something similar to this so equipped armor would automatically add to the actor's defense bonus.
🙂 it worked!
RTA style Dialog Editor
Jornal link looks like: @UUID[JournalEntry.UdJdggqKrJuBz8vV]{My personal description}
You can drag-drop a Journal entry in to the RTA and then delete everything that not looks like above.
It worked very well with the item template modifier, like a charm
Great!
Now... I have a more difficult question...
Let's say the item I am going to equip has a list of powers, modeled with a item container (within the item I am going to equip in my actor).
So... Can I fill an item container in my character sheet (the powers list) with the equiped item "powers"? (I hope I have explained myself right)
(This is for a mecha rpg... I'd love to equip a mecha and put in the character sheet all the mecha characteristics, defined in a single mecha item, to make it easy for the characters to change mecha, :P)
Out of my depth, I'm afraid. You may have to use the script Martin mentioned earlier.
#1037072885044477962 message
yes, I am making test 🙂
Thanks a lot to all for the help, support and will to help 😄
@formal goblet Is this possible?
#1037072885044477962 message
Probably doable.
This sounds like putting items inside of items, which is currently not possible in CSB but is scheduled to be added in a future update
I realized that... I can't put an Item Container within an Item... but, well I can work around that 😉 this CSB is fascinating 🙂
Hi, is there a value that I can change in the Json file for a character sheet to specify which template should be used for it? I changed the sheets template to one that has an error on it that prevents it from opening, and I would like to force it to use a known good version of the template. Any assistance would be greatly appreciated.
It's not as easy as you think. The JSON doesn't only save the reference to the template, it saves the complete template with concrete values. That's why you actually have to find the error in the JSON-structure and fix that.
Got it, thanks!
Yeah thats done with a world Script. Should be pretty simple too. Check macro-polo Channel Pins for a Guide how to Setup a world script
That's why I'm working on my "put an Actor inside another Actor" component, because limits like that are annoying.
Current barely-working implementation, as a Foundry module: https://gitlab.com/Akjosch/csb-component-additions
What would be a Common usecase for this?
I'm using it for MechWarrior Destiny, where everyone has one Actor sheet for their character, for RPing and personal-scale combat, and at least one another for their vehicle, for 'Mech-scale combat.
They can of course switch vehicles if one gets blown up, or for various other reasons, and have more than one vehicle available. So the idea is that they can "switch out" the vehicle they are currently using by dragging and dropping one of them onto their personal character sheet, and have all the important values and rolls available from that one.
And then you can go two more levels of abstraction up, with one "Actor" representing a whole squad/lance/... of multiple of those (where you set up the composition by dragging and dropping vehicles and their pilots and gunners into the corresponding slots), and one where one "Actor" represents a whole, potentially combined-arms, company of vehicles and their crew.
In a fantasy RPG, this could be used to have a ship Actor with slots for various roles on board the ship, or a kingdom Actor for a strategic warfare, kingdom building and politics game.
Or, you know, just a "group" Actor like the newer versions of the pf2e system have.
Next goal: Look up how translation for modules in Foundry works...
That's a very similar need I have; In SMG Robotech there is personal sheet and mecha sheet (if you like) and you can change them... or have two of them in the same session (now I'm un my cyclone, now I'm in my Alpha)
Well... I wouldn't say annoying... Having CSB for free is a gift, and its function has been created with the vision of the developer. Some things can be done, some others not (I find there is a great amount of things that can be done). And of course having the feature of puting an actor inside other actor... is great and awesome too!
The limit is on Foundry's side, BTW.
Items-inside-actors is fully supported with all kinds of extra bells and whistles, items-inside-items and actors-inside-actors and actors-inside-items you have to code around.
I have a problem, I have macro that's using warpgate to "deal damage" to the tokens. It all works, but now I need to also "apply" this damage on players sheet, not only token. Any idea how to do it? I have one GM only visible checkmark for "Is player?" so it could be checking it's state to see if it should save dmg to the sheet
Applying damage to the token should be enough (and also preferred).
I think you forgot to link your tokens to the actors directly, otherwise every token will create a copy instead of using a reference (player-tokens vs. mob-tokens)
Hmmm... Could be. But if I link it, am I still able to just pull new one for each scene and it'll work, or do I need to "move them between scenes"?
Link Actor Data
When enabled, changes to the resource pools either on the base Actor or on the Token itself will reflect in the other location. These changes apply to all linked tokens in all scenes, and is best used for unique or named characters. It's not recommended to link actor data for generic creatures or types of character (such as bandits). When data is not linked, each Token will have independent resources pools and turn order tracking.
- Linked: 3 Tokens, 1 Sheet (every Token will reference the same sheet)
- Unlinked: 3 Tokens, 3 Sheets (every Token will have its own sheet)
I've encountered a weird problem. I've lifted some code from all over the place and adjusted it as needed. it works as intended but it adds an additional line to the chat windows with "undefined"
for context: label roll message > code that rolls on a table multiple times and throws all the results in a single line into the chat.
the first message is by the "player account" and the second message is by the "character" itself.
can anybody help me remove that annoying line?
here's the code:
%{ let baseMessage = "";
let sum = 0;
// loop the number of dice entered in the input box
let roll;
let baseTable=game.tables.getName('wuerfeln');
let bonusTable=game.tables.getName('erzaehl');
for (let i = 0; i < ${schnelligkeit_wert}$; i++)
{
// roll against the rollable table
roll = await baseTable.roll({async:true});
console.log(roll);
// add to the message the image of the entry and a debug of the text message
baseMessage += '<span style="position: relative; text-align: center; color: red; padding: 1px;"><img src="' + roll.results[0].data.img +'" ></span>';
sum += +roll.results[0].data.text;
}
roll = await bonusTable.roll({async:true});
console.log(roll);
// wrap the final message
let finalMessage = "Wurf auf Schnelligkeit" + "<br>" + "<div>" + baseMessage + '<img src="' + roll.results[0].data.img +'" >' + "</div>" + "<br>" + "<div font-size: 20px;>" + sum + "</div>";
// Finally send the output to the chat window.
ChatMessage.create({ content: finalMessage });}%
Your macro and the Label Roll Message are creating a Chat Message.
There will be a feature for the next update to suppress message creation from the Label Roll Message. Until then, wait for the update or suppress the creation by throwing an Exception.
how would I go about it?
// Whatever you do in the Script
// ...
throw 'Done';
I lost the roll sound but also the message, thanks!
I've downloaded an mp3 and used
AudioHelper.play({src: "worlds/dice.mp3", volume: 0.8, autoplay: true, loop: false}, true);
to play it.
let problem = "solved"; ^^
Is there a way to show the number of items in a container in a label?
Id like somehow to have it say "Weapons 3/3" and have that reflect the number of items in the contianer.
Create a Label above or under the container with the value 0. Then go to the Item Template and create a modifier, which increases the value of the Label by 1
also I was trying to figure out that setPropertyInEntity thing but im confused on how to structure it to reduce a value when i click on it.
is there a way to use setPropertyInEntity in the roll message of that label so that it reduces by 1 when clicked?
When I try it just writes it in chat
You can basically copy it...
Oh my ${}$ around it had a typo, thank you!
Is there a way to clear a dynamic table? Preferably actually clear, as opposed to setting "deleted" to "true".
You mean to delete the invisible entries instead of setting the flag? Should be doable if you edit the JSON directly.
yeah. ...u-uh, can I do that from a roll message? ahahah
I'm mostly doing this for performance concerns, but is this necessary to do?
ahh, lmao.
Does CSB cull deleted entries at any point, though?
Hi guys! Because I couldn't find it, I'm developing a sheet for Kids on Bikes in FVTT.
This is one of the tabs of the sheet, I'm using the Custom System Builder, and one function I'd like to add would be that when we select one of these "checkboxes" with a characteristic, the characteristic would be displayed in the "Main" tab, in its respective place (Strengths/Failures), as shown in the second image.
When it comes to subtemplates, there's a small paragraph about them but it doesn't really say how they're used or any examples of them. Do you just name like tables and stuff identically to what an Actor template would have?
Sorry, Case, but I didn't understand your question
Subtemplate components function in the same method as actors.
Still not sure I understand how to use them though but I'll work on figuring it out.
Do you mean in designing template, creating the item from the template, or getting the items onto the character sheet or something else?
Getting the SubTemplate into a character sheet.
Create a container on the character sheet. Select the template that will be displayed in the container (ie "_weapon template") if you want to limit the items in the container to a type. Create the item based on the template (ie sword). Drop the item on to the character sheet. It should appear in the container.
Greetings Friends and Brilliant Coders, Is there a way to Add the values of several drop down list Keys together(assuming they are numerical )? or really just any way to convert a string to a float value ?
Basically i made a potion crafting system that relies on a d100 roll. But depending on the ingredients and conditions the potion is made in adds bonuses or penalties. I'd like to have this small panel where they can select there conditions and then have the bonus calculated and then added or subtracted from the roll.
I am trying to use a macro that generates a dialog in the Roll Formula. I have not been able to resolve the following:
- Is there way to differentiate between Group NPC Initiative roll and individual initiative roll. By detecting this, I can skip the dialog for the group roll.
- The macro does not wait for the dialog before continuing. I tried
Dialog.wait()instead ofnew Dialog()but I get the errorDialog.wait(...).render is not a function. Not sure if this a CSB issue or a Foundry issue.
Does anyone have any suggestions on resolving these?
Hi nothing complex - just seekign to update an equation - basically I need to combine a few values, but I only want to add a particular value if it is less than zero (Max(sameRow('WeaponBonus'),0)
Did you try using max(sameRow('WeaponBonus'), 0)?
Alternatively, min(sameRow('WeaponBonus'), 0).
As far as I understand the Strenghts/Failures will be different for each characteristic?
And a character can have more than one characteristic?
Then I think you need a panel for each possible characteristic and via advanced setting allow their visibility via your checkboxes.
Yeah, man. I can select more than one strength and/or more than one flaw.
To explain it better, I need when I select several checkboxes in the "characteristics" tab, both strengths and flaws, they are displayed in the "main" tab either in a panel or a table.
So use the advanced configuration possibilities and set the “visibility formula” to the negate of your checkbox keys.
https://gitlab.com/custom-system-builder/custom-system-builder#3-component-library
I'll take a look, man! Thanks a lot!
I have an issue with the visibility formula... I have a Item Container with a text field (don't judge me, it has 1 or 0 to mark if something has to be visible or not)
I have a label in the item container with the boolean condition as result (to test) ${item.gear_ad6_dest==1}$, and it states "true" when the item has the text field with an 1, so right.
BUT
In the visibility formula I tried (without the ${}$)
- item.gear_ad6_dest==1
- gear_ad6_dest==1
And with any option, it doesn't show... Would you point me what am I doing wrong??
(I also tried with "1" and '1')
(and no error in the console, btw)
(tried also with a checkbox in the item... nothing 😦 It must be a silly error but can't get it)
~~Hmmm... I need to show results of rolls set by this code separately (so that 2d6 shows me 1d6 and 1d6, not result (sum) of 2d6) preferably without removing it from label it is in :/ Does anyone have any low-cost idea?
${#basicDiceRoll:=PCHealthPointsAct <= 5 ? [2d4] : PCHealthPointsAct <= 10 ? [1d6]+[1d4] : [2d6]}$
this variable is later invoked in many different rolls for damage/attack etc. for example like this:
${BasicDiceRoll+SkillModifier+AttrModifier+WeaponOnePrecission+PCWywazenieUpgrade+PCWydluzenieUpgrade+GeneralRollModifier}$
```~~
Nevermind, got that assignment in different label, and made this code way easier :3
Thanks ioplex! i'll look into it. This seems like too basic of a question for here, but i am really struggling just to have a button that takes a field and modifies another field. The documentation shows you can use a notify or setPropertyInEntity in a roll message but i cant get either to work. Is there some type of syntax to make it work?
Shouldnt ${#setPropertyInEntity('self', 'AmmoTest', 5)}$ just set my label AmmoTest to 5? it just produces a blank chat entry.
Hi, i've ran into a problem
Here is what i've got so far:
${roll:=[1d100]}$
${roll}$
${ [roll > :Current_Strength: roll == :Current_strength:]}$
What i want it to do in words is: roll 1d100, output number to chat(maybe with text), change number if its greater than :Current_Strength: to :Current_Strength: and output to chat
I'm still learning so take it with a grain of salt, but maybe something like
${roll > Current_Strength **?** Current_strength : roll}$ ?
(if roll superior to current strength, then display current strength, else display roll)
I do have a quick question myself : I'm trying to use a formula as a filtervalue in an item container, is that actually possible ? (in my case, displaying only the spells (item) with the same "school" as the character (actor)
It doesn't seem to work, but maybe I just configured something wrong
You can only change values from Input Components, so Labels are out.
If the documentation of the Item Container doesn't tell that Formulas are allowed for the Filter, then it isn't possible.
It's currently not doable for Item Containers and Dynamic Tables. This will be different in the next patch.
yeah actually now that I double check it precisely states that it can't be a formula, gotch'ya
I'll either go with creating a container for each and fiddling with the visibility formula ooooooor just check what spell I give to my players
The export/import template buttons are not working quite right for me. There are several types of items in my game, the character sheet has a different item container filtered to show each of the item types. After importing to a new game, the character sheet loses all the filtering information, so item containers are blank and the template needs to be corrected to show the right items in the right block.
Even once I've corrected the character sheet, I have a problem setting up a new game with the imported templates. I've made a "shared data" module (as per the Foundry documentation, it provides compendiums to copy to/from), I can import characters, but they lose all their information as to what template they are using. Any character that is imported generates error messages for each item ("Item template has been deleted for item xxx"). Is there something I should be doing to copy things (characters/items) from one game world to the next?
how do i adjust your code to work without the LE: prefix?
The prefix shouldn't matter. Just change it to anything you like.
when i remove it, it doesn't work
assuming it has something to do with nesting
Kind-of. It has to do with the fact that Label doesn't construct a consistent DOM hierarchy across all possible options. Anyway, adding grid-column: 2 to bar-container so it looks like this fixes it (and doesn't break anything else):
bar-container {
displaY: block;
position: relative;
background-color: rgba(127, 127, 127, 0.5);
height: 2rem;
width: 100%;
grid-column: 2;
}
You then get a (virtual) zero-width first column with no content when you have no prefix content, but that shouldn't be a problem, really.
Small syntax question concerning item containers: When setting the label of a coulumn to, for example, ${item.key}$ I get the value of the desired item component. When I do the same for an item component which is a dropdown list, I get the key instead of the value. What am I doing wrong?
When doing ${ref(item.key)}$ I only get a blank return without error in the console by the way
That is intended. It's more of a Value-Label-Map (the Label being only a visual thing) instead of a Key-Value-Map
I see, then I will rename my key values to fit my needs. Thank you!
Hey, can I change the icons and the name of the effects?
Also, in my game the initiative has no roll, it is assigned by the Agility attribute. Can I change this in CSB?
Core Settings Expanded-Module
You can define your own Initiative Formula in the Game Settings of CSB- This can also contain just a plain value
Thanks!!
Hey, I have another question. I'm using this formula in one of my item containers to fetch something from a dynamic table:
first(fetchFromDynamicTable('dt_waffen', 'waffe_wert',waffe_name,item.typ))
It works without a problem. But if I use it in another column in the same row in the same item container in a label roll message, it spits out the following error:
The third arg is missing quotes
Interesting. Why is it, that the formula does work in a normal label without quotation marks but in a roll message it doesn't? But thanks anyway!
Thank you a lot.
Hi ! me again
not a problem this time, more of a general "brainstorming" or "best practice" question on the best approach to doing what I need to do
I'm trying to make a sheet for ryuutama, and I'm now tackling the items
more specifically, the price of items in ryuutama can be altered by adding preset "traits" to them
so for example, a sword would be 700po, but you could fin a "broken" sword for only 350po (x0.5), a mithril sword for 7000 po (x10), or a broken mithril sword for 3500po (x0.5x10)
so my idea would have been to add traits within an item and somehow add their modificators in a formula
The only constraint is that every multiplicators must be applied before additions, other than that I'm just wondering how to achieve it in a user friendly manner (either creating modifier in a dynamic table and adding them all in a formula ? or having "trait" items that you put in the actual item/subtemplate ?)
(I'm leaning toward some form of the latter considering traits can have other effects on the item in addition to altering the price)
Ok, definitely some room to make it more elegant, but it works
Hello, in one of the games in which I am using Custom System Builder (Foundry v11.313, CSB v3.0.0) my dice rolling formulas have all broken. I get the following error: Cannot read properties of undefined (reading '0'). I get this error even when I build a label with a simple formula like: ${[1d6]}$
I have another game on a separate server, also running foundry v11.313 and CSB v3.0.0 that is working fine.
Any suggestions on possible causes and/or solutions would be greatly appreciated.
I have tried disabling all modules, and there was no change.
From everything I'm reading it should just be as simple as making a number field that has a Maximum Value and an attribute bar should be available to use by the system auto creating it.
The Configure Attribute Bars didn't create anything either while using formulas or static numbers
Any idea how it's not workin?
Only Module in use is the Bar Brawl
It generally works for me just fine. Did you configure maxHealth to be a number field too?
No, just tried it, but didn't do anything
maxHealth is a label that is derived from other values that change over time
health is a number field that changes by the user and the max value is maxHealth
if it matters
changing the maxHealth to a num field didnt do anything, and granting maxHealth a max value didnt do anything
Overall stumpped after 2 hours of attempts and thankful for something I didn't think of trying. Even if it didnt work
Possibly a bug, possibly an oversight in the documentation: Component's getConfigForm() docs state the following:
/**
* Get configuration form for component creation / edition
* @abstract
* @param {Object} existingComponent Basic description of the existing component to pre-fill the form
* @param {TemplateSystem} entity The entity holding the existing component
* @return {Promise<JQuery<HTMLElement>>} The jQuery element holding the component
* @throws {Error} If not implemented
*/
However, in my tests existingComponent can be null in addition to an Object. So that should either not be the case, or the parameter declaration should be @param {Object|null} existingComponent.
You're better off configuring it as a (custom) attribute bar in any case, then. There's a "Configure attribute bar" button to do so at the top of the template sheet.
Yeah attempts to do that also resulted in nothing appearing
I can't think of why it would be different than any other person so im confused on the matter. Just yesterday someone had an issue that was solved by using the max value number field method.
Maybe its a foundry system thing im in V11 Build 299
any major issues there?
(prolly going to pass out though its 2am
Did you refreshed the character sheet after making changes to the number field?
Did you tried restarting your gameworld?
How are you hosting foundry? Via Forge?
If using the “configure attribute bar” function on the template, the values will NOT be changeable via token. So no hp changes via any combat helper modules.
How I can roll the dice for specific item from HotBar? Like a spell or item for specific actor.
As I understand need wrote the macros? Because if I put item directly to HotBar, It only open window with such spell/item.
Hi,
I've got a label roll which substracts 1 arrow when the bow is used, and rolls all the related dices. Arrows are a property of the item used.
Is there a way to roll dices only item.quantityOfArrows is > 0 ? And to show or hide the HTML accordingly ?
Good day all. I have an item container with a label column, with a label icon performing an action when clicked: Reload the item ammo. Now, there are items that have no ammo. Is there a way to conceal the label icon? I tried the visibility formula but it applies to whole column not discrete cells. Is there a way to conceal a label icon in label column in an item container (Tried with formula but it appears it doesn't work in that particular field)
Untested, but something like this as the first line could work:
%{if(linkedEntity.qttMunitions < 1) { alert('No dice!'); throw 'Stop'; } return '';}%
thank you 😉
Just woke up,
Yeah, the sheets were refreshed
I have, but just restarted it again in case, but nothing changed
Hosting from Port Forwarding
I assumed the Configure attribute bar wouldn't be that good given the warnings and such, but even when using that it doesn't create any bars.
I assume something is wrong but have no idea what could be the case
Well, in doubt export the template's data, paste it on pastebin or similar, and link the paste here so we can see it in detail.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
In one of my CSB based games, dice rolls from formulas has suddenly stopped working. (Foundry v11.313, CSB V 3.0.0). Chat dice rolling works, but rolls from inside formulas do not, even very simple formulas such as ${[d6]}$. the error I get is: "Cannot read properties of undefined (reading '0')" I have disabled all modules and the problem persists. Any suggestions as to what I might look at to track this down?
At the end of the error message you also see which formula was affected. Check where that is and try to fix that.
So, I created a new character sheet template with a single Label Component. I get get the same error with this roll formula.
Huh...
And here is the full error output:
Wait, that´s not CSB. That comes from the Tokenizer-module
Oh, looks like I reenabled mods, I'll shut them all off again.
Huh, still getting Tokenizer errors with Tokenizer disabled.
Well, something goes wrong very hard which is probably not related to CSB
Ok, thanks, I'll keep working on this.
Hi again !
quick question regarding this, everything is working, except the item container label
How do I get it to show the calculated price (wich is in a label) ?
Right now it shows... nothing (I tried the key, and ref('key') like for dropdowns, always with the appropriate "item.")
(it's probably pretty obvious but just in case : "Prix" is the Price column)
Ye if anyone solves the mysterious attribute bar not being created thing lemme know, but dont want to bother anyone, so wont mention it less someone else asks additional questions or has a solution. Thankya for trying so far
What's the bar name you tried to create? Just so it's easier to search for it in the JSON export.
In this case was for Health Stamina and Mana
health / maxHealth
curStam / maxStam
curMana/ maxMana
Yes, I know, but as I explained I don't think maxHealth will work when it's a Label. It should be a numeric field entry.
Even when changed to one it doesn't work though
basically health is the numeric field entry using maxHealth as the max value
which we should be able to do since the max value can be a formula
Two ideas. The first one I know works, since I use it myself; see for example this picture:
What it does is using hidden attributes, which I then feed into custom attribute bars.
as a suggestion : at first I tried setting maxHealth in a label, didn't work because I'm not sure it's supposed to, so then I created a maxHealth Hidden Attribute, the Health has- welp
The other idea I would try if that doesn't work is to change the max value formula for health into ${str+vit+lvl+aftHp}$
Tried both and it didn't seem to work
One thing to keep in mind is that even if i try making static variables as the attribute bar through the configure attribute bars it doesnt seem to create any too.
I really dont get it
did you try setting up only this in a fresh world ?
May need to remake the world you think
Alternatively, just a new character template with just the number fields required to make a HP bar (health, str, vit, lvl and aftHp)?
Also, make aftHp a number field too for the tests.
I have no idea if or how that would be the culprit, but at least that would allow to make sure it's not something else
Also yes, it could just work with a new template instead of a whole new world
The current formula for it, ${sum(fetchFromDynamicTable('condTable','conditionValue','statType','Health','=='))}$, not only looks way more complicated than it should be, it can also easily return an error and screw everything else up.
Well with a fresh world I just made a sheet with a number field and set the max of that to 2 just to see if an attribute bar would be made, but I got nothing
Seriously, I would just make aftHp into a field modified by item conditions. CSB will then sum it all up for you automatically in the background.
I mean overall it isn't like the bar is 100% needed for what I'm doing, it just puzzles me why it isn't working as expected
Anyway, you could start debugging it by creating a new template sheet with just two number input fields: health (with the maximum set to ${maxHealth}$) and maxHealth. Then create a new character from this template and see if its token gets a health bar.
I did try that, but nothing was made
(reloaded after doing it but no new results)
If it doesn't work, your world and (in the worst case) your installation is broken and nothing we can try here will ever help you until you fix it.
That's what I'm thinking based on looking at things
Has to be a foundry issue with everything we've tried
which, weird. But seems to be the answer
As for this
if the quantity and the Prix are in the item you can make a formula multipling the two ${item.prix * item.quantity}$
This is the minimum template I could make which works, for example. You could import it if you like to see if it's still broken for you.
yeaaaaah but no but ultimately yeah
it's a bit more complex formula than just quantity*price because traits can be applied to the item (see the message I was responding to)
but yes I just put the formula directly in the item container label and added "item." everywhere and now it's working, right before I saw your message
Next I was gonna suggest the item. if it was more complicated, glad you got it handeled haha
So now a sword is 700 pieces, but a broken foul second hand mithril talking sword is 3960 pieces
as it should be
Yeah nothing on my end, so something in the system is broken for me. Which is frustrating, but is what it is
That's just cool btw
yeah it's a pretty nice rule of Ryuutama
allows for customisation and bargaining
You want a good sword but it cost too much ? try finding a broken one for half the price, then the blacksmith in the party can repair it
Course I'd assume if it was a super amazing legendary sword it would still be a task to repair it, but overall would be cheaper than buying a new one for full price
that's the spirit
on the other hand, you can buy a bunch of normal swords, and craft them to become fancy swords to sell them double price (and other stuff but that would start to derail the channel)
Try to update the Foundry-version if you're not using the latest version.
That is prolly it, but can't for some other worlds im running
Will update when I can though
Why not? You said you're already on V11 so there shouldn't be further incompatibilities by updating it
Terrified of breaking things with the updates. I run 4 different systems with too many modules. Whenever I get things to work I just wait for the modules to start telling me they need the next update but ill backup and try it
That was the solution btw
Just be updated
It does btw, because the max-value is allowed to be a derived value.
Ah well. Good to know, but I just wanted to try and eliminate all possible issues to fix Jov's problem.
After multiple hours im just glad the answer was there. Disappointed in the ease, but grateful for all the aid.
Hi something simple - is it possible to pass a value to a macro while calling it using the following syntax
/amacro "Roll-Stat" ${!Agi}$
Agi is a numberfield value
It is returning this in the chat window /amacro "Roll-Stat" 3 - which is the correct value for the number field - its not calling the macro however
The call through Chatcommands is not recommended anymore. Use the Script-Expression syntax to call macros instead.
I am hoping to use the Foundry Roll All and Roll NPCs buttons in the combat tracker for rolling initiative. I need to use the actor ID to get data from each token but it appears that only the first token in the tractor is returned when the buttons are clicked via my test macro which is only console.log(actor) which as two tokens, one assigned to a PC and one not. Are these buttons compatible with CSB?
Yeah, they work if your Initiative Formula is defined in the Game Settings
It doesnt appear to work correctly. I have a macro defined in the roll formula but when I "Roll All" in the combat tracker with the macro containing only console.log(actor), the same actor appears twice in console. I think this actor may be the last one added.
Hey! How would I do a roll in a recalculate()-ed string?
It doesn't seem to work the way I would expect. Everything works otherwise (without the roll).
omg it didn't post all three pictures :<
recalculate() does only work with CSB-Formulas. Roll Formulas are excluded.
awww
randomInt it is
You can still achieve your result if the Text Field with your calculation looks like this instead: 1d2 * ${item.value}$. Then you can just use recalculate() on the key of the Text Field and it will give you a string, which will be valid for your Roll Formula.
unfortunately, only certain attacks even use this 1d2, hahah
I would either need to add a check to see if this move needs it, or just use randomInt
Well, you can use static values in the Roll Formula as well
@formal goblet Is this something that can be resolved or is use of the "Roll All" and "Roll NPC" combat tracker button not supported? #1037072885044477962 message
I cannot reproduce your issue
My initiative formula is %{return game.macros.getName("Get id of actor").execute({source: "initiative", diceletters: ""});}% and the macro only contains console.log(actor)
Your actor-context is wrong. This will be either the selected token or the current players actor. That´s why you have to use the entity-context
You probably want to do something like this: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#334-calling-macros
Can I use if statements?
gotcha using switch instead.. cool
Thanks again, back at it for me. trying to figure this all out lol
This is excellent
how do I use this? consoleLog(dataLog : *) Its not clear on my side.
It´s just ${consoleLog(key)}$ in a Label. This will create a log entry in the console, which can be inspected. Nothing else
Is there any way to to select the second highest in an array same fuction as LARGE in excel?
Basicly, the idea is to compare a list of values, select the second highest and multiply it by another value
Is there a way to implement dragable items? By that I mean the ability to drag and drop an item from one sheet to another? Or from a sheet to the Items directory?
as a player or a gm?
Would require your own script
ok
Long shot but any help with that?
If I could get help with a shell I think I can piece the rest together
Take array, sort by property and return the 2nd one
This would require an implementation on system-level.
%{const data = ${fetchFromDynamicTable('PCF_Table', 'Skill_Rank')}$;
const SecMult = ${fetchFromDynamicTable('Variable_Table', 'Value', 'Variable', 'Secondary Multiplier')}$;
const max = Math.max(...data);
const sortedData = data.sort((a, b) => b - a);
const secondLargest = sortedData[1];
const result = (max * SecMult) + (secondLargest * SecMult);
return;}%```
Does this look right?
so I can use the above in a dynamic table and it returns nothing and messes with a whole bunch of stuff on my sheet. Example
vs
- You cannot use CSB-Functions directly in Script-Expressions.
- Your return is empty.
Would that also cause the errors on other CSB formulas?
Thanks! So, just to clarify, this would need to be coded in as a branch from CSB, as opposed to being implemented using the current version, is that correct?
Using a custom macro or script as a lable inside a dynamic table causes all my cbs formulas to error out. Either i am not doing something correctly or i am missing something.
If anyone has any macros that nest csb code or cbs code that nest scripts in that could send them to me so i can get an idea of where my error maybe that would be great. Thanks
So, I'm trying to have text only be visible if a certain box in the same row is checked (within a dynamic table). I've tried several different versions in the visibility formula line, but none seem to actually make the text show up dependently on the box. Things I believe I've tried thus far:
check
'check'
sameRow(check)
sameRow('check')
ref(sameRow(check))
ref(sameRow('check'))
Also, is it possible to use data from one dynamic table to create tooltips for items on another dynamic table? (Like for instance, if I want descriptions to show up as tooltips on for individual items chosen on a drop down box within a dynamic table). I tried earlier, but was getting error messages
OK so I want to round a number down which is easy enough with the floor command, but can anyone tell me how I would do round down to minimum of 1?
Would it be max(1,floor(num)) ?
Does anyone have a good example is a dice rolling macro I could have a look at?
The example sheet had a good example.
<th>Standard check</th>\n
</tr>\n
<tr>\n
<td>Roll</td>\n
<td>${Roll:=[1d20]}$\n<strong>${!Roll >= Crit ? '<br>Critical Success' : Roll <= Fumble ? '<br>Fumble' : ''}$</strong></td>\n
</tr>\n
<tr>\n<td>Dice Mod</td>\n
<td>${?{Modifier[number]|0}}$
</td>\n
</tr>\n<tr>\n
<td><strong>Result</strong></td>\n
<td><strong>${Roll + Modifier}$</strong></td>\n
</tr>\n
</table>"````
Try that
Is there one where we are passing in a variable from the sheet e.g. strength roll ( dice pool)
Almost working but getting undefined in the chat
Just to explain the use case here that we are trying to get for @raven tree
Roll a pool of Xd6
Give a total of the number of 1's and 6's
I wrote this macro js let roll1 = await new Roll(`${stat}d6`).evaluate({async: true}); let count = 0; let sixes = 0; let ones = 0; roll1.dice[0].results.forEach(j => { if(j.result === 6 | j.result === 1){ if(j.result === 6) sixes++; if(j.result === 1) ones++; count++ } }); await ChatMessage.create({ rolls: [roll1], type: CONST.CHAT_MESSAGE_TYPES.ROLL }); console.log(roll1.dice[0].results); await ChatMessage.create({content: ` You rolled ${count} successes. <br> ${sixes} Sixes and ${ones} Ones. `});
which is being triggered by js ${%{return game.user.name;}%}$ ${# %{return await game.macros.getName('RollStat').execute({stat: ${STR}$});}%}$
If I don't include the js ${%{return game.user.name;}%}$
the system displays
So the real question is: Is there a way to prevent the system from pushing the last message?
Or is there a better way to get the roll data within CSB to be able to count the 1's and 6's?
Hey small question:
I'm trying to modify a field in my character sheet via item modifiers set operation. The field on the sheet is a label. The modifier looks like this:
Key: field
op: =
formula: ${typ}$
where typ is an attribute of the item. Am I missing something?
Thanks
in the next update, you will be able use a setting to hide that last message. for now, you can put
%{throw "Done";}%
after you execute your macro in the roll message and it should suppress it
Fantastic. Many thanks.
@raven tree Yes, I have this tied to the stats,
<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>```
Attributes are on a dynamic table
This passes through weapon damage that is varible
<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>```
Hope that helps you out
How do I find seemingly vague errors like this? I checked all the links but they don't seem to point to a specific formula in my sheet, unless I missed a link. My sheet is (overly) complex and near complete so there is a lot of JS.
It says there's a ; too much somewhere in the formula you're executing. The ComputablePhrase reference tells you that that bit of code could not execute due to the anomalous argument, so to speak.
Thanks. My question is not what but where.
You're right and I misread, my bad.
Anyway, no additional hint at the bottom of the console message?
no, that message is everything I have.
@tired zealot How is the macro being executed? As in, are you using the label roll message? I attempted to run your code and I am just doing something wrong on my side to trigger it. My thought is that the execution is running the code that is broken up into different segments,
/Runs first
let roll1 = await new Roll(`${stat}d6`).evaluate({async: true});
let count = 0;
let sixes = 0;
let ones = 0;
roll1.dice[0].results.forEach(j => {
if(j.result === 6 | j.result === 1){
if(j.result === 6) sixes++;
if(j.result === 1) ones++;
count++
}
/Break
});
await ChatMessage.create({
rolls: [roll1],
type: CONST.CHAT_MESSAGE_TYPES.ROLL
});
console.log(roll1.dice[0].results);
await ChatMessage.create({content: ` You rolled ${count} successes. <br> ${sixes} Sixes and ${ones} Ones. `});
/break
${%{return game.user.name;}%}$
${# %{return await game.macros.getName('RollStat').execute({stat: ${STR}$});}%}$
/break
3 different different commands run through the macro even tho the execution that triggers it all of them
My thoughts is to lump them togther and then display them all at once. Please bare with me I am still learning javascript so I may butcher this code to pieces
await ChatMessage.create({
rolls: [roll1],
type: CONST.CHAT_MESSAGE_TYPES.ROLL
});
console.log(roll1.dice[0].results);
await ChatMessage.create(
{content: ` You rolled ${count} successes. <br> ${sixes} Sixes and ${ones} Ones.
`});```
Change this part to
await ChatMessage.create({
content: You rolled ${count} successes. ${sixes} Sixes and ${ones} Ones.,
rolls: [roll1],
type: CONST.CHAT_MESSAGE_TYPES.ROLL
});```
You should get 1 consistent message at that point
I see this as well that may help 7.2.1. actor.roll With the actor object, which references the current actor, you can use the roll method to trigger a chat roll. actor.roll(rollCode: string, [{ postMessage: boolean }]): ComputablePhrase rollCode is the code used with /sheetRoll postMessage: if true, will automatically post the message to the chat The ComputablePhrase object returned by the method is detailed below.
postMessage: if true, will automatically post the message to the chat
Was asking because it usually puts the error-causing formula at the bottom of the message, but if it isn't there it's no use.
What does the error pop from? Formula or...? I mean from clicking a labelroll or what? Just to understand.
Torlan, if you would like to send me you sheet I can take a look and see if I can track down the formula or issue that you maybe presented with
Thanks pal, but @latent sorrel was reporting the issue not me 😉
Sorry about that, just caught the name and was trying to help. I am at a standstill on my sheet atm. I still have to figure out scripting and I am just not that smart lol
Not a bit of a problem, mate. Not a codemaster here, anyhow if there's anything you need help with just give a knock 😉
Yep, I am the same, I am learning Javascript so I understand what is happening but dont know how to do certain things.. My use case is as followed:
I have an excel sheet that I am currently pulling apart and putting it into Foundry, most of it is straight forward but there are 3 problems so far I have run against.
- Modifying the sheet in foundry is very slow and laggy <-- I can get around this by editing the Json code directly in VS and pushing it back but testing formulas tends to be a long process
- I have fuctions like LARGE(PCF_SkillRange_Start:PCF_SkillRange_End,2) that requires it to look at the 2 largest in the array <-- figuring out the array is easy, selecting the second largest value requires code
- I cant figure out how to run the actual code/macro once it is created.. Example below, I would need to nest the values inside the script or inside the formula.. but I cant even figure out how to execute the macro such as the one posted by paul above.. It just doesnt work so I feel like I am doing it wrong..
const SecMult = ${fetchFromDynamicTable('Variable_Table', 'Value', 'Variable', 'Secondary Multiplier')}$;
const max = Math.max(...data);
const sortedData = data.sort((a, b) => b - a);
const secondLargest = sortedData[1];
const result = (max * SecMult) + (secondLargest * SecMult);
return;}%```
here is my json if you wanna have a gander
I am sure there are ways to clean it up.. at some point I want to use containers for the actual weapons and armor
which would pull the tables out of the sheet but I dont know how that works yet 100%
I also have to figure out the SL Chart, ie you roll 1x100 and consult a dynamic sheets to determine success rate.
Soo lots to do.. lol
Watch what you do with dTables and containers: getting data out if them is not exactly straightforward.
How are you putting number fields in an item container? I want to use an item container for inventory but the lack of variable quantity is a problem.
Yep, I have had some issues with reference points not calculating so it can sometimes be a fight
Have to rethink how I reference things at times
What errors do you get from the code?
Just error and it breaks my other forumlas on the sheet
I'll have a look...no promises made, though 😅
I removed all the scripting out since it didnt work and moved on. Tell me if you get lag as well opening and modifying it
If you haven't done it yet, have a look at the console meassages. Anything in those?
If anyone else knows how to put a quantity field in an Item Container please let me know!
I guess if I have to I can add qty to the item itself, but that's.... suboptimal...
Can you explain what you mean by quantities in a container?
In this example, I have a list of weapons the character is carrying. I'd like them to be able to say "2 concealed weapons" instead of have two separate instances of the same item.
If I can make this work, I can use it for general inventory -- 10 rations, 30 arrows, etc.
${item.Quantity}$
Floriak seemed to have managed it...
#1037072885044477962 message
Okay, so the quantity has to go on the item and you have to open the item to edit it.
"no" what?
Yes, I know how to get variables from the item, that's not the question.
THIS. Something like this.
Can you modify that label when dropping another item in?
Okay, look....
Here's what I would LIKE:
I open my character sheet. I open the compendium.
I drag "Ration" from the compendium to the character sheet. Now I have 1 ration.
On the item container, I set the quantity to 10 so now I have 10 rations.
Could you nest a container inside of a dynamic table
I don't think so
The error was being generated when I dropped an item into a container (which had a few buttons w/JS). I ended up creating a new container and copied over the JS which solved the problem.
I guess I'll just add the qty to the item template. Not as easy to use, but I guess it works.
I think the problem is triggering the update of the label when the 'drop item event' fires...
Might have been that something got corrupted along the way, dunno at this point.
But good to know you could solve the issue 😉
Okay, one last question... can a user reorder items in an Item Container?
Never tested, but i would say no. You can try by creating a player user and log in as that to your game.
ugh...
Would it work putting in the item a counter label and creating a modifier that increments that?
Ah no, it would not I think.
Can't verify, but... to a limited degree I think so, by having a symbol to start off the name _Items, *Weapons, ^Ammo, etc. If I'm understanding your question right.
I believe he's talking about manual reordering the items...
Oops. ok. ...but does that work to sub-group things within a big ol' pile of the same item template?
Good points I will have a play.
You mean if order is by template?
As far as I know, the container always puts new stuff at the bottom...
@tired zealot can you tell me how you execute that within the sheet? I can try and play with you code a bit as well. (I need to be taught lol)
True that
I even adjust the tag to a text field instead of a number field and it doesnt allow editing
I have different item templates for things like weapons, armour, keys, wands, scrolls... which is useful if I put a container on the "Combat Tab" but when viewing the entire backpack... would a prefix character work to Sub-Group everything?
... Could an emoji be used to be the prefix character?
⚔Katana, 🛡Scalemail, for example.
Prefix can be whatever, as far as i know. But as for sub-grouping I do not think so. Have to try, though.
Mmm... I'll be in a position to try it in about 4-5 hrs.
I dont see a way to add an icon as a prefix
Icon yes
but prefix just list out the name
unless there is a command to that I am not seeing
I'm on a Win PC so I use Windows + Period to get an OS based emoji search box.
Hi there, sorry to interrupt. Im just trying to make a condition. Essentially i just want it to categorize the result of a 2d6 roll as either Poor, good, or Excellent.
So far i've tried variations of:
${[2d6] > 10? 'Excellent!' : [2d6] < 3? 'Poor' : 'Good.'}$
But it rolls both times, when i just want it to go off of the result of a singular 2d6. Ive tried creating a label that has ${[2d6]}$ but it doesnt let me reference it. Just a little stuck, again sorry for the blunt intrusion.
ahhhh Yeah that would work since its part of the alt commands
■
things like dice-d20 wouldnt work
<table>
<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> <----------- you would use the if else command
</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>```
Something like that
Awesone, ill give it a shot thanks!
break it apart but its doable
When you set a label to Button mode, how do you define what it does?
Your basicly saying if results = this you do this
I don't want to roll, I want it to do something else. (I'm kind of assuming I can execute arbitrary JS code one way or another.)
The answer you'd get from #macro-polo would be more of a javascript'y solution worked into a macro, but they'll likely give you additional avenues to think about.
yeah I agree with Sabrecho however CSB has the custom roll fields which can take that code directly and adjust it..
${!Roll >= 10? '<br>Excellent' : Roll <= 3 Poor ? '<br>Fumble' :Good ''}$
something like that
I think I missed a ' but you get the point
What does prefixing Roll with ! do?
switchCase(DropdownKey, 'a', 1, 'b', 2, 'c', 3, 0 <-- might work as well
! normally means not equal
!= for 'not equals'
Ok, so is the ! in ${!Roll >= 10... a typo?
I think so, that would compare 10 against "not Roll", which is probably going to be "false".
When using formulas in chat-messages, you can use the Formula's result as is, without it being enclosed in the clickable
box with the explanations. This can be useful if you want to call a macro with parameters calculated from Formulas. To
do so, prefix your formula with !, for example :
/myMacro ${!target - roll}$```
Ahh okay
Oh... so in this case it's less a prefix for Roll and more a suffix for the curly braces... ${! ... }$
Thanks for clarifying that Dragius.
Dang! I need that!! /drool
Its all yours
Steal what you need
I figure share is caring, we learn from each other and steal what works
gather ideas and push forward
Actors are stored as a JSON object, right? Anybody know how to reference it in JS?
@{<actor>|<propertyKey>}
Thank you!
so actor.whatever
This worked perfect! Thank you for the help ive only been messing with CSB for about a day but this really helped me understand 🙌
No problem, I poked at it a bit trying to get things to work right for myself. I am not an expert but learning as I go
Also, a lot of the call out goes to the sample/example sheets
I looked through them and pulled and modified what worked for me
Hey @grave ether, in the example you gave above, does the actual roll go through the chat system? ... Both me and my players love seeing huge handfuls of 3d dice fly around. 😁
Hmm, perhaps I did it wrong?
Would it work if you put something like ...log(@{actor.name}....?
Your using a mod correct? Dice so nice or something similar? It does go to the chat system tho
Dice-so-Nice... yep. (With the Companion Cube addon. 😉 )
No, it still gives me that "illegal character" error. It's crashing at the @.
%{console.log(actor); return"";}%
I dont think the @ part should be on there
What are you trying to show tho
actor.hp?
No, if I do that it says "actor" is undefined.
I just want to view the whole actor's JSON.
OH
In pursuit of finding the parts I want to reference.
Export the sheet? You mean export the whole game and locate the actor in all that?
Oh, I see. Thanks.
Yep
that gives you the entire sheet
I do that to make massive edits, its just easier to work with on my side without the lag
import it back in after I make a copy of the sheet, just in case of errors
Also, I don't know if you use the text editor Notepad++ but it's got features like collapsing nested lines, code colouring, and more. It's very handy.
I havent looked at dice-so-nice with the current setup I am using but I am sure it can be intergrated
Visual Studio Code for me
I have note++ for some things but its easier to use VSC to edit since it yells at me if I miss a }{
dice-so-nice watches the chat for roll formulas, but it doesn't notice js dice numbers, leaving me with half a solution for about 5 different things.
hmmm
my guess then the solution would be to run by macro instead of directly in the lable
it might pick up at that point
I figure /roll would be what its looking for?
I would have to dig
And if you've played Portal, then yep... the dice can be skinned to look like the Companion Cube with the addon. 🙂
It is going to have to be another time. Wife is looking at me with hungry eye.... She wants food..
nope, it looks for [[2d20kh1 + blahdy-blah]] too.
ahhhh
Well
change the dice coding in the example to match the format
I think dice so nice adds in fuctionallity
so it might just work as long as you give it the format it is looking for
Cya all in a bit.
I'm actually trying to create a diceless world, so most of these complications are simply left out 😅
Alas, different issues arise, like how to define success in contested 'rolls' or how to quantify damage and similar things...
Huh. Is there a component that allows you to pick an image, like the one that's built in on each sheet?
Rich text area can contain an image of your choice, but an image picker is quite different.
Create the macro as normal. On the sheet I have a Label set up as a button with the trigger in the in the Label Roll message field. I also have a numeric field called STR. Clicking on the button passes the STR value to the macro that does the rest.
Good afternoon folks, I just recently installed CSB, but whenever I try to use it I get an error message that asks me to check the system and Foundry are up to date:
They're both up to date. Has anyone run into this or know what might cause it?
package test? 😅
The name of the world. I haven't been able to get any world running with it, and after several tries I stopped being creative with the names.
Can you check the console (F12)?
Certainly. Am I looking for something in particular?
Well, for errors
And these are all worlds and not modules?
Which version of CSB and Foundry are you using?
These are all worlds, yes. Foundry is V11 Build 313, CSB is 3.0.0
Can you close the world, go to the package manager and see if the module "Chat Commander" is installed?
Chat Commander is not installed.
Alright, install that one
...It appears I can launch it now, and it's not throwing errors. Thank you so much! Apologies, I must've missed the dependency.
I have some places I've tried to do visibility formulas based on checkboxes within the same dynamic table. These worked prior to upgrading to 3.0, but now they don't work conditionally. The visibility formula I've got is just check with nothing else there (check being the column name within the same dynamic table). I've also tried sameRow(check) and ref(sameRow(check), all with and without '' around check.
Using check should be enough, as far as I know. Cannot access my world now, but I'm pretty sure it works on it.
So, I was told previously there should be a fix incoming for the 'undefined' message when rolling a macro, any idea when that'll happen?
They worked with 2.x? I thought it never worked with Dynamic Tables and Item Containers 😅 . Well, let´s say that it´ll work with the next patch
Oh, maybe that's why it's not working then. I thought it was before, but maybe I'm remembering wrong, lol
Uh, the undefined-message is completely normal if your Script does not return anything. What you probably mean is the feature to suppress Chat Message generation in Label Roll Messages. This will come with the next patch (already implemented)
Good to know though, I'll table doing that for now
Yeah because my script generates its roll, but every time before it does that it returns an 'undefined' message
Because every Label Roll Message generates a Chat Message on its own.
Is there any way we can get some type of active console to push code to see if it resolves? Prolly not possible but figured i would ask
Idk about you but i get LOTS of lag when editing a sheet saving and the pulling a character up and refreshing
I don´t know what you mean?
An active console to basicly put formula in and see if it resolves without going through the process of saving it to the sheet.
Kinda like an active console.log
Another small question:
I'm trying to modify a field in my character sheet via item modifiers set operation. The field on the sheet is a label. The modifier looks like this:
Key: field
op: =
formula: ${typ}$
where typ is an attribute of the item. It does nothing and the console does not throw any errors. Am I missing something?
ComputablePhase.computeMessageStatic(expression, props).result is probably what you´re seeking.
Ok so how do i get that implemented or do i run that in chat?
Speak to me like i am 10 lol
You run that in the console. E.g. ComputablePhrase.computeMessageStatic('${Strength}$', game.actors.getName('Little Ghost').system.props).result would return the current value of Strength of the actor Little Ghost.
Did you also define a priority?
Thanks i will give it a try here in about 30 or so mins
Yes, I tried it with 0 and 1
0 should be enough. Alright, then present the whole setup you have
This is the label I want to change when the Item is attached to the actor
the last modifier is the one in question
Try to assign a random default value to the Label
This is the attribute of the Item I want to assign
Okay, I'll try
Ah, now it is working. Thank you!
Does CSB suport Item nesting? For example, I would like to make a Gun Item, and a magazine item. I would like the gun item to have an item container that holds one or more magazines. When I tried this, however after dragging a magazine item onto a gun, the magazine did not show up on the gun. Is that expected behavior or did I do something wrong?
I'm looking to add more support for Item Piles in CSB, but there's nary an API get item types and their properties
Is there any way to get properties of CSB's custom item types?
There´s simply no support for that currently. It will be added in a future release.
There should be props for every Item (excluding templates), so I don´t know why template is null and why props is empty.
Ok, cool, thanks! Glad I was not doing it wrong.
sorry, I was busy today, it seems people anwsered, but just to clarify the screen : those are labels that read what's in the item, the white box around the numbers is just cosmetic with a bit of ccs, I use what the others described : number field in the template, i create items with basic stats, when dragged into a sheet it creates a copy that you can then modify by opening the item
I see, thanks.
is there a way to tell custom system builder if sometime comes back as 0 to use an alternate roll?
Can i please get some help on how to use functions in the Roll portion of a Label? I am reading the documentation but I seem to be missing something. I created a label and added this to the Label Roll message: ${setPropertyInEntity('TestCharacter', 'AmmoCountPrimary', 5)}$. I do not update AmmoCountPrimary, i only post 5 to the chat. what am i doing wrong?
Try using self instead of the actor name. Does it work?
Is there a way that i can have a dropdown effect multiple things?
like this system has simply none, light or heavy armor
heavy armor gives +2 AC but -1 to reflex saves
Not that I know of, but you could set up a second dropdown, or label even, controlled by the first one
I mean yeah, if I need a hidden modifier to do it, not an issue
I have all the other parts setup to accept the relevant imput
so if there is a way I can do 'if (the dropdown) equals X then throw this number out'
Sure. You can do like ${dropdownKey==val?mod1:mod2}$ if keys are numbers or ${equalText(dropdownKey,'key')?mod1:mod2}$ if keys are text.
Yep, a little bit of an overshoot but not wrong 😉
hmm, OK, also how would I setup a roll where I enter the dice formula elsewhere, say in a text entry on the sheet
since just referencing that key does not roll, it just shows 1d6 in the chat without rolling it
This should work:
${[:textEntry:d6]}$ (copied from the wiki and adapted to the case at hand 😉).
ahh OK, I mean I have the full damage roll in the other entry