I knew I was messing something up.

Everything about ToME 2.x.x. No spoilers, please

Moderator: Moderator

Post Reply
Message
Author
Lord Estraven
Uruivellas
Posts: 718
Joined: Tue Dec 13, 2005 12:35 am

I knew I was messing something up.

#1 Post by Lord Estraven »

I think I've figured out one of the reasons that stability has been such a problem for me when modifing the Lua parts of the game

When I've modified various schools, I've often removed spells that have a wand or staff. Then the game would try to generate that wand or staff, and would crash because the spell for it didn't exist (thus "attempt to index a nil value").

This befuddled me, because I had figured that there was a single generic item type for a "Staff of Foo" or a "Wand of Bar" - like with spellbooks, with one of the item's traits determining exactly which spell it had in it. So it had to be some weird hardcoded stuff, right?

Nope. Turns out there is a separate item in k_info.txt for every type of wand or staff that can show up. So I had for instance removed the code for the Confuse spell, but Wands of Confuse were still on the item list, leading to crashes. Serves me right for my assumptions, I guess. :evil:

Post Reply