#Custom System Builder

1 messages · Page 52 of 1

silver lake
#

So, any idea of what might be going wrong? Any suggestions on what I may do to learn more about the problem?

#

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.

wheat geyser
#

Hi! Is there a way to show on a roll-message the selected label, not the key, of a specific drop-down list?

sinful spade
normal jolt
#

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.

manic crypt
#

Items with effect type modifiers to existing keys, likely.

normal jolt
#

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.

manic crypt
#

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.

normal jolt
#

When you get a chance, if you can share some screenshots, I would appreciate it.

silver lake
#

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?

vagrant hollow
silver lake
vagrant hollow
# silver lake 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.

edgy barn
#

hey did someone know how i put a roll formula in the rich text i guess im a bit stupid right now xD

sinful spade
#

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???

oblique willow
#

How come my players cannot edit rich text areas on their items?

edgy barn
# sinful spade i can't wrap my head around the usecase for that???

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?

sinful spade
#

am I missing something?

edgy barn
sinful spade
#

🤔 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')}$

edgy barn
#

like this but without making a macro for it

sinful spade
#

erm... ok... so i ask - why not just have a label beneath it?

edgy barn
edgy barn
sinful spade
#

no sir, you just have to make a more robust label function.

#

let me load my world, one second

manic crypt
# normal jolt When you get a chance, if you can share some screenshots, I would appreciate it.

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.

edgy barn
sinful spade
#

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.

edgy barn
#

okay and how much i have to set up for this to work?

sinful spade
#

🤷 not much.
you just need to reference your item's components

edgy barn
#

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

edgy barn
#

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

sinful spade
#

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.

manic crypt
# normal jolt When you get a chance, if you can share some screenshots, I would appreciate it.

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)

sinful spade
#

i dont know why but
"subtle?" "obvious." made me chuckle.

what kind of system are you running?

manic crypt
#

Cities Without Number

sinful spade
#

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

manic crypt
#

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:

edgy barn
edgy barn
sinful spade
manic crypt
edgy barn
#

is okay if it is so but wuld be cool if not xD

formal goblet
manic crypt
sinful spade
oblique willow
#

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?

manic crypt
oblique willow
manic crypt
#

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.

manic crypt
#

I just get this:

oblique willow
#
Fortitude save: ${[1d20] + fortitude_save}$
${!notesDefenseSaves ? notesDefenseSaves : ""}$
${!notesDefenseFortitude ? notesDefenseFortitude : ""}$

I tried just using ${!notesDefenseSaves}$ but that didn't work either

manic crypt
#

What's the error?

oblique willow
manic crypt
#

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.

oblique willow
#

Yep, it works as soon as text is added to the field

#

Just errors out if its empty

manic crypt
#

Hm. Let me duplicate that quick.

formal goblet
# oblique willow

fromUuidSync('uuid').system.props in the console. If a value is undefined, it has the same meaning as non-existance.

manic crypt
#

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?

oblique willow
#

I don't know why fromUuidSync isn't working, copied the uuid from the actor doc

#

just returns null for any uuid

formal goblet
oblique willow
formal goblet
oblique willow
#

I looked it up on the wiki and they have it backwards, they say left click is uuid while its the reverse

formal goblet
oblique willow
#

11, since most modules don't work or have warnings for 12

formal goblet
oblique willow
#

I had the same issue when I ran v12 though, that including an empty text field error out

formal goblet
#

That's probably if you run an old component config

oblique willow
#

When I asked the same question for the v12 instance which was fresh and separate from this one

formal goblet
#

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.

oblique willow
#

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.

formal goblet
#

I think the fix is to hit the save button for each entity using the RTA

oblique willow
#

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.

formal goblet
#

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.

oblique willow
#

Probably true, but they're far too valuable to live without

manic crypt
oblique willow
#

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.

austere lantern
#

Hey sum() works on a dynamic table correct?

formal goblet
manic crypt
austere lantern
#

oops I see it

#

I forgot )

manic crypt
#

Pesky little guys.

austere lantern
#

yee. I miss something like that.

#

always

manic crypt
#

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.

austere lantern
#

good idea. I don't have notepad++ but I do have kate and that does the samething.

manic crypt
#

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.

austere lantern
#

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.

regal valley
#

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.

wheat geyser
wheat geyser
#

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

normal jolt
sinful spade
latent oyster
#

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?

wheat geyser
# sinful spade Stops working when the two values are the same??

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,

formal goblet
wheat geyser
#

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

formal goblet
formal goblet
wheat geyser
#

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

wheat geyser
#

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, '>=')}$

verbal portal
#

Hello everyone!
I was looking for sPIE function can I roll a damage and subtract the HP o a target with the sPIE( 'target' ,....)?

verbal portal
#

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

manic crypt
verbal portal
#

Mmm there is a way to do it?

manic crypt
#

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.

verbal portal
#

Ok Thanks 🙏🏼

sinful spade
sinful spade
candid badger
#

How do you set an item displayer to only hold one item?

manic crypt
# candid badger 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.

candid badger
manic crypt
lilac panther
#

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.

manic crypt
#

Inside the brackets preface the formula with # .

manic crypt
lilac panther
#

Can you please link the wiki if it's possible?

manic crypt
#

${#setPropertyInEntity('self', 'HpCur', "HpRegen+HpCur")}$

lilac panther
#

Okay, i understand now, but it still doing this

manic crypt
#

Yeah, its a roll message, it sends a card to the chat. One sec while I get the link, I'm on my phone.

lilac panther
#

forget it

#

how can i make it not through the roll massage?

manic crypt
#

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.

lilac panther
#

Okay, thank you, i'll do something with it

rocky sable
manic crypt
lilac panther
wheat geyser
#

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?

manic crypt
manic crypt
manic crypt
wheat geyser
#

No no, that's exactly it. My problem was doing it like this: ${:variable:}$

manic crypt
#

You only use the :: when you're calling a key (aka variable) inside a roll formula. So if there's no [], there's no ::

wheat geyser
#

Thank you! That helps me alot

manic crypt
#

No problem, good luck!

lapis meadow
#

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.

lilac panther
#

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

lapis meadow
lilac panther
#

Now i have a question.
How can i sum two strings using item modifiers?

manic crypt
#

strings, or numbers?

lilac panther
#

strings

#

like

#

"Hello" + " " + "World"

manic crypt
#

concat()

lilac panther
#

But item modifiers doesn't have that(

#

like i have d8 as base damage

manic crypt
#

for which field?

lilac panther
#

and i want to add d4 to that

#

label or hidden attribute, doesn't matter

manic crypt
#

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?

lilac panther
#

i found a way around but i'm still working on it.

#

And it's too complicated, so if you have any ideas

manic crypt
#

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.

lilac panther
#

but what if i need to stack 2, 3, or 5 ot modifiers like this? (and this system will do that)

manic crypt
#

I think it winds up in script territory at that point.

lilac panther
#

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

manic crypt
#

idk, that's a Martin or Linked question.

lilac panther
#

btw, are item mods from CSB or FVTT?

manic crypt
#

they're an implementation of the FVTT concept in CSB.

lilac panther
#

okay... I think i understand?

#

Thank you anyway

manic crypt
#

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.

formal goblet
manic crypt
#

Ah, Martin, do you have any thoughts on how to implement what dima is looking for?

formal goblet
#

Active Effects might help you more than Item Modifier, because there's currently no implementation for other aggregations or reducers

lilac panther
#

just an item on an actor

formal goblet
lilac panther
#

But, they have the same modifier interface...

formal goblet
lilac panther
#

Oh, and how to change the list of active effects? I want to add my own

manic crypt
#

Those are the conditions you're talking about.

formal goblet
# lilac panther ??

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

lilac panther
formal goblet
lilac panther
#

Oh, is it new?

formal goblet
lilac panther
#

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

sharp grotto
#

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 ?

formal goblet
lilac panther
sharp grotto
lilac panther
#

and what sould it do if it's checked?

sharp grotto
#

add +1 to an modifer at the actoer sheet

lilac panther
#

where are ${}$

#

add them at the left and right and it should work

sharp grotto
lilac panther
#

yes, you do)

sharp grotto
fringe silo
#

is there a maxium to the amount of modifiers a item can have

#

this should work right?

formal goblet
#

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)

fringe silo
#

do i need the ${}$ arond the keys.

formal goblet
lilac panther
#

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.

plucky canyon
#

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?

manic crypt
plucky canyon
# manic crypt 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');} }%}$

manic crypt
#

Is it throwing the right error when the right condition is there?

plucky canyon
#

It's giving me an undefined. Should I add a let for the error?

manic crypt
manic crypt
#

Ah, it's confusing that sometimes it is and sometimes it's not. Is his error saying something else then?

manic crypt
plucky canyon
#

Ok, yeah it's a bit confusing when you're unsure if you have the "right" error or not. 🙂

THanks for the help!

silver lake
#

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.

elder raft
#

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?

humble geyser
#

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

manic crypt
#

You don't need to put in the ${}$ for each sub conditional.

humble geyser
#

what really?

#

oh

manic crypt
#

For these purposes a switchCase() would probably also be more efficient.

humble geyser
#

whelp, removing the extra ${}$ worked

#

SwitchCase() ?

#

OH, i see that on the document

#

yeah, that would make life easier

manic crypt
#

Yeah, it's good for returning text easily.

humble geyser
#

Thanks, I was bashing my head in for the past hour trying to figure something out

elder raft
proper dagger
#

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.

manic crypt
#

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.

proper dagger
#

Dang. That's really simple

#

Did this used to not work? I feel like I looked for it before

Either way, thanks!

manic crypt
#

I'm not sure, it's worked since I've been messing with it, so since the last iteration of 3.x?

proper dagger
#

Very possible I missed it in a changelog

manic crypt
#

Well, I'm glad you got it sorted! Good luck with it all.

proper dagger
#

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.

manic crypt
#

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.

proper dagger
#

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.

manic crypt
# proper dagger I should clarify I'm saying I've been using "shortsword" to test, so I just made...

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.

proper dagger
#

I'm a bit confused. One sec, let me get a few screenshots so I can make sure we're on the same page

manic crypt
#

Sure.

proper dagger
#

So this is a section of the weapon list on the actor template.

And my label formula. To break it down, it's currently...

manic crypt
#

Ah.

proper dagger
#
  • 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

manic crypt
#

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.

proper dagger
#

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

manic crypt
#

what key name convention do you have for those level fields?

proper dagger
#

To simplify things, and because the key isn't used elsewhere, I just used the name of the weapon

manic crypt
#

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.

proper dagger
#

So, have like a text box with the name in it as well?

manic crypt
#

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.

proper dagger
#

Here's a screenshot of the whole item template

#

Bit of a mess but I'm still building it lol

manic crypt
#

No worries, mine tend to look the same.

proper dagger
#

But yeah, I see what you're saying. Probably a good call

manic crypt
#

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.

proper dagger
#

fetchFromParent wasn't working for me. How new is that?

#

I might be on an outdated build

manic crypt
#

Umm.. most recent version.

proper dagger
#

Ah. That'd do it

manic crypt
#

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.

proper dagger
#

I just hadn't gotten around to it yet

#

Doing it now

manic crypt
#

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.

proper dagger
#

Ok, still working out some update kinks. It's on a server, so it got a little wonky

manic crypt
#

Oh, ok. I'm kind of spoiled in just running it locally.

proper dagger
#

I miss when I was. Didn't have a proper server setup, so my janky method was unsurprisingly unreliable

manic crypt
#

My players wind up with some lag, but it runs really reliably for me (and my wife, who connects on a local IP).

proper dagger
#

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.

manic crypt
#

Sorry for prompting it.

#

Hit me up if that code has any snags you can't overcome, I'm usually watching on here.

lilac panther
#

What is "CSB - Embedded Items Folder - DO NOT RENAME OR REMOVE"?

white hatch
#

@formal goblet Hi. Can you answer please in DM to me? Ive smth to discuss.

manic crypt
ruby frigate
#

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

formal goblet
proper dagger
proper dagger
#

I'm not sure how to see that

manic crypt
#

hit F12 and then screenshot the last red part on the console.

proper dagger
#

I don't see any red besides parts that just make up the page. "right justified," and all that

manic crypt
#

Hm. The label is just reading "Error" or something?

proper dagger
#

Right

manic crypt
#

Hit refresh from template on the character, and see if the error pops up in the console?

proper dagger
#

Oh, I was in the wrong tab

manic crypt
#

Hm. Try removing the "Bonus:" part from the front. You can put that in the prefix if the rest is working.

proper dagger
#

It was actually already in the prefix

manic crypt
#

Oh, you'd moved it? Ok, I had it typed in there. Did that change anything, or the same error?

proper dagger
#

No, I had it there the whole time, and just removed it from your formula when I copied it

manic crypt
#

Ok. It's weird that it's saying that the { is an unexpected character.

proper dagger
#

Is this important?

manic crypt
#

I'll have to get back to you, sorry, I'm not in a position to really sort out code at the moment.

proper dagger
#

You're good!

#

Just tag me when you've gotten a chance to look at it

charred prairie
#

Howdy! I just downloaded this today and there's a lot, I'm not even sure where to start at all

charred prairie
#

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?

manic crypt
#

Mekton, eh?

manic crypt
charred prairie
#

Thank you! This system functions more or less the same way as Cyberpunk 2020

manic crypt
#

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.

charred prairie
#

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

warm quartz
#

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.

wheat geyser
#

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.

formal goblet
# proper dagger Is this important?

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.

formal goblet
wheat geyser
#

So I have to set the token's basr every time one is summoned to a scene, right?

formal goblet
wheat geyser
formal goblet
#

You can find the Button at the header of every Actor sheet

wheat geyser
#

Well, it's surprising that I haven't seen this after a full hour searching while having my glasses on. Thank you!

charred prairie
warm quartz
charred prairie
#

Thank you very much! 🙏

proper dagger
silver lake
#

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

#

.

manic crypt
manic crypt
# proper dagger Where would I put those quotes? I tried around ${Skill}$ and Training both separ...

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.

proper dagger
#

Gonna try it out real quick. I think I understand where this is going, but a true coder I am not

proper dagger
#

Wait no, actor

#

Got an error again. What component has the key "Skill" in your example?

manic crypt
#

sorry, I meant to make that clearer then got lost in the explanation of things.

warm quartz
#

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.

charred prairie
warm quartz
charred prairie
#

Question: How do I put this in foundry?

warm quartz
#

Just put the mekton folder inside your World folder. I hope there is no other places declare this world. I'll check.

charred prairie
#

Oh its that easy ok

warm quartz
#

I think so. I haven't found any file with a list of worlds. So I guess it should work.

charred prairie
#

It does

warm quartz
proper dagger
proper dagger
#

I made a dumb mistake. It all works

#

You have earned your hero role

manic crypt
#

Lol. That's just a promotion thing, from backing Ember.

proper dagger
#

Still fits

manic crypt
#

Well, I'm glad I was able to get it working for your framework. Good luck with the rest of it!

sturdy dirge
#

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.

manic crypt
#

You can, how are you determining the row? Column is easy, you can just use a lookup.

manic crypt
#

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.

sturdy dirge
manic crypt
sturdy dirge
#

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

manic crypt
#

Got it.

sturdy dirge
#

For further information: its a skill table

manic crypt
#

so in the roll message field:
${concat("sameRow('identificacao')"," ", "sameRow('descricao')")}$ should do what you're looking for.

sturdy dirge
#

thx mate

#

appreciate it

manic crypt
#

ack. I forgot a closing )

#

If you copied that out, try it again.

#

I fixed it above.

sturdy dirge
#

just fixed it here, dont worry

manic crypt
#

Ok.

sturdy dirge
manic crypt
#

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.

sturdy dirge
#

trying to figure out why it doesnt

manic crypt
#

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.

sturdy dirge
#

i see, thx again

#

IT WORKED

#

yessss

charred prairie
#

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

manic crypt
charred prairie
#

A static item on the sheet

manic crypt
#

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.

charred prairie
#

I ended up just slapping a number box and bypass the dropdown menu entirely

manic crypt
#

Thats reasonable, especially if you don't want an upper or lower limit on the mods.

charred prairie
#

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

manic crypt
charred prairie
#

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

manic crypt
#

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?

charred prairie
#

Almost all of it unfortunately

manic crypt
#

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.

charred prairie
#

Thank you for your help, I really appreciate it

manic crypt
#

No problem at all. Whats the first thing?

charred prairie
#

How do I attach text to a roll?

manic crypt
#

Type it in the Roll message outside the ${}$ part. You can also format it using css notation.

charred prairie
#

How do I attach the contents of a text field to a roll?

manic crypt
#

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.

formal goblet
normal jolt
#

@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?

normal jolt
#

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
normal jolt
#

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

normal jolt
#

Scyrizu - you have created such a problem for me now - lol - how much time will I spend on this???

dense verge
#

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.

sturdy dirge
#

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

manic crypt
#

However, that only works on the item displayer. Doing it somewhere other than that is more complicated.

manic crypt
sturdy dirge
#

desc is the item rich text box

manic crypt
#

${sameRow(item.desc)}$

sturdy dirge
sturdy dirge
manic crypt
#

Oh, this is on the item displayer, right?

#

${item.desc}$

#

doesn't need the sameRow(), sorry. I should have been thinking of it.

manic crypt
#

Could you show me the item component? desc?

sturdy dirge
#

Give me a minute

sturdy dirge
#

sorry, i was into something here

manic crypt
#

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.

sturdy dirge
#

now i see the problem

dense verge
# formal goblet Read this here: https://github.com/GamerFlix/foundryvtt-api-guide/blob/main/READ...

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

formal goblet
dense verge
#

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?

formal goblet
dense verge
#

thank you

charred prairie
#

I'm trying to add the item from a table to a roll. Here is my roll command and the table

manic crypt
#

${[1d10xo10] + sameRow('MWeaponWA') + ref("sameRow('CbtSkillList')"}$ might work? I'd have to test it to be sure.

silver lake
#

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.

manic crypt
silver lake
#

I thought that one would still make the noise. My bad.

#

Thank you

charred prairie
#

It threw an error unfortunately

formal goblet
charred prairie
#

Well, new problems is a sign of progress. The item is no longer rollable, but it doesn't throw errors anymore

manic crypt
#

How do you mean "No longer rollable?"

charred prairie
#

I press the D10 Icon that I use to roll, and it doesn't output anything

formal goblet
charred prairie
#

There seems to be a problem with an uncomputable token?

formal goblet
charred prairie
#

And it's referencing this table

manic crypt
#

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?

formal goblet
#

Right, what does MFightingLevel reference?

charred prairie
#

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'?

formal goblet
manic crypt
#

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.

charred prairie
#

I see

silver lake
#

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?

manic crypt
#

#?

silver lake
#

Didn't work

#

It was the first thing I tried

#

%{${#!item.Sound}$}%

manic crypt
#

without the !?

silver lake
#

I thought that was necessary

manic crypt
#

It just suppresses the box around the result

silver lake
#

... oh

#

I thought it was to indicate the selected actor or something

#

that makes more sense

silver lake
manic crypt
#

No problem.

silver lake
#

So

#

%{${#!item.Sound}$}% has not worked, apparently

#

rather

#

%{${#item.Sound}$}%

#

It still pops up in chat

hollow crow
#

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?

silver lake
#

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();
charred prairie
#

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

sinful spade
#

as for how long you're going to spend on this, erm... i uh... don't want to talk about that 😅 ... too much.

sinful spade
vagrant hollow
hollow crow
# sinful spade have you tried the fill-opacity property?

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.

hollow crow
# vagrant hollow You can edit the transparency of this icon only inside the svg file itself. You ...

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));
}```

celest osprey
#

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

celest osprey
#

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

deft sluice
#

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

deft sluice
sinful spade
deft sluice
# formal goblet `ref(sameRow('Talent'))`?

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 ?)

deft sluice
#

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 😅

formal goblet
deft sluice
#

Yeah, I'm editing the example sheet, for not going from Zero 😅

#

I stop for tonight, I will try with a fresh skills table

formal goblet
deft sluice
#

I havent check the console, thanks for the advice

fresh arrow
#

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

formal goblet
#

The ERROR comes from the undefined return from the script.

fresh arrow
deft sluice
formal goblet
#

I don't know if there's a good example item with such a modifier

deft sluice
#

I will look at this 😊

deft sluice
formal goblet
#

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()")

fresh arrow
#

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 😉

formal goblet
#

Everything else depends on the error messages itself

fresh arrow
# formal goblet 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? 😄

fresh arrow
fresh arrow
#

Isn't that a reload of foundry?
Already done that many times to check if changes are valid... And nope, doesn't help.

fresh arrow
warm quartz
# charred prairie Nothing against the creator, I just simply don't know it

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.

charred prairie
#

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

warm quartz
#

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}$

charred prairie
#

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:

warm quartz
#

That's nice.

charred prairie
#

Thank you! It took a lot of trial and error, but I can loosely recognize basic functions.

warm quartz
#

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.

charred prairie
#

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

warm quartz
#

Yes tooltips are a must for the players.

charred prairie
#

MTZ seems to have a lot of optional but impactful modifiers for gear

warm quartz
#

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.

charred prairie
#

Or any of the custom weapons. You can't really pre-bake anything mech-side

warm quartz
#

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.

charred prairie
#

We're using the expansion.

warm quartz
#

Do you intend to use a lot of different mecha ? Or mecha that can change their payload depending on the mission (like modern aircrafts) ?

charred prairie
#

I don't think so

warm quartz
#

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).

manic crypt
#

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.

warm quartz
manic crypt
#

Nope, items can have the full gamut now.

warm quartz
#

Cool ! I was still using the old Foundry v11, I can now update to v12...

manic crypt
#

Theres even items in items.

warm quartz
#

(and spend the next weekends remaking my mekton sheets).

warm quartz
manic crypt
#

My thought was to have the armor sp as a configuration in the servo item, just adding to the overall servo cost and weight.

warm quartz
#

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.

charred prairie
#

I put RAM as a checkbox, and the Abs as a Text field

manic crypt
#

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).

manic crypt
warm quartz
#

I need to make a few tests.

#

(and write down the different cases to make sure I'm not forgetting something).

manic crypt
#

<nod> Have fun with it!

charred prairie
#

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

warm quartz
# charred prairie

Can you send a pic of the whole dropdown description ? YourDropdownKey should be the Component Key.

charred prairie
warm quartz
#

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 :

charred prairie
#

Hm, so it would be In my case
:${equalText(sameRow('NAMEOFTABLE','Nothing'),'LABELKEY')?DESIREDSTAT :

warm quartz
#

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 ".

manic crypt
#

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.

warm quartz
#

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.

elfin fog
#

does CSB work with carousel combat tracker? i dont see anything in the tracked resource aside from template

manic crypt
warm quartz
manic crypt
elfin fog
#

the configure attributes works but i dont think the attribute bars do

oblique willow
#

Whats the preferred way of doing status effects for CSB?

elfin fog
#

im not sure if its because they are named differently between the two or something else

manic crypt
manic crypt
warm quartz
#

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).

elfin fog
#

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

manic crypt
elfin fog
#

panzerkraken singlehandedly holding up the csb chat rn

manic crypt
elfin fog
#

thats what i did

manic crypt
#

did you use the props address for it?

elfin fog
#

im using the attributeBars rn

#

props works but

#

it looks something like this so im using the tooltip attributes rn

oblique willow
manic crypt
#

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.

oblique willow
#

Can they accept scripts? Trying to make it work with StatusIconCounters

manic crypt
#

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.

oblique willow
#

Tried to make it work for a test but no.

manic crypt
#

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.

oblique willow
#

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

manic crypt
#

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:

oblique willow
#

Are they then active on all characters of that template, or can they be separately stored/enabled?

manic crypt
#

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.

oblique willow
#

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

formal goblet
oblique willow
formal goblet
oblique willow
#

Ah, items can have active effects? Now I see the use yeah

formal goblet
oblique willow
formal goblet
oblique willow
#

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

ancient temple
#

can i use a checkbox to make a switchCase()?

manic crypt
#

For that few a number of options, why not just a conditional?

#

Like <checkboxkey> ? <true output> : <false output>

ancient temple
#

that works way better thank you!

oblique willow
#

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

sturdy dirge
#

yo guys quick question here

#

how can i show an item from a item displayer in a dropdown list?

#

sorry for interrupt btw

oblique willow
#

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

manic crypt
#

It comes out looking like this:

sturdy dirge
#

oh i see

#

thx

manic crypt
# sturdy dirge thx

No problem. I modeled it and took pictures because I didn't know the answer either.

sturdy dirge
#

oh wait

manic crypt
#

Is there anything in the item displayer?

sturdy dirge
#

its probably just not showing the item name

#

but its def recognizing it

manic crypt
#

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

sturdy dirge
#

OOOOH OK

#

now i got it

manic crypt
#

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.

sturdy dirge
#

identificacao is the item reference column label

manic crypt
#

What are you planning to have happen with the dropdown? Something like selecting an attack weapon?

sturdy dirge
#

yep

#

like he's equipping that item

#

basically i have the item displayer and the "selected items" section

manic crypt
#

Ah, so the attack and damage rolls are static, but change which item they're pulling from based on that dropdown?

sturdy dirge
#

yep

manic crypt
#

Not a bad plan at all. I'll remember that workflow.

sturdy dirge
#

actually theres not even a roll button, its just show the player which item is he equiping

#

look

#

just for tracking lmao

manic crypt
#

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.

formal goblet
manic crypt
#

And that's why you're getting blank, because there isn't a column keyed as 'identificacao', it has the key 'name'

sturdy dirge
#

another quick question herem, how do i get the item name? its just like {item}

#

or anything more complex?

sturdy dirge
manic crypt
#

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?

formal goblet
formal goblet
manic crypt
#

Nice.

oblique willow
charred prairie
#

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

hollow crow
#

Hello everybody! Any ideas about where to get interesting pre-made, fantasy themed CSS to change characters' sheet and other elements layout?

elder raft
#

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"

fast umbra
#

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.

plush delta
#

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.

manic crypt
plush delta
manic crypt
#

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.

plush delta
#

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

normal jolt
sinful spade
#

just set their with: and height: properties, if they're stuborn set the min-wdith and max-width (and heights) as well

plush delta
normal jolt
manic crypt
plush delta
#

I just don't know how to get to the keys on the item

manic crypt
#

if you can get the UUID, you can use fetchFromUuid() to pull values directly from the specific item.

plush delta
#

Off the top of your head do you know what syntax I'd use for that? Because that sounds like a useable route

manic crypt
#

fetchFromUuid(<uuid>,<key>,<fallback>)

#

actually, all of those parameters should be set in ' '

plush delta
#

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

manic crypt
#

what's the error?

#

probably uncomputable, but it's nice to be sure.

plush delta
#

Literally just the word "ERROR" in the test dropdown I made

manic crypt
#

I meant from the console (F12)

plush delta
#

How can I pull that up on browser? F12 opens my browser's console

manic crypt
#

That.

plush delta
#

Whoops, I flipped a parantheses to a bracket. Fixed, I'll get the new error

manic crypt
#

I was just about to say that 😄

#

I didn't even notice it in the code you pasted in earlier.

plush delta
manic crypt
#

are you on the most recent build of CSB?

plush delta
#

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

manic crypt
#

If possible. That error is saying that fetchFromUuid() isn't a valid command.

plush delta
#

Okay I yelled at them and they're updating it

plush delta
#

I sowwy 😭

manic crypt
#

No no, I meant you lol

plush delta
#

True XD

manic crypt
#

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.

plush delta
#

Ooh, shiny blue circles, I like these

#

And yup it works now

manic crypt
#

Great!

plush delta
#

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

manic crypt
#

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?

plush delta
#

Nope, it's properly capitalized

#

This is the item calling the user input, instead of the character sheet (and the fromUUID method)

manic crypt
#

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'

plush delta
#

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

manic crypt
#

Ah, yeah. Thats gotten me more than once.

plush delta
#

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

manic crypt
#

Lol. Well, I'm glad we got that part sorted. Good luck!

plush delta
#

Thanks a lot! I'm sure I'll be here in following days asking more dumb questions ^^

#

I appreciate your help ❤️

proper dagger
#

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?

manic crypt
proper dagger
#

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

manic crypt
#

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?

manic crypt
# proper dagger But just in case I'm wrong here, it seems like in a user input template, anythin...

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.

formal goblet
formal goblet
proper dagger
manic crypt
#

@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..

warm quartz
manic crypt
# warm quartz Looks nice. I've always though that there was so many options that allowing for ...

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.

warm quartz
#

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.

manic crypt
#

<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.

warm quartz
#

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...).

charred prairie
rich spear
#

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?

manic crypt
rich spear
#

Great, how would I refer to that count in a formula?

proper dagger
proper dagger
manic crypt
rich spear
#

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.

manic crypt
#

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.

rich spear
#

Gotcha, that makes sense

manic crypt
#

@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.
sinful spade
#

Is this being called from a dynamic table??

fringe silo
#

yes

manic crypt
#

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.

sinful spade
#

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

manic crypt
#

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)

sinful spade
#

The issue being just the little er.. thing? At the top?

#

With the 0 after it?

manic crypt
#

No, the centered state of the Proficiency Modifier. That's from something else he's working on.

sinful spade
#

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)

manic crypt
#

Yeah, it probably is. It's unstyled right now, so whatever the default of <td> is, which I suppose is left.

sinful spade
#

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?

manic crypt
#

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.

sinful spade
#

Like the else is outside the rest of the same grouping, and the logic is just floating in the void of the table

manic crypt
#

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>'}

sinful spade
#

Try restructuring to...

ROW{style="logic to show the row"(TD()TD())}

manic crypt
#

Ah.

sinful spade
#

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.

manic crypt
#

Yeah

#

"He" being "Me" in this case, I was helping him with the code.

sinful spade
#

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

manic crypt
#

So set a logic statement in each of the <td>'s?

sinful spade
#

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

manic crypt
#

Can you hit me with a simple example of that? Can you use CSB logic formats in the styling section?

sinful spade
#

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

manic crypt
#

Thanks, let me give it some poking at. Appreciate the help.

sinful spade
#

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.

manic crypt
#

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.

manic crypt
sinful spade
#

that's really friggin weird. Have you tried swaping out the entire style element?

manic crypt
#

Yeah, I got pretty much the same thing, let me cycle it back into the alt roll and I'll show you.

sinful spade
manic crypt
#

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>

sinful spade
#

wtf

#

what's it showing in console at that part?

#

like the html inspector

manic crypt
#

had to find it all.
<tr class="custom-system-roll" data-roll-data="{&quot;raw&quot;:&quot;sameRow('chk_prof') ? '' : 'style=\&quot;display:none;\&quot;'&quot;,&quot;result&quot;:&quot;ERROR&quot;,&quot;parsed&quot;:&quot;sameRow('chk_prof') ? '' : 'style=\&quot;display:none;\&quot;'&quot;,&quot;hasDice&quot;:false,&quot;tokens&quot;:[],&quot;rolls&quot;:[],&quot;hidden&quot;:false,&quot;explanation&quot;: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="{&quot;raw&quot;:&quot;roll:=[!d20]&quot;,&quot;result&quot;:16,&quot;parsed&quot;:&quot;16&quot;,&quot;hasDice&quot;:true,&quot;tokens&quot;:{&quot;children&quot;:[]},&quot;rolls&quot;:[{&quot;formula&quot;:&quot;[!d20] → [1d20]&quot;,&quot;roll&quot;:{&quot;class&quot;:&quot;Roll&quot;,&quot;options&quot;:{},&quot;dice&quot;:[],&quot;formula&quot;:&quot;1d20&quot;,&quot;terms&quot;:[{&quot;class&quot;:&quot;Die&quot;,&quot;options&quot;:{&quot;flavor&quot;:null},&quot;evaluated&quot;:true,&quot;number&quot;:1,&quot;faces&quot;:20,&quot;modifiers&quot;:[],&quot;results&quot;:[{&quot;result&quot;:16,&quot;active&quot;:true}]}],&quot;total&quot;:16,&quot;evaluated&quot;:true},&quot;expandRollInChatCard&quot;:true}],&quot;hidden&quot;:false,&quot;explanation&quot;: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="{&quot;raw&quot;:&quot;#sameRow('chk_prof')?'unset':'none'&quot;,&quot;result&quot;:&quot;unset&quot;,&quot;parsed&quot;:&quot;sameRow('chk_prof')?'unset':'none'&quot;,&quot;hasDice&quot;:false,&quot;tokens&quot;:{&quot;children&quot;:[{&quot;handle&quot;:&quot;sameRow(\&quot;chk_prof\&quot;)&quot;,&quot;display&quot;:&quot;sameRow(\&quot;chk_prof\&quot;)&quot;,&quot;children&quot;:[],&quot;value&quot;:true}]},&quot;rolls&quot;:[],&quot;hidden&quot;:true,&quot;explanation&quot;: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.

sinful spade
#

sorry for the delay in response im struggling with cloudflare 😦 networking is kicking my ass

#

but

${condLogic ? <table....> : <table...>}$
formal goblet
lost wigeon
#

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?

fresh arrow
#

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 😉

fresh arrow
fresh arrow
# formal goblet 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"}$

formal goblet
fresh arrow
#

skill is an Array:
${#skill:=lookup(concat('dt_',item.attr),'value','skill_label',item.skill)}$

fresh arrow
#

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

manic crypt
#

Find or first(lookup()) dont though.

fresh arrow
fresh arrow
#

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>

sinful spade
#

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.

fresh arrow
formal goblet
#

You just outsmarted our system 😅

#

But this might be handy even for me

fresh arrow
#

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 🤔

formal goblet
fresh arrow
#

still the only error is:

#

ok... will work on that... have a good evening all

formal goblet
sinful spade
molten stone
#

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?

formal goblet
molten stone
#

So if it's executed from actor sheet via label roll it's good idea to just use actor.system.props then?

formal goblet
molten stone
#

It would be easier if there was self reference like sending entire actor object from the sheet lol

molten stone
#

facepalmpicard ok i'm dumb forgot about %{}%

#

thanks again 🙂

deft sluice
#

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