Jump to content


Photo

Unregistered Spells and scripting


  • Please log in to reply
5 replies to this topic

#1 Alan M.C.

Alan M.C.

    What I can have a title?

  • Member
  • 327 posts

Posted 04 May 2003 - 10:12 PM

I need help on a tough one. I have a fighting script for an NPC MOD and some spells (Like Balth02.spl) does anyone knows how to integrate the spell "as is" (without renaming it first to the standard spclxxxx.spl or spwixxx.spl).

If I do the following script

IF
HaveSpell(Balth02)
THEN
RESPONSE #100
Spell(Myself,Balth02)
END

The script when compiled shows HaveSpell(0) Spell(Myself,0) and BGII hangs.

So far, I was renaming the spells and appending the spell.IDS, which works fine but I'd really could do with having these odd names. I know most of the creature script use these names but I do not know how they do it!

Alan M.C.

#2 Dyara

Dyara
  • Member
  • 262 posts

Posted 05 May 2003 - 01:43 AM

Some of the spell-related actions/triggers have an equivalent that uses the ressource name rather than the spell number. Usually they have a RES in its name. Just check the ToB versions of ACTION.IDS and TRIGGER.IDS. However I donīt know if thereīs a SpellRES() or a HaveSpellRES().

Spell() and HaveSpell() need a number or an entry of SPELL.IDS. If the compiler doesnīt find Balth02 in SPELL.IDS then it should give you an error. Just replacing Balth02 with 0 without any warning seems not very good (what compiler are you using?).

These actions/triggers that use the ressource name donīt exist in the SoA version of ACTION.IDS/TRIGGER.IDS but they exist also in SoA. So if you donīt have ToB just use the ToB versions of that two files to compile the script and it will work in SoA without problems.

#3 Alan M.C.

Alan M.C.

    What I can have a title?

  • Member
  • 327 posts

Posted 05 May 2003 - 03:02 AM

Hi Dyara,

Action.ids and Trigger.ids have SpellRES() and HaveSpellRES() respectively but I could not compile with IE Script Editor V.1.0 the following:

IF
HaveSpellRes("BALTH02")
THEN
RESPONSE #100
SpellRES("BALTH02",Myself)
END

First, it compiles but gives the following result when I re-open the BCS file:
HaveSpell(0) Spell(0)
Secondly, it does not work in the game either.

I know some people used it Weimer in Solaufein and most of the creatures in TOB (like Balthazar). When I also open these scripts, they show me eg: solar stance in Batlhft.bcs Spell(0). I wonder if my scripting editor has anything to do with it or if my miss a point somewhere.

If anybody knows what to do, let me know.

Alan M.C.

#4 -Sim-

-Sim-
  • Guest

Posted 05 May 2003 - 03:46 AM

IE Script Editor uses the IDS files in the script compiler directory, not the override, so you will need to update those as well. Personally, I would suggest that you leave it, and stick with either Near Infinity or the DLTCEP/WeiDU combination for script editing.

#5 Alan M.C.

Alan M.C.

    What I can have a title?

  • Member
  • 327 posts

Posted 05 May 2003 - 05:09 AM

Hi Sim,

Actually, IE Script editor works fine. I have identified the problem on using RES. The following script worked in my MOD:
IF
InParty(Myself)
THEN
RESPONSE #100
SpellRES("BALTH03",Myself)
END
Casted dragon fist on myself.

The problem lies with HaveSpellRES(). According to the IDS file it uses S:Spell* when SpellRES(S:RES*) and Spell(I:Spell*Spell). That's the only reference to S:Spell* in all ids files!

If anybody knows what S:Spell* is supposed to be let me know as I did the following tests with (BALTH03 appended in spell.IDS) and I got the result:
HaveSpellRES("BALTH03") -> game crash
HaveSpellRES(BALTH03) -> does nothing
HaveSpell(BALTH03) -> does nothing
HaveSpell("BALTH03") -> game crash

Cheers,
Alan M.C.

#6 -Alan M.C.-

-Alan M.C.-
  • Guest

Posted 06 May 2003 - 09:33 AM

After a bit of research HaveSpellRES("BALTH03") works in any NPC script.

The problem lied in the spell itself. The original spl file reports level 6, by replacing Level 6 by level 1 next to innate, it started working. Besides, the casting time should also be set 0 (I think!).

Very usefull since more and more spells are appearing with various MODs and the duplication of spell names appeared inevitable in the IDS entry.

Secondly, this makes it possible to use any spell an NPC (Dragon breath....)

Alan M.C.