#Custom System Builder
1 messages · Page 14 of 1
Famous last words
.
just for today
Inline rolls, huh... I´d need to take a look at it
@light hinge That's the crimes on character sheet I have commited for now for the weapons and shield part
cool
It's (from left top to left down and then other column)
Health and speed
Melee weapon 1
Melee weapon 2
Shield
Throwing weapon
Bows
But it's... Static in character sheet for now
Attack, Evade, Parry
Well... I thought about fields "Nazwa" (name), "Kość obrażeń" (damage dice), "Cecha" (attributes) being pulled from the item object. So perhaps making the Nazwa field a dropdown list of item objects?
Actor sheet
ok
In a visibility formula can I use a conditional between two keys as such: current_endurance >= item.weapon_endurance_expenditure_requirement
there are some changes that you will need to dow
I don't think it should pose a problem, as long as they pull actual numerical values before they are compared (don't quote me on that)
it doesnt seem to be working haha so....
you created a lot of itens containers, and that not how it's works. Think the intem container as a dynamic table that you add rows (itens)
if you click in this button, you will add a new collumn to the item container
and that you will need to do
in "Bron reczna I" you will create a item containter with "Nazwa" / "Kosc obrazen" / "Cecha"
the same applies to the 2 and 3
also one more thing
Im not sure why it isnt working though because the "item." field has a numerical value, and the formula should find that and use it but idk
confusing
can you show a print?
of which part?
what you are trying to hide
Wait, item. in a visibility-formula? That can´t work 😅
well what do you suggest then? haha
@tidal quiver as you said. The 3 names are going to be taken from the item. If you create 3 containers, you would need 3 different items
Im trying to make it so it hides the button when the endurance requirement of each individual item is not met
why cant it reference 'item.'?\
if the label "button" is part of the item container
Like this?
yes
and there is one more thing
i guess theese button you will use to use the items right?
Yup
so you will need to include them inside the item continer
Well... Kinda except shield, cause it should just add flat
That's why it doesn't have button
because they can't find the item
tbh, i would remove damagedice and weaponattributes display
and make only the buttons
I am trying to have an attack roll button either be hidden or unusable, with the condition of if an amount of "current_endurance" number field is a certain amount when compared to the individual item's "weapon_endurance_expenditure_requirement" field
for example
make them as labels
it should be like that
but whit your buttons
I could do that with DD and Atak button, but WeaponAttributes need to stay, otherwise one would need to search for them in the book (do I think right?)
nope
I guess adding Evade and Parry button to it also wouldn't make much difference in how it looks
this items is a quarterstaff that deals d6 damage
when you open it
it is wrote inside of it
Yup, while being two handed (duh), unwieldy (evasion -1), slow (parry -1), and long (2 meters range)
now
can you do me a favor please?
Ohhh... Now I see "i" xD
open the cfg tab of one your items containers
in this section, it does show nothing right?
I see templates to select (cause I made empty ones for now) it just doesn't show anything in filters
oki
aside from the bonuses and quantity limitations, there are other difference between weapons?
One handed, two handed and spears all use different skill for attack check (easy part, just do it in button), different damage dice, and attributes. Thats it for melee.
Ranged different skill, different damage dice, different ranges (and max ammo) different attributes.
okay
now it's your time to decide how you want to make your weapon templates
creating one for each weapon category
melee ; ranged ; trwoing
or a generic one that you choose inside of it the weapon type
I think that one per category will be cleaner
It´s missing some implementation details for that, but I can add them (seems to be only small changes)
so let's create the melee weapons
a melee wepon have the following attributes if i'm right:
a name ; a skill ; a damage die ; and a attribute
Im confused what you mean, are you adding examples of how to do this to the Github?
it's means it is impossible now
he will need to create the code
to allow that
Nope, it´s just that the system is not able to do what you want
Okay, is there any simplified version of what I am trying to accomplish that you could think of?
Well, skill is already in character sheet, so I don't think we need to implement it IN item. So it'll be Name;DD;Attributes
you will need to implement
because how the button will know what skill it will use?
Wouldn't it fetch it if I just point at it when calling throw for Attack?
yes, but how do you know what you are fetching?
maybe it's because i don't know the system
but the skill is just "melee"
or are "spears" ; "swords" ; "axes" ?
Spears, One handed, Two handed
see
Wouldn't this kind of call work?
nope
so, yeah
name; dd; weapon skill ; attributes
can you please create a blank item template called : melee weapons - template ?
Done
now it's up to you how you will do the design
but
i prefer creating a panel first
you will need to create 3 fields
one text field for damage dice ;
a dropdownlist for the skill type ;
and a dropdownlist for selecting the attribute?
what is the attribute?
i forgot
💀
Its one or more attributes that weapon has, that adds modifiers to your attacks/evasion/parry. So I think that as long as we don't really have to show it in characters sheet, I should make them on checkboxes, and just later send labels to character sheet, or really don't show them at all
yeah
it will be like that
i reccomend using a table
@tidal quiver after you create it, ping me
@glossy hare
They have constant values so no need for third column from yours
Have you used the visibility options for components yet? That would simplest way to accomplish what you want, just in a round about way. You'll be missing the "notify" part of your goal but it will fulfill the other requirements you want.
yeah thats what I was trying to do based off of what you found out, but the problem is that I cant just set it to ">= 1" because my weapons all have different endurance expenditure requirements
ok
so i was trying to use the "item.weapon_endurance_expenditure_requirement" label from the items itself, but @formal goblet said that don';t work
create an item
Make it as variable to check outside of roll and sending a flag to the roll?
No worries, I have to go shopping and hey, it's free help so I can't say anything ;P
Ok so we have different endurance numbers for different weapons. I will ponder this with my limited knowledge and see if I get a work around since what you want isn't doable in CSB.
Yeah im pondering as well, haa, I think it should be possible right?
Part of me thinks there's a work around involving hidden attributes or swtichCase but I would need be at my computer
okay it is good. now it is time to make this work ;
i will assume that you have a attack label as a columm inside your item container
first, inside you dropdown panel, you list each skill that melee weapons can have as labes. For keys, use 0,1,2,3,4.....
inside your attack label formula
you will need to create a variable, that uses a switchCase. it should be like that
skillModificer := switchCase('item.dropdownPanelKey','1','skillKey','2','skillKey2')...
i will be playing now, but don't mind pinging me
If there is my knowledge is limited on those features so I wouldn't know where to begin, but ill look at the Git to see...
You lost me at inside your attack label formula create variable
You meant in Label Roll message?
yes
Okay, I have this, how do I link it up to check if the button is working?
(which probably, rather for sure, isn't)
WeaponSkill
Hey, I'm debugging by getting errors and figuring them out 😛 No "working" button, no errors to show up 😛
?
so
in this line
its should be
skillModifier := switchCase('item.WeaponSkill','1','skillKey','2','skillKey2')...
but
you will need to change
skillKey
for the key for the value of the skill
for example
'1','skillSword'
'2','skillSpear'
if the skill are on a dynamic table
you use fetchFromDynamicTable
${skillModifier := switchCase('item.dropdownPanelKey','1','OneHandedSkill','2','HeavyWeaponsSkill','3','SpearsSkill')}$ ${string([2d6]+skillModifier+PCAttrDEX)}$
it shouldWork
but
you need to change this
It changed again...
switchCase('item.dropdownPanelKey'...
```for
switchCase('item.WeaponSkill'...
yes
So it is how it is now 😛
Is there a way to have a button when you click on it, check a checkbox for you?
or another checkbox
Im trying to have a checkbox or button in an item which checks another checkbox off in the character sheet when clicked
How do you make a roll button that can be activated from the chat?
Or clicked on I mean
Hey guys, this was probably been asked before (and my blind self couldn't find it) but is there a way to refer to the number rolled by the dice instead of the total result?
Example: I want that, whenever a 6 is rolled ** on the dice**, no matter the final result, it'll be a Fumble (for ability test) or a Critical (For attack test). The way i achieved it until now was to use the following formula
<b>${charname}$</b> makes a melee attack on the enemy <p><b>Dice result:</b> ${roll:=[1d6]}$ </p> <p>The attack causes ${roll == Crit? roll + abichar + (strchar * 2) + afmod : roll + abichar + strchar + afmod}$ damage</p> <p> <b>Hit Type:</b> ${roll == Crit? '<b>LETAL HIT! </b> ' : 'Normal Hit'}$ </p>
What i want is to incorporate the dice roll into the damage message, while still referring to the dice result to show it as a fail or a success. But when i try it, it takes the final result (dice roll + ability + strength + attack force) as the reference. So if the dice rolls a 4, but the final result is 10, it refer to it (10) instead of the number rolled by the dice (4).
This would also serve for the multi-attack macro of the system, since i could refer to each dice rolled to make it automatically add the strength or fire power multiplier for each critical result, instead of having to add it by hand each time.
CSB only allows to take the total (or total successes) of a roll, you cannot access the results of single dices from a roll expression.
But what if he would write them to variable? And then refer to it for his thing and for the rest of the roll?
He does that already
I am trying to do something complex: I want to have a damage dice roll that can reference the damage dice of the particular weapon for which the roll is for. For example: a dagger has a damage dice of 1d10, but another weapon has one of 1d12 etc. Can I do something like: ${[item.weapon_damage_dice] + :virtue_body:}$ for the roll? with the [] as the roll type? if what is being supplemented there is [1d10] from the item itself?
@formal goblet
Okay thanks. I am not sure where they are wrong based on that link, but ill try
it slightly confusing to me
keys inside [] must be surrounded with colons
okay yeah I just tried that and it still outputs ERROR.. hmm
and it does work to use a 'item.' to reference a text feild which has "1d10" in it, to bring it into the roll?
Yeah, it should. Check the console with F12
In the console it says error, and it says that the value is undefined, but the item has the text "1d10" in it so i dont know.
Screenshot the error and show the formula again
Damage Roll: ${item.name}$
${[:item.weapon_damage_dice:+:virtue_body:+:athletics_mastery_bonus:]}$
@formal goblet
Check if the key in the Item Template is right
And don´t forget to reload the Item in the Actor, if you added it recently.
oh yes i did not try that
It worked!
Thanks so much for your help.
@formal goblet
With the existing custom system submissions that are in the repo, are there any that would be recommended to use for reference that would compare to pf/d&d/pta/ptu/etc? I am trying to assist someone with something and tend to have alot of questions and like to reverse engineer my answers if I have similar things to look at.
There´s an example from me, which uses most features of CSB: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
thank you. I'll tear into it. c:
If they didn't look at this example first I'm about to give him some flak. Thank you c:
I am trying to have an item effecting a number field with an item modifier which subtracts from the number in the number field, but when I put the item on the character the number field still remains at 0 instead of -3 etc.
5.2. Item Modifiers:
- Key : This is the key of the property to modify in the owner actor. This must be the key of a number containing Label...
with formula support in drop down fields now, is it actually possible to populate the drop down field options with item container contents (like the name)?
or its further down the road in https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/180 ?
saw this in the kofi page
Dont know If this ist already resolved but you should be able to do this with a macro
or maybe i misunderstood the task 😅
hi, i have a questión.
How can i resize the image of subtemplate?
prueba is actor, creature is subtemplate.
But... a sub template doesn´t even have a concrete sheet 😅 . So why the image resizing?
Hello, I'm don't know what's going on. I'm trying to modify an the Attribute bars for an NPC but the system is preventing me from doing so. Like see this picture, unfortunately my cursor wasn't saved in the screenshot but it gives the usual 🚫 sign when I hover over at the attribute bar values in attempting to modify them (and the numbers are greyed out in the (proto)type token. This isn't an issue for PC tokens so I don't know what's going on.
I see
Is CSB capable of targeting multiple tokens and adjusting their HP with one attack? Basically AOE.
Nope, currently not. I suggest to do this via script-syntax
To clarify, this is using Foundry's innate ability to use JavaScript and adjust props within actors? Then combine the JavaScipt with CSB's own syntax?
can you use "x"as a multiplication factor in a formula?
More or less. We have a section in the Wiki, where some pieces are listed. But this section is only editable by us, so you´d need to create a ticket with the example script you want to share
The right sign for multiplication is *
hey CSB devs, why isn't possible to transfers itens between actors? I'm not demanding for it or like that, i'm just curious the tecnichal reasons for that
There is simply no implementation for that currently
Is there a way to have items be aware of other items with the same name in the same container and increment an index within the item based on the number of occurrences.? So one would have index 1, the next index 2, and so on.
Nope, items are unaware of other items
Hi, I'm a user who just started using this system recently. I'd like to try adding a talent field on a character sheet that will affect basic attributes. For example, "Might," which would increase Strength by +1. I want to create a feature table and allow users to select corresponding features from a dropdown menu on the character sheet to trigger these effects. Where can I learn how to set up this part of the program?
not possible to have a roll message play an animation/video, right? Trying to figure out how to add animations to spells on cast
actually, I figured it out, but I have a small issue now.
I basically used a script in my roll formula to trigger a macro that has an animation play when I roll damage, which works great, but since the macro has no "value" it also sends a message to chat saying "undefined" next to the damage roll text.
Is there a way to suppress this text specifically? I don't need the entire message suppressed I just want the undefined text to not show in the damage roll message
No return = undefined. Either return something or pass it to a CSB-Formula as a string and hide that with #
to send it to the formula as a string I just remove the return from the script right?
${'%{...}%'}$
ah gotcha thank you!
I suggest that you read through the README of the project first, it contains all necessary information to work with the system: https://gitlab.com/custom-system-builder/custom-system-builder/
You can also take a look at the example-template to get familiar with the system: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
If you still have questions, feel free to ask them.
Thank you. I'll research that
Hello, does someone have an example of a macro they use in order to update attributes according to variable value ? I've been struggling with this the last few days with no success
yeah I saw this one, problem is I can't figure how to make the change variable and not fix. because in the example change are +1 or -2, but i need something like +x where x is defined as a value chosen by the user of the macro. And when I tried it, I wasn't very succesful in making it work
So you need to also pass values to the macro? Then check this example from the Readme:
%{return await game.macros.getName('YourMacro').execute({name: '${name}$'})}%: Will execute the macro with the nameYourMacro, passnameas an argument to the macro and return its result.
In the macro, you get access to the name-variable, which can be used whereever you like.
Not necessarly passing values to the macro. Here is how it works in a simplified way :
1- a dialog opens asking the user to introduce all changes to HP separated by a comma [example : +4,-5,+1,+10]
2- the macro sums the list a gets a number that it stores into hpmod. [in our example : 10]
3- then macro uses :
/// ...
updateProperty(a, 'HP', '${HP + hpmod}$');
///..
But the values do not update. I just figured that it was because hpmod didn't mean anything to the updateProperty function. when I replace hpmod by 5 the macro works
Because the third argument of updateProperty() in this macro is a CSB-Formula. And because hpmod is not present in the ecosystem of CSB (it is only present in the macro), it doesn't know anything about that. Instead of ${HP + hpmod}$, you can enter currentProperties.get('HP') + hpmod (or a.system.props.HP + hpmod).
Okay thank !
It worked 😁
Hey ! Does anybody know how to add items to a character's inventory ? I have inserted an item field in the pannel on a template character sheet, but I cant seem to be able to drag items towards it so I wonder how it really works, or if I misunderstood the use of the "item container" thing
Thanks for any tips !
Take a look at the example template how it's done: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
Hello, I have been playing with inline rolls and wanted to know how to reference a variable.
I know that you can point towards a component like this
[[/roll 1d20 + @str]]
But what I want is to reference a variable
[[/roll 1d20 + @var]]```
Obviously just using "@" is not working, and I wanted to know how it is done
@var -> ${var}$?
No. In fact, it throws an error
I have removed the spaces and it no longer throws an error
But instead it shows in chat like this
-> ${!var}$
That fixed it, thanks 😄
Yo. I support and vote but i forgot to check whats goes in. I cant find in changelog but was there item.item container voted out or in? will be there a way to nest items? i found something similar but its for dnd5 but in works it looks greate so maybe there is something to canibalize? https://gitlab.com/tposney/itemcollection
Yes, there are item containers and, from recent poll results, there will be the ability to add sub items will be added. This means either pieces of equipment, like scopes, or adding qualities (ie accurate) have things dropped on to them.
Hey
using what you helped me out with yesterday to integrate macros in with CSB rolling
just wandering if I wanted to add a second tag to this...
%{return await game.macros.getName(rolls).execute({Skill ${Ath2}$})
how i'd go about it?
since I've got it setup in the macro to allow a wild dice to roll as a different colour (with dice so nice) simply with dice=[fire] as an example
%{...execute({var1: 1, var2: 2, var3: 3, ...});
ok thanks, just still learning and not sure where everything fit within the brackets etc for doing two
It´s basically pure javascript (if you leave CSB-formulas out), so you can find tutorials everywhere about the language
yeah
so just...
%{return await game.macros.getName(rolls).execute({Skill ${Ath2}$, Dice ${Dice}$})
then?
Don´t forget colons
script doesn't have them but they are still needed there?
script being setup as... const rollData = {skill, dice};
and then both of those just being plugged into a roll command
This won´t work...
I´ll give you an example how the syntax looks like if you´re defining an object:
const person = {
firstName: "John",
lastName: "Doe",
age: 50,
eyeColor: "blue"
};
You see that the fields (firstName, lastName, ...) in the object person are listed as key-value-pairs separated by colons. What you pass into the execute()-method of your Script is nothing different than an object (just without a name like person).
After that, you can access these values in your Macro just by using their name (in your case: Skill and Dice).
well here is the whole script I am trying to run
const formula = "(@skill)d6cs>=4 + 1d6x=6cs>=4@dice";
const rollData = {skill, dice};
const roll = await new Roll(formula, rollData).evaluate();
const isFail = roll.dice.at(-1).results[0].result === 1;
await roll.toMessage({flavor: isFail ? "Critical Failure": ""});
basically the dice rolling system for Mythic D6 since its wild dice is...a bit of a headache for standard foundry roller
given it also has a critical failure roll on a 1
Your macro is fine, it´s just that the syntax for passing values between Script and Macro is not right.
No, Tabs and Whitespaces are irrelevant. You´re just missing colons in-between Skill & ${Ath2}$ and Dice & ${Dice}$.
Yep
I assume I'll need to change them in the macro too
I just logged in to my world and my sheet was blank and nothing was moddifiable. Anyone else having this problem?
Check the console. Something is not loading correctly
ok, something is still not working there
added them in
it just posts the whole thing to chat without triggering the macro
Did you create a Chat Macro? 😅
Just checked it, there are a few warnings, but I'm not certain what I'm looking at. Any Help?
You probably didn´t close the Script-expression in CSB: %{Content of your Script}%
forge... Btw, I don´t see anything relevant. You can limit the console to warnings/errors (and a screenshot is actually better for the visuals)
good call, sorry not used to playing with the console.
There is still nothing from CSB. And no errors whatsoever (you can ignore the one with the screen resolution, that one is normal when the console is open)
right
every time I try to create a new _template it comes back as my first screnshot
You are not the first one with problems at forge.
And I have no clue what goes wrong there
should I be working on this system outside of the forge and then try importing the world and see if that works? It seems like either way I'll have to start over...
<p>%{return await game.macros.getName(rolls).execute({skill: ${Ath2}$, dice: ${Dice}$})%</p>
in CSB
That one seems fine so far. And that is in a Label Roll Message?
yep setup as a button
Label Roll Message is enough, the button style is just aesthetics. Any errors in the console (F12)?
nope it's just telling me foundry created chat message when I hit to roll
Ath2 I have set as a hidden attribute just PHY+Ath
which should be fine for its formula
both are defined and filled in fields
Are Ath2 and Dice numbers?
Ath2 should be, its just PHY+Ath which right now for testing is 3+1
Dice is not
it's telling the macro to roll a difference dice colour with dice so nice
Then wrap that with quotes
but triggering the macro outside the character sheet just through the chat /macro command that worked fine
'${Dice}$'
done
didn't change anything
do I need to add colons to the dice and skill in the macro?
Which version of Foundry and CSB are you using?
CSB 3.0.0 currently
and foundry V11 stable - patch 8
Build 308
all as up to date as it can be
the script runs fine with /macro rolls skill=3 dice=[acid]
Oh boy...
VM7330:3 Uncaught (in promise) SyntaxError: Invalid left-hand side in assignment
at AsyncFunction (<anonymous>)
at processFormulas (ComputablePhrase.js:166:40)
at async ComputablePhrase.compute (ComputablePhrase.js:212:34)
at async HTMLAnchorElement.<anonymous> (Label.js:271:21)
current error now
Hey, we are further 😅
yee
<p>%{return await game.macros.getName(rolls).execute:({skill: ${Ath2}$ dice: $'{Dice}'$})}%</p>
where did that come from?
Yeah
No key-value-pair -> no colon. Also, you´re missing a comma between skill and dice
quotes are placed wrong. Check this: #1037072885044477962 message
fixed that already
%{return await game.macros.getName('rolls').execute({skill: ${Ath2}$, dice: '${Dice}$'})}%
and no quotes around Ath2 because that'll end up a number
Still same error?
yep
VM7458:3 Uncaught (in promise) SyntaxError: Invalid left-hand side in assignment
at AsyncFunction (<anonymous>)
at processFormulas (ComputablePhrase.js:166:40)
at async ComputablePhrase.compute (ComputablePhrase.js:212:34)
at async HTMLAnchorElement.<anonymous> (Label.js:271:21)
Did you reload the actor?
each time I've changed anything yep
%{return await game.macros.getName('rolls').execute({skill: ${Ath2}$, dice: '${Dice}$'})}% is correct. Your macro seems to have issues.
const formula = "(@skill)d6cs>=4 + 1d6x=6cs>=4@dice";
const rollData = {skill, dice};
const roll = await new Roll(formula, rollData).evaluate();
const isFail = roll.dice.at(-1).results[0].result === 1;
await roll.toMessage({flavor: isFail ? "Critical Failure": ""});
is the entriety of the macro
and I run it from the /macro command in chat and it goes fine
/macro rolls skill=3 dice=[acid]
you know what, I'm going to try simplifying this issue a little
I just deleted the dice option completely and it worked
so wtf is going wrong there
I reconstructed your example and it works. Check if you get the right values from Ath2 and Dice (you can use Label prefix for that).
I suspect its because dice in order to work and alter the colour of the wild dice requires [ ] around the command
like [red]
having PHY+Ath should be fine as the formula for Ath2 right?
So I just tried exporting it to foundry and it worked, and now it's showing up in the Forge too. Weird bug.
Like I said, I have no clue what goes wrong with Forge
${PHY + Ath}$ is fine as long as both are numbers
so would the [Red] being put in screw things up somehow?
You can create a test template on your own and test things out
in my macro would I have to quote mark it since it'd be text there?
No, they are already stored in a variable
ok well, no fancy different coloured wild dice I guess
but got the rest working
it'll do
i got css grid mostly working with item containers
Hello, everyone. I'm attempting to use ${[::]}$ program to import calculation results, but I'm unsure why it's failing. I'm wondering if a separate formula is required to calculate the result.
Example:
A_key ${[:(b_key+c_key):]}$
D_key ${[:A_key:]}$
Calculations in A_key are successful, but when I attempt to use D_key to import the result from A_key, I encounter an error.
I'm not sure about pulling results from one key to an other but you can use results in the same formula using the :=
https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/main/README.md#47-reuse-formula-results
🤔 i try ,thank
I am trying to use the following code within an item to generate output based on the value of num box on the item:
let ranks = ${skillRank}$;
let output = "";
for (let n = 1; n <= ranks ; n++){
output = output +"<span class=\'advantage\'>l</span>";
}
return output;
}%```
It out puts the following error. I know it relates to the single quote but attempts to use single, double, or escaped quotes have been unsuccessful. How do I overcome this error?
JS strings should be single-quotes, while HTML strings should be double. Also, there's no escaping needed
need some help, im just new to css and customizing a game system into a sheet. I'm trying to use the switchCase expression by fetching a key from a user input Number Field and makes a return string into the label. but all I got is an Error from the sheet
${switchCase (xp ,
>=100 & <600 , "2" ,
>=600 & <1200 , "3" ,
>=1200 & <2000 , "4" ,
>=2000 & <3000, "5" ,
>=3000 & <4200 , "6" ,
>=4200 & <5800 , "7" ,
>=5800 & <7500 , "8" ,
>=7500 & <10000 , "9" ,
>=10000 , "10" , "1")}$
switchCase can only check against equality, no range checks. Use the ternary operator instead
so i need to make a check outside or another way for it to calculate without range?
thank you
are you looking for something like this?
${experience > 509999 ? 9 : experience > 253999 ? 8 : experience > 125999 ? 7 : experience > 59999 ? 6 : experience > 29999 ? 5 : experience > 13999 ? 4 : experience > 5999 ? 3 : experience > 1999 ? 2 : 1 }$
oh yeah something like that
thank you, I never used these kind of syntax before
i used to C++ more
first conditional has priority, last "else" is if nothing applies. you must include an "else" or it will spit out an error
? then
: else
So it is a if else without the function there?
Like built in if then else of its own?
I used to code some pdf and c++ but it was long ago. Thanks a lot really. Im not used to js yet
i grew up with BASIC so im used to thinking in those terms
VSB?
Ah, i hadnt learnt that one yet
X$ is a string
Ook
Basically, yes: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator
The conditional (ternary) operator is the only JavaScript operator that takes three operands:
a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy.
This operator is frequently used as an alternative to an ...
Thank you, its a new language for me
hi, i am trying for first time userinput template.
I create a inputusertemplate with some numberfields. My problen is that i dont know how to call the userinput template.
first paragraph dont say how to call, second dont work
?#{userInputTemplateName}
@formal gobletWhenever you want I am ready to throw the Mythic D6 system template and macro json your way, if you wish to add them to the library?
i create the userinput, put the numberfields, but dont know what do do next with the button. I wan pass all keys, make some calculs and show in chat all calculs.
I can help you with that, you just make a label and in the post to chat area put whatever maths you need referencing whatever is required elsewhere in the sheet and it'll just do it when clicked on the sheet.
You can also have it do some maths in the background with hidden attributes so if you have some bonuses that are added you can just do it there and have the final number used elsewhere.
OK, tactical/design question for the room. The system I'm prototyping allows players to enhance skills with the equivalent of XP in the system. So, for example, if a character has the 1-Handed Weapons sphere (school), it comes with a basic attack (Sweep, does 1d6 damage) and a basic defense (Parry, on success take 1/2 damage).
I want the players to be able to choose from a broad list of potential augmentations to skills, so they could spend Potentail (XP) to add the "Riposting" effect to Parry, which would allow them to roll damage in addition to the base effects of the Parry talent. I had planed to make a series of Item templates (called 'Augments') with an "effect" text box, then put an Item Container in each equipable talent (and piece of gear) that would accept the Augment type. So a player could drag the "Riposting" augment onto the "Parry" talent on their sheet and it would add the effect text to an item container. Then I'd concatenate the effect text from that container to a different label to put the effects together as reminder text to the player (will try to turn it into automated effects/updates when Active Effects work).
The challenge is that, at the moment, you can't put items in Item Containers on other items. I'm trying to think of alternative techniques and hoping that someone has already done something like this in a system. Any thoughts or insights?
sounds more like a character skill than something directly attached to an item, guy with parry for instance could do so with a rapier sure, but could probably just as happily pick up a side sword (probably generic short sword in stats) and do the same thing
or for that matter a long sword since they aren't exactly lacking in nimbleness of the blade 😛
so I'd just have a separate talents area to drop it in then a way to tell it 'apply this on attacks'
Yes, attacked to a skill, but under the covers, skills are still Items, type-wise
But I do like the workaround of making each augment a separate item on the character sheet that the player can click. would have to rewrite the code I use to build the roll statements (or just do it manually, I suppose, it's a TTRPG, not a video game)
yeah, kinda an annoying situation
otherwise a macro maybe that looks for those arguments and if not present just moves on without them
parry not ticked? ok, not going to include it.
Hello all,
Quick question: can you create a shop for players to buy and potentially sell?
not home atm and I don't remember for sure but I think items aren't tradeable from one actor sheet to another directly. I think they have to be dropped on the ground and then picked up, so a shop in the form you're probably hoping for I don't believe is possible in core CSB. You can use things like Monk's Journal Enhancements to make a functioning shop though
thanks a lot !
Can I write using the entity command? I know I can write with setPropertyInEntity but I have the problem that I had before with the reading....
entity is not a command, it´s an object 😅 . And yeah, you can use that to read / write values.
Oh, I can??? But that's super nice, thanks!
Does anyone know why CSB is trying to parse the output of this code as JSON?
let a = ${skillRank}$;
let output = "";
for (let n = 1; n <= a ; n++){
console.log(n);
output = output +'<span class="advantage">l</span>';
console.log(output);
}
return output;
}%```
The error
``SyntaxError: Unexpected non-whitespace character after JSON at position 14 at JSON.parse (<anonymous>)``
Sorry to be a bother...any chance to find a list of CSB-safe font families?
hi, any know how to make itemcontainer with variable filter?
I have spell items orderer by magic class (fire, necromancy, illusion, etc) In the sheet i wan that player can see only the class that have.
I try with itemcontainer for each class, but make sheet slow and visuality ugly
Ok, found the issue. You need a double-backslash \\ before every double-quote ". The reason behind this is this: After a script gets processed, it will be handled by the CSB-Formula-system by passing the script result as a string. Because the string contains ", it needs to be escaped by \. In order to print a \ in JS, you need another \, so that´s why you need 2.
Uhh, nope.
Oh well, no big deal. Thanks 😉
The problem I noticed is that I can set values but they won't refresh unless I recharge the Template. Is there something I can do to force a refresh?
Right now I'm doing entity.system.props['defensepenaltyfromactions'] = penalty;
Call the update-method (like here: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Tips-&-Tricks/Script-to-update-multiple-items)
My issue is the same basic issue as the previous post but I don't think that solution will work for me as the issue does not involve item values.
My issue: On one tab, on the main actor sheet, I have some buttons that +/- a number box value (increment+stat+item value) that is on another tab. The result is also shown in a label on the same tab as the buttons. I have to press the button twice to update the label but then the label is an increment behind the num box.
It's the same for the actor, you have to call the update()-method.
Thanks. I still seem to be missing something in getting the label to match the value of the num box on button push. I am not sure what the correct implementation of the update() method is.
${setPropertyInEntity('self', 'brawn', ${brawn}$ >= 5 ? 5 : ${brawn}$+1)}$
%{
let name = entity.entity.name;
let a = game.actors.getName(name);
a.update({'system.props.brawn': ${brawn}$});
}%```
You can optimize some things here:
${setPropertyInEntity('self', 'brawnXP', "brawn >= 5 ? brawnXP : (brawnXP + brawn + 1) * 10")}$
${setPropertyInEntity('self', 'brawn', "brawn >= 5 ? 5 : brawn + 1")}$
You already handle the setting of the value with setPropertyInEntity(), which is already calling the update-method for you.
Thanks but this doesnt solve my problem. From the picture, assuming white "Brawn=4", when I click the up-arrow for "Brawn", "Current Rank" and "XP Spent" increase to 5 and 75, however the white Brawn remains at 4 unless I click the up-arrow again (which increments everything one level and creates a lag) or refresh the sheet. When I click the up arrow, white Brawn and Current Rank should be the same value.
Is brawn a number field?
Is there a way to use a portrait if i'm using a form fillable pdf as the character sheet with PDFPager, and make it work like the portairt in the default sheet?
You cannot transfer data from a PDF to CSB
I feel stupid for asking, but can you not call a key within a normal table? I can't get StrMod to use Str in the formula ${floor((Str-10)/2)}$
Yes, Brawn is a number field
Okay, found the workaround. I mapped the field to "img", then i just switch to the default sheet, change the portrait, and change back to the pdf sheet, that shows the picture
You can, a normal Table has no special boundaries. Check the console for errors in your Label Roll Message
My Label Roll? That doesn't have an @ in the message
Well, but it still is invalid. 1d20 is not a number, so you cannot add that with StrMod. If you want to perform rolls, use the roll-syntax [] additionally. You can find more instructions in the projects Readme.
Having removed the entire Label column for rolls, it still returns the same error
Do you use @ at other places?
Negative. This is the first formula I've written for the sheet
But the error says that you have a formula with (@StrMod)
Correction, my bad. I did @ str in the skills, I've removed that now
This is the current error msg
Show me Str
Seems fine.
Anything wrong in my formula for StrMod?
That seems fine aswell
🤷
Stupid thought, maybe, but could the system be 'unsure' what to do because both key and label are the same in Str?
If you mean the optional Label, then no. That is not even available as a key
Just a wild guess...I'm out of educated guesses 😅
Maybe a problem with uppercase?
I'm fiddling a bit with the formulas and have found that using ${floor(Str-10)/2)}$ in a label works fine but as soon as you put it into a number field it just hangs up and reads Str as 0. 🤔
Might be an issue with the system, because your props are also undefined there, which doesn´t seem right.
Can't say, everything else works just fine 🤷♂️
Wait a sec, there is not even an implementation for formula support for default values in number fields 😅
Oh boy 🤣
But labels read that correctly...
Well, it´s only the starting value anyway. Default value for number fields means, that this will be the value on initialization, it won´t track any updates.
So it´s useless most of the time
True that, but another number field should read it, shouldn't it?
What do you mean by "read"?
Extract the default value for 'later use', so to speak.
Then I'm confused... and this is mainly due to my limited coding capabilities...
Why do labels 'read' it, then?
Because Labels are non-input-components. They work on derived data, so they can just recompute their current value
That´s why most of the Formulas are in Labels.
Ok, so number fields instead can't do that. I think i got it...
But Input components can be directly manipulated by the User (updating their values), while it is straight up impossible to do so with Labels
So Input Components and Labels do complete opposite things
So I just gotta make my players put in their modifiers for their sheets, is what I'm getting?
It depends on which kind of modifiers. You can do that with input components, but you can also utilize Item Modifiers, if you´re working with Items.
I was just trying to automate "X attribute score outputs Y attribute modifier"
But I think they can suffer through without that 😂
Hello, all you beautiful people, I'm wondering about making a rest button that restores the players max mana and 1/2 their total Hit die. I believe it can be done im just not sure how? Any help you all could provide would be amazing!
Can I, out of curiosity, ask why you want to use number fields for modifiers?
This one should help you out: https://gitlab.com/custom-system-builder/custom-system-builder#4211-setpropertyinentity
Because they're a number on the character sheet. StrMod is "strength modifier" as in D&D5e
Of course, I understand that. Anyway that could be achieved via labels, or am I on the wrong path? Sure I don't know what your goal is, so please bear with me and my questions 😅
But the label wouldn't display the numerical value on the sheet, would it? I know I could use my formula for the roll, but would it also display the roll mod on the char sheet?
Let me know if that made any sense 😵💫
Ok so i've got it where i think it should work but its not... any clue what im doing wrong (also i know this isnt what i said i was aiming for just thought i'd start with something simple so i could understand it before i made it hard with math and stuff. haha)
Use double-quotes around 20 and you´re good to go
No joy, its just putting it into chat.
Well, you also have to put it into a formula ${}$ 😅
haha, tried that as well. i get an Error box in chat.
Check the console
Whut? Which version of CSB are you using?
2.2.7
Sure it shows, just put the formula in the label and that's it.
If you look at this image, it shows just that https://cdn.discordapp.com/attachments/1037072885044477962/1154435673634394142/rn_image_picker_lib_temp_ab65d71a-e23e-4b0c-9443-242e974aab4d.jpg
I havent updated cause i was worried it would break my add ons but i can do it if you think thats the issue
Yeah, you need at least 2.3.0. That´s where it got released.
Cool beans, I'll do some updates and see if it works!
Here the Changelog for reference: https://gitlab.com/custom-system-builder/custom-system-builder/-/blob/develop/CHANGELOG.md?ref_type=heads
Ok, NOW I feel dumb again. Thanks for the assist
Oh, don't dumb yourself, everyone goes through that 😉
And it's my pleasure 👍🏻
Wow, so I was doing 3 columns that could've just been 2 this whole time. 🤯
@dim bison You can also check out the Example-Template. It might help you structuring your sheet: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
Speaking of sheet structure...
If I ever went bananas and decided to inject som CSS in my sheet template, once I devise a CSS file and put it in the system dir, how do I use it? Do I need to modify each part of the sheet by looking at it via F12 explorer? Or...?
Either you override existing classes (with the help of the console), or you define your own ones. Every component accepts additional CSS-classes
Thus to modify the components I would go through the console, right?
Might be, yeah
Thanks for the heads-up 😉
That did the trick. Thanks boss!
is there a way to edit the Tabbed Panel so that if there's only one visible tab, the tab header doesn't display?
Nothing that CSB offers you out of the get go.
yea, but is there a way to finagle it anyhow?
CSB doesnt offer me gridded item containers from the get go either
Well, we generally work with Tables. So grids are kinda... meh
One final question, is there a way to update a value and then if it exceeds a max value set it to the max ? Basically my players have hit die equal to their level + 1 so right now they have a max of four.
so this : ${setPropertyInEntity('self', 'hd_Aval', 'hd_Aval + ((player_lvl +1 )/2)')}$
works like a charm but i'd like to make it so it cant go over.
If you want to, you can take a look at the system-files from CSB to get an insight of how the Components are structured. I´m open for enhancements.
Determine with formulas what the maximum allowed increase can be and set the cap with the min()-function.
To answer the question, nope. You´re responsible for updating your values correctly.
Again, I do not know how your system works...anyway, can't you just put player_lvl+1 in the max value portion of the number field? Assuming hit dice are stored in a number field, that is...
I was trying that and i couldnt get it to work, then i noticed its because im dumb and it was a text and not a number line! Working like a charm. This community is awesome. I really appreciate all of you.
Hey guys, Is it relatively easy to make a Backpack Tab in a CSB Actor sheet which will support [Mod] 'Item Piles'?
Thanks, I'm sure that'll come in handy later, but for right now... what do I put here so I can drag 'n' drop items in?
it doesn't seem to respect item quantity
add an Item Container
or are you talking about a bank
click the Configure button in the title bar
Actually, I'd like to thank you @blazing ibex for not throwing shade on me for being completely blind.... 😆
... frickin Item Container element sittin' right there.
it interacts strangely with Item Piles, you might think it's bugged, but its not
do you have an example item?
Not yet, but I'll have time to go into round 3 in about an hour.
I'm hoping to achieve making a merchant actor called The Quartermaster, and his gear is paid for by a Requisition Token (Players get 3 each) and a suitable skill roll, done in RP.
so when you drag an item onto your character, it looks like this
if you want to move it again you cant drag the name, you have to drag the icon. even though it looks like its part of the same element its not
If all 5 of my players can window-shop at the same time, and then I can baby-sit the skill checks that'd be ideal.
Thanks Fiffin, looking forward to putting your tips into action. 👍
check this thread out when you get more used to things #1154507115172466810 message
Oooh, shiny. that would cover converting it from looking like it's on antique paper to a "pit-boy" or the like?
seems possible but you'd have to figure it out
Mmm... wish I didn't have to go get food and eat it now. 😉
Do dice formulas like [d20] not work with recalculate()?
Nope
Hello, how can I link the bonus damage of a weapon to the item panel in a character's sheet to show it in the panel itself? Like in the last image posted here, by Fiffin.
I'd try importing the Example sheet from the gitlab, but it's not actually working for some reason.
Huh, that's odd, looking up it seems that my version is outdated, but when I try to install a new version with the manifest from the page, it still installs the 1.7.3 version.
Oh, I'm stupid and forgot to update my foundry server. D'oh.
Back to the weapon damage thing then.
Importing the Example sheet still doesn't work, odd.
${item.KEYNAME}$
Hello, I have a question about advanced filter for conditional modifier list, is it possible to make it so that only modifiers that =/= 0 are shown ?
Also are the formulas contained in the description for a item modifier are computed using the actor's or the item's data?
nope
item data
thanks!
OK, I am close. But before I try the next version, I want to know if this should even be possible.
I am setting up a module for the new Cowboy Bebop RPG.
So, the rolling mechanics work like this:
- Grab a number of d6 based on the Scene setting
- Grab a number of d6 equal to the number of Traits used
- Determine if there is Advantage or disadvantage.
- If there is Advantage or Disadvantage, add a d6 to the pool
- Roll 'em!
- If there was advantage, discard te lowest. If there was disadvantage, discard the highest.
- (this is the hard part) Count the number of 1's rolled, Count the number of 6's rolled and add up all the dice rolled and kept.
Is this possible?
I´d try to do that with a Script. A normal formula wouldn´t be enough.
OK
I kind of thought so. I don't have the chops to do proper scripting yet, TBH...
Using a label formula, I can do all of it but count 1's and 6's
So, I'll just put the PCto work after it rolls, thanks for making such anAWESOME module BTW
But... CSB is not a module 😅
Sorry, I am still learning the Foundry Lingo
1 world, 1 system, many modules
CSB is super rad is what I am trying to say. Thanks for making it and thanks for maintaining it!
Sure, no probs
huh i wasnt aware that item piles works with csb. for normal buying transactions to work, do you just set the gold field into the currency editor?
Items - Tooltip: I can define a tooltip for an Icon and the Icon itself has a tooltip that says "Item". Is it possibly to deactivate or change this second tooltip? Both together look weird:
Item Containers - Additional Filters: I would like to make a filter like this: TYP is 1 OR 7
Is this possible? Is there an OR operator?
Or a kind of enumeration? TYP is 1,7
yes? do you mean whatever keyname you set for your currency on the player sheet?
it wasnt working before for me. i will check it again. i did not use the 'system.props' tho previously
so it might be that
just put in the field name directly which make sense that item piles is not able to detect
it has to be a fixed value so no
for the filter value
@tiny hinge the items require a keyname price and in item piles you enter as system.props.price
i don't know why it doesn't recognize quantity on an item, but everything else seems to be system.props.KEYNAME
alright it works. not entirely but good enough! thanks! 😄
anyone know how or even if I can make a dropdown list switch a button between one macro and another for a button elsewhere on the sheet?
the system has a weird potential set of advantage/disadvantage rolls
and I have the macros and rolls for all of them setup thankfully
Do you want to be able to call different macros within one Label Roll Message or do you want to have different Label Roll Messages?
The first one would be done by setting the macro name dynamically, and the second one would be done via a visibility formula
want to have a dropdown so say I select 'disadvantage' and hit the button above the skill to roll
it will roll that skill with a disadvantage
And what is the disadvantage? How does that influence the Label Roll Message?
macro can accept stuff from the sheet, I have all of that sorted
and it will display the message
basically I just need in the roll command under the label/button I have it so that depending on what dropdown option is enabled elsewhere on the sheet it will roll with advantage, with disadvantage, with advantage (taking higest even) and with advantage (taking lowest odd), the macros for all of those are done
just need to know how to make it swap over
This will help: https://gitlab.com/custom-system-builder/custom-system-builder/#4213-switchcase
E.g.: switchCase(DropdownKey, 'normal', 'normalRollMacro', 'advantage', 'advantageRollMacro', ...). Just replace the macro name with that
ok will try
my brain is kinda cooked from spending all day doing this several times over
// Define the number of D10s to roll
const numberOfDice = 5; // Change this to the desired number of D10s
// Define the penalty value
const penalty = -2; // Change this to the desired penalty value
async function rollDice() {
let results = [];
for (let i = 0; i < numberOfDice; i++) {
const rollResult = await new Roll('1d10').roll();
results.push(rollResult.total);
}
// Filter out the odd rolls
const oddRolls = results.filter(result => result % 2 !== 0);
// If there are odd rolls, find the highest one
let highestOddRoll = null;
if (oddRolls.length > 0) {
highestOddRoll = Math.max(...oddRolls);
}
// Calculate the final result with the penalty
let result = 0;
if (highestOddRoll !== null) {
result = highestOddRoll + penalty;
}
// Create a chat message with the results
let message = `Rolled ${numberOfDice} D10s: [${results.join(', ')}]`;
if (oddRolls.length > 0) {
message += `\nOdd rolls: [${oddRolls.join(', ')}]`;
}
if (highestOddRoll !== null) {
message += `\nHighest odd roll: ${highestOddRoll}`;
message += `\nFinal result with penalty: ${result}`;
} else {
message += "\nNo odd rolls found.";
}
// Send the message to the chat
ChatMessage.create({
content: message,
speaker: ChatMessage.getSpeaker(),
});
}
// Call the async function to roll the dice and display results
rollDice();
});
and then trying to find weird little things stopping it from running like needing to add await
Hello I have a question. If I roll a macro from a button in an item container, would it recognise things like item.key ?
Nope, you have to pass the item data to the macro. You can use the linkedEntity-object: https://gitlab.com/custom-system-builder/custom-system-builder/#45-scripts
okay thanks 😄
ok so with %{return await game.macros.getName('HiEv').execute({bonus: '${BPFIT}$'})}%
what exactly would I have to do to add a second argument?
since the macro requires two, one the total number of dice and the other the flat bonus
I have the second arguments stuff all ready to go, just not sure on the syntax here
Hello!
Is it possible to use tagger to get the attributes of an actor created in CSB?
using game.actors.get or getName I can access and find the attributes inside system, but when I grab it with tagger, I can't find a system to access the attributes.
If anybody has any experience with this combination, I'd grealy appreciate some help!
One more thing!
How do I make an equippableItem that when clicked, the content is shown to chat?
I currently set up an item container, added a column called roll, and used ${}$ to access item.desc which I defined on my template. This does work, but it being treated as an inline roll rather just pasting the text, which is what I want.
Question - when using lables as buttons for automation purposes on the sheet - is there a way to not trigger a chat message?
'#' hides the text but message still occurs
@formal goblet or anyone else who knows: First off, CSB is Fantastic!
Second: is there a handy way of making a bulk-export / copy of the Sample World I've made in order to cram it into a new (proper) campaign world?
Also, is there a means of colspan'ing a static table?
You can export everything into compendiums p easily and then use the compendium importer module to import everything into a new world
I would export each folder separately for organization’s sake btw. Like in your actors tab, if you have a folder for all your templates and then a folder for all your NPCs and a folder for PCs, export each of those into individual actor compendiums or else when you import them into the other game world they’ll be all mixed into each other and disorganized
Hello, I see that a button in a dynamic table has the option of "Add as macro" if you click the right button of the mouse.
If it possible in a item container?
So, to follow up on my previous query:
There's NO way for a Number Field to call/reference a key in its Default Value?
Because in my Sandbox system, as old as it was/is, I was able to put in an Attribute Score, reference that key in the math for the Attribute Modifier, and then the Attribute modifier key was then referenced in all the corresponding skills. Granted, this is all to save my players from having to type numbers in and do math manually, but it seems odd to me that the newer system builder is somehow more... limited?
Did you try referencing the attribute key like ${attributekey}$ ? For max value that works
Oh, that does work! Then I can reference the modifier key as min value for all the corresponding skills, then just worry about proficiency checkboxes. Sorry for the assumption and lack of understanding
Hi all! How can I get the green part and the red part to add together in the roll message? the red ones are adding up correctly. Any combo of [[${...}$]] I've tried has broken the thing further, this is as far as I've gotten it to work:
Fix your conditionals this way and it should work when you combine them: ${(pc_something ? 1 : 0) + (...) + ...}$
Btw, string('something') is completely useless because 'something' is already a string (is wrapped in quotes). You only need it, if you have numbers that need to be converted to a string (5 -> '5').
Well, you asked for the default value of a number field. That's something different than the min value.
You can do that with every Label with a key, but I think that Item Containers are excluded.
You can mass-import/export templates over the buttons in the settings-tab of Foundry
That will be a feature for 3.1.0
Do ${!item.desc}$ to remove the border, so that it looks like normal text.
Yes, I'm sorry for my confusion. I assumed that min/max would be similar, and not be able to reference keys in their formulas. I was frustrated, as I thought I'd be messed up for all 27 skill values on the sheet
We have a description for every component in the readme. That also includes if certain configs can accept formulas or not.
thank you, honestly the "string" thing is just how someone told me I had to call the radio button part, I really have no idea what it does. :P. ANYWAY, now I have it like this [[ref('pc_healthdice') + (pc_agility ? 1 : 0) + (pc_cli1 ? 1 : 0) + (pc_cli2 ? 1 : 0)]] and it just rolls 'null'
Why [[]]?
well I tried that because ${}$ was saying error
do the two sections still need to be separate ${}$?
No, it should be contained in one. Math can only be done inside those
${ref('pc_healthdice') + (pc_agility ? 1 : 0) + (pc_cli1 ? 1 : 0) + (pc_cli2 ? 1 : 0)}$ gives ERROR
Everything else outside of ${}$ is treated as static text.
Show the console.
Or even better, show me your radio button
I think you have an error there
oh, should that not have the [[]] on it? I just noticed the box says 'value' and not 'label roll message'
I knew it. The radio button should only contain the text of the roll formula. Remove the [[]]. And then, go to your Label Roll Message and replace the part with the roll with ${[:pc_healthdice:] + ...}$
M A G I C🎉
Everything inside [] in ${}$ will be treated as a roll formula. :key: in a roll formula will be replaced by its value (in this case 1d6, so it will look like this when resolved ${[1d6] + ...}$
Thank you, this was gonna be my next question... when to use the different symbols. U DA BES
CSB has 3 different syntax delimiters:
${}$: CSB-Formula[](only inside${}$): Roll Formula%{}%: Script-Expression
and [[ ]] is only when they are by themselves, not inside ${ }$?
[[]] comes from Foundry and is used for inline-rolls.
G'day everyone. Kind of stuck on a, possibly, stupid thing.
Can a roll be done in a simple user-prompt structured like the example on the readme? If so, how? Adding a {[1d12]} line to the concat() does not work. Thanks in advance.
Why do you want a roll in a user input dialog? That is meant for asking a user for additional data before a roll gets submitted.
My bad, I realized that it was a silly question and figured out how to getvwhat i needed.
Thanks 👍🏻
Hi,
I need roll 3d6 and use result as is and use it for success count also
For example:
Roll: 12 (4 + 2 + 6)
Success: 1 (4 + 2 + 6)
Roll: ${roll:=[3d6]}$
Success: ${[:roll:cs6]}$
is not correct way
Because Success will calculated from 12cs6
Is it possible? Or I need use some script %{}%
You only get the total or the successes, not both. If you need both, use Scripts.
I may potentially have just found a bug. I have two number fields I'm using for my system's currency selections because there are different currency options available, and the one currently active is set using radio buttons.
the issue is that number fields don't appear to be able to keep whatever values are put into them when they're linked to a radio button. Each field's tag is set to be the value of one radio button in the group, and each number field linked in this way simply removes whatever values I put into them when I tab off the tab the currency is tracked in or close the actor sheet.
just checked and removing the radio button group altogether from the actor sheet allowed the currency fields to retain their values
Hey! A quick question.
Is there any way to allow the players to organize items in an item container? I know dynamic tables allow that.
There will be something in the next patch (it is actually already done).
OH! Perfect <3
I just wanted to thank everyone on this Discord for their patience and help. I'm much further in my understanding thanks to you guys, and I apologize in advance, as I know I'm not done with silly questions that are likely answered in the readme.
Strange question. Is there a way to make a label clickable to change A value or text of a text field?
Thank you in advance
yes, in label roll message https://gitlab.com/custom-system-builder/custom-system-builder#4211-setpropertyinentity
next update should include a feature that lets you skip the chat message https://ko-fi.com/post/Custom-System-Builder-3-1-0--Poll-Results-K3K0P4PC7
Thank you so much, I will try and get that working today
It seems to work for numbers which gets me halfway there. But not text fields.
Show me what you got
Works fine when I set a number
Use double-quotes for the last parameter
Yeah. Actually, single quotes should also be fine for a static string
no function
Can I use that inline code that Fiffin has to make like a checkbox-type control inside an item container?
using a label
(trying to figure out how to handle an "Equipped" function to items in an Item Container on a character sheet
please forgive my ignorance, I don't know what inline code means.
That's kinda what I am trying to do
oh ok
(if it's possible to "trick" the label limitation on Itm Containers)
Yeah, check the first arg from setPropertyInEntity()
(I think that's for you Oni)
This
Set value of key HP to 20 in the current actor: setPropertyInEntity('self', 'HP', 20)
"HP"
That was for you 😅
<crambles to go look at the ref documentation>
ohh, the 'item' entityName
thanks, let me try that
a checkbox returns true if it's checked? Not in quotes, just true? or 1?
Yeah, it returns a boolean. But you have to be a bit careful with setting a checkbox-value. I suggest to use an empty string for a falsy value.
This has led to a work around. Thank you so much all for the help
I'll use a label with the text "Equipped"
You can also use an icon in the Label, which changes depending on the equipped-state.
You just use HTML in the Label text with a small formula in it.
Got it
You can use the fontawesome-stylenames directly
I don't suppose you have a code snippet somewhere, do you?
Something like <i class="fas-fa dice-d20"></i> I think. But you can also check the Example-Template, which contains this.
perf, I have that loaded already, let me look. Thanks
Ok, the above convo was about making the “equipped/not-equipped” label in the item container the thing that gets clicked instead of going into the item itself and clicking the checkbox so that the column in the container changes, correct? Is anyone willing to share screenshots of what exactly you put where to make that happen? My brain just does not understand lingo without pictures. 😞
If I totally missed the actual point, just ignore me, carry on 😅
That´s correct. Here a small example:
- Label text:
<i class="fa-regular fa-${item.Active ? 'square-check' : 'square'}$" style="color: ${item.Active ? 'green' : 'red'}$;"></i>
- Label Roll Message:
${#setPropertyInEntity('item', 'Active', "item.Active ? '' : 'true'")}$
I´ll include it in the Example-Template later on
Thank you, that would be great!
And I'm grabbing screenies to show what I did
Steps I used to make an Equip/Unequip with icon in an Item Container on a Character.
- In the Item template, I made a Hidden Panel (hide it with the Advanced Configurations.
- Inside that panel I added a number field with the key set to "equipped" and set the default value to 0
- On the Character Template, inside the Item Container, I made a label column and named it itmEquipped (you can name it whatever, it's not relevant on this step.)
- in the Label text, I put the following:
<i class=" fa-solid ${item.equipped == 1 ? 'fa-hand-back-fist' : 'fa-hand'}$"> </i>
This shows a closed fist if the item is equipped and an open one if it's not equipped. - in the Label roll message for that label, I put the following:
${item.equipped == 1 ? setPropertyInEntity('item', 'equipped', 0) : setPropertyInEntity('item', 'equipped', 1)}$
So if the player clicks on it, it changes from equipped to unequipped and back.
You still get a message in the chat (but that will go away next version)
Do not use setPropertyInEntity() in conditionals, they will be executed regardless of the condition. The condition should be specified in the formula of the function.
Hey guys! I've started using CSB to make a system we use to play in my home game and I have a probably silly question?
Is there any way I can get the list of items a character has and iterate through them to show them with some custom layout? Like get an array of them, loop each one and make some custom html to display them in the character sheet instead of using the item container?
@formal goblet What game system is your example based on?
Homebrew, so it´s not based on a known system.
Should be doable. A Label can contain HTML and is able to execute Scripts (which can contain your parsing-logic).
I was trying to do something like this inside a Label, but I keep getting errors like the one on the second picture
New version of the Example-Template for 3.0.0: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/template/example_template/sheet-library/Example?ref_type=heads
Typo at the beginning of your line (first 2 chars)
Thank you for the type thing. I hadn't seen it. how would be best to do it?
Like this?: ${!%{return '<p>Hello World</p><br><p>Second</p>';}%}$
Btw, you can directly use entity (object) in your scripts, which contains all actor-data.
That new eaxmple template is AWESOME! I love the CSB tab as well. Thank you @formal goblet !
@formal goblet just a fyi that I got it to work like this. The problem seems to be the line breaks in the string. Removing them before rendering seems to solve it.
thanks for the help 🙂
is there any chance that this feature will also be made available for item containers? since i am doing a bit of animations using macros, this is probably the only reason why i am not moving most of my table contents to item containers.
I have no clue about that one. I'd suggest to open a Feature Request
hi, i dont know how to put more that 1 blank space in labels. I try with concatenate (' ','word'), but only make 1 blank.
can i have some help on something ?
i'm trying the configure an attribute bar, but i've probably missed something about the use of formulas
ok lol thx, that was just the :: who wasn't supposed to be here
Struggling with my syntax on proficiency bonus. I want it to change at certain levels:
${lvl ? <= 4 '2' : <=7 '3' : <=10 '4'}$
The conditional (ternary) operator is the only JavaScript operator that takes three operands:
a condition followed by a question mark (?), then an expression to execute if the condition is truthy followed by a colon (:), and finally the expression to execute if the condition is falsy.
This operator is frequently used as an alternative to an ...
Thank you!
is it possible to define the Row number of a table from a formula ?
Hello there friends! So I'm trying to set up a module called heartbeat, it basically plays a little effect as the player HP drops below a threshold. but it needs me to set the path to the HP value and im not sure how to do that.
I suggest to read through this: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System. The part under "CSB-Formulas" is still in progress, so check that out later. But it still should give you a basic understanding of the syntax used in CSB.
Try out system.props.health
doesnt seem to be working
I'm reaching out to the mod builder on his discord. I originally thought it would be props.health but didn't have any luck with that one. theres a chance it just doesnt work with this system which is NBD. just thought it'd be a fun system to drop on the players during a boss fight. haha.
If you have tokens set to display a health bar, check the key that’s using under token settings > resources and paste the result from that into the Heartbeat mod
I do. its "props.health". works great for my health bar but not so much for Heartbeat.
i think system.props.health is the correct because its the only option ive used so far that this icon pops up in the corner, but it never changes for the players or myself
I´d optimize it a bit.
- Go to the health-component and define a max-value
- Go to the token settings and select the attribute bar for health instead
ok so I think i follow you on the optimize thing. i added a formula to calculate the max health by adding the default value + any temp HP. this worked like a charm. the attribute bar thing im less familiar with but i think this is set up right ? it works from the token at least.
Remove those attribute bars. Let the system create those for you
haha i was just noticing that! thats so cool i had no idea it did that. love this system.
I got Proficiency Bonus to set based on Level using switchCase, but now I get an error stating it can't convert to a number.
"AcroProf" and "AcroExprt" are checkboxes.
If you use quotes, you basically tell the formula, that this is a text.
Gotcha. So quotes out. Do I need to bracket them, or just run it like:
${DexMod+(AcroProf ? ProfBonus : +0)+(AcroExprt ? ProfBonus : +0 )}$
This one should be fine. I'd only suggest to remove the signs before the 0s
Sweet, that worked. You're awesome
So one of my most requested updates to the character sheet is to make it so they can rearrage their spells. The spells are displayed in an item container. is there anyway to do this ? (short of removing the spells and re-adding them) or is there a different component type i should be using ?
This will be doable in the next patch
I think here is the proper place to ask, I'm not entirely sure. I'm new to Foundry and trying to install Custom System Builder as a game system... but it's saying it requires a dependancy it can't install, and I can't figure out how to get that one, it doesn't seem to work. Any help to know what I'm doing wrong?
You’re looking for “Chat Commander.” I know the messages is telling you to install “chatcommands,” but these names both belong to the same one module.
Oh... That helps. Thank you!
You bet
is there a way to increase the number of actor types? I'm building automation for a monster-catching ttrpg and it's kind of rough having all the player classes sharing the same template list with monster categories (classes are kind of complex for this system so they're each getting their own actor sheet template)
Hello there!
Is there any other icon source other than FontAwesome?
What type of icons you looking for? They're a little simplistic, but I use:
https://game-icons.net
That could do, thank you very much 😉
Btw, anything that could be directly embedded in labels, similarly to FA?
What file type would that be? Game-icons does png and svg
But you have to download them and then insert them in the label. FontAwesome gives you a directly embeddable code.
Ah. I don't know of another resource for that, then. Sorry, friend 🤷
No worries, mate. You gave me a good hint anyway 😉
Label Roll Message: how can i check wether a Text Field in an item has text in it?
item.textfield == true
item.textfield != 0
How?
Default would be empty
You need to use equalText()
Hey, do you folks use a custom Actor or an Item for your NPCs/Enemies? Just curious.
Can I grab keys, such as hp_Current in my game, with JavaScript and then pass it into a CSB formula for multiple targets?
I'm having trouble understanding how to use script within foundry formulas and I need further clarification than the examples and documentation provided.
My goals:
-Grab 4 enemy attributes associated with the 4 keys in each of the selected targets.
-run my CSB attack using the 4 keys I pulled from JavaScript and pass it into the CSB formula as one roll.
-output the results to chat.
-have this as a label button in the actor template for players to press after they have selected their targets.
I am using a custom Actor. Helps keep my NPCs organized. Also in the system that I currently run with CSB NPCs are almost no different than PCs.
I use a custom NPC/Monster template. In my system monsters have different values than PCs. And NPC don’t need most of the skills/features of an PC sheet. So trying to keep the workload of the hardware a bit lower.
Where do you go to create the custom actor type? I can’t find that anywhere
Just make a new actor template and call it "_NPC" or something similar
I only use 1 template, because PC and NPCs can do the same stuff. And more templates means more maintainance.
so I'm doing a monster catching game and there are a handful of different enemy varieties, but there are also like almost 20 classes and having all of those on a single template list is kind of rough to dig through. Was trying to see if there was a way to actually change the actor type so I could separate the two
i have a question, how do you call a value from created item in a drop down box in the character sheet template. for example, if I put something like a class as an item, then using a dropdown box to use as an option to choose?
This would be only doable by using Scripts in your Dropdown Formula, because there are no CSB-functions to retrieve item data outside of Item Containers
so I just tick the Dropdown as Formula with ${}$?
to call the values from the items?
I had a much smaller but similar problem with backgrounds.
I used items and a visibility formula when the item was equipped so my template is full of stuff but the players only see what the background gives because of the visibility formula. Not sure if that's exactly what you want but it's kind of a work around.
That’s definitely an option, yeah 🤔 it’d take a LOT of reworking at this point but I’ll keep that in mind. I appreciate the suggestion
Hello, how can I place the item image on the chat? I have this right now, the "item.img" thing is just a place holder. Is it possible?
<div class="chat-image">${!item.img}$</div>
<div class="chat-label">${!item.name}$</div>
<div class="chat-trait">${!item.traits}$</div>
<div class="chat-desc">${!item.description}$</div>
</div>```
this question usually isn't responded to from what I've seen for some reason, and when it eventually is, I've seen people say there's just no way to reference a sheet image in CSB
what you might be able to do instead is import an image into a rich text field and then send that rich text field to chat. that basically means you'd have to input every image twice and isn't super elegant, but it might work
Thanks! For now it will be like this...
It was even possible to improvise a show/hide description, it is good enough:)
that's so sick! is it just a label icon that all the descriptions are connected to with visibility formulas?
yep. I'll be updating the module now
done
I've created a video instruction also
I've made some video instructions on how to install the module in Foundry VTT. Doing this way, instead of using the adventure importing from the previous video prevents the issues with the unwanted warnings caused by IDs differences in the Custom System Builder item containers.
This is a fully functional project, so go for it, and have fun with...
Installing in the way described in git /showed in the video doesn't give the warning problem with the items, so its fully playable now
I just closed two issues, so I think thats better to warn everyone: the sheet is not broken. The css messes a lot with the template panels, it uses css grids and such... 😄
There is a "not" command for css that can be used to limit how your css effects the templates if you css has a negative effect on panels and makes them difficulty to interact with when the css is active.
Really?! how do I do that?
There´s also a life-hack for CSS 😅 https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/231#note_1284412353
Google css not, it not difficult but you reference a "higher class name" that is only present in the designer side within the "not". I am not at home so I can't see what I actually did.
Edit: The solution to hiding specific CSS effects in template view (for me) is:
.attributePanel .attribute:not(._template .attribute){css code}
In this case,attributePanel and attribute are panels. I only use this on CSS that really messes with the template view.
The old syntax got removed. Check the beginning of the README: https://gitlab.com/custom-system-builder/custom-system-builder#custom-system-builder
It works, but the template is still messy...
show and hide is indeed very useful. thanks for sharing!
Well, it was meant to remove the need to include a CSS-file. The template styling is something else
And to be fair, I normally use Angular with TailwindCSS, so CSS-conflicts do not even arise. So I´m also a bit lost with vanilla-CSS 😅
Hello!
I want to sum the values in the column "skill_value" from a Dynamic Table "table_skill".
I have tried it like this:
${sum(table_skill$skill_value)}$
But unfortunately this does not work.
Can someone here tell me where my error is?
Thanks a lot!
Boy, the syntax got changed 😅
I noticed that... 😉
Keep the sum and you´re good to go
It works... Thanx a lot! 🙂
what am i doing wrong here? Getting "Uncomputable token type"
?{type:'What type of spell is this?'|'Harm'|'Heal'}
${harm:=[:renown:d6]}$
${heal:=[:healing:d6]}$
<div class="chat-check">
<div class="vc">
${!item.name}$
</div>
<div></div>
<div>${equalText(type,'Harm') ? harm : heal}$<br><h4>${!type}$</h4></div>
</div>
Attempt to combine prompts with reusing results
https://gitlab.com/custom-system-builder/custom-system-builder#481-simple-prompts
https://gitlab.com/custom-system-builder/custom-system-builder#47-reuse-formula-results
reducing this to just the prompt and two rolls, the prompt doesn't seem to do anything?
sigh it needs to be inside ${ }$ even though the text tells you not to use it at several points
Hi...
what could be the reason that the existing templates (eg when I want to create a new character) are no longer selectable after the update?
Is there a solution for this?
Thanks a lot!
Ok, that´s unusual. Can you provide more details? Are there any errors in the console? Can you send the affected templates?
Sure... I'll take a closer look tonight and post the info here....
Hey question. I would like to hide a panel until a class is selected in my dropdown list. I know that i need to use a formula, but i have no idea how to do that...can someone help?
I think it is
not equalText(dropdownKey,"").
so I'd write down
${not equalText(dropdownKey,"key1")}$
?
i'm so sorry, i have zero coding abilities...
Without ${}$ and just leave the second argument empty so the panel won't appear if nothing is selected in the dropdown.
Do you have a default value for the dropdown?
Remove the condition or just select any class 😉
ok wait, i know class means something in coding. What i meant with class is like melee, range or magic... does that make it different?
also, with remove the condition, you meant 'not equalText' right? Does that include the '()' or not?
Also thank you for your time! You are a life saver!!
i wrote down '(dropdownKey,"key1")'
It doesnt work xD
I mean that if you want the panel to appear select a class in the dropdown or remove the whole not equalText(dropdownKey,"key1") line from the visibility condition field of the panel 😉
ok, but how do i make the panel only appear with one of the option of the dropdown list?
A specific one or just any of them?
In the first case put the corresponding key inside the () of the condition, in the second just leave it like that.
so like this?
not equalText(key1)
or like this?
(key1)
My bad, it is :
not equalText(dropdownKey,"key1")
if you only want the panel to appear for key1.
It works! and i also found out by removing the 'not' it will only appear with 'key1'!
Thank you so much!
Is it possible to make select the whole line on dynamic table ? without having to have a dropdown box for every value ?
Sure, just use fetchFromDynamicTable() for every column. For example: fetchFromDynamicTable('dynamicTable', 'fatigueColumn', 'nameColumn', dropdownKey).
so how to a fetch a number from a number field for a roll message?
Just ${keyOfNumberField}$
okay, so is this (1d6+${brainsmod}$) is how it would work?
so more of a completely different equation, but how do i make a formula where its rolls an x amount of d6s with x being fetched from a number field?
There´s literally an example about this case there in 3.2.2
i'm sorry, but i'm not sure to understand, were am i supposed to use this command line ?
You replace one of your dropdowns with a Label and use this Formula in the Label text
Have you read the README? https://gitlab.com/custom-system-builder/custom-system-builder
Here´s also a link to an example-template, if you want to see how things can work together: https://gitlab.com/custom-system-builder/custom-system-builder/-/tree/develop/sheet-library/Example
so i want to make an alternative roll formula for this example that adds additional dice based on the higher of another two number field values (if tied, just take the shared value).
Any ETA for 3.1.0?
ok, i now remember why i've stop my programming study. so what i'm trying is : (Red should be auto selected with the Blue selection)
is it what you told me ?
so if i follow what you told me should be : fetchFromDynamicTable('Magic', 'FatigueSpell', 'NomSort', SortLance)
from my table, putting this line into a Label
i've just forget the ${}$
-_-
i want to end myself
Its working !
@formal goblet i'm sorry for the ping, but i want to say that i love you
Hi Martin,
the topic seems to be closed...
Is it possible to define a numbers of Row from a table with a Formula ?
I cannot comprehend this sentence 😅 Do you mean to count the rows of a table in a formula?
Yo guys, I´ve written a Guide about the Formula-System of CSB. If you feel that something is missing, then say so: https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System
Hum, im making a Dynamic table to simulate bagpack slots, i Wonder if i Can generate the number of lines of this table with a formula
So you want the current row number in each row of the Dynamic Table?
No, i want the table to create automaticly New Line when the formula Said so
Uhm, nope
Arf, am gonna stay with the GM right only to create New Line then
is there a way to make an addition to a number directly or i need to use the Replace() function ? Exemple : "use spell" Current_Mana -15
Replace Mana by Mana-15
Does anyone have an example of using JS to add an entry to a dynamic Table? I can overwrite the existing single entry in my test table with this
where actor = entity.entity but I cannot figure out how to add a new entry.
Also, how do I use JS to delete a row as I need to run a macro or JS in conjunction with the row being deleted.
There is a CSB setting:
“Delay entry saving. On big sheets, you may want to delay entity saving if sheet reloading takes too much time. This will wait until fields are deselected before saving everything at once.”
But for me it seams the system is reacting exactly this way, even when I don’t have checked the box.
So, is there any different or is this outdated?
is there a script for health bars? or do I need to import a custom CSS?
hi, i am triying combine props fron item and actor. Is that posible?
From actor i have range by strengh, and item have range value.
In item container i try sum both props ${item.range+strengh_range}$ to show the final range. Dont work. I try too, using reference, but dont know how to make. setPropertyInEntity('self', 'strengh_range') dont work.
What you´ve done in the beginning seems right. Check if there are any typos (e.g. "strength"). Otherwise, check the console (F12) for errors
If you mean a Health Bar Component for the Sheet, then there´s no implementation for that. If you mean Attribute Bars for the Token, then you can just define a number field with a max value and the system will create one for you, which can be selected in the token-settings
If it displays an ERROR, there must be an error in the console
found it. arma_cal_alcance its a concatenate with value and string, For example: 30 m
hey question, how do get my label to fetch the text in a hidden textfield?
what's the formula to fetch text from a textfield is basically my question...I don't understand the explanation on gitlabs and after trying several times, it just won't work...
Should be
${textfieldKey}$. Isn't it?
does that not work in the text field of the label? or do i need to use rich text field?
text below is what it should be
In the text field of the label, I think.
aah wait, in the template it only shows the key, but when updating the other character sheets, it does show it...
ok, it works! Thank you again @fierce harbor
My pleasure 😉
does that also work for dropdown lists??
Yes it does.
oh that made my life a lot easier suddenly!!
ok, i'm back already...
The dropdown list text is not being shown.
Instead it either shows the label key and not the text or it gives an error...
It is meant to show the key, I believe. That's why I use the same text for keys and labels.
And the form with "value" as additional argument is not gonna work.
Uh, why "value"?
i tried some stuff out i saw on the wiki.
I'm pretty sure you're missing some stuff. You have 2 values without any operations (functions), that cannot work.
I'm sorry, but I have no idea what that means...
@glossy hare You there mate? I've got some time to work on that sheet 😉
I'm going to try something else, I'll come back when I need more help! Thank you for your time!
Ayo
i kinda still need help on this one, if anyone have any idea
I think we've finished on weapon template last time
its "work" but the Current Mana Value didn't change
Edit : i've find the issue, it work better with the setPropertyInEntity() formula
okay
let's see if i remember it
🤔
ah yes
you have to finish the rolls buttons now right?
${skillModifier := switchCase('item.WeaponSkill','1','OneHandedSkill','2','HeavyWeaponsSkill','3','SpearsSkill')}$
${string([2d6]+skillModifier+PCAttrDEX)}$
I can't roll it, it's not clickable
can you send a print please?
This underlined one "is" that button, but it's not clickable
ah yes
create an item
not a template
an item
an use the weapon template that you made
Okay, I created an item (Called "Miecz")
throw it in your sheet now
Should I just drag it to the item container?
yes
Okay, clicking it doesn't send anything to chat
open the console (press f12)
then click again, and print what the console scream at you
why did you make this a string?
${string([2d6]+skillModifier+PCAttrDEX)}$
Without it it seems it died even more judging by the number of errors it threw at me
show the full console please
nono
i'm referring to OneHandedSKill, HeavyWeaponSKill...
where do you store them in your sheet
it is a dynamic table?
a number field
Dropdown list
it is in your item template isn't?
do you have a place in your player sheet to store theese skils?
Yup
Should they have different keys than those in dropdown list?
no
i will open my docs
one minute
okay
It works!
good
now there anything else you need to do?
also, you probably will have to pass every weapon as items
So we have melee weapons basics of basics done. Now I would need to make it deal damage to target, add those attributes that are chosen by checkboxes, and make ranged weapons.