What ids to use for new spells?

Discussion in 'General Modification' started by Rudy, Mar 16, 2015.

Remove all ads!
  1. marc1967

    marc1967 Established Member

    Joined:
    Jan 19, 2014
    Messages:
    578
    Likes Received:
    60

    :hug:
     
  2. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    It worries me, though. I mean, why 802? It seems so completely arbitrary; enough so that I'm concerned there may have been a reason for it.
     
  3. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Can you upload a set of files that makes the game crash? I haven't been able to reproduce it. Or does that happen when you actually cast? Either way would be useful.
     
  4. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    It only crashes when you try to cast the spell. If that doesn't work for you, let me know, and I'll create and upload a set of crashable files as you request.
     
  5. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Nope, can't get it to crash. Lucky me :)
    Though I do have problems getting them to be learnable, I guess it's part of the same bug.
     
  6. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Hmm... ok, sorry. When I get home (in about five hours), I'll set something up that crashes for me.
     
  7. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Sitra,

    The crash file is attached. The spell, Snowball Swarm, is at index 803, where I moved it to from where I had it at 799.

    When at 799, it works fine on scrolls, and the wizard can choose it as a spell upon leveling up.

    When at 803, it does not show up on the Wizard's spell list (to choose from when leveling), and the wizard cannot cast it from the scroll normally. When I force a casting from the scroll via UMD, a CTD results.


    More importantly, I think I figured out WHY 802. The spell.mes file had "Dispel Magic Target" and "Dispel Magic Area" at index 800 and 801. I had mistakenly thought that these were spells created by Co8 (based on this post). However, looking at the "Temple of Elemental Evil.tfm" file indicates that they are original spells, even if they seem not to do anything.

    Which means that 801 is the last index of any spell originally created by Troika. So a coherent theory would be that they had the index of spells FIRST, and then said "Hey, we only created spells up to 801, so we can just create the array to hold 802 spells; no need to leave room for adding more in the future".

    As an aside, this means I'm going to lower the index on the custom spells of Scintillating Sphere and Great Shout; I had previously overwritten the Dispel Magic Target and Dispel Magic Area, errantly thinking they were not-implemented Co8 spells. But, since they are originals, safer to leave them be, even if calling them seems not to do anything.
     

    Attached Files:

    Last edited: Mar 25, 2015
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Um, it works :p lovely spell btw.

    Though I added it via spell_known_add - was I supposed to scribe a scroll? There's no proto for it that I've seen.

    The 802 explanation makes sense, nice find. Though it doesn't really help solve the issue. Again, I've found one place where it allocates 802 entries, but that was a crafting related function (the function that sets the caster level for crafted items, btw), not a spell cast function.
     
    Last edited: Mar 25, 2015
  9. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    oh, no; I didn't want to give you a whole protos.tab file just to give you a scroll, but I can do that.

    Let me try it out with spell_known_add, and see what results I get. If you level a wizard, as opposed to using spell does the spell "Snowball Swarm" show up on the list of 2nd level spells to add for you?
     
  10. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    So, I confirmed that if you use spell_known_add it works fine. (Didn't know about that command, by the way, so thanks)

    However, it's not properly on the wizard spell list. It's not selectable when you level up as a spell to learn.

    I'm attaching another version with the protos.tab included; item 9699 is the relevant scroll. The wizard cannot cast from the scroll, even if you use spell_known_add to teach him the spell, because the spell is not on his class spell list properly. If you use UMD to activate the scroll, it gives the CTD.
     

    Attached Files:

  11. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Here's one more, that includes another non-functional. I moved the internal spell, resist cold, from 592 to 805, and the associated items, such as item id 8049, went from being functional, to causing CTDs.

    This file includes the stuff from the previous one as well.
     

    Attached Files:

  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    No, I don't. I'll try to use that as an achor for debugging in the meanwhile.

    edit: was in reponse to two posts above in case it wasn't clear ;)

    BTW, I suspect you left the Fox's cunning name by accident :p
     
  13. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    Left it on what?

    *confused*

    OH! I didn't give you the description.mes file in the .zip *facepalm* So, yeah, the descriptions would all be wrong, sorry. I have it correct in my files, I was just trying to minimize the number of files you had to deal with.
     
  14. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,613
    Likes Received:
    537
    Ok that crashed it alright. Now to find out where, and fix it :)

    I was talking about spell.mes actually. Check out what it says instead of Fox's Cunning, heh.
     
  15. Rudy

    Rudy Established Member

    Joined:
    Jan 30, 2005
    Messages:
    345
    Likes Received:
    2
    I really don't know what you're referring to, unfortunately... at which spell id?
     
Our Host!