Checking Alignment
Checking Alignment
Okay, let me try to articulate what I am seeking. I need to check for specific alignments. The isgood check is too broad for my needs. I need to check for LG, LN, and NG. On the alignment list, LN falls below CG numerically. I don't want CGs included in the accepted alignments. So, is there a way to check for specific alignments? If so, is it available on the web page to be copied? If not, can we create a section for templates so that builders can go and copy bits of code that work instead of redoing it every time the work on an area? (Did that make any sense?) There is a sample area on the page. The templates would be more specific, often used bits of code.
-
- Sword Grand Master
- Posts: 4708
- Joined: Tue Jul 15, 2003 9:26 pm
- Location: House of Wonder, Waterdeep
In align($n), Lawful-Good is 1000, Neutral-Good is 650, and Lawful-Neutral is 200. The simplest solution would be to use a program like this:
Unfortunately, alignment values are not always set to these exact values. You could want to allow for the values who are between 600 and 1000 as well as those between 100 and 300. That yields the following program.
In this case, you have to copy twice the "things for people who cannot be accepted". The idea of the program is as follows:
- If align < 100, the people cannot be accepted.
- Otherwise, the align is between 100 and 1000. There are two possibilities. First possibility is "the character can be accepted". That corresponds to align that is either > 600 or < 300. In this case, "do things for people who can be accepted". Otherwise [that is, if the align is in the 300-600 range], "do things for people who cannot be accepted".
Code: Select all
if align($n) == 1000
or align($n) == 650
or align($n) == 200
** do things for people who can be accepted
else
** do things for people who cannot be accepted
endif
Code: Select all
if align($n) < 100
** do things for people who cannot be accepted
else
if align($n) > 600
or align($n) < 300
** do things for people who can be accepted
else
** do things for people who cannot be accepted
endif
endif
- If align < 100, the people cannot be accepted.
- Otherwise, the align is between 100 and 1000. There are two possibilities. First possibility is "the character can be accepted". That corresponds to align that is either > 600 or < 300. In this case, "do things for people who can be accepted". Otherwise [that is, if the align is in the 300-600 range], "do things for people who cannot be accepted".