#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Text Variable Math with Sort

Is it possible to take a table-based variable like below and add more text to it and have it sorted? jdale and Levendor helped me out with the some tables to variable problems last year. Now I'm trying to take it to the next level.

[Variable==[!{1dsomething} anytable]

[Variable=={Variable}Something Else >> sort >> implode]]

I don't think so. I've tested a few variations and it keeps tacking it on the end with no punctuation or sortation.

I keep getting Anytable Result 1, Anytable Result 2, Anytable Result 3SomethingElse.

I think it's because it's treating the table rolls as a single variable then adding the new after. Is there a way to put Something Else in the Anytable results that I'm missing? If not, is it possible to get the sort/implode to work at least? For clarity, Anytable results are sorted and imploded successfully each iteration.

• edited April 2021

Try editing it to this

[Variable1==[!{1dsomething} anytable]]

\I messed up this next part

[Variable2==[{Variable1} Something Else >> sort >> implode]]

• I just looked it up, I told you wrong.

you have to set a variable.
Ex\/ \/ \/
set: V1==[!{1dsomething} anytable]
set: V2==[{Variable1} Something Else >> sort >> implode]

• Weird, I'm still not getting it. I'm getting --

Result1Result2Result3Something Else

No commas, no spacing in the results.

Here is a quick little generator to test different ways. Maybe you can see what I'm not doing correctly? For focus, though, the inline variant is what I'm really hoping to make work somehow. That way I can apply it as I come across it and it doesn't require a lot of rework in earlier sections.

``````maxreps: 1

set: V3=[!{1d5} skills]
set: V4=[{V3}Something Else >> sort >> implode]

table: NPCcreation
[@stats][@someothertable]<BR>&
// section break - next line is as posted on the forum
Set at Start of Generator Skills: {V4}<br><br>&
// section break - next two lines are from inline trial
<I><B>Inline Skills:</B></I> {V2}<BR><BR>&
// section break - next two lines are with alternate tables with set function in them
Set In Table Skills: [@differentalltheskillstable]

table: differentalltheskillstable
set: V5==[!{1d4} skills]
set: V6==[{V5}Something Else >> sort >> implode]

table: anothersomeothertable
[V6==[{V5}Something Else >> sort >> implode]]

table: stats
1:[Skills==[!{3d4} skills]]<BR><BR>

table: someothertable
[V2==[{skills}Something Else >> sort >> implode]]

table: alltheskills
{skills}

Table: skills
Skill01
Skill02
Skill03
Skill04
Skill05
Skill06
Skill07
Skill08
Skill09
Skill10
Skill11
Skill12
``````

The above generator is giving me these results -->

Set at Start of Generator Skills: Skill12Skill06Skill03Skill01Skill11Something Else

Inline Skills: Skill12Skill01Skill09Skill06Skill10Skill03Something Else

Set In Table Skills:

• the following line has v2 instead of v3 or v4

Inline Skills: {V2}

&

• you also have a v5 down the line from there

• Right, that's because I have three different ways of trying it. None of them worked.

Set at start of Generator Skills is your V3 and V4 method.

Inline skills is where I started before asking for help with V1 and V2.

Set in Table is where I tried to place them at the start of a table and see if it would work.

In all three attempts, I'm not getting any spacing or punctuation.

• ; other testing.ipt
; created 4/11/2021 5:12:39 PM

maxreps: 1

Set: V2=[{skills}Something Else >> sort >> implode]]
set: V3=[!{1d5} skills]
set: V4=[{V3}Something Else >> sort >> implode]
set: V5=[!{1d4} skills]
set: V6=[{V5}Something Else >> sort >> implode]

table: NPCcreation
[@stats][@someothertable]
&
// section break - next line is as posted on the forum
Set at Start of Generator Skills: {V4}

&
// section break - next two lines are from inline trial
Inline Skills: {V2}

&
// section break - next two lines are with alternate tables with set function in them
Set In Table Skills: [@differentalltheskillstable]

table: differentalltheskillstable
{V5}

table: anothersomeothertable
{V6}

table: stats
1:[Skills==[!{3d4} skills]]

table: someothertable
{V2}

table: alltheskills
{skills}

Table: skills
Skill01
Skill02
Skill03
Skill04
Skill05
Skill06
Skill07
Skill08
Skill09
Skill10
Skill11
Skill12

the issue seems to be that the various additional V# sets seem to be added mid gen. I edited that, placing all of them at the top and putting Set: in front of those which needed it. However, I managed to add {V#} to each section which had one mixed in it.

• I edited that, placing all of them at the top and putting Set: in front of those which needed it.

Not what I wanted to read. That's what I'm trying to circumvent. When an advantage/feat adds a skill, I want to add it only if that advantage is a result from a table call. I'm trying to keep it inline as much as possible.

If that's the only way to do it, then that's my answer. I appreciate your help finding that out, though!

• your welcome, and sorry I can't help more.