It looks like you're new here. If you want to get involved, click one of these buttons!
I need help getting an external table call to work. It needs to run before anything else because it will define the base stats for attributes, characteristics and a couple helper variables.
I have two prompts, Prompt 2 is species. The only choices right now are Human and Nonhuman.
My pathway and filename is correct.
It calls out to an external table 'statset'. Statset is supposed to do a dictionary call to 'setstats'. Setstats has about a dozen set: variables for attributes and stats.
table: statset
[#{$Prompt2} setstats]
table: setstats
Type: Dictionary
Human:[@humanstats]
Nonhuman:[@nonhumanstats]
table: humanstats
set: ADSCAT = Mundane
set: ENVIRON = Land-based
set: ST = {10 + [@attributemods]}
set: DX = {10 + [@attributemods]}
set: IQ = {10 + [@attributemods]}
set: HT = {10 + [@attributemods]}
set: HP = {[@secondarymods] + {$ST} + 0}
set: WILL = {[@secondarymods] + {$IQ} + 0}
set: PER = {[@secondarymods] + {$IQ} + 0}
set: FP = {[@secondarymods] + {$HT} + 0}
set: BS = {!(({$HT} + {$DX}) + {1d17-9}) / 4 }
set: BM = {! floor ({$BS})}
set: BL = [#{!{$ST} - 6} basiclift]
set: TL = {$prompt1}
set: DOD = {!floor ({$BS} + 3)}
set: SWING = [#{!{$ST}} swing]
set: THRUST = [#{!{$ST}} thrust]
set: Parry = {!floor( ({$DX} / 2) + 3)}
set: DEF = 0
set: contacts = {1d4-1}
set: INIT = {!((({$BS} * 4)-{$DX})-{$HT})+{3d6}}
Nonhuman stats are exactly the same right except the ST/DX/IQ/HT bases are 1 not 10 until I get it working.
I've tried -
Nothing has worked for me.
I don't get missings or invalid expressions. So I think it's working to a point, it's just not returning the values to the original generator and using the values.
Comments
Oh, and I've also tried using it in the parent generator file. Still no luck with anything unless I pull them out of a table and hard code in
set: ST = some math
set: DX = some math
so on and so forth....
I may be mistaken, but I do not believe that you can pass {$Prompt2} to an external generator.
I'd say that you would have to use something like
Define: VariableA={$Prompt2}
in the main generator.
And then in the external called generator use something like:
table: statset
[#{VariableA} setstats]
I've done this somewhere before, I just haven't found the example yet. I'll keep looking. But at first glance, it seems to me to be a problem passing {$Prompt2} from the original generator to the external one.
No, it passes to the external generator. If I put {Prompt2} outside of the table brackets, it will display where the table doesn't run.
Unless I'm misunderstanding.
Main Generator:
External:
Output:
&(missing)HumanMyrtis Whitlow
Nationality: American
Prompt2 should be human, which is right in the middle. I don't understand why it's saying humanstats is missing, though.
Possibly because there are no table lines in humanstats. You only have lines with Set, so it expects at least one line of table data after that.
Ohhh...yeah, that would be likely if it's a requirement of a table. Back to the worktable...
And, that doesn't seem to be it. I tried returning a constant, an inline variable assignment and another table call. None of them pulled data back to the main generator beyond the statset table.
I know that it's getting to the statset table and returning information from it.
It doesn't seem to see anything relating to the Dictionary table call or after.
I changed it to a Lookup table, set VariableA =1 and replaced Human: and Nonhuman with 1 and 2.
The table is no longer missing, but it still isn't returning anything.
I think that JDale means there is a problem with humanstats not being a complete table... it doesn't return anything.
I put it all together as you have but made humanstats look like this:
I get it to return a "Mundane Hello". So it is making it all the way to that table. No "missings" when I do that.
I did take a short cut: I didn't actually make a prompt for Human in my test generator... I just instead used this in my main generator to quickly force the dictionary lookup in the external generator:
define: VariableA=Human
I can't imaging that set shortcut made a difference, but to make sure, let me add 2 prompts and see that {@prompt2} gets me there as well.
Here's the two test generators, with just a couple extra weird bits (constant strings) so that I can see what is processing and what is not. Looks like it's all processing correctly.
The main generator:
The external generator:
Alright, I don't think it's going to do what I want it to with this method. My intent, is to make an external table for stats based on race. The stats are all set: functions that I was trying to move external so I could just select a species from a prompt instead of having lots of different generators. I don't really have anything to return other than the set functions for the stats with this part.
Originally, I wanted something like:
I intended to be able to see everything across and compare humans and non-humans basically. I couldn't get that to work, so I moved to the subtables.
So, is there a better way to achieve my intent?
Try putting another ] at the end of the nonhuman line. Right now it has one of these [ before environ and land but not the ending for both of them
Nope, not that either. If I use a Dictionary table it can't find it. I keep getting a (missing) error, even copying/pasting in Levendor's solution above. (missing) VHuman is the output.
If I switch to a Lookup table and just set VarialbeA equal to 1 or 2, it finds it, but doesn't return anything. With Levendor's, it finds the table and returns VHuman. Nothing else. No, Mundane Hello.
I'm lost. I have a bunch of other external tables calling and returning info. I just can't get this part to work. Unless maybe there's a limit to external table calls? But it would go in the order of operation, I would think, not the order that it was typed into the code.
I'm going to post the two pieces of code. Feel free to comb through it.
Actual NPC Generator file - some of it is ugly because of using & n b s p ; and the like to format the output the way I want to see it.
And, it's long. Really, really long. Too long in fact. I had to stop after the stats subtable. To credit though, the rest beyond that seems to be working perfectly (other than missing the base stats for the NPC).
Setstats external table. Cleaner, and shorter because I haven't put much effort into building it out until I get it working.
So, I started trying to do something similar (maybe?). I also gave up. But I did get it to do a few things. I had "generators" that were really just a bunch of database files. One for a particular PC and its ability stats, one for another PC, one for Orc, one for Goblin, etc.
The main generator would prompt for participant 1 and participant 2, and then reconcile combat. It looked up the pertinent attack and defense stats, rolled to hit dice, etc. System was Dragon Quest.
It did OK grabbing the stats and using them. The rest of combat reconciliation was too complex to bother with further development.
I will make sure those things still work, then I will post here for you to see if they help at all.
But first, it seems to me that it's a bit odd where to place those "database" fixed generator files. You probably already have this part done right, otherwise you wouldn't be getting as far as you have. But, to be sure... You use a USE command of
Use: nbos\GURPS\AttributeMods.ipt
Now, this file - AttributeMods.ipt - must be in your /Inspiration Pad Pro/Common/nbos/GURPS folder. The first two bits of that path are key. A default IPP installation will only look for USE: ipt files in that Common folder, not in the Generators folder. It's an important distinction, because (at least for me) I cannot easily edit or directly save files to that folder. I have to drag and drop copies from Generators to Common after writing the file.Again, I expect you've got all that correct, or you wouldn't even be getting close with this. But figured it can't hurt checking the file locations. And, I believe you can redirect things, but this is how the basic program install lays it out.
Next I'll test out the Dragon Quest example and see if I can post something that at least looks up attribute values and uses them in a main generator.
The main file, placed in Generators is Test-Combat.ipt
The data files (i.e. the pc/npc/monster stat blocks) are each of the other attached files, placed in /common/nbos/DQ.
In this, the 9 attribute stats are "looked up" from the proper .ipt file based on the user's prompt response. In the case of Orc.ipt, the attributes are calculated in the outside table and then returned to the main generator. They are pulled into the main generator and used (in calculations of other stats) or simply displayed as output.
There are a lot of weapon table in the main generator, but the character sheets do not include that data, so that part is not functional and returns errors.
I hope this help demonstrates using a user prompt to lookup data from the correct "Library File" and return it for use in the main generator. Beyond that, I'm not too sure what is good for.
And... DQ is copywrite, blah, blah, blah... not for public use, blah, blah, blah. And someone else probably started (or gave me the idea for ) this generator, so credits to them.
The files are attached here.
Thanks, Levendor, I'll start taking a look and see if I can spot any differences.
And yeah, I've been pretty careful about my pathways, but I'll double check them as well. I do have the main common folder with a subfolder for each of my games. I might have mistyped something somewhere.
Levendor, I did the original DragonQuest generator, I’m glad you are making use of it.
Thanks for that Stephen_Peto. I'm not real careful about putting credit lines in my generators, since I only use them personally. But, I'll be sure to add a line to give you credit for starting up the generator. It's a real helpful thing, whether for DQ, or just breaking down how to make a complex generator!