Senior Member
Join Date: Jul 2010
Posts: 3,147
|
So now that I have the ability to choose spells working properly, I am trying to set up the DC for the spell chosen. This isn't a huge deal imo, but it would be nice if I could get it to work.
I am attempting to access the sLevel field of the chosen spell and set a variable equal to it with this: Code:
SL = field[usrChosen1].chosen.field[sLevel].value Also of note may be the debug output for SL shows this: Code:
[Unnamed 1.1] 0 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
If you're debugging while there are multiple characters in a portfolio (like hero + animal companion), it will put the name of the particular character where the debug is running in square brackets, so you can tell where to look.
|
#2 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
phase & priority of the script this debug is in?
|
#4 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
I always use priorities with at least 4 digits, usually 5. There may still be internal calculations going on at 101 in any phase.
Try some other phases. Final would be the first one I'd try. |
#6 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
Quote:
Attributes/10000 Final Phase/10000 Render/10000 None of them worked. I had also previously tried an earlier time just to see, but that also hadn't worked. |
|
#7 |
Spy
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220
|
sLevel is calculated and set at First/10000, so it's not the issue. This issue, unfortunately, is how you are using it. I know this, because I've tried several different methods of making a chooser (which is what you have here) and learned quite a bit. Choosers can be created on Custom Abilities, Class Specials, and Feats. Technically you can have a chooser on an Adjustment too, but you can't use a custom expression with it. If you have Traits & Flaws in your game, you can make a chooser with them, but I have no idea how they operate since I don't use them at all, and there could be limitations on how they are used.
Custom Expressions can have a chooser, but you have to have a field for allowing a number of custom abilities to activate them, which means it has to be a Class or it won't work at all. Unless it is class related, it simply can't be used as a generic chooser (it expects it to exist as a custom ability that is live on a hero). Class Specials do the same thing, but don't require a field for the number of custom abilities. It needs to know a class and a class level to become active. So, assuming that you have no class input, it will never meet the requirements, because it is looking for a spell that has to have a class and class level on the hero that meets the requirements. Since no class is listed, it doesn't find anything. If you do list a class, it will work on that class and ignore other classes altogether. PITA I know. So you are left with Feats, which is always what I use for the generic chooser, and for which no requirements are necessary. But you do have to bootstrap it to all the things that are going to use it. This is the only solution I've been able to do to make generic choosers work. Not sure if this is the issue, it could be some kind of live state issue, but I wouln't know without knowing what exactly you are trying to achieve and how you are going about doing it. Last edited by Kendall-DM; May 18th, 2012 at 10:49 AM. |
#8 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
I tried doing the same thing with a feat chooser, but that didn't work either.
I'm working on the Factotum class from Dungeonscape. It has an ability that allows it to choose any wizard spell (up to 7th level) and cast it as a spell-like ability. The DC is 10 + Int modifier + spell level. I was hoping to easily determine the spell level of the chosen spell so I can put the DC in the summary description. Frankly, it's not a big deal. I can always just require the user to know what level spell they are choosing and add it in themselves. Anyway, the chooser works fine. I haven't yet looked into/determined how to either bootstrap the chosen spell or carry over the description. It might be necessary to find a way to bootstrap the spell before solving the DC problem. The other problem I'll have to tackle once I tackle this is the ability to choose any 3 extraordinary abilities. I have the chooser working ok, but again, do I bootstrap the ability or just carry over the description? Can either actually be done? |
#9 |
Spy
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220
|
Try this instead. Look for the tag sLevel.X, so you'll be looking at a possibility of 10 tags. Psuedo-coding here...
if (chosen.tagis[sLevel.0] <> 0) then SL = 0 elseif (chosen.tagis[sLevel.1] <> 0) then SL = 1 etc... |
#10 |
|
|