Author Topic: Is it possible to make an innate spell work in script?  (Read 2214 times)

Offline ServantofAuril

  • Planewalker
  • *****
  • Posts: 21
Is it possible to make an innate spell work in script?
« on: October 13, 2005, 12:59:57 AM »
I've delved into a long list of tutorials and practically every script in BG1, but I still cannot find an answer to my question.

Like before, I'm still working on my mod and I have run into this problem.  I'm trying to make a simple modification to a spell by using DLTCEP and editing the spell "Summon Dread Wolf" which is an innate ability.  I have changed everything accordingly like a tutorial I read said to.  I changed the name of the spell, the creature being summoned to a GIRL, and also gave the NPC all of the spell abilities in the Spells and items tab.  Where I keep messing up is when I go to write the script which I borrowed from "MAGE1.BCS" and simply add this:

Code: [Select]
IF
   See(NearestEnemyOf(Myself))

THEN
   RESPONSE #100
     
   Spell(Myself, INNATE_SUMMON_GIRL)
END


I added all this and got a compile error that said something like "It was not in the SPELL.IDS".  However, I put it in the SPELL.IDS before even writing the script "3999 INNATE_SUMMON_GIRL".  What gives? 

How come the script fails to recognize me putting this custom line in the SPELL.IDS file?



Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Is it possible to make an innate spell work in script?
« Reply #1 on: October 13, 2005, 11:19:55 AM »
Try removing the space after the comma.
Earn Money Sleeping.

Offline ServantofAuril

  • Planewalker
  • *****
  • Posts: 21
Re: Is it possible to make an innate spell work in script?
« Reply #2 on: October 13, 2005, 11:42:14 AM »
Try removing the space after the comma.


Removed the space from it, but still no luck.  It still gives me the same error.  "Cannot find in SPELL.IDS".  Is it possible I have to also add this to a .tbp file first?



Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 832
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: Is it possible to make an innate spell work in script?
« Reply #3 on: October 13, 2005, 12:08:42 PM »
spell.ids has a specific naming convention, which I can not recall offhand. The first number determines the type (SPCL, SPPR, SPWI, SPIN) and the rest is the actual spell number. So basically the engine sees you invoking INNATE_SUMMON_GIRL, which it looks up in spell.ids as 3999. Then it goes looking for spin999 (or spwi999 or sppr999 or spcl999 or whatever the 3 represents) and can't find it.

edit: Found it; 3xxx are SPIN spells. So it's looking for SPIN999.spl.
« Last Edit: October 13, 2005, 12:10:49 PM by CamDawg »
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Is it possible to make an innate spell work in script?
« Reply #4 on: October 13, 2005, 12:41:34 PM »
What's a .TBP file, btw?
Earn Money Sleeping.

Offline ServantofAuril

  • Planewalker
  • *****
  • Posts: 21
Re: Is it possible to make an innate spell work in script?
« Reply #5 on: October 13, 2005, 12:49:06 PM »
spell.ids has a specific naming convention, which I can not recall offhand. The first number determines the type (SPCL, SPPR, SPWI, SPIN) and the rest is the actual spell number. So basically the engine sees you invoking INNATE_SUMMON_GIRL, which it looks up in spell.ids as 3999. Then it goes looking for spin999 (or spwi999 or sppr999 or spcl999 or whatever the 3 represents) and can't find it.

edit: Found it; 3xxx are SPIN spells. So it's looking for SPIN999.spl.


Ok, I think I am beginning to understand a little bit how this works.  However, if I did a custom spell called "GRLSUM" how would I go about putting that in the SPELL.IDS?  Since this is a custom spell I am trying to use, or would I just follow the naming convention of SPELL.IDS and change 3999 to something else similar to the original spell I edited which was Monster Summoning?

BTW - heh thanks for catching that one for me Ghreyfain.  I meant "tp2" as opposed to "tbp".  Caffeine can sometimes make one delirious at times.  :P




Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Is it possible to make an innate spell work in script?
« Reply #6 on: October 13, 2005, 01:05:54 PM »
You can't call GRLSUM or anything other than SPIN/WI/PR/CL* from the spell.ids file.  What you need is the SpellRES() set of actions and triggers.  They even work in SoA if you add them to action.ids manually.

Basically, where before you'd have Spell(Player1,WIZARD_MAGIC_MISSILE) you'd have SpellRES("spwi113",Player1). Magic Missile might be something other than spwi113.spl, but you get the idea.  It's the filename you use, not an IDS entry.

So for your spell, you'd have SpellRES("grlsum",Player1).
Earn Money Sleeping.

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 832
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: Is it possible to make an innate spell work in script?
« Reply #7 on: October 13, 2005, 01:11:27 PM »
Except that this is for BG, which doesn't have the RES actions available. :) You'll need to use the naming conventions, unfortunately.
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Is it possible to make an innate spell work in script?
« Reply #8 on: October 13, 2005, 01:13:55 PM »
Oh, yes.  Maybe I should pay attention instead of skimming.
Earn Money Sleeping.

Offline ServantofAuril

  • Planewalker
  • *****
  • Posts: 21
Re: Is it possible to make an innate spell work in script?
« Reply #9 on: October 13, 2005, 01:34:34 PM »
Hmm let me get this straight in my head first off before I proceed:  So Ghreyfain is saying to use "SpellRES" instead of just "Spell" but since I am using BG1 I cannot do this?  It sounds a whole lot better than referencing the ID imo.

Also CamDawg is saying to use the naming convention already in place, so would I simply change my spell name filename which is right now GRLSUM to maybe SPINXXX?  I still can't understand how this naming scheme thing works.  Anyway, what my point is, do I change the filename of the spell, or do I leave the filename the same and just change the SPELL ID in the .IDS file?

Such as:  3999 INNATE_SUMMON_GIRL becomes SPIN01 or something?


Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Is it possible to make an innate spell work in script?
« Reply #10 on: October 13, 2005, 01:58:08 PM »
No, 3999 would become SPIN999.  3 is for INnate, 2 is for WIzard, 1 is for PRiests, and 4 is for CLass abilities.  That's mean you have SPIN(nate)*.spl, SPWI(zard)*.spl, etc., with * being the 2nd-4th numbers in the IDS field.
Earn Money Sleeping.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: Is it possible to make an innate spell work in script?
« Reply #11 on: October 13, 2005, 02:09:55 PM »
Hmm let me get this straight in my head first off before I proceed:  So Ghreyfain is saying to use "SpellRES" instead of just "Spell" but since I am using BG1 I cannot do this?  It sounds a whole lot better than referencing the ID imo.

That's the short version of why some people find developing new content for Tutu more appealing than developing new content for BG1. The engine got a lot more accessible in that ~3 year span.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Is it possible to make an innate spell work in script?
« Reply #12 on: October 13, 2005, 02:21:08 PM »
Oh, hey, you're right.  I can't believe I'm not pimping Tutu.

Mod for Tutu!  It's great!

http://www.pocketplane.net/tutu
Earn Money Sleeping.

Offline ServantofAuril

  • Planewalker
  • *****
  • Posts: 21
Re: Is it possible to make an innate spell work in script?
« Reply #13 on: October 13, 2005, 03:20:16 PM »
Great, thanks to you both.  You are all my heroes as of now!  :D

Offline cirerrek

  • Planewalker
  • *****
  • Posts: 92
Re: Is it possible to make an innate spell work in script?
« Reply #14 on: October 13, 2005, 07:50:43 PM »
I haven't personally tried it, but in my scripting notes I have a comment that says that the the SpellRES actions and triggers are potentially portable to all versions of the infinity engine.

You'd have to add them to the triggers and action.ids files then compile the scripts using the newly added triggers. 

Worth a shot at least.   Let us know if it works :)

Offline balduran

  • Supremacy of the Metal Kingdom
  • Planewalker
  • *****
  • Posts: 271
  • Gender: Male
  • Photo - useless. Inner beauty - questionable.
    • BG2 Improvements Mod by Victor and azure NPC Romance
Re: Is it possible to make an innate spell work in script?
« Reply #15 on: October 14, 2005, 04:14:15 AM »


Code: [Select]
IF
   See(NearestEnemyOf(Myself))

THEN
   RESPONSE #100
     
   Spell(Myself, INNATE_SUMMON_GIRL)
END


How come the script fails to recognize me putting this custom line in the SPELL.IDS file?




Here's how your code will work:
Quote
IF
   See(NearestEnemyOf(Myself))
   
THEN
   RESPONSE #100
     ForceSpellRes(Myself,myspell)
END

Where 'myspell' is the name of the spell without the .spl extension. Though you'd need to append ForceSpellRes to the Action.ids if you do not habe ToB.
Ask not! Dominate!

http://balduran.blackwyrmlair.net

-- BG2 Improvements
-- Azure NPC Romance

"In the end, my girlfirend became my arch-enemy, my arch-enemy became my best friend, and my best friend became my girlfriend. But hey - that's high school!"

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: Is it possible to make an innate spell work in script?
« Reply #16 on: October 14, 2005, 11:14:30 AM »
My notes also say that pst and bg1 can also accept the *RES actions/triggers.
But i have to admit, i don't remember if i tested it.

Offline ServantofAuril

  • Planewalker
  • *****
  • Posts: 21
Re: Is it possible to make an innate spell work in script?
« Reply #17 on: October 14, 2005, 12:16:56 PM »
Just wanted to drop in an update here to this thread pertaining to my now solved problem.

After extensive testing with regards to what was suggested and information given to me by you fine members of this modding communuity, I finally managed to get my custom spell working properly.  Not to mention gain a better understanding of the IE in the process.  My thanks to you all.

Here is the code I used in the Class script of the NPC:


Code: [Select]
IF

   See(NearestEnemyOf(Myself))

THEN
   RESPONSE #100

  ForceSpell(Myself, INNATE_SUMMON_GIRL)
END


Success!  Everything worked like clockwork, as they say.  I also got the chance while I was frustrated with this little problem to check out other mods of the community (including Tutu which was mentioned earlier) that increased my understanding of modding even more.


So thanks again everyone.  I'll keep you posted on the mod I am doing, though I don't know how to go about sharing it on this site since there doesn't appear to be a files section.  Oh well, still I'll cross that bridge when I get to it.

:) 




Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: Is it possible to make an innate spell work in script?
« Reply #18 on: October 25, 2005, 03:33:35 AM »
Guess you renamed your spell to follow the SPIN*** convention and added it to spells.ids
But you haven't really shared that info :)

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: