Skip to content

Feed variables into other variables (limit scope of variables) #26

@Gazook89

Description

@Gazook89

Your idea:

I'm opening this on behalf of a discord user so hopefully I have the request right-- could variables somehow have their scope limited to some degree, such that a variable could be reassigned throughout the brew?

The idea is to be able to do something like this:

[TraitMagicResistance]: The $[Name] has magic resist

[Name]: Sally

$[TraitMagicResistance]

[Name]: Barney

$[TraitMagicResistance]

and get output like this:

The Sally has magic resist

The Barney has magic resist

So the Name variable could be reused within another variable template. To more precisely show the thinking of the requesting user, the TraitMagicResistance could take in another variable to fill slots, like this:

[TraitMagicResistance]: The $[Name] has magic resist

called like this

$[TraitMagicResistance][Sally]
$[TraitMagicResistance][Barney]

And I suppose with this latter syntax the trailing variables would just fill in from beginning to end if there were multiple. Sort of like regex The $1 has magic resist substitution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions