¿ªÔÆÌåÓý


Re: A question regarding parameters

 

So this is a valuable piece of information for something I'm working on.? However, what if you want to use a set of inputs from a user to create multiple instances using a given set of variables.

?

For instance:

With the InputList function, I can make it possible to select a Race, a Region, a Town, a neighborhood, a profession, with the available decisions being based on the parameters of the previous entry.? While this works when doing a character by character generation, is there a way to take in those InputList options and then using them to generate multiple NPCs with those settings, for instance?


Re: ERROR Generate function calling Generate again #function #error

 

If I am understanding correctly, what Klaas is wanting, he might do better creating and calling a dataset.

That way, he could set the entries on the dataset in the first call, and then have one entry (perhaps called "Current hits" that gets adjusted each time he needs it to be adjusted.

He could then call it, and/or adjust it as needed.?


Re: ERROR Generate function calling Generate again #function #error

 

> It would be great know what Tablesmith stores on a call to [~GroupName]. Is this a closure and the global state is stored when the [~GroupName] is clicked?

Yes, but the "global state" isn't stored when a group name is clicked - it's stored continuously until the next iteration. The table is loaded and when the variables change their value stays the same until the next iteration, when everything is reset. If another table is called and that table has variables, that table's variables stay the same as well.

If you're imagining Groups as methods, with variables local to the Groups, that's not how they work. The entire table is essentially a single method. That said, variables are "local" to their table, so if you have a Table A with a variable "level" that calls Table B, which also has a variable called "level", Table A's "level" and Table B's "level" are two different things.

The "Generate" function wasn't intended for anything other than a delayed result. It's essentially a standard Group call, but rather than being made at runtime, it's deferred until the link is clicked. The idea is that you might have something you want to generate later, but you might not (like, say, the stat blocks for patrons in a tavern or the background of citizens in a village).

>?I guess I should use a programming language instead :)

TableSmith's scripting format can be fairly versatile, but it is not nor was it ever intended to be on the same level as an actual programming language. No sense in trying to re-invent the wheel :) If TS can't handle what you want to do, then yes, an actual programming language would be a better choice.



©\©\©\©\©\©\©\ Original Message ©\©\©\©\©\©\©\
On Tuesday, May 11, 2021 2:46 PM, <klaas.reineke@...> wrote:

Thank you for clearing up, that it should work and not throw an error.

What I try to do, is to create a simple tracker for my BX character and encounter generator that I can include where the Hit Points are displayed. It can be "clicked" the InputText Dialog appears to enter the damage and the new hitpoints are displayed. By this I can play encounters directly from the generated Encounter or Stats. I try to do the same for attack rolls. If I display more than a single monster or (N)PC I need to save the state like the HP and the damage individually for each one.

The global state is a problem, because I cannot reuse the variables for the different lines. It would be great know what Tablesmith stores on a call to [~GroupName]. Is this a closure and the global state is stored when the [~GroupName] is clicked? Here is my quite difficult code for the HP tracker to accomplish this. I guess I should use a programming language instead :)

# Creates a simple HP Tracker that can be included in other tables

%hp%,
@hp,1,Hit Points?
%damage%,
@damage,0,Starting Damage?

# Variable used to signal if table is initialized
%initialized%,0

#temp variables used for different calculation
%temp%,
%dice%,
%damage%,

# Create a single NPC as defined in Parameters
:Start
1,[~hp_%hp%=%damage%]

# Makes roll support possible call AFTER tables are set up
:initialized
1,|initialized=1|

:hp
1,|hp={LastRoll~}|
# do not show Input List on initialization of table
_{IIf~%initialized%=1 ?
_|temp={InputText~0,Damage in hp (heal by using negative values)}|
_{IIf~{IsNumeric~%temp%}=1 ?|damage={Calc~%damage%+%temp%}|}
_|initialized=2|
_[~hp_%hp%=%damage%]
_:
_{IIf~%initialized%=2 ?|initialized=1|}
_|temp={Calc~%hp%-%damage%}|
_{IIf~%damage%=0 ?%hp%:%temp% / %hp%}
_{IIf~%temp%<=0 ? (Dead):{IIf~%temp%>%hp% ? (extra HP)}}
_}

:hp_1
1,|damage={LastRoll~}|
_[hp=1]
?
:hp_2
1,|damage={LastRoll~}|
_[hp=2]
?
:hp_3
1,|damage={LastRoll~}|
_[hp=3]
?
:hp_4
1,|damage={LastRoll~}|
_[hp=4]
?
:hp_5
1,|damage={LastRoll~}|
_[hp=5]
?
:hp_6
1,|damage={LastRoll~}|
_[hp=6]

[..] omitted hp_7 - hp_100


Re: ERROR Generate function calling Generate again #function #error

 

Thank you for clearing up, that it should work and not throw an error.

What I try to do, is to create a simple tracker for my BX character and encounter generator that I can include where the Hit Points are displayed. It can be "clicked" the InputText Dialog appears to enter the damage and the new hitpoints are displayed. By this I can play encounters directly from the generated Encounter or Stats. I try to do the same for attack rolls. If I display more than a single monster or (N)PC I need to save the state like the HP and the damage individually for each one.

The global state is a problem, because I cannot reuse the variables for the different lines. It would be great know what Tablesmith stores on a call to [~GroupName]. Is this a closure and the global state is stored when the [~GroupName] is clicked? Here is my quite difficult code for the HP tracker to accomplish this. I guess I should use a programming language instead :)

# Creates a simple HP Tracker that can be included in other tables

%hp%,
@hp,1,Hit Points?
%damage%,
@damage,0,Starting Damage?

# Variable used to signal if table is initialized
%initialized%,0

#temp variables used for different calculation
%temp%,
%dice%,
%damage%,

# Create a single NPC as defined in Parameters
:Start
1,[~hp_%hp%=%damage%]

# Makes roll support possible call AFTER tables are set up
:initialized
1,|initialized=1|

:hp
1,|hp={LastRoll~}|
# do not show Input List on initialization of table
_{IIf~%initialized%=1 ?
_|temp={InputText~0,Damage in hp (heal by using negative values)}|
_{IIf~{IsNumeric~%temp%}=1 ?|damage={Calc~%damage%+%temp%}|}
_|initialized=2|
_[~hp_%hp%=%damage%]
_:
_{IIf~%initialized%=2 ?|initialized=1|}
_|temp={Calc~%hp%-%damage%}|
_{IIf~%damage%=0 ?%hp%:%temp% / %hp%}
_{IIf~%temp%<=0 ? (Dead):{IIf~%temp%>%hp% ? (extra HP)}}
_}

:hp_1
1,|damage={LastRoll~}|
_[hp=1]
?
:hp_2
1,|damage={LastRoll~}|
_[hp=2]
?
:hp_3
1,|damage={LastRoll~}|
_[hp=3]
?
:hp_4
1,|damage={LastRoll~}|
_[hp=4]
?
:hp_5
1,|damage={LastRoll~}|
_[hp=5]
?
:hp_6
1,|damage={LastRoll~}|
_[hp=6]

[..] omitted hp_7 - hp_100


Re: ERROR Generate function calling Generate again #function #error

 

I don't think this is a boundary issue, it appears to be a bug (though why it took so long to manifest, I don't know). As the two of you have found, the "=%var2%" seems to be the cause of the issue (it should work as written, but obviously that's not the case).

Though I'm not sure what you mean when you say you need to pass the result to the group to "store state"; variables in a table are global, so you don't need to pass anything to a group, you can just store what you need in a variable.



©\©\©\©\©\©\©\ Original Message ©\©\©\©\©\©\©\
On Monday, May 10, 2021 3:35 PM, <klaas.reineke@...> wrote:

Yeah this fixes it, but then it does not help any more. I need the parameter/roll result passing to the Group as way to store a state. If I omit the %var2% it does not help. Here a more complex example to show what is needed. It is working from the state but the Error mesage is messing up the result window.

The code below is preserving the state that is changed for each call. The display text remains the same, i.e. "1". The group "other_1" can perform some calculation display the result via Msg or InputText and preserve state with the new call to Generate. If you click the 1 more the once the message within the messagebox does change correctly. I just need Tablesmith to not write an error for working code. I guess this is the boundary of the design of Generate.

%var1%,
%var2%,

:Start
1,|var1=1|
_|var2=2|
_{Generate~0,%var1%,~other_%var1%=%var2%}

:other_1
1,|var1=1|
_|var2={LastRoll~}|
_{Msg~%var2%}
_|var2+1|
_{Generate~0,%var1%,~other_%var1%=%var2%}


Re: ERROR Generate function calling Generate again #function #error

 

Yeah this fixes it, but then it does not help any more. I need the parameter/roll result passing to the Group as way to store a state. If I omit the %var2% it does not help. Here a more complex example to show what is needed. It is working from the state but the Error mesage is messing up the result window.

The code below is preserving the state that is changed for each call. The display text remains the same, i.e. "1". The group "other_1" can perform some calculation display the result via Msg or InputText and preserve state with the new call to Generate. If you click the 1 more the once the message within the messagebox does change correctly. I just need Tablesmith to not write an error for working code. I guess this is the boundary of the design of Generate.

%var1%,
%var2%,

:Start
1,|var1=1|
_|var2=2|
_{Generate~0,%var1%,~other_%var1%=%var2%}

:other_1
1,|var1=1|
_|var2={LastRoll~}|
_{Msg~%var2%}
_|var2+1|
_{Generate~0,%var1%,~other_%var1%=%var2%}


Re: ERROR Generate function calling Generate again #function #error

 

Ok, went back to your original code and simply removing "=%var2%" from the Generate lines gets rid of the error.


Re: ERROR Generate function calling Generate again #function #error

 

Ok, so I was playing around with your code that you posted
and the following is not giving any errors

The biggest changes I made was to remove the "=%var2%" from the Generate statements, and adding the second entry to the table (so that there was something to actually call, as you code was telling it to select something that was not there...)

Not sure why it was giving errors, but this code did not give one.Will play some more...

%var1%,
%var2%,
?
:Start
1,|var1=1|
_|var2=2|
_{Generate~0,%var1%,~other_%var1%}
?
:other_1
1,|var1=1|
_|var2={LastRoll~}|
_{Msg~%var2%}
_{Generate~0,%var1%,~other_%var1%}
2,|var1=1|
_|var2={LastRoll~}|
_{Msg~{LastRoll~}}
_{Generate~0,%var1%,~other_%var1%}


Re: ERROR Generate function calling Generate again #function #error

 

My current fix is to use Rerollable GroupCalls [~other_1] adding an If checking if the table is initialized around all Msg or InputLists. By this the table is displayed completely then I call initialize and then the roll stuff is working.

I don't like the second call neded, but it does work.

Example:
:other_1
1,|var1=1|
_{If~%initialized%=1?
_{Msg~whatever}
_}
_%var1%


ERROR Generate function calling Generate again #function #error

 

Hi there,

I cannot figure it out. I am using {Generate~0} to create a link that does some calculations and shows the result within a {InputList~} and a {Msg~} and then creates the same {Generate~0} again. The idea is to have a simple to-hit and then damage roll that can be clicked directly within tablesmith from a generated NPC or monster to track a whole battle.

Tablesmith is working and it is possible to provide and preserve two arguments with this type of calls. But it always generates a strange error, I cannot fix. Output:

***ERROR on line -1 of table '~test' - Table '~test' not found in call to 'Reset'. ***? <== The strange error, appearing after link from {Generate~} is clicked
1???? <== the clickable link generated from the testcode below. It is still clickable and the error above is repeated for each click


A simplified sample table to demonstrate the problem is shown below.

Has anybody a suggestion if this is possible and the error fixable, or is it not possible to use tablesmith for this type of recursive calls?

Best Klaas

%var1%,
%var2%,

:Start
1,|var1=1|
_|var2=2|
_{Generate~0,%var1%,~other_%var1%=%var2%}

:other_1
1,|var1=1|
_|var2={LastRoll~}|
_{Msg~%var2%}
_{Generate~0,%var1%,~other_%var1%=%var2%}


Re: Timestamp

 

There's no functionality in Tablesmith for timestamps, but you use a little Javascript and HTML to display a time.



©\©\©\©\©\©\©\ Original Message ©\©\©\©\©\©\©\
On Monday, May 3, 2021 12:16 AM, KingsTears <CatherineAKeene@...> wrote:

Is it possible to put a timestamp in the table result?? I have some tables that return a yes/no/maybe and find myself unsure if a new result was rolled or if I have gotten the same result again.? If not this solution, does anyone have a suggestion to the problem of wondering if I clicked it?


Timestamp

 

Is it possible to put a timestamp in the table result?? I have some tables that return a yes/no/maybe and find myself unsure if a new result was rolled or if I have gotten the same result again.? If not this solution, does anyone have a suggestion to the problem of wondering if I clicked it?


Re: Maximum size of a group or table

 

There's likely physical limitations based on things like RAM, but I'm not aware of any particular limits in TS, especially with group or table size.

You can run into issues if you have too much recursiveness - i.e.; a table calling itself repeatedly. I recall that's come up once or twice over the years, but that involved a table calling itself thousands of times or something of that nature.




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

On Sunday, May 2, 2021 8:52 AM, ErolB1 via groups.io <ErolB1@...> wrote:

What is the maximum size of a group or a table that Tablesmith can handle without choking?
I have some name lists with tens of thousands of names. Will Tablesmith be able to handle that, or will I need to break the lists down into smaller chunks?


Re: Maximum size of a group or table

 

I have a name generator which is used tenth of tables names, the biggest one hold 30.000+ names without problem

Le 02/05/2021 ¨¤ 15:52, ErolB1 via groups.io a ¨¦crit?:
What is the maximum size of a group or a table that Tablesmith can handle without choking?
I have some name lists with tens of thousands of names. Will Tablesmith be able to handle that, or will I need to break the lists down into smaller chunks?




Maximum size of a group or table

 

What is the maximum size of a group or a table that Tablesmith can handle without choking?
I have some name lists with tens of thousands of names. Will Tablesmith be able to handle that, or will I need to break the lists down into smaller chunks?


Re: DataSet Oddity

 

I should have been more clear. By "bunch of DSSet functions" I meant just the ones on the one branch of the If function.

I would have rewritten [AddItem} as

:AddItem
1, {Split~Result,"`",Item,QTY,XP,GP,Notes}
_|SavedIndex={DSFind~Treasure,0,Item=%Item%}|
_{If~%SavedIndex%<0?
_{DSAddNR~Treasure,Item,%Item%,QTY,%QTY%,XP,%XP%,GP,%GP%,Notes,%Notes%}
_|Index+1|/
_{DSSet~Treasure,%SavedIndex%,
_QTY,{Calc~{DSGet~Treasure,%SavedIndex%,QTY}+%QTY%}
_GP,{Calc~{DSGet~Treasure,%SavedIndex%,GP}+%GP%}
_XP,{Calc~{DSGet~Treasure,%SavedIndex%,XP}+%XP%}}

With just the one {DSAddNR} function if adding a new item and just the one {DSSet} function if updating the QTY, GP, and XP of an existing item


Erol K. Bayburt
ErolB1@...

On 4/29/2021 9:26 AM, Otaku Smurf wrote:
[Edited Message Follows]
Thanks.? I knew it had to be something I just wasn't seeing.
As for the {DSSet} functions, I am checking if what I am adding already exists, if it does, increase?the quantity, xp and gp.? If not, add the item, qty, xp, gp, and notes.
On Thu, Apr 29, 2021 at 3:45 AM ErolB1 via groups.io <> <ErolB1@... <mailto:[email protected]>> wrote:
The problem is in the [Display] group. In particular in the section
_|GP={DSGet~Treasure,%Index%,GP}|
_<td align="left" valign="top">{If~%XP%=0?{Color~White,__}/%XP%}</td>
_|XP={DSGet~Treasure,%Index%,XP}|
_<td align="left" valign="top">{If~%GP%=0?{Color~White,__}/%GP%}</td>
you've swapped GP and XP in the {DSGet} functions. It needs to be
_|XP={DSGet~Treasure,%Index%,XP}|
_<td align="left" valign="top">{If~%XP%=0?{Color~White,__}/%XP%}</td>
_|GP={DSGet~Treasure,%Index%,GP}|
_<td align="left" valign="top">{If~%GP%=0?{Color~White,__}/%GP%}</td>
As an aside, is there a reason you're using
{DSAddNR~Treasure} plus a bunch of {DSSet} functions
rather than
{DSAddNR~Treasure,Item,%Item%,QTY,%QTY%,XP,%XP%,GP,%GP%,Notes,%Notes%}
?
Erol K. Bayburt
ErolB1@... <mailto:ErolB1@...>
On 4/28/2021 8:28 PM, Otaku Smurf wrote:
> I have just noticed that my Datasets are either not setting
correctly,
> or not getting correctly.? Most likely, I have something off in
my code
> and can't see it.
>
> I've put in an "error" check.? So, the 1st 3 lines are what is being
> returned for addition to the dataset.? The table is the output
and for
> some reason, "Experience" is offset by 1.
>
> -1; 1; (A1)Scroll of 2 Wizard Spells;1;0;0
> -1;2;Protection from Undead;1;1500;7500
> -1;3; Potion of Extra-Healing;1;400;800
> Treasure? ? ? Quantity? ? ? ? Experience? ? ? Gold Value? ? ? Notes
> (A1)Scroll of 2 Wizard Spells? ? ? ? ?1? ? ? ?400? ? ?__
(L4) Tenser's Flaming Blade (GA)
> (L2) Wings (7S)
> Protection from Undead? ? ? ? 1? ? ? ?__? ? ? 7500? ? __
> Potion of Extra-Healing? ? ? ?1? ? ? ?1500? ? 800? ? ?__
>
>
> I've spent 2 days trying to figure this out on my own, and I am
at a loss.
>
> Thanks.
>


Re: DataSet Oddity

 

The problem is in the [Display] group. In particular in the section

_|GP={DSGet~Treasure,%Index%,GP}|
_<td align="left" valign="top">{If~%XP%=0?{Color~White,__}/%XP%}</td>
_|XP={DSGet~Treasure,%Index%,XP}|
_<td align="left" valign="top">{If~%GP%=0?{Color~White,__}/%GP%}</td>

you've swapped GP and XP in the {DSGet} functions. It needs to be

_|XP={DSGet~Treasure,%Index%,XP}|
_<td align="left" valign="top">{If~%XP%=0?{Color~White,__}/%XP%}</td>
_|GP={DSGet~Treasure,%Index%,GP}|
_<td align="left" valign="top">{If~%GP%=0?{Color~White,__}/%GP%}</td>

As an aside, is there a reason you're using
{DSAddNR~Treasure} plus a bunch of {DSSet} functions

rather than
{DSAddNR~Treasure,Item,%Item%,QTY,%QTY%,XP,%XP%,GP,%GP%,Notes,%Notes%}
?

Erol K. Bayburt
ErolB1@...

On 4/28/2021 8:28 PM, Otaku Smurf wrote:
I have just noticed that my Datasets are either not setting correctly, or not getting correctly.? Most likely, I have something off in my code and can't see it.
I've put in an "error" check.? So, the 1st 3 lines are what is being returned for addition to the dataset.? The table is the output and for some reason, "Experience" is offset by 1.
-1; 1; (A1)Scroll of 2 Wizard Spells;1;0;0
-1;2;Protection from Undead;1;1500;7500
-1;3; Potion of Extra-Healing;1;400;800
Treasure Quantity Experience Gold Value Notes
(A1)Scroll of 2 Wizard Spells 1 400 __ (L4) Tenser's Flaming Blade (GA)
(L2) Wings (7S)
Protection from Undead 1 __ 7500 __
Potion of Extra-Healing 1 1500 800 __
I've spent 2 days trying to figure this out on my own, and I am at a loss.
Thanks.


DataSet Oddity

 

I have just noticed that my Datasets are either not setting correctly, or not getting correctly.? Most likely, I have something off in my code and can't see it.

I've put in an "error" check.? So, the 1st 3 lines are what is being returned for addition to the dataset.? The table is the output and for some reason, "Experience" is offset by 1.

-1; 1; (A1)Scroll of 2 Wizard Spells;1;0;0
-1;2;Protection from Undead;1;1500;7500
-1;3; Potion of Extra-Healing;1;400;800
Treasure Quantity Experience Gold Value Notes
(A1)Scroll of 2 Wizard Spells 1 400 __ (L4) Tenser's Flaming Blade (GA)
(L2) Wings (7S)
Protection from Undead 1 __ 7500 __
Potion of Extra-Healing 1 1500 800 __

I've spent 2 days trying to figure this out on my own, and I am at a loss.??

Thanks.


Re: Mysterious Error #error

 

Thanks.

I have it in a different folder "Spells", so I thought that was how it was supposed to be.


Re: Mysterious Error #error

 

To call the table Wizard1.tab, you need the line

:Start
1,[Wizard1.Start]

The line you're using is calling Spells.tab, and rolling on the group [Wizard1] in the Spell.tab table.

Erol K. Bayburt
ErolB1@...

On 4/24/2021 2:43 AM, Otaku Smurf wrote:
I am running into an odd error.
Summon Monster I (
***ERROR on line 891 of table 'Spells' - Group 'Creatures.SumMon1' not found. ***
)
Here is the crux.? I can roll on the attached table and never get an error - there are not 891 lines in that table either.
For testing, I am calling it from another table (in another folder) with a simple:
:Start
1, [Spells.Wizard1]
What am I missing?