Jump to content


Photo

[COMPLETE] Contingency Detects Select Spell


  • Please log in to reply
25 replies to this topic

#1 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 05 March 2011 - 01:24 AM

* Spell Immunity-type menus (.2das) could be linked with spells (.spls) in an external .2da table so that the menu will expand to replace the spell when selecting contingencies/triggers.


After many hours of hack-n-slashing away at the code, and lots of frustration, this is almost ready. Better be worth it...

N.B. I have not externalised the linkage to 2DA. Rather TobEx will detect the presence of a Select Spell opcode and adjust accordingly.

Triggers? Not done.

-----120 Contingency Detects Select Spell [F, M]
Allows the contingency panel to support spells containing the Select Spell opcode
Instead of showing the parent spell, the child spells contained in the 2DA file specified by the 'Resource' field of the Select Spell opcode that would be used if the spell is cast at the creature's level are shown
Child spells are displayed separately, and are thus not stacked upon, normal spells or child spells from a different parent spell (for example, A.SPL with a Select Spell opcode of A.2DA containing SPWI112 would display separately from SPWI112.SPL and separately from B.SPL with a Select Spell opcode of B.2DA containing SPWI112) Select Spell opcodes embedded within Use EFF File opcodes are supported

This also fixes a bug with scrolling of the spell choices when there are greater than 11 choices in a level

Options:
-0: disabled
-1: enabled


Edited by Ascension64, 05 March 2011 - 05:03 PM.

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


#2 Galactygon

Galactygon

    Modding since 2002

  • Member
  • 938 posts

Posted 05 March 2011 - 03:24 AM

* Spell Immunity-type menus (.2das) could be linked with spells (.spls) in an external .2da table so that the menu will expand to replace the spell when selecting contingencies/triggers.


After many hours of hack-n-slashing away at the code, and lots of frustration, this is almost ready. Better be worth it...

Thanks. Will CONTINGX.2da block child spells as it does parent spells right now?

Nahal's Reckless Dweomer will pose a problem though, because it involves a parent spell placing an effect on the caster that triggers a wild surge on the next child spell the caster casts.

[idea]Perhaps the local variable field at 0xa8 could be split into 3x8 chars with the parent spell reference to ensure the parent spell is cast on the caster before the child spell fired.[/idea]

N.B. I have not externalised the linkage to 2DA. Rather TobEx will detect the presence of a Select Spell opcode and adjust accordingly.


I'd like to raise your awareness that some mods might embed their spell selection screens in external .eff files or shell spells. aTweaks is planning a selection based on alignment (see this post).

-Galactygon
Posted Image

#3 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 05 March 2011 - 03:47 AM

Thanks. Will CONTINGX.2da block child spells as it does parent spells right now?

Yes.

Nahal's Reckless Dweomer will pose a problem though, because it involves a parent spell placing an effect on the caster that triggers a wild surge on the next child spell the caster casts.

Nahal's Reckless Dweomer will still appear as that, since it lists known spells and does not specify a resource. (param2 = 1 does not use resource field)

[idea]Perhaps the local variable field at 0xa8 could be split into 3x8 chars with the parent spell reference to ensure the parent spell is cast on the caster before the child spell fired.[/idea]

This would be very difficult because one would have to prevent Select Spell opcode from firing, which is super-hacky. I think the easiest way to go is to duplicate all those feature blocks in the child spells. This, however, is a disadvantage for creatures with Protection from Spell, etc.

I'd like to raise your awareness that some mods might embed their spell selection screens in external .eff files or shell spells. aTweaks is planning a selection based on alignment (see this post).

Right, so you will need support for Use EFF File then.

Edited by Ascension64, 05 March 2011 - 03:52 AM.

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


#4 Galactygon

Galactygon

    Modding since 2002

  • Member
  • 938 posts

Posted 05 March 2011 - 05:37 AM

Thanks. Will CONTINGX.2da block child spells as it does parent spells right now?

Yes.

Nice, thanks.

Nahal's Reckless Dweomer will pose a problem though, because it involves a parent spell placing an effect on the caster that triggers a wild surge on the next child spell the caster casts.

Nahal's Reckless Dweomer will still appear as that, since it lists known spells and does not specify a resource. (param2 = 1 does not use resource field)

This would be very difficult because one would have to prevent Select Spell opcode from firing, which is super-hacky. I think the easiest way to go is to duplicate all those feature blocks in the child spells. This, however, is a disadvantage for creatures with Protection from Spell, etc.

Got it, I will not worry about this then.

I'd like to raise your awareness that some mods might embed their spell selection screens in external .eff files or shell spells. aTweaks is planning a selection based on alignment (see this post).

Right, so you will need support for Use EFF File then.


Support for .effs would be really nice. If there are multiple select spell opcodes in a header, I'd go with displaying the last one in the contingency - [guess]this would happen if you'd cast the spell normally.[/guess]

-Galactygon
Posted Image

#5 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 05 March 2011 - 02:07 PM

Support for .effs would be really nice. If there are multiple select spell opcodes in a header, I'd go with displaying the last one in the contingency - [guess]this would happen if you'd cast the spell normally.[/guess]

That was my guess too, and the way I have implemented it. I am sure you don't use select spell targetting someone other than a caster, so just make sure use EFF file targets the caster. TobEx will ignore the target field (it will assume caster to check IDS against), but that can lead to some in-game inconsistencies if the use EFF file was intended for some other target.

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


#6 rajman

rajman
  • Member
  • 28 posts

Posted 19 March 2011 - 06:10 AM

Having this component enabled ( default option ) made me crash when casting a spell sequencer and having no memorized spells left for levels 3 and 4 and trying to scroll the list.

I can't put spell immunity in contingency yet btw.

#7 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 21 March 2011 - 10:22 PM

Which test release? I cannot reproduce on build 20.3.14.
In order to get Spell Immunity, you must use Chain Contingency, since none of the other spells support level 5 spells.

In future, if you are using a test release, please report at http://www.shsforums...lease-feedback/ instead of here.

Edited by Ascension64, 21 March 2011 - 10:30 PM.

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


#8 rajman

rajman
  • Member
  • 28 posts

Posted 22 March 2011 - 12:41 AM

20.3.12

Spell Trigger and a Contingency casted by a level 15+ caster support level 5 spells btw

Edited by rajman, 22 March 2011 - 12:41 AM.


#9 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 22 March 2011 - 02:17 AM

Try the latest test release.

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


#10 Galactygon

Galactygon

    Modding since 2002

  • Member
  • 938 posts

Posted 22 March 2011 - 12:56 PM

I can't put spell immunity in contingency yet btw.


Note that you will have to remove the entry SPWI510 from CONTINGX.2da to enable the spell (or the child spells) to be viewed in a contingency/sequencer menu.

-Galactygon
Posted Image

#11 -T-

-T-
  • Guest

Posted 28 July 2011 - 01:53 PM

Sorry to bump an old thread, but when I put spell immunity into a spell trigger and use the trigger, after selecting which spell school I want to immunize myself to, I then have to cast again (since spell immunity requires two castings - one for itself, and then some more casting time after selecting the school). In other words, the trigger gets rid of the first casting period but not the second.

Is there a way I can get it to go off instantly without having the post-school-selection casting time? Basically I want my sorcerers to be on par with SCS2 wizards.

Thanks for all your work, guys!

#12 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 06 August 2011 - 04:53 PM

So you are suggesting the hack isn't working?

Note that you will have to remove the entry SPWI510 from CONTINGX.2da to enable the spell (or the child spells) to be viewed in a contingency/sequencer menu.

Did you do this?
If so, do you get to directly choose the spell school on casting spell trigger, or only after triggering the spell trigger?

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


#13 -T-

-T-
  • Guest

Posted 08 August 2011 - 01:25 PM

When I posted last, I hadn't noticed the subtitle "beta 0200," which I don't think I have unless it's the version that ships with the latest version of SCS2. So it might just be that my version is outdated.

If I do have beta 0200 - yeah, I removed that entry; I replaced it with asterisks like in the other entries since I didn't see any completely blank entries, and perhaps doing so was a mistake. When I cast Spell Trigger, I do not select the spell school if I put SI into it. It's only when I trigger the spell trigger from my innates, do I then select the spell school. Then I need to take time casting, whereas it seems like it should insta-cast as other spell-trigger spells would.

Thanks again for your consideration.

#14 -Asc64_offline-

-Asc64_offline-
  • Guest

Posted 08 August 2011 - 03:28 PM

It sounds like when you cast Spell Trigger normally, the specific Spell Immunity will trigger instantly as intended, but...

It's only when I trigger the spell trigger from my innates...

What do you mean by this?

#15 -T-

-T-
  • Guest

Posted 09 August 2011 - 11:58 AM

No, it's not going off instantly. For all other spells you put in a trigger, they go off instantly when you use the trigger, but for SI, after I use the trigger I then have to select the school and then spend additional time casting. When I said "from the innates" I meant only that after you've cast the Spell Trigger spell and selected the three spells that go into it, to use it you then "trigger" the Spell Trigger by selecting it from your list of innates.

Let me illustrate. Sorry for the links but three images seems to exceed the media limit:

http://i1101.photobu...31/Baldr002.jpg
So first, I put the SI into the Spell Trigger.

http://i1101.photobu...31/Baldr004.jpg
Then I use the Spell Trigger by selecting it from the list (the step you would more likely do in combat).

http://i1101.photobu...31/Baldr006.jpg
Upon using the trigger, I then choose the spell school and then have to stand around casting more. I might have expected this step (selecting the school and spending the extra casting time) to happen when I put the SI into the trigger.

Thanks again and sorry for any miscommunication.

#16 -Asc64_offline-

-Asc64_offline-
  • Guest

Posted 09 August 2011 - 03:20 PM

According to your screenshots, it looks like this hack is just not working (since you should be able to select the spell school directly from the Spell Trigger menu. Can anyone else confirm?

#17 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 27 October 2011 - 04:45 PM

I have done some more testing on this, and I cannot reproduce the issue. Putting Spell Immunity in Spell Trigger works correctly as intended by the hack - when you place spells into the trigger, you directly choose the spell school. I am not sure what's going on here. If anyone else gets an issue with this not working, please say so.

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


#18 The Cow King

The Cow King
  • Member
  • 19 posts

Posted 14 November 2011 - 11:07 AM

According to your screenshots, it looks like this hack is just not working (since you should be able to select the spell school directly from the Spell Trigger menu. Can anyone else confirm?


Works just as intended for me on ToBEx v21, just tested while checking to see if I need the "individual spell immunity versions" component from SCSII (which is now an obsolete component, if installing ToBEx before SCSII).

SCSII however, uses ToBEx v19 (redistributable), so players using ToBEx that comes along with SCSII v19 will not be able to select the immunity school in the trigger/contigency screen. Instead, they get the immunity school selection after using the trigger/contigency (the case above).

Edited by The Cow King, 14 November 2011 - 11:13 AM.


#19 DavidWallace

DavidWallace
  • Validating
  • 337 posts

Posted 17 November 2011 - 01:28 AM

On ToBEx 21, with no other mods installed, I find that Nalia's and Imoen's Contingency/Trigger select screens don't show the spells in their spellbook. It's cosmetic (the spells are there, but not showing up). I don't have the same problem with Edwin, or with a sorcerer, mage, or thief -> mage PC. It stops happening if I disable this component.

#20 The Cow King

The Cow King
  • Member
  • 19 posts

Posted 17 November 2011 - 06:45 AM

On ToBEx 21, with no other mods installed, I find that Nalia's and Imoen's Contingency/Trigger select screens don't show the spells in their spellbook. It's cosmetic (the spells are there, but not showing up). I don't have the same problem with Edwin, or with a sorcerer, mage, or thief -> mage PC. It stops happening if I disable this component.


Does this only happen to you with no other mods installed, or with other mods installed as well? Because on my setup (with ToBEx 21), they show up and everything works fine (at least from ToB fate spirit summoning).

Weidu log:
Spoiler


TobEx Core & Tweak:
Spoiler


I also have the polytope and -agris- SCSII fixes installed, and removed the entry SPWI510 from CONTINGX.2da with **** (+3 spaces).

Edited by The Cow King, 17 November 2011 - 06:49 AM.