Jump to content

BGII: Detecting a Drow PC?


jastey

Recommended Posts

Could you check for the script? There's one called DROW61.BCS.

I don't think the PC gets this applied, whatever the player does with hair and skin color of his "elf" PC.

 

D'oh! Sorry, I was thinking along the lines of an NPC.

Link to comment

If all you do is to select a specific skin/hair color for the player, there is no way to detect that. Sadly.

 

Except, in GemRB, there are stats:

 

 

208 METAL_COLOR

209 MINOR_COLOR

210 MAJOR_COLOR

211 SKIN_COLOR

212 LEATHER_COLOR

213 ARMOR_COLOR

214 HAIR_COLOR

 

So CheckStat() would work for them :)

You might want to ask Ascension to code these for you in ToBEx.

He intentionally left stats alone for GemRB support.

Link to comment

You can make use of custom spell states in EE v2.x patched games to detect creatures of certain race, type or other characteristics. I'm making heavy use of it in my Golem Construction mod to identify all of the individual golem types and variants.

Add a new entry to SPLSTATE.IDS and apply permanent opcode 328 (Set State) with that state to your creature. You can then use script trigger CheckSpellState() or opcodes 324 (Immunity Spell and Message) and 326 ( Add Effects List) to target creatures of that specific type.

Link to comment

Unfortunately yes. It's currently limited to 0..255 (which I can imagine will be filled by mods in no time). There is already a feature request to expand it. We'll have to see if the devs care enough for modders to consider it.

 

Spell states are IDS values, so each state is associated with a single ID (which limits its use to simple true/false existence checks). Script trigger CheckSpellState() can only check individual spell states. However, opcodes 324 and 326 are using expressions from SPLPROT.2DA, so you can also define something like "SPLSTATE <= value" or "SPLSTATE > value" if you want. But I don't see a real need to check for less or greater values since each spell state value will most likely have a different meaning.

Link to comment

SPLPROT can reflect and check values, but I guess the question is, can opcode 328 assign integer values to the spell states it sets.

 

I have one mod that only checks for a simple boolean value of a stat, so maybe I'll shift that over to a spell state. But my other one that requires a value to be set/read, I'll stick with my pseudoproficiency.

Link to comment

Opcode 328 sets only a specific spell state. Using your analogy, the spell state itself is the integer value that can be evaluated by various means while SPLSTATE.IDS would be the name of the variable.

It would be great if we could also use (local) variables for targeting purposes.

Link to comment

Archived

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

×
×
  • Create New...