Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old January 15th, 2014, 04:48 AM
Well, I've gotten the language portion of this settled. An can even force an automatic language to change based on what race (bootstrap conditions).

Here is the next part, and for that I just need a bit of direction. What code may have an example.

I want to create drop down list of the available feats that changes based on the heroes race.

I can add feats to that list with Custom Expressions. thingid.fXXX|thingid.fXXX. But I cannot figure out how to limit the choices based on what race is selected. Nor can I seem to figure out how add a feat based on the selection.

I've looked at Aberrant Blood from LoM, and Draconic Heritage from Complete Arcane for a hint, and I have gotten a lot of information from both, but not quite what I'm looking for.

I think I could probably do it using the method from Aberrant Blood if I created a special ability for each feat, (which I'd rather not do).

The question I have is,
First: Is it even possible to have the choice of feats listed in the drop down menu change BASED on what race you have selected.

Two: How does one connect the choice of feat with bootstrapping the feat to the character.
TobyFox2002 is offline   #31 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old January 15th, 2014, 05:18 AM
Quote:
Originally Posted by TobyFox2002 View Post
The question I have is,
First: Is it even possible to have the choice of feats listed in the drop down menu change BASED on what race you have selected.
Yes. You can modify the custom expression with a script, and can use if statements that search for race. For example:

Code:
if (race1 <> 0) then
 field[usrCandid1].text = "thingid.f001|thingid.f002"
elseif (race2 <> 0) then
 field[usrCandid1].text = "thingid.f002|thingid.f003"
endif
An example of this is found in the Dungeonscape file for the various custom abilities named "Arcane Dilletante (spell level)". Note that usrCandid1 is the name of the field for Custom Abilities. It's probably different for class specials. If you need to find out what it is, right-click on the class special in your portfolio, and select "Show Debug Fields", then look for the expression you entered.

Two: How does one connect the choice of feat with bootstrapping the feat to the character.[/QUOTE]

This is trickier. You can't bootstrap through a script, so the only way to really do this is to bootstrap all of the feats with a conditional. This probably isn't optimal if you have a lot of feats involved. If it's only a few, then it could make sense. My suggestion in this case would be to use the selection to modify the field[Value], and then use that field as your bootstrap condition...unless you are already using that field for something else.
Sendric is online now   #32 Reply With Quote
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old January 15th, 2014, 08:54 AM
Quote:
Originally Posted by Sendric View Post
Two: How does one connect the choice of feat with bootstrapping the feat to the character.
This is trickier. You can't bootstrap through a script, so the only way to really do this is to bootstrap all of the feats with a conditional. This probably isn't optimal if you have a lot of feats involved. If it's only a few, then it could make sense. My suggestion in this case would be to use the selection to modify the field[Value], and then use that field as your bootstrap condition...unless you are already using that field for something else.[/QUOTE]

Bootstrapping the feats with a conditional, not sure how that work when each race has their own choice of feats for any given region, there is some overlap but not much.

Wouldn't bootstraping a feat with a condition to a region would ALWAYS attach that single feat to the region based on the condition regardless of the number of possible feat choices for that race/region combination, Correct?
TobyFox2002 is offline   #33 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old January 15th, 2014, 09:37 AM
Quote:
Originally Posted by TobyFox2002 View Post
Bootstrapping the feats with a conditional, not sure how that work when each race has their own choice of feats for any given region, there is some overlap but not much.

Wouldn't bootstraping a feat with a condition to a region would ALWAYS attach that single feat to the region based on the condition regardless of the number of possible feat choices for that race/region combination, Correct?
Yes, which is why I'm not suggesting you do that. Instead, I would use the choice of feat to set the value field to a number, then use that value as the basis of the conditional. For instance:

if (feat1) then
value = 1
elseif (feat2) then
value = 2
endif

conditional for feat1:

fieldval:Value = 1

Of course, pulling the id of the chosen string and using that to set the value is a bit tricky. You would need to pull the id with something like this:

Code:
feat = field[usrChosen1].chosen.idstring
Then you need a way to compare it. I'm not sure if you would have to set up a string variable for each feat or not, but let's say you do.

Code:
feat1 = "thingid.xxx"

if (feat = feat1) then
 value = 1)
endif
Like I said before though, this works better with fewer feats.
Sendric is online now   #34 Reply With Quote
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old January 15th, 2014, 11:10 AM
Quote:
Originally Posted by Sendric View Post
Yes, which is why I'm not suggesting you do that. Instead, I would use the choice of feat to set the value field to a number, then use that value as the basis of the conditional. For instance:

if (feat1) then
value = 1
elseif (feat2) then
value = 2
endif

conditional for feat1:

fieldval:Value = 1

Of course, pulling the id of the chosen string and using that to set the value is a bit tricky. You would need to pull the id with something like this:

Code:
feat = field[usrChosen1].chosen.idstring
Then you need a way to compare it. I'm not sure if you would have to set up a string variable for each feat or not, but let's say you do.

Code:
feat1 = "thingid.xxx"

if (feat = feat1) then
 value = 1)
endif
Like I said before though, this works better with fewer feats.
Well I first have to be able to know what it is I'm compairing, and as it stands I havent a clue how to take the selection I've chosen and put it into an if statement to compare.

With out that I cant do any variable assignments.

Trait: Region Aglarond
Post-levels/10000
Code:
if (hero.tagis[Race.Human] + hero.tagis[Race.HalfElf] + hero.tagis[HasTrait.trPFAdopte] <> 0) then
  perform hero.assign[Language.lChessenta]
  perform hero.assign[Language.lDamaran]
  perform hero.assign[Language.lDraconic]
  perform hero.assign[Language.lElven]
  perform hero.assign[Language.lMulhorand]
  perform hero.assign[Language.lOrc]
  perform hero.assign[Language.lSylvan]
  perform hero.assign[Language.lUntheric]
endif

if (hero.tagis[Race.Human] <> 0) then
 field[ftCandExpr].text = "thingid.fTreetop|thingid.fRegDisc"
elseif (hero.tagis[Race.HalfElf] <> 0) then
 field[ftCandExpr].text = "thingid.fEndure"
endif

if (field[fChosen].chosen.tagis[thingid.fTreetop] <> 0) then
xxx

endif
In short, I haven't a clue how to pull the choice from the drop down into a script and compare it. I've looked at several examples and they don't have anything resembling what I have.
TobyFox2002 is offline   #35 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old January 15th, 2014, 11:39 AM
Quote:
Originally Posted by TobyFox2002 View Post
In short, I haven't a clue how to pull the choice from the drop down into a script and compare it. I've looked at several examples and they don't have anything resembling what I have.
Ok. I took your code above and inserted into the file you sent me. Here is what I came up with:

In the first eval script (First/1000), I added your code for ftCandExpr:

Code:
~ Add bonus feat slot, so the user can add their choice of regional feat.  Would like to add a dropdown to the trait to choose based on race, but that might be a nightmare.

herofield[tFeats].value += 1

if (hero.tagis[Race.Human] <> 0) then
 field[ftCandExpr].text = "thingid.fRegTretop|thingid.fRegDisc"
elseif (hero.tagis[Race.HalfElf] <> 0) then
 field[ftCandExpr].text = "thingid.fEndure"
endif
I removed that code from the other eval script run at Post-Levels/10000 so that script is only doing languages now.

I then made a new script at First/1001:

Code:
if (field[fChosen].chosen.tagis[thingid.fRegTretop] <> 0) then
 field[hTotal].value = 1

endif
Note: in the file you sent me, the id for Treetopper is fRegTretop.

And then bootstrapped Treetopper with the following conditional at the default First/10000:

Code:
fieldval:hTotal = 1
When I re-compiled and chose Treetopper, the feat appeared in the feats list, and disappeared when I de-selected it, so it seems to be working.

I also perused the Campaign Setting book real quick to get a better understanding of what you are trying to do. Did they change things around at some point? I only ask because looking at the Campaign Setting there doesn't seem to be a need to change the selection list based on race. Also, I noticed that the list of feats available for Algarond is Discipline, Luck of Heroes and Treetopper. It appears to me that anyone from that region can select any of those regardless of race. Am I wrong?
Sendric is online now   #36 Reply With Quote
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old January 15th, 2014, 12:22 PM
I threw Endurance in there so I would know that it was working, ie, would give me a different result for the two different races.

And that works perfectly, I know have a model for all of the regions, nasty work this is. I can see why it hasn't been done.
TobyFox2002 is offline   #37 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old January 16th, 2014, 04:41 AM
Quote:
Originally Posted by TobyFox2002 View Post
I threw Endurance in there so I would know that it was working, ie, would give me a different result for the two different races.

And that works perfectly, I know have a model for all of the regions, nasty work this is. I can see why it hasn't been done.
Makes sense. Glad it worked for you. Are we still certain that you need to make different feats available for different races?
Sendric is online now   #38 Reply With Quote
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old January 16th, 2014, 06:20 PM
Quote:
Originally Posted by Sendric View Post
Makes sense. Glad it worked for you. Are we still certain that you need to make different feats available for different races?
Quite Certain. Some regions have only one race that can be chosen, but most have more than one. Most races have one or two bonus feats in common but not all of them.

I finished entering the feats for Players Guide to Faerun yesterday, so I'm quite familiar with them and how they interact with regions. I was out for most of the day. But already I have started connecting the regions with them. It takes nearly 10mins for each region... With 81 regions (and I think I am missing some). I am beginning to realize what you meant by, "This probably isn't optimal if you have a lot of feats involved." a few days ago.

However, it will be all the more satisfying when it is complete. I predict I should have it all done within a week. Not including races such as, Planetouched, Gnoll, Centaur, Oroc, Tanaruk, as they are either not entered in yet or do not have tags for races.

I am hoping I can find a way to speed the process up. The time consuming process is matching the thingid to the list.
TobyFox2002 is offline   #39 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,144

Old January 17th, 2014, 04:34 AM
Quote:
Originally Posted by TobyFox2002 View Post
Quite Certain. Some regions have only one race that can be chosen, but most have more than one. Most races have one or two bonus feats in common but not all of them.

I finished entering the feats for Players Guide to Faerun yesterday, so I'm quite familiar with them and how they interact with regions. I was out for most of the day. But already I have started connecting the regions with them. It takes nearly 10mins for each region... With 81 regions (and I think I am missing some). I am beginning to realize what you meant by, "This probably isn't optimal if you have a lot of feats involved." a few days ago.

However, it will be all the more satisfying when it is complete. I predict I should have it all done within a week. Not including races such as, Planetouched, Gnoll, Centaur, Oroc, Tanaruk, as they are either not entered in yet or do not have tags for races.

I am hoping I can find a way to speed the process up. The time consuming process is matching the thingid to the list.
Yea. My Tome of Battle project is also time-consuming so I feel your pain.

Gnoll should have the race tag already. The Race.Centaur tag exists but oddly enough the Centaur race wasn't applying it. I don't see the other races in the community set. If you want me to send you the most recent MM1 file, let me know. If there are other races I can apply tags to, let me know that as well.
Sendric is online now   #40 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:32 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.