Jump to content

Photo

spell that only affects invisible targets?


8 replies to this topic

#1 subtledoctor

subtledoctor
  • Modders
  • 2848 posts
  • Gender:Male

Posted 27 January 2018 - 09:33 PM

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...


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#2 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6829 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 28 January 2018 - 02:40 AM

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 by Jarno Mikkola, 28 January 2018 - 05:49 AM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#3 subtledoctor

subtledoctor
  • Modders
  • 2848 posts
  • Gender:Male

Posted 28 January 2018 - 05:19 AM

EE. Invisible enemies - I guess it should work both ways. (Enemies should be able to cast it and affect invisible party members.)

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#4 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Gibberling Poobah
  • 9751 posts
  • Gender:Not Telling

Posted 28 January 2018 - 08:55 AM

Op 324 can check states, IIRC, and enemy/ally can be handled by the projectile.


Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.


#5 subtledoctor

subtledoctor
  • Modders
  • 2848 posts
  • Gender:Male

Posted 28 January 2018 - 10:14 AM

Ah ha! 0x111! I missed that.

[Mr. Burns] Excellent... [/Mr. Burns]

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#6 subtledoctor

subtledoctor
  • Modders
  • 2848 posts
  • Gender:Male

Posted 29 January 2018 - 09:40 PM

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?


Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#7 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Gibberling Poobah
  • 9751 posts
  • Gender:Not Telling

Posted 30 January 2018 - 07:17 AM

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.


Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.


#8 Avenger

Avenger
  • Modders
  • 3805 posts
  • Gender:Male
  • Location:Hungary

Posted 30 January 2018 - 12:22 PM

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.



#9 subtledoctor

subtledoctor
  • Modders
  • 2848 posts
  • Gender:Male

Posted 31 January 2018 - 12:17 PM

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 by subtledoctor, 01 August 2018 - 07:31 PM.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users