Howdy, Stranger!

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

Trouble setting Variable

I have the following code, and while $SpellLevel gets set as a variable. It seems since I am using [@ClassMid] and [@ClassHigh] it is not setting the variable. Is there something I am missing or doing wrong?

Table: SpellProxy
[@Level]Spell Level: {$SpellLevel}\n[when]{$SpellLevel}>5[do]{$CasterClass==[@ClassHigh]}[else]{!CasterClass==[@ClassMid]}[end][@RandomSpell]

Table: Level
[when]{$prompt1}=Random[do]{!SpellLevel=={1d10-1}}[else]{!SpellLevel=={$prompt1}}[end]

Table: RandomSpell
Scroll of [!{$NumSpells} Spells{$CasterClass}Level{$SpellLevel} >> sort >> implode]

Table: ClassMid
Roll: 1d120
01-10:Druid
11-25:Cleric
26-45:Artificer
46-75:Arcane
76-90:Bard
91-100:Warlock
101-110:Paladin
111-120:Ranger

Table: ClassHigh
01-10:Druid
11-25:Cleric
26-55:Arcane
56-70:Bard
71-80:Warlock

Comments

  • Try this:

    Change the do and else expressions from {$CasterClass==[@ClassHigh]} to {CasterClass=="[@ClassHigh]"}

    I used {1d6] for the NumSpells call. And - it is important to remove the deck pick "!" from Scroll of [!{$NumSpells}. That really messes up the whole RandomSpell table.

    You missed a Roll: 1d80 parameter in Table: ClassHigh

    Here's a working version:

    Prompt: Spell Level {Random|1|2|3|4|5|6|7|8|9} Random
    
    Table: SpellProxy
    [@Level]Spell Level: {$SpellLevel}\n[when]{$SpellLevel}>5 [do]{CasterClass=="[@ClassHigh]"}[else]{CasterClass=="[@ClassMid]"}[end][@RandomSpell]
    
    Table: Level
    [when]{$prompt1}=Random[do]{!SpellLevel=={1d10-1}}[else]{!SpellLevel=={$prompt1}}[end]
    
    Table: RandomSpell
    Scroll of [{1d6} Spells {$CasterClass} Level {$SpellLevel} >> sort >> implode]
    
    Table: ClassMid
    Roll: 1d120
    01-10:Druid 
    11-25:Cleric 
    26-45:Artificer 
    46-75:Arcane 
    76-90:Bard 
    91-100:Warlock 
    101-110:Paladin 
    111-120:Ranger
    
    Table: ClassHigh
    Roll: 1d80
    01-10:Druid 
    11-25:Cleric 
    26-55:Arcane 
    56-70:Bard 
    71-80:Warlock
    

    Good luck!

  • Here's sample output:

  • Awesome thank you very much for this.

Leave a Comment