As the title says. I had a plan for a quest, only to figure out at the end that I cannot cast light at an enemy. I cannot change this. It's already too far ahead. Any solution?
Thanks a lot.
As the title says. I had a plan for a quest, only to figure out at the end that I cannot cast light at an enemy. I cannot change this. It's already too far ahead. Any solution?
Thanks a lot.
I think you'll need to edit spells.2da, and change the TargetType column of the Light spell to include enemies. It's a bitwise number, so you add up all of the valid targets and use that total number:
Well, now that I look at it, I don't see an "enemies" there...
Maybe instead the Category needs to be changed to Harmful_Touch?
Or HostileSetting changed to 1.
now that I look at it, I don't see an "enemies" there...
Or HostileSetting changed to 1.
When I tried to add weapons firing ammo without overriding the slings and crossbows, I thought about using a spell for the trail, and "creatures" is good for enemies with HostileSetting set to 1.
Thanks for the info. I'll test it soon. Uhm, any way I could use this particular setting on the spells.2da only in one module of my campaign? I heard 2da files don't work from module directory. I wonder if a variable could be set there somehow on the modules properties? Or does anyone know if spells2da work from hak? That way I could associate a separate hak on this particular module.
Thanks MH. Good to know.
Alright, sells.2da collumn TargetType, I see what Tchos says, but it get confussing, Why do they add a letter there? Could it be that what makes the difference? For example:
Light = 0x2B
Lesser Restoration = 0x2B
While,
Harm = 0x2A
Greater Spell Breach = 0x2A
Some other include 0x2E or 0x2F.
All with 0x02 have a letter included. I guess it defines what we're talking about. From a quick search all buffs have the B. While all harmful spells have the A. The documentation about the 2da doesn't state anything about these letters, but I'll give it a shot and try the A on light.
Scrap that. If you change the B to A not even the PC can be targeted with the spell.
The letter is part of the number -- it's a hexadecimal number. 0x2B = 2B = 43 in decimal, which is 32, 8, 2, and 1 added together. (Self, creature, items, and placeables).
Ah, so it shouldn't change anything.
Anyway, I did some trial and error.
Hostile setting allows indeed an enemy to be targeted. But it doesn't allow friendly target anymore. I changed the category to 2 = Harmful_Ranged, causing the same thing.
The category should play some role, right? But the light spell on the 2da has a default setting ****. On the documentation it doesn't state what this is for. Anyone knows?
Funny thing I noticed, from the document on spells.2da: "I have no idea how it is decided if one potion is a healing, beneficial or otherwise potion. iprp_spells.2da doesn't help. Speculation:" then goes on guessing. These are ChazM's notes
. I guess developers had a hard time figuring out stuff as well.
http://nwn2.wikia.com/wiki/Spells.2da
category is used by the AI. ... i'd try a custom light script; you'll never get a spell to be targettable on friendlies and hostiles without two separate spells. Or changing the spellscript,
... even then it won't actually "target" both
Healing spells can target both allies and hostiles (or at least, hostile undead). All the non-mass healing spells seem to have a TargetType of 0x2B, and a Category of 5. They're not flagged as hostile though.
However, I notice the following note in the TargetType field description on the wiki:
"...certain rows are hard coded to ignore this and do both at once..."
I suppose healing spells might be some of those hardcoded spells (the dreaded 'H' word).
i wonder if NwNx4 can be used to Liberate some of those issues
That's out of my league. I guess I'll go with the solution to only cast on enemies. At least for now. Good thing is that the module I need this is the one that contains only the world map encounters, therefore no really dark areas. Mostly exteriors. Hopefully it won't be a problem. Thanks for the help
.