The Black Wyrm Lair Forums
The Black Wyrm's Lair Terms of Use Help Search Members Calendar

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to activate "hidden" BG1 TotSC script actions, Research by drake127 & Baronius
Baronius
post Jun 5 2005, 06:21 PM
Post #1


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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.


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
drake127
post Jun 5 2005, 07:13 PM
Post #2


self-employed modder


Contributor
Posts: 41
Joined: 8-May 05
From: Jihlava, Czech Republic




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).
Go to the top of the page
 
Quote Post
Baronius
post Jun 5 2005, 07:22 PM
Post #3


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
drake127
post Jun 5 2005, 07:46 PM
Post #4


self-employed modder


Contributor
Posts: 41
Joined: 8-May 05
From: Jihlava, Czech Republic




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.
Go to the top of the page
 
Quote Post
igi
post Jun 5 2005, 08:02 PM
Post #5


IESDP Guardian


Forum Member
Posts: 175
Joined: 22-July 04




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


--------------------
Go to the top of the page
 
Quote Post
Baronius
post Jun 5 2005, 09:26 PM
Post #6


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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.


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
Baronius
post Jul 16 2005, 07:23 PM
Post #7


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
Baronius
post Jul 16 2005, 07:25 PM
Post #8


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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\*)~


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
Avenger_teambg
post Jul 17 2005, 12:40 PM
Post #9





Forum Member
Posts: 78
Joined: 13-July 05




Any other actions that are missing from the list?


--------------------
See GemRB !
Go to the top of the page
 
Quote Post
Baronius
post Jul 17 2005, 04:16 PM
Post #10


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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.


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
Avenger_teambg
post Jul 23 2005, 06:55 PM
Post #11





Forum Member
Posts: 78
Joined: 13-July 05




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.

This post has been edited by Avenger_teambg: Jul 23 2005, 06:55 PM


--------------------
See GemRB !
Go to the top of the page
 
Quote Post
Baronius
post Jul 23 2005, 10:28 PM
Post #12


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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.


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
Avenger_teambg
post Aug 8 2005, 05:27 PM
Post #13





Forum Member
Posts: 78
Joined: 13-July 05




Ok, what about triggers, i just made 0x0091 (SpellCastObjectRES(O:Object, S:ResRef) ) work.

This post has been edited by Avenger_teambg: Aug 8 2005, 05:28 PM


--------------------
See GemRB !
Go to the top of the page
 
Quote Post
jastey
post Sep 14 2008, 09:26 AM
Post #14





Forum Member
Posts: 1366
Joined: 22-August 04
From: Germany




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)?
Go to the top of the page
 
Quote Post
Baronius
post Sep 14 2008, 02:43 PM
Post #15


Master of energies
Group Icon

Council Member
Posts: 3307
Joined: 9-July 04
From: Magyarország




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


--------------------
Mental harmony dispels the darkness.
Go to the top of the page
 
Quote Post
jastey
post Sep 14 2008, 05:33 PM
Post #16





Forum Member
Posts: 1366
Joined: 22-August 04
From: Germany




Thank you very much! I will let you know when I updated the tutorial.
Go to the top of the page
 
Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:



- Lo-Fi Version Time is now: 18th May 2024 - 03:34 PM