Question about WEIDU functions from a novice
seraglio
Member Posts: 122
Actually I'm not even a novice!
Up to this point I haven't bothered with weidu as I see it as a packaging/batch processing/productivity tool. For my little home projects I haven't needed those kind of functions.
I've kinda come up with an idea, a personal project that I might try if its feasible. I'm not going to outline all the details, precisely because its probably not feasible, especially if I can't use weidu to make the grunt work easier.
Basically imagine I'm writing my own personal version of Spell Revisions. I need to touch every spell in the game. For this project, I'd basically need to multiply every caster level entry in every spell 10x, the way Spell Revisions increased each spell to scale to level 50. Yeaah...
So take fireball, spwi304.spl. It has 6 "abilities" (sorry I'm still new and use NI not DLTCEP...I'm sure the later has a better description). These correspond with "minimum level", which I think is the minimum caster level for each ability within the spell; minimum caster level 1 (5d6), and caster levels 6-10.
I would need WEIDU to make copies these 6 "abilities", increasing the minimum caster level to a bogus number each time. So Fireball would have 66 entries/abilities, the current 6, another 6 starting at minimum level 101 through 106, another 6 with a minimum level of 201-206, and so on.
Spells with more minimum caster entries, that scale to level 20, like Armor of faith...same thing. Twenty new entries starting at 101-120, twenty new entries 201-220...etc.
I'd actually need this for EVERY spell in the game. Unfortunately, for my purposes, it doesn't matter whether I actually make any changes to some spells or not, all spells will need base, higher level entries as placeholders even if nothing else changes. My BG2 installation shows 4411 .spls. Hehe. Anyway, I assume Spell Revisions did something similar, and didn't do it by hand. So I'm hoping A: Weidu can run that task for me easily and more and B: drastically increasing the size of .spl files isn't going to kill performance, though I have to increase the size/depth with Weidu before I can do any performance testing. That's the minimum I need to know before I can even continue any theorycraft on the actual project.
0
Comments
And the extended headers you are referring to are pretty small, so I wouldn't worry about adding a lot of them. However, I'd be quite careful to refine the list of spells you modify to only involve spells that are actual cast by characters, rather than by the game at specific instances (for example, the Machine of Lum the Mad ability bonuses are each awarded via a spell). You could easily code a list of all spells you are interesting in modifying, and then have Weidu iterate through that list and make the requisite modifications.
You're trying to do some variation on metamagic, aren't you?
I think that Ardanis created something like an ADD_SPELL_HEADER macro for kit revisions
Edit: spelling (... and that is why i couldn't @ him...)
And you all got it, looking for a way to integrate "meta-magic" like features into spells, while not actually creating new spells. I've been very frustrated with some of the opcode functions and finally decided that all the time I spent trying to get specific functions to work the way "I" would like them to I could have probably just rewritten all the basic spells. Just looking at different ways of doing it with minimum impact and within the scope of my limited skills.
Another thing I'd like to do with it is expand Wild Mages. In short, I think the main useful mechanic of wild mages is their caster level variation. But because of the minimum caster level in most spells (and maximum), it goes un-utilised. Imagine a Neera that can actually cast a 1d6 fireball....with some pathetic animation and maybe summoning an angry mephit. And on the other end, conjuring a greater than 10d6 fireball ( I probably wouldn't go 15d6, since at level 20 that will always be conjured)...with a screenshake, possibly a wing buffet and burning damage over time. In the middle casting range....a chance of a frostball or lightningball instead of a fireball. All without assigning her custom spells....just bump her caster level up +500 and fill in the caster levels as desired from there. That's the idea. It should be usable for short term, single cast metamagic feats or kits that always have a variation on casting, like Necros with save penalties and modifications to their base necromancy spells like more powerful animate dead.
And yeah, I didn't want to touch spells that don't need it, but I want to be sure to account for things like assassin poison and bounty hunter traps that use caster level. And dispels. And anything else I'm not thinking about yet. Anything that has a single header, and is not castable by pcs/npcs could be skipped. Just trying to determine feasibility now.
There's a copy of ADD_SPELL_HEADER function in Detectable Spells library (at least in the version that ships with latest SR/IR). Or, if you prefer, here's the actual code:
PS *Scratches head* Actually, the way I read it now, it appears to have some cloning functionality as well, what do you know... It's been quite a while since I wrote that, so I don't exactly remember the context, but guess you can modify it to write new level requirements as it clones headers.
You cannot alter the casting level for innate spells anyway, nor can you alter the casting level of characters that do not normally receive access to priest/wizard spellbooks.
The only spells you really need to worry about are SPPR###, SPWI###, SPRA###, and any subspells they cast.
Unfortunately Caster level is capped and overflows at 255 back to 0.
A spell header/ability minimum level is not capped, but values above 255 can only be called through opcodes that can "Cast at Specific Level", and may or may not use the correct level if cast normally.
I've tried it before, so I know it is functionally doable, I just never managed something that wasn't cumbersome for the user, which I found to be the real challenge.