Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - d20 System (http://forums.wolflair.com/forumdisplay.php?f=46)
-   -   Adding regions for a Forgotten Realms campaign (http://forums.wolflair.com/showthread.php?t=7095)

Ravencloak August 25th, 2007 05:30 PM

Adding regions for a Forgotten Realms campaign
 
All right, this bit seems really complicated, so I'd appreciate whatever advice/guidance I can get.

I'm prepping HL files for a Forgotten Realms campaign, but they've introduced the concept of character regions. Essentially, the region your character comes from is almost as important as his race. It determines one of the character's bonus languages, the availability of some feats (specific regions are prereqs for some FR feats), and affects some Knowledge skills.

So, how do I build in a new widget so the player can choose from a predefined set of regions? Or, do I need to somehow incorporate this into the races?

Colen August 27th, 2007 06:44 PM

Adding regions for a Forgotten Realms campaign
 
Ravencloak wrote:
>
>
> All right, this bit seems really complicated, so I'd appreciate whatever
> advice/guidance I can get.
>
> I'm prepping HL files for a Forgotten Realms campaign, but they've
> introduced the concept of character regions. Essentially, the region
> your character comes from is almost as important as his race. It
> determines one of the character's bonus languages, the availability of
> some feats (specific regions are prereqs for some FR feats), and affects
> some Knowledge skills.
>
> So, how do I build in a new widget so the player can choose from a
> predefined set of regions? Or, do I need to somehow incorporate this
> into the races?


The easiest way to do this is probably to add a new template (with a +0
level adjustment) for each region. The template can then automatically
add the appropriate language, and be a pre-requisite for appropriate
feats and knowledge skills.


Hope this helps,


--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/

Ravencloak August 28th, 2007 06:52 PM

Thanks, Colen, you've definitely pointed me in the right direction and I see how I can easily bootstrap in automatic languages. However, it's a bit more complicated than that...isn't it always.

They also use these regions to determine which additional bonus languages (beyond those assigned by race) are available to a character. Evidently, in the Forgotten Realms not all languages are available as bonus languages for humans, instead the character's home region determines which languages are available as bonus languages.

So, unless I miss my mark, it looks like I need to learn more about scripting and portals. I think that I need to figure out the name of the portal responsible for allowing bonus language picks and then "enable" the appropriate bonus languages by setting their values to 1.

I'm certain I'll run into more problems along the way :) but for now I haven't got a clue as to how I identify the name of the portal. While I'd greatly appreciate just getting the name of this specific portal, I'd be even happier if you could tell me in general how to go about "finding" the names of portals.

Brian

Colen August 30th, 2007 03:54 PM

Adding regions for a Forgotten Realms campaign
 
Ravencloak wrote:
>
>
> Thanks, Colen, you've definitely pointed me in the right direction and I
> see how I can easily bootstrap in automatic languages. However, it's a
> bit more complicated than that...isn't it always.
>
> They also use these regions to determine which additional bonus
> languages (beyond those assigned by race) are available to a character.
> Evidently, in the Forgotten Realms not all languages are available as
> bonus languages for humans, instead the character's home region
> determines which languages are available as bonus languages.
>
> So, unless I miss my mark, it looks like I need to learn more about
> scripting and portals. I think that I need to figure out the name of the
> portal responsible for allowing bonus language picks and then "enable"
> the appropriate bonus languages by setting their values to 1.
>
> I'm certain I'll run into more problems along the way Smile but for now
> I haven't got a clue as to how I identify the name of the portal. While
> I'd greatly appreciate just getting the name of this specific portal,
> I'd be even happier if you could tell me in general how to go about
> "finding" the names of portals.


I don't think you need to worry about portals for this stuff. Here's
what you'll need to do:

1) Create these 'regional' languages in the editor, and mark them as
"Secret Languages". This will ensure that humans, half-elves, and other
races that can choose "Any" language won't be able to pick them by default.

2) Now, create a script that runs at an early priority, that assigns the
"Language" tags for those languages to the hero.


For example, let's say that "Gnothic" is a regional language that you
want to add. First, you add it as a language with the unique id
"lGnothic", and mark it as a secret language.

Now, on the "Gnothic Native" template, add a script with phase "First"
and priority 10000 that does this:


~ Add the Gnothic language as a possible bonus language
var result as number
result = hero.assign[Language.lGnothic]


This should make the Gnothic language available when that template is
taken - otherwise it will be greyed out.

Hope this helps,

--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/

Ravencloak August 31st, 2007 08:01 AM

Thanks again, Colen. As usual, I was trying to make things more difficult for myself than necessary. ;)

Your solution works beautifully. One more question. Is there a way to combine multiple "bonus languages" into a single script statement? What you suggested above works just fine, I simply need to enter multiple scripts and increment the index value so they aren't seen as redundant. However, it seems like there ought to be a more elegant way to handle assigning multiple bonus languages in one script. Then again, I've been wrong before.

Thanks again, Colen.

Brian

Colen August 31st, 2007 10:37 AM

Adding regions for a Forgotten Realms campaign
 
Ravencloak wrote:
>
>
> Thanks again, Colen. As usual, I was trying to make things more
> difficult for myself than necessary. Wink
>
> Your solution works beautifully. One more question. Is there a way to
> combine multiple "bonus languages" into a single script statement? What
> you suggested above works just fine, I simply need to enter multiple
> scripts and increment the index value so they aren't seen as redundant.
> However, it seems like there ought to be a more elegant way to handle
> assigning multiple bonus languages in one script. Then again, I've been
> wrong before.

You can absolutely do multiple languages in the same script. For
example, if you wanted to add Lang1, Lang2 and Lang3:

var result as number
result = hero.assign[Language.lLang1]
result = hero.assign[Language.lLang2]
result = hero.assign[Language.lLang3]

With the unique ids of the languages changed appropriately.

--
Colen McAlister (colen@wolflair.com)
Chief Engineer, Lone Wolf Development
http://www.wolflair.com/

rob August 31st, 2007 10:42 AM

Adding regions for a Forgotten Realms campaign
 
At 09:01 AM 8/31/2007, you wrote:
Quote:

Your solution works beautifully. One more question. Is there a way to combine multiple "bonus languages" into a single script statement? What you suggested above works just fine, I simply need to enter multiple scripts and increment the index value so they aren't seen as redundant. However, it seems like there ought to be a more elegant way to handle assigning multiple bonus languages in one script. Then again, I've been wrong before.
You can assign any number of tags in the same script, so assigning access to three optional languages for a given region in a single script would look like the following:

var result as number
result = hero.assign[Language.lGnothic]
result = hero.assign[Language.lLang2]
result = hero.assign[Language.lLang3]

.....continue as necessary

-Rob

TobyFox2002 December 24th, 2013 11:32 AM

Lets say you wanted to set up a selection of languages based on race.

I have the code working and it gives no errors (except an editor error) an but it seems to work regardless of the if statements.

Secondary tagexpr for pick 'trAglaReg' is scheduled after primary condition test is scheduled
(This pick was added from the editor - reloading the game system my fix this problem)

Levels/10000
Code:

var result as number
if (tagis[Race.Human] <> 0) then
  result = hero.assign[Language.lChessenta]
  result = hero.assign[Language.lDamaran]
  result = hero.assign[Language.lDraconic]
elseif (tagis[Race.HalfElf] <> 0) then
  result = hero.assign[Language.lChessenta]
  result = hero.assign[Language.lDamaran]
  result = hero.assign[Language.lDraconic]
endif


Sendric December 31st, 2013 05:48 AM

Quote:

Originally Posted by TobyFox2002 (Post 172818)
Lets say you wanted to set up a selection of languages based on race.

I have the code working and it gives no errors (except an editor error) an but it seems to work regardless of the if statements.

Secondary tagexpr for pick 'trAglaReg' is scheduled after primary condition test is scheduled
(This pick was added from the editor - reloading the game system my fix this problem)

Levels/10000
Code:

var result as number
if (tagis[Race.Human] <> 0) then
  result = hero.assign[Language.lChessenta]
  result = hero.assign[Language.lDamaran]
  result = hero.assign[Language.lDraconic]
elseif (tagis[Race.HalfElf] <> 0) then
  result = hero.assign[Language.lChessenta]
  result = hero.assign[Language.lDamaran]
  result = hero.assign[Language.lDraconic]
endif


You can remove the variable "result" and replace "result =" with perform.

TobyFox2002 December 31st, 2013 09:56 AM

The code still gives

Code:

Secondary tagexpr for pick 'trAglaReg' is scheduled after primary condition test is scheduled
(This pick was added from the editor - reloading the game system my fix this problem)

And works no matter what happens, regardless of what race I choose. Human, Half-Elf, Orc, Goliath, etc...

Sendric January 1st, 2014 07:15 AM

Quote:

Originally Posted by TobyFox2002 (Post 173323)
The code still gives

Code:

Secondary tagexpr for pick 'trAglaReg' is scheduled after primary condition test is scheduled
(This pick was added from the editor - reloading the game system my fix this problem)

And works no matter what happens, regardless of what race I choose. Human, Half-Elf, Orc, Goliath, etc...

Does reloading the game system resolve this issue? If not, then you may have a timing issue. You could try moving your script to a later time to see if it goes away.

TobyFox2002 January 2nd, 2014 12:07 AM

1 Attachment(s)
I have tried all of the timings and three or four different numbers in each timing, and there is no change at all.

I have been trying to get this to work for about a week and a half. Getting slightly frustrating. Even more so since this is holding up my work on the faerun feats because most of them are attached to regions and I don't want to work on them until I have their prereqs down.

Attaching File for further review, I have added comments as much as I can for clarity.

Sendric January 2nd, 2014 07:19 AM

Quote:

Originally Posted by TobyFox2002 (Post 173430)
I have tried all of the timings and three or four different numbers in each timing, and there is no change at all.

I have been trying to get this to work for about a week and a half. Getting slightly frustrating. Even more so since this is holding up my work on the faerun feats because most of them are attached to regions and I don't want to work on them until I have their prereqs down.

Attaching File for further review, I have added comments as much as I can for clarity.

Ok. I'll take a look at this as soon as I can. I'm currently waiting on delivery for a new tablet that I will be putting HL on. It's due here tomorrow, but I live in New England, and we're having a massive storm so we'll see. Sorry its been so frustrating.

TobyFox2002 January 2nd, 2014 07:44 AM

I'm in New England as well :D soo yeah.. Know all about it.

Sendric January 2nd, 2014 02:27 PM

Quote:

Originally Posted by TobyFox2002 (Post 173443)
I'm in New England as well :D soo yeah.. Know all about it.

Oh hey, it even says so on the side there. I play softball in Andover in the summer. I think its a bit cold for that now, though.

TobyFox2002 January 5th, 2014 05:32 AM

More trouble, same as the previous code, it works unpredictably. Its really stumping me and I don't think I can continue. I've tried to examine the Authoring Wiki, but it just makes my head spin, without examples and 'non-technical' explanations.

Post-Levels (Users)/5000
Code:

      ~ Calculate our total level - our Kundula level plus any 'extra levels'
      ~ assigned to us
      var level as number
      level = field[xTotalLev].value

      ~ Assign the Number of times the alternate form is active.
      var dice as string
      if (level > 10) then
        dice = "Alternate Form (1/day)"
      elseif (level > 15) then
        dice = "Alternate Form (3/day)"
      elseif (level > 20) then
        dice = "Alternate Form at Will"
        endif
      field[livename].text = "" & dice & ""


Sendric January 6th, 2014 06:15 AM

Taking a look at this right now. Sorry for the extensive delay.

Update: There's nothing wrong with your code, though I think you would do better to use bootstraps to add languages rather than a script. In any case, from what I can tell, there's something about your file that has gotten corrupted. I saw a note where you had to delete all the old languages and make new ones. I wonder if something happened there. I am going to try to reconstruct this file myself and see if that makes these problems go away.

TobyFox2002 January 6th, 2014 07:07 AM

Quote:

"...though I think you would do better to use bootstraps to add languages rather than a script."

Each region has multiple race options, to use bootstraps I'd need to create one trait for EACH race/region combination. Which I would rather not do if I could avoid it.

Quote:

"...I saw a note where you had to delete all the old languages and make new ones."
Yes, I found a source for all of the languages which turned out to be some bogus homebrew creation. So I had to delete all of the languages which leaves me with nearly three dozen orphaned tags. I've tried to delete them but I cant seem to find a way to do so.

Sendric January 6th, 2014 07:52 AM

Quote:

Originally Posted by TobyFox2002 (Post 173679)
Each region has multiple race options, to use bootstraps I'd need to create one trait for EACH race/region combination. Which I would rather not do if I could avoid it.

Not true. Based on your script, you want to assign the character the following languages if they are Human or Half-Elf:

lChessenta
lDamaran
lDraconic

To do this with a bootstrap, you can use the following condition:

Code:

hero#Race.Human | hero#Race.HalfElf
I've already done this on my end and tested it. It works just fine, so assuming that my interpretation of your intentions is correct, you can do this for all of your traits for whatever languages they are supposed to add.

Also, on your pre-req for Aglarond, you can reduce all that code to:

Code:

validif (tagis[Race.Human] + tagis[Race.HalfElf] + tagis[HasTrait.trPFAdopte] <> 0)
Quote:

Yes, I found a source for all of the languages which turned out to be some bogus homebrew creation. So I had to delete all of the languages which leaves me with nearly three dozen orphaned tags. I've tried to delete them but I cant seem to find a way to do so.
I don't get those errors, so in your portfolios, I would recommend deleting the old languages, and then re-adding them. Alternatively, you may try the "Strip Missing Sources" option under "Portfolio" in the menu if it is available.

OK, so I tried to re-create the use file, and I couldn't get rid of the error. So, then I started over, and created a trait called "test". As soon as I add this trait to the portfolio, I get the error. There are no scripts, tags or anything else on this trait. Therefore, I can only conclude that this error is a bug in HL. As frustrating as it is, I think you should just ignore it. The good news is that as a user, you probably won't see it. If you do, it would only be the first time you select it.

Sendric January 6th, 2014 08:10 AM

Quote:

Originally Posted by TobyFox2002 (Post 173625)
More trouble, same as the previous code, it works unpredictably. Its really stumping me and I don't think I can continue. I've tried to examine the Authoring Wiki, but it just makes my head spin, without examples and 'non-technical' explanations.

Post-Levels (Users)/5000
Code:

      ~ Calculate our total level - our Kundula level plus any 'extra levels'
      ~ assigned to us
      var level as number
      level = field[xTotalLev].value

      ~ Assign the Number of times the alternate form is active.
      var dice as string
      if (level > 10) then
        dice = "Alternate Form (1/day)"
      elseif (level > 15) then
        dice = "Alternate Form (3/day)"
      elseif (level > 20) then
        dice = "Alternate Form at Will"
        endif
      field[livename].text = "" & dice & ""


As for this, my guess is you could be doing this too soon. When you want to change the name of something, I find it easiest to run these in the Final Phase. A couple of other things to note is that I think you intend to use ">=" instead of just ">", and I got an error on the field. The line:

Code:

level = field[xTotalLev].value
sets "level" equal to the value of xTotalLev on the thing the script is on. That may be your intention, but I wasn't sure, so I changed it on the version I wrote. I also changed who you are modifying the name. I find using variables as a string to have very inconsistent success, so I removed that. Here's what I have:

Final Phase/5000
Code:

~ Calculate our total level - our Kundula level plus any 'extra levels'
      ~ assigned to us
      var level as number
      level = herofield[tTotLevel].value

      ~ Assign the Number of times the alternate form is active.
      if (level >= 10) then
        field[livename].text = field[name].text & " (1/day)"
      elseif (level >= 15) then
        field[livename].text = field[name].text & " (3/day)"
      elseif (level >= 20) then
        field[livename].text = field[name].text & " (at Will)"
      endif

See if that does what you are looking for.

TobyFox2002 January 6th, 2014 09:49 AM

Quote:

Originally Posted by Sendric (Post 173681)
As for this, my guess is you could be doing this too soon. When you want to change the name of something, I find it easiest to run these in the Final Phase. A couple of other things to note is that I think you intend to use ">=" instead of just ">", and I got an error on the field. The line:

Code:

level = field[xTotalLev].value
sets "level" equal to the value of xTotalLev on the thing the script is on. That may be your intention, but I wasn't sure, so I changed it on the version I wrote. I also changed who you are modifying the name. I find using variables as a string to have very inconsistent success, so I removed that. Here's what I have:

Final Phase/5000
Code:

~ Calculate our total level - our Kundula level plus any 'extra levels'
      ~ assigned to us
      var level as number
      level = herofield[tTotLevel].value

      ~ Assign the Number of times the alternate form is active.
      if (level >= 10) then
        field[livename].text = field[name].text & " (1/day)"
      elseif (level >= 15) then
        field[livename].text = field[name].text & " (3/day)"
      elseif (level >= 20) then
        field[livename].text = field[name].text & " (at Will)"
      endif

See if that does what you are looking for.

Nope, the Append wont work because I'm using this to modify the Class Special, so it would come out as:
Alternate Form (1/day) (1/day)

And no matter how many levels of the class I have it still shows:
Alternate Form (1/day) (1/day) on the Specials tab.

TobyFox2002 January 6th, 2014 10:00 AM

Quote:

To do this with a bootstrap, you can use the following condition:

Code:

hero#Race.Human | hero#Race.HalfElf
I've already done this on my end and tested it. It works just fine, so assuming that my interpretation of your intentions is correct, you can do this for all of your traits for whatever languages they are supposed to add.
That works great for AUTOMATIC languages, but I want to add languages to the bonus languages.

Quote:

Also, on your pre-req for Aglarond, you can reduce all that code to:

Code:

validif (tagis[Race.Human] + tagis[Race.HalfElf] + tagis[HasTrait.trPFAdopte] <> 0)

Well that works, works very well.

Sendric January 6th, 2014 10:21 AM

Quote:

Originally Posted by TobyFox2002 (Post 173687)
Nope, the Append wont work because I'm using this to modify the Class Special, so it would come out as:
Alternate Form (1/day) (1/day)

And no matter how many levels of the class I have it still shows:
Alternate Form (1/day) (1/day) on the Specials tab.

Well, the first thing to do is to remove "(1/day)" from the name of the ability. Just keep it as "Ability Focus". If you want it based on class levels, then use this to set the variable (replacing "Fighter" with whatever class you have):

Code:

level = #levelcount[Fighter]
To be honest, though, you don't even need to use a variable (as I show below). Also, I just realized why it doesn't change. I forgot to reverse the level checking. You need to check for the highest level first. So, the script should look like this instead:

Code:

      if (#levelcount[Fighter] >= 20) then
        field[livename].text = field[name].text & " (at Will)"
      elseif (#levelcount[Fighter] >= 15) then
        field[livename].text = field[name].text & " (3/day)"
      elseif (#levelcount[Fighter] >= 10) then
        field[livename].text = field[name].text & " (1/day)"
      endif


Sendric January 6th, 2014 10:29 AM

Quote:

Originally Posted by TobyFox2002 (Post 173688)
That works great for AUTOMATIC languages, but I want to add languages to the bonus languages.

My mistake. In that case, the only change to your code I would make is to combine the two races into one line, as such:

Code:

if (tagis[Race.Human] + tagis[Race.HalfElf] <> 0) then
  perform hero.assign[Language.lChessenta]
  perform hero.assign[Language.lDamaran]
  perform hero.assign[Language.lDraconic]
endif

Also, I noticed you have "Don't generate pre-requisite?" checked on the language Chessentan. I think this is just a mis-click or something. You'll want to remove it, though, or else it will always show up as a possible bonus language.

TobyFox2002 January 10th, 2014 07:55 AM

Quote:

Originally Posted by Sendric (Post 173690)
My mistake. In that case, the only change to your code I would make is to combine the two races into one line, as such:

Code:

if (tagis[Race.Human] + tagis[Race.HalfElf] <> 0) then
  perform hero.assign[Language.lChessenta]
  perform hero.assign[Language.lDamaran]
  perform hero.assign[Language.lDraconic]
endif


Does not work, I've tried for several days to get this to work using every conceivable timing. And nothing.

Sendric January 10th, 2014 09:17 AM

Quote:

Originally Posted by TobyFox2002 (Post 173826)
Does not work, I've tried for several days to get this to work using every conceivable timing. And nothing.

Add hero. in front of "tagis" for both human and half-elf. I got this to work at Post-levels/10000.

Code:

if (hero.tagis[Race.Human] + hero.tagis[Race.HalfElf] <> 0) then

TobyFox2002 January 10th, 2014 12:27 PM

Well I've found, the problem I think... I have selected "Secret Language?" checked. I did this to prevent humans from automatically having the language as an option, humans automatically having the faerun languages automatically invalidates the whole purpose of regional languages. Unfortunately, having that selected seems to override the scripts entirely.

I guess I'll just have to deal with the problem. But at least now I have a reason why the scripts were not functioning properly.

Sendric January 11th, 2014 07:14 PM

What I did above by adding hero in front of tagis then setting the time to Post-Levels/10000 worked for me with the Secret Language checked on. You do need to make sure you don't have "Don't generate pre-requisite?" unchecked, though.

TobyFox2002 January 11th, 2014 10:01 PM

Quote:

Originally Posted by Sendric (Post 173900)
What I did above by adding hero in front of tagis then setting the time to Post-Levels/10000 worked for me with the Secret Language checked on. You do need to make sure you don't have "Don't generate pre-requisite?" unchecked, though.

doesn't work for me.
I have to uncheck secret to get it to work, and dont generate pre-requisite is unchecked.

The script mostly works now, there are a few races that wont work with
hero.tagis[Race.?]. Like Grimlock, Hobgoblin, Centaur Koa-toan etc..

Some of the regions check for non-standard races. And the tagis[Race.?] <> 0 doesnt seem to work for bootstrap conditions, it probably uses a different syntax. But I'll figure that out through trial and error (i hope).

Other than that, I'm good and just about ready to move on to Feats.

Although, I do have a non-code related question. Do you think I should create each indivudual Knoweldge Local (region name) as its own new skill or just bootstrap knowledge local as 'always a class skill?' The Forgotten Realms Campaign Setting seems to list them as separate.

Beyond that I want to thank you for your help for this issue. I will post the finished .user file here when I get the regions working fully.

Sendric January 13th, 2014 04:52 AM

Quote:

Originally Posted by TobyFox2002 (Post 173903)
doesn't work for me.
I have to uncheck secret to get it to work, and dont generate pre-requisite is unchecked.

That's strange. Oh well, I'm glad you have it working for you at least.

[QUOTE]
The script mostly works now, there are a few races that wont work with
hero.tagis[Race.?]. Like Grimlock, Hobgoblin, Centaur Koa-toan etc..

Some of the regions check for non-standard races. And the tagis[Race.?] <> 0 doesnt seem to work for bootstrap conditions, it probably uses a different syntax. But I'll figure that out through trial and error (i hope).

Other than that, I'm good and just about ready to move on to Feats./quote]

It's possible something with these races wasn't set up properly. I'll take a look at them and see if anything out of the ordinary is going on.

Quote:

Although, I do have a non-code related question. Do you think I should create each indivudual Knoweldge Local (region name) as its own new skill or just bootstrap knowledge local as 'always a class skill?' The Forgotten Realms Campaign Setting seems to list them as separate.
To be honest, I don't really have a preference. I haven't played much in the Forgotten Realms setting, and don't know how much it matters. To me, it seems like something the players could keep track of rather than having to input all those different skills.

Quote:

Beyond that I want to thank you for your help for this issue. I will post the finished .user file here when I get the regions working fully.
More than happy to help. A lot of people have been clamoring for Forgotten Realms material, and I just haven't had the time to delve into it. Anything I can do to help someone else enter it is my pleasure.

TobyFox2002 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.

Sendric January 15th, 2014 05:18 AM

Quote:

Originally Posted by TobyFox2002 (Post 174051)
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.

TobyFox2002 January 15th, 2014 08:54 AM

Quote:

Originally Posted by Sendric (Post 174053)
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?

Sendric January 15th, 2014 09:37 AM

Quote:

Originally Posted by TobyFox2002 (Post 174071)
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.

TobyFox2002 January 15th, 2014 11:10 AM

Quote:

Originally Posted by Sendric (Post 174074)
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.

Sendric January 15th, 2014 11:39 AM

Quote:

Originally Posted by TobyFox2002 (Post 174086)
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?

TobyFox2002 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.

Sendric January 16th, 2014 04:41 AM

Quote:

Originally Posted by TobyFox2002 (Post 174090)
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?

TobyFox2002 January 16th, 2014 06:20 PM

Quote:

Originally Posted by Sendric (Post 174120)
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.

Sendric January 17th, 2014 04:34 AM

Quote:

Originally Posted by TobyFox2002 (Post 174149)
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.


All times are GMT -8. The time now is 12:47 PM.

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