Jump to content

Alignment check for vanilla BG1


jastey

Recommended Posts

Does anyone happen to know why in my vanilly BG1+TotSC game the trigger

 

Alignment(Player1,CHAOTIC_GOOD)

 

or, also

Alignment(Player1,MASK_GOOD)

 

does not work for my chaotic good human PC fighter.

 

It compiles fine, but in the game, the script block using these triggers aren't executed.

And here I sit trying to implement a romance for a paladin...

Link to comment

Normally, it's not necessary, but IIRC, one of the alignment IDSs that may or may not be used for the Alignment() trigger was horribly screwed in BG/TotSC.

 

Using the number is just a quicker way to check if something else is going on or if the engine is handed nonsense numbers in the BCS (since they'll compile to the incorrect numbers used in the IDS). If it's the latter, you can then decide if it's worth fixing up the IDS file for your mod or just leaving the numbers (the numbers will *always* work, regardless of the state of the user's IDS files).

Link to comment

IF

Global("X#AjantisRomanceMatch","GLOBAL",0)

Global("X#AjantisRomanceCheckMatch","GLOBAL",0)

Gender(Player1,FEMALE)

ReputationGT(Player1,10)

Alignment(Player1,1) //MASK_GOOD

 

THEN

RESPONSE #100

SetGlobal("X#AjantisRomanceCheckMatch","GLOBAL",1)

SetGlobal("X#AjantisRomanceMatch","GLOBAL",1)

END

 

This is the script block. It wasn't executed with the Alignment check. Without it it worked (first LT dialogue got triggered afterwards).

Link to comment

Did you try the actual alignment (it's possible just the masks don't work)?

Are you sure that Player1 is actually good?

 

Assuming yes to both, I guess it's one more thing to look at the next time I fire up BG/TotSC (sometime in the next eon).

Link to comment

Assuming I didn't screw up (it's really late here)

0 NONE
17 LAWFUL_GOOD
18 LAWFUL_NEUTRAL
19 LAWFUL_EVIL
33 NEUTRAL_GOOD
34 NEUTRAL
35 NEUTRAL_EVIL
49 CHAOTIC_GOOD
50 CHAOTIC_NEUTRAL
51 CHAOTIC_EVIL
1 MASK_GOOD
2 MASK_GENEUTRAL
3 MASK_EVIL
16 MASK_LAWFUL
32 MASK_LCNEUTRAL
48 MASK_CHAOTIC

Apparently, the MASK_s don't work very well in BG/TotSC, but it looks like the specific alignments should work.

 

You can also fix up the bad IDS file (I believe ALIGN is the broken one in BG, but it might be ALIGNMEN) by either correcting the values or by altering TRIGGER.IDS to reference the correct one (the IDSFileHere part of Alignment(O:Object*,I:Alignment*IDSFileHere)), and then revert to using the symbols. A correct version of the file for all engine variants would be

15
0x00 NONE
0x11 LAWFUL_GOOD
0x12 LAWFUL_NEUTRAL
0x13 LAWFUL_EVIL
0x21 NEUTRAL_GOOD
0x22 NEUTRAL
0x23 NEUTRAL_EVIL
0x31 CHAOTIC_GOOD
0x32 CHAOTIC_NEUTRAL
0x33 CHAOTIC_EVIL
0x01 MASK_GOOD
0x02 MASK_GENEUTRAL
0x03 MASK_EVIL
0x10 MASK_LAWFUL
0x20 MASK_LCNEUTRAL
0x30 MASK_CHAOTIC

Link to comment

devSin, I have an exactly matching your .ids entries in EasyTutu_ToB for ALIGN.IDS, and again in ALIGNMEN.IDS, ALIGNMNT.IDS - so is this just a BG/TOTSC and perhaps Tutu v4 difficulty?

 

Reading the above, it sounds like the safest and most univerally compatible way of coding would be to skip straight to the numbers, as other mods may or may not change these values, right?

 

Sorry - rereading, let me rephrase and actually ask what i need to know:

 

in your opinion, is the most stable way of addressing this in a non-fixpack mod

 

a. repairing this at the .ids level

 

or

 

b. recoding all instances of

~OR (2) Alignment(Player1,MASK_GOOD) Alignment(Player1,MASK_LCNEUTRAL) ~ etc.

to

~OR (2) Alignment(Player1,1) Alignment(Player1,32) ~

 

or

 

c. recoding all of the instances of MASK_myalignmentWanted from

 

Alignment(Player1,MASK_GOOD)

 

to

 

OR(3)

Alignment(Player1,17) // LAWFUL_GOOD

Alignment(Player1,33) // NEUTRAL_GOOD

Alignment(Player1,49) //CHAOTIC_GOOD

 

?

Link to comment
devSin, I have an exactly matching your .ids entries in EasyTutu_ToB for ALIGN.IDS, and again in ALIGNMEN.IDS, ALIGNMNT.IDS - so is this just a BG/TOTSC and perhaps Tutu v4 difficulty?
I have no experience with Tutu games, so I'm not sure if any other variants of BG/TotSC would be affected. :( In vanilla BG/TotSC, ALIGN.IDS (which the Alignment() trigger uses) has incorrect values for LAWFUL_EVIL, NEUTRAL_EVIL, CHAOTIC_GOOD, CHAOTIC_NEUTRAL, and CHAOTIC_EVIL.
15
0x00 NONE
0x11 LAWFUL_GOOD
0x12 LAWFUL_NEUTRAL
0x14 LAWFUL_EVIL	 // should 0x13
0x21 NEUTRAL_GOOD
0x22 NEUTRAL
0x24 NEUTRAL_EVIL	// should 0x23
0x41 CHAOTIC_GOOD	// should 0x31
0x42 CHAOTIC_NEUTRAL // should 0x32
0x44 CHAOTIC_EVIL	// should 0x33
0x01 MASK_GOOD
0x02 MASK_GENEUTRAL
0x03 MASK_EVIL
0x10 MASK_LAWFUL
0x20 MASK_LCNEUTRAL
0x30 MASK_CHAOTIC

 

Reading the above, it sounds like the safest and most univerally compatible way of coding would be to skip straight to the numbers, as other mods may or may not change these values, right?
Correct. The engine knows all the numbers (and only those numbers). They cannot and will not change, regardless of mod installations. (This isn't to say that there's a hardcoded list of numbers in all cases, but the engine knows how to get the data it needs from the numbers and will always do the same thing with them.)

 

In most cases, I don't think it's terribly necessary to choose one method over the other; whichever is easier for you is probably the better approach. I prefer numbers (after working on this stuff for so long, you remember that 2112 is *SPELL Magic Missile and that 4 is *GENERAL UNDEAD and that 30 is *EA GOODCUTOFF, etc.), but fixing the IDS file possibly allows other mods that are installed afterward that may mistakenly depend on the incorrect values to work correctly.

 

In my opinion, Option B is best when you know that the MASK_s work correctly (you're modding BG2 or Tutu or whatever). But all are acceptable (and with correct IDS files will behave identically); there really is no wrong answer, as much as I'd like to point to one single "right" option.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...