It looks like you're new here. If you want to get involved, click one of these buttons!
Define: Fighter = $Fighter [when][@DwarfCLASS]=Fighter[do][@DwarfFighter][end] Table: DwarfCLASS 30: Fighter 5: Cleric 25: Barbarian 2: Rogue Table: DwarfFighter Class Fighter chosen Table: DwarfCleric Class Cleric chosen Table: Dwarf Barbarian CLass Barbarian chosen Table: DwarfRogue Class Rogue chosen
Comments
To do it in a table row, you can also use (assuming RandomClass was a valid table)
To suppress output so nothing is displayed but the variable is assigned, use ==
Expressions nest, so you can get rid of the [when] and use the variable name as the table name
I changed the code to try what you suggested but all that reports are (missing) prompts.
Also, I see where 2 conditions can be checked for, using when>>do>>else>>end code but what if I wanted to check for more than 2? [when]{condition}[do]{script}[else][else][else][end] ???
...you should be fine.
To your other question, as long as all the conditions are mutually exclusive, you can just link together a bunch of [when] statements, like this:
[when]{ClassName}=DwarfFighter[do]stuff[end]& (the ampersands make IPP think it's all on one line)
Hope that helps!
Thanks for the feedback lads. I was able to get things working as expected by using and
Thanks for the tip on the ampersand.