#Custom System Builder
1 messages · Page 52 of 1
This problem, sorry.
When I roll only the ${${!item.Sound}$}$ all I get is an error in the chat. Clicking that error gives me this console error:
I've tried re-writing the sound macro in a different way. The macro itself still works but I get the same problem.
Hi! Is there a way to show on a roll-message the selected label, not the key, of a specific drop-down list?
your best bet is to use ? : notation to 'reconvert' the key back to its label.
${ ref('dropdownkey') == 1 ? 'say this' : (ref('dropdownkey') == 2...
Hey Hivemind: What would be the best approach to programming things like "Feats" or "Edges / Hindrances" that would do things like give +/- to a specifc skill or bonus health, etc.
Right now I have a hidden tab with a variable for each skill - and a lookup to see if they have the "Advantage" equipped - and then calculate the bonus if they do. But I feel like that many lookups are probably not the most efficent.
Items with effect type modifiers to existing keys, likely.
Do you - or does anyone - have any examples of how to use the Item Modifiers. There isn't really an example on the GitLab page, and I tried a few different things and they did not work.
I can, but it'll have to wait a couple hours for me to get back on my Foundry so im not just guessing when i say stuff. I'd work with simple stuff to sort it to start. The modifiers are written like formulas.
If noone else chimes in ill give you some examples later.
When you get a chance, if you can share some screenshots, I would appreciate it.
Thank you!
I read through most of the README.md and sadly could not figure out a solution to the ${${!item.richTextArea}$}$. Is there another place where I may be able to see examples of it working?
If I run just the macro inside a roll it works but displays an error on the chat log:
%{fromUuidSync('Macro.n5c1uxvyV2GCI1DG').execute();}%
But of course the point is that every item would have a different sound, so I need it to be defined in the richText.
I tried creating a new sheet and isolating the issue, but it all just ends up with the same error and no sound.
Is there another way to make rolls from itemDisplayers play a sound, if this one doesn't work?
As far as i remember Martin used this in his example template: https://foundryvtt.com/packages/custom-system-builder-example
Anyway it is a all-encompassing sorce of posebiletis
Custom System Builder - Example, an Add-on Module for Foundry Virtual Tabletop
Do you know how to run a macro from a richTextField in a sheet?
Directly from a RichTextField – I don’t know.
But I use textfields (editable by players) wherein I store names of macros and made them executable together/with label-roll-messages.
Same should be posible with RichTextFields.
Inside label-roll-message:
%{return await game.macros.getName('${mytextfieldkey}$').execute()}%
Macro has to exist and be executabel by the user.
hey did someone know how i put a roll formula in the rich text i guess im a bit stupid right now xD
man am i missing something here?
two people asking how to put stuff in rich text area...???
i can't wrap my head around the usecase for that???
How come my players cannot edit rich text areas on their items?
i only know how to write a macro and put it in the text field. But i dont wont to write a Macro for every different diece combination so i askt that. I tryed everything from what i know so far but it dont worked so i ask again. Can some one tell me how to set a roll formular in a rich text?
what im getting at is, aren't labels a lot better for macros and roll use cases? why specifically rich text?
am I missing something?
because i do a Spell template withe a richj textz area to put descriptions etc in it and wont to make the damage velues posteble
for example
🤔 oh okay- you're not putting a macro IN a rich text area, you're calling to reference a rich text area in a macro
I've done that a few times, you can ${ref('RTACOMPONENTKEY')}$
no i want a klickeble earea in the text for my players to klick sc
like this but without making a macro for it
erm... ok... so i ask - why not just have a label beneath it?
sry my english is not the best and im a dyslexic xD
bc if i make a Lable i have to make a differnt tamplate for every spell
no sir, you just have to make a more robust label function.
let me load my world, one second
Sorry for the long delay, I had to sleep, I would've been no use to you typing when I got back last night.
So what happens here is that having the Educated Focus Item (like a Feat from D&D) provides the character with +1 skill point to spend per level (focus description on bottom right). The item does this through a modifier (top right). Key takeaways here are no formula or key indicators in the key that you're modifying, just the name of the key in the 'Key' field. Also, make sure you set the priority to something other than 1. The target key must be contained in a label, (in my case it's the Skill points per level field on my Game Data tab of the sheet, which I've included for you to see in both the config (top left) and sheet view (center). So even though the label is set to a flat 3, the value on the character sheet is 4.
I know I set another modifier somewhere that used a formula, so let me find that and I'll get that up here too.
how? and how do i eddit it for every spell?
Attacked with ${item.name}$<br>
${ref('item.itemDamageDisp')}$<br>
</div><div class="chat-roll-result-two">${[:ref('item.itemDamageQuant'):d(${ref('item.itemDamageVal')}$)]+(ref('item.itemBaseModifier'))}$
that's a button i made within the item container that gets the item's name, the damage displayer from inside it, and then the actual quantities of the dice and modifiers and makes it role
the GM view of the item:
1 button for all my weapons.
okay and how much i have to set up for this to work?
🤷 not much.
you just need to reference your item's components
no offence this is 100% usefull, but for my problem it wuld be easyer to just say me if its posible and if how XD
and how do i do this
i will make an easy systhem i just need to know ho to put an /r 1d10 in a text so i can cklick it
i have no clue how you'd add a working macro into a rich text area.... it seems that it wouldnt work but im not a computer science guy and martin didnt outright say its impossible yesterday.
just put a number label or something in your spell template to show the quantity of dice, another for the type of the dice, and another for the modifier and reference them in the button.
Ah, here it is:
In this case, the armor is set up to provide the bonuses only when equipped, so the value formulae each have a conditional in them. Again, note that the priority is set to something other than 1, the keys are in plain text format, but the value formulae use the normal markup. In image 2 you can see why I went about it that way, it was so that a character could conceivably have two sets of armor on their person, but only the equipped (readied) armor modifies the stats. Once again, the target of all modifications are label values. (further explanation; the Readied Armor item displayer is filtered to only show items with template _Armor and item.Readied == true)
i dont know why but
"subtle?" "obvious." made me chuckle.
what kind of system are you running?
Cities Without Number
ah you mentioned that the other day.
i've been meanign to give that one a try. huge fan of stars without number.
would love to check out their fantasy approach
Yeah, I've been pretty much buying anything that Sine Nominae puts out for the last 15 years or something. Worlds Without Number (their fantasy approach) is good, I've run it for a couple groups and it's very fun to run. Godbound (his Exalted Take) is also very good.
I didn't pick up Wolves of God (Celtic Fantasy/Historical) but I've heard it's very good as well.
As for the subtle? part, that's the Concealment rating of the equipment. Two possibilites, it's subtle (needs a scanner or Notice check to detect) or Obvious (you can't hide it).
Cyberware gets a bit more involved, but it's just as intuitive:
[[1d10]] in the RTA
ty ❤️
must ther more bc it dose not roll it?
now celtic historical mythology may be REALLY interesting. I've always loved their mythos.
That was the first one that he did as an offset-print format, I think it's available on his website or on DTRPG if you're a digital type. His layouts are really good too.
only roll it if i open the area and dont post it in chat
is okay if it is so but wuld be cool if not xD
Dunno. Foundry is converting those inline rolls, CSB doesn't influence those.
okay but so or so ty
Can I see the code for that button? I feel like it's doing something that I want to handle the same way, but it's slightly eluding me and I'd like to work through the logic on it. I also would like to see how you set up the divs for that image on the roll message.
I stepped away from my pc to run some errands. i'll get back to you ^^
Np, tyt.
Trying to add an empty string (like a rich text area without text) to a roll message errors out, how do I only add it if it isn't empty?
Like you want some empty space in the roll message?
No. Lets say I have a rich text area called defenseNotes
In my roll message, I want to add some other information, and include defenseNotes
Which errors out if theres no text in defenseNotes
You could include some default text in the defenseNotes component, like "None". There might be another way but I want to try it before I say anything so let me poke at my testing tab.
Could I see the code you're using? It's not throwing an error for me when I directly reference either an empty RTA or Text field.
I just get this:
Fortitude save: ${[1d20] + fortitude_save}$
${!notesDefenseSaves ? notesDefenseSaves : ""}$
${!notesDefenseFortitude ? notesDefenseFortitude : ""}$
I tried just using ${!notesDefenseSaves}$ but that didn't work either
What's the error?
Could you double check that you have the key spelled right and you've re-loaded the character from the template? It's one of those "Are you sure you have the power cable hooked up correctly questions" but I do it myself more often than I'd like to admit..
That error usually means that there's a configuration error with the component.
Hm. Let me duplicate that quick.
fromUuidSync('uuid').system.props in the console. If a value is undefined, it has the same meaning as non-existance.
I just ran the code in image 1 with the fields empty (first roll) and then filled (2nd roll) and it seems to work for me?
I don't know why fromUuidSync isn't working, copied the uuid from the actor doc
just returns null for any uuid
Show it
That not an UUID. That's an ID
I looked it up on the wiki and they have it backwards, they say left click is uuid while its the reverse
It is actually left-click nowadays. Which version are you using?
11, since most modules don't work or have warnings for 12
I see. Well, some things changed since then and there were also bugfixes along the way.
I had the same issue when I ran v12 though, that including an empty text field error out
That's probably if you run an old component config
When I asked the same question for the v12 instance which was fresh and separate from this one
We got rid of that issue some time ago I think, but I can't tell you when. You see, that it does work for panzerkraken in the latest version.
Is there a way I can just add a blank space or invisible character to the default text area to "fix" it that way? or just a space doesn't get saved.
Once the RTA is created, it will not consider default values
I think the fix is to hit the save button for each entity using the RTA
Yeah, but it would solve the issue without the player needing to open all the RTA's to instantiate them. Just opening and closing them seems to be enough on the player side
At least glad to hear its something thats fixed in the current version, dunno when I'll ever get to move over though.
We're already close to V13, so you are already far behind. I doubt that the modules you're waiting for will be updated anymore.
Probably true, but they're far too valuable to live without
Which mods are they?
I forget the whole list, but stuff like TurnAlert (how do people live without that in any tactical game?), the DragRuler mods (I know drag ruler is getting core but its worse and harder to interface with), Token Hotbar and Custom Hotbar
Maybe once v13 stabilizes I will pull myself over the line, but I hate fixing modules on my own, I suck at js.
Hey sum() works on a dynamic table correct?
sum() expects an Array for the input. lookup() returns an Array
you can also do something like sum(sameRow('col1'), sameRow('col2'), sameRow('col3')) if you're just adding fixed column values.
Thanks. This is what I have set up. But I was trying out
${(techniquestrack + neuro_tech) - sum(lookup('tech_table', 'techcost')}$
but it returns an error. Any idea why?
oops I see it
I forgot )
Pesky little guys.
I do a lot of my base code in notepad++ because I can move the cursor over the various brackets and it highlights both to make sure they're closed.
good idea. I don't have notepad++ but I do have kate and that does the samething.
it's also a lot easier to work with the code when you can lay it out and see it better without resizing the input fields.
true I ended up doing that for THIS monster.
I probably could have coded that more eloquently but I had just started getting back into coding just for doing the sheet.
Wondering if someone can help. At the moment, I'm trying to apply a status effect to a token using a macro. I can't for the life of me figure out how to do this. I'm using the Condition Lab & Triggler Module, if that helps at all.
I can't make it work, if even tried other variables of the same as copying the actual key or makeing a ref of the value it entails, but nothing came out, just an ERROR message
Nevermind, I actually could do it with the ref to the key value XD BUT, it stops working the moment 2 values are the same
Thank you so much for this! I was overcomplicating it, using the example I was trying to pull some ${fetchFromParent()}$ functions, when all I needed was the Component key!
Stops working when the two values are the same??
Hey folks, I have a JSON with my items’ info, like name, stats, type. Is there anyway to mass import them and apply to a template and generate multiple items?
The thing is that putting a number to check which option has been selected doesn' work. I don't know if it's because I did it wrong, but I believe I copied it right. So I tried making a ref to the value instead, but if two options gave the same value (like 12 or 6) the label given was always the first one with that value.
Muscle 3
Bone 7
Senses 3
In tha case, either I choose Muscle or Senses the function will always return Muscle,
Because Muscle and Senses will be treated as equal if the keys of both are equal
That's because their keys are refs to the character attributes. The actual key is ref('total_muscle') and so on
So same values are bound to happen
What was the initial requirement?
No, it's not possible. Option labels are only for display-purposes and aren't saved in the properties. Your Formulas will only get the option keys
I know, the initial proposition was to use something like this "${ ref('dropdownkey') == 1 ? 'say this' : (ref('dropdownkey') == 2...", but using numbers as filters to check which drop-down option was selected didn't work, so I tried creating a dynamic table with all the required information I needed and use a lookup function, but didn't work either. So next I tried filtering using ref functions... And that's when it gave the same value error
Also... How can I make it so hat each time this function gives a value ('escogido_tirada') rolls as many d4s as the value in 'ataque_tirada'?
${lookup('reserva_tirada', 'escogido_tirada', 'ataque_tirada', 1, '>=')}$
Hello everyone!
I was looking for sPIE function can I roll a damage and subtract the HP o a target with the sPIE( 'target' ,....)?
I made this label roll but something not working
<table>
<tr>
<th>Test Base</th>
</tr>
<tr>
<td>Test </td>
<td>${?{Test[number]|0}}$<br></td>
</tr>
<tr>
<td>Roll</td>
<td>${Roll:=[1d100]}$<br>
<strong>${!Roll <= 5 ? '<br> Critical success!!! ' : Roll <= Test ? '<br>...Success...' : Roll >= 96 ? '<br>Critical Fail' : Roll > Test ? '<br>Fail...' :''}$<br>
<td>Mod</td>
<td>${?{Mod[number]|0}}$<br></td>
<td><strong>Result</strong></td>
<td><strong>${Roll + Mod}$</strong></td>
</tr>
<tr><td>hit : </td><td>${!Roll <= 5 ? switchCase(Roll%10,0,'Testa',1,'Braccio Sx',2,'Braccio Dx',3,'Gamba Sx',4,'Gamba Dx',5,'Torso',6,'Torso',7,'Torso',8,'Ventre',9,'Ventre') :
Roll <= Test ? switchCase(Roll%10,0,'Testa',1,'Braccio Sx',2,'Braccio Dx',3,'Gamba Sx',4,'Gamba Dx',5,'Torso',6,'Torso',7,'Torso',8,'Ventre',9,'Ventre') : 'Nessuna Parte'}$</td></tr><br>
<tr><td>Damages: </td><td>${!Roll <= 5 ? setPropertyInEntity('target', 'Health', "target.puntiferitaparziali - 10") :
Roll <= Test ? setPropertyInEntity('target', 'Health', "target.puntiferitaparziali - 5") : 'Nessun Danno'}$</td></tr><br>
<tr>
</table>
I have tryed with sPIE and it gives me the result on chat of the HP of the target but into the targetted sheet the HP remains the same. I was hoping the subtract for example 10 HP for a critical success and - 5 for a success but maybe something missing in my formula
If the person rolling the damage is the GM it's possible, but a player cannot sPIE on a sheet they don't have ownership permissions on.
Mmm there is a way to do it?
DnD does it by generating chat cards for the gm to apply the damage instead of the player, but doing that would require scripting. That kind of automation is restricted by Foundry intentionally. Anything is possible through enough coding (see Midiqol) but that doesn't make it easy.
Ok Thanks 🙏🏼
Sorry yeah you replace 1, 2... With the dropdown option key
You'd lookup the value of ataque_tirada and put it in [:'ataque_tirada':d4] I think
How do you set an item displayer to only hold one item?
Generally you sort of have to control it as the gm. So if it's only one item that meets the filter criteria, then that's all that shows up. So a checkbox or a dropdown to filter against is a good option. For my part, i have a comparison string that occurs when changing the armor equipped status to see if there's already an armor suit equipped, and refusing to equip it if there's one already.
I can work with that. It was on an NPC template I am building so I would be the only one accessing it. I was just curious as I was adding it.
Then as long as there's only one item that meets the filter criteria, that's all that will show up and you can lookup('itemdisplayername', columnname') or find() in it to your hearts content.
How can i make a label do something on click, but not send anything to the chat?
Right now i have this setup: ${setPropertyInEntity('self', 'HpCur', "HpRegen+HpCur")?"":""}$ in the label roll message, which should restore Hp(and it works), but it also sends this to the chat.
Inside the brackets preface the formula with # .
You could also delete everything from the ? to the last ", thats not doing anything related to the rest of the line.
what is the #?
Can you please link the wiki if it's possible?
${#setPropertyInEntity('self', 'HpCur', "HpRegen+HpCur")}$
Okay, i understand now, but it still doing this
Yeah, its a roll message, it sends a card to the chat. One sec while I get the link, I'm on my phone.
no, i mean on the part of the wiki, where it says how # works
forget it
how can i make it not through the roll massage?
For my sheet I left it as a roll message and just included it as feedback like "Actor has healed naturally." If you really don't want a chat card for it, you can create a macro that does the effect and link it to a button.
Okay, thank you, i'll do something with it
Or just untick the 'Send roll message to chat' checkbox
Oh right. That's what I get for answering questions in bed at 6am. Thanks for remembering that.
I am blind, i was looking for that for a month
Hi! I'm trying to get a variable from a prompt and show it through the chat. This variable will contain a string. Does somebody know how to make it?
Once it's assigned at the input prompt it can be called in the roll like any other key. One sec and I'll give you an example to work from.
The text typed in the prompt was: ${variable}$.```
That shows the prompt after a roll is called. Were you talking about typing it into a character sheet first, then having the string transferred to the chat card when it's clicked?
No no, that's exactly it. My problem was doing it like this: ${:variable:}$
You only use the :: when you're calling a key (aka variable) inside a roll formula. So if there's no [], there's no ::
Thank you! That helps me alot
No problem, good luck!
Anyone can explaint it to me?
${CARREGAR01 ? [1d6] : [1d8]}$
If the checkbox is checked, should roll a 1d6, else if roll a 1d8.
But it's rolling both 1d6 and 1d8, don't matter if checkbox is checked or not.
you could try something like that, ${[${CARREGAR01 ? "1d6" : "1d8"}$]}$, but that could be too complicated
@lapis meadow
in your it's gonna roll both, and then use one at the end, in my thing, it will pick one and then roll whatever from text
it's going step by step from inside, so whatever the deepest will go first
Thank you! Divines bless your kind heart!
Now i have a question.
How can i sum two strings using item modifiers?
strings, or numbers?
concat()
for which field?
Hm. I think see what you mean, let me look at it some, you're saying you have a roll and you're going to call it, and want an item modifier to also apply to it?
i found a way around but i'm still working on it.
And it's too complicated, so if you have any ideas
You'll need to set a label for the item modifier to send that modifier value to, then call that in the roll you're trying to make, I think. So something like [1d8 + :${fallback('itemmodkey',0):}$] and then have the item modifier apply the modifier value to the itemmodkey key.
And your item modifier applies as "1d4", which should insert 1d4 into the roll.
but what if i need to stack 2, 3, or 5 ot modifiers like this? (and this system will do that)
I think it winds up in script territory at that point.
that's what i thought, thanks for trying to help)
i really can't understand why can't we just concat in the item modifiers, it's not that different from other operations
idk, that's a Martin or Linked question.
btw, are item mods from CSB or FVTT?
they're an implementation of the FVTT concept in CSB.
No problem. I'm thinking about it some, it might be worth looking at how concat() works with arrays to put the overall set of the modifiers into a single label that's doing the concat part before handing it off to the roll. If I have some kind of breakthrough on it I'll let you know.
Although that doesn't help the messiness part of it, since that would mean the keys would have to be different for each modifier. Not sure; it might not work at all.
CSB
Ah, Martin, do you have any thoughts on how to implement what dima is looking for?
Active Effects might help you more than Item Modifier, because there's currently no implementation for other aggregations or reducers
Aren't they the same?
just an item on an actor
No, different implementations
But, they have the same modifier interface...
You mean the visual interface? That's also not true
Oh, and how to change the list of active effects? I want to add my own
Those are the conditions you're talking about.
??
Ah, that's actually also something different, but yeah, behaves the same as Item Modfiers. I meant the interface you get when you create a new Active Effect with the Active Effect Displayer
What is an active effect displayer?!
Component
Oh, is it new?
It is the newest one, yeah
Btw, i need most of my actors of one kind have a linked actor data on a token, is it possible?
Like to set them up to be that way every time
Im trying to add an item moddifer when the item is eqquiped on a character. The item has a check boks that determins if the item is eqquiped or not. How does i do this?
${ checkboxKey ? 'Checked' : 'Not checked'}$
were
${ item_equipped ? '1' : '0'}$
can someone help ?
Script. We haven't implemented anything for the Prototype Token
in the character or in the item itself?
In the item. So the checkboks item_eqquiped is on the item itself.
and what sould it do if it's checked?
add +1 to an modifer at the actoer sheet
i need sleep
yes, you do)
thx alot 🙂
is there a maxium to the amount of modifiers a item can have
this should work right?
There's none
Whatever you insert into Key, should return a valid component key in the parent entity. Your formulas within those modifiers will be calculated with the properties of the actual entity (Item in this case). So you should know, when to use Formulas an when not (e.g. you don't need Formulas for static values)
do i need the ${}$ arond the keys.
Depends on your case. If it is static, then no
Can i make a dynamic table, that is accessible for any item?
I need to make a dropdown menu for two different templates and make it so i can edit it in both at once.
Okay, i think i found one solution. But i still don't understand how to access another character sheet.
There is a way for it and i saw it on wiki, but i can't understand it.
Hi! I'm trying out this to have a label roll abort early when out of range, but I get a syntax error for throw. What am I missing?
What does your code look like?
Well, I tried some different things, and got this to work. Although I'm not sure it works as intended. 😅
${#%{ if (${get_range_mod}$ < -5) { throw new Error('Out of range'); } if (${ammo_current}$ < 1) { throw new Error('Out of ammo');} if (${wrongattacker}$) { throw new Error('Wrong attacker');} if (${sameattacker}$) { throw new Error('Target same as attacker');} }%}$
Is it throwing the right error when the right condition is there?
It's giving me an undefined. Should I add a let for the error?
Every instance of throw new Error() I've seen has " instead of ' for the script delimiter, that would be the first thing I'd try.
Same meaning
Ah, it's confusing that sometimes it is and sometimes it's not. Is his error saying something else then?
I went back and looked at my stuff that does the same sort of thing and having an error is normal (you're creating one, after all), at least in my sheet as well. If it's working as intended I'd keep going with it.
Ok, yeah it's a bit confusing when you're unsure if you have the "right" error or not. 🙂
THanks for the help!
So, any news on if it is possible to run a Macro from a rich text field?
I've had this issue for a bit now, and haven't been able to find any solution.
Sorry that I have been coming back for 4 days now, but I haven't been able to get an answer.
Hey @formal goblet
You made the comment to Linked:
And also a question: Will the pool still be shown with # (hide result) in effect, so that it would hide the sum?
Here: https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/207
About hiding results but displaying pools.
Did that get implemented or is there another way to get it to work?
${#[!1d10]}$ doesn't display anything, seems like hiding the result kills the pool display too?
Why is this not working in a Label:
${Frame_Type == 0 ? "Pistol" :
${Frame_Type == 1 ? "SMG" :
${Frame_Type == 2 ? "Light Shotgun" :
${Frame_Type == 3 ? "Revolover" :
${Frame_Type == 4 ? "Light Thrower" :
${Frame_Type == 5 ? "Rifle" :
${Frame_Type == 6 ? "Machine Gun" :
${Frame_Type == 7 ? "Sniper" :
${Frame_Type == 8 ? "Shotgun" :
${Frame_Type == 9 ? "Thrower" :
${Frame_Type == 10 ? "Heavy Machine Gun" :
${Frame_Type == 11 ? "Heavy Sniper" :
${Frame_Type == 12 ? "Heavy Thrower" :
${Frame_Type == 13 ? "Rocket Launcher" :
${Frame_Type == 14 ? "Grenade Launcher" : "Please Select Weapon Type in Frame Part" }$}$}$}$}$}$}$}$}$}$}$}$}$}$}$
Pistol works, then everything after that alternates between blank and 0
You don't need to put in the ${}$ for each sub conditional.
For these purposes a switchCase() would probably also be more efficient.
whelp, removing the extra ${}$ worked
SwitchCase() ?
OH, i see that on the document
yeah, that would make life easier
Yeah, it's good for returning text easily.
Thanks, I was bashing my head in for the past hour trying to figure something out
Ehh, kinda figured out a janky way to do it with font-size:0px lol 😅
New dumb question, but is there a way to reference a character's/item's name? Trying to get my weapon attack formula to reference the name of the weapon being used.
${item.name}$
or ${name}$ for a character
it's one of the default keys from the system.
so an entry like ${name}$ uses ${item.name}$ to attack! in a roll message from an item displayer should work.
Dang. That's really simple
Did this used to not work? I feel like I looked for it before
Either way, thanks!
I'm not sure, it's worked since I've been messing with it, so since the last iteration of 3.x?
Very possible I missed it in a changelog
Well, I'm glad you got it sorted! Good luck with it all.
A much more complicated question
I'm trying to make a weapon item automatically update its bonus to hit. In my system, most of this bonus comes from your skill level with the weapon. How I have it set up currently is there's a list of weapons on your character sheet, each with a number field for you to input your skill level.
Currently, I'm trying to make the hit bonus formula find, on the actor it's attached to, the weapon level that corresponds to the name of the item. Maybe this is a terrible way to do it, but I couldn't think of anything else.
The hit bonus formula is on the sheet, in an item displayer, or on the weapon item?
if it's on the item, then you can use fetchFromParent() (wiki 4.2.15) to get the key, using a find() or lookup(first()) if it's on a dynamic table or item displayer. If it's on the item displayer itself, then you can just use sameRow(<columnkey>) to get it.
@proper dagger tagged because I forgot to reply in one of those.
It's on the item template. The issue is more directing the fetch to a matching number field. I'm able to make the formula reference "shortsword", but I want it to be able to find "warhammer" if that's what the item is named.
I should clarify I'm saying I've been using "shortsword" to test, so I just made it reference that specific field to make sure the other parts of the formula worked. What I'm trying to do is make it so that if the name of the item is something else, it'll reference the corresponding text field in the actor sheet.
The easiest method I can think of for that that still allows you to name items whatever you want (as in if its item.name is Shortsword +1 instead of just Shortsword it's different; not insurmountably so, but different) would be to have a dropdown on the item sheet that defines the selected skill (we'll pretend you choose "skill" as the key for it in this discussion). Then you can reference item.skill when you go about choosing the skill to lookup on the sheet.
so in the case of the earlier example, on the item template you can have fetchFromParent("lookup('<skill dynamic table>', 'name','item.skill')") .. although I'm not actually sure if you would use item.skill or skill in that context; I don't actually know which perspective the lookup would take, I think it would probably be from the parent's perspective and might require a little wrangling to make sure you're getting the right value for it.. wrangling like using a fetchFromUuid() that would need to be set.
it does say on the wiki that it's calculated with the properties of the parent entity, so it might require a nested formula to snag the right value before it does the outside one. So maybe fetchFromParent("lookup('<skill dynamic table>', 'name','${skill}$')") would work better, since it'll resolve the ${skill}$ part first then look at the rest of the formula.
I left that code example without the formula deliminaters so you could just put it in whatever the formula you're using to calculate the actual bonus is.
I'm a bit confused. One sec, let me get a few screenshots so I can make sure we're on the same page
Sure.
So this is a section of the weapon list on the actor template.
And my label formula. To break it down, it's currently...
Ah.
- Checking if the shortsword training box is checked
- If so, adding Proficiency
- Adding bonus equal to the level
- Adding an additional 1 when you have 3+ levels
I'm not even 100% sure this is possible with how I set it up. I'd be willing to change how the level is tracked on the sheet
Can I see the item template sheet you're working with? Do you have the skill used defined separately from the name of the item?
It's possible.
The skill used is just the "level" field on the right of the weapon list. The term is a bit confusing.
"Weapon Skill Levels" in the actual rulebook for this system
what key name convention do you have for those level fields?
To simplify things, and because the key isn't used elsewhere, I just used the name of the weapon
Again, I think it's a good idea to have which skill you want to be used on the item in a separate field from the item.name field.
So, have like a text box with the name in it as well?
It lets you do something like have "Winged Spear of the Dragon" or "Shortsword +1" in the name field without compromising the skill references.
It could be a text box, or it could be a dropdown. Either works the same in this case.
Here's a screenshot of the whole item template
Bit of a mess but I'm still building it lol
No worries, mine tend to look the same.
But yeah, I see what you're saying. Probably a good call
For the sake of ease here lets say it's a text component (not a Rich Text Area) down in the GM options with the key skill. If you decide to do something else you can just change that later.
if you do it as the text area permanently you'll have to make sure you spell the skill name exactly as it's shown on the skill list.
Also, I think they may be depricating fetchFromActor('attached' ...) in future versions, so it's best if we change that to fetchFromParent() instead.
fetchFromParent wasn't working for me. How new is that?
I might be on an outdated build
Umm.. most recent version.
Ah. That'd do it
are you on an earlier FVTT?
if not there's no reason not to update, there haven't been any changes that broke anything since I started with it about two updates ago.
Bonus:${fetchFromParent('concat(${skill}$,_training)') ? fetchFromParent('Prof_mod') + fetchFromParent('${skill}$') + lvl3 + Additional_bonus : 0}$
That seems like it should work. I dropped the ref() from the last two keys, you can just call them by name in the newest version.
Oh, wait.. let me fix something.
Ok.. I had to make it variable on the skill selection in the first boolean.
btw, I'm super iterative, so if that's not working (and I'll be honest, it probably won't at first) show me your F12 error so I can fix it.
Ok, still working out some update kinks. It's on a server, so it got a little wonky
Oh, ok. I'm kind of spoiled in just running it locally.
I miss when I was. Didn't have a proper server setup, so my janky method was unsurprisingly unreliable
My players wind up with some lag, but it runs really reliably for me (and my wife, who connects on a local IP).
Welp.... it's stopped, and won't start. This is concerning.
Guess I have to call it a night, then. Hopefully nothing tragic has happened.
Sorry for prompting it.
Hit me up if that code has any snags you can't overcome, I'm usually watching on here.
What is "CSB - Embedded Items Folder - DO NOT RENAME OR REMOVE"?
@formal goblet Hi. Can you answer please in DM to me? Ive smth to discuss.
That's the folder where CSB stores the item-in-item data.
Hi i have a bit of a technical question, is there a scrip that adds an item to an Actor?
i figured a semi clean way of sending a purchased item from merchant actor in the chat trough UUIDs but i was wondering if i could do the same to add directly an item to an actor
Check the Foundry API for Document#createEmbeddedDocuments()
Ok, I got it working again, and updated. I did get an error. What do?
What error came up?
I'm not sure how to see that
hit F12 and then screenshot the last red part on the console.
I don't see any red besides parts that just make up the page. "right justified," and all that
Hm. The label is just reading "Error" or something?
Right
Hit refresh from template on the character, and see if the error pops up in the console?
Oh, I was in the wrong tab
Hm. Try removing the "Bonus:" part from the front. You can put that in the prefix if the rest is working.
It was actually already in the prefix
Oh, you'd moved it? Ok, I had it typed in there. Did that change anything, or the same error?
No, I had it there the whole time, and just removed it from your formula when I copied it
Ok. It's weird that it's saying that the { is an unexpected character.
Is this important?
I'll have to get back to you, sorry, I'm not in a position to really sort out code at the moment.
Howdy! I just downloaded this today and there's a lot, I'm not even sure where to start at all
I'm trying to turn this into a character sheet, along with another similar sheet. If there are any good tutorials, could someone point me that way?
Mekton, eh?
There aren't really tutorials. There's the git wiki and some faqs, which are informative as a starting point, but you'll want to work through the basics before you get into something as table intensive as that.
Thank you! This system functions more or less the same way as Cyberpunk 2020
I know it pretty intimately.
One nice thing about doing it in csb is that you'll be able to move from that construction sheet to the mekton record sheet just by changing the template on the mekton actor.
Very cool. This sheet is the same as the NPC one too, so it's less work on my part. I'll poke around more later when it's not 12AM lol
Thanks again. I'll ask questions if I'm stuck
I started toying with csb building a Mekton sheet. It is currently barebone with little or no automation and I lack time and skills to improve it. I ended doing a template for each mek but at least it works.
I'm having some issues while defining the token default settings since it only gives me sheet display setings and a "template" option. I tried to change the default template but there are no options available. I'm using the heartbeat mod, just in case that could be the problem.
You forgot quotes within concat(), because both strings you pass to it are literals. Bare in mind, that you have to use the other type of quotes (single quotes vs. double quotes) if you have a string within a string.
Stats are defined by a Template. The default token settings cannot read those
So I have to set the token's basr every time one is summoned to a scene, right?
You can configure the prototype token of every Actor, so you don't have to do it for every Token
How can I do that? I added tokenizer
Has nothing to do with Tokenizer.
You can find the Button at the header of every Actor sheet
Well, it's surprising that I haven't seen this after a full hour searching while having my glasses on. Thank you!
Is there a way to share it? Automation isn’t necessary, so whatever you have would be valuable
I don't use github, but i'll see if I can pack it in a file and share it. I made it more as a training than a serious project, it should be easy to improve it.
Thank you very much! 🙏
Where would I put those quotes? I tried around ${Skill}$ and Training both separate and together.
Bumping this once again:
It would be amazing to know.
What I have is this:
%{fromUuidSync('uuid').execute();}%
And this:
${${!item.richTextArea}$}$
Since the rich text is in an item displayer, but it doesn't work.
And this was the error
.
I'm back to being able to sit down and actually look at stuff and I'm working on it some. I think it needs to be type-reversed at the fFP() level and then use the singles in the concat() on both.
Ok.
I was having some trouble with the concat() business in there, so in classical "me" I decided to just bypass doing it inside the formula and created a hidden attribute on the template that did the concat without having to worry about it. As such, I added the Trainingadd hidden attribute shown in image (1). I did a little re-creation on a test item displayer and I think I have it working completely with your keys plus the extra hidden attribute.
Image (2) is the results when configured with proficiency in the weapon, proficiency modifier 2, skill modifier 1, no additional or lvl3 bonus.
Image (3) is the results when set to non-proficient, but the same modifiers in place as image (2). (Bonus drops to 0, as expected)
Image (4) is the same as image (2) but with a modifier in both lvl 3 and Additional Bonus, bringing the total to 5, as expected.
Finally, image (5) is the same settings as image (4) but has the skill changed, which came back as 0, as expected.
So, the code for it in the form I'm using is:
${fetchFromParent("${Trainingadd}$") ? fetchFromParent('Prof_mod') + fetchFromParent('${skill}$') + lvl3 + Additional_bonus : '0'}$
And the configuration for the hidden attribute (in image(1)) is:
${concat('${skill}$','_training')}$
Of note: You can't update the character's values being used in the item sheet formula while the item is open. If you want to change the checkbox, proficiency value, or skill rating on the actor's character sheet, you have to close the item and reopen it to pull the new values. Other than that it seems to be working.
Let me know if you have any edge cases.
Gonna try it out real quick. I think I understand where this is going, but a true coder I am not
Is the hidden attribute on the item or the actor template? Item, right?
Wait no, actor
Got an error again. What component has the key "Skill" in your example?
it's on the item.
The component 'Skill' is on the item as well, that's the field where it pulls the skill to use for the weapon.
sorry, I meant to make that clearer then got lost in the explanation of things.
Disclaimer, it is more a training project than a real project. There are no macro, no css formating. I managed to get the skill rolls working but with just the exploding part (no minus when you roll a 1). And I should rename the initiative box in the mecha sheets to have the same than the character sheet, I guess it would help to automate initiative rolls.
Understood. Thank you for your help again. I've been learning on the side so I won't be completely lost
I hope it will help you set your own world. At least you'll have a few parts to poach. I used a template per mecha instead of a generic one because it is faster to pop one on the board than to rebuild a new token from a blank template.
Question: How do I put this in foundry?
Just put the mekton folder inside your World folder. I hope there is no other places declare this world. I'll check.
Oh its that easy ok
I think so. I haven't found any file with a list of worlds. So I guess it should work.
It does
Have fun.
So the 'skill' component is the field on the item that says what kind of weapon it is?
Yes
The text field in the middle:
Lol. That's just a promotion thing, from backing Ember.
Still fits
Well, I'm glad I was able to get it working for your framework. Good luck with the rest of it!
Yo guys. I want to get info from a specific line and column in a dynamic table and then print it in a chat message through a button. Someone know how the hell can i do that? Lmao. Every help is appreciated.
You can, how are you determining the row? Column is easy, you can just use a lookup.
Step 1: Stick a button on there. Label Component, change the Label Style to "Button." Code is going to go to the 'Label roll message' field, which is triggered when you click on the button. If you want it to say something on the button, type that in the 'Label' field.
Anything that's in the Label roll message field is sent to the chat card when you click the button at that point. The only thing left to do is take a look at your dynamic table and decide how you're determining the specific cell you want sent there.
Yep im using a column but i honestly dunno how to proceed lol
ooooh okay i see
Could you put up a screenshot of your table and then explain how you want the cell determined?
sure
Thats the dynamic table. It has a small butto label on the right side of the table btw
i basically want to click that button and send a message on the chat that get the first and second column information
Got it.
For further information: its a skill table
so in the roll message field:
${concat("sameRow('identificacao')"," ", "sameRow('descricao')")}$ should do what you're looking for.
just fixed it here, dont worry
Ok.
oh thx anyway
If you're interested in the theory there, the sameRow() command only works because the button is in the same line as the data you're looking for. If you wanted a static button somewhere else it would be a little more involved to figure out which cells you wanted to pull.
I see. It kinda worked but i dont think it worked 100% as i expected. It should get the text from the text boxes in that rows, right?
trying to figure out why it doesnt
Probably something in the concat. We have a standing feud.
The other way to do it is to put it in two formulae, I was just trying to be fancy. ${sameRow('identificacao')}$ ${sameRow('descricao')}$ should also send the information.
I require some guidance.
I would like to implement a modifier to a weapon roll, And I would like to select said modifier from a dropdown list
From a dropdown that comes up when the Roll happens, or one that is static on the sheet?
A static item on the sheet
What do you have in the roll so far?
The process will be to create a dropdown component, populate it with the modifier range you'd like, then call the component in the roll, using the key that you set when you create it. The component will respond with the number in the 'key' field of the dropdown.
I ended up just slapping a number box and bypass the dropdown menu entirely
Thats reasonable, especially if you don't want an upper or lower limit on the mods.
Due to the varied nature of the game system, there's a lot of modifiers, so it may be easier to go by number fields
Yeah, that can happen. Are you good then?
Are there any learning resources that I can consult before poking here again? I don't know enough to understand the guide that goes along with this system
Umm, maybe like some of the coding tutorials out there? It's mostly just a matter of getting used to the syntax. Which parts are confusing you?
Almost all of it unfortunately
Well, I can answer a lot of questions related to "how do you do x" and it should be pretty easy to contextualize it from there.
Thank you for your help, I really appreciate it
No problem at all. Whats the first thing?
How do I attach text to a roll?
Type it in the Roll message outside the ${}$ part. You can also format it using css notation.
How do I attach the contents of a text field to a roll?
If a text field is going to be called (asked for by a formula) somewhere you need to make sure it has a Key in the configuration. Then when you want to call it, you just type in the key inside a formula. So if you have a text field that has the Key Text and you type ${Text}$ in either a label or a roll message, it'll bring out the text in the field.
as an example, let's say you set the key on your number field from before as Modifier. Then in a different label component you create a label with a roll message of Roll: ${[1d20 + :Modifier:]}$ that will call the modifier, add it to the d20 roll, and then display something like: Roll: 19
(eta: Just realized I used the wrong name for the modifer, which would be confusing...)
In the case of rolls, when you type inside the [] brackets to describe the roll, you have to surround any Keys with :: to indicate that they're keys to the system. Outside that specific instance, anytime you're operating inside ${}$ you can just type in the Key that you're calling.
So if you just wanted to display the Modifier key, like in a different place on the sheet, you could have a label where the label field just has ${Modifier}$ in it, and that will display that number, as well as change when you change the value in the Modifier number field.
This one here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
You should learn basic concepts of Javascript like:
- Data types (Number, String, Boolean, Array)
- Variables
- Operators
- Functions
If you know these, you should be good to go.
@formal goblet Is there a way to detect when it's your turn in combat - or the start of a new round - so you can build formula off of that?
For the CSS - I have the custom css file selected in the configuration, and I have 2 classes defined:
.essenceBar .custom-system-meter-fill { background-color: rgb(0,0,255); }```
Then in the Addiitonal CSS Classes I have healthBar - but it doesn't do anything. What am I doing wrong? lol
I downloaded the Custom CSS module, and I can get the custom-system-meter class to work, but I cannot get custom-system-meter-fill to respond to any of my CSS
Figured it out - you have to put the !important tag to get it to override it.
.healthBar .custom-system-meter-fill {background-color: darkred !important;} worked
Scyrizu - you have created such a problem for me now - lol - how much time will I spend on this???
Hi all, I'm struggling to find a way to change the quantity value of an item via a macro. How can I update the specific value within the found items actor sheet via a script? I have tried using the uuid but it doesn't actually update the value stored on the item it just takes the number each time. How do I update the number stored on the actual item sheet?
The item is in an item displayer stored on the players actor sheet. I am able to get as far as it -1 each time but not actually update the value to be -1. I hope this makes sense. Many thanks. The number is in a number field on the item sheet at the moment.
For some more context which might be of use.
The script is an attack roll, the player runs the macro and a selection box appears asking Melee or Ranged, When ranged is clicked the script checks for a ranged weapon in an ranged weapon item displayer if it finds a ranged weapon it then checks for a matching ammo type in an ammo item displayer. If there is a match it finds the quantity of the matched ammo and uses it. This all works except for the value on the item reducing by -1. In my case the original value is 10 and it stays 10, so the ammo remaining constantly reverts back to 10.
Yo guys, theres anyway to get information from an item that is in a displayer?
basically i want to send the text from a rich text box inside the item on the chat when i press a button label which is inside the item displayer
So you can do it exactly the same way as the other, except if you're using a Key that's on an item, you refer to it as ${item.<key>}$
However, that only works on the item displayer. Doing it somewhere other than that is more complicated.
ooooh i see
thx again bro
No problem!
${sameRow({item.<desc>})}$
like this?
desc is the item rich text box
${sameRow(item.desc)}$
oh ok ok
Well it doesnt work, dunno if im doing something wrong :(
Oh, this is on the item displayer, right?
${item.desc}$
doesn't need the sameRow(), sorry. I should have been thinking of it.
look
Could you show me the item component? desc?
here
sorry, i was into something here
No problem. And you revised the code in the button like I described above?
to just read ${item.desc}$, nothing with sameRow()?
I ask because I replicated what you were describing on a test sheet, and it works for me, even with an image in the RTA.
aaah ok
now i see the problem
apologies I'm still going to need help with this, I am able to do everything outlined in there, I can modifiy values directly on the actor sheet that all works ok, the issue I am having is modifying the values on an item directly once it is attached to an actor
I have no problems in accessing the information in the table itself, I just can't successfully update the value within the item sheet
I think I just need the correct path to update it,
are we looking at actor.item.uuid.update....I can get it to the point of reducing the value but it constantly reverts back to its original value because the item itself has that value. I need to directly access and update the item itself
sorry if this is confusing I am going insane as it can't be as difficult as I'm making it out to be
You can't call update on a UUID, because that is only a string. You need the instance of a Document like Actor or Item to do so.
let updatedQuantity = Math.max(ammoQuantity - 1, 0);
await matchingAmmo.update({ "system.quantity": updatedQuantity });
this is only updating the value temporarily, before reverting back to to its original value, I understand why it is doing it because I am not updating the actual item sheet itself. My question is how do I update the actual item actor sheet instead of the value that is displayed in the item displayer on the players actor sheet?
You can use the linkedEntity-instance (if you execute the Formula from an Item Displayer). Also, the correct path is system.props.yourComponentKey
thank you
I'm trying to add the item from a table to a roll. Here is my roll command and the table
${[1d10xo10] + sameRow('MWeaponWA') + ref("sameRow('CbtSkillList')"}$ might work? I'd have to test it to be sure.
Ey, how do I make this %{${!Sound}$}% not send a chat message, again? I don't want it to make the dice rolling noise. %{${#!Sound}$}% doesn't stop it.
uncheck the "Send roll to chat message" setting on the component
ref(sameRow('CbtSkillList'))
Well, new problems is a sign of progress. The item is no longer rollable, but it doesn't throw errors anymore
How do you mean "No longer rollable?"
I press the D10 Icon that I use to roll, and it doesn't output anything
Check the console with F12
What's your current Formula?
MFightingLevel is being called by the ref, it's probably what he has selected on the dropdown. Is there a value in the MFightingLevel on the sheet?
Right, what does MFightingLevel reference?
Upon closer inspection, it seems to be referencing a non existent stat
sigh
I'll dig through this again and potentially re-label things. It's always hard to understand spaghetti that you didn't write/build
Nothing against the creator, I just simply don't know it
Actually, sice the dropdown menu has a key portion, shouldn't I be referencing 'key' rather than using 'ref'?
The approach with ref() is correct. The key options are just the values the Dropdown will return when selecting one.
Those aren't actually Keys as the way it's used in the rest of CSB, it's more like just the value for the Key of the dropdown list.
I see
Okay, I do need to hide %{${!item.Sound}$}% without hiding all the other rolls within the same label roll
is there a way to do that?
#?
without the !?
I thought that was necessary
It just suppresses the box around the result
... oh
I thought it was to indicate the selected actor or something
that makes more sense
Fantastic. Thank you again bud
No problem.
So
%{${#!item.Sound}$}% has not worked, apparently
rather
%{${#item.Sound}$}%
It still pops up in chat
Hi guys! In this token i have two conditions: deaf and cursed. I'd like to improve the 'cursed' icon's opacity (which path is icons/svg/sun) as much as the 'deaf' one. I tried in many ways (macros, css commands etc) but the cursed icon overlay remains barely visible. Any ideas?
This macro does not return the actual name of the item. As in, no matter if the name is correct, it says it will say it's not there. Do I have to write it differently for CSB?
const itemName = "The name of my Item";
const itemOnActor = actor.items.getName(itemName);
if(!itemOnActor) console.log(`There is no item called ${itemName} in the actor`);
else await itemOnActor.delete();
I typed this in trying to get the output of the text field before the D10+ modifiers. I tried following the advice earlier but I think something was lost in translation
I am trying to get the text contents of the MWeaponName text field to display before the actual roll number. However, I just get the actual MWeaponName to display, rather than the contents
glad you got it sorted out, sorry for the delay, i've been seriously busy the last 48 hours. Yeah you have to override CSB defaults with important, this goes for margins especially. Just be wary of that going forward; it's actually funny looking at my css because a LOT of important tags are thrown around.
as for how long you're going to spend on this, erm... i uh... don't want to talk about that 😅 ... too much.
have you tried the fill-opacity property?
You can edit the transparency of this icon only inside the svg file itself. You will need a graphic program capable of editing svg for this.
It seems that the status overlays that appear directly on the token (as opposed to the exact same icons that appear in the ‘Assign Status Effect’ token menu, which I can in fact edit) are handled by PixiJS and are not part of the traditional HTML DOM. So you won't see them in Elements and you can't edit their style attributes.
Yes indeed, but i don't want to edit Foundry default icons. I have this macro that should draw a custom svg icon on the token (which is an enhanced opacity version of the already existing 'sun.svg' icon which i renamed 'sunbright') but it doesnt seem to work ```// Seleziona il token controllato
let token = canvas.tokens.controlled[0];
if (!token) {
ui.notifications.warn("Seleziona un token prima di eseguire il comando.");
} else {
// Aggiorna l'overlay del token con la nuova icona "sunbright"
token.document.update({ overlayEffect: "icons/svg/sunbright.svg" })
.then(() => console.log("Overlay applicato correttamente."))
.catch(err => console.error("Errore durante l'update dell'overlay:", err));
}```
Trying to do some (at least from my understanding) incredibly simple work done on this sheet for a 3.5e inspired system. I've basically gotten everything I want done EXCEPT for attribute modifiers. I currently have things rigged so that a player can very easily make skills naturally by adding all the bonuses in the same row as the button they're pressing via the sameRow function. However, my dropdown table of keys and labels just didn't seem to work no matter what I did, and I couldn't ever pull out a concrete value from what I had assigned the column key to be.
Whatever I do, using "base_att" just spits out errors after errors after errors. I have a theory it had something to do with the fact that I reused the STR DEX CON keys for the table hoping it would literally use those keys, but honestly I have no idea and its way too late for me. If anybody could tell me how to make my attribute numbers correlate with what you pick on the dropdown that would be incredible, but alternative solutions on how to be able to change the math on that specific skill check depending on what attribute the user picks would be just as stress-relieving. Any other advise is obviously welcome as well.
dunno if its important but the keys which hold number fields detailing the specifics of someones attributes are all the same in this dropdown as they are in the attribute tab
turns out I had to combine the sameRow and ref functioned that you linked me to to solve the "crisis"
much appreciated my friend, I apologize for not looking theremyself first
Hi, I've looking for a savior 🤣
I've made a Table, 2 columns, with skills name, and the value (calculate from strengh + dex for example, so it's variable)
This is working
Now I'm looking for putting these values in a Dynamic Table, with contains my skills (and then for chosing the skills and roll it, with something like ${first(lookup('Skills', 'Total', 'Name', Skill_Selection), 0)}$ )
don't know what to put in the "base" column
something like "get the value from the key (samerow"Talent") ", it look for the name of the skill, get the value from his key
But I don't find the right formula
ref(sameRow('Talent'))?
That's it, thank you !
sadly you're talking above my paygrade rn, 😦
Sorry to bother you again ! Now I have my skills table working with the ref() thing 👌.
I want to make rolls from it, with
${first(lookup('Skills', 'Total', 'Name', Skill_Selection), 0)}$
But it shows only values which are fixed, not calculated
(For example I have "Flair" at 5, and "Athlétisme" at Strengh value)
if I understand, it can't find the value with lookup, and return 0, but I Can't figure why..
(I can give the foundry world if I'm not clear, english isn't my native language)
(on the other hand, I would like to support you, for helping me.
If I gave on Koffee, it will come to you ?)
It seems I'm struggling with dynamic tables, maybe doing the same thing with static ones and an "Talent_base" + "Talent_mod" thing is much easier for me 🙄
with some tryings, now even my "Flair" Talent wasn't working 😅
Try to install the example module from the Foundry package manager. That ones has an example with skills and such
Yeah, I'm editing the example sheet, for not going from Zero 😅
I stop for tonight, I will try with a fresh skills table
Is Name the correct column key? If yes, do you have any warnings/errors in the console?
I havent check the console, thanks for the advice
Hello Dears, I come back after a while to CSB and my old template doesnt work on current v4.4.2... could you help with one of examples? hopefully then I will be able to decipher other 🙂
%{ const props = entity.system.props; options.hide = true; localVars.kosc= props.obrazenia_k4 > 0 ? 'k4' : props.obrazenia_k6 > 0 ? 'k6' : props.obrazenia_k8 > 0 ? 'k8' : ''; localVars.koscEN= props.obrazenia_k4 > 0 ? 'd4' : props.obrazenia_k6 > 0 ? 'd6' : props.obrazenia_k8 > 0 ? 'd8' : ''; }% That generates an error but later on when I use: ${ref(concat('obrazenia_',kosc))}$ ${koscEN}$${modyfikatorObrazen>0 ? concat('+',modyfikatorObrazen) : modyfikatorObrazen<0 ? modyfikatorObrazen: ''}$
it give me correct value but with "ERROR". I.e. obrazenia_k8 = 1 and modifikatorObrazen = 1 generate: ERROR 1k8 + 1
Why even a script? You can do the same logic in a regular Formula
The ERROR comes from the undefined return from the script.
now on I don't remember why it was so, maybe due to better flexibility... will work on return something usefull or change formula then... thank you very much
Can you give me an hint for changing the "+/-" column in the example sheet ? For adding a mod ?
I've an object which make Acrobatics +3, I've set a Key "Acrobatics_Mod" in the template, but how to get automaticly the value, like :
${the skills name + the string "_mod"} $
These are modified by Item Modifiers. So you should try working with them if you are working with a Dynamic Table
I don't know if there's a good example item with such a modifier
I will look at this 😊
I don't think so 😔
The Key of the modifier must be a valid path to the Component you wish to modify in the parent entity. If the Component lies within a Dynamic Table, you have to use fetchFromParent("lookupRef()")
ok, seems that there were some changes done in meantime which require bigger attention.
#1 I have an item with "dropdown" component key="status" options={(owned, 'Owned'),(inuse, 'In Use')}
then in "item displayer" i have an component with "roll message" like: ${setPropertyInEntity('item', 'status', item.status == 'owned' ? "'inuse'" : "'owned'")}$... but at the end when I click on component console return cannot convert "inuse" to a number...
... I remember that in past there was additional article about containers and items, but can not find it... could you help?
PS: I tried also with equalText(item.status, 'owned')
#2 do you have some good way to debug the code? after migration I have like 59 errors and 118 warnings and in some cases to identify where problem raised is like going through swamp 😉
- You have to use
equalText(), that's for sure. - Each error indicates, for which formula it was raised and what properties it used (including the name of the entity).
Everything else depends on the error messages itself
and such one without clear indication (at least as per what I see):
SyntaxError: undefined. Expected "$", "(", "{", [+-], [0-9], [^ (){}[]$,+-*%/], [a-z$_], [dD], or whitespace but end of input found. (at foundry-esm.js:64400:22)
[No packages detected]
at new peg$SyntaxError (foundry-esm.js:64400:22)
at peg$buildStructuredError (foundry-esm.js:64775:14)
at Object.peg$parse [as parse] (foundry-esm.js:65751:13)
at Roll.parse (foundry-esm.js:63976:45)
at new Roll (foundry-esm.js:63323:37)
at Roll.fromData (foundry-esm.js:64317:20)
at foundry-esm.js:63101:77
at Array.map (<anonymous>)
at PoolTerm._fromData (foundry-esm.js:63101:39)
at RollTerm.fromData (foundry-esm.js:61097:18)
at foundry-esm.js:64324:27
at Array.map (<anonymous>)
at Roll.fromData (foundry-esm.js:64320:31)
at foundry.js:17447:25
at Array.reduce (<anonymous>)
at ChatMessage.prepareDerivedData (foundry.js:17445:29)
at ChatMessage.prepareData (foundry.js:10824:12)
at ChatMessage._safePrepareData (foundry.js:10799:14)
at Game.initializeDocuments (foundry.js:9168:18)
at Game.setupGame (foundry.js:9054:10)
at async Game._initializeGameView (foundry.js:10432:5)
any suggestion? 😄
rest was solvable (if I can say so 😉 )
Try CTRL + F5
Isn't that a reload of foundry?
Already done that many times to check if changes are valid... And nope, doesn't help.
I missed name of entity earlier, that's great for debug 🙂
Thanks for tip
When I started, I was at the same level as you are (and I'm still not that better now). Several iterations on the same pages over a month or two and you get something that is hard to read. What I fail to see is why you are using a dropdown. In Mekton a weapon doesn't use several skills, so you could use a single Label zone where you have the modifiers computed (Stat + Skill + Maneuver Value). Usually this doesn't change (except for transformable meks, but I had this case covered with radio button for the various forms. You can assign a value to each radio button, so that the one ticked will give you the correct maneuver value. I guess I should have named the keys after the skills and not by number.
I guess a piece of advice for beginners would be to use explicit names for your component keys. Instead of "Skill1", "Skill2", it is better to include the name of you skill ("Gunnery", "Piloting") in the component key.
My plan for the drop down was to save players the potential snag of “what do I put in these field”
I’ve added a few more buttons and have gotten the hang of the skill names, so that’s not a big deal. The player facing sheet just has to be coherent and legible
I think I understand, you want the players to be able to modify or create their own meks, to have complete access to the mecha sheet, isn't it? As a GM, I prefer to create the mecha myself. I tend to use a few common meks over having unique models for each PC & NPC (I'm more into Robotech than Mazinger).
I think I have something is close to your need in the character's sheet. For non-combat skills there is a dropdown to select the attribute and a label to get the attribute value (so that everything is on the same line). It might help you. The formula is quite long, basically it is a big IF-THEN for each possible case (including the absence of a value).
${equalText(sameRow('SkillListStat','Rien'),'ATT')? ATT : equalText(sameRow('SkillListStat','Rien'),'BODY')? BODY : equalText(sameRow('SkillListStat','Rien'),'COOL')? COOL : equalText(sameRow('SkillListStat','Rien'),'EMP')? EMP : equalText(sameRow('SkillListStat','Rien'),'INT')? INT : equalText(sameRow('SkillListStat','Rien'),'REF')? REF : equalText(sameRow('SkillListStat','Rien'),'TECH')? TECH : 0}$
Default value is REF and depending on what you select the value will be the correct one. I guess it can be adapted for a skill dropdown, you'll have less possible choices (Gunnery, Missiles, Fighting & Melee).
So if you want a dropdown box to choose a skill and get the skill value you can use :
${equalText(sameRow('YourDropdownKey','Nothing'),'Gunnery')? GunneryValueKey :
equalText(sameRow('YourDropdownKey','Nothing'),'Missiles')? MissilesValueKey :
equalText(sameRow('YourDropdownKey','Nothing'),'Fighting')? FightingValueKey :
equalText(sameRow('YourDropdownKey','Nothing'),'Melee')? MeleeValueKey : 0}$
I'll give that a stab. I've been poking it and gradually getting the hang of things. I poked around enough to get the firing weapon to display as so:
That's nice.
Thank you! It took a lot of trial and error, but I can loosely recognize basic functions.
It gives me an idea. I think I'll add another field for the weapons so that any special affect can be added to the roll. For example "Firing Beam Rifle 13 to-hit for 3 Kills Frag/Incendiary". It might be useful to add this information. But I don't know (at least not yet) how to do it for linked weapons.
This is my working statline RN
Oh, and filling in the tooltips helps provide context too
Firing ${sameRow('MWeaponName')}$ ; ${[1d10x10] + sameRow('MWeaponWA') + sameRow ('MWeaponTotal') + ref('MProfileStatREF')}$to hit for ${sameRow('MWeaponKills')}$ Kills!
This is what I used to get the chat message btw
Yes tooltips are a must for the players.
MTZ seems to have a lot of optional but impactful modifiers for gear
Yes, there are tons of options that makes it hard to make a working sheet. One of them being the Targeting Computer, your maneuver value is not the same for shooting or for piloting...
V-Max is another game changer system.
Or any of the custom weapons. You can't really pre-bake anything mech-side
Just changing the ammo type used by your gun is a nightmare. That's why I used a template per mecha. It was easier than trying to make a 'one size-fit all' sheet. If you just use the systems in the core book, it should be fine. If you start using Mekton Zeta Plus it becomes far more complex.
We're using the expansion.
Do you intend to use a lot of different mecha ? Or mecha that can change their payload depending on the mission (like modern aircrafts) ?
I don't think so
If the pilots don't have a lot of choices, then you can make a pre-made template per vehicle. You can tailor the template to the payload and the various bonus they can give. Maybe if the pilot have the choice between two weapons (either the big single-shot cannon or the lighter autocannon) you can use radio buttons and check the value in the roll button (with a "Sorry you don't have this weapon right now" message instead of the usual roll).
When you first started talking about mekton it occurred to me that you could pretty easily build item templates for each of the weapon types to do the configuration from MZ+ and even have the servos as items.
IIRC item lists have some limitations on the type of fields you can use. You are limited to labels. So for ammo it won't be possible to use a number fields with nice +/- buttons to change the value. We will need macros for this.
Nope, items can have the full gamut now.
Cool ! I was still using the old Foundry v11, I can now update to v12...
Theres even items in items.
(and spend the next weekends remaking my mekton sheets).
It will be useful for the armor.
My thought was to have the armor sp as a configuration in the servo item, just adding to the overall servo cost and weight.
Thanks for the information. I'll have to try a few things.
But armor isn't just SP, you can have armor that is harder to ablate, armor that can absorb energy. Well, I'll keep it simple to start.
Ok, back to the drawing board.
I put RAM as a checkbox, and the Abs as a Text field
Some of the fancier stuff like RAM armor is a bit harder, but ablation could be an automated button on the locations item displayer (since damage can't be easily automated in v12).
Yeah, thats a good method.
I'm thinking of a button on the servo line that ask for the amount of damage (and if it AP or a beam melee weapon or just an armor ignoring hit) and depending on the ablation and current level of armor could distribute the damage. But that would be a hell of a formula... Might need a macro on this one.
I need to make a few tests.
(and write down the different cases to make sure I'm not forgetting something).
<nod> Have fun with it!
Hm...I plugged in the desired stat keys and now the dice roll button seems to be broken
I followed the template to the best of my ability and I seem to be flip-flopping between error and a broken button
Can you send a pic of the whole dropdown description ? YourDropdownKey should be the Component Key.
You should use CbtSkillList (Name or Key of the whole dropdown) and not the name of each line.
In my case (for the attributes) I used this : ${equalText(sameRow('SkillListStat','Rien'),'ATT')? ATT : equalText(sameRow('SkillListStat','Rien'),'BODY')? BODY : equalText(sameRow('SkillListStat','Rien'),'COOL')? COOL : equalText(sameRow('SkillListStat','Rien'),'EMP')? EMP : equalText(sameRow('SkillListStat','Rien'),'INT')? INT : equalText(sameRow('SkillListStat','Rien'),'REF')? REF : equalText(sameRow('SkillListStat','Rien'),'TECH')? TECH : 0}$
SkillListStat is the name of the dropdown and ATT (for exemple) is the expected key (or value I don't remember, so for Missile/Missiles I don't know which one should be used).
So : equalText(sameRow('CbtSkillList', 'Nothing'), 'Gunnery' ? MCbtSkillTotal3 :
Hm, so it would be In my case
:${equalText(sameRow('NAMEOFTABLE','Nothing'),'LABELKEY')?DESIREDSTAT :
Yes
In plain english "equalText(sameRow('CbtSkillList', 'Nothing'), 'Gunnery' ? MCbtSkillTotal3 :" could be translated as "IF the text of the selected row of CbtSkillList (use 'Nothing' if no value found) is equal to 'Gunnery' THEN use MCbtSkillTotal3 ELSE ".
Are all of those skill values on a table, or are they static keys on the character sheet?
It would make the code a lot simpler if they were on a dynamic table and you could just lookup the dropdown value and pull the skill value directly, instead of all those conditionals.
When I coded my version of Mekton I went for static keys, as the skill list was short and fixed (everyone has the same list of combat skills). So if Jazzman is using it as a base for his own sheet, it might be the same.
does CSB work with carousel combat tracker? i dont see anything in the tracked resource aside from template
It might be worth re-looking (although that would break a lot of formulae). You can fix the entries and forbid players from adding new lines to any DT; and the lookup() and find() functions make those kind of things work well. You can also use something like ref(<dropdownkey>) to bypass a lot of it, since ref() will take string inputs.
I'll keep this in mind. I think I'm going to rebuild a lot of things. Better to start from scratch.
I don't have a sure answer for you on that, but I would think "Not out of the box." Mostly because there's a lot of stuff that goes on in CSB that happens outside the normal areas that CCT would be looking at.
the configure attributes works but i dont think the attribute bars do
Whats the preferred way of doing status effects for CSB?
im not sure if its because they are named differently between the two or something else
it might be the same thing you can run into with the token attribute bars, make sure whatever you're tracking is a number field with min and max set.
Umm.. there's status effect support, or active effects.
With mekton, players have 2 sheets ingame (one for the character and a second for the vehicle). Since you are not limited to labels in items lists anymore, I guess it might be possible to merge the two in CSB. I still need to figure the initiative part as the vehicle usually gives a malus (and rarely a bonus).
tracked resource is still empty
the tooltip attributes work fine
i tried typing the attributeBars into the secondary resource inside of CTT's config but it gives me this
There's a lot going on between the two that are handled differently, I guess if it's a custom mech that only that character will be in, sure, but if it's a mass-market or trooper mech? Might be better to have separate sheets and have the player type in their relevant stats (mostly INT/REF) when they get ownership of the sheet.
panzerkraken singlehandedly holding up the csb chat rn
And I'm just some guy.
I'm not familiar enough with CCT to know for sure, but can you type in a custom value instead of just looking on a list?
thats what i did
did you use the props address for it?
im using the attributeBars rn
props works but
it looks something like this so im using the tooltip attributes rn
Where do I read about that, I find the wiki hard to read?
Until now I've just simple statuses by worldscript
If you click the "Configure active effects" button on a template you can see the list of default statuses, and you can customize the effects that they apply when they're set on the character.
They're configured a lot like the Item Modifiers.
Meaning that the key takeaways are that you set a priority (I like to make it 2), a value to be modified in the Key field, an operator, and a formula or value (complete with ${}$ if it's a formula) in the 'value formula' field.
Active effects work pretty much identically to baseline FVTT once you insert an Active Effect Displayer component.
BTW, the 'Configure active effects' is actually a misnomer, think of it as 'Configure status effects' instead.
Can they accept scripts? Trying to make it work with StatusIconCounters
In the key formula? I'm not sure, I've never tried. They should execute like any other formula, so using %{}% should work?
It looks like it should from the documentation, provided the script returns a number.
Tried to make it work for a test but no.
Hm. Might bet something to ask Martin about when he's on then. It's not an area I have a lot of experience in, my things are usually pretty simple that way.
Will do. Theres no "traditional" active effects for CSB, just the tab on the template? With anything else I assume being handled by item modifiers
There are. Insert an Active Effect Displayer component on one of your templates and you should be able to add them on your character sheet.
AFAIK that works with the effect macro mod as well. Not sure if that helps for your implementation though.
You wind up with one of these guys:
Are they then active on all characters of that template, or can they be separately stored/enabled?
No, you can't create effects on a template, only on a character.
I also don't know if the AE handling is the same as it is for FVTT; as in idk if a macro to create an effect from base foundry would work, although Martin has a FAQ entry about it.
It looks very similar to how macro-created AE's are handled from the one time I worked with that, but I'm not for sure about it.
Well if they are on all characters of a template they sound a lot less useful. There's probably uses for it but I can't think of any atm, too hungry
Active Effects are per Actor, not per Template.
If you want to configure those, that are shown in the Token HUD, then you need a world script.
I don't quite see the use case for that but fair enough. Do you have an answer to what I'm doing wrong here
Good example would be Spell effects. You don't want any possible Effect configured in the Token HUD, so you configure the Active Effect in the Item and write a little Script to transfer it to the targets.
Ah, items can have active effects? Now I see the use yeah
Yes, they can
I tried a couple of different ways but none of them work
The API of Icon Status Counter changed, so you might have to do it differently.
I tried using their new formatting of
%{const effect = CONFIG.statusEffects.find(e => e.name === "acid");
return EffectCounter.findCounterValue(token.document, effect.icon);
}%
But I don't know how to reference the current token or actor
can i use a checkbox to make a switchCase()?
For that few a number of options, why not just a conditional?
Like <checkboxkey> ? <true output> : <false output>
that works way better thank you!
What is it you are actually returning with %{entity}%? I've been trying to bang my head against the wall to figure out how I get the token document out of there.
entity.entity.appliedEffects returns nothing, as the array is always empty regardless of what statuses are active
yo guys quick question here
how can i show an item from a item displayer in a dropdown list?
sorry for interrupt btw
In Configure Active Effects on a template, it seems any status with more than one word bugs out. The menu cannot be closed or reopened until the sheet is refreshed, and there is no entry for modifiers.
CSB 4.4.2, Foundry 12.331
Use the key for the Item displayer in the dynamic table mode of the dropdown.
It comes out looking like this:
No problem. I modeled it and took pictures because I didn't know the answer either.
dunno if im doing something wrong but its not working
oh wait
Is there anything in the item displayer?
Ah, yeah. if the identificacao isn't the name field, like if it's blank, that would be a thing.
You can set the name in the next field.
if it's different from what you want to have the dropdown field show as
well.. report as. If it's different from the value you want to be called from the dropdown.
like the first line is the Key* column and the second one is the Label column from a manual dropdown.
You pick which two columns you want to show up from the item displayer.
identificacao is the item reference column label
What are you planning to have happen with the dropdown? Something like selecting an attack weapon?
yep
like he's equipping that item
basically i have the item displayer and the "selected items" section
Ah, so the attack and damage rolls are static, but change which item they're pulling from based on that dropdown?
yep
Not a bad plan at all. I'll remember that workflow.
actually theres not even a roll button, its just show the player which item is he equiping
look
just for tracking lmao
Ah, ok. That's very good. You could also have information pulled from the items based on that dropdown value, if you need them. Looks nice though, very clear.
column label. It will still have the column key name
Oooooo. I was not aware of that. I'll put that in my mental list of things I should remember. So it's just the label for the name column.
And that's why you're getting blank, because there isn't a column keyed as 'identificacao', it has the key 'name'
another quick question herem, how do i get the item name? its just like {item}
or anything more complex?
${item.name}$
thx[
On the subject of dropdowns, Martin, can you just feed an array in the formula mode of a dropdown and get all those as options? As in ${array(..., ..., ...)}$ with a bunch of keys (like say all the keys for a stat array) to fill the options?
Interesting one you found there. Can you open a ticket for that? Don't have the time for today and tomorrow
Uh, yeah. Arrays are converted to a CSV-string. And guess what the delimiter is for the options in the Formula one
Nice.
If I remember it tomorrow I will. For now I fixed it by removing spaces from all my status ids
has anyone encountered a bug where a tab in a dynamic table just vanishes?
Any following attempts to re-create the label results in it disappearing again
Hello everybody! Any ideas about where to get interesting pre-made, fantasy themed CSS to change characters' sheet and other elements layout?
Does anyone have a good method/technique/idea to have multiple rolls coming from different Characters happen on a single-roll card?
-
I'd love to have a "call for X roll" that pops something up for players to all do their own, then combines the output, but I know that's asking for a lot.
-
Alternatively, it'd be cool to have a "communal" pop-up that allows rolls from any sheet to be contributed to (this is a feature inside the "Cortex Prime" FoundryVTT beta system.)
-
Ultimately, I'd be okay with a simple Input window for the DM that can at least just "grab" rolls from player sheets. Like, an input window with dropdowns/table with a list of all characters that I can select "Roll PC1's Strength, Roll PC2's Strength, etc" And I can combine that into a single roll card (I know how to format the output, but not sure how to get the User Input Template to grab a list of players. (But once I can do that, I shoudl be able to just ${player.strength}$ any roll modifiers right?)
I'm adapting 3:16 Carnage Amongst The Stars to Foundry inside CSB, and in lieu of Initiative rolls, the game does a "everyone make a d10 check vs their stat, and aliens do the same"
But without getting into it and modify the initiative base, I'd just like to condense all that into a single roll-card, rather than having 5+ rollcards just to determine if the players or aliens "go first"
Total Noob with Foundry, so forgive the ignorance. I'm using Custom System Builder to try to play Letters to the Stars by WM Akers... Across the bottom of my player sheet, I have a table with 11 columns, one per turn and in the table I have a Rich Text Area component. I want the Label (just two character notation for the round, eg O1, M2, R3, etc) next to the icon that opens the Dialog Editor, this is where I want to record my notes for a round in an external window. In my template it appears correct, but when I open the character sheet, it is dropping the icon down to a new line. Is there a style to apply to keep them on the same line? I tried adding display: inline; to the style box, but that didn't seem to help. Alternatively, is there a way to have a label itself open a Rich Text Area dialog editor? Thanks for the help.
Hi everyone, I'm stupid and couldn't figure out the answer to my question after searching, so I'm asking here and expect it to be something really easy that I just overlooked.
I want to be able to call a User Input Template from an Item Displayer in a character sheet (My ultimate goal is to open a dialog for adding modifiers and bonuses from talents and yadda yadda). I cannot however figure out how to pass values from the item to the User Input Template, since it only seems to be able to see fields from the actor sheet, not the item. I tried calling the User Input Template from the item itself, and that works fine, but not from the Item Displayer on a character sheet.
Were you using the item.key format for calling the item's keys?
It throws an error if I do it from the input template, and I don't know how to use the item.key formate for calling the input template itself
Can you walk me through what you're doing with it? It might be having problems with what it's looking for. It should be able to be triggered from a roll on an ID without any problems.
Yup, can do! So, I'm a scrub and all with CSB and struggling with the documentation to fully understand everything I can do with it, so it would make sense if I miss something obvious.
FIrst things first, I have an item displayer that lists a character's weapons. Then for one of the columns, I call the user input template directly using the syntax I got from the documentation
This gets the template up and everything, but I have absolutely no idea how to reference stats from the item itself in the template. As a test for myself, I have a single dropdown on the input template to get the attribute of the weapon so my players can select the applicable attribute if there is two different ones, but this doesn't work because it can't see the field
And putting the 'item.' in front of anything doesn't work
You have any luck with resizing panels to specific dimensions? That has been the biggest pain for me.
yeah?
just set their with: and height: properties, if they're stuborn set the min-wdith and max-width (and heights) as well
If I call this exact same input template from the weapon itself (I just made a test formula for it) , it works like expected
That was the key. I had to set min and max. lol Thank you, again!
Experimenting vicariously, can you use sameRow() to pull a value from the item displayer into a label on the UIT?
Yes, I was able to sameRow('id') and name and uid and whatnot, so that does work
I just don't know how to get to the keys on the item
if you can get the UUID, you can use fetchFromUuid() to pull values directly from the specific item.
Off the top of your head do you know what syntax I'd use for that? Because that sounds like a useable route
fetchFromUuid(<uuid>,<key>,<fallback>)
actually, all of those parameters should be set in ' '
Got it, giving it a try now
${fetchFromUuid(sameRow('uuid'),'weaponattribute_dropdown')}$
If this is the correct syntax, it's throwing an error. I also just tried and for some reason I don't think I can get the uuid from the item? Which is odd, I can get 'id' and 'name' just fine, but 'uuid' is coming up blank
Dunno if it's supposed to be, but just doing sameRow('uuid') returns blank, and also the above line just returns an error
Literally just the word "ERROR" in the test dropdown I made
I meant from the console (F12)
That.
Whoops, I flipped a parantheses to a bracket. Fixed, I'll get the new error
I was just about to say that 😄
I didn't even notice it in the code you pasted in earlier.
are you on the most recent build of CSB?
Looks like I am not. My friend is hosting it, so I didn't even notice myself. Should I update asap?
I'm on 4.1.1 looks like
If possible. That error is saying that fetchFromUuid() isn't a valid command.
Okay I yelled at them and they're updating it
I sowwy 😭
No no, I meant you lol
True XD
To my mind, that's a win, because it means I didn't say something wrong. Martin comes on and corrects me sometimes and I feel like a scrub.
Great!
Weird side effect: The attribute I'm grabbing is coming over in lowercase, even though the key is definitely uppercase
Ish uppercase
ish lowercase :c
Hm. Thats an odd one that I have no idea about.
That could make for problems if it's going to be a key.
That might be worth making a ticket over. Does it happen if it's a static key from the item?
Nope, it's properly capitalized
This is the item calling the user input, instead of the character sheet (and the fromUUID method)
I meant if the one from the item displayer calls like a label with 'Test ' in the label field, does it come out as 'test'
Yes, it's lowercase
In the item displayer
...Oh figured it out I'm actually an idiot, there's no bug here
When you add an item to a character sheet, you make a copy of that item at the moment that you add it. Further updates to the item don't retroactively affect those copies, and that was an old item
I had it lowercase in an earlier draft, that's what it was
Ah, yeah. Thats gotten me more than once.
Alright, I think that's all I needed for now, I need a break from staring at this screen, my soul is going to leave my body if I keep doing more
Lol. Well, I'm glad we got that part sorted. Good luck!
Thanks a lot! I'm sure I'll be here in following days asking more dumb questions ^^
I appreciate your help ❤️
Any way to make a roll message close a user input field?
Oh nevermind. I can't use input fields how I wanted
But just in case I'm wrong here, it seems like in a user input template, anything you change there is not taken into account because it's prioritizing the data in the actor sheet.
In my case, I have my advantage/disadvantage/normal radio buttons, and an additional bonuses number field that I want to implement into an attack roll template. It copies the state of the radio buttons just fine, but if you change them, the roll doesn't reflect that. Whatever the character sheet said when the template was called is what will go through.
It would've streamlined things if I could make a popup for the players when they roll, but I can just put it on the sheet somewhere, and remind them to reset it.
Related question, any way to make a roll message change the state of radial buttons?
You should be able to just set the desired key to true with an sPIE(self, ...) and the other keys in the group will go false.
What's an sPIE?
Oh, setPropertyInEntity gotcha
So what would the syntax be if the key for normal was just "Normal"?
This is what I got, but it's just saying "true" in the chat
That looks right, give me a few and I'll open my fvtt and see if I can model it.
Yup, that doesn't seem to be working very well, even the radio button group key isn't filling with an option. I think a different solution would be better. You're trying to do different rolls for advantage/disadvantage, right? Is there a reason you want it to be persistant outside the roll message?
In my case, I have my advantage/disadvantage/normal radio buttons, and an additional bonuses number field that I want to implement into an attack roll template. It copies the state of the radio buttons just fine, but if you change them, the roll doesn't reflect that. Whatever the character sheet said when the template was called is what will go through.
I've seen Martin recommend a dropdown instead of radio buttons before, but I don't remember the specific instance. If you do an in-line user input command (the one that's configured in the roll instead of in a user input template) it's always worked better for me, but the look of it is pretty set. You can have a couple hidden attributes with the various roll states and use a ref to put them in the same basic roll so you don't have to type it three times depending on the condition.
The second argument must be the Radio Button Group and the third must be one of the values you've set in your Radio Buttons. Setting a boolean is not sufficient, it must be a string.
That's only in combination of a Dynamic Table. Otherwise Radio Buttons work fine.
That was actually the first thing I tried, but I couldn’t get that to work either. When I’m off of work, I’ll try it again
@warm quartz @charred prairie So yall inspired me to play around with Mekton some too. I'm working on the idea that all the servos, weapons, and equipment are going to be items with templates to easily filter them into the boxes from the mecha design sheet, and that they're configurable as such. It's still in the building phase, but this is what I have so far..
Looks nice. I've always though that there was so many options that allowing for all of them in a VTT sheet was going to be tricky. At least on the coding side.
I'm debating mentally right now with whether I should have each class of weapon as a separate template or if I should try to get fancy with a visibility formula on a single template (hiding the tabs that have configuration options that don't apply to the specific weapon class). So if you choose "Beam Weapon" on a dropdown, the Beam Weapon configuration tab is visible, but if you choose "Missile" it's not. If I go with the multiple template option (which is easier, tbh) I'll just have all the various weapon templates show up on the Weapons item displayer.
If you want to templates to compute the cp value & space, I've found that someone had managed to get all the formulas behind the Mekton Zeta Plus tables, but it's going to be a lot of work (especially with ammo). Otherwise, if you just need to record a weapon to use it in your game, you probably don't need to bother with multiple templates. But I tend to try to keep things simple, why coding the whole mecha construction rules if only the GM is going to use it (and just when preparing his campaign).
IIRC for the range, you take the square root of the weapon damage multiply by 4 (for beam weapons), 3.5 (for missiles) or 3 (for projectile weapons) and round to the closest value.
<shrug> I like figuring out how to make stuff work. Having a fully-functioning MTS is nifty for me.
Rather than just calculating everything I was going to go with a table lookup based on the damage, and multiplied by the range modifier. So the table for beam weapons would be 3 columns, with Damage|Cost|Range, and you would select the damage from a dropdown, then various other modifiers on the item, which would then do the calculation to a display at the top of the item.
As for ammo, the design max ammo will be kept on the item, but the current ammo will be on the play sheet for the mech (which I have yet to design; what I showed above is just the design sheet). Keeping the weapon's ammo in the sheet makes adjusting it easier when coding attack rolls, imo.
The other thing I'm thinking I'll work on during this project is a script to send a chat message to the GM with the damage result, so that he can click a button in the chat card to apply it, similar to how DND5e handles it.
Kudos if you can pull this out, I'm not proficient enough even for the damage allocation... Too much special cases for my taste (weapons that hit all the servos, burst value, armor piercing, incendiary, entangling, shock weapons, etc...).
That's a really clean looking UI
Is it possible to create a table where you count the number of rows that have text in them? For example, create a table with 12 rows and I want to know the 5 of them have text?
If its a dynamic table, yes. If it's a regular table component, not directly.
Great, how would I refer to that count in a formula?
I must've done it wrong before. This worked!
As far as this goes, I think having it be all on the sheet will be ok. I've set it up so the main roll message resets the situational bonus (and now advantage/disadvantage), and the alternate one leaves them alone.
count(lookup('<dtkey>','columnkey>')) will return the number of entries in the column that are filled.
One more question. How do I left justify a rich text area by default? I've added one to a tabbed panel but all the text in the rich text editor is centered.
in the html editing mode of the RTA (the button with </> on it), you can add <div style="text-align: left;"> to the beginning.
The reason it's doing that is that it's inheriting the styling from the panel.
Gotcha, that makes sense
@sinful spade I have a quick question on formatting. Knees has a line in a roll that he wants to have hidden if the character isn't proficient in it, but would also like to have the 2nd column right-justified. I have no problem using the div styling I just described to Krelios in the other lines, but on this line in particular it has a problem because of the " " in the styling. Is there a way to define that the 2nd column is right justified in the table styling instructions, or would it have to be a more involved css definition to get that to happen?
What I'm working with here:
<tr><td>Roll: </td><td style="text-align: right;">${roll:=[!d20]}$ </td></tr>
<tr><td>Attribute Modifier:</td><td style="text-align: right;">+${!rowMod:= sameRow('row_mod')}$</td></tr>
${sameRow('chk_prof') ? '<tr><td>Proficiency Modifier:</td><td style="text-align: right;">+${!profMod:= rank_mod}$ (${rank}$ rank)</td></tr>' : '<tr>${#profMod:= 0}$</tr>'}$
<tr><td><b>Total:</b></td><td style="text-align: right;"><b>${sum(roll, rowMod, profMod)}$</b></td></tr></table>```
This would throw an error because the formula doesn't like the " " in the formatting.
You mean the " " for the stir tag??? I think the issue has more to do return the same row being called?? Same row as what?
Is this being called from a dynamic table??
yes
Without the styling the roll works fine, and the other lines are styled properly, but it's line 4 that causes the problems.
So I was wondering if there was a way to style the whole table instead of doing it line-by-line
or more specifically, style the second column in the whole table.
So there's two ways you could try to style this without styling to td itself...
1.) Put a span in the TD and style that.
2.) Use nth child selectors to select the TD and use your css file.
Really doesn't feel like it should be that though, especially if it's only one styling call causing the issue, not all of them
This is the output he's getting with just the line 4 styling removed, top is proficient, bottom is nonproficient (so top is "true" bottom is "false" in the line 4 conditional)
No, the centered state of the Proficiency Modifier. That's from something else he's working on.
Gottacha.
And is it actually centered? That looks left to me (assuming the cell div is where I think it is) only way to tell is to use the page inspection and look at where the border is.
Just want to make sure that we're trying to fix the right issue (text alignment, or is it actually something to do with padding)
Yeah, it probably is. It's unstyled right now, so whatever the default of <td> is, which I suppose is left.
So as far as I'm seeing there's actually 2 issues, no? Prof mod isn't being added in the first roll, and it's not right aligned.
That right?
I .. actually didn't notice that. I would say that I can get past any kind of code issues for the roll (I actually know what's happening there; profMod is being overridden to 0 by the embedded function in the conditional. I'll fix that.
The second issue is the one I need help with. Can you use nth-child inline? All the information I'm seeing on it has it defined in the css files.
Right. I think the same issue is with how he nested the logic not actually the style.
logic not being contained{
ROW(CELL()CELL())}ROW()
Like the else is outside the rest of the same grouping, and the logic is just floating in the void of the table
IF [sameRow('chk_prof')]
{'<tr><td>Proficiency Modifier:</td><td style="text-align: right;">+${!profMod:= rank_mod}$ (${rank}$ rank)</td></tr>'}
{ '<tr>${#profMod:= 0}$</tr>'}
Try restructuring to...
ROW{style="logic to show the row"(TD()TD())}
Ah.
Oh.i see what he was trying to do, hot swap the rows rather which is why the code is nested outside the table structure.
I don't know if that's possible or not, but even if it is; since the other row is just not visible I'd still try to do the logic just impacting a display property
🤣🤣 fair enough
So set a logic statement in each of the <td>'s?
Nah, in the TR
Just have the logic changing the display property of the row that way it's still "there" even if you can't see it
That way if he adds more rows in the future, it doesn't impact any other nth child or what not styling choices, plus should be a little cleaner
If the data was changing maybe we'd have a different usecase but we really only care to show the row or not
Can you hit me with a simple example of that? Can you use CSB logic formats in the styling section?
Idk if you need to do the whole style tag or just the contents but one of the two should work.
Something like either, and bare with me im on mobile
<tr style="display:${sameRow('chk_prof') ? 'unset' : 'none'}$">
<tr ${sameRow('chk_prof') ? '' : 'style="display: none"'>
I'm assuming unset should work fine but if there's no errors and it's never visible there may be a better display value haha
Thanks, let me give it some poking at. Appreciate the help.
No problem.
If you want to brute force it with css nth child, you'll need to do it from the css targeting a class on the table main tag.
any luck?
I mocked it up because knees had to go. It's not working properly, the part being selected by the logic function is just echoing at the top of the table and isn't being taken up by the html.
<tr style="display:${#sameRow('chk_prof')?'unset':'none'}$;"><td>Proficiency Modifier:</td><td style="text-align: right;">+${!profMod:= sameRow('chk_prof')? rank_mod : 0}$</td></tr>
That roll should be a false response on the logic.
and this one is a 'true' response. At least the math is working lol
that's really friggin weird. Have you tried swaping out the entire style element?
Yeah, I got pretty much the same thing, let me cycle it back into the alt roll and I'll show you.
I've nevger tried to do this with a table before so a lot of trial and error, but im starting to wonder if it's even possible - you may have to have the roll on the outside of the table and import its results into two separate tables having each entire table display/not, rather than just a row
It was actually even worse, the styling for that line got all jacked.
<tr ${sameRow('chk_prof') ? '' : 'style="display:none"'}$><td>Proficiency Modifier:</td><td style="text-align: right;">+${!profMod:= sameRow('chk_prof')? rank_mod : 0}$</td></tr>
had to find it all.
<tr class="custom-system-roll" data-roll-data="{"raw":"sameRow('chk_prof') ? '' : 'style=\"display:none;\"'","result":"ERROR","parsed":"sameRow('chk_prof') ? '' : 'style=\"display:none;\"'","hasDice":false,"tokens":[],"rolls":[],"hidden":false,"explanation":true}" data-roll-mode="publicroll" data-hidden="false"> <td>Proficiency Modifier:</td><td style="text-align:right">+0</td></tr>
That's the info for the Proficiency Modifier section there. Here's a screenie of the whole section
I have no idea how it decided that should be in a roll box.
Maybe because I didn't hide the first formula, let me try that.
Nope, same result
So I went back to the less awful one and looked at that element too. It seems like what's happening is that it's resolving the pieces of the <tr> and inserting the <span class = ...> text.
Normally parsing <tr>:
<td style="text-align:right"><span class="custom-system-roll" data-roll-data="{"raw":"roll:=[!d20]","result":16,"parsed":"16","hasDice":true,"tokens":{"children":[]},"rolls":[{"formula":"[!d20] → [1d20]","roll":{"class":"Roll","options":{},"dice":[],"formula":"1d20","terms":[{"class":"Die","options":{"flavor":null},"evaluated":true,"number":1,"faces":20,"modifiers":[],"results":[{"result":16,"active":true}]}],"total":16,"evaluated":true},"expandRollInChatCard":true}],"hidden":false,"explanation":true}" data-roll-mode="publicroll" data-hidden="false"> <i class="fas fa-dice-d20"></i> <span>16</span></span> </td>
Not parsing section:
<tr style="display:<span class=" data-roll-data="{"raw":"#sameRow('chk_prof')?'unset':'none'","result":"unset","parsed":"sameRow('chk_prof')?'unset':'none'","hasDice":false,"tokens":{"children":[{"handle":"sameRow(\"chk_prof\")","display":"sameRow(\"chk_prof\")","children":[],"value":true}]},"rolls":[],"hidden":true,"explanation":true}" data-roll-mode="publicroll" data-hidden="true"> <td>Proficiency Modifier:</td><td style="text-align:right">+7</td></tr>
The pieces that would complete the <tr style=... section are what are up in the very beginning for some reason; if it said unset";> that would complete the entry.
But, I'm starting to agree with you. I think I'll advise him to just leave the proficiency modifier visible and have it set to 0 when the character isn't.
Or to just remove the styling, we were able to leave out the line about proficiency when it wasn't styled. This was just trying to have the cake and eat it too.
oh no, i was saying have two tables coded into the roll and have the formula wraped around both to decide which to export
sorry for the delay in response im struggling with cloudflare 😦 networking is kicking my ass
but
${condLogic ? <table....> : <table...>}$
Use ! at the beginning to get rid of the <span></span>
I'm seeing a weird message in the console, and it's appearing alongside something on the sheet not updating properly.
Does anyone have a clue what this is about?
I have an issue and I'm sure that I'm missing something very tinny which makes me sad :/
I have roll formula like:
${#result:= roll + mods + skill}$ ${#dc_value := switchCase(dc,"easy",10,"hard",15,"very hard",20,0)}$
*dc is given through user question prompt
${!dc_value>0?"no DC":concat("DC:",dc_value)}$ ${!dc_value <= result ? "Success" : "Failure"}$
there is no issue to have DC: xx result but to know if there is Success or Failure I have constantly "error" with "Unsupported type of condition "Array" TypeError: Unsupported type of condition "Array""
Any help or tip how to identify problem?
PS: verification by Array.isArray show that both attributes (dc_value, result) are not arrays... surprise 😉
Check with typeOf()
ok, via typeOf the result is an Array... but how its so?🤔
first(result) return result of "roll + mods + skill"... but...
Which variable is an Array?
result is an array and is only set once by:
${#result:= roll1 + roll2 + mods + skill}$
and
mods are summary of numbers from char sheet
skill is number from char sheet
roll1 & roll2 are rolls:
${#roll1:=[!"1d6"]}$
${#roll2:=[!"1d6"}$
Check if mods or skill is an Array
skill is an Array:
${#skill:=lookup(concat('dt_',item.attr),'value','skill_label',item.skill)}$
There you have it
ok, even if there is only one value lookup always will return an array.. just in case if there are more rasults which fit to condition
Find or first(lookup()) dont though.
I already used first as there will be always one result in that case... will take a look on find later on also :)...
PS: panzerkraken I left you a prv 😉
Hi there, maybe someone will also wish to use picture of dices in chat roll messages 🙂
<div class="dice-tooltip custom-system-dice-tooltip"> <div class="dice-rolls"> <span class="custom-system-dice-pool custom-system-dice-pool-multiple" data-hidden="false" style="border: 0;"> <span class="roll die ${!diceType}$ custom-system-roll-tooltip-dice"> ${!diceRollResult}$ </span> </span> </div> </div>
Ah interesting. So you've effectively recreated a visual dice pool but in a different spot if you just had CSB do it?
That's actually really handy.
I recreated how its done via [!1d6]. Normally at the bottom of chat message.
hehe.. .you'r welcome 🤣
but I have an question 😉
I have 2 rolls hidden and assigned to two variables as I need to track result on each of them (as they could be eaither d4 or d6, defined by situation on char sheet):
${#rollA:=[1:diceA:]}$
${#rollB:=[1:diceB:]}$
point is that after execution I can hear rolling dices, but I can't see dices rolling on the screen :/
in theaory DiceSoNice are set as should be (as per my knowladge) but maybe I'm missing something 🤔
They should be rolled, yeah. Dunno why it's not deferring it if there's no error
That one is coming from Foundry solely as it seems... Good luck finding the culprit there, might be a corrupt file somewhere
Seriously impressive! 👏
I'll be stealing that when I get back to work on my system. A bit of burnout from overdoing it haha, taking some time off.
Lmk if you find any of my work useful I'll be sure to throw some snippets your way
Hey quick question about macros, since i can acces most of the actor data via actor.system.props if i'm understanding this corretly, i believe i can make most of the stuff via that like accesing most values of the actor sheet not needed to pass them manualy vial label roll like it says on the wiki? Or is this a bad practice?
If you execute the Macro manually, then the context of actor will be provided in most cases. If executed automatically, then the context will not be provided. You have to take care of that on your own.
So if it's executed from actor sheet via label roll it's good idea to just use actor.system.props then?
Check this here: https://foundryvtt.com/article/macros/
The official website and community for Foundry Virtual Tabletop.
Ok i get it now
It would be easier if there was self reference like sending entire actor object from the sheet lol
Hi, anyone for a little help ? 🙂
My skills values are calculated with a formula
and I want to roll it
but if I make the "base" column an Number field, it doesn't refresh if I Change my strengh value for example
BUT , if I make it a text field, the value was recalculated, but the first(lookup) function return me an error in my roll panel
ok i'm dumb forgot about %{}%