1. SPS Accounts:
    Do you find yourself coming back time after time? Do you appreciate the ongoing hard work to keep this community focused and successful in its mission? Please consider supporting us by upgrading to an SPS Account. Besides the warm and fuzzy feeling that comes from supporting a good cause, you'll also get a significant number of ever-expanding perks and benefits on the site and the forums. Click here to find out more.
    Dismiss Notice
Dismiss Notice
You are currently viewing Boards o' Magick as a guest, but you can register an account here. Registration is fast, easy and free. Once registered you will have access to search the forums, create and respond to threads, PM other members, upload screenshots and access many other features unavailable to guests.

BoM cultivates a friendly and welcoming atmosphere. We have been aiming for quality over quantity with our forums from their inception, and believe that this distinction is truly tangible and valued by our members. We'd love to have you join us today!

(If you have any problems with the registration process or your account login, please contact us. If you've forgotten your username or password, click here.)

Near Infinity, Scripts, and Spell Strings...

Discussion in 'Icewind Dale 2' started by The_Mad_Godling, Feb 21, 2005.

  1. The_Mad_Godling Gems: 1/31
    Latest gem: Turquoise


    Joined:
    Apr 20, 2001
    Messages:
    3
    Likes Received:
    0
    [​IMG] I've downloaded and setup Near Infinity. I can now edit the script files. It seems that the scripting system is drastically different from IWD, and IWD HoW.

    Previously, to enter a spell it was simply, "WIZARD_MAGIC_MISSILE" or "WIZARD_CHROMATIC_ORB"

    Now it seems to be, "WIZARD_MAGIC_MISSILE - 2112" and "WIZARD_VITRIOLIC_SPHERE - 2424" with each spell having its name, and a number in addition.

    Does anyone have a list of these? It would seem to be impossible to add any other spells to a script other than those already listed, as without the spell number I'm not sure it would work. I so far haven't been able to edit any spell files in Near Infinity either, but if there is a way could someone post here and inform me?

    Thanks in Advance.

    Here's what I've worked out so far.

    Back in IWD, IWD-HoW, you used:

    IF
    See(NearestEnemyOf(Myself))
    HaveSpell(WIZARD_MELFS_ACID_ARROW)
    THEN
    RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_MELFS_ACID_ARROW)
    END

    IF
    See(NearestEnemyOf(Myself))
    HaveSpell(WIZARD_FLAME_ARROW)
    THEN
    RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_FLAME_ARROW)
    END

    Which is pretty simple. Essentially, it says, "If you see a "Nearest Enemy", cast Melf's Acid Arrow on it, when you run out, start casting Flame Arrow. And so forth.

    IWD2 is very different. The previous way is actually quite cumbersome, as I figured out making that script originally. What they've done looks like this:


    IF
    ForceMarkedSpell(MARKED_SPELL)
    SetSpellTarget(Nothing)
    ActionListEmpty()
    See(MyTarget,0)
    THEN
    RESPONSE #100
    MarkSpellAndObject("242221122211242224242312251126122303",LastMarkedObject,SPELLCAST_IGNORE_SEE | SPELLCAST_IGNORE_VALID_SPELL_TARGET) // WIZARD_MORDENKAINENS_FORCE_MISSILES - 2422, WIZARD_MAGIC_MISSILE - 2112, WIZARD_MELFS_ACID_ARROW - 2211, WIZARD_MORDENKAINENS_FORCE_MISSILES - 2422, WIZARD_VITRIOLIC_SPHERE - 2424, WIZARD_SLOW - 2312, WIZARD_SHROUD_OF_FLAME - 2511, WIZARD_OTILUKES_FREEZING_SPHERE - 2612, WIZARD_FLAME_ARROW - 2303
    MarkSpellAndObject("2118",LastMarkedObject,SPELLCAST_IGNORE_SEE | SPELLCAST_IGNORE_VALID_SPELL_TARGET) // WIZARD_CHROMATIC_ORB - 2118
    Continue()
    END

    All of the stuff I have bolded is actually comment, anything that appears on a line after the // is just a comment, and it's left there as a way of showing which spells are cast, in which order. The part where it says,

    MarkSpellAndObject("242221122211242224242312251126122303",

    Is where it actually lists which spells to cast and in what order. For example, the 2422 at the beginning is for Mordenkainen's Force missiles, and the 2112 after it is for Magic Missile. Each spell seems to have a 4 digit number that represent it in code, which is much less cumbersome than typing out spell names in Capital letters with underscores. That is, IF you have the reference list to go by. The other thing they do to make it less cumbersome, is instead of having to make a seperate code block for each additional spell, they just use the markedspell() function. Which is very nice because you set up the "situation" code block, then just enter all the spell numbers you want cast in that situation. I'm sure it would be relatively easy to do a situation code block like,

    IF
    NearestEnemyType(Troll)

    THEN

    MarkedSpell(numbers for Melfs Acid Arrow, Flame arrow, etcetera)

    That would allow your caster to attack trolls with acid/fire spells specifically, and not waste Magic Missile on them, the way they do when they're already on the ground.

    So if anyone can support me by giving me a list of which spell numbers are for what, I'd greatly appreciate that. Here's what I've got so far:

    2422 WIZARD_MORDENKAINENS_FORCE_MISSILES
    2112 WIZARD_MAGIC_MISSILE
    2211 WIZARD_MELFS_ACID_ARROW
    2424 WIZARD_VITRIOLIC_SPHERE
    2312 WIZARD_SLOW
    2511 WIZARD_SHROUD_OF_FLAME
    2612 WIZARD_OTILUKES_FREEZING_SPHERE
    2303 WIZARD_FLAME_ARROW
    2118 WIZARD_CHROMATIC_ORB

    I'm also thinking it may be possible to include spells by using their name. Take a look at this block of code:


    IF
    HaveSpell(WIZARD_STONESKIN)
    HPPercentLT(Myself,50)
    IsSpellTargetValid(Myself,WIZARD_STONESKIN,0)
    THEN
    RESPONSE #100
    Spell(Myself,WIZARD_STONESKIN)
    WaitAnimation(Myself,WALK)
    WaitAnimation(Myself,CONJURE)
    WaitAnimation(Myself,CAST)
    END

    It doesn't use a reference number, but instead calls the spell directly by name instead of reference number. Granted, it's inside a function, but it's possible that the numbers are unnecessary.

    [ February 21, 2005, 10:50: Message edited by: The_Mad_Godling ]
     
  2. Lynx Lupo Gems: 6/31
    Latest gem: Jasper


    Veteran

    Joined:
    Sep 21, 2003
    Messages:
    154
    Likes Received:
    3
    Gender:
    Male
    If anyone else stumbles upon this same question, the answer is simple. The numbers correspond to spell.ids entries like in other games. First digit is indicative of the spell type as before (dictating the spell filename prefix - spin, spwi ...), the others numbers used in the name. So MM at 2112 is actually SPWI112.spl and so on.

    http://gemrb.org/iesdp/files/ids/iwd2/spell.htm
     
Sorcerer's Place is a project run entirely by fans and for fans. Maintaining Sorcerer's Place and a stable environment for all our hosted sites requires a substantial amount of our time and funds on a regular basis, so please consider supporting us to keep the site up & running smoothly. Thank you!

Sorcerers.net is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to products on amazon.com, amazon.ca and amazon.co.uk. Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.