#Custom System Builder
1 messages · Page 3 of 1
I hope the "modify the values on the item" can be turned off so if multiple characters have the same item, they can use their own values in their own inventory. Ammo being the use case in mind.
That's not a problem because items get copied when dragged on an actor (so every character would work on its own item).
That now works perfectly, thank you!
With that i have an alpha version of a Palladium Rifts character sheet which needs significant play testing!
Thanks to everyone who put this system together, it's allowed me to get where i needed to be.
@formal goblet i have a problem with a macro i hope you might be able to assist with.
Im trying to call a lable for a value from an actor but im not able to figure out the path to it 🙂
Hey guys, I was wondering if inventories (weight) worked with item container the same way they do for dynamic tables. If yes, can you pls send me an existing example of it?
Is there someone that can tell me the path to this part of the sheet for a macro ? What i want is in the Panel Dexterity 🙂
run game.actors.name('ActorName') in the console. It should contain enough information about the data structure
might be doing it wrong but im just getting is not a function.
ok, try only this then:
finding something. If i would add like dex to a roll i would path it to the template and not the token right ?
uhhhh, it should be actor data in the end, I think?
are you able to narrow it down a bit there is a lot to look at 🙂
The main data is under actor.system.props. But you have to get the right actor before (with a static name, from a target / selection, etc...)
And I can recommend "Hinkik & A Himitsu - Realms", feels a bit like from Feint if you know what I mean 😇
this is the path that i am useing.
OBS. selectedActor is defeind 🙂
${selectedActor.value.system.props.dexterity_mod}`
Might also fit
is that a system or ?
D&B 😅
sadly dont work tho. It cant define / read system
Are you trying it from a formula?
// Roll the Attack!
callback: async () => {
console.log(token.actor.getRollData())
let newRollString = `1d20 + ${selectedActor.value.system.props.dexterity_mod}`
console.log(newRollString)
let roll = await new Roll(newRollString).roll()
let result = roll.total
console.log(result);
}
},
close: {
label: "Close"
}
}
}).render(true);
}
ok, that´s definitely a macro
This is what I did to get the right data (part of the system code):
getPropertyDataFromActor: (actorName, formula, fallbackValue = null) => {
formula = formula.replaceAll('"', ' ');
formula = '${' + formula + '}$';
let actor;
switch (actorName) {
case 'selected':
actor = canvas.tokens.controlled[0]?.actor ?? game.user.character;
break;
case 'target':
actor = game.user.targets.values().next().value?.actor;
break;
case 'attached':
actor = parentActor;
break;
default:
actor = game.actors.filter((e) => e.name === actorName)[0];
}
// If actor was found
if (actor) {
let actorProps = actor.system.props;
let returnValue = getNumberCastValue(new ComputablePhrase(formula).computeStatic(actorProps));
return returnValue ?? fallbackValue ?? defaultValue;
}
return fallbackValue ?? defaultValue;
}
so i understand my code since i have gotten alot of help from the comunity here and help from YT. But what you just wrote i dont undertand at all 😄
Well, this one is part of a new feature and not really a macro 😅 https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/main/README_BETA.md#428-getpropertydatafromactor
A working example from the console (with a selected token):
new ComputablePhrase('${Dexterity}$').computeStatic(canvas.tokens.controlled[0]?.actor.system.props)
its the ref that you are thinking off right 🙂
btw, not knowing "Feint" is a sin when I see you hearing music from artists like "Voicians", "Telomic", "Bert H", "SQL", "Koven", "T & Sugah" and so on 😂
haha 🙂 Im just chilling atm more focused on trying to make this work. Have been baning my head against a wall for 2 weeks 😄
@formal goblet Thank you so much for the help ❤️ I HAVE FOUND IT!!!!!
I can now get on with the project to make a roll with a macro useing this awsome system ❤️
Glad I could help. But why do you need a macro for a roll?
i was trying to do it with items but somehow i dont understand how to make an item or a spell make a callback to the actors sheet who is haveing that item or spell.
So i am not able to make a 1d20+dex
So the roll would be performed from an Item?
Yes since the system i am doing is completly custom and is useing alot of items / spells to have diffrent rolls and stuff 🙂
Well, this would also be doable with the new feature... You´re just a bit too early 😅
Do you just wanna make me cry ..... 🙂
I also spend hours to implement this, you´re not the only one 🥲
And LinkedFluuush is a monster, implementing drag & drop-functionality as it was nothing 🥲
up 😅
well cant wait to see what you guys are able to do with this 🙂
Are you up for another headic :p
would love to help but i dont have a clue what you are reffering to... sry m8 🙂
ah yeah, there was something, oops 🤣 . Item Containers work a bit different. Instead of using fetchFromDynamicTable(), you use Item Modifiers to modify a Label containing your weight.
Item Modifiers are on every Item (not Item Template). Check this chat for more details: #1037072885044477962 message
I see thanks Imma give it a try
also I have this very weird error cause it does not seem that any of my variables in my character sheet starts with a $
Uncaught (in promise) Error: Field names cannot begin with the $ character
at checkKey (opt/foundryvtt/node_modules/nedb/lib/model.js:32:11)
at opt/foundryvtt/node_modules/nedb/lib/model.js:54:7
at Array.forEach (<anonymous>)
at checkObject (opt/foundryvtt/node_modules/nedb/lib/model.js:53:22)
at opt/foundryvtt/node_modules/nedb/lib/model.js:55:7
at Array.forEach (<anonymous>)
at checkObject (opt/foundryvtt/node_modules/nedb/lib/model.js:53:22)
at opt/foundryvtt/node_modules/nedb/lib/model.js:55:7
at Array.forEach (<anonymous>)
at checkObject (opt/foundryvtt/node_modules/nedb/lib/model.js:53:22)
Interesting. Enable log-level: verbose and check at which computation it fails.
I know there's a way to add a minimum role and permission level to view a component. But is there a way to allow a player to view a component but not edit it? Specifically Rich Text Areas, in my case.
Nope, currently no read-only fields.
Although... Custom-CSS?
That's beyond me, sadly. Unless you can provide the code I would need to input?
Uncaught (in promise) Error: Field names cannot begin with the $ character
at checkKey (opt/foundryvtt/node_modules/nedb/lib/model.js:32:11)
at opt/foundryvtt/node_modules/nedb/lib/model.js:54:7
at Array.forEach (<anonymous>)
at checkObject (opt/foundryvtt/node_modules/nedb/lib/model.js:53:22)
at opt/foundryvtt/node_modules/nedb/lib/model.js:55:7
at Array.forEach (<anonymous>)
at checkObject (opt/foundryvtt/node_modules/nedb/lib/model.js:53:22)
at opt/foundryvtt/node_modules/nedb/lib/model.js:55:7
at Array.forEach (<anonymous>)
at checkObject (opt/foundryvtt/node_modules/nedb/lib/model.js:53:22)
_handleError @ foundry.js:2913
(anonymous) @ foundry.js:2897
value @ socket.js:309
value @ socket.js:239
x.emit @ index.mjs:136
value @ manager.js:200
x.emit @ index.mjs:136
value @ index.js:119
value @ manager.js:192
x.emit @ index.mjs:136
value @ socket.js:323
x.emit @ index.mjs:136
value @ transport.js:104
value @ transport.js:97
ws.onmessage @ websocket.js:79
Promise.then (async)
reloadTemplate @ actor.js:590
(anonymous) @ template-sheet.js:131
yes @ template-sheet.js:130
callback @ foundry.js:56465
button.callback @ foundry.js:56516
submit @ foundry.js:56403
_onClickButton @ foundry.js:56332
dispatch @ jquery.min.js:2
y.handle @ jquery.min.js:
Doesn´t help. You need the white message above the error
this is all what I can see
nvm, it´s html 😅
This is the error message above, it's in red tho
Field names cannot begin with the $ character
fetch @ foundry.js:59187
notify @ foundry.js:59114
error @ foundry.js:59150
_handleError @ foundry.js:2915
(anonymous) @ foundry.js:2897
value @ socket.js:309
value @ socket.js:239
x.emit @ index.mjs:136
value @ manager.js:200
x.emit @ index.mjs:136
value @ index.js:119
value @ manager.js:192
x.emit @ index.mjs:136
value @ socket.js:323
x.emit @ index.mjs:136
value @ transport.js:104
value @ transport.js:97
ws.onmessage @ websocket.js:79
Okay. Thanks again.
I mean these ones:
You see which keys are getting computed before the error occurs
In this case my result key has an error.
Weird I don't see it... would it be easier if I filter only by Verbose ?
it is on
Huh, this is a tricky one
isn't 😂
I don´t even know where to look further besides in the JSON
When I try to look for a "key":"$ there is no result
which means that, theoretically, there is no key starting with $
if I'm not wrong
Theoretically yes.
I mean, so far, it's just a warning, but it doesn't seem to prevent me from doing anything
it's very weird tho
Actually, the keys from hidden attributes are named name instead of key
really? cause it only works when there is no space
I mean for the key-part
Atleast what I figured out with VS-Code
Although, my code is autoformatted......
Like I said, mine is autoformatted, so it´s my fault 😅
hahah I see 😅
Actually I figured out something, the error only happens when I reload a one specific sheet
but not with the others, so it should be something hidden inside this character sheet
I'm gonna scan this real quick, I should be able to find it, If not I'll come back to you guys later
anyway thanks a lot for your time Martin !
I do what I can
Is it possible to use a put referenced data within a roll message without it appearing like this?
I want it to appear as plain text (like, without the rectangle that can be clicked in the chat). Also, the "Effect Tab" manifests as a small, thin, vertical rectangle because it's a Rich Text type of object.
How would I change the text color in a field? I have a custom theme that changes everything to super dark (I have migraine issues that require ultra-dark UIs) and I was able to set the color of all other text, but not the ones in text/number fields.
I couldn't find anything in the CSS files that obviously referred to the color of this text (or any text).
Someting like: <p>${!item.name}$</p>
?
But then you can not klick it anymore.
Is the Effect Tab empty?
It's not empty. The Effect is an RTF object that contains the shown paragraph. It just looks weird like that for some reason.
I see…actually there should be also a box around the rtf text...
Can you please show us the content of this RTF field?
Try the above solution if this is what you wanted.
This one is a more complete image:
I meant just the input of this rich text area.
Are you using HTML inside?
Hey actually, does anyone know how to hide an empty result in a chat message? Like if a message for a roll has an empty field or something, so instead it can just not show anything at all.
Nothing like that at all. Just text.
Hmm…this small box is not showing up on my side if I print my RFT fields…
Anyway, try the above ${!
The ! will hide the box at last for your first issue and maybe even for the rtf field.
That did the trick. Thanks!
So if I have a hidden attribute that calculates number of dice (nodice) and another that calculates type of dice (dicetype), with dice type being either d20kh or d20kl. How can I combine them into making a roll?
Ok, solved it.
${roll:=[:nodice::dicetype:]}$
hello,
is it possible to let the player make a roll with a manual modifier?
for example the player rolls a d20 and before the roll he gets a windows asking him of any modifiers?
edit: by clicking on a label
and another Question: i have a rollmessage with ${Name_FGEW1}$, to display the name of a Talent in a Textfield. Can i make it more pretty, so it wont have the border of a roll if displayed to chat? i think i have seen something on reddit, but couldnt find it again. Something like value:Name_FGEW1
Has any CSB setup ever been released as a full add-on module? Is that possible?
it is possible
Basically what I'm wondering is if I could stick all the Templates into compendiums instead of using the "Export/Import templates JSON" buttons.
(obviously I also want to put a bunch of non-template stuff into compendiums as well.
Okay. I'll explore this idea and see if I can flesh it out. It would definitely be nice to define dependencies on modules that are needed, etc.
Thanks for that link! I'm bookmarking that. lol. I've made modules by hand before, but this is definitely a fun way to get a stub to start from!
A little ignorance speaking here, but how do I change the unit of measurement in CSB?
It has nothing to do with the system, you change the scale and unit of the grid in the scene's grid setting.
OH
So, I have a question. If an item has a set penalty to a specific skill, how do I check that value of the item, if it is equipped on the character, when I parse the roll to to output?
Example: Plate Armor - 5 to Sneaking, when rolling Sneaking skill, how do I fetch that -5 value from the item on the character?
It works to fetch it within the item container, with item.sneakingmod. But not outside it.
Oooh. Looks like someone already did release a CSB powered system as an add-on module: https://github.com/Nnayl/brigandyne2e-csb-sheets
Super helpful!
@vivid ice shoutout ^
You don´t fetch it, you set it with an Item Modifier: https://gitlab.com/custom-system-builder/custom-system-builder/#52-item-modifiers
Yes, and it is set in the item. However, I can not call upon it for a skill roll outside the item container.
It will automatically change the value in a Label if the Item Modifier is set up right.
Use ! if you don´t want the border: ${!Name_FGEW1}$
Open the Item (not Item Template) and click on Configure item modifiers
Hmm, so the values etc I have added on each object through the template is meaningless?
thank you very much, i was on the site, but missed this part 😄
is it possible to add all the Values from the Number Fields in a dynamic table?
Yep: ${sum(fetchFromDynamicTable(TableKey, ColumnKey))}$
just had a major problem if anyone can help
I cannot open my actors sheets
I tried making a new actor and the sheet won't reload to look like my sheet template
I checked the console and when I click on an actor I get this
TypeError: An error occurred while rendering CharacterSheet 38. text.includes is not a function
[Detected 2 packages: pdfoundry, system:custom-system-builder]
Ok I figured it out, I had some modules that were not compatible which were messing with things, and turning them off fixed the problem
You can use them as value formula in the item modifiers.
But if you want to use them for rolls on the character sheet you have to set labels on the character with the same key as the item modifiers an than use this label to modify your rolls.
On my sheet I have to us this more than 200 times…
is it possible to easy move a table or smth like this? i have the issue, that i started creating the table and after i realised, that i cant fit the other things on the same page. so i want to create a tabbed panel and have the table in one of them. But i dont know how to put the table into the tabed panel. Do i need to make the wohle table again? i was thinking about copying the part from the json file, but i am not sure i can find it and put it in the right place withour breaking the whole sheat.
Additionally i just read the part about subtemplates. Do i understand that right, that i can make the table as a subtemplate and just drag and drop it where i need it? That would be pretty awesome, because then i can make all the needed Data in Subtemplates and can easily make another Design for my sheat without doing everything completly new.
Ah okay, I will check later for system updates and try to drag and drop 🙂 thanks again 🙂
afternoon everyone. Can someone help me understand how to process an array in a label field? For example, I know you can get the items in a column from a dynamic table, but how does one loop through those items? Immediate use case is to sum a column of numbers; but I can see places where I might want to process all the items in a table individually.
It is now ! Version 2.2.0 just released :p
evening everyone. Can someone help me understand how to process an array in a label field? For example, I know you can get the items in a column from a dynamic table, but how does one loop through those items? Immediate use case is to sum a column of numbers; but I can see places where I might want to process all the items in a table individually.
Custom System Builder has been suprisingly helpful for quickly throwing together a sheet for a system I found which currently lacks Foundry support!
However, I have a question.
How do I add 5e style attacks as a button in the sheet?
you know, 1d20+modifier+proficency modifer
and how do I add them to a dynamic table?
I
I've been downloading sheets from the repository and reverse engineering the items I want. Have you seen these? https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library
do you know how to set true of false a checkbox with a Item Modifier formula ?
not me, if you find out let me know.
I am trying to figure out how to make the sheet roll off of something put into a text box.
like if I put in 2d6+3 it will roll that when I press a button
${:textField:}$
I tried that
${[:damage_box:]}$
with damage_box being the textbox with the die in it
CSB doesn´t support loops at all (for, foreach, streams, etc...), you have to use functions from the math.js-lib, which can process arrays.
Thanks.
Do you have any links to examples of using math.js-lib to process an array?
https://mathjs.org/docs/reference/functions.html Just a few functions, which can have a matrix as input
Math.js is an extensive math library for JavaScript and Node.js. It features big numbers, complex numbers, matrices, units, and a flexible expression parser.
thanks again! Hope your saturday is amazing.
ok, any errors in the console, when you try to roll? (press F12)
Formula.js:723 Uncaught (in promise) Error: Uncomputable token end at Function.math.SymbolNode.onUndefinedSymbol (Formula.js:723) at math.js:26377 at math.js:26118 at Object.evaluate (math.js:24162) at r.evaluate (math.js:24139) at Formula.computeStatic (Formula.js:728) at Formula.compute (Formula.js:292) at ComputablePhrase.compute (ComputablePhrase.js:128) at HTMLAnchorElement.<anonymous> (Label.js:247) at HTMLAnchorElement.dispatch (jquery.min.js:2) UncomputableError @ errors.js:13 math.SymbolNode.onUndefinedSymbol @ Formula.js:723 (anonymous) @ math.js:26377 (anonymous) @ math.js:26118 evaluate @ math.js:24162 r.evaluate @ math.js:24139 computeStatic @ Formula.js:728 compute @ Formula.js:292 compute @ ComputablePhrase.js:128 (anonymous) @ Label.js:247 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 async function (async) (anonymous) @ Label.js:247 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2
alright, for shits and giggles, I rewrote this: ${[:damage_box:]}$ and now it works as intended
I guess there were some spaces gunking things up
One of my PCs is a summoner, and he wants the ability to toss his summons (as tokens) onto the board himself. Is there any way to allow this?
Sure, grant him Create New Tokens permission (in the core permission config screen) and Owner on the actors.
Awesome, thank you very much @undone smelt.
hello, i need a little bit help with the conditions:
i have a dynamic table and in the dynamic table a dropdown "Hand_WF". i want to have a specific value (in this Case "Schaden_Ges_ArmL" (Numeric)) based on the choice in the Dropdownlist Hand_WF. "WF_L" is a key of the dropdown. So i want this:
if Hand_WF the option WF_L, then Schaden = Schaden_Ges_ArmL
This is my try so far:
${Schaden:=[sameRow('Hand_WF')=='WF_L'?'Schaden_Ges_ArmL' : 'Schaden_Ges_ArmL'+'Schaden_Ges_ArmR']}$
${floor(sameRow('Punkte_WF',0)/10)-'Abzug_RS'-'Schaden'}$
Hand_WF - key of the dropdown in the dynamic table (Strings)
Schaden_Ges_ArmL - key of a value in a different table (Numeric)
Punkte_WF - key of a value in the dynamic table (Numeric)
Abzug_RS - key of a value in another Table (Numeric)
Ich versuchs mal, ein wenig umzustrukturieren:
${Schaden:= equalText(sameRow('Hand_WF'), 'WF_L') ? Schaden_Ges_ArmL : Schaden_Ges_ArmR}$
${floor(sameRow('Punkte_WF', 0) / 10) - Abzug_RS - Schaden}$
Having a bit of an issue
Didn't change anything, system was working yesterday
then today all my character sheets are blank with "owned items" in the upper left hand corner
anyone have any idea what happened?
Funktioniert gut 🙂 ich hab alles mögliche ausprobiert, dass er den string annimmt, wusste nicht, dass es equalText gibt 🙂 Danke vielmals
Ja, string-comparison funktioniert nicht mit dem Gleichheits-Operator 😅
That's unusual... Any errors in the console?
it says its rendering my sheet
I also can't reload them or add to them
this is my template atm
Huh. Restart?
I tried that...
not sure if its a compatibility issue, but it was working like 8 hours ago without issue
I haven't installed any new modules or anything
I am using Forge, not sure if its on their end or something
There was a system update yesterday, but it shouldn't break the template.
thought it may be world size or something, but I'm pretty new and its 6mb which doesn't seem huge
Are you able to create a new template?
No, it brings up the same thing
Ok, now it gets complicated...
that's concerning
Try to create a new world and see if the problem is still there.
What is the foundry and system version?
I'm updated to foundry 10.291 and I updated custom system builder yesterday
to 2.2.0
The New World loaded very slowly and is very slow. When I made a template it eventually appeared in my actors, but when I click it nothing happens, no sheet comes up
in the console, I see no errors
though there does seem to be connection issues
I think there's something wrong with Forge
yeah, I think that'd be the most likely situation
it gets stranger
so I turned off the server and waited a bit, then went back in
the chat is now black and the character sheets have changed
things have returned but..... its a little odd
Looks interesting 😅
but I think that confirms its forge
Next question from me 🙂
i have my dynamic table. i have a checkbox (Checkbox_WF), to mark, if it is equipped.
Now i have a value (Wert_WF) (also in my Dynamic table)
A Person can equip two items. The Bonus a person gets is Wert_WF-10 for each Weapon
So i need a roll message looking for the checked items, roll 2d10 and and add Wert_WF-10 for every checked item
${sum(fetchFromDynamicTable(TableKey, 'Wert_WF', 'Checkbox_WF', true))}$
ah, da ist mein Fehler, ich hab durch die conditions eingetragen 'Checked' 😄
Auch gut 😂
evening all. I have a question about item containers. Can you access the attribute data from the item without adding it as a column in the item container? I'd really like to be able to access the attributes without cluttering up my character sheet. Any ideas?
The only other way is with Item Modifiers (if you need the data outside of the Item Container).
you have to do that for every base item you create every time?
BTW, thanks for always being so helpful. You rock!
Yeah, that is the unfortunate thing. You can avoid this by duplicating existing items
That could work. as an alternative, is there a way to hide the columns in the item container, so they are there but not visible?
You can delete the column if you don't need it. Otherwise... maybe you can do it in the advanced settings of the Label.
Thanks for your help. You give me much to ponder on.
How do I get something like this: ${[:damage_box:]}$ to work in a dymanic table.
The idea is that I can put a die roll into the damage_box and cause it to roll when I press the button.
I have been trying to reverse engineer it from other people's work, but man, the examples people made are inscrutable to me.
i am not sure, i understand what you want.
i you want to refer to a key in the same dynamic table you can access the key by sameRow('component key')
for example: ${[1d:sameRow('Damage_box']):}$
If Damage_box is '10' it will roll 1d10
for what I want, I want the ability to put '2d6' into a box and press Attack and it rolls the to hit and damage
and the ability to turn that 2d6 into 4d4, or 3d10+4, or 9d99-69 or whatever
but your example seems like it could do that with a bit of tweaking
I will give it a try, and thanks for answering!
if i understand right, you can do something like this:
Dynamic table:
1 Column for the Number of dices, 1 Column for the Dice, 1 Column for the modifier
Then the field for the roll with
${[:sameRow('Dice_Number'):d:sameRow('Dice_Value'):+:sameRow('Modifier'):]}$
that works, thanks!
a bit clunky, but better then nothing
I wish I understood what code magic people did to make their damage rolls fit into one box
i mean, you can make this with user input too, then you dont need a dynamic table
?{<varName>|<defaultValue>}
@formal goblet hast du eine gute Idee, wie ich ein Zauberbuch umsetzen kann?
Das würfeln selbst wird nur durch die Fertigkeit gemacht, unabhängig vom Zauber.
Ich kann einen Item Container nehmen und die Zauber erstellen, das funktioniert an sich gut, allerdings hätte ich gerne noch ein Text Field oder ähnliches.
Alternativ ginge natürlich auch eine Dynamic table, allerdings wird das dann schwierig mit der Masse an Informationen und der Beschreibung.
that would require them to write it every time they use the button. The goal is that the number can be written down once, and it persists until it gets changed again.
unless the user input stays?
nope, the user input is everytime you click on the roll
Musst mir genauer erklären, was du erreichen willst 😅
Ok, ich hab eine Idee, ich frag einfach Mal, da ich nicht am PC bin:
In item Container kann ich nur weitere Labels hinzufügen. Kann ich hier auf die Werte des Items zurückgreifen? Z.b. mit item.zauber_stufe, sodass mir in der gleichen Zeile, in der das Item liegt (und im Item die Stufe unter zauber_stufe gespeichert ist) anzeigen zu lassen?
Evtl. Dann auch eine Roll message machen und auf Item. Werte und normale Werte vom Bogen zurückgreifen?
Ja, das geht. Innerhalb des Containers kannst du problemlos auf Item-Werte zugreifen
Muss ich hier auch etwas beachten wie in der dynamic table mit sameRow oder sowas?
Ne, bezieht sich automatisch auf dieselbe Zeile
friends help! i moved large section (with skills lists) on character sheet wanted to put it into a tab. and it disapered! I can still reference values in it. so i hope there is a chance to get it back. As for how it happened i dont know, few fields didnt had a problem, and bam the one to do me most damage did disapear
Ich benutze dafür ein Rich Text Area mit Style „Dialog editor“ damit sich die Spieler durch Links zu Journal Einträgen oder via „PDF Pager“ Modul zum PDF Systemregelwerk ihr Zauberbuch selbst erstellen/editieren können.
Würde natürlich vieles vereinfachen.
Aber ich hab vorher noch eine andere Idee:
Kann ich bei einem wurf auch ein Makro aktivieren?
Die Idee wäre ein Item zu erstellen, ein Makro für das Item machen und beim Wurf im Charakterbogen im Item Container das Makro auszuführen um bspw. Mit Sequencer Animationen hinzuzufügen
edit: solved - habs gefunden im Chatverlauf, danke an TwistedDM
Module Adcanved Macros und dann über /amacro
I have an issue where I cannot delete tabs
it pops up an error
Uncaught (in promise) TypeError: undefined. this.parent.deleteComponent is not a function [Detected 1 package: system:custom-system-builder] at Tab.delete (systems/custom-system-builder/module/sheets/components/Component.js:407) at HTMLAnchorElement.<anonymous> (systems/custom-system-builder/module/sheets/components/TabbedPanel.js:221) at HTMLAnchorElement.dispatch (jquery.min.js:2) at HTMLAnchorElement.y.handle (jquery.min.js:2)
anyone knows how to get the Boss Bar module to work with a Custom Sheet?
I need to be able to get current and maximum hitpoints
you can set up the current and max HP in the configs of the Boss Bar.
You need the correct Data Path.
Unfortunetly i dont know the path 😄
edit: Doch nicht ganz 😄
Wie kann ich das Macro im Item Abspeichern (mit /amacro) und dann auf dem Charabogen über den ItemContainer den Text dartellen, sodass das Macro abgespielt wird?
und wie kann ich das ganze mit der Label Roll Messge verknüpfen?
Alternativ muss ich die Rollmessage im Makro neu machen, aber dann muss ich immer noch das Makro vom Charabogen aus starten, welches im item hinterlegt ist
edit: Hat sich wieder erledigt 😄
${!item.Sequencer_Macro}$ war die Lösung, wobei im Item unter dem Key Sequencer_Macro das entsprechende Macro mit /amacro hinterlegt ist
How can i make different Item Containers?
i have two Item Containers and each with a different key, but both Containers have the same Items. I can only make different labels
You can select in the Item Container, which Item Templates should be shown (and even filter by a key value).
Uhhh, I´d check if you can recover some things from the JSONs. Otherwise, this is a pretty problematic bug... We have to find how to reproduce this.
i got the same problem just this moment 😄
i could fix it within the json and an older template i made for Backup.
i can send you the damaged file, and tell you, where you have to look.
But i dont know what it was exactly.
We need the exact steps to reproduce this issue. I don´t think the file itself is enough.
i was drag and drop from another character sheat. and i am not sure, but i think the part where i dropped it, was not bordered at this moment. I tried to reproduce it, but it didnt work.
If needed id pay for help i lost so much data. but i know its there some way. Since rolls still capture those valuees i can give you acces to whatever you need
for me it was same sheet moving in between tables to tabed element or maybe i droped beyond to the field for new componnent. I dont have backup please help me obi one
I´ll try some things out. I have an idea I have to test
If you have characters still linked to the template, and not updated with the faulty version, the data may be recoverable. If not, without backup, I'm afraid we won't have much to do
If you have characters, DO NOT REFRESH. The data will be lost if you do
yes i updated but i found the saved file! from when i had table but missing some parts i can regain easily. but i dont know how to transfuse them between files
I'll investigate what could have caused that and add some failsafes to prevent those case, like maybe as you said a 'ctrl-z button'
Ok, please send an export of your character and template, and some keys to find the missing table in the template 🙂
If you have a file, you can import it via right click on the item/actor/template. I recommend creating a new one and import it on it.
ok i got old file can anyone help me revive those3 tables?
These can be exports obtained by right clicking on the template
I have db file
ah
not an export
can you send me the db file by DM ?
ok
I'll try and find a solution tonight, I can't really work on it right now but I'll try in a few hours 🙂
Can i change the value of a numeric field (in this case for all in the Clumn)?
For example i have my dynamic table with Wounds and if i press Rest it should reduce every Wound by 1
i found the recalculate formula, but i am not sure if it dies what i need, and if it can do it in a dynamic table
What you want is an Action Button, which changes values on press. This is not implemented in the system (but you can achieve this with macros).
can you help me with the Macro?
i dont know how to access the values from my sheat.
The Action Button is not the Problem, i have the module Advanced Macros which allow me to call a macro from a chat message
Check this conversation: #1037072885044477962 message
Hey guys, does CSB work with Drag Ruler? Cause I cant't get the module to recognise the attribute for speed
actor.data.data.props.YourSpeedKey
You can use either a Dynamic Tables or Items (I don´t know the rules of PF-2)
is there a way to find the data path?
since I know where I store the current and maximum hitpoints (within the framework of CSB)
#1037072885044477962 message or type game.actors in the console
thanks!
I apologize for bothering you, but it failed to work. I tried actor.data.data.props.words where words was the Key for the current health and maximum health
props stores only the current value. I think you have to look after ...attributeBar.words or so.
ah
So with the new update, the whole referencing properties/keys on another sheet thing was supposed to be implemented/working, but I'm pretty sure I still have the same error. Anyone know how to get it working or at least any idea on if its working?
It works on my side. Can you show how you used it?
Oh I actually just got it, thank you, I was just using the old way which only returns a key in chat
Ah, ok. Yeah, the old thing is also still there 😄
I was super confused until I gave it all another look and I just managed to glance over the new feature, which made me feel REAL dumb.
Actually, @formal goblet if possible, could I ask how you implemented the reference feature? I'm having some random issues that I don't think I understand at all. I'm trying to use it to calculate damage types against a targets defense in the results, it seems to just not work at all with what I'm doing currently. I hope the @ isn't too much.
It isn't. Show me what you did.
Oh okay, well its a number of things, I'm just testing it out before actually trying to implement the feature into my actual sheet. It pulls up this error when I use this ${sameRow('Dmg_Type_1')==1? getPropertyDataFromActor("target", "Prc_Def"):sameRow('Dmg_Type_1')==2?getPropertyDataFromActor("select", "Sla_Def"):1}$
whats strange is that it doesn't do this if I do this: ``${sameRow('Dmg_Type_1')==1?70:sameRow('Dmg_Type_1')==2?getPropertyDataFromActor("select", "Sla_Def"):1}$ ` instead it pulls up a different error and the second result doesn't work right (the result being an empty field). I have to be doing something wrong here.
I'll probably figure out another way around this, since it seems to just not like being included in some things (or I just have no idea what im actually doing, which is definitely true)
The syntax looks right. Are you using this in a Dynamic Table? Also, try out ${sameRow('Dmg_Type_1')}$ and see if you get any results there.
You can use Label prefixes for testing
Yes this is in a dynamic table, but as for the Dmg_Type_1 key it works just fine, the results are pulling in the respective numbers just fine.
And ${typeOf(sameRow('Dmg_Type_1'))}$ ?
Sorry, do I literally just put that in? Doesn't seem to be returning anything other than an error.
Just a test
Well ``${typeOf(sameRow('Dmg_Type_1))}$` doesn't seem to work then. I'm not 100% sure what it's testing though.
Ah, forgot a ' 😅
Ok, and the actor thing alone?
What do you mean?
Just ${getPropertyDataFromActor('select', "Sla_Def", 0)}$
Huh, it only seems to work on target, not select.
It works though, shows the multiplier.
Well, 'select' is just the left click selected token and 'target' is the targeted token.
No idea why it acts the way it does, but regardless I still don't know how to get this property data working in a dynamic table. It's got to do a lot of things, but it just doesn't feel like cooperating, no idea why. I'll have to figure something out eventually though.
I can send a working one but that has to wait until evening (GMT +1).
That would be greatly appreciated, I do not mind the wait. Thank you for everything so far. For now I'll tinker about with some other ideas, I have something that may work, it just won't be pretty.
Hey everyone ! Does somebody knows if it is possible to change the icon of an item located in an item container of an actor to match the actual icon of the item? (instead of the classic grey link)
Nope, not implemented in the system.
Okay thank you
By the way could you explain me what are used the label options such as prefix/suffix and icon?
Labels are displayed as followed: prefix -> value -> suffix. Just enter some text and you'll see.
ho okay thought it was used for entering specific formulas, I feel stupid now x)
For the icon: It will display an icon if you enter a valid font-awesome string (like 'dice-20'), check the website for it.
Hello, I hope your are all doing good!
is there a way to set up by default item modifiers in a template ?
Nope 🥲
Should we expect this feature any time soon 😂 ? or is it fundamentally impossible ?
Also, can you put a variable key in the item modifiers ? For example ref(stat)
ref(stat) + ${preitem}$
Guys i wanted to import from excel items. I dont understand data toolbox . Anyone know how to import items from excel? I have item template in system too
The key must be static. Only the value can contain formulas.
I don't know. It depends if either LinkedFluuuush or me can implement this.
thanks ^^
Whenever I create an HP box and give it an MHP (maximum hp) for some reason the attribute box only shows the current but not the max
is there a way to edit the attribute bar directly or fix this?
Is it a manually created Attribute bar or was it automatically created by the system? Because the manual ones don't support token edit.
An Attribute Bars is automatically created when a number field has a defined max-value.
This is the automatic one
but my max value is a variable which might be the problem MHP
(yeah just created NHP and NMHP same thing it shows the max empty when trying to assign the attributebar.nhp)
Shouldn't cause issues. It just mustn't be a manual attribute bar.
hi guys anyone tried or have experiance import items from excel table?
I have some specifically using an available module that makes it easy(er) still kinda hard
do you mean data toolbox? im trying for weeks with no results 😄
Yup! I can send you some of my files see if that helps crack the code
of stuff I successfully uploaded
I think the big part is that the JSON file needs some very specific editing
great! if i had somethin working i may reversingenner
Like here I exported 'fireball' and turned it into a template where instead of the items name it uses "name":"{{iname}}" and so on for the rest of the variables
(this is for my friends weird d100 system not like D&D or anything in case it looks weird)
ok so round two 😄
message me if you need more help I only come here when I need help so I rarely notice
Hello! I am trying to use a piece of text as a roll. I'll explain.
I have a variable that imports a text formated as a dice roll (like it literally says '2d6'), so I want to slot that into brackets so that I have a button that rolls a different amount depending on said variable.
Writing ${[dmgMain]}$ and ${[ref(dmgMain)]}$ both don't work. How would I go about doing this?
@formal goblet not sure why but by default it shows up in my JSON as "mlife" instead of "${mlife}$" so I just edited the JSON weird but it works now
I'm not official help but you might be forgetting the : : so it rolls like ${[:dmgMain:]}$
${[:dmgMain:]}$ doesn't work, and neither does ${['dmgMain']}$. It seems like [brackets] are super picky about what they interpret as a valid dice roll
it looks like this on mine but I'm getting my dice from an item so keep that in mind
${item.idice}$
and to roll ${[:item.idice:]}$
After further testing, sending the value to a different label and trying to roll that label also fails. It is just not recognizing my dmgMain as 2d6 for some reason
You have this as part of an item container?
Yeah, but if you are doing it without an Item container I can take a look might be simpler
I just have an item attribute that sets a hidden value as "2d6" and I'm trying to use that hidden value, what do you wanna see?
so if it is on an item you should be able to add a column to your item container that can present what the dice is and then in the roll part be able to roll 'em... if it is just an attribute on the character then yeah no need for a container it should grab the text from 2d6 and be able to roll it when you reference the object
I don't want it as part of the item container because I feel like it's cleaner to have a separated label
so if it is an item but not referenced in a container not sure how to do it
this is the current design
There IS an item container, but I'd rather keep it for information instead of rolls
so in the item I have an item modifier that sets a variable as "2d6"
since that's the longsword damage in this instance
I tested with simply writing ${ref('dmgMain')}$ and that returns 2d6 with no issue
#1037072885044477962 message this one should be right
Let me double check
ok it's my bad, it IS working
I wrote ${[:dmgMain.]}$ by accident
god dammit
ok thank you very much
wrote to U
hey!
how does the new implementation work: visibility formula?
hey guys how to add to roll popup with dropdown with value i want to add to calc ? like choose from -30 to +30
User input can only be a text/number input, no support for dropdown, checkbox, etc...
You can find this in every component under 'advanced configurations'. There you can enter a formula, which has to evaluate to a boolean value (true or false).
an example?
like ${mycheckbox?}$
still fine thanks
Yeah, but without the question mark
Plese tell me what i did wrong is that at the top corect call for user intput or what i failed?
?{<wplyw>|<0>}
Test umiejętności ${sameRow('umsn')}$
${fix((((ref(sameRow('umsa'), 0)+(sameRow('UMSWY')<-5 ? 0 : sameRow('UMSWY')))/(sameRow('UMSWY')<-5 ? 2 : 1))+wplyw-[1d100])/10)}$ sukcesów
That's how it works:
${?{userInput | 0}}$
${[1d20] + userInput}$
ok it musp be named userinput?
Nah, every name does
works! thanks mate!
Hello, i'm coming back with a new tricky roll I cannot get to work.
For a specific item that scales with rarity, I set up a label with the following formula :
${jetitemqte + ( modraritem * rar )}$d${jetitem}$
When computed this formula displays for example 4d6 in the corresponding label. I also have a hidden attribute with the same formula in it stored into the key : jettotal
In parallel I also have another attribute that is not supposed to be a roll bu a fixed value computed in a label and in a hidden attribute (bontotal) as follows :
${bonitem + (modraritem * rar)}$
When this item is dropped into the character sheet, the player can roll through a button that has for message roll this :
${#jet_item:= [item.jettotal]}$
[${jet_item}$]
${#bonus_item:= [item.bontotal]}$
${bonus_item}$
But the roll do not display offering the following error message :
foundry.js:11730 Uncaught (in promise) Error: undefined. Unresolved StringTerm item.jettotal requested for evaluation
[Detected 1 package: system:custom-system-builder]
at StringTerm.evaluate (foundry.js:11730:11)
at Roll._evaluate (foundry.js:9292:42)
at Roll.evaluate (foundry.js:9256:25)
at Formula.evaluateRoll (Formula.js:815:24)
at async Formula.compute (Formula.js:270:30)
at async ComputablePhrase.compute (ComputablePhrase.js:128:13)
at async HTMLAnchorElement.<anonymous> (Label.js:247:21)
"Unresolved StringTerm" is a hint for a wrong roll-expression (everything inside []). It should look like this:
${#jet_item:= [:item.jettotal:]}$
[${jet_item}$]
${#bonus_item:= [:item.bontotal:]}$
${bonus_item}$
hello,
i need a little help with my rest macro.
i got this so far for the selected token:
const arr = a.props.Table_Schaden.Schaden.map(i => i - 1);
await a.update({"props.Table_Schaden.Schaden": arr});```
but i got this in my console:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Table_Schaden')
That is the Part in actors.data under props:
edit: i mean game.actors
Ok, I found out some things:
- It´s
selectedand notselect😅 - I don´t know why, but it doesn´t like
sameRow()andgetPropertyDataFromActor()in the same formula in the Label Roll Message (but normal Labels are fine? Idk, weird bug). At least the workaround is pretty simple. Just use a temporary variable forsameRow():
${#temp:= sameRow('Dmg_Type_1')}$
${temp == 1 ? getPropertyDataFromActor('target', "Prc_Def", 0) : temp == 2 ? getPropertyDataFromActor('selected', "Sla_Def", 0) : 1}$
guys how to refer name not value from dropdown?
Not possible. The name is only visual
so if i target value of dropdown to just show item qality in table, i need to make mighty if to reverse function?
sry, can you rephrase your sentence? 😅
So to have name values i had in dropdown somwhere else i need to make looong IF to bind values to names?
It depends what you want to do. If you have the following dropdown-options
Key - Value
1 - Strength
2 - Dexterity
3 - Constitution
then yeah, you have to check for each case. It might be easier for you to use equal values like:
Key - Value
Strength - Strength
Dexterity - Dexterity
Constitution - Constitution
This would simplify A LOT
i use it like in idea 1 with key numbers as i use those mathematicly
As qality impacts price, waight and durability
How does it impact? Maybe we can find an easy way
jakosc
0.5 -bad
1 -common
5 -good
10 -amazing
${floor(waga*((1+1/jakosc)/2))/10}$
What about price, weight and durability? All the same factor?
yes but i dial it externaly since 2jakosc is different to 2(1+1/jakosc)/2
ok, and you also need the quality name from the dropdown?
yes adresed from outside like i do now ${item.jakosc}$ but its only number i need value not key
Then you have 2 options: Either with nested (or summarized) ifs or with a lookup table (dynamic table ftw).
hoped it will be adresable i think if must suffice ;] thankls
Is anyone having issues with deleting tabs within tabbed panels?
For some reason, a tab within a tabbed panel is not deletable for me. I can delete everything from within the tab but not the tab itself
just tested it, i cant delete it, too
Okay, thank god its not just me
Appreciate your response. Its not mega big deal, just ugly to look at
Sorry, we don't have enough monkeys for testing 😅
😄
Yeah! Thank you, I'm already well on my way to get this working. The bug is incredibly odd, but the work around works well enough so far which is good.
Im a bit confused on css styling, iv never done css before, if I just want to change the background of the character sheet in general or change maybe some color of the text, i do have programming experience but have never done anything related to webpages lol. Does anyone have any resources to use? Or maybe even an example of their own "Additional CSS Classes" and from there I could just extrapolate how to do it? lol
I've puzzled out that nested ternaries work, but I'm wondering is there a better way to manage if/elseif/else or switch style logic?
This calculation is working for me in a hidden attribute, but feels really kludgy, and having to run everything through Math.js had me scratching my head.
${ (equalText(ref('class'), 'adept') or equalText(ref('class'), 'warrior')) ? floor((level-1)/4)+2 : (equalText(ref('class'), 'devoted') or equalText(ref('class'), 'expert')) ? (floor((level+3)/4)) : (floor((level+8)/6)-1) }$
I feel certain there's a better way?
MDN is hands down the best all around online documentation for html/css/js I'd take a look here:
https://developer.mozilla.org/en-US/docs/Learn/CSS/First_steps/Getting_started
turns out shared vision breaks longer rolls that rely on getproperty, not sure why, but it just made it so that tokens that dont have permission to access certain tokens cant actually pull keys from them.
Unfortunately there is not really a better way.
Gotcha, thanks!
So if i'm reading this right the scenario of having a dynamic number of dice in a dicepool and having to evaluate them separately is going to be a bit of a problem, correct?
yep
Just followed the question to the top. You need to figure out if 2d6+
is rolled with two 1s right?
How about
:Roll:+:target:
!:Target:-:roll: == 2 ? Critical fail : normal```
Hello, is there a way to create an equality between a value and an array of value ?
for example if if 1 < x < 8 then y = 2
I assume x and y is a key
${ 2<='x'<=7 ? 'y' == 2 : <value if false>}$
This should work I think
Well no, you can't change a dofferent key
Yes also :/ I'll probably need some elseif cause the array is a bit more complex than 2 values
The idea behind it is you upscale the dice you use when you increase you stat
Can you explain it s bit more? I am pretty sure there is a way.
In my system, it's called the intensity dices. If your stat is between 1 and 7, you use a 1d4 as intensity dice. If your stat is between 8 and 13, then it's 1d6....
0 = 0
1-7 = 1d4
8-13 = 1d6
14-16 = 1d8
17-19 = 1d10
20 = 1d12
This value has to be stored in key because some weapons relies on it for damage, dealing for example 2 intensity dices.
I have to find a way for the sheet to understand for example that is the stat is between 1 and 7 then the corresponding should store a value equal to d4.
Table woth 2 columns
${'key' == 0 ? 0 : 'key' <= 7 ? 1d4 : 'key' <= 13 ? 1d6 : .......
That should do the job I think
The last one is >= 20
Key is the value of the stat
I'll try it and let you know
I finished my rest macro. The Main part is reducing the value of a Numeric field in a dynamic table.
just in case someone will ever need it:
//this part detects, if a Token is selected. If not or more than one, it returns an error message
console.log("Tokens: ", canvas.tokens.controlled)
if(canvas.tokens.controlled.length == 0 || canvas.tokens.controlled.length > 1){
ui.notifications.error("Bitte nur einen Token auswählen");
return;
}
let currentActor = canvas.tokens.controlled[0].actor
//this part reduces the value of the key 'Schaden', which is found in the dynamic table with the key 'Table_Schaden', by 1, but not under 0
const a = currentActor;
const obj = Object.entries(a.system.props.Table_Schaden).reduce((acc, [i, vals]) => {
acc[i] = {...vals, Schaden: Math.max(0, vals.Schaden -1)};
return acc;
}, {});
await a.update({"system.props.Table_Schaden": obj});
//this part creates a chat message with the content and the selected Actor as speaker
ChatMessage.create({content: "Hat eine Rast eingelegt", speaker: {alias: currentActor.name}})```
the move before/after function has disappeared?
Yeah, you can now drag the components
but maybe the move button isn't that bad. i had the point where i wanted to add a new column in the front of the table and had to drag every entry.......
well, while writing it down, i could have drag the empty field to the front, god i´m dumb
${feu == 0 ? 0 : feu <= 7 ? d4 : feu <= 13 ? d6 : feu <= 16 ? d8 : feu <= 19 ? d10 : feu >= 20 ? d12}$
Used this, seems like it's not workin
You forgot quotes at your dices, because these are strings.
${'feu' == 0 ? 0 : 'feu'<= 7 ? d4 : 'feu'<= 13 ? d6 : 'feu'<= 16 ? d8 : 'feu'<= 19 ? d10 : 'feu'>= 20 ? d12}$
This is actually more wrong than it was before 😅
Comparing a string with a number is... mutig 😄
yeah, i miss that more often, it is more a trail and error, label or rollmessage and all the other.
Just saw he missed the 1 before the rolls
${feu == 0 ? 0 : feu <= 7 ? 1d4 : feu <= 13 ? 1d6 : feu <= 16 ? 1d8 : feu <= 19 ? 1d10 : feu >= 20 ? 1d12}$
I willingly didn't include it because i want the key to store 'd4' for example to be able to roll several all them if needed
${feu == 0 ? '0' : feu <= 7 ? 'd4' : feu <= 13 ? 'd6' : feu <= 16 ? 'd8' : feu <= 19 ? 'd10' : feu >= 20 ? 'd12'}$
Like this ?
Almost. You forgot a final :
${feu == 0 ? '0' : feu <= 7 ? 'd4' : feu <= 13 ? 'd6' : feu <= 16 ? 'd8' : feu <= 19 ? 'd10' : feu >= 20 ? 'd12' :}$
yeah sorry with the quotes
And the value after the :
the value ? what value ?
The Statement 2 would correspond to the value if every other condition are false ?
Yes
Perfect it works now
I actually enjoy this more than expected 😂 I wish I had the chance to learn more about it before
i know the feeling, i invested round about 30 hours to create my template while learning 😄
And in the meantime you learn some programming basics
yeah, and i could have made alot of things way more easy for me 😄
That is a rollmessage from me and i copied this message for every attribute. i tried to make as little changes as possible after copying.
Then i realised, i could have used replaceALL, change just the value i needed and never had to bother about correcting every entry, didnt i?
${#?{Erschwernis|0}}$
<h3>${!sameRow('Name_FGE')}$ erschwert um ${![:Erschwernis:]}$</h3>
<p><strong> Wurf 1: </strong>${roll:=[1d10%10]}$ <strong> Wurf 2: </strong> ${roll2:=[1d10%10]}$</p>
<p><strong>Probe: </strong> ${![:Wert:-:roll:-:Erschwernis:]}$ netto</p>
<p><strong>Schicksalsprobe: </strong>${![:Wert:-:roll:-:roll2:-:Erschwernis:]}$ netto</p>```
Hey guys I have a question for you guys
In my system upgrades can be installed on weapons to increase their efficiency. Since, there is no way of dropping an item in a item, is there still a way to automatise the process ?
I imagine a system with a dynamic table and a drop down list, but also I cannot see how to apply automatically the modification
In custom system builder, for getPropertyDataFromActor, can I fetch the actorName from a dynamic table? I would like to be able to easily adjust the actors that my formulas are calling from.
Fixed it
Should be possible
im having this weird problem where i moved something in a character sheet template and now i cant open any Effected* character sheets
It wouldn't let me. It's ok, I'll just hard code all my party member names in. Just means that if I need to change their names or if I run the game with a different group I'll have to change a lot of fields.
Hey guys
I need some help
Im trying to make a count success for system that im building, but I can't get it right
Skill checks in my system is 1d20 + statnumberD6
In d6 array any 5 is counting +1 to 1d20 result, and any 6 is +2 to 1d20 result
I was trying to use count success, but its working only on 5 or 6, I can't create a formula for 2 cs to work simultaneously
You have a character sheet that you haven't updated? That is still working with the Version before?
Or a Backup from the template that works before moving? Then it could be possible to get it work again
If you have a working sheet, do not update it
Hey I was working on a macro and I was trying to get it to roll. When I run the macro it doesn't do anything but I get this error in the console
Uncaught (in promise) Error: undefined. Unresolved StringTerm undefined requested for evaluation
[No packages detected]
at StringTerm.evaluate (foundry.js:11730:11)
at Roll._evaluate (foundry.js:9292:42)
I'm new to coding. Does anyone have any idea what this error message means?
I'm no expert, far from that, but that error message suggest that one of keys you used is undefined, maybe you missed spelled it or forgot some brackets (At least this is what happens to me when I do)
maybe if you send your macro it would be more clear
This is the part that started to get a bit wonky, Its a script macro so I'm a bit hesitant pasting the whole thing
You'll need someone with a higher level than me 😂
sorry, the others will probably answer you soon
Nah, i just hooked on that question because it was a simple version of what i'm trying to do. For me it's a bit more complex. spoken in Foundry Roll-language it would be something like [x]d6cs4 + [y]d8cs6cf2 (the latter part doesn't work completely. It does count successes AND it highlights the dice) and then modifiying the successes AND fails. I swear it does make sense in my head 😄
Can you aid me my popup does not compute into calculation
${?{wplyw1 | 0}}$ Test umiejętności ${sameRow('umsn')}$ ${fix((((ref(sameRow('umsa'), 0)+(sameRow('UMSWY')<-5 ? 0 : sameRow('UMSWY')))/(sameRow('UMSWY')<-5 ? 2 : 1))+wplyw1-[1d100])/10)}$ sukcesów
after i added wplyw1 popup and +wplyw1 to calculation i have error it posup but result is error
Uncaught (in promise) Error: undefined. Uncomputable token wplyw1 [Detected 1 package: system:custom-system-builder] at math.SymbolNode.onUndefinedSymbol
Without it it all works
So I've been working on my best friends RPG for 6 months and accomplished A LOT
That said might try to adapt an indie game we like... do I need to take any extra steps to release it as a system? Do people need to download CSB? Do I just delete the templates and stuff?
${5+(equalText(Rank,'Starter')?5:equalText(Rank,'Beginner')?9:equalText(Rank,'Amateur')?12:equalText(Rank,'Ace')?14:15)+(Champion?1:0)-Ski_T}$ Rank is a dropdown list, Champion is a Check Box, And Ski_T is 16 Stats added together in hidden why am i outputing nothing?
Ski_T = 0 at the moment* rank is set to starter* champion is False
(Proof we need switch statements) 👆
Hey guys I think I discorverd somekind of bug, I don't know if you know the solution for it. If you reload a sheet while putting a key to hidden "${key}$" it will corrupt the sheet prevent you from reloading it again
seems like the $ is stored in the data of the sheet, and causes the bug with no way of removing it since it's hidden and the sheet won't reload
yeay @formal goblet you are on!
how do i better optimize this?
${equalText(ATK_TYP,'Normal')?(equalText(T_1,'Fighting')?-1:0+equalText(T_2,'Fighting')?-1:0):}$
Yeah, I agree on that. I like the switch-formula from Excel/Google Sheet way more than the ternary operator if you check one value against multiple cases. Give me a sec, I´ll implement this rn, I have some time to spare 😅
You have 2 ? in row. That´s not allowed 😅
havent even tried to put it in yet..... im trying to make the type matchup from pokemon, i have ATK_TYP set to the moves Type And T_1 And T_2 Are The Defending type
any idea?
Fixed some mistakes: ${equalText(ATK_TYP,'Normal') ? 0 : (equalText(T_1,'Fighting') ? -1 : 0 + (equalText(T_2,'Fighting') ? -1 : 0))}$
Um it's (If ATK_TYPE = Normal Then If T_1 = Fighting Then -1 Otherwise 0 Plus If T_2 = Fighting then -1 Otherwise 0 Otherwise If ATK_TYP = ....... )
Is the logic that I can workout but if I'm not mistaken you put (If ATK_TYP = Normal Then 0 otherwise if T_1 = Fighting then -1 otherwise 0 plus......
I habitually nest Ifs that's why I ask for the more accurate solution
The type table for pokemon is pretty large, isn´t it? If you´re trying to check if the attack type has an advantage, disadvantage or nothing from both against the defending type, then I´d recommend to use a Lookup-Table instead of trying to catch every case in formulas.
Ok how would I do that:
1 Where would I make the table?
2 how can I get a single output from 1 move type and 2 defending types
3 thank you so much for all your help
I'm trying to have this ready for tomorrow to play.... Or at least somewhere remotely functional I'll add more complicated stuff later
Dynamic Table: Type_Table
Rows: Attacker, Columns: Defender
| - | Fire | Water | Gras | ...
| Fire | 0.5 | 0.5 | 2 | ...
| Water | 2 | 0.5 | 0.5 | ...
| Gras | 0.5 | 2 | 0.5 | ...
...
Formula would be something like ${fetchFromDynamicTable('Type_Table', DefenderType, 'AttackTypes', AttackerType)}$ (for checking 1 Attack Type against 1 Defender type).
And I can do that 2x In hidden then have my single output be the 2x hidden together?
Normal Label formula or Label Roll Message?
label as in the future i intend to call on it
Btw, what happens mathematically if a pokemon has 2 types?
Are the factors just multiplied together?
yea in the games the multipliers can be .25-4x damage
ok, that´s simple. Just multiply both results
in the tabletop version its from -2 to +2
Ok, in this case it would be an addition, but that wouldn´t change the complexity
thank you so much and sorry for being so needy
Anything else that you need?
yea i just went to make the dynamic table... i dont see an option for rows and columns.... is that in the read me how to do?
i can look there if it is
You can create columns as soon as you´ve created the table. Rows must be added in the character sheet (not in the template)
so i have to make the Type Match up on each character sheet i make?
Yeah, or you make a default character and duplicate him for new characters. That would spare you the time to recreate it
is there any way i can put it in a journal entry?
Nope 😅
Whelp looks like imma do it that way
I think I have a good idea, but I have to check it out because I´ve never done this before. How about creating the table in an item and do the calculation on an Item Container? But first I have to check if you can do something like fetchFromDynamicTable('item.TableKey', ...) 😅
lol That would help Alot!
It actually works, WTF
here is something else i have the chart ready to be filled how would i put in ineffective (Normal moves do no damage to Ghost types)
-99? 🤣
then i would have to add something at the end like If(total)<-2?"No Damage":(total)
correct?
Would be the easiest, I guess.
and by that logic i could use -4 rather as thats even simpler
${fetchFromDynamicTable('item.Type_M', T_1, 'AttackTypes', ATK_TYP)}$
Correct?
so what would happen is It would look for the Table, then the Column that matches T_1, then go to the first column to look for the one that matches ATK_TYP?
@formal goblet ?
sorry i taken it for granted and it didnt work on session. than i tried your code and it didnt roll too. i pasted it 1to1. can you test it?
Is it a roll message?
yes, intention is to add modifire to roll before roll, with popup
${?{userInput|0}}$
${[1d20] + userInput}$
Sorry, whitespaces seem to cause issues.
It would do SELECT <DefenderType> FROM Type_Table WHERE AttackType = <AttackerType>
Ok, it´s more it selects the defender value, not the type of it. So a bit of a wrong wording from my side, but the formula should still do what I expect to do.
Hey, quick question about conditionals, is there a reason I cant check strings or something?
Lets say this:
${sameRow('weapon_magazine_bullet_type')=="H" ? 0 : 1}$
this sameRow key that im calling is just a text field. How do I get this to actually check if the strings match
Am i dumb?
Use equalText()
oh yeah, my bad, i mean id still have to sameRow that key
but okay, that is basically how you use it, thank you i appreciate it
thats solved it thx
hello, complete newbie here! I'd like to make a custom game system and was wondering how to get started?
https://youtu.be/yGVOj_iqiKg I used this to get going with my first world. After a while you should know enough to be able to play around and try new things
The new Custom System Builder for Foundry VTT (was Modular System)
Custom System Builder: https://gitlab.com/linkedfluuuush/custom-system-builder
Sandbox: https://gitlab.com/rolnl/sandbox-system-builder/-/tree/master
Sandbox Video: https://www.youtube.com/watch?v=V9IXafKPK2I
GRPGA: https://gitlab.com/jbhuddleston/grpga
Using Foundry without a...
thanks!
The GitLab-Page is also a good source: https://gitlab.com/custom-system-builder/custom-system-builder
Any way that you can kinda do what FetchFromDynamicTable does but for an item container?
As an example, I have the weight of an item in an item container that I want to add to the actors weight on its sheet
Your error message means that one of your string variables has no value assigned to it when you attempt to use it. I suspect token.actor.getRollData.Accuracy_bonus. Try adding console.log(token) and make sure it's got the data you're expecting.
Also, what you have will only get it to roll internally. If you want to be able to see the roll, you'll need to put it in a chat dialogue window. Also, this error doesn't seem specific to custom system builder. If you try macro-polo for your macro issues, they are usually super quick and helpful
someone have idea how to deal with temporary modificators? So that thay work on stats and can be add multiple times like in dynamic table or item table?
Nope, you have to use Item Modifiers if you want to sum up the weight.
Do you mean status effects? Well, you can assign modifiers to existing status effects. Otherwise, how about creating Effect-Items with the needed modifiers?
i thout that too but how to acces data from item to alter stats?
Does anybody know the component key to the PC´s name?
There isn´t one
Damn.
${#?{Modifikation|0}}$
Can anybody tell me why this (Roll Message) is shown in chat, although I should´ve played the # right?
It shouldn´t and it doesn´t on my end
Alright, thanks!
The only thing you get is an empty chat message
That isn´t supposed to happen either, it´s supposed to ask you for a value input and then give an empty chat message
Well, it does both on my side
Okay, now that´s weird. Thanks!
I copy & pasted your formula and it works like intended
Ok, thankyou for the help
So uh, can't delete tabs ig? Very weird
Hello! Is is possible to only display the results of a dice roll made from a label instead of having the click box? i use only D6 so i would to have the classic results appearance or so like this, if not, if there a possibility to get the results of the results of the dice so i can display it in a message for exemple?
Sry for asking help, i took time to re-read the gitlab, i didn't saw it at first, sorry to have bothered you, you can delete the messages if you want ^^
Can a custom system be released Standalone or only as a World requiring Custom System Builder? Thinking of building Liminal Horror without just hacking Cairn
Tell us what you found 😄
I´ve created a section for FAQ´s in the Project-Wiki. Suggestions are welcome: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Frequently-Asked-Questions
I want to make my roll messages look prettier, how can I do that?
Can I fetch from a table like I do it from a dynamic table?
Can I use macros directly from a sheet/roll message?
This
Making your roll messages look prettier is pretty straightforward if you have a basic html/css understanding. Wrap your rolls in a div with a class name, and key off of that for styling in you css file.
@robust wren here's an example from the 5e-based system I'm working on:
${#check_type:='Strength Check'}$
${#modifier:=ref('mod_str')}$
${#roll1:=[1d20]}$
${#roll2:=[1d20]}$
<!--DO NOT EDIT BELOW-->
<div class="mb-roll">
<h3>${!check_type}$</h3>
${! (equalText(ref('roll_type'), 'advantage')) ? '<p>Advantage</p>' : (equalText(ref('roll_type'), 'disadvantage')) ? '<p>Disadvantage</p>' : '' }$
1d20 + ${!ref('mod_str')}$
${! (equalText(ref('roll_type'), 'advantage')) ? concat( '<br><strong class=\"result\">', string(max(roll1, roll2)+modifier), '</strong><br><small>(rolls ', string(roll1), ', ', string(roll2), ') +', string(modifier), '</small>' ) : (equalText(ref('roll_type'), 'disadvantage')) ? concat( '<br><strong class=\"result\">', string(min(roll1, roll2)+modifier), '</strong><br><small>(rolls ', string(roll1), ', ', string(roll2), ') +', string(modifier), '</small>' ) : concat('<br><strong class=\"result\">', string(roll1+modifier), '</strong><br><small>(roll ', string(roll1),')</small>')}$
${! (equalText(ref('roll_type'), 'advantage')) ? (max(roll1,roll2)==20 ? '<p class=\"critical\">CRITICAL SUCCESS!</p>' : max(roll1,roll2)==1 ? '<p class=\"fumble\">FUMBLE!</p>' : '') : '' }$
${! (equalText(ref('roll_type'), 'disadvantage')) ? (min(roll1,roll2)==20 ? '<p class=\"critical\">CRITICAL SUCCESS!</p>' : min(roll1,roll2)==1 ? '<p class=\"fumble\">FUMBLE!</p>' : '') : '' }$
${! (equalText(ref('roll_type'), 'normal')) ? (roll1==20 ? '<p class=\"critical\">CRITICAL SUCCESS!</p>' : roll1==1 ? '<p class=\"fumble\">FUMBLE!</p>' : '') : '' }$
</div>
And here's a snip from my css file
.mb-roll{ text-align: center; }
.mb-roll .result{ font-size:2em; }
.mb-roll .critical{ color: #0c6400; }
.mb-roll .fumble{ color: #640000; }
^Note: this is another place where I just really wish switch statements were a thing.
Works like the SWITCH() from Google Sheets: https://support.google.com/docs/answer/7013690?hl=en
Awesome. That's going to be so helpful.
Adding pure functions is the easiest in this system.
You can write your own little module for that. https://glumbosch.home.blog/2021/03/05/how-to-show-all-dice-automatically-in-foundry-vtt/
Ho nice one, i didn't digged too much the code part yet but this is really cool, thanks for that mate
the third one is the way to go
Sorry we were actually playing ^^
What i found is that you can change the formulas of a roll to be like a normal roll:
on a label for rolling 4d6 you put ${[4d6]}$, just add a ! before the roll parameters like this ${![4d6]}$
you can add ! before the formula so doing like, ${![1d20]}$ would show it as text, without it being in a little box
Oh wait
you literally just said that
hahaha no problems friend
The thing is, most people, me included, don't have this basic understanding 😄
I am going to learn it, because I want, but most people wont
This^^^ Ya'll are great in here and I've learned so much but I know I've barely scratched the surface of any "basic understanding of html/css/js". I am CERTAINLY having a ton of fun though!😆
Is there anyway to change a label icon with a formula between two ? (fontawesome compatible i talk) . Or AI saw in Label an Advanced configuration with a Visibility Formula, can someone tell me how does it work?
okay, so I'm having a slight bit of trouble with the Custom System Builder. I have a drop down menu that I want to use to select which stat is rolled with an attack. How do I do that? Currently doing this:
Attack Roll: ${ATTACK_STAT == hard ? [2d10] + HARD + MOD : ATTACK_STAT == keen ? [2d10] + KEEN + MOD : ATTACK_STAT == calm ? [2d10] + CALM + MOD : ATTACK_STAT == daring ? [2d10] + DARE + MOD :}$
but its throwing an error
got it working, thanks!
now I'm wondering how to add "If And" conditions
is that mentioned in the main docs?
actually, at this stage I'm trying to implement a loop of some kind or other
is there a way to roll a varying number of dice and not sum them?
working on a system where you can have 1 weapon make multiple d20 attack rolls
Maye a dynamic table or item Container. An then a field to put the number of d20 in there. Or can the same weapon have different d20 on the same Charakter?
Maybe with a user input asking how many d20 to roll?
I've got an input for the number of d20s to roll and can get that number of dice rolled
but Foundry automatically sums all of the d20s
instead of parsing them individually and displaying their values
I think this is only doable with a macro.
welp, time to teach myself how to add one of those to foundry
I made it with the module advanced macros. Then you can run a macro via /amacro <macronsme>
I am using it for Sequencer and adding animated spell effects
Custom System Builder - 2.2.1 Beta version
A small beta version has just been released with the following changes :
### Fixes
- [#229] Fixed drag & drop issues
- [#223] Fixed tab window edit title
- Fixed tab deletion issue
I should be releasing it completely on Tuesday, if it does not cause more bugs 🙂
Sweet I have made a macro exporting every template every 30min in a compendium, to prevent data loss from drag&drop issue 😄 maybe I won't need it anymore 😄
I will share it in the next days after testing it properly 😄
Sadly, I can't be sure every drag&drop issue will be solved, as I couldn't reproduce the data loss behaviour :/
But the fix I made may be fixing the data loss as well, since it has to do with how the template is saved on drag & drop 🙂
Just wanted to let you know this is great. First 2 questions were ones I just asked in the last few days lmao thanks
@formal goblet Hi! I read somewhere that you have a work around for summing up values in an item container. Ex: tallying up total item weight in a container. Would you mind directing me to info on how to do that?
Thank you!
Hello,
just wanted to Share my Macro for automated Backups:
This is a Worldscript. For using as a Macro ingame you have to make a few changes.
The Script starts with Asking you, if you want to export the Actos into a Compendium
if yes, The Macro will do this every 30 Minutes. You can Change the Interval in the Script under setInterval(() => {exportToCompendium(); }, 30 * 60 * 1000);
The Macro will create a new Compendium in the format "Template Backup YYMMDD"
So you have a new Compendium for every Day. This prevents the Compendium to get to big and makes it more easy to delete old Backups.
I have only the Macro tested and i haven't tested it for a longer Duration, but i dont expect anything going wrong.
The Script will only Backup you Actor templates, no items. And Only the templates.
Hooks.on("ready", async function() {
// Popup if backup should start
let confirmed = await Dialog.confirm({
title: "Export Actors to Compendium",
content: "Do you want to export Actors to the Compendium?",
});
if (confirmed) {
exportToCompendium();
setInterval(() => {
exportToCompendium();
}, 30 * 60 * 1000);
}
});
async function exportToCompendium() {
const now = new Date();
let dateString = `${now.getFullYear().toString().slice(2)}${(now.getMonth() + 1).toString().padStart(2, "0")}${now.getDate().toString().padStart(2, "0")}`;
let compendium = game.packs.get(`world.template-backup-${dateString}`) ||
await CompendiumCollection.createCompendium({
label: `Template Backup ${dateString}`,
id: `world.template-backup-${dateString}`,
private: true,
type: "Actor"
});
let actorsToExport = game.actors.filter(actor => {
// filter for _template type
let isTemplate = actor.type === "_template";
let isInCompendium = compendium.index.find(e => e.name === actor.name) !== undefined;
return isTemplate && !isInCompendium;
});
let completeDate = dateString + `_${now.getHours().toString().padStart(2, "0")}${now.getMinutes().toString().padStart(2, "0")}`;
const toCreate = actorsToExport.map(actor => {
let actorData = actor.toObject();
// change Name with timestamp
let actorName = actorData.name.replace(/\s/g, "");
let newActorName = `${actorName}_${completeDate}`;
actorData.name = newActorName;
return actorData;
});
await Actor.createDocuments(toCreate, {pack: `world.template-backup-${dateString}`})
}```
Since I have no idea what any of this says, am I safe to say that all I need to do here to use this is copy/paste into the macro bar? Is there anything I need to do prior? Like make a Base compendium? Or anything in the code I need to replace with my info? Thank you so much for making this BTW!!
Also, once I push the button the first time it just auto does it or do I need to do anything else?
This is a worldscript, it wont funnction if you put it into the Macro Bar.
The World Script starts with the World loading. There are some preperations you have to do:
https://foundryvtt.wiki/en/basics/world-scripts
that would be the Macro you can use from the macro Bar.
// Popup if backup should start
let confirmed = await Dialog.confirm({
title: "Export Actors to Compendium",
content: "Do you want to export Actors to the Compendium?",
});
if (confirmed) {
exportToCompendium();
setInterval(() => {
exportToCompendium();
}, 30 * 60 * 1000);
}
;
async function exportToCompendium() {
const now = new Date();
let dateString = `${now.getFullYear().toString().slice(2)}${(now.getMonth() + 1).toString().padStart(2, "0")}${now.getDate().toString().padStart(2, "0")}`;
let compendium = game.packs.get(`world.template-backup-${dateString}`) ||
await CompendiumCollection.createCompendium({
label: `Template Backup ${dateString}`,
id: `world.template-backup-${dateString}`,
private: true,
type: "Actor"
});
let actorsToExport = game.actors.filter(actor => {
// filter for _template type
let isTemplate = actor.type === "_template";
let isInCompendium = compendium.index.find(e => e.name === actor.name) !== undefined;
return isTemplate && !isInCompendium;
});
let completeDate = dateString + `_${now.getHours().toString().padStart(2, "0")}${now.getMinutes().toString().padStart(2, "0")}`;
const toCreate = actorsToExport.map(actor => {
let actorData = actor.toObject();
// change Name with timestamp
let actorName = actorData.name.replace(/\s/g, "");
let newActorName = `${actorName}_${completeDate}`;
actorData.name = newActorName;
return actorData;
});
await Actor.createDocuments(toCreate, {pack: `world.template-backup-${dateString}`})
}
it just auto creates the Compendium and everything
oh OH wow Definitely above my pay grade😅Thank you!
when i attempt to configure an item modifier to be able to add weight, all i get inside my label on my actor sheet is a "NaN"
it is not my own 😄 i googled a bit together, let an AI look over it and then make a whole lot with the people in macro-polo, they deserve the credits 😄
so you have a Key ToalWeight on your template?
or PC_weapon_weight on yout Actor template as far as i see on the picture?
the "Key" you see on the left is a label with default 0 and the value formula on the right is the key for the weight on the item
yeah exactly
it definitely does modify the key on the actor sheet, just seems to be strange. I presume its some sort of like issue with maybe something being a string or integer, idk, but idk how to fix it
and the weight is a label and not numeric field, Textfield or something like that?
the weight on the actor sheet is a label with the optional text set to 0
if i change the optional text to nothing, it just gives me nothing as well lol
give me 2 min i will try it on my version
thx
yeah no, i tried alot, but i get only the error No Access to property "Weight"
@formal goblet I tried to do a quick test on a new/blank sheet using your FAQ instructions regarding item container weights and keep getting NaN. I may be doing the default value 0 wrong, how do I do that? I'm assuming just entering 0 in the label is incorrect lol
someone seeing, what is wrong here?:
<p>${!(equalText(ref('Art'), 'Probe')) ? (roll1 <= ref('modifier') ? '<p style="color: green; font-weight: bold;">Erfolg!</p>' : '<p style="color: red; font-weight: bold;">Fehlschlag!</p>' ) : ''}$ </p>
A couple of things stand out, not sure what you are seeing that is unexpected, but you need to escape the quotes i.e. style=\"
You also shouldn't put <p> tags inside other <p> tags. Paragraphs are block elements. That's not likely to break anything, but it might look weird.
Does anyone have a good example I could look at for d&d style classes?
I'm curious how other folks are implementing levels/classes in systems that have them. Using item containers for class abilities seems close, but not quite what I'm looking for. Dynamic tables similarly seem close, but a bit limited. What I want to do is minimize the amount of lookups and/or copy/paste tasks for someone to add levels on the sheet. Ideally, levelling up would just prepopulate the right abilities on the sheet for that class/level combo.
Yeah, myself and Mot checked this, it seems to be an error or something, not entirely sure how to fix right now
ah yeah, that was a bit doubbled 😄
i think it fixed the error, but i wont make the Message in green/red and bolt:
<p>${!(equalText(ref('Art'), 'Probe')) ? (roll1 <= ref('modifier') ? '<style=\"color: green; font-weight: bold;\">Erfolg! </style>' : '<style=\"color: red; font-weight: bold;\">Fehlschlag!</style>' ) : ''}$ </p>
Ah, that's not how a style tag works. Try changing those back to <p> tags, and the one wrapping it all up to a <div>
oh man, i am not the type for html 😄
style tags hold css rules, like what goes in a css file. they don't render anything themselves
ah yes, that works now 😄
quick question, if i wanted to include the name of an item in a chat message like when rolling, how would I do that? What is the code to get the name of the item like if i wanted a roll message to say
"You are shooting an [item name] "
your formula for rolling is in the item container?
yes
i will say the name of the item is nowhere on the item sheet as a key, only in the name
hm, lemme try again, didnt seem to work first time but i could also be dum
okay, it worked this time, lol sorry for dumb question smh
I'm agree with you on this point i'm pretty curious
I want to update health on an actor with a macro.
The path i have found for my Current health is a string and is located here js canvas.tokens.controlled[0].actorsystem.props.current_hp
were do i look for a Integer instead ?
Does anyone know how to build the Chat message with a part looking like the default roll?
So i have the border and can click on it to see what dice were rolled?
is the current_hp a label?
how is the current hp calculated?
Without some sort of action buttons in the sheet that could trigger some fairly complex javascript to manipulate fields I'm kind of thinking this isn't going to totally work how I'd like it to (i.e. no way to replicate something like the roll20 charactermancer), but I do think I can mostly make do with plain html/css and stuff that into the sheet. There will be a fair amount of hidden stuff in the dom, but the formula calls should be minimal.
i use advanced macros to call a script from a label roll message.
you can use the /amacro <MacroName> and run the script
thats nearly an action Button 😄
Hmm. Possible to manipulate item containers with that?
it was a label yeah.
I figgured i just convert it into an integer and it wok 🙂
i mean, you can run a macro with that, and i am pretty sure you can manipulate item containers with Macros. Just the Question how 😄
how do I prompt a player for input inside a formula? I know in the documents it says to use
?{<varName>} but when I use that it just throws an error
or, more specifically, when I type out:
${${Save}}$
You're using twice the '$' symbol imo, which is used only for start and end of the formula, if your field is called 'Save' then the second line should be ${Save}$
ho and also i'm not entirely sure but i don't think it is handled without any module
what?
I mean the fact of asking a user an input, maybe it's not handled without a complementary module
I don't fully follow what you are saying
what is a complementary module in this instance?
i mean the system may not be able to prompt a dialog box for a player to ask him to enter a value on its own, you might need a macro or a module to make it so
but in the documentation for the CSB itself it says this:
I'm an idiot
I've been using '$' instead of '?' this whole time
it works now
it always worked
am dumb
thank you Zog!
No problem i didn't helped that much haha
anyone seeing what is wrong here?:
${!equalText(ref('Art'), 'Probe') ? concat('<li class="roll die d10">', string(roll1), '</li>') : concat('<li class="roll die d10">', string(roll1), '</li>', '<li class="roll die d10">', string(roll2), '</li>')}$
i see it, just a sec for testing
yep, fogot to space out the "
that is the html formula for the Standard Roll, when you type /r 1d10 into the Chat.
just change the values with your formula and you should be ready to go.
You can make your own changes, too.
<div class="message-content">
<div class="dice-roll">
<div class="dice-result">
<div class="dice-formula">1d10</div>
<div class="dice-tooltip expanded" style="display: block;">
<section class="tooltip-part">
<div class="dice">
<header class="part-header flexrow">
<span class="part-formula">1d10</span>
<span class="part-total">5</span>
</header>
<ol class="dice-rolls">
<li class="roll die d10">5</li>
</ol>
</div>
</section>
</div>
<h4 class="dice-total">5</h4>
</div>
</div>
</div>
for example, i added a Title just under the first div
@formal goblet i think i already asked this, but it is not possible to get a popup / userInput with just two Buttons, isn't it?
Like asking for Advantage and Disadvantage
Right now that user prompt only accepts a generic text/number field.
I put my advantage toggle in the sheet header as a dropdown.
yeah, my system has only two options: 1d10 or 2d10
So i think i will just make two Roll-labels next to each other. Should be ok with the Space
Is there a way to hide certain stats in a Item Container for certain items? I have a "weapons" where I need to show the Defend Roll for melee weapons, but not for ranged ones. I tried putting "item.range==0" in the visibility formula for the label, but it just hides it for all items.
In the image, the Defend Column should be showing for the Unarmed and Baton attacks, and not for the Heavy Beam Pistol
Use a formula in the label with a condition, something like this should do :
${item.range!=0? 'Yes' : 'No' }$
Replace Yes by your icon and the stat you want, for no simply let a blank ' '
Is it possible to call a Macro from a label ?
I made a small mistake 🥲 . Now it should be right. And have mercy, I´m a bit sick 😅
Hey, not sure if it's correct channel to ask this question, but I'm trying to translate one game system for my party. So, I tried to translate the text manually using visual studio, but it the Foundry cyrillic letters are showing as squares with "?" sign. Is there a way to change it somehow?
Never worked with json before tbh
Have you tried with another program like the base note app from windows or notepadd++? seems strange
@formal goblet Can you use a fetch in a dropdown list ?
I have multiple careers divided each in 3 sub careers.
In 1- the list of all careers
In 2- Here is my question. I want to make the dropdown list n°2 correspond to the results of dropdown n°1
In 3- For instance Academician has 3 results Engie, Scholar, Strategist
Yep, notepad++ worked perfectly! Thank you so much!
Yet another time disappointed in VS
Not in core as far as I know. But you can use the module advanced macros
The you can call the macro from a label wit a chat message /amacro <macroName>
Okay good to know thanks Mot'!
Ahhh yeah that makes sense. No need to have "item." In the modifier. Thanks! Hope you feel better.
Question about the Macro API
I have a roll message, that I will use for every roll, with just two changes.
Can I make a macro, call this roll message with given parameters?
For example actor.roll(defaultRoll){modifier := ref('STR'), dice:= 2d10}
Or something like this?
I tried and failed to come up with a good way to do that same thing. Ultimately I made separate dropdowns for each group of subclasses and show/hide them with visibility rules. There is a small downside to this though - each dropdown has a different key so before I can use it elsewhere I have to check the parent class also. (i.e. I can't just call something like ref('subclass'), I have to do something like ${equalText(ref('class'), 'adept') ? subclass_adept : ''}$
Am I missing something really obvious regarding cloning fields? Is there a way to do this that I am overlooking?
Like can I create a default layout for a weapon and then clone it twice for them to have three weapons on the sheet?
My work around:
Make a copy of the template, open both and drag and drop what you need from the copied version.
Nice to have: you have also created a Backup of your template with the Copy 😄
Oh I hadn't realize I could drag between template. That will work. Thanks!
You can also hold CTRL. Instead of moving, the component will be duplicated.
Is there some function that lets me duplicate sections of my sheet in the template? I was moving panels around and it duplicated the entire panel which had a lot of stuff in it.
Not sure if it was a bug or a normal function and accidentally triggered it. And if it isn't an intended function it totally should be lol...
Hello!
I have a problem and I hope someone here can help me with it!
I have designed some templates for Actors and Items in the system "Custom System Builder" in a test environment and created them from scratch.
Now I wanted to integrate these into my game world - but I overlooked that I had implemented them with the system "Simple World-Building".
Since I have invested a lot of work in this world: do I have the possibility to somehow transfer the templates from the CSB system into the other game world?
Thank you very much for your help! 🙂
Thanks for that it works very well !
I think that would be a good point for the FAQ
I think that is more a question for #core-how-to
But for a workaround:
#513918036919713802 look at the first pinned comment. That is shared Compendium Module. You can put everything you created into compendiums (Macro, Scenes, Journals, Music, etc.) An import them into your new World.
Just as an Idea'
Maybe you can just copy the things from your world (Scenes.db
, and so on) but I am not sure of it works
Here is hopefully an easy question: How would I call for a roll from a table in a Label using the label Roll Message? I have a hit location table that I would like to call with my 'Make an Attack' label, but I haven't a clue how the syntax goes for making a call to that table...
on your label roll message put this ${#Your table name}$
Hey! I'm back. I've spent a little time wrapping my head around using the computablePhrase API and have a theoretical question: If i'm getting this right i could build a computablePhrase that just lists all the csb variables from a sheet, compute the values and then use them for writing foundry core macros, including the roll API and core chat-message behaviour. Or am i missing something? (This seems promising in regard of my problem of evaluating individual dice from a roll. might be a bit overkill but hey...)
I think that should be doable. You would have pretty much the same capabilities like any other system/module because they all use javascript (or typescript) and you have access to the same functions from the FoundryAPI.
neat! I'm going to play around a bit. (read: I#m going to stumble around in the dark and maybe end up with something i can use :D)
game.actors will help you to get the necessary data paths. Otherwise... you have to look up some things 😅
@brittle moth , @formal goblet
I've been playing around with adding an extension as a module here:
https://gitlab.com/mattbeckpdx/custom-system-builder-actionbuttons
This lets me do things like manipulate field values with javascript and access the DOM for the sheet to tweak things/add interactions.
I've just pushed up my first crack at it, I'd love any feedback you all might have.
i have done alot with Macros and the System 😄
Some good to know things:
await a.update({system: {props: {<key>: <value>, <key2>: <value2>}}}); - let you change the Value of one or more keys
const obj = Object.entries(a.system.props.Table_Schaden).reduce((acc, [i, vals]) => {
const s = Math.max(0, vals.Schaden - 1);
const d = s === 0;
acc[i] = {...vals, Schaden: s, deleted: d};
return acc;
}, {});
await a.update({"system.props.Table_Schaden": obj});
``` - reduces every entry with Key Schaden in my dynamic table Table_Schaden by 1 and deletes the ones, that reach 0
alternatively you can use Advanced Macro module to call Macros from a sheetroll with /amacro <macroname>, or you can use the (propably easier solution) of mattbeck 😄
Thanks- I tried that, using my table name ${#Hit_Location}$ but I get the following error in the console:
Uncaught (in promise) Error: undefined. Uncomputable token Hit_Location
[Detected 1 package: system:custom-system-builder]
at math.SymbolNode.onUndefinedSymbol (Formula.js:723:27)
at math.js:26377:89
at Object.evaluate (math.js:24162:45)
at r.evaluate (math.js:24139:55)
at Formula.computeStatic (Formula.js:728:27)
at Formula.compute (Formula.js:292:21)
at ComputablePhrase.compute (ComputablePhrase.js:128:27)
at async HTMLAnchorElement.<anonymous> (Label.js:247:21)
Is it a normal table or a dynamic table?
its a normal table
Well, normal tables are irrelevant in terms of computations. So you cannot reference them
It doesn´t matter if a key is inside or outside of a normal table
ahhh, so you cant call a table (using the label message) from a normal table in Foundry ? This is not a table in the CSB/character sheet, just a table created in my Foundry game that I would like to have the label message roll on...I was not clear on that I think
Ah, so we´re talking about Roll Tables? Then it should be like this ${[#rollTableName]}$
I presume you put the [] around the hit table in your actual code?
🙌🙌
You can also use Roll Tables, using the syntax [#<rollTableName>]. Just put a # before your roll table name, inside
brackets, and the system will roll its default formula and integrate the result in the message.
You can customize the Roll Table formula by adding a Roll formula in this
syntax : [#<rollTableName>|<rollFormula>]. The formula must follow roll formula syntax, with :: to delimit the keys.
This formula can be a Dice roll or a constant value, the latter drawing always the same result from the Roll Table.
Yeap..."RTFM" is something ive told others to do...lol 
Seriously - Thank you folks very much for the help, I appreciate it
It looks promising from the first sight. If you like, we could integrate this component into the system as a core feature.
Please let me know by an issue if you implement a Component you think should be available to all ! Link your
implementation, and I'll most likely add it to the system !
One thing I´d do different is to do the alteration of the value via key + formula (almost like Item Modifiers work) instead of via a script. This makes it easier for the user (better readability, no boilerplate-code like document.querySelector()) and is also safer.
afternoon fellas. I am totally new to this and am hoping to hop on in. I have a rudimentary knowledge of C++ and was hoping if I could find some help for the baby steps of making a character sheet
Do you know what a key-value pair is?
safe to assume it is a key'd term with a value attached to it?
Thanks. And yeah, that incrementing counter is more proof of concept example than practical code. In reality, what I want this for is to do things that are too complicated to do in just formulas. For that, getting at the dom and rewriting things makes sense (to me).
That´s basically what you need to know for most of the work. The rest is in the documentation: https://gitlab.com/custom-system-builder/custom-system-builder
i have that site open but it still seems kinda confused and sterile
well, guess i should be able to beat my head against this wall till one of us breaks
And how would it be different to a macro? 😅
Somewhat personal preference I guess. I want to keep the executable javascript as part of the sheet itself, tied directly to the button. I should probably do some actual paid work here for a bit, but I'll post a more complex / real example soon 🙂
How might I go about connecting something like this to a rollable label?
Like, a roll is done, ammo is subtracted by 1
I was planning to do the macro but this could be simpler?
As Martin said, this looks great 🙂
Not really a fan of letting people use javascript directly, as Martin said, but that could be an 'advanced feature' of the component.
Something like that is planned anyway in the system, maybe I'll reuse some of it if you allow me to 🙂 (with credit of course)
I suspect for what you are describing using a macro is probably actually easier, or at least as easy. 🤷♂️
Basically this just creates a button with a click handler you can pass js to. So, I imagine you could code a button so that the js fires the roll and changes the ammo counter, but I'm not sure it saves you anything vs using a label roll and calling a macro to do other stuff along with it.
You'd use this instead of a rollable label and key off of it to do whatever other manipulations you need.
Absolutely, if it makes sense do chop any bits of this out go for it. I totally get why you might not want to give people js access directly in core, but for me that was the goal here 🙂
For my specific use cases I have at least 2 things I'll be building with this.
- New Character button that sets up a character at 1st level
- Add Level button that handles all of the conditional logic for what you get at a certain level for your class/subclass/etc. I can sort of do this with just labels and existing fields, but not for things that rely on user choice. For example w/o this I can fairly easily render spells per day, but not pick 2 more spells or pick a new feat that you qualify for.
Totally understandable, and that's why I gave access to the componentFactory in the first place, so people can do whatever component they need ^^
One thing that I think might help folks would be some sort of scaffold or a super minimal hello world example along with the docs. I had to sort of muddle through some of it, not too bad but I had to dig into the system source a fair bit to puzzle out some bits.
You're right, it would be helpful. Then again that takes time and I prioritize new features rather than this to be honest ^^"
I'm so sorry i am the one at first who told you a bad move i forgot the [] in the formula i gave you (andi just tested it just before sending it to you to be sure and still made a mistake) xD
What is that @brittle moth? priorizing quality over quantity hmmmm? sigma.
Hello!
Somewhere I still have a bug here, which I'm sure you can help me with:
I have an item container "item_container_armor", in which I list all armor parts. In this container I give the respective armor value per part to "key_item_rw".
Now I want to output the sum of all armor values in another place. This is what I did, but unfortunately it does not work:
${floor(sum(item_container_armor$key_item_rw))}$
Can you tell me where my error is?
Thanks a lot!
Funktioniert... Vielen Dank! Es gibt keine Möglichkeit, Modifikatoren direkt in den Templates zu setzen, oder?
Nope
Ok... Danke!
Does someone can tell me how i can access an item Field Text from a Js file? I don't know Js ^^"
I tried theses:
let itemDescription = {{item.description}};
And
let itemDescription = ${item.description};
But it doesnt work as you can tell lol
:= not = ?!
You need a reference to the Item Path. It might be easier if you do the call from the Item directly, but if you do it from an Actor (or elsewhere), you have to get the right reference first (which includes some filtering logic to get the right Item). After that, you can call system.props.Key on the Item reference to get the value of your Text Field.
{{ }} is something I only saw in HTML (data binding in Angular), not JS 😅
${ } are template literals and also something completely different from what you want: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals?retiredLocale=en
Custom System Builder 2.3.0 - Roadmap !
Hello everyone !
Here are the features I will integrate in the version 2.3.0 of Custom System Builder ! They are listed by order of priority, meaning the most top ones will be developed first and the last items may not be in 2.3.0 if I can't develop them and release 2.3.0 in a reasonable amount of time 🙂
- Formula computing [#126 - Allow roll messages to edit values on the sheet]
More customization, as clicking on labels will allow you to directly edit values in the sheet ! This will unlock new possibilities like healing, recovering spell slots, or ammunition management !
- Component configuration [#215 - Add delete warning on component deletion]
Little safety update to prevent deleting components by mistake, just like it is in place for dynamic table rows.
- Component configuration [#166 - Predefined lines in Dynamic Tables]
You have Dynamic Tables that always begin with the same rows on character creation ? You will be able to configure them so that newly created characters get some pre-entered rows !
- Formula computing [#170 - User input dialog rework, with more field choices like dropdown or number fields]
A full rework of the User Input dialog to allow more flexibility on rolls with options, with number fields, dropdowns or checkboxes to use freely !
- Item management [#5 - Ability to add items to other items]
Big, BIG work on this one but you want it so much, you will be able to add items to items, create bags with all your belongings, guns with accessories to enhance their capacities, enchanted weapons with spells directly attached to them !
- Item management [#155 - Conditional item & active effects modifiers]
You have situational modifiers, coming from items or status, and it's a pain to remember them all and add them when rolling ? This will allow you to select modifiers when triggering a label, to add the correct bonuses at the right times !
These will be shipped with other small features and bugfixes 🙂
Thank you again for using the system !
Holy fuck, what a big milestone. Especially with Items in Items.
Youston I have a problem!!
After the last but one update I moved a Panel from a tabbed-panel in order to remove a tab from this Tabbed Panel. I couldn't delete it at that time. I made the last update and was able to delete the recalcitrant tab.
Since then I can't use the form to create a new character and my test character is not accessible anymore. (the model sheet is still accessible).
What can I do to make things right?
I am absolutely losing my mind over 126, the ability to edit values with roll messages is going to be so so useful
Use this for making backups of your templates (see further for the macro only)
Otherwise you have to look through the Json and finde the error. Or maybe martin can help you with finding it.
It helps when you know the keys of the moved data
anything gonna change if i update to the newest from the last one ?
what do you mean ? you're talking about the system's versions ?
If that's the case, you will just have more functionalities available 🙂 It should not break anything
Problem solved (but bug still active?!)
I had to use a trick of sioux. I made a new character_template, created a new Tabbed Panel and drag and drop the items from the non operational form to the new one. I still have to fill in configure hidden attributes
Here's a thing I'm fiddling with that others might find helpful and/or if anyone has a better suggestion I'd love to hear it 😉
I'm working on some sheets with a lot of conditional logic via javascript. I'm mostly using a custom module for this, but it could also be a worldscript or macro if that's your jam.
For my use, I'm putting a lot of the mechanics of leveling up characters into the sheet. To keep that manageable, I'm storing the reference data for it in various json objects. Initially, I had them in hidden fields on the sheet itself, but that meant that every character using the sheet would have this sort of hidden bloat weighing down it's data, kind of ballooning the props.
So instead, I've put them in a template called globals. It has no other fields aside from those hidden fields. Even though it's a template, not a sheet itself - templates are Actors so I can reference them like:
const globalsActor = game.actors.find(actor => actor.name === 'globals');
const globalFields = globalsActor.system.hidden;
const class_levels = JSON.parse(globalFields.find(row => row.name === 'class_levels').value);
Keeps things nice and contained, and let's me keep the hidden fields on the sheet itself to things that normal formulas doing calculations needed for rolls, etc. (ability score mods, etc).
A question on the plan for 2.3.0. Will the changes to items and formulas mean that a macro can safely change one of the values on an item? Currently, if I have a macro change an item (one of the parameters of the item that is used by the sheet), it makes all the computed values NaN.
thx 🙂 Ill take the chance 😄
quick question: does Custom System Builder support the Forge's Shared Compendium module? I'm trying to import some data from another world and not having any luck getting it to show on the Manage Modules page
It won’t show there if you have a different system requirement set for the module.
ah gotcha that makes sense, thank you!
This is super helpful, thanks! Any plans to also make items inside an item container be reorder-able by drag'n'drop in the future?
Drag & Drop, I don't know, but reorderable is planned, in the same way as Dynamic Tables 🙂
Everything is possible though ^^
I have been made aware of some bugs in the last version regarding Component saving
Currently (in v2.2.2) it is impossible to save columns in Dynamic Table and Item Containers. I am working on it at the moment, it should not take long to fix.
Please do not hesitate to tell me if you run across other bugs like this 🙂
Everything should be good with the fresh 2.2.3 version 🙂
RIP Version number 2.2.2 😅
great update! thank you!
got another quick question for you folks:
I can't quite wrap my head around the formula syntax for updating an actor property upon item equip. I've read through the FAQ and believe I've followed the instructions correctly for the example there (https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/FAQ/Frequently-Asked-Questions#q-i-have-an-item-container-with-inventory-items-and-i-want-to-sum-up-the-weight-of-each-item-but-sumfetchfromdynamictableinventory_container-weight-doesnt-work-is-there-a-way)
attached show what my setup looks like right now. for the item modifier key, I've tried:
- attack_dice_hero
- ref(attack_dice_hero)
- getPropertyDataFromActor("selected", "attack_dice_hero")
have I completely veered off course? can someone show me the light?
The modifier-formula should be without the item.-prefix.
Look at that MuScuLaRiTy!
thank you! I updated the formula as you suggested and the console seems to show everything falling into place correctly, but I'm not seeing the character get updated after adding the item to the inventory. I know the target value to be updated should be a Label component, but does the source component in the item sheet need to also be a Label? I also want to be sure I'm future-proofing since I read that some older syntax is being deprecated
Hi LinkedFluuuush
A minute ago i just wanted to ad in version 2.2.3 a roll message in a new and empty label like I did 100 times before – but now I get “Error: Component key should be unique in the template.”
But the key field is empty and I never needed a key for a roll message before!?
Is this a bug or a new feature?
Sure looks like a bug 🙂
Ok, so rolling out the red carpet for the amazing and all mighty version 2.2.4!? 🥳
May the Fluuuush be with you.
Sorry for finding bugs so often...
I am absolutely thankful for your work.
No, I am sorry for making them 🙂
I thank you for finding the bugs ^^
2.2.4 Available with the bugfix 🙂
Drag&Drop changed many things in the component saving procedure, so these bugs are understandable, but I'm sorry if it affects you right now 🙂
fucking sick update, wow i cant wait
I am unable to create any new actors at the moment, after updating to 2.2.4. As soon as I open the sheet for an actor, I get this first error. Hitting the template refresh button nets me the second error and nothing loads.
I can confirm the above issue, my console gives the following error message:
actor-sheet.js:76 Uncaught TypeError: undefined. Cannot read properties of undefined (reading 'getAllKeys')
[Detected 1 package: system:custom-system-builder]
at TemplateSheet.getTemplateKeys (actor-sheet.js:76:65)
at CustomActor.getKeys (actor.js:537:42)
at CustomActor.reloadTemplate (actor.js:564:38)
at HTMLAnchorElement.<anonymous> (character-sheet.js:80:28)
at HTMLAnchorElement.dispatch (jquery.min.js:2:43064)
at y.handle (jquery.min.js:2:41048)
I just posted this ^ issue on the gitlab issues tracker for CSB.
Can I make levels and durations for status effects or do I have to use items?
A tab got deleted from my charactersheet. I do not know how. I didn't reload any of my other actors. Is there any way I can recover it?
some additional feedback: I think part of the issue is that when dragging a component to a new panel, or even just across the existing panel to a new spot, it seems that the system tries to make a copy of it by appending "_copy" on it, but it doesn't remove the _copy after successfully moving the component
NVM fixed it
I saw the issue and know how to fix it, unfortunately I don't have access to my PC until monday. so I won't be able to fix it until then :/
How do I get the name of the actor that the player is targeting?
I know this might be a long shot but...is there a way to create a permanent dynamic table? Where you can add entries and (most importantly to me) use fetchFromDynamicTable, but the actual data in the table is the same between characters/templates?
I have a pretty big list of skills (22 or so) and each one adds a stat and a specialization bonus to the skill roll. I bascially want to create a lookup table that will search for the name of a skill, add the associated stat and specialization bonus, and return the total to the roll. But the only thing I can think of to make sure the info is permenent across templates is to use a standard table, which means naming each cell.
If I could use dynamic table, I can just define the columns and enter the skill names and bonuses one, and copy it to the template so all characters have it
damn, no pins
I have a pretty big list of skills (22 or so)
Haha...come back when you get over 150...🥺
You could try to make a separate sheet just for lookups and use getPropertyDataFromActor() to pull from it's fields.
Predefined lines for dynamic table are on the roadmap for the next update
okay, but... why ||joking though, I have an annoying amount of stuff in my system too haha||
I also seem to have issues with the advanced config, specifically hiding tabs with the formulas. It hadn't been working very well in the previous versions, but now it seems to not work at all with the current version.
it seems that the latest update broke the ability to apply a template to sheets.
nevermind, it was just lagging real bad for a bit
Heya, is there a simple guide available for building character sheets? perhaps with some examples, how-to's, and other protips? I've been somewhat struggling with it.
Pinging @stuck python to try and pull you into this channel
got it!
hey! I started using this as I'm developing my own system, and am thinking that Foundry would be a good platform to automate some stuff in. I've managed to do some character sheet creation, but I'm a little stuck on basic macros. I have no experience with CSS so I'm a little lost
Well, for macros it's gonna be JavaScript. CSS is for styling stuff, while JS is for doing code stuff
Right, yeah
I have no experience with that either
Fortunately there are a lot of helpful people around if you have specific questions
I'm basically trying to start with a macro that would read a value I have on a character sheet, and add it to a d20 roll. I'll go further from there
sort of confused how the compute prhase and stuff works, does that go in the macro?
So, grab the value, roll d20, add them together, and output it in chat? ```js
new Roll(1d20+${actor.system.value}).toMessage()
Where `actor.system.value` is pulling `system.value` from an actor, using JS string literals with `${}` to pull a JS variable into a string to feed into the Roll before using `toMessage()` to evaluate the roll and post it to chat
alright, how do I know what the current "actor" is?
I'm not sure how CSB actually stores all its values, I haven't used it myself. That's just the general idea for how stuff would go
If you're running it in a macro while you have a token selected, it should be the actor for the currently selected token (either that or the current user's selected character, I can't remember; token.actor will always get the selected token's actor, so that's also an option)
does .system need to be something specific?
The whole .system.value part is the path to the data in the actor that you actually want to pull stuff from. I've got no clue how CSB actually stores its data. If you bring up your browser console (F12), select a token, and run _token.actor, it should spit out the actor data of that token, which you can poke around in to find the exact variable you want (there are other ways of finding stuff, but that's my go-to)
I think I'm a little confused in some areas. The ReadMe talks about ComputablePhrase. Am I suppose to build my own ComputablePhrase things within the code itself, or am I supposed to somehow put that into the macros, or is it just something I don't touch?
If you just want to make a basic roll from the sheet (say, a skill check), you don't need a macro. You just need a label with a roll message.
True, I did find out how to do that
However, if I want do so something like an attack, where an enemy is targeted, can I do that in a label roll?
awesome thanks!
I have a question how can you get a player sheet to factor bonus like if you have 12 strength how do you get it to register the plus 1 bonus to profenceny
How do you assign modifiers to status effects?
Hello @here 🙂
I am working the the fix for the issue preventing template reloading, or character creation.
In the meantime, there is a workaround :
When Reloading a template, if you have the template actor sheet open next to the character, it should work.
Please ping me if this workaround does not work for you 🙂
Indeed there seem to be issues with tab edition. I'll look at it 🙂
Hello I'm really not trying to rush anything, I'm just curious, when should we expect the 2.3.0 ? This update is incredible and I want to see if it's worth for me waiting in order to design some aspects of my system using the new features of this update
thanks you again for the huge work on CSB btw
I put them in hidden fields on the sheet and use their formula to do the calculation
I was wondering about the hidden attributes vs regular attributes. Do the regular attributes somewhere? They didnt seem to show up in any obvious way so I'm just using number fields to store player stats
Using a Key for any component uses public attributes
Number fields, text fields, etc will map the key’s value
Ah, so if I set an attribute key as like, "Strength", and have a label in the sheet read from the "Strength" key, it would copy any number in there?
Your Label would need to have a key if you plan to reference this Label somewhere else.
Let's say you have a number field Strength: 5 and a Label TotalStrength: ${Strength + 2}$. If an other Label has the formula ${TotalStrengt}$, it would display 7 as the value.
Okay, cool
alright, i think I'm getting it now, I can have labels in my sheet that perform attacks, and then I can have a macro which just calls that label's key so the sheet doesn't necessarily have to be open
it's the best feeling when things start to click into place in one's mind
What's the "recalculate" function good for? Would it be useful to detect when a value is changed somewhere and update something on the sheet?
also, trying to get a basic attack roll vs dodge thing to work, but its giving an error, and I can't figure out why
whoops it should be target not targeted
It's useful if you want a way to parse custom formulas from the user-side. For example: Text input inputField: ${Strength}$ and Label test: ${recalculate(inputField)}$... Label would return the formula result of inputField
ahh cool
Given the amount of bugs following the version 2.2.0, and the size of the planned features of 2.3.0, I would not be too hasty. I can't say for sure when it will be ready, but this could take a couple of months.
If I change a rich text area in an actor template from in sheet editor to dialog box, will that erase all the text that's already been written? I don't want to try it and potentially lose dozens of hours of writing and have to start over.
It should not, but just in case, you should copy/paste your text in word or something 🙂
Not to whine, but anyone got any recommendations for tutorials or other sources of help? ^^: I've been trying my hand at it to build a custom sheet with the instructions on github, but so far It's.. Not really clicking.
I found this video very informative: https://www.youtube.com/watch?v=yGVOj_iqiKg
The new Custom System Builder for Foundry VTT (was Modular System)
Custom System Builder: https://gitlab.com/linkedfluuuush/custom-system-builder
Sandbox: https://gitlab.com/rolnl/sandbox-system-builder/-/tree/master
Sandbox Video: https://www.youtube.com/watch?v=V9IXafKPK2I
GRPGA: https://gitlab.com/jbhuddleston/grpga
Using Foundry without a...
Hey guys any ideas why this is not working ? Any of if ?
${fetchFromDynamicTable('runes' , 'effet', 'effet', 'Étourdissement')}$
${fetchFromDynamicTable('runes', 'qteeff', 'effet', 'Étourdissement')}$
${fetchFromDynamicTable('runes', 'effet', 'effet', 'Saignement')}$ ${fetchFromDynamicTable('runes', 'qteeff', 'effet', 'Saignement')}$
${fetchFromDynamicTable('runes', 'effet','effet','Poison')}$ ${fetchFromDynamicTable('runes', 'qteeff', 'effet', 'Poison')}$
runes is the name of the dynamic table
effet is the key of of its columns
qteeff us too
Étourdissement, Saignement, Poison are values that use to filter the Fetch.
These formulas are stored in a label that return no result
Is it possible to create a dynamic table with varying columns depending on what you put in a dropdown menu?
Right now I have a dynamic table, and if "Multi" is selected in the Type dropdown with a fresh row, I want a number field to appear in the "Multi Count" column. I'm thinking that the "visibility formula" should handle that, but it doesnt appear to do anything. Any advice?
DynamicTables are made for a dynamic count of rows. I don´t think that the same applies to columns
Dang
Would it be possible with a regular table?
I don´t think so. You´d only be able to hide the content of a table cell, not the cell itself.
Do you get a result if you just use ${fetchFromDynamicTable('runes', 'effet')}$ ?
I believe that actually works for what i'm going for
yes
Oh, that´s good. So if you use ${fetchFromDynamicTable('runes', 'effet', 'effet', 'Poison')}$, it should return Poison if you have a row, where effet = Poison
It's what I want it to do
but for some reason it does not work
maybe because effet is a label that coded so that it takes different values depending on another variable?
this is how effet is set :
${sameRow('name', 0) == 1 ? 'Dé de dégâts' : sameRow('name', 0) == 2 ? 'Dé de dégâts' : sameRow('name', 0) == 3 ? 'Blocage' : sameRow('name', 0) == 4 ? 'Blocage' : sameRow('name', 0) == 5 ? 'Précision' : sameRow('name', 0) == 6 ? 'Précision' : sameRow('name', 0) == 7 ? 'Magie' : sameRow('name', 0) == 8 ? 'Magie' : sameRow('name', 0) == 9 ? 'Étourdissement' : sameRow('name', 0) == 10 ? 'Étourdissement' : sameRow('name', 0) == 11 ? 'Chargeur' : sameRow('name', 0) == 12 ? 'Chargeur' : sameRow('name', 0) == 13 ? 'Saignement' : sameRow('name', 0) == 14 ? 'Saignement' : sameRow('name', 0) == 15 ? 'Poison' : sameRow('name', 0) == 16 ? 'Poison' : sameRow('name', 0) == 17 ? 'Portée' : sameRow('name', 0) == 18 ? 'Portée' : ' Aucune Rune'}$
Uiiiiiiiiiiiiii, that´s long
but it works don't worry
I mean it displays the correct message for the correct value, and the text is fetchable if I do not filter it
the problem only occurs when I try to fetch and filter
huh, weird
yeah xD
Does it pull up any specific error in the console? I might know the issue, but I could be wrong.
With this I mean
Is name a dropdown and do you need the numeric values from it?
name is a dropdown list that links name to a number, this number is used then to apply a description, and effect, a weight....
The way it works is that players select the rune they want to apply to their weapon through a dropdown list, and then the rest of the dynamic table fills alone
using a system of conditions
nop
I would probably outsource the whole block into a (hidden) lookup-table. It would remove this conditional clusterfuck and you would have a better overview over it
Really? Weird.
wait, how would you do that?
It would be a dynamic table. And it would behave the same as a VLOOKUP() in Excel or Google Sheet
Oh I think I get it, I hadn't actually done that, but it would definitely help with the absolute *mess my formulas end up being a lot of the time
wait... how are you supposed to do that ? how would you convert the condition system into a dynamic table ?
Imagine we can raise a value from 0-25:
And the values in column A are the costs, which are needed to raise our value.
We would simply look, which our current value is and filter by it in the dynamic table
The formula would look like this: fetchFromDynamicTable('LookupTable', 'A', 'Value', sameRow('Raise'))
I see... clever
Oh I already do this proficiencies in my system, it took me a moment to get it, I felt very lost ngl.
So I'd need to create a dynamic table that contains every rune and their description, then make in hidden. In this table I'd need to set a number as I did with my condition formula where every number corresponds to a raw where each column correspond to a specific information about the rune. Then, when the players select in a dropdown list a rune that is linked with a number the label will fetch the values from the table
correct ?
im having a weird issue. I have one item template that has a roll and when rolled it has a header at the top before the rest of the formula that simply outputs the name of that item. So its just ${name}$ wrapped in a header. Simple and it works fine
I have another item that is almost the exact same thing and it works completely fine when rolled. But as soon as I put ${name}$ it doesn't output anything. I can even put regular text like "TESTING" and it makes it a header. But if I put code, it gives me nothing
it is a longer piece of text with more code in it so idk if that makes a difference
Hi, brand new to Foundry and found CSB, really enjoying learning it and trying to implement a new game system I've been working on. I do not have a technical or coding background at all so just wanted to say I'm extremely grateful for you making this kind of thing accessible
the mistake is probably is the rest of the code, why don't you show us what it is
also look the error message in the console
Hey, so I'm doing a item container. One of my columns is labeled "Damage", with the key being "Weapon_Damage". I have another column which makes a button which should make a roll for what is listed in the "Weapon_Damage" column, which is ${[:sameRow('Weapon_Damage'):]}$
I have "1d6" for a particular item in the Weapon_Damage column, but for some reason the formula isnt working, any insights?
just tells me uncomputable token name.
which is confusing since ${name}$ worked on the other item
Oh, you're trying to roll a dice and not just display a value correct? So, any errors in the console?
sorry for big spam
and in my other code for my other item, its exactly like this with ${name}$ at the top and it works fine, outputs name of the item
okay i delete, never fucking mind, i figured it out
relax, I was looking
sorry for wasting your time. I realized that it worked when it was within an item container but if it was just an item without belonging to an item container the ${name}$ did not work
I appreciate it
Ah okay
I just figured since my roll is from within the item sheet, the item container didnt matter
i figured wrong
Yeah, you have to redefine the formula, because sameRow() doesn´t work in an Item Container. To be more specific, you cannot reference ANY Item Container Label in an Item Container 😅
Seems correct
Damn, that's annoying
Wanted to use item containers to easily give weapons to players
Items are still very beneficial. It´s just that formulas can get redundant if your calculations can be dependant on your columns
Yeah
The issue is my weapons generally have similar values and properties, except one or two "types" are handled a bit differently and have a couple extra values. I wanted to have a table that could have spots for those values if a weapon was that specific type, and then be able to read from those.
I can do that with a table, but the issue there is I have to have each row have its own key for each column, so Weapon_Damage_1, Weapon_Damage_2, etc, which would get a bit messy
actually, i think I just figured it out with dynamic tables, nevermind
what's the equivalent of fatch fetchFromDynamicTable() for a regular table?
not really anything I believe, you just have to reference the key
this is............. really true
why was I trying to make things more difficult that they are
I have a form-fillable PDF for character sheets, but I'm trying to make a macro that interacts with the fields. I'm just learning Foundry, any advice?
you guys are very helpful ill prob have alot of questions bout to start doing little more design on my system right now
Does anyone know a way to measure the distance between two tokens within a formula? I'd like to be able to determine the distance between the actor and target token within a label formula if possible
if not, is there some way I could do that with a macro or script and read the value from that into a label formula?
That´s probably scene-data. That´s not supported by CSB so you have to fall back to macros or modules
So, maybe this is interesting for someone here (or maybe, you'll tell me i could have had that way easier 😄 ): Building a computablePhrase that just lists a bunch of properties from your sheet and using that in vanilla-style macros works. Some example:
`//generate computablePhrase from csb-sheet
let phrase = new ComputablePhrase("${ROLL_ATTR1_VAL}$, ${ROLL_ATTR2_VAL}$, ${ROLL_GAD_VAL}$, ${ROLL_RISK_VAL}$, ${ROLL_SKILL_VAL}$, ${ROLL_SKILL_DD}$");
await phrase.compute(actor.getRollData());
let buildPhrase = phrase.buildPhrase;
let values= phrase.values;
//translate CSB-Phrase-values to named variables
let Attr1 = Number(values.form0._result)
let Attr2 = Number(values.form1._result)
let Gad = Number(values.form2._result)
let Risk = Number(values.form3._result)
let Skill_value = Number(values.form4._result)
let Skill_name = values.form5._result
//roll formula
let roll = await new Roll((Attr1+Attr2+Gad)+"d6cs>3").evaluate({async: true});
let riskroll = await new Roll(Risk+"d8cs>5").roll({async: true});`
im working on gear section of my character sheet and how would you make a panel for say the primary weapon would you do a table and just put how many columns and rows you need to put in info
for example
Name | Attribute
Dice | Mods
or is there a better way to design weapon holders for character sheet
Hm i wonder if I can put an item container inside an item
No
Make a dynamic table with two item containers. Closest you can get
I'm going to assume there's not really a way to modify an item's values from a formula on a character sheet
I think Version 2.3 with items within items and such would allow me to do what I'd like to do
Basically, I want to be able to have an item in an item container have an amount of ammo within it, which goes down when attacking. Additionally, you could select different kinds of ammo which modify the item's values in different ways