subtledoctor Posted January 28, 2018 Share Posted January 28, 2018 I'd like to create an AoE spell that only affects people who are invisible. Is this possible? It looks like opcode 20 does not set a stat that I can check for, surprisingly. STATE.ids has an entry for "STATE_INVISIBLE" but can 324/326 filter for those states? I guess I could patch all Invisibility spells to set a SpellState... and then... I don't know, have BALDUR.bcs remove it if/when the invisibility goes away? That would be pretty annoying... Quote Link to comment
Jarno Mikkola Posted January 28, 2018 Share Posted January 28, 2018 (edited) Is this actually for invisible creatures, or just stealthed ENEMIES/hostile ? Cause there's a whole lot of difference there. Ones's a door, the other is a Lich. With EE or BG2Fixpacked / Extended AI features enabled ? Edited January 28, 2018 by Jarno Mikkola Quote Link to comment
subtledoctor Posted January 28, 2018 Author Share Posted January 28, 2018 EE. Invisible enemies - I guess it should work both ways. (Enemies should be able to cast it and affect invisible party members.) Quote Link to comment
CamDawg Posted January 28, 2018 Share Posted January 28, 2018 Op 324 can check states, IIRC, and enemy/ally can be handled by the projectile. Quote Link to comment
subtledoctor Posted January 28, 2018 Author Share Posted January 28, 2018 Ah ha! 0x111! I missed that. [Mr. Burns] Excellent... [/Mr. Burns] Quote Link to comment
subtledoctor Posted January 30, 2018 Author Share Posted January 30, 2018 Op 324 can check states, IIRC, and enemy/ally can be handled by the projectile. STATE.IDS seems to use hex values... and I notice that all of the existing instances of 0x111 in SPLPROT.2DA use either 8 or 9 ("bit equal" or "bit not equal") in the RELATION column. Are these things related? If I need to add more rows to SPLPROT.2DA for other states, should I be using bit equality? Quote Link to comment
CamDawg Posted January 30, 2018 Share Posted January 30, 2018 You want to check bit values because while the target may be under multiple states you only care about one. Checking directly for state = 0x10 means you would miss a creature who's invisible plus any other state like silenced (0x1010, or bit5 + bit13). Every state in kit.ids corresponds to a bit, and the special ones like CD_STATE_NOTVALID are just combos of existing bits. Quote Link to comment
Avenger Posted January 30, 2018 Share Posted January 30, 2018 You can set up an entry with 0x111 -1 8 and another with 0x111 -1 9 Then use param1 in the 318/324/326 effect to cover for the real bit value. Note, there are more binary relational operators, you surely can find the perfect one. They are usable to check more than one bit(s) simultaneously. Quote Link to comment
subtledoctor Posted January 31, 2018 Author Share Posted January 31, 2018 (edited) All good to know. I'll probably first try the idea of merging the invisibility and Sanctuary effects, so this hopefully won't be necessary for STATE_INVISIBLE.But I'm also trying to make an "Absorb Infliction" ability which would need to target STATE_DISEASED, STATE_POISONED, and STATE_BLIND, so this is useful. Edited August 2, 2018 by subtledoctor Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.