#Custom System Builder

1 messages Β· Page 36 of 1

knotty bluff
#

Are people just using it on v11? Do you need to reinstall for v12?

velvet heron
#

Is there a way to remove a selection from a radio button after it has been selected?

I made one part of a template that sets a radio button as being Checked by default and created items with that template, then I changed my mind so I went back and unchecked the default checkbox and clicked on Reload all item sheets but the items still show the selection.

formal goblet
velvet heron
#

After messing with the checkbox thing for hours and coming very very close, I decided to just scrap the whole idea. It would've been nice, but it just wasn't working for me.

What's the reason you can't have checkboxes as a viable option for item containers, anyway? Why restrict only to labels and meters?

formal goblet
velvet heron
finite rapids
#

Hey guys, this might seem very basic, but... can I copy/paste an element? Either that or move an existign element into a panel. Said element is a dropdown with a LOT of choices that I would prefer to not have to type up again lol

velvet heron
finite rapids
#

hmm I think it might be different on a Mac keyboard

velvet heron
#

CMD, then.

umbral jackal
#

I don't know what's going on with my character sheet template, but I'm not able to reorder items within a tabbed panel.

umbral jackal
#

Also, can a meter's max value be accessed directly?

spiral dome
#

I was typing a really long reaction with every option i tried and the errors I got. Then I used the formula ${fetchFromActor('attached', "lookup('allskillstable', 'allSkillsTableSkillRanks', 'allSkillsSkillname', '${itemsWeaponsSkill}$')",'0')}$ and it worked. Thanks for the pointer on the quotes around the inner formula! <3, that was where the issue was at.

cobalt mango
#

How do I access the initiative formula as a string, please?

formal goblet
cobalt mango
#

Yes, I'm trying to pass it to a world script so that it rolls initiatives for each actor in combat. But I can't seem to find it on the actor(?)

formal goblet
cobalt mango
#

Hooks.on("combatRound", async (combat, round) => {await main();});

async function main() {
game.combats.active.combatants.forEach(async (combatant) => {
const newInitiative = await new Roll**(combatant.actor.getInitiativeRoll().**formula.replace().slice(4))
await newInitiative.toMessage({
speaker: ChatMessage.implementation.getSpeaker({ actor: combatant.actor })
})
await combatant.update({ "initiative": newInitiative.total });
});

}

#

I put in bold what I wish to get a value for

formal goblet
cobalt mango
#

ty 😁

formal goblet
fervent pasture
#

using google translate
How do I make a label become a roll?
Images of my attempt

sand nova
#

Hi everyone, I'm using Google Translate to communicate, could you help me?

I want to use macros to create "Skills" in my campaign using the "System Custom Builder" system. However, I am unable to extract a certain value from a character's sheet as an attribute.

Example: "for" attribute of a certain character to enter the damage formula

next obsidian
#

Thanks, your solution is CLEARLY better than mine. Thank you for taking the time to help me πŸ™πŸ™πŸ™πŸ™.

lament flint
#

Whenever anyone opens one of my players sheets. it spits out a ton of this one error. How can I go about fixing it?

formal goblet
formal goblet
formal goblet
finite rapids
velvet heron
cobalt mango
#

Hello πŸ˜„
Thanks to the help I got here I was trying to make my tokens roll initiative:

game.combats.active.combatants.forEach(async (combatant) => {
const newInitiative = await new Roll("2d20")
await newInitiative.toMessage({
speaker: ChatMessage.implementation.getSpeaker({ actor: combatant.actor })
})
await combatant.update({ "initiative": newInitiative.total });
});

looking at the part in bold: putting a string there works.
I also managed to make it work by calling a token "2d20" and using

Roll(combatant.name)

I'm now trying to access values using

Roll(combatant.actor.name)
Which works if the actor name is a valid roll formula.

So my next stell was making a variable in the template called "InitiativeFormula", giving it a valid roll string as value.
But that gives me an error:

formal goblet
cobalt mango
#

So I guess the short question would be: How can I access an attribute?

cobalt mango
formal goblet
#

Properties are stored under actor.system.props

formal goblet
cobalt mango
#

Makes sense as it's within the system

#

Ah that error is unrelated to the question (I didn't know that a few seconds ago)
using actor.system.props worked πŸ˜„

#

ty vm πŸ˜„

somber jay
#

i wanted to try a new foundry world from v11 to v12 (has nothing on it, same for CSB elements)
got the migrate options, migrate finished, but when i try use a new template to add a new element with the + i'm getting this error:

[Detected 1 package: system:custom-system-builder-beta(4.0.0-rc1)]
    at Function.entries (<anonymous>)
    at getLocalizedPermissionList (utils.js:235:38)
    at Object.component (template-functions.js:118:25)
    at Panel.openComponentEditor (Container.js:116:27)
    at HTMLAnchorElement.<anonymous> (Container.js:97:18)
    at HTMLAnchorElement.dispatch (jquery.min.js:2:40035)
    at v.handle (jquery.min.js:2:38006)```

not sure how to fix - any help would be awesome~
umbral jackal
#

I've probably already asked this before, but how would I sum up the values of a column in an Item Container? (For example, an Item Container contains a list of Force Fields, each with an Armor Rating, and I want to have a field that totals up the Armor Rating of all the Force Fields.)

somber jay
# somber jay i wanted to try a new foundry world from v11 to v12 (has nothing on it, same for...

nevermind - i was able to sort it. the export const getLocalizedPermissionList = (keyType) had the error. swapped to below and it works great so far now.

    if (!CONST || !CONST.DOCUMENT_PERMISSION_LEVELS) {
        console.error("CONST.DOCUMENT_PERMISSION_LEVELS is undefined or null.");
        return {};  // Return an empty object to avoid the error
    }
    
    return Object.fromEntries(Object.entries(CONST.DOCUMENT_PERMISSION_LEVELS).map(([key, value]) => [
        keyType == 'number' ? value : key,
        game.i18n.localize(`OWNERSHIP.${key}`)
    ]));
}; ```
umbral jackal
#

...Oh. Thank you!

lethal flax
#

So how do i get this to work, cause it ain't rolling dice

swift quest
#

One issue I keep having is that when I have a hidden attribute that's basically the sum of some other attributes, and I use that in the char sheet, the values are always one change behind.
For example:
dr_physical (hidden attribute) = ${dr_physical_origin + dr_physical_armor + dr_physical_temp}$ (each of which is a number field)
dr_blunt (label) = ${dr_physical + ....}$
dr_blunt is always one value "behind" dr_physical, so when I set it from 0 to 1 it's still 0. If I then set it to 2 it becomes 1.

lethal flax
cobalt mango
formal goblet
lethal flax
formal goblet
lethal flax
formal goblet
lethal flax
#

and here's how i set up the aformention things

formal goblet
lethal flax
#

not sure what you mean

formal goblet
#

The key end

#

Uncomputable token "end". That's what the console says.

lethal flax
#

no

formal goblet
#

Ah, you forgot to use [] in your last line

lethal flax
#

cuz i tried it and it still didn't work

#

okay i got rolls when i use ${[:Dice_Formula:]+:Stat_Formula:}$ but can't actually see the result

#

@formal goblet so the idea is that the stat variable is supposed to referance an actual character stat elsewhere.

formal goblet
lethal flax
formal goblet
lethal flax
formal goblet
#

Remove # to check the intermediate values

lethal flax
# formal goblet Remove `#` to check the intermediate values

Formula.js:665 Uncaught (in promise) Error: undefined. Uncomputable token "Stat_Formula" [Detected 1 package: system:custom-system-builder-beta(4.0.0-rc1)] at mathInstance.SymbolNode.onUndefinedSymbol (Formula.js:665:27) at math.js:26377:89 at Object.evaluate (math.js:24162:45) at r.evaluate (math.js:24139:55) at Formula.computeStatic (Formula.js:669:27) at Formula.compute (Formula.js:363:21) at processFormulas (ComputablePhrase.js:106:35) at async ComputablePhrase.compute (ComputablePhrase.js:160:34) at async computeRollPhrase (Formula.js:727:13) at async Formula.evaluateRoll (Formula.js:738:29) at async Formula.compute (Formula.js:349:30) at async processFormulas (ComputablePhrase.js:106:21) at async ComputablePhrase.compute (ComputablePhrase.js:160:34) at async Label.js:596:13

#

and still no roll

#

Okay just has to use ${Stat_formula:= ref(sameRow('Stat'))}$ and able to see the bravery score, but the roll is still not being made

formal goblet
lethal flax
#

the die and the stat are showing in chat, but its not adding them up properly or rolling for that matter.

formal goblet
lethal flax
#

also rolled snake eyes and 2 6s in a row

abstract siren
#

Is there any way to add a tooltip to the item reference column of an item container?
As in hovering on the name of the item reveals the description.

formal goblet
cobalt mango
#

At the moment I am showing a dialog to each actor which has a choice (say Choice1, Choice 2, Choice 3)
Depending on what is picked I pass it to a custom formula that I import in the world script and run that...
However it's very janky and I was wondering if there's a better way to go about it.

formal goblet
cobalt mango
#

Sorry. I'll try again and if that fails hop on my PC.
Every player is shown a dialog with three choices. Their choice is combined with their character name to find out what script I will run.
The choices are just 1, 2, 3 for the macro responsible. The player are asked which action they want to perform from a list that I store in the actor itself

#

What I actually wished to do was to have items with a "show in dialog choice?" flag and a macro that runs if that option is chosen. But I can't do something so complex yet

formal goblet
#

Do you collect the choices of the multiple Actors or do the Macros execute independently from each other?

formal goblet
cobalt mango
#

Each player choice -> macro runs on its own.
Turning on the PC. I should have done that to begin with lol

cobalt mango
#

math.import(
{
FindFormula: (N, Name) => {
var pick = N;
switch (N)
case 1:
return(game.actors.getName(Name).props.items.getName('Ability1').system.props.MacroText)
break;
case 2:
return(game.actors.getName(Name).props.items.getName('Ability2').system.props.MacroText)
break;
case 3:
return(game.actors.getName(Name).props.items.getName('Ability3').system.props.MacroText)
break;

    }
}

)

#

@formal goblet

#

I wished to make it dynamic \ scalable by adding ability items and flagging them to be shown in the dialog instead of having manually added 1, 2 and 3

#

atm the dialog just lets you pick N and calls FindFormula with N and the actor name

formal goblet
cobalt mango
#

Just because I 'm not able to construct a dialog well enough🀣

formal goblet
#

How does your Dialog look like?

#

Btw, macro-polo is the better channel for such questions, because you're operating directly with the Foundry infrastructure instead of with the structure of CSB

cobalt mango
#

Ok, I'll close with something on the matter that's CSB-specific.
Can't I show item containers with their label in a dialog? And have it close after they pick one

formal goblet
#

Nah, Item Containers cannot be part of a Dialog (issue with Items in Items)

cobalt mango
#

Alright πŸ˜›

#

Thanks !

glossy hare
#

Good afternoon. I'm currently having a problem. I made some macros to emulate pathfinder rolling dice feature.

#

I wrote this for the label roll message:

${%{
const docId = 'BkXvGLu6wGvyxvJc';
const compendiumKey = 'csb-remasters.scripts';

return await (await game.packs
    .get(compendiumKey)
    .getDocument(docId))
    .execute({entity:entity.entity,linkedEntity: linkedEntity});

}%}$
#

Is there a way to avoid the behaviour in the video? Where when i click the button, CSB sends a message to the chat?

#

The reason i did this it was to reduce the code in the label roll message. It was a hell to navigate the labels

formal goblet
glossy hare
formal goblet
#

And you can omit ${}$ πŸ˜…

glossy hare
#

tyty

#

@formal goblet sorry to bother you again, but, i'm having a problem in passing entity.system.props to the next macro.

My attack macro use this scructure

main();

async function main() {
//i use this variables to manage the code better
  const actorStats = entity.system.props;
  const weaponStats = linkedEntity.system.props;

//some code, before i create the dialog.

 new Dialog({
  title: "Rolando ataque",
  content: attackInput,
  buttons: {
    attack: {
      label: `Rolar (${rollFinalModifier >= 0 ? '+' : ''}${rollFinalModifier})`,
       callback: async (html) => {
        // before the hook there is a code to create the buttons, it work
        Hooks.once('renderChatMessage',(chatItem,html)=>{
          html.find("#createDamage").click( async ()=>{
          const docId = 'BkXvGLu6wGvyxvJc';
          const compendiumKey = 'csb-remasters.scripts';
          const document = await game.packs.get(compendiumKey).getDocument(docId);
          await document.execute({ actorStats: actorStats, weaponStats: weaponStats })
}}}})

The macro I use, is the one to roll damage

#
//macro to roll damage
main();

async function main() {
    const actorStats = entity.system.props;
    const weaponStats = linkedEntity.system.props;
    const additionalDamage = weaponStats.additionalDamage != 0 && weaponStats.additionalDamage != null ? ` + ${weaponStats.additionalDamage}[${weaponStats.baseDamageType}]` : '';
    const damageRollString = `(${weaponStats.baseDamageDieQuantity}d${weaponStats.baseDamageDieSize} + ${actorStats[weaponStats.baseDamageAttribute]})[${weaponStats.baseDamageType}]${additionalDamage}`;

    let roll = await new Roll(damageRollString).roll();
//rest of code
#

The roll damage macro works when i use it from the sheet, but not when calling another macro

#

i tried removing the variables actorStats amd weaponStats, but the console return this: ReferenceError: entity is not defined

formal goblet
glossy hare
#

🀑

#

Me when i found the problem was that i was recaling strike macro instead of roll damage macro, that was the reason entity was not defined

#

now it works

brittle moth
formal goblet
#

Don't worry. I spent 1 hour trying to figure out why my

use SomeLib 'function1';

didn't work. Well, guess what...

package someLib;
use Exporter 'import';
our @EXPORT_OK = 'function1, function2';

I fucking used a scalar instead of an array...

formal goblet
brittle moth
# somber jay yeaaah it was the 4.0.0-rc1

Indeed... Well, that's weird, both the tag on gitlab and the package downloaded on one of my instances refer to the right property for v12, which is CONST.DOCUMENT_OWNERSHIP_LEVELS...

The full function should be

export const getLocalizedPermissionList = (keyType) => {
    return Object.fromEntries(Object.entries(CONST.DOCUMENT_OWNERSHIP_LEVELS).map(([key, value]) => [
        keyType == 'number' ? value : key,
        game.i18n.localize(`OWNERSHIP.${key}`)
    ]));
};
somber jay
#

cool, just swapped it -- have no problems

#

thanks!

brittle moth
#

If you made no other changes, you can try to uninstall the system and reinstall it, it should fetch the latest package πŸ™‚

somber jay
#

nah that was the only one since i wanted to start off fresh~ not sure if it's a beta issue or a foundry one, but the only other problem i've come across so far is being unable to drop token actors onto a scene

spiral dome
#

I have a number of item templates that use a dropdown to a dynamic table in the parent with all the skills. This means that when the item is not (yet) attached to a character, I cannot select a skill, which is a bit annoying. Is there an (easy) way to add all those skills (about 55) quickly (maybe through a formula or something), or will I have to add them all manually?

formal goblet
spiral dome
spiral dome
somber jay
formal goblet
#

That is an interesting error...

somber jay
#

ah, i reinstalled foundry -- had the same error but i've got this one too

    at Object.fn (custom-system-builder.js:340:23)```
formal goblet
#

Cause line 340 in the source code is literally just a comment πŸ˜…

brittle moth
formal goblet
#

Actually... Is it maybe the browser cache again? Try out CTRL + F5

somber jay
formal goblet
somber jay
formal goblet
somber jay
#

i chalk it up to being super unlucky πŸ˜‚
let me try on my laptop and see if i catch the same issue

ornate haven
#

Hello! I have a player that has set drop downs, that set the training in a skill. However, when I load their sheet, it does not show their entries on my end. This is after a reload of the page, and restarting the game world.

main magnet
#

Hey guys,

does anyone know of a macro to update all the keys for specific items to a certain value?

For instance I want all the items that have the item_desc value to change to let's say 1 (or whatever I put in).

It would also need to affect the items not attached to characters as well (or the compendium).

Any ideas?

(I'm using CSB with Foundry v11)

abstract siren
#

Hello, is it possible to populate a dropdown list in a UserInputTemplate with data from tables/ItemContainers of the actor?

abstract siren
half beacon
#

Is it possible to add an option to a dropdown list that looks for items in an item container? I want to add "None" to the list.

formal goblet
lost wigeon
#

Good morning all!

First, I wanted to say that this is awesome. I really wanted to bring my WoD vG system into Foundry, and now I can! I threw you guys a 20 this morning just to say thank you for doing all this.

OK, onto my quesiton.

I wish to write a macro for Custom System Builder that allows players to click a button on their sheet to spend XP. I intend on embedding this code into a Label.

The macro should:

  • Increase "willpower" by 1
  • Decrease "experience" by (willpower + 1) x 3

For reference, in Roll20, it would look like this:

!modattr --name|@{character_name} --willpower|1 --experience|[[[[@{willpower}+1]]x[[-3]]]]

Thank you so much for any help that can be given πŸ™‚

lost wigeon
potent fossil
#

I have question, might be stupid

If I have FetchFromdynamictable()
Functions on my sheets can this result in performance issues ?

#

I'm planning on changing them to lookup() anyway, just curious

formal goblet
#

lookup() is just an alias, no functional changes

potent fossil
#

Oh okay, thanks

brittle moth
#

I'll add that you'll need to change it to lookup() when upgrading to v12 πŸ™‚

vocal sorrel
#

Hello, I know I can toggle the Checkboxes with SetPropertyInEntity like so ${SetPropertyInEntity('self', 'CheckboxExample', CheckboxExample + 1)}$ but I had no luck with setting a specific Radio Button to become active. How would I do something like that?

formal goblet
#

And to set the value of a Radio Button, you simply have to do setPropertyInEntity('self', 'radioButtonGroupKey', 'radioButtonValue')

vocal sorrel
#

Oh so it does work like that after all, I may have just made a typo somewhere then, thanks!

lost wigeon
#

OK, I took a 4 hour course on Javascript, read all the documentation, and read all the Foundry documentation, and none of that told me how to update an attribute on the actor πŸ™‚ Can anyone give me an example of the code used to do this?

#

(Nor did any of the macro examples contain such an example.)

half beacon
lost wigeon
#

OK, so, I've made some headway, but the macro I'm trying to use within a label is throwing an error, and I don't know why:

const { willpower, experience } = entity.system.props;
entity.update({"system.props.experience":  parseInt(experience)  - ( (  parseInt(willpower)  + 1 ) * 3 ) });
entity.update({"system.props.willpower":   parseInt(willpower)  + 1  });
}%```

It works great as a separate macro but won't execute from inside a label.  Any thoughts?
#

OK! I got it to work by calling it from outside...so...Yay! ❀️

formal goblet
upper olive
brittle moth
#

#package-releases message
Hi everyone πŸ™‚

**Version 4.0.0 is now generally available, with the following changes : **

Warning ! As usual, please make a backup of your world before updating Foundry to v12 and CSB to v4.0.0. With the major Foundry version came some changes in Foundry VTT's API, so be aware that your scripts (as in %{}% formulas) may break, with no fault to CSB.

Technical Features

  • Refactored CSB-specific functions in Formula.js to FormulaFunctionImporter.ts

Features

  • BREAKING - V12 compatibility - System is no longer compatible with v11
  • BREAKING - V12 compatibility - Grid settings have been removed in favor of core Foundry's settings
  • BREAKING - Removed deprecated fetchFromDynamicTable and getRefFromDynamicTable functions
  • Added TemplateSystem#throwUncomputableError() to force recomputation when encountering undefined properties in the current computation cycle

If you encounter any issue with this new version, please post an issue on Gitlab : https://gitlab.com/custom-system-builder/custom-system-builder/-/issues/new

lethal flax
#

@formal goblet ${applytrait ? (traitbonus):0}$ So is this formula correct, wanna double check. the idea is that i check a checkbox that adds applys a number field value.

woeful skiff
#

In a formulae how do you add another value to the array returned with lookup() in a dropdown?

woeful skiff
gray sage
#

Hey All,
How can I change a game system?
I had the beat verison for 4.0 and now I want to add the v12 one.

brittle moth
gray bluff
#

Hello everyone, just updated to v4 and I don't seem to be able to make "Dice so nice" work with CSB.
The 3D dices are showing perfectly when I roll directly from the chat (with /r 1d10 for exemple) but whenever I'm trying to roll from a CSB sheet the 3D dices won't show up. The roll is still resolved in the chat though.
I tried creating a clean world with just CSB and "Dice so Nice" but to no avail.
I would like to know if I'm missing something or if someone got an easy fix before submitting an issue on gitlab.

brittle moth
last mirage
#

is there a quick way to make a lable into a "long rest?" essentially healing hp and mp to full? I assume maybe through a label roll message?

grave ether
#

Is there anything to add in for version control? I would like to stamp something on there the last template edited or something like that.

return (`Last edited: ${lastModified}`);}%``` 

This provides a date and time but updates everytime the sheet refreshes
grave ether
lost wigeon
lost wigeon
#

For some reason, by the way, it says literally "Error" in the chat, but it works all the same...

last mirage
#

the component keys for hp and mp are "hpcurrent" and "mpcurrent"

cobalt mango
#

Your problem kinda makes me wonder if we're able to access proprieties in an array, for each -> and change them accordingly

formal goblet
lethal flax
formal goblet
#

it should, yeah

lost wigeon
#

Is there anything in my code that's causing these error messages in the chat. It works perfectly. So, it's not a big deal. But, it would be preferable to not see them.

%{

const { willpower, experience, rank } = entity.entity.system.props;

if ( ( parseInt(willpower) + 1 ) <= (rank*2) ) {

await entity.entity.update({"system.props.experience":  parseInt(experience)  - ( (  parseInt(willpower)  + 1 ) * 3 ) });
await entity.entity.update({"system.props.willpower":   parseInt(willpower)  + 1  });

} else {}

}%
formal goblet
lost wigeon
#

Thanks! πŸ™‚

formal goblet
#

If you don't need the Chat Message, you can tick of the creation of the Chat Message in the Label Component config

lost wigeon
#

Ahh, ok, thanks:)

lost wigeon
#

BTW...due to this, I no longer have need of Roll20 at all, because I can create everything I need with this. So, I'm reallocating the value of my Roll20 subscription to you guys. Very well earned!

#

They had a large team building for 15 years, and this is better, and it's not even a little close.

grave ether
# last mirage the component keys for hp and mp are "hpcurrent" and "mpcurrent"

Make a lable, in that lable paste this. You will need to play with it since I am not able to get it to sync unless I update the sheet so there is a trigger point I am missing.


onclick="${setPropertyInEntity('self', 'hpTotal', 'hpMax')}$;"

>Long Rest</button>```

HpTotal is your hpcurrent
HpMax can be replaced with a value but I have it set to use the Max HP
formal goblet
lost wigeon
#

Self hosting is sooo good! πŸ™‚

formal goblet
formal goblet
grave ether
lost wigeon
#

Everyone can kind of work together, one way or the other, to make the whole system better.

grave ether
#

I get this anytime I create a new pc

[Detected 1 package: system:custom-system-builder-beta(4.0.0-rc1)]
    at Hooks.onError (foundry.js:654:24)
    at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54)
    at CustomActor._safePrepareData (foundry.js:10801:15)
    at CustomActor._initialize (foundry.js:10630:19)
    at new DataModel (foundry-esm.js:10182:12)
    at new Document (foundry-esm.js:10955:3)
    at new BaseActor (foundry-esm.js:13233:7)
    at new ClientDocumentMixin (foundry.js:10594:7)
    at new Actor (foundry.js:15521:1)
    at new CustomActor (actor.js:13:8)
    at #preCreateDocumentArray (foundry-esm.js:56385:17)
    at ClientDatabaseBackend._createDocuments (foundry-esm.js:56347:58)
    at ClientDatabaseBackend.create (foundry-esm.js:12281:19)
    at async CustomActor.createDocuments (foundry-esm.js:11423:23)
    at async CustomActor.create (foundry-esm.js:11567:23)```
formal goblet
formal goblet
grave ether
grave ether
#

Once I close the actor I can never open it again

#

throws ``` foundry.js:655 Error: An error occurred while rendering CharacterSheet 26. Cannot create property '0' on number '0'
[Detected 1 package: system:custom-system-builder-beta(4.0.0-rc1)]
at Hooks.onError (foundry.js:654:24)
at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54)
at foundry.js:5795:13

formal goblet
# grave ether original code came from someone else ```` <button id="colorButton" style="padd...

This is something completely different. The Script within the click-handler refers to the same HTMLElement the click-handlers resides in. That's why you can simply access the style of the Element with this.

If you want to access the properties of the entity, which sent this Chat Message, you'll need a completely different approach. In this case, you don't have direct access to the entity context, so you have to store unique information (like the document UUID) to fetch it later and work upon that.

grave ether
#

Now if I could gain access to creating new characters that would be grand.. atm, I cant do much

formal goblet
#

Basically every click you do

grave ether
#

Yep

#

Create actor = error

#

Thats it

#

I get a blank page originally,

#

actually hold on

#

I will screen grab it

grave ether
#

@formal goblet Alright to explain in more detail,

  1. Actor is created - Produces error on the right
  2. Actor gets closed and opened without issue
  3. Open Actor and select PC Sheet (any sheet that has formulas) - Produces error
  4. Close Actor and is never able to reopen again

Restart

  1. Create a new actor - Produces error
  2. Select blank template, Loads fine
  3. Select the PC template - Loads fine

Upon initial load of the PC file it will produce a multitude of errors but thats because the formulas are not seeing values until others calculate. This is normal behavior in this case

The sheet currently doesn't have any consistent errors upon already loaded PCs

formal goblet
grave ether
#

Safe mode produces the same error

formal goblet
grave ether
#

Attempted that as well, no luck

formal goblet
grave ether
#

Foundry

#

not using any browser atm

last mirage
formal goblet
formal goblet
grave ether
sturdy mesa
#

Maybe I can't drag above tables or right below tabbed panels

last mirage
#

Essentially using the panel as a container or seperator.

last mirage
sturdy mesa
#

ctrl + c
ctrl + v

last mirage
sturdy mesa
#

you don't need modules to do this

last mirage
#

thx!

sturdy mesa
#

you need to press f12 and inspect elements and then edit these elements in custom css module

last mirage
#

awesome. Thanks, I'll give it a try later

last mirage
main magnet
main magnet
formal goblet
main magnet
# formal goblet https://www.w3schools.com/js/js_string_methods.asp#mark_slice

Any idea why this doesn't work?

const itemTemplateName.substr(-5) = ' (Q1)'; const itemTemplateId = game.items.getName('weapon template11 - alt').id; entity.items .filter(item => item.system.template === itemTemplateId) .forEach(item => { const newValue = "no bonus or penalty"; item.update({'system.props.damage_info': newValue}); });

elder raft
#

Is there a way to tally a column of checkboxes for use in a number calculation? Either from a table or dynamic table?

I'm trying to add a "level up" section to a sheet, where players can have a list of their levels with which options they chose to upgrade at that level (hp, power, etc) and I'd love for them to be checkboxes that auto-calculate their max HP or PP in another part of the sheet.
Is that do-able with checkboxes? Or radio buttons?

#

I guess I could do a dropdown choice too, since they only choose one. But I'm also not sure how to reference those as math in a formula elsewhere on the sheet

last mirage
#

That makes it so every level and point of resolve they have adds 1 to their hp total

elder raft
#

Oooh this might be me running into syntax problems again, I can never remember which and how many variables get what.

last mirage
#

if you're trying to make them checkboxes, you can use this example:

Path Points ${Levelnumber - sum(cbc1 ? 1:0, cbc2 ? 1:0, cbc3 ? 1:0, cbc4 ? 1:0, cbc5 ? 1:0, cbc6 ? 1:0, cbc7 ? 1:0, cbc8 ? 1:0, cbc9 ? 1:0, cbc10 ? 1:0, cbc11 ? 1:0, cbc12 ? 1:0, cbc13 ? 1:0, cbc14 ? 1:0, cbc15 ? 1:0)}$

essentially i made a lable that shows points they have available to spend. Every time they check a box it minuses a point. It's a bit tedious for a lot of boxes, but it works well

elder raft
#

That may be the best option

#

I assume under that you have each checkbox with its own key in a table (cbc#), rather than something like a synamic table?

last mirage
#

just change the "-" to a "+" and make sure the component keys all match your boxes

#

yeah, I'm using their direct component keys. It may not be the best way, but it works.

elder raft
#

Yeah, That's a good idea, I can tally them in their own label then use that key in math elsewhere

late ferry
#

Hello, i finished my game and now invited the first friend. i Created some macro and send him the code so that he can use it. he can create the macro and it works but he cant upload a picture. when i click on the white dice a windows open to upload an imagine. not not when he does

#

do i have to upload somehow the picture for him? If yes, how?

last mirage
#

thats what I do. I have a lot of links to other things. Every time they level it adds points to multiple tables, and it does take a second or two to update when things are clicked, but it works well enough

elder raft
#

Yeah, I was hoping to avoid the "create 30 checkboxes" in favor of something that could grow with a dynamic table, but not only is it functional, it's also the most straightforward

last mirage
#

Hope it works for ya. If you find a neater way to do it lmk. πŸ™‚

elder raft
#

Will do!

#

Thanks for the input!

last mirage
#

I'm still learning myself, and am not the best with syntax and such as well lol

#

sure thing!

last mirage
#

this is currently working for a "long rest":

`<button id="Long Rest" style="padding: 10px; font-size: 14px; background-color: green; color: white; border-radius: 10px; border: none; cursor: pointer;"

onclick="${setPropertyInEntity('self', 'hpcurrent', 'hpmax'); setPropertyInEntity('self', 'mpcurrent', 'mpmax');}$

Long Rest</button>`

but I'd like to make a "short rest" where it will roll 1d10 for every "Levelnumber" and heal their "hpcurrent" and "mpcurrent" for the value rolled.

Anyone have an idea how to do so?

elder raft
#

@last mirage
I think I got something a bit more elegant for our checkbox.
Again, I'm just trying to tally the amount of checkboxes ticked in a certain column. I prefer the dynamic table so levels can just be added as they go, tick their choice checkboxes, and it'll auto add to their HP and stuff (kinda a weird game system ,lol)

but ${10 + sum(lookup('player_leveltable', 'player_leveltable_hp'))}$
Works to make their HP 10 plus the amount of checkboxes in the hp column of the leveltable.

last mirage
#

Nice! I'll see if I can put this to use too.

last mirage
elder raft
#

If you figure that out let me know! lol I was just asking myself the same thing 🀣

last mirage
#

hahaha ok

late ferry
elder raft
#

Now I'm trying to figure out how to make Dynamic Table rows automatically count-up when you add a new one. So that each time they add a row it will label that row with the level 1, 2, 3, etc.
πŸ€”

last mirage
#

ooh. thats far beyond my knowledge haha. I'm experimenting with resetting checks still xD

formal goblet
main magnet
# formal goblet - `itemTemplateName` should be `'weapon template11 - alt'` - revert the change i...

Like this?

const itemTemplateName = 'weapon template11 - alt'; const itemTemplateId = game.items.getName(itemTemplateName).id; entity.items .filter(item => item.system.template === itemTemplateId && item.name.slice(-5) === ' (Q1)') .forEach(item => { const newValue = "no bonus or penalty"; item.update({'system.props.damage_info': newValue}); });

Console throws an error:
caught (in promise) ReferenceError: undefined. entity is not defined [

formal goblet
main magnet
#

Not on the actor.

formal goblet
#

You mean in the Item directory?

main magnet
#

Yes

formal goblet
#

These items are stored under game.items, use that

main magnet
# formal goblet These items are stored under `game.items`, use that

const itemTemplateName = 'weapon template11 - alt'; const itemTemplateId = game.items.getName(itemTemplateName).id; entity.items .filter(item => game.items.system.template === itemTemplateId && game.items.name.slice(-5) === ' (Q1)') .forEach(item => { const newValue = "no bonus or penalty"; item.update({'system.props.damage_info': newValue}); });

Like that?

formal goblet
main magnet
elder raft
#

Is there a way to use setPropertyInEntity within a roll message execution?
Like if a player uses a charge it can decrease the component on the sheet, or if a value comes back under a certain amount they can generate a resource point,

setPropertyInEntity('target', 'Health', "target.Health - Damage")
Is what I'm working off of, but I'd like it to adjust the value on the current sheet, this one isnt working:
${!paragonuse == true ? 'setPropertyInEntity('self', 'player_paragon', "self.player_paragon - 1")'}$
(and I've messed with the syntax a bit, changed the self and Actor and stuff like that... no luck)

Or is there a different way to do this better?

main magnet
formal goblet
elder raft
#

Yeah, that's what I was thinking with the prefixes from what I read. But even without them it doesnt seem to be affecting the character

worn iron
#

Hi all, so I'm not a coder by any stretch, but I've kludged a basic system or two together in Simple Worldbuilding system and the Pbta system before with only minimal trouble.

Recently, my players have asked me to run a new system for them, one I'm relatively familiar with and I figured that I'd try out again this time with CSB considering it seems like it has the most active team and most flexibility of any of the system builders I've seen so far.

I've mostly got the appearance of the CS I want down, but I've run into trouble when it comes to actually making things roll. I'm just not really able to parse the wiki on how any of that stuff works, it's a bit above my skill level as it were.

Would anyone be willing to help me along?

elder raft
formal goblet
#

But I think that every beginner tutorial for JS can explain things better than me

elder raft
#

haha, idk I think you do a decent job!

#

I understand the "text" need for quotes but why do some component keys need them in certain places?
For instance, the above code player_paragon needs ' around it inside the setentity

formal goblet
worn iron
# formal goblet You'd need to explain what you want to achieve. The simplest roll formula would...

The system I'm working on has an odd dice pool system where it rolls multiple dice and keeps only the highest.

I'd like the sheet to be able to reference the number set in the various skills and roll the appropriate dice as well as learn how to set up other items that reference those numbers and modify them and/or set the difficulties based off the numbers on other "actor" sheets.

To give a specific example:

  • I have an actor attacking with a straight sword.
  • Straight Swords are mapped to using the Medium Melee skill (labeled: mmelee) and give +1d10 on rolls to hit as well as Damage
  • The actor has 2d10 in Medium Melee and 3d10 in Muscle
  • With the equipped sword, they should roll 3d10 to hit and 4d10 for Damage
  • For the Sword attack to hit, 1 or more of the die needs to meet or beat the enemy actor's Parry (which is 6)
  • Assuming the attack lands, the actor should then roll their 4d10 against the enemy actor's Hardiness (which is 4), and if any of the die meet or beat 4, and for each die that rolls a 10 specifically, the roller should record a wound.

I'd like the character sheet to be able to do those calculations

formal goblet
# elder raft I understand the "text" need for quotes but why do some component keys need them...

setPropertyInEntity() is a function, which expects input arguments (usually 3 different arguments). The first 2 must be strings, while the 3rd one can be any primitive (string, number, boolean). If you'd use a component key (keyword: variable) in one of the input arguments instead, it would resolve the variable to the value it holds before it gets passed to the function. That's why some functions expect the keys to be strings, so these are not automatically converted to their respective values.

elder raft
#

Oooooh

#

I seee

#

Yeah I'm pprobably never gonna figure that out to a point where it's intuitive for me, but at least the concept makes sense!

formal goblet
elder raft
#

fair

elder raft
elder raft
#

Is it difficult?

#

Being such a genius sometimes?

#

🀣 I swear i read past the "samerowindex" a thousand times on the wiki

main magnet
formal goblet
# worn iron Does that make sense?

There are a few things, that come together, so I'll try to start simple.

We're working with Dice Pools, so we'll need the kh (keep highest) - modifier (see here: https://foundryvtt.com/article/dice-modifiers/). A simple example:

${5d10kh}$

This one rolls 5d10 and only keeps the highest of these 5.

Now let's go into Detail:

  • I assume the following keys and values within your Weapon-Items:
{
  "skill": "mmelee",
  "hit-bonus": "1d10",
  "damage-bonus": "1d10"
}
  • I assume that your Skills of your Actor are within a Dynamic Table and have the keys name, value
  • I assume that your Label with the Roll is within an Item Container, which displays your Weapons
${#hit:= concat(ref(item.skill), '+', item.hit-bonus)}$
Hit-Roll: ${hit_roll:= [:hit:kh]}$
Does it hit? ${hit_roll >= fetchFromActor('target', "parry", 0)}$
${#damage:= hit_roll ? concat(ref(item.skill), '+', item.damage-bonus) : '0'}$
${#damage_roll:= [:damage:kh]}$
Wounds: ${damage_roll >= fetchFromActor('target', "hardiness", 0) ? 1 : 0}$

I'll leave out the count of 10s, because that will require a Script, which is more complex. You can tackle that case when you have more knowledge.

formal goblet
worn iron
#

I assume that your Skills of your Actor are within a Dynamic Table and have the keys name, value
They're in a panel? will that break things?

I probably should've shared this earlier. I was cribbing off the notes of someone who worked on a similar system, but I couldn't quite make the actual roll thingy work

formal goblet
#

I actually forgot to use the case with the Dynamic Table, so my example should still be valid

worn iron
#

so I don't actually have anything labeled "skill" I'm not even sure where I would.

In that case, should I just replace "skill" with the actual label?

If so, what do I do for the sections that reads "item.skill"?

#

oh right, those are labels that should be on the item not the base character sheet

formal goblet
#

The item has to know which skill you want to use

worn iron
#

I'm now confused on where this label should be? Is it supposed to just be a button on the specific weapon? something extrinsic on the character sheet?

formal goblet
worn iron
#

Currently weapon template looks like this

formal goblet
worn iron
#

at what location should the actual thing that rolls it be?

formal goblet
#

In an Item Container

#

And that Item Container should be within an Actor Sheet

main magnet
formal goblet
main magnet
worn iron
#

Did I do that right? It's not rolling anything

#

ok, so error message reading...

a syntax error which means I wrote something wrong. The 39th character is a space

formal goblet
formal goblet
worn iron
#

Like this?

${#hit:= concat(ref(item.skill), '+', ref(item.wacc))}$
Hit-Roll: ${hit_roll:= [:hit:kh]}$
Does it hit? ${hit_roll >= fetchFromActor('target', "parry", 0)}$
${#damage:= hit_roll ? concat(ref(item.skill), '+', ref(item.wdmg)) : '0'}$
${#damage_roll:= [:damage:kh]}$
Wounds: ${damage_roll >= fetchFromActor('target', "hardiness", 0) ? 1 : 0)}$

#

alright so that didn't work

worn iron
#

Progress has been made

#

A new error message

formal goblet
#

You only want to use ref() with item.skill. Because item.skill contains e.g. arm_strike. But we need the value of arm_strike, not just the string.

All other refs are not needed

worn iron
#

I think we're getting somewhere, 2 new errors

formal goblet
worn iron
#

alright so it didn't like that

#

Current code is...

Hit-Roll: ${hit_roll:= [:hit:kh]}$
Does it hit? ${hit_roll >= fetchFromActor('target', "parry", 0)}$
${#damage:= hit_roll ? concat string((ref(item.skill)), '+', item.wdmg) : '0'}$
${#damage_roll:= [:damage:kh]}$
Wounds: ${damage_roll >= fetchFromActor('target', "hardiness", 0) ? 1 : 0)}$```
formal goblet
#

concat(string((ref(item.skill)), '+', item.wacc)

worn iron
#

Alright, we're moving right along. New Error

formal goblet
worn iron
#

all of them have #d10 instead of just flat numbers so far as I can tell

#

ah

#

I see the issue

#

the item won't let me add a formula in that area since I made it a number box

#

Suggestions on what I should change it to?

formal goblet
#

You can split it up and merge it together into a Roll Formula, but for now, let's just do a Text Field

worn iron
#

changed that, but still getting the same error

#

even changed the one in my actor sheet being referenced for good measure

formal goblet
#

Replace the Roll Formulas with a static value. We can handle that later

worn iron
#

so just 3 instead of 3d10?

formal goblet
#

[3d10kh] e.g.

worn iron
#

ok, so now it rolls

#

it's almost saying the correct thing

#

but not really

formal goblet
#

I wanted you to do this: Hit-Roll: ${hit_roll:= [3d10kh]}$

#

Same with the other one

worn iron
#

wanted?

formal goblet
#

Yeah, so we get rid of the error and can check what the Chat Message outputs

worn iron
#

ah yes, we got past the error and did make sure it output a roll that is mostly correct

formal goblet
#

Your Text Fields should only contain 3d10 e.g.. The kh-modifier should only be part of the Label Roll Message

#

That's why we see kh twice in there

worn iron
#

I removed the excess "kh" from the fields, but it's still not actually keeping the highest

formal goblet
worn iron
#

ok, so it doesn't like the parenthesis

formal goblet
worn iron
#

all I did was enclose :hit: in parenthesis

#

works if you take em off

formal goblet
#

Is it always d10 you're rolling?

worn iron
#

yes

formal goblet
#

Then we can simplify a few things.

  • We'll change the content of your Input Fields, which contain a Roll Formula (e.g. 2d10) to only the amount of dices (e.g. 2)
  • We change the concat()-thing to something like this: ${#hit:= ref(item.skill) + item.wacc}$
  • The Roll Formula will change to this: ${[:hit:d10kh]}$
worn iron
#

So can I return the fields to Number instead of text?

formal goblet
worn iron
#

Changed code:

${#hit:= ref(item.skill) + item.wacc}$
Hit-Roll: ${[:hit:d10kh]}$
Does it hit? ${hit_roll >= fetchFromActor('target', "parry", 0)}$
${#damage:= hit_roll ? concat (string(ref(item.skill)), '+', item.wdmg) : '0'}$
${#damage_roll:= [:damage:)d10kh]}$
Wounds: ${damage_roll >= fetchFromActor('target', "hardiness", 0) ? 1 : 0)}$

What should I do for :damage: since that still has a concat?

Something like ${#damage:= ref(actor.Muscle), '+', item.wdmg}

formal goblet
#

${#damage:= hit_roll ? ref(item.skill) + item.wdmg : 0}$

worn iron
#

and it's borked again

formal goblet
#

Hit-Roll: ${hit_roll:= [:hit:d10kh]}$

worn iron
#

ok, so that's rolling again

#

A few things to patch up now.

Firstly, looks like it's not actually checking to see if it meet/beats the target's parry

#

I'm also not actually sure where it's getting it's number of die to roll for damage either

#

oh, it's actually just using the exact same dice as the "to hit"

worn iron
#

Thanks for your help so far

#

I'll need some help ironing out the weirdness on the Damage side of the calculations

#

but I think I at the very least it's fairly easy to tell use this as a template to figure out how to make weapons work

#

I think I'll futz with basic rolls for a bit

#

Would it be possible to add a section into the code to ask for a target number that it will then input into the roll?

#

So for example,

If I want to roll Athletics (ath) on the character sheet to climb a building. In this game I might say that it's a fairly easy roll, and require the player to make the roll at a Target Number of 4 (meaning that in their dice pool, that any die that outputs a 4+ counts as a success)

formal goblet
worn iron
#

I was more asking for soemthing that would allow the player to click to roll the action and it open a dialogue box asking them to input the difficulty

worn iron
#

then what's the "5" in the first line for?

formal goblet
#

Just a default value

#

You can adjust that to anything

worn iron
#

oh... you wrote the whole thing

#

I tried writing the basic roll dialogue and then just adding in what you wrote

#

b4 realizing you wrote out the entire code for it

#

ok, so now I've a request that's going to make things likely a little more complicated

#

I'd like an "if" formula.

Essentially, the way the game works, whenever you have a rank in a skill you roll that many d10s to determine whether or not you succeed keeping the highest.

But for skills you have no ranks in you roll 2d10kl.

So if I have 0 ranks in Muscle and try to lift something heavy, it'll roll 2d10kl.

worn iron
formal goblet
worn iron
#

what part of that rolls 2d10kl?

#

I think I see how it reads if you have 0 then it rolls 2 dice

#

but I don't see anything that'd tell it to keep the lower in that case

formal goblet
#

Fixed for the kl-part

worn iron
#

damn dude

#

you're magic

#

alright, my brain is officially fried so I'm gonna take a rest

#

I really appreciate your assistance

formal goblet
#

Call me Elias Ainsworth - sensei

supple latch
#

Do anyone know if someone takes commissions to craft character sheets using this system and how much people usually charge for this?
if its is a real thing, i might just get myself something like this as a christmas gift
because everyone just get money in dollars and thats extra expensive

marble burrow
#

EDIT: SNIP! I figured it out on my own ❀️ Thank you anyway!

cobalt mango
#

I deleted my message earlier because I wanted to make sure it was about CSB and not native Foundry. Posting again because I believe it's more relevant here as it has to do mostly with paged panes and setproprietyinentity

cobalt mango
#

If I could change an element from label to entry field during runtime it would be great

formal goblet
cobalt mango
#

The reason I was using setProperty is that as I understand it, I can only modify label keys with attribute modifiers

formal goblet
cobalt mango
#

Oh. Then I'm not sure what you mean by a label referencing an input field

#

They definitely cannot reference the same key

#

How does the input field modify the label without

Setproprietyinentity
?

formal goblet
cobalt mango
#

Oh I totally didn't realize I could do that and still modify the label itself. Thought it had to print its own key

#

Then your version is much leaner. Ty

brisk finch
#

anybody know something about it after update to 4.0.0?
it happen after i use items in characters

formal goblet
brisk finch
#

and now this buttons doesnt work

#

i think i found problem... Thanks for help anyway :3

dusky mist
#

I am using this to pass data to a macro, I have put that same macro in a compendium. how would I call the compendium version?

%{return await

game.macros.getName('ActionDice').execute({nameValue: '${name}$', classValue: '${chr_class}$', stringValue: '${attk_value}$',actionType: "attack",rollType: "dh"})}%
dusky mist
#

you are awesome.

marble burrow
#

Is there a way to make a Label Roll Message roll with Dice So Nice? Mine just outputs directly to chat without the dice roll. Works fine but doesn't have the satisfaction of seeing the actual dice roll

#

Also need to figure out how to get the Label Roll Message to do a call out when the dice roll doubles πŸ€”

#

Side note: Thank you so much Martin (I assume it's Martin) for making this ❀️ not having a native system is a pain but this allows my group to play Daggerheart and while it takes a bit of learning and work it has been a fun experience to do so ❀️ ❀️ ❀️

dusky mist
#

for combat tracker I can seem to edit the initiative is there a way to allow typing in?

calm fable
brittle moth
half beacon
#

Wait, does that mean there's a stable release for v12 now

formal goblet
formal goblet
formal goblet
half beacon
cobalt mango
#

Agree I owe you being able to run my game ❀️

#

Thanks

#

Well, and of course the system existing is needed to run the game 🀣 but I'd have given up and looked for a different system

half beacon
#

Foundry VTT was my last resort, but the flexibility in Foundry and CSB made me feel like an idiot for not making it my first choice

lament flint
formal goblet
formal goblet
# lament flint

Ok, try out game.actors.getName('actorName').items in the console and see if you can find the item

formal goblet
formal goblet
#

If I get to finish that... I'm getting sick rn...

sturdy mesa
last mirage
safe halo
#

is it possible in CSB to have any kind of interactive bars like checkboxes that fills previous ones or drag a meter to change value?

#

like this

cobalt mango
#

I bet you can do it with a custom script and css

safe halo
#

I'm moving from sandbox and that was something really easy to do

safe halo
#

I just asked an AI and gave me a css code that works in codepen I'll try it later with CSB

sturdy mesa
#

I'm facing issues with the default values in the sheet fields, as shown in the video.

By default, in the Rich Text field, I set that light magic image, yellow. By default, I also set the name "Luminancia" in the Text Field.

However, whenever I add a new item to the table that starts with these default values, it isn't sent to the chat unless I manually update the item's name again and open and close the Rich Text with the image to save it again.

cobalt mango
cobalt mango
#

I was looking at the documentation but it's not clear to me what's the supposed use case for a dynamic table

safe halo
#

how you do updated formulas ?

#

like a mod in osr

formal goblet
safe halo
#

?

#

i want a mod field displaying str-10

formal goblet
charred spire
#

Hey guys, how are you?
Could anyone help me with this?
I wanted to do something like PokΓ©mon, when I identified the type I would take double or half the damage.

formal goblet
formal goblet
safe halo
formal goblet
safe halo
#

I'm used to work with sandbox and things work quite different here

#

I think I can sort out some kinda numeric radio buttons with css

formal goblet
#

Well, we separate derived from non-derived values (you cannot have both in a single field)

safe halo
#

so I can recall values from labels in formulas right ?

formal goblet
#

Yep

#

The go-to structure for most cases is: baseValue (input-field) + modifier (label) = total (label)

safe halo
#

so for what is used recalculate?

formal goblet
safe halo
#

and a common value like "target value/difficulty level" field for all players is possible in CSB? something that i can change in a common place that affects all rolls

formal goblet
safe halo
#

ummm can do the trick, thanks !!

cobalt mango
#

Could someone show me how to use a dynamic table to roll the correct attributes on an actor?
atm I'm storing the value to be rolled in each item and the actor references its string when rolling. But I feel like there's a better way

#

so the roll formula has ${${item.Roll1Ability$}}$ -> a number

formal goblet
cobalt mango
#

No, I'm storing directly in Text Entries and It's a lot less clean. screenshotting brb

#

formula on the actor:

#

where item.Roll1 is "MuscleTotal"
and actor.MuscleTotal is "5"
so it rolls 5

formal goblet
cobalt mango
#

ok, I was wondering if there's a better way to do it. I have a foggy understanding of dynamic tables but I feel like they should help here

#

ideally I'd like to calculate the number within the Dagger at the very least

safe halo
#

can I limit max rows of a dynamic table ?

formal goblet
safe halo
#

what is world script o.0" ?

#

I can use a row count as well, do we have it ?

formal goblet
formal goblet
safe halo
#

encumbrance is based on equip slots

#

and you have max of your strenght

#

i can flag it as overcharged

elder raft
formal goblet
elder raft
#

Ahh k, it looked like the formatting I've seen in other systems like 5e and I thought maybe it was something configurable in CSB. But a module CSS change makes sense

safe halo
#

on a dynamic table if the first column is an item can I retrieve a value of that item on next column?

formal goblet
safe halo
#

is a dynamic table with an item container in the first row

#

I want to add a second column with the damage of first column item

dire socket
#

When attempting to open an item container component

formal goblet
formal goblet
safe halo
#

Ic now

#

can item containers be inside objects ?

#

I want to add tags to an object

#

and seems Item container is available only if i add dynamic table first

formal goblet
safe halo
#

Yup, I cant create a bag for example

brittle moth
left osprey
#

Hey kinda new to CSB labs. I have made a simple character sheet for my players and we have been pretty okay with it. Next, I want to work on automating Long-Resting (and others like Partial Rest, and short rest, but I feel like it would be easy once I get that) and charges for spells/abilities/features. Is that something I can do in the editor, or is this when I need to start working with CSS? (Since different classes have different charges for spells, and skills i can't just put it on the template) Any help would be great thank you! (I came from Quest Bound & DND Beyond if you have heard of it, and it was great but the product is very limiting) This is what I got so far!

formal goblet
# left osprey Hey kinda new to CSB labs. I have made a simple character sheet for my players a...
  • For resting, you can use setPropertyInEntity() for each field, which should be updated. If you have many fields, which should be updated, then you can use a Script instead (check the Wiki for this case)
  • I'm actually not that familiar with DnD, so I can't really tell, what would be the best here. I can think of a few possibilities (simple number fields for each spell slot grade, Items, ...), but each with pros and cons
left osprey
# formal goblet - For resting, you can use `setPropertyInEntity()` for each field, which should ...

Thank you for the response! I am having my own custom classes, so I am not sure how I would go about: when choosing a class, that will provide them with the "charges" or "slots" for their abilities. The thing is its different for each class, so I couldn't just put it on the template. Specific Examples to make it clear:

-Protector Class has 2 Spell slots they can use per long rest
-Conjurer Class has 2 Spells Slots and 2 (proficiency) Slots for their Conjuring
-Operator Class, that one has like 3 different slots for different things.

And I would want to connect that to a Long-Rest Button, Partial-Long-Rest, and for some a Short-Rest Button. I feel like I got the hand of the Template, but this doesn't seem like I could do with the Template itself. I don't really mind the method meaning: if its the "3/3 and reduce it to 2/3, or 3 Checkboxes and marking each one" . What do you think?

last mirage
#

How would I make it so this roll syntax automatically adds the rolled number to a "Initiative" number field?

initiative:${roll:=[1d100] + Finesse}$

#

or I can change it to a label if it's easier.

last mirage
formal goblet
undone tinsel
#

Hello!
First time reaching out, and first time using this application, so please forgive the lack of knowledge!
I'm playing a custom system that has each stat set using an S-F system that I'm likely going to have selected using a dropdown with the hidden Values being 1-7, but each stat and Value has a specific written description.
My main idea on how to do so is to have a label lookup another few tables that have all of the information stored, but I want to know if it's possible to call said info from a compendium of some sort, rather than having the table directly in the Sheet.

If that didn't make sense, please let me know.
Thanks in advance for any Advice!

half beacon
#

I updated from v11 to v12, but now all of my scripts that use entity.items.filter() aren't functional. Is it an outdated way to filter items?

drifting raft
#

Thanks @brittle moth for fixing Dice So Nice issues. Hero!πŸ‘

brittle moth
late ferry
#

Is it possible in the journal to make hyperlink to other journal entrys? for example if in a sentence there is the word "Status XY" to make a hyperlink to an other journal or Page?

sturdy mesa
#

I just sent it on GitLab.

dire socket
#

How do I find paths for attributes?

formal goblet
half beacon
# brittle moth This should still work, from what I see... Can you give a more complete example ...
let score = ${strBonus}$;
const skillsTemplate = game.items.getName("_SkillsTemplate").id;
const skillRank = entity.items
            .filter(item => item.system.template === skillsTemplate).map(item => item.system.props.rank);
const skillType = entity.items
            .filter(item => item.system.template === skillsTemplate).map(item => item.system.props.skillType);
for(let i=0; i < skillType.length; i++)
{
    if(skillType[i]=="str"){ score += Number(skillRank[i]); }
}
return score;```
#

It's for a hidden attribute

formal goblet
formal goblet
half beacon
formal goblet
half beacon
#

I believe I found the right error. Apparently there's a lot, but so many are repeats.

formal goblet
half beacon
#

No idea how that's happening. I changed score to a static 0 to see if ${strBonus}$ was the problem, but I still have the error. I removed all items from the character sheet and even tried a new sheet. When it should return 0, "NAN" shows instead.

formal goblet
half beacon
#

That's what I thought too. So I just used "return 0" in the script and still get the error.

#

I'll try reverting back to v11 then to v12 again

half beacon
#

For some reason, the problem was with a boolean for turning the character creator I made on and off. Removing that allows all hidden attributes to work as normal. Not sure why, since it's not referenced in them, but it works now.

#

I spoke too soon. Refreshed and they fell apart again. But I don't really have anymore information. I might redo it or just stay on v11.

undone tinsel
#

Another hopefully simple question.
I've been banging my head against the wall to get a clickable inline roll in a text Label.
I've added ${Roll:=[1d20]}$ as a test but it seems to automatically roll it rather than act how Foundry's inline rolls normally do, showing as a clickable element. I have read through https://gitlab.com/custom-system-builder/custom-system-builder/-/wikis/Guides/Formula-System#32-roll-formulas but nothing in it is showing me this, and looking at the examples in the addon, but I don't see any thing inline.

What do I seem to be missing?
Inline roll example is from a Journal, the other two are from a character sheet.

ornate latch
#

hey does anyone know how to get the radio buttons in a tab to be progressive? ie when i click the second one in the row, the first one gets ticked automatically and when I tick the 9th one, 1 through 8 gets ticked

#

i know absolutely nothing of formula writing so I'd really appreciate some help or any tutorials you know of to help use this

#

or grouped checkboxes would be good too

formal goblet
ornate latch
formal goblet
ornate latch
formal goblet
ornate latch
formal goblet
ornate latch
ornate latch
#

is there a way to get a radio buttin to untick? clicking it doesnt work

heavy elm
#

Hey, is there an option to use an itemcontainer as a source for a dropdown-menu?

undone tinsel
brittle moth
hasty grove
#

Hi - I wanted to ask, is there a way to add images/graphics to the background of panels etc on the Actor Sheets?

undone tinsel
#

Ah, understood.
I'll just add another column then and see if I can use the roll message function with switchcase

#

My switchcase doesn't quite seem to be working how I expected / hoped.
I have the following in my Label roll message:
${switchCase(aura_speed,
'S', '${roll:=[2d20kh1+3]}$',
'A', '${roll:=[2d20kh1]}$',
'B', '${roll:=[1d20+3]}$',
'C', '${roll:=[1d20]}$',
'D', '${roll:=[1d20-3]}$',
'E', '${roll:=[2d20kl1]}$',
'F', '${roll:=[2d20kl1-3]}$',
'Lookup Failed')}$

But when I click on the Label, it rolls all dice at once.
My desired effect was that it would only roll the matching selection, rather than rolling all dice, and selecting the correct result.

Fixed using the following, for others that may stumble across this:
${roll:=[${switchCase(aura_speed, 'S', '2d20kh1+3', 'A', '2d20kh1', 'B', '1d20+3', 'C', '1d20', 'D', '1d20-3', 'E', '2d20kl1', 'F', '2d20kl1-3')}$ ]}$

brittle moth
undone tinsel
#

That's a much cleaner version, thank you!
And looking at that, is #tempVariable a standard way of making variables?

brittle moth
#

The # at the start of a Formula just prevents it from being printed in the Chat

undone tinsel
#

What you provided gives the char13 error, which seems to be : in ${#rollFormula:=

#

Removing the : removes the first error, but still produces

undone tinsel
#

That worked, interestingly enough.
Is there a specific reason the newlines don't work?

formal goblet
undone tinsel
#

Understood.
Javascript is a new Language for me

#

Only other question then, Is there a way to copy / paste components?

undone tinsel
#

My absolute Godsend

umbral jackal
#

To create a custom input component, do I need to follow the coding tutorial on the wiki, or use the userInputTemplate template type? (I'm good with either.)

brittle moth
umbral jackal
#

Oooooh, so that's the difference. I want to add a new component to put on a sheet.

brittle moth
#

Then the coding it is ^^"

half beacon
#

Is it possible to create a button or checkbox in the chat window using a label roll message?

umbral jackal
brittle moth
half beacon
umbral jackal
#

I mean...doesn't the Label component type have an option to display it as a button or something?

#

Oh, wait, just understood what you meant. Not sure you can display a Label component inside chat message.

hasty grove
#

I see, Im new to this so what exactly is a CSS? Right now I have alot of the overall layout functioning, just need the actual numbers to work if that makes sense

umbral jackal
#

CSS = Cascading Style Sheet. It's what's used to style HTML.

#

For example:css div { background-image: url("image.png"); }will set the background image of the <div> element to image.png. Though I forget whether relative pathing uses the path of the CSS file or the HTML file it's attached to as an origin point.

half beacon
#

CSS if fun once you get the hang of it. F12 is your friend.

hasty grove
#

I see. Il give a look into it deeper when I can, for now I have a bit of a new problem - how do I add an increasing counter to an item container, so if there is 2 of the same item it will go up on the item container?

half beacon
#

You could either use a Number Field and manually enter it or install the Item Piles module with the Number Field.

hasty grove
#

I cant seem to change the item container to anything but a label or a meter, so il try the module

formal goblet
hasty grove
#

I see.

lusty parrot
#

So, got directed to roughly around these threads lol. So I'll start here for now. Currently trying to port a character sheet from an English translation of the Japanese TTRPG Dracurouge. Would this be a good system to use to do this? How would I go about doing this?

dusky mist
#

I have some macros that kick on on label roll message with the PC data passed through it. Is there a way to make it so players can pull the process off and set in their macro bar? image is from my PC template. want to be able to drag the red words to the macro bar

dusky mist
#

the input fields represent how many dice that red button rolls

#

its that easy... wow

#

Thank You

#

hmm right clicking doesn't seem to do anything. maybe i need To reload

formal goblet
dusky mist
#

pfft im dumb, sorry and thank you

#

yep works, you Are awesome!

formal goblet
# lusty parrot So, got directed to roughly around these threads lol. So I'll start here for now...

Well, you can build your own sheets with this system. But if it meets your needs is up to you. I suggest to read a bit here and maybe try out the example-module, which contains a ready-to-use example:

lusty parrot
heavy elm
#

I have a problem with an template of an item requesting informations from an diffrent itemcontainer. I have a field with the key Sphere and a label with the following formular:

${fetchFromActor('attached', "lookup('Classes_Container','Level', 'name', Sphere)")}$

but the label always returns nothing. Checked spelling multiple times. When I enter the Name of the requested -Item manually it returns me the correct value. What am I missing?

last mirage
#

Is there a specific place where there is a list of helpful syntaxs used in rolls? I'd like to just trial and error myself instead of bothering people here every time.

I'm trying to find out how to clear checkboxes when a label's roll message is activated.

#

Sorry for two questions at once, but is there also a better description of how to set up item modifiers? I'm simply trying to make it so when a character has an item in their inventory they gain a + to a number field.

heavy elm
#

Thats possible. You name the component key in the column 'key' and the value in the column 'value formular'

formal goblet
last mirage
half beacon
#

I'm using a Tabbed Panel. Is it possible to use CSS to fade in/out the transition between these tabs?

last mirage
# formal goblet You cannot modify Input Components, only Labels

I cant seem to find how to use the item modifier table through these pages.

Would you be able to help me make it so when a character has an item, it adds the bonus to the "stealth_modifier" label? and when Stealth is rolled, it would add the "stealth_modifier" to it?

undone tinsel
#

Hello, another question from me today.
I'm wanting to have a conditional argument based on weather an Item is present or not in the Character sheet.
I can tell ${return if(object exists on actor) { ans = true } else { ans = false}}$ is likey the answer, but I can't figure out how to specify what object to look for.

undone tinsel
# half beacon I'm using a Tabbed Panel. Is it possible to use CSS to fade in/out the transitio...
formal goblet
formal goblet
marble burrow
#

I'm using a module called Party HUD which shows active players/characters in a side panel. It's supposed to show stuff like HP and the like in a tooltip when you hover over them using their attributes. The configuration for the tracked resources only show some generic looking attributes, and I don't know how to modify these attributes to reflect the values on the character sheets in CSB. Can someone point me in the right direction? See attached images for context.

formal goblet
marble burrow
#

Ah, sadness. That's okay. Party likes being able to see their images in a line at any rate ^_^

grave ether
#

Does party hud have a github

marble burrow
#

I don't believe so. It's a premium module by TheRipper93

grave ether
#

Alright so the config carousel has some configs to it. You could attempt to update those to include the attributes needed

#

There is a script file thats in the repository

#

Without dinking around with it, my guess is you could add your own system values in the world script file and reload.

half beacon
#

Can item containers be a scrollable list that only displays (x) number of items at a time?
EDIT Never mind, my brain cells woke up and did it.

undone tinsel
#

I am so close to done.
I'm still stuck on my if else statement to get a true false on whether an Item is present.
I currently have This, but have some issues with it:

%{return wantedActor=game.actors.getName("Test")
wantedItem=wantedActor.items.getName("Damage Reflection")
if (wantedItem != undefined) {console.log("Feature Found!")} else {console.log("Failure")}}%

Main issue is it relies on knowing the actor name, and I'm not sure how to have it automatically search the actor that it's running from. Other part is I'm unsure how to have it output a True or False statement rather than directly to the console

brazen laurel
#

Unsure why inventory items only appear in the token sheet and not the main sheet when picked up

half beacon
#

Is it intentional for us to be able to have a dynamic table within a dynamic table? I can't figure out how to make labels for the second table.

#

The "Effects" column is the second dynamic table.

umbral jackal
#

Can switchCase() be used to test whether a number is within a certain range? For instance, I need to specifically be able to test if a number is 0, 1, 2, or >= 3.

marble burrow
#

Man, I feel like I need a CSB mentor to address all of the things I want to do lol. So many questions but I feel as if I'd be annoying if I asked them all here @_@

brittle moth
umbral jackal
#

Hmm. All right, thank you both for the help.

brittle moth
#

This is a workaround though, be aware that the last value matches everything that didn't match before πŸ™‚
So it will match >=3 but also <0

umbral jackal
#

I'm trying to test it against an absolute value.

#

I put this onto the label in a userInputTemplate, but as I change the value of Roll_Modifier, the label text isn't changing:

${concat(switchCase(abs(Roll_Modifier), 0, 'Normal Roll', 1, 'Minor ', 2, 'Major ', '${Roll_Modifier}$x '), Roll_Modifier > 0 ? 'Edge' : Roll_Modifier < 0 ? 'Obstacle' : '')}$

#

What it should do is display "Normal Roll" at 0, "Minor Edge" at 1, "Major Edge" at 2, "<number>x Edge" at 3+, "Minor Obstacle" at -1, etc.

#

Though I suppose I could use switchCase(sign(Roll_Modifier), ...) instead of the chained ternary operator for that second one.

umbral jackal
#

Also, would I need to create a macro and propagate it to every other friend who wants to use this system if I want to easily be able to roll this with a single command?:

${rollFormula := concat(2 + abs(:Roll_Modifier:), 'd6', switchCase(sign(:Roll_Modifier:), 1, 'kh2', -1, 'kl2', ''}$
${[:rollFormula:]}$```
half beacon
umbral jackal
#

This is incredibly frustating. I can't find the right way to edit only a portion of a roll formula based on a switchCase.

brittle moth
# umbral jackal Also, would I need to create a macro and propagate it to every other friend who ...

This is the formula you're looking for :

${rollFormula:=concat(string(2 + abs(Roll_Modifier)), 'd6', switchCase(sign(Roll_Modifier), 1, 'kh2', -1, 'kl2', ''))}$

${[:rollFormula:]}$
  • It was missing two parenthesis to close the switchCase and the concat
  • You should not use colons to denote variables in a standard formula, only in rolls
  • The first parameter of the concat should be string, else the formula interpreter wants to concat only numbers
umbral jackal
#

Oooooooh, now I understand! Thank you so much!

brittle moth
umbral jackal
#

Makes sense, I guess.

#

YES! It worked perfectly! Thank you again! The major problem was not knowing I needed to convert the first term in concat() to a string. Also forgetting about the last two closing parentheses.

brittle moth
#

You can often find error messages in the browser console by pressing F12 πŸ™‚
Little tech savvy trick, but most messages are explicit

umbral jackal
#

It did give me helpful messages, I just wasn't sure how to fix many of them.

#

That took way too many hours to get the way I wanted it. 😩

#

Well, Roll Modifier was 10 when I actually rolled it.

safe halo
#

I'm trying to execute a macro from a label but seems arguments aren't passed

}%}$
#

can't get args inside macro

willow birch
#

Here's an example I made
%{return await game.macros.getName('Base Roll check').execute({S: '${Snapp + KastvapenS}$', V: '${KastvapenN + Kastvapen}$'})}%

#

Need help with this one, I have no errors and it prints 0. Want it to switch between 0-1 when clicked.
${setPropertyInEntity('item', 'EQ', (item.EQ ==0 ? '0':'1'))}$

#

NVM, I was too tired facepalmpicard

formal goblet
formal goblet
safe halo
#

ReferenceError: args is not defined in macro

#

is execute but i can't read arguments

safe halo
#

is called scope >_>

formal goblet
safe halo
#

not really is called "scope.atributo"

formal goblet
# safe halo

Huh, didn't know about the scope-object. So both scope.atributo and atributo are valid

ornate haven
#

How do you change the default settings for Grid Scale in foundry?

velvet heron
left osprey
#

Here breaking my back, does anybody know any common things that might cause this error in the VTT Console: {description: undefined, fileName: undefined, lineNumber: undefined, endLineNumber: undefined, message: 'An error occurred while rendering CharacterSheet 4…d 1 package: system:custom-system-builder(3.2.5)]', …} (basically one of my players character sheet isn't opening, while some are)

left osprey
#

Trying to fix that now I am getting

"An error occurred while rendering CharacterSheet 34. Missing helper: "range""

😭

left osprey
#

nvm i think i am good? it seems to work lol

half beacon
#

I think I've fried my brain. How do I add to a string in an item? The item has a script that brings up a user input window. The player types what they want into it, and then it's added to a label within the item. I tried a few things...
setPropertyInEntity('self','original-key',"original-key + userInput")
setPropertyInEntity('self','original-key',"original-key" + "userInput")
Neither do anything.

formal goblet
half beacon
#

... oh my god facepalmpicard

#

Thank you

charred spire
formal goblet
# charred spire Okay, can you give me an example of what that would look like?

I'll use 3 types (Water, Fire, Plant):

# type  water fire  plant
1 water   1     2    0.5
2 fire   0.5    1     2
3 plant   2    0.5    1

The columns are type: TextField, water: NumberField, fire: NumberField, plant: NumberField


Attacker is of type water, defender of type fire:

${first(lookup('table', defender_type, 'type', attacker_type))}$ // Result is 2
hasty grove
#

Is it possible to copy paste the layout of a table and replace the keys on its components, rather than remake the same format every single time? I need to use this table and a format exactly like it, its a tad tiring to have to repeat so was just checking before I continued

hasty grove
#

Oh nice, that will allow me to replicate the table and then just change the key? excellent

#

Excellent, thank you!

left osprey
#

why is this giving 12 ?? Am i slow?

formal goblet
left osprey
#

Okay I see what you are saying, but the class_ope one worked lol

formal goblet
left osprey
#

Basically whenever someone chooses a class, it sets an amount of spells slots or charges depending on the class chosen. Here the class_ope has two types of charges, and same for class_mar. for some reason the "specialAbilityCharges" is returning the right amount and the "IWFCharges" is also, but specifically the 1+proficiency isn't giving me 3, but instead a 12.

#

If it was a string, how can I multiply 2 * proficiency

formal goblet
#

Implicit type coercion is a funny rabbithole in JS, so you'll find a lot of stuff about that in the web

half beacon
#

Small question, hopefully easy. How do I add [ and ] to a string without making CSB think it's for a roll formula?

half beacon
#

New question. I have an item with a dynamic table, and that item is attached to an actor. I want the Item Container to list all of the effects from that dynamic table. To do that, I'm using const effectList "${lookup('item.dynamicTable','effectName')}$" and a for() loop to separate each element into different lines. But it's putting each character on a new line. Also, it's carrying over what's in the previous item's dynamic table to the next one.

#

I'm very clearly doing this wrong, but what's the correct way to do this?

charred spire
safe halo
formal goblet
formal goblet
half beacon
#

How would I fix that? And would doing that stop the script from duplicating text to the next item?

turbid elbow
#

Is there a way to add more door sounds should I find any online?

formal goblet
turbid elbow
#

ah, ok

#

Should I ask in Core?

formal goblet
#

Yep, that's Foundry-stuff

turbid elbow
#

Thanks

formal goblet
low cape
#

Hi everyone! πŸ™‚ I have a question to those that use the Item Piles module in their CSB system.
It appears that I have not set it up correctly. Items of the same type won't stack on piles and will always be depicted as "free" in the merchant screen as it detects neither the amount nor the value of my items from the item sheets.

For my items I have made various templates (Ammo, Consumable, ...) that all have an "amount" and a "value" label. In the System Specific Settings of Item Piles I put in system.amount and system.value respectively, which is probably the culprit. How do I correctly refer to my fields?

Additionally, I have created a currency here ("Caps"), that I also save in the pc_template as "caps". In the Item Piles config I refer to it as actor.caps, which also does not seem to work.

If it helps, I have attached my Item Piles settings. Please lmk if you have any pointers for me

formal goblet
safe halo
#

I want to achieve and no way

formal goblet
safe halo
half beacon
safe halo
#

A nice feature to have could be to reorder name and picture as you do with other elements

formal goblet
half beacon
formal goblet
# half beacon No, I do not
return Object.values(linkedEntity.system.props.dynamicTable)
  .filter(row => !row.deleted)
  .map(row => row.effectName)
  .join('\n');
half beacon
formal goblet
faint wharf
#

Hi you analized in my ticket that for some reason i generate strings in place of numbers, all fields i adres here are set to numeric (item fields)
game.macros.getName('Rana').execute({x: 0, y:${calc}$, k:${Typ}$, enit: entity.entity});
for some reason it fills numeric fields with strings, how to avert it?
full code bellow: ```${#concat(
?{ObraΕΌenia|0},
?{Typ:"Typ obraΕΌeΕ„"[check]|0,"StΕ‚uczenie"|1,"Rana"|2,"OpaΕΌenie"}
)}$
${#calc:=ObraΕΌenia-RES}$
%{
if (${calc}$ <= 0) {
return 'Tylko muΕ›niΔ™cie';
}
return await game.macros.getName('Rana').execute({x: 0, y:${calc}$, k:${Typ}$, enit: entity.entity});

}%

${ HPL>0 ? (calc-HPL>0 ? calc-HPL : 'Nie'): calc }$ Krytyczna w ciaΕ‚o

half beacon
formal goblet
faint wharf
formal goblet
faint wharf
formal goblet
#

${switchCase(number(item.BP), 0, 'CiaΕ‚o', 1, 'GΕ‚owa', 2, 'Lewa rΔ™ka', 3, 'Tors', 4, 'Prawa rΔ™ka', 5, 'lewa Noga', 6, 'Prawa Noga', item.BP)}$

half beacon
faint wharf
#

wait my error

#

case sensitive

#

Thank you it bothered me for a long time

elder jasper
#

I would like to know how I can put a button on the roll message label to apply damage

half beacon
#

Is it be possible to take an item container and use transform-style: preserve-3d to turn each row into cards with a backside that provides more information?

#

I thought maybe I'd have to make two item containers (one for the front, and the other for the back) then overlap them using CSS.

half beacon
#

Now I'm having trouble returning a string from a rich text field. %{return "${item.description}$";}%

ornate haven
#

Can you make a visibility formula check two check boxes and appear if either are checked?

foggy grotto
#

Has some thing changes that I can't drag things into tabbed panel sections?

half beacon
foggy grotto
foggy grotto
#

Will try it. Thank you for the help.

foggy grotto
#

It worked. Thank you

worn iron
#

Hello again, I poked my head around here a lil over a week ago. Since then, I've made a bit more progress on my Character Sheet, but I've run back into the issue of still not really understanding the coding bits.

Right now, I have 2 Core issues that I'd like assistance with.

  • Finishing the Combat functionality #1037072885044477962 message

    • so that the roller not only identifies the right amount of dice to roll to make an attack (this works properly), but also can properly register the difficulty of an attack roll based on a value on a target's sheet (the framework is there afaik but hasn't been touched), can judge the correct amount of damage dice to be rolled based off weapon properties actor traits (which Is where I left off last time), and finally should be able to determine the target number of damage rolls based on a value on a target actor's sheet.
  • Create a similar framework as above for "techniques" (which is likely going to just be a copy/paste from the above with adjustments)

#

Right now, my code for weapon attacks looks like this:

Hit-Roll: ${hit_roll:= [:hit:d10kh]}$
Does it hit? ${hit_roll >= fetchFromActor('target', "parry", 0)}$
${#damage:= ref(item.dmg_att) + item.wdmg}$
Damage-Roll: ${#damage_roll:= [:damage:d10kh]}$
Wounds: ${damage_roll >= fetchFromActor('target', "hardiness", 0) ? 1 : 0)}$``
#

Weapon Traits

dusky mist
#

not sure if related to CSB or just calling compendium macros but in my hero sheet I am using this as the Label Roll Message:

%{return await
game.packs.get('Compendium.heroquest-assets.hq-macros').getName('ActionDice').execute({nameValue: '${name}$', classValue: '${chr_class}$', stringValue: '${attk_value}$',actionType: "attack",rollType: "dh"})}%

When its set to a local macro it works but i would like to leverage data in compendiums as much as possible. Am I calling it incorrectly?
I have also tried this with no luck:

%{return await
game.packs.get('Compendium.heroquest-assets.hq-macros.Macro.eXsBJgVq87TCwW6j').execute({nameValue: '${name}$', classValue: '${chr_class}$', stringValue: '${attk_value}$',actionType: "attack",rollType: "dh"})}%
dusky mist
#

thank you

formal goblet
# charred spire Is this correct?

numberx is unnecessary, you can delete that if you want. Rest is fine, although I'd use more meaningful key names for the types and not type1, type2, etc...

charred spire
formal goblet
charred spire
formal goblet
brave trench
#

Does anyone know if 1. foundry can detect the number rolled on a die, then have an effect happen based on the number, like a +1 to a mod, or whatever... and 2. if foundry is capable of re rolling a die if a 1 is rolled?

civic furnace
#

I am trying to use fetchFromActor to grab a stat from a player to use in the Item sheet, what am i doing wrong ?

${#scale:=switchCase(sameRow('simplemagic_scaling'), 'forca', 'Forca', 'agilidade', 'Agilidade', 'constituicao', 'Constituicao', 'inteligencia', 'Inteligencia', 'sabedoria', 'Sabedoria', 'carisma', 'Carisma', 0)}$
${#playerstat:= fetchFromActor('attached', ${scale}$)}$
${concat(
'<div>',
'<h2>${playerstat}$<h2/>',
'<div/>'
)}$

#

All i want to do is to grab the value of the character stat based on what is selected in a dropdown menu

#

Here is the Character Stats

#

Here is the weapon dropdown and label that runs the script

formal goblet
civic furnace
#

I am not sure what i am doing wrong...

#

Fixed it, thx Martin

civic furnace
#

Can i make it so when people click a label it plays a mp3 sound ? If so does anyone have a example on how its done ?

vagrant hollow
civic furnace
#

Can i roll a RIch Text Area with a Label ? I saw people doing all kinds of crazy abilities and skills in their sheets using them. I have tried it for some time, but i cant make them work...

#

Also, if i write something like this:

#

Can i get it to actually roll a dice or something ?

civic furnace
#

Never mind, figured it out

hasty grove
#

So - when it comes to making a dice roll check, how do I make a pop up table akin to say, pathfinder which contains all the modifiable values?

#

A way to automatically fill in the stuff on a sheet that matters and add the other modifiers to the roll

rapid hare
#

Hello,

Thank you for CSB, after trying Simple Worldbuilding, I found out it was a bit lacking in what I wanted. However, it seems I hit a roadblock in my quest.

I want to add a simple effect of shooting bullets against an enemy using Sequencer, and incorporate it into a macro using an editable text field. I do that so can use one item template and change the values for different effects on different items. Seems like that was a bad idea, as it doesn't work.

My macro is simple and only outputs the raw data (Image 1):

${#Effect}$
"Effect" is a Text Field where I put the actual Sequencer effect in %{script brackets}%

I tried the following:

  • If I change ${#Effect}$ to %{Effect}% and remove the %{brackets}% in the text field, the macro does not trigger at all.
  • When I make a hotbar macro with the exact same script, it works flawlessly. Using Advanced Macros to then input /macro "macroname" only pastes a chat message without triggering the macro.
  • If I put the whole %{script}% into the Label roll message, it displays the effect and produces an ERROR message into the chat (Image 2). That also doesn't give me the flexibility I wanted, as I need a different template for different weapons, or a lot of Effect macros in each item.

Is there a sane way to make the macro output a chat command and play this script?

vagrant hollow
# rapid hare Hello, Thank you for CSB, after trying Simple Worldbuilding, I found out it was...

How I did this:

  1. Programmed the effect in a macro. The macro needs a specific name und has to be owned by every player who is allowed to use it. It is not necessary to have the macro inside the hotbar, it is enough that it exists inside the macro directory.
  2. Inside the weapon items I paced a textfield with key β€œweaponmacro”. In this textfield I put the macro name for the specific weapon item.
  3. Inside the weapon item container of the character sheet I have a label with %{return await game.macros.getName('${weaponmacro}$').execute()}% inside the label roll message. Deactivate the β€œSend roll message to chat” button for this.

So if a player wants to execute his specific weapon effect, he just needs to klick the label of this weapon inside his weapon container.

rapid hare
rapid hare
brave trench
#

is there a way to edit the size of the user input templates? just CSS im assuming?

half beacon
#

Can rich text fields use formulas in them? I tried ${key}$ and had no luck.

formal goblet
misty jewel
#

hello, I'm trying to add an item to a character sheet using this script in a roll message:

%{actor.createEmbeddedDocuments('Item', game.items.getName('ITEM NAME HERE').toObject())}%

but I'm getting "undefined. actor is not defined". Any ideas?

brittle moth
misty jewel
misty jewel
formal goblet
misty jewel
#

Do you know how I'd need to change it for deleting the item? Basically I want one roll message to delete an array of existing items and then create/add a new one.

I tried changing it just to '%{entity.entity.deleteEmbeddedDocuments('Item', [game.items.getName('Resilient').toObject()])}%' and got:
undefined id [[object Object]] does not exist in the EmbeddedCollection collection.

#

I made the item unique so there should only ever be one that exists in the sheet

formal goblet
brittle moth
misty jewel
#

My guess is I need something other than .toObject then, what would I use to get the id of the item when I just have it's name? I tried just doing an array of the names and that didn't work

formal goblet
misty jewel
# formal goblet Every Document has an ID and a UUID: `game.items.getName('Resilient').id`

I see, well with %{entity.entity.deleteEmbeddedDocuments('Item', [game.items.getName('Resilient').id])}% gives the error 'undefined id [kwofPSEyjzbBLcPa] does not exist in the EmbeddedCollection collection.'

I wanted to try "GetEmbeddedDocument" but that requires the id lol, I'm guessing the ID is different for the out of sheet item vs when it's embedded/added to the sheet

formal goblet
misty jewel
dense pine
#

anyone noticed that core settings expanded doesnt work anymore with Foundry V12

vagrant hollow
last mirage
#

Is there a way to add "stats" or even "abilities" via item containers when you make a selection from a dropdown menu?

I'm trying to add background bonuses when someone chooses a background.

If not, what's a better way of doing this?

rapid hare
formal goblet
rapid hare
vagrant hollow
worn iron
rapid hare
#

One more small thing, because I can't seem to get it to work - how would I go about an item modifying the actor's attributes? I want to make it so using an item reduces fatigue by X. I used:

${setPropertyInEntity('attached', 'fatigue', "attached.fatigue- ${Fatigue_Cost}$")}$

Where:

  • Lowercase fatigue is the actor's attribute
  • Uppercase Fatigue_Cost is an item's property (The cost of using the item)
    All I got is this error:
    Uncaught (in promise) Error: undefined. Uncomputable token "attached"

Also tried "selected" for both, didn't work. However, if I put in "target" in both places, it starts to work, meaning my little atrocity actually works... I just can't get the "attached/selected.fatigue" to read the actor's data

On an unrelated note... How do I make it so a button will not trigger if the player has no target chosen? I ahve no idea where to start with this one.

formal goblet
formal goblet
worn iron
# formal goblet Post again what you currently have and what you're trying to achieve

The system I'm working on has an odd dice pool system where it rolls multiple dice and keeps only the highest.

I'd like the sheet to be able to reference the number set in the various skills and roll the appropriate dice as well as learn how to set up other items that reference those numbers and modify them and/or set the difficulties based off the numbers on other "actor" sheets.

To give a specific example:

~~* I have an actor attacking with a straight sword. ~~
* Straight Swords are mapped to using the Medium Melee skill (labeled: mmelee) and give +1d10 on rolls to hit as well as Damage
* The actor has 2d10 in Medium Melee and 3d10 in Muscle
* With the equipped sword, they should roll 3d10 to hit and 4d10 for Damage
* For the Sword attack to hit, 1 or more of the die needs to meet or beat the enemy actor's Parry (which is 6)
* Assuming the attack lands, the actor should then roll their 4d10 against the enemy actor's Hardiness (which is 4), and if any of the die meet or beat 4, and for each die that rolls a 10 specifically, the roller should record a wound.

^ was the original post, I've crossed out the things that the code currently does correctly and underlined the parts that I'd like to add.

Accuracy Roll

Hit-Roll: ${hit_roll:= [:hit:d10kh]}$
Does it hit? ${hit_roll >= fetchFromActor('target', "parry", 0)}$```

## Damage Roll (Does Not Currently work at all)
```${#damage:= ref(item.dmg_att) + item.wdmg}$
Damage-Roll: ${#damage_roll:= [:damage:d10kh]}$
Wounds: ${damage_roll >= fetchFromActor('target', "hardiness", 0) ? 1 : 0)}$```
rapid hare
static cargo
#

Hello, is it possible to make items that bring other items along when added, such as "Fire elemental" species item that has "Fire Resistance" piggybacking on it?

worn iron
late ferry
#

how can in insert stuff in a map that are not actors? for example i have a map and what to add a picture of a chest. i tried it with "items" but cant drag the into the map

worn iron
late ferry
worn iron
late ferry
#

ah ncie thanks!

heavy elm
#

Hello I have an Problem with a Label and the following formular:

${fetchFromActor('attached', "lookup('Classes_Container','Level', 'name', '${Sphere_Value}$')")}$

It should return me a single Value, in this case '10' as in the column 'Stufe', but it returns me in some cases an array with gibberish as showed in the first picture.

I guess its something wrong with my Item Template, but I cant figure out where this formular fetches that many values from. And it gives me hard headaches. Any Idea whats going on here?

formal goblet
heavy elm
#

I tried, it returns me a 3 then if the the value is 10

#

I really dont know whats going on

#

And as I play around with three diffrent templates and itemcontainers Im kinda overwhelmed now to figure out the problem

worn iron
formal goblet
worn iron
#

The first was my built to screw around test actor and I got the following error

#

The 2nd time was with a fresh npc actor I made yesterday on a whim and it actually just... worked (minus not being able to calculate wounds)

formal goblet
#

Did you reload your Actor + Items in the Actor?

#

Reload all Items doesn't include those inside Actors

worn iron
#

I made a new sheet that's updated and yeah

#

it's working bar the wounds error

formal goblet
#

And if we interpret the error message correctly, it tried to find something with the name na but couldn't find anything.

worn iron
#

which means I'm now vaguely capable of parsing the code

#

let me put actors down on the sheet and see if it's actually trying to grab the data

#

alright, just tested

#

neither the "accuracy" or "damage" are pulling data from the target actor's sheet

formal goblet
#

I found the current issue with wounds. You have a closing parens at the end, which is too much

formal goblet
worn iron
#

now it's just not reading the data and counting anything over 0 as a success

formal goblet
#

With this, we should have more info on what is calculated.

worn iron
#

I get taking it out

#

and it seems like you're saying to save it as something like...

#

Damage Threshold: $ {(dmg_thresh: = fetchFromActor('target', "hardiness", 0))} $

formal goblet
worn iron
#

That better?

formal goblet
#

Yep

worn iron
#

${#damage:= ref(item.dmg_att) + item.wdmg}$
Damage-Roll: ${#damage_roll:= [:damage:d10kh]}$
Damage Threshold: ${(dmg_thresh: = fetchFromActor('target', "hardiness", 0))}$
Wounds: ${damage_roll >= :dmg_thresh: ? 1 : 0}$

formal goblet
#

No :variable: if you're not within []. It's just variable

#

And you can remove the outer parens

worn iron
#

Which outer parens?

formal goblet
#

From Damage Threshold. Right after the Formula delimiters

worn iron
#

Updated Code and Error Message

${#damage:= ref(item.dmg_att) + item.wdmg}$
Damage-Roll: ${#damage_roll:= [:damage:d10kh]}$
Damage Threshold: ${dmg_thresh: = fetchFromActor('target', "hardiness", 0)}$
Wounds: ${damage_roll >= dmg_thresh ? 1 : 0}$

formal goblet
#

No whitespace between : and =

worn iron
#

fixed but got same error

${#damage:= ref(item.dmg_att) + item.wdmg}$
Damage-Roll: ${#damage_roll:= [:damage:d10kh]}$
Damage Threshold: ${dmg_thresh:= fetchFromActor('target', "hardiness", 0)}$
Wounds: ${damage_roll >= dmg_thresh ? 1 : 0}$

formal goblet
worn iron
formal goblet
# worn iron

It's still the old formula (see last line of the first error)

worn iron
#

sorry forgot to update

#

Here's the new error

formal goblet
formal goblet
# worn iron

That's still the old one. You even have a \ at "hardiness.

#

Do you use the Rich Text Editor?

worn iron
#

only in the text areas

worn iron
#

I might need to make a new actor to see if that changes anything

formal goblet
#

Is your Token linked to your Actor? If not, then each Token will have its' own sheet

worn iron
#

it's not

#

Yep

#

tried it on a new actor and it worked

#

so... lemme just copy the changes and apply them to the "accuracy" formula

#

Actually, is there a way I can set the field to look at the weapon type to see if it's meant to check against "parry" or "evade"?

formal goblet
worn iron
# formal goblet Too unclear, more details pls πŸ˜…

In this game certain weapons (as well as techniques) determine whether or not they hit a target based on one of their defenses. Most melee weapons target an enemy's "Parry" and most ranged weapons target an enemy's "Evade"

#

Is there a way to add a step in the process for the weapon to check and see which of the two it should be searching for?

#

Like say, reading the "skill" line in the weapon sheet to determine which it should use?

formal goblet
worn iron
#

Usually, the only other dependency would be if you're using a technique, but while those use weapon attributes to boost them, they will likely need their own code to function properly that we can sort out after the basic weapon attack part is in working order

formal goblet
#

Then you only need to decide, where you want to store the information, which skill type uses which defense stat (either in the Skills Table itself or in a switchCase()-formula).

worn iron
#
  • Parry = Arm Strike (astrike), Leg Strike (lstrike), Grapple (grab), Throw (throw), Light Melee (lmelee), Medium Melee (mmelee), and Heavy Melee (hmelee)
  • Evade = Small Ranged (srange) & Large Ranged (lrange)
#

I'll leave the data stored in the weapon

#

Alright, reading through what switchCase does it seems like exactly what I'm looking for

#

but I don't know how I'd implement it

#

Right now, the code for accuracy is:

${#hit:= ref(item.skill) + item.wacc}$
Hit-Roll: ${hit_roll:= [:hit:d10kh]}$
Accuracy: ${accuracy:= fetchFromActor('target', "parry", "evade", 0)}$
Does it hit? ${hit_roll >= accuracy}$

formal goblet
worn iron
#

${#hit:= ref(item.skill) + item.wacc}$
Hit-Roll: ${hit_roll:= [:hit:d10kh]}$
${target_defense_stat:= switchCase(item.skill, 'srange', 'evade', 'lrange', 'evade', 'parry')}$
${accuracy:= fetchFromActor('target', target_defense_stat, 0}$
Does it hit? ${hit_roll >= accuracy}$

#

Like that?

worn iron
#

Fixed it

#

Alright, one last thing I'd like to see about getting settled with Damage if possible

#

The core is very good

#

However, the damage should record a wound:

  • Whenever any of the Damage Die are greater than "hardiness" (Currently Correct)
  • Whenever any of the damage die roll a ten
formal goblet
#

So you can accumulate a max of 2 wounds?

worn iron
#

It's a Dice pool system

#

so if any die is successful you score a wound, but also for each 10 you score an additional one

formal goblet
#

Ok, that wording is clear

worn iron
#

so if I have a pool of 6 dice (and the target's defense is 5) and the results on the dice are:

5, 4, 3, 10, 10, 9

Then I'd deal a total of 4 wounds

#

but yeah, should just need to count successes on the damage formula instead of keeping highest tbh

worn iron
#

5 is a success

#

meet or beat

#

5, 10, 10, and 9

formal goblet
#

So it's also relevant how many non 10s there are, which meet the criteria (instead of at least one that meets that)

worn iron
#

If any are =>, then you earn a wound. Furthermore, every 10 score an extra

formal goblet
#

So for example defense is 6 and you have 1, 8, 9, 7, 5, this would result in 3 or 1?

worn iron
#

1

formal goblet
#

Because 5 & 9 inflict the same wound

worn iron
#

ah, you're right