Jump to content


Photo

Spell flags with spells cast from items


  • Please log in to reply
4 replies to this topic

#1 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 23 July 2013 - 07:19 AM

Would it be possible to have the 'cast spell' opcodes (#146 and #148) take the flags from the resource into account while casting?

 

E.g., if you have a spell with the 'No LOS required' flag (BIT11 in the SPL header), casting it from a scroll enforces the normal restrictions (LOS is required). Another example is Clairvoyance, which has the 'Outdoors Only' flag set, but can still be cast indoors if you do it from a scroll.

 

Or, failing that, would it be possible to implement a 'No LOS required' flag for items, similar to the 'cannot target invisible' flag?

 

Edit: oh, sorry. Maybe this should have been in the Wishlist. I only looked at the pinned topics, I'm afraid.


Edited by Wisp, 23 July 2013 - 07:38 AM.


#2 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 23 July 2013 - 09:44 PM

Should be possible. Have you also asked on the BGEE forums?

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#3 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 24 July 2013 - 02:45 AM

Not yet. Which should be possible? (So I ask for the same thing.)



#4 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 24 July 2013 - 05:35 AM

Probably both - I have not looked into the cast spell opcode for a while, so I can't go into the specifics. The question to consider is how many of the parent resource flags should the cast spell opcode obey? Are there duplicates? Are there any undefined behaviors?

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#5 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 24 July 2013 - 01:23 PM

Okay, let's see.

The flag 'hostile' (bit 10) does not seem to be a problem. Casting from scrolls breaks invisibility, and I assume the target checks the flag on the spell itself on impact (and treats it as an attack if the flag is set). Off-hand I can't think of any reason to check this flag.

 

It would be nice if it checked 'No LOS required' (bit 11).

 

I don't know what 'Allow spotting' (bit 12) does, but it is set on a few vanilla spells: Meteor Swarm, Storm of Vengeance, Comet, Cinder Shower (SPIN560) and a few stat-increasing spells.

 

It should probably check 'Outdoors only' (bit 13).

 

I guess maybe it should check 'Non-magical ability' (bit 14), but you can already use items to cast spells when silenced or in a dead/wild magic zone, so maybe it's redundant.

 

I don't know enough about 'Trigger/Contingency' (bit 15). But seeing as how they work when cast from scrolls, there's probably nothing that needs to be done.

 

It should check 'Non-combat ability' (bit 16). You can't cast non-combat spells during combat, but you can cast them from scrolls.

 

As for 'can target invisible' (bit 24), that's already default behaviour for items, and (as you know) there's a flag to disallow this, so it might be a bit messy to obey both. Likewise, 'castable when silenced' (bit 25) is already default behaviour for items.


Edited by Wisp, 24 July 2013 - 01:37 PM.