• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Getting specific class levels

Sevisin

Well-known member
Hello,

This seems like it should be a simple thing, but I can't seem to figure it out. I am creating the Landforged Walker (Secrets of Xen'dirt, pg 123), but I'm having problems with Body of Nature. At level 1, they get Body of Nature. At level 2, Body of Nature gives some resistance, and +1 natural AC.

When I created this as a new and separate class special, the natural armor class rose at level 1, even though the Level Requirement was placed at 2. So, it turns out I need to get the levels of that specific class.

Here is what I tried.
Code:
var classLvl as number
classLvl = #levelcount[Landforged Walker]

I get an error saying,
Syntax error in 'eval' scrit for Thing 'cAM-BoN' (Eval Script '#1' on line 2
-> Tag 'Classes.Langforged' not defined.

However, the following code works
Code:
var classLvl as number
classLvl = #levelcount[Crusader]

Why is that?

Thanks,

-S
 
The format of the macro you are using should be #levelcount[class_ID]
Normally your class ID isn't going to be 2 words, so "Landforged Walker" is likely to give you an error.
Also, note the actual text in your error message given is "Langforged" - not "Landforged". There may be a typo in your original code.
 
@Dami
Thank you for the reply. How would I go about making a class ID that the macro will understand? I have used the unique ID... or, wait. You mean the name created when the class was first created? I didn't think of that.

As for the typo, that was not a direct copy and paste so the spelling is actually correct.

Thanks,

-S
 
Here is the script that macro #levelcount[] is doing under the covers:
Code:
hero.tagcount[Classes.#class]
This means its looking for the "Classes.?" tag that resides on the Hero. To find this tag do the following:

1) Start with a new character and add one level of the class you want to count to a character.
2) Go to "Develop->Floating Info Windows->Show Hero Tags".
3) In the new window that appears type "Classes" into the TOP LEFT corner text area. This will then show you all tags that have that word. The "Tag ID" will show you the value your looking for which is AFTER the Classes Period. In example for the Cleric the tag is "Classes.Cleric". Which would make the macro look like this:
Code:
#levelcount[Cleric]
 
Thank you all for the replies. However, I am still having problems with this simple matter.

01.jpg shows the hero tags for a single level of the class
02.jpg shows the simple if statement used
03.jpg shows the error after compile/test

The code below is code I used that worked, but would CRASH THE PROGRAM after compiling. After I reload the program, the class would work normally. Not sure why.

Code:
      var level as number
      var total as number

      level = field[xTotalLev].value

      if (level >= 4) then
        field[livename].text = "Body of Nature rank 2, +2 Natural Armor, Resistance 10 Cold/Electricity"
	total = 2
      elseif (level >= 2) then
        field[livename].text = "Body of Nature rank 1, +1 Natural Armor, Resistance 5 Cold/Electricity"
	total = 1
      endif

     ~ Note: This power increases our natural armor, it doesn't just add a nonstackable bonus.
      hero.child[mNatural].field[Bonus].value = hero.child[mNatural].field[Bonus].value + total
      field[livename].text = field[livename].text & total

The goal of this code is to overwrite and update the natural AC given by Landforged Body, as well as the text for the special ability at given levels. Above code was recycled from class special cDDiArmor1 (or was it cFMaNatAr1? I don't remember).

Any help is appreciated.

Thanks,

-S
 

Attachments

  • Landforged Walker problem 01.jpg
    Landforged Walker problem 01.jpg
    224.1 KB · Views: 4
  • Landforged Walker problem 02.jpg
    Landforged Walker problem 02.jpg
    140.5 KB · Views: 5
  • Landforged Walker problem 03.jpg
    Landforged Walker problem 03.jpg
    79.6 KB · Views: 2
Code:
#levelcount[Cleric]
Please note the group + tag is "Classes.Cleric" but the macro ONLY wants the "TAG" of "Cleric". :)

You have Classes.LndfgWlkr instead of just:
Code:
#levelcount[LndfgWlkr]

Several more notes:
1) DO NOT use the '(Users)' timings as those are going to go away in a future d20 update. :(

2) If your on a Class Special and after Post-Level/10000 you don't need to use this macro at all. Just use "field[xTotalLev].value" like you did in your script above as it will already contain the value you want. What is also great is if you bootstrap the class special to a different class it will also work for that classes without making changes.
 
Alright, I went to my old version of the code. Still buggy, but I sent in a bug report to support. Hopefully, they can fix my crashing.

Again, thank you for all of your help. Next, Celestial Mystic.

-S
 
I got alot of work on my hands, I used the hell outta the User ones, thinking that was the best way to handle my stuff. Boy oh boy.
 
Here's something I'm trying to figure out:

var classLvl as number
tagexpr = "component.Class"
foreach pick in hero where tagexpr
classLvl = hero.tagcount[Classes.?]
~#levelcount[????]
nexteach

Is there a way I could use a variable, for example, the total class for just the current class being parsed.

Using Classes.? gives me the total level of the character, not the level for that one particular class.


Dave

I think I tried something like #levelcount[eachpick.tagnames[thingid.?]]
 
Last edited:
Great question for LW. I am just sharing that they are planned to be deprecated at a future point. So may as well move away from them now and save yourself any issues. :)

Super late to comment on this, I know, but there shouldn't be any issues. When we did this for PF all we did was hide the timings so that users won't be exposed to them in the editor. The (Users) phases are still there and will still run their code, AFAIK.
 
Several more notes:
1) DO NOT use the '(Users)' timings as those are going to go away in a future d20 update. :(

Craaaap! I've been using those... for forever (so I knew they were timings I created rather than HL timings).

I'll be losing another week of sleep fixing these in my files (after losing two weeks worth fixing my spells).

Woot!
 
Craaaap! I've been using those... for forever (so I knew they were timings I created rather than HL timings).

I'll be losing another week of sleep fixing these in my files (after losing two weeks worth fixing my spells).

Woot!
Need to simply use a Find/Replace grep tool and it will be finished in about 5 minutes.

Worst case use a text editors simple find/replace which will be a little longer as you will have open each user file individually.

Or as Aaron said do nothing and it will continue to just work. :)
 
Also of note, I'd already known this. All this did was remind me of it again, LOL. Literally, a few posts before this last one I made the same comments.
 
Back
Top