Help - Search - Members - Calendar
Full Version: How to activate "hidden" BG1 TotSC script actions
The Black Wyrm's Lair - Forums > Mod development resources & discussion > Modder's Workshop
Baronius
drake127 has drawn my attention to the fact that some of the spellcasting script actions (SpellRES, ForceSpellRES etc.) work in BG1:TotSC, and that there are several "hidden" script actions which aren't in action.ids but would work in the game.
He has done a research which proved that many of these script actions work perfecly in BG1 TotSC. Based on his results, I have done additional testing on 8 scripting commands chosen from his list. These were:

31 SpellRES(S:ResRef*,O:Target*)
95 SpellPointRES(S:ResRef*,P:Target*)
113 ForceSpellRES(S:ResRef*,O:Target)
114 ForceSpellPointRES(S:ResRef*,P:Target)
160 ApplySpellRES(S:ResRef*,O:Target)
181 ReallyForceSpellRES(S:ResRef*,O:Target)
191 SpellNoDecRES(S:ResRef*,O:Target*)
192 SpellPointNoDecRES(S:ResRef*,P:Target*)


The summary of my experience:

After properly added to ACTION.IDS, these actions can be used in scripts which can then be compiled by using WeiDU.

When casting your spells with custom filenames (such as BBSW01.SPL), you have to be careful in case of SpellRES and SpellPointRES: they won't work if the filename is more than seven character long (the original SPL filenames of the game are exactly 7 characters long, by the way). So BB00SW01.SPL will not work but BB00S01.SPL or BB01.SPL will (they don't have to follow the SPWIxxx/SPPRxxx/etc. convention).

I've encountered only one difference between drake127's and my results: SpellNoDecRES worked properly for me, memorized spells were kept in the caster's memory, they weren't removed.
drake127
SpellNoDecRES worked properly also for me. Problem was SpellPointNoDecRES which behaved like SpellPointRES (removed spell from table of memorizated spells).

QUOTE(Baronius)
After properly added to spell.ids, these actions ca...
Spell.ids should not be changed. It is not related with these (neither other) actions.

I did not test Spell*RES functions with eight-character names but even seven-character names may not work if they are lowercase (bad: spwi215; good: SPWI215) or maybe if they are not same as they are write to character file (because these actions check if caster knows this spell).
Baronius
QUOTE
SpellNoDecRES worked properly also for me. Problem was SpellPointNoDecRES which behaved like SpellPointRES (removed spell from table of memorizated spells).
I see... I will test it again.

QUOTE
Spell.ids should not be changed. It is point of functions *RES. Action.ids is file to change.

I've accidently written Spell.ids in my post, certainly action.ids must be modified and not spell.ids. Thanks a lot for correcting me, it could have led to a misunderstanding.

QUOTE
I did not test Spell*RES functions with eight-character names but even seven-character names may not work if they are lowercase (bad: spwi215; good: SPWI215) or maybe if they are not same as they are write to character file (because these actions check if caster knows this spell).

For me, they were exactly written in the same way in the CRE file as in the script file, but spells with 8-character filenames don't work in case of SpellRES and SpellPointRES (they worked okay in case of the other 6 commands).
drake127
You are right, eight characters does not work but six character do.

SpellPointNoDec remove spell from table of memorizated spells also in its noRES version. It is a bug or I am wrong?

igi, you can add to IESDP note about these hidden functions.
igi
Yes, I can, and will.
However, I'd prefer a post in the IESDP update forum (even if the post just contains a link to this topic or something), so I don't have to check and remember every forum for IESDP updates. And a post is better than a PM, because I usually forget those as well... smile.gif

And yes, I still do maintain the IESDP, I'm just very, very busy. I did update my local copy with a few things today though :-)
Baronius
QUOTE(drake127)
You are right, eight characters does not work but six character do.

Right. The filenames can be up to seven characters. Beside with seven, I've tested it with 6 characters and with 2 as well.

QUOTE(drake127)
SpellPointNoDec remove spell from table of memorizated spells also in its noRES version. It is a bug or I am wrong?

It seems to be a bug. I tested it and it worked for me in the same way as for you.
Baronius
Okay here are the descriptions.


31 SpellRES(S:ResRef*,O:Target*)
95 SpellPointRES(S:ResRef*,P:Target*)
113 ForceSpellRES(S:ResRef*,O:Target)
114 ForceSpellPointRES(S:ResRef*,P:Target)
160 ApplySpellRES(S:ResRef*,O:Target)
181 ReallyForceSpellRES(S:ResRef*,O:Target)
191 SpellNoDecRES(S:ResRef*,O:Target*)
192 SpellPointNoDecRES(S:ResRef*,P:Target*)



31 SpellRES(S:ResRef*,O:Target*)
Casts a spell on target O object. S is always a maximum 7-character long SPL filename written with upper case, without the SPL extension. Additionally, the filename cannot consist only of numbers. The spell must be memorized by the caster. It is interruptible during casting. The spellcaster must meet the level requirements of the spell.
Warning: according to tests, it doesn't work reliably.

95 SpellPointRES(S:ResRef*,P:Target*)
Casts a spell on target P[x.y] point. S is always a maximum 7-character long SPL filename written with upper case, without the SPL extension. Additionally, the filename cannot consist only of numbers. The spell must be memorized by the caster. It is interruptible during casting. The spellcaster must meet the level requirements of the spell.

113 ForceSpellRES(S:ResRef*,O:Target)
Forces the object running the script to cast the spell specified by the S parameter. O is the spell's target object, S is always a SPL filename written with upper case, without the SPL extension. The spell cannot be interrupted and the caster does not need to have the spell memorized or even have the spell.

114 ForceSpellPointRES(S:ResRef*,P:Target)
Forces the object running the script to cast the spell specified by the S parameter. P is the spell's target [x.y] point, S is always a SPL filename written with upper case, without the SPL extension. The spell cannot be interrupted and the caster does not need to have the spell memorized or even have the spell.

160 ApplySpellRES(S:ResRef*,O:Target)
Instantly casts the spell on target O object. S is always a SPL filename written with upper case, without the SPL extension. Does not play the casting animations. The spell cannot be interrupted and area effect spells that target multiple objects will only affect the specified target object.

181 ReallyForceSpellRES(S:ResRef*,O:Target)
Forces the object running the script to cast the spell specified by the S parameter. The casting time is 0, the spell is cast instantly. O is the spell's target object, S is always a SPL filename written with upper case, without the SPL extension. The spell cannot be interrupted and the object does not need to have the spell memorized or even have the spell.

191 SpellNoDecRES(S:ResRef*,O:Target*)
Casts a spell on target O object. S is always a SPL filename written with upper case, without the SPL extension. The spell must be memorized by the caster, and it won't be removed from the caster's memory if cast via this action. It is interruptible during casting. The spellcaster must meet the level requirements of the spell.

192 SpellPointNoDecRES(S:ResRef*,P:Target*)
Casts a spell on target P[x.y] point. S is always a SPL filename written with upper case, without the SPL extension. The spell must be memorized by the caster. SpellPointNoDecRES shouldn't remove the spell from the caster's memory but according to tests this part does NOT work (the spell is cast but is also removed from memorized spells.) It is interruptible during casting. The spellcaster must meet the level requirements of the spell.


NOTES:
SpellRES does not always work reliably.

In case of SpellRES() and SpellPointRES(), the ResRef parameter, which is a filename, must be up to 7 characters long (just like all of the original game's spell files); if it's longer than 7 characters, the spell will not be cast, the command will not work. However, it does not have to follow the SPWIxxx (SPPRxxx etc.) file naming convention.

In case of SpellPointNoDecRES(), according to tests the spell is still removed from the caster's memory (from the memorized spells), it is probably a bug. So it works as if it were SpellPointRES (but unlike in case of that spell, here 8-character long filenames are accepted).
Baronius
The working TP2 code.

CODE
APPEND ~action.ids~ ~31 SpellRES(S:ResRef*,O:Target*)~
UNLESS ~SpellRES(S:ResRef\*,O:Target\*)~

APPEND ~action.ids~ ~95 SpellPointRES(S:ResRef*,P:Target*)~
UNLESS ~SpellPointRES(S:ResRef\*,P:Target)~

APPEND ~action.ids~ ~113 ForceSpellRES(S:ResRef*,O:Target)~
UNLESS ~ForceSpellRES(S:ResRef\*,O:Target)~

APPEND ~action.ids~ ~114 ForceSpellPointRES(S:ResRef*,P:Target)~
UNLESS ~ForceSpellPointRES(S:ResRef\*,P:Target)~

APPEND ~action.ids~ ~160 ApplySpellRES(S:ResRef*,O:Target)~
UNLESS ~ApplySpellRES(S:ResRef\*,O:Target)~

APPEND ~action.ids~ ~181 ReallyForceSpellRES(S:ResRef*,O:Target)~
UNLESS ~ReallyForceSpellRES(S:ResRef\*,O:Target)~

APPEND ~action.ids~ ~191 SpellNoDecRES(S:ResRef*,O:Target*)~
UNLESS ~SpellNoDecRES(S:ResRef\*,O:Target\*)~

APPEND ~action.ids~ ~192 SpellPointNoDecRES(S:ResRef*,P:Target*)~
UNLESS ~SpellPointNoDecRES(S:ResRef\*,P:Target\*)~
Avenger_teambg
Any other actions that are missing from the list?
Baronius
According to drake127's tests, these also work:
204 TakePartyItemNum(S:ResRef*,I:Num*)
215 FollowObjectFormation(O:Object*,I:Formation*,I:Position*)

There are some other actions that haven't been tested yet:
240 ReallyForceSpellDeadRES(S:RES*,O:Target)
318 ForceSpellRangeRES(S:RES*,O:Target)
319 ForceSpellPointRangeRES(S:RES*,P:Target)

HaveSpellRES() does not work.
Avenger_teambg
Wow, up to 215?
I'm sure all the rest in between should work.
Maybe even more, i believe that stuff common in iwd1 and bg2 is also in bg1.
(Since iwd1 code was passed to blackisle around the time bg1 was released).
This would work only in the last upgrade of bg1, i guess.
Baronius
The last release is the Original Saga, isn't it? (They changed the original Spider's Bane to something different sad.gif )
I just have stock BG1 plus TotSC... with final patch IIRC.
Avenger_teambg
Ok, what about triggers, i just made 0x0091 (SpellCastObjectRES(O:Object, S:ResRef) ) work.
jastey
I missed this when preparing my BG1 coding tutorial (link). Can I ask permition to include this into the tutorial?
Was any of the above tried for plain BG1 (without the TotSC)?
Baronius
I would be glad if you included them in your coding tutorial (and I'm sure drake127 wouldn't mind it either, if he was here).

Drake127 said that these only worked in BG:TotSC, so he might have checked BG1 (without TotSC) to a certain extent, but I don't know (I suppose they work only with TotSC).
jastey
Thank you very much! I will let you know when I updated the tutorial.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.