¿ªÔÆÌåÓý

Re: Just wanted to share -- variables in table calls...


 

¿ªÔÆÌåÓý

Also be careful when you put HTML tags inside an If~ statement. Ex. <b> ¡­ </b> The close tag / is detected as the ¡°else¡± / of the If~ statement.

?

Sent from for Windows 10

?

From: Bruce Gulke via groups.io
Sent: Monday, February 8, 2021 5:43 PM
To: [email protected]
Subject: Re: [TableSmith] Just wanted to share -- variables in table calls...

?

To expand, you can nest table calls, functions, etc. to your heart's content. TableSmith parses text from the inside out, so it will evaluate the "deepest" pieces first then work it's way out. So, for this (odd) example:

?

1,[TreasureLevel=[GetLevel%monsterType%={Dice~3d8}]]

?

TS will first evaluate the "Dice" call, then replace "%monsterType%" with whatever that variable holds, then call the table "GetLevelwhatever" with the forced result from the dice roll, then call "TreasureLevel" with whatever the "GetLevel..." call returns.

?

The one element you can't nest is variables, since the percent sign doesn't have an open/close. When TS sees a "%", it keeps reading until it hits another "%", and then evaluates what's inside.

?

One other exception is that TS will?not evaluate a conditional that isn't true, like so:

?

{If~%monster%=1 ? [GenMonsterEnc] / [GenNPCEnc] }

?

TS will evaluate one or the other, not both (it wouldn't be very efficient to do both, not to mention the potential for side effects...)

?

?

?

©\©\©\©\©\©\©\ Original Message ©\©\©\©\©\©\©\

On Monday, February 8, 2021 4:30 PM, Vance <clubvance@...> wrote:

?

Yes ¡­ absolutely!

?

_{If~ %A% > %B% ? Do this /

_???????????? {If~%B% = %C% ? Do this /

_??????????????????????????? Do this

_???????????? }

_}

?

You can do it all on one line, but I like staggered sets.

?

Vance

?

?

Sent from for Windows 10

?

From: tim@...

Sent: Monday, February 8, 2021 3:21 PM

Subject: [TableSmith] Just wanted to share -- variables in table calls...

?

In working on the weather system for the setting I am working on (for release to go with my RPG), I am planning on having the core Weather file (a single file) have parameters that you set before rolling (i.e. click on the gear and select the month).?

?

I am planning on that selection setting a number of variables, including which of the reference files it selects to run the weather tables in there. So I wanted to test to see if I could put a variable in for the file name in calling the table, so I tried

:Start

1,[%month%.Start]

?

and it worked!!!

?

My question is -- can you do nested IF statements, or IF/Else statements where you have more than 2 choices? (am looking, but have not figured it out yet)

?

?

?

Virus-free.

?

?

?


Virus-free.

Join [email protected] to automatically receive all group messages.