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)
-   -   Getting specific class levels (http://forums.wolflair.com/showthread.php?t=58947)

Sevisin August 12th, 2017 12:11 AM

Getting specific class levels
 
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

Dami August 12th, 2017 05:50 AM

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.

Sevisin August 12th, 2017 09:01 AM

@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

ShadowChemosh August 12th, 2017 09:40 AM

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]

Sevisin August 12th, 2017 12:09 PM

3 Attachment(s)
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

ShadowChemosh August 12th, 2017 12:33 PM

Quote:

Originally Posted by ShadowChemosh (Post 254091)
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.

Sevisin August 12th, 2017 01:19 PM

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

Dark Lord Galen August 14th, 2017 02:33 AM

Quote:

Originally Posted by ShadowChemosh (Post 254104)
................
1) DO NOT use the '(Users)' timings as those are going to go away in a future d20 update. :(
.

oh really??? I need to check mine then..... or will old ones be grandfathered?

ShadowChemosh August 14th, 2017 02:59 PM

Quote:

Originally Posted by Dark Lord Galen (Post 254180)
oh really??? I need to check mine then..... or will old ones be grandfathered?

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. :)

Dark Lord Galen August 14th, 2017 09:58 PM

Gotcha.. well it will be one of the growing list of things I'll ask while at the Gencon this year....;)


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

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