IfCheck for Races and Subraces

For builders to discuss and ask building questions.
Post Reply
Lathander
Staff
Staff
Posts: 3629
Joined: Tue Jul 15, 2003 9:30 pm
Location: The Eastern Sky

IfCheck for Races and Subraces

Post by Lathander » Thu Oct 06, 2011 10:08 pm

What is the syntax to check for elven subraces?

I am able to get if race $n != Elf to work, but that doesn’t encompass sun elves, moon elves, et al.
I’ve tried “Moon Elf” and ELFMOON (which is what the FKbit list shows for race) but neither worked.
Lathander,
Commander of Creativity
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: IfCheck for Races and Subraces

Post by Harroghty » Fri Oct 07, 2011 1:12 am

Should be ELFMOON, but how are you checking? That is, what is the syntax of your checks?
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Solaghar
Staff
Staff
Posts: 1283
Joined: Sun Nov 16, 2003 8:33 am
Location: Menzoberranzan

Re: IfCheck for Races and Subraces

Post by Solaghar » Fri Oct 07, 2011 3:42 am

Actually if race($n) != elf SHOULD encompass all the subraces, as they're all of the elf type.
Lathander
Staff
Staff
Posts: 3629
Joined: Tue Jul 15, 2003 9:30 pm
Location: The Eastern Sky

Re: IfCheck for Races and Subraces

Post by Lathander » Fri Oct 07, 2011 7:23 pm

Here's the actual program I'm working with, sorry for not posting it earlier:

Code: Select all

>wear_prog 100~
if race($n) != Elf
   mpechoat $n {70}The longsword of the fey {90}pulses red {70}and wriggles out of your hand!
   mpechoaround $n {70}A longsword of the fey {90}pulses red {70}and wriggles out of $N's grasp!
   mpforce $n remove i7931
   mpadd $n currhp -50
endif
~
|
That program works for Elf. I mset myself as Elf and could wield it fine. But, when I set myself to Moon Elf (mset Lathander race Moon Elf) the program kicked in and did not let me wield.
Lathander,
Commander of Creativity
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: IfCheck for Races and Subraces

Post by Harroghty » Sun May 06, 2012 1:34 pm

Non-sequitor to Lathander's original, resolved issue, but in that vein..

Yes, checking by the major category does work (so ELF should check for subordinate types of ELF), but if you want to be detailed than here is a list of "objectionable" races that I wrote for one of my areas. It might save you some time if you want to use something like this in one of yours.

Code: Select all

    if race($n) == orc
    or race($n) == mountain orc
    or race($n) == gray orc
    or race($n) == orcorog
    or race($n) == halfdrow
    or race($n) == drow
    or race($n) == tiefling
    or race($n) == goblin
    or race($n) == troll
    or race($n) == bugbear
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Post Reply