Can I give a kit the possibility to trigger a certain effect every time it scores a Critical Hit with a specific weapon (e.g., a mace)?
You would have to patch all weapons matching your criteria (e.g. maces), adding an equipping effect for 177 targeting your kit, and give the triggered .EFF the critical hit effect opcode with timing mode 2. Pretty sure that should work.
What about ranged weapons (e.g., bows)? I'd like to prevent this unintended side effect, but the following doesn't seem to work:
341 (critical hit effect) --> 249 (ranged hit effect) --> 146 (cast spell)
That only happens because those bracers are an equipped piece of clothing (bracers). If you put the crit effect into a melee weapon it will work fine, because when you switch to a missile weapon you "unequip" the melee weapon.
Sorry but I don't understand.... Are you saying it is possible to fix that issue for ranged weapons (it's never been an issue for melee weapons if I understood well, i.e.: opcode #248 is not needed....)? If so, how? As I said, my previous solution doesn't seem to work.....
Using Opcode 172 in Casting Features: spell doesn't appear anywhere to be cast
Using Opcode 172 in the effects: spell does nothing. It is not cast, the character just remains as it was about to take an action and comes back to normal.
---
Just to clarify what I want: to give a weapon to a kit. I've tried it through AP_Spell using Opcode #122 and it works... for a character created in Lv 1 (the level that I assign the AP_Spell).
If I create the character in BGEE or IWD, the weapon is there. If it is created in IWD, the weapon is there.
I'd like my kit to be able to deal additional magic damage (via opcode #12) whenever he/she scores a critical hit with bows. The problem is that this time I cannot strictly follow your previous advice (equipping 177 ---> 341 ----> .SPL with melee ability containing opcode #12) because I'd like to avoid that issue (i.e., "Ranged Weapons with Critical Hit Effects through opcode 341 trigger those effects immediately upon the attack roll, rather then when the weapon strikes its target, effect is preceding the cause".)
Having said that, I think the issue can be fixed by combining opcode #249 and #341 (summoning also @kjeron ........)
The problem: it installs perfectly in BG2EE, but fails to install in BGEE.
ERROR: Failure("resource [IDPRO282.PRO] not found for 'COPY'") Please make a backup of the file: SETUP-DEITIESOFFAERUN.DEBUG and look for support at: Raduziel
It's the exact same file with the exact same code for both games.
@Raduziel In BGEE, IDPRO282 is listed in PROJECTL.ids, but no such file exists in the game. ADD_PROJECTILE doesn't work if the projectile is already listed in PROJECTL.ids. Try using the projectile function I gave you earlier for it instead.
Let's say I wanna make an aura effect that affects every party member in a 10 ft radius (but not the "caster"), but only takes place during a combat (which means: start its effects when the combat starts, cease it, as well as removing its effects, once the combat ends).
Is it possible? Opcode 232 gives me options of Seeing Enemy and Attacked By, but my idea would be to fire this spell when YOU start attacking, not the other way around.
Edit: What I can do so far
10 ft radius: I'll use an adapted version of the Invisibility 10 ft projectile;
Except for caster: I'll use the "Exclude original caster" target for the spell;
The spell per se;
The aura effect;
Which means that my problem is the firing condition.
How do I make an event trigger upon resting (like the dreams, for instance), and one just after resting (Like the post-dream dialogues that we see in many mods)? I could only find one trigger (0x0093 PartyRested()) that, I assume, does one or the other
I've come up with some hex edits to the BG2EE v2.5.16.6 exe in order to add some new LUA commands; my question is this: am I allowed to distribute a mod that directly modifies the executable of the game? I feel like this is a bit of a gray area in terms of acceptance, and I wanted to hear everyone's opinion before I move forward...
Edit: I'm sure the community wouldn't have a problem with it; I am more concerned about Beamdog taking issue with modifying their executable.
I can't say much about the legal situation today, but a good number of mods (e.g. TobEx, Widescreen mod or some PS:T mods) patched the game executable to add new features or remove certain restrictions back in the days without getting into trouble.
Well it's best to ask it directly to Beamdog in this situation. Theoretically we are not supposed to do reverse engineering and all that and modifying the executable kind of enter the area, but it is definitely Beamdog's call to make.
I would say they won't mind it, but best to ask them before you do the job rather than doing the job, publishing the mod and having it taken down because of legal issues.
1) Is it possible to allow a specific kit to use wizard scrolls and wands?
2) Is it possible to allow a specific kit to use wizard scrolls from a specific school only?
3) Is it possible to reproduce a specialist wizard's penalty to enemies for another wizard kit? And 15% bonus/penalty to learn scrolls? I know how to add the +2 resistance, restrict the use of items and the game automatically gives the extra spell slot (that IDK if can be target by @kjeron 's mod).
1) Is it possible to allow a specific kit to use wizard scrolls and wands?
2) Is it possible to allow a specific kit to use wizard scrolls from a specific school only?
3) Is it possible to reproduce a specialist wizard's penalty to enemies for another wizard kit? And 15% bonus/penalty to learn scrolls? I know how to add the +2 resistance, restrict the use of items and the game automatically gives the extra spell slot (that IDK if can be target by @kjeron 's mod).
Thanks.
1) I believe the only way to do that is to allow the base class of the kit to use these scrolls, and then forbid every kit besides the one you want from using the scrolls. There might be a cleaner solution I am not aware of. If you go for that option then you need to install the scroll restriction component after any other kit mod.
2) Assuming you got a solution for 1 (whether mine or a cleaner one), you may add an extra test to the PATCH_IF, to apply the modifications only to scrolls that have a certain "unusable by" flag ticked in. These flags are split in 4 bytes (at 29h, 2bh, 2dh and 2fh). So for instance if you want only divination spells to be usable by your kit, then, as they are divination spells, they will be unusable by conjurers, so bit 7 at 0x2f will be a 1. You may check for these bits. Some overhaul mods might make modifications to scroll and spell usability, so you might want to check them too, for compatibility.
3) These are hardcoded and we had a long session of trial and error last summer to try and find a solution around the issue. Never got anything satysfying. IIRC you ended up asking Beamdog to dehardcode them in a feature request thread, and I joined you by asking to dehardcode other unique class features (such as HiPS on shadowdancer). Maybe it will be part of the 2.5 IE update.
Comments
How do I do that?
Using Opcode 172 in the effects: spell does nothing. It is not cast, the character just remains as it was about to take an action and comes back to normal.
---
Just to clarify what I want: to give a weapon to a kit. I've tried it through AP_Spell using Opcode #122 and it works... for a character created in Lv 1 (the level that I assign the AP_Spell).
If I create the character in BGEE or IWD, the weapon is there. If it is created in IWD, the weapon is there.
Created in BG2EE or ToB, nothing.
My text was not good, sorry.
The spell (let's call it K) currently has two effects:
122 -> Create Weapon X
172 -> Removes K.
Neither happens.
---
How can I do to append to the area script a command to create this weapon in the golem's room if someone in the party has the kit?
Beautiful solution, by the way.
I'd like my kit to be able to deal additional magic damage (via opcode #12) whenever he/she scores a critical hit with bows. The problem is that this time I cannot strictly follow your previous advice (equipping 177 ---> 341 ----> .SPL with melee ability containing opcode #12) because I'd like to avoid that issue (i.e., "Ranged Weapons with Critical Hit Effects through opcode 341 trigger those effects immediately upon the attack roll, rather then when the weapon strikes its target, effect is preceding the cause".)
Having said that, I think the issue can be fixed by combining opcode #249 and #341 (summoning also @kjeron ........)
I have the following piece of coding: The problem: it installs perfectly in BG2EE, but fails to install in BGEE.
It's the exact same file with the exact same code for both games.
Ideas?
In BGEE, IDPRO282 is listed in PROJECTL.ids, but no such file exists in the game. ADD_PROJECTILE doesn't work if the projectile is already listed in PROJECTL.ids. Try using the projectile function I gave you earlier for it instead.
Is it possible? Opcode 232 gives me options of Seeing Enemy and Attacked By, but my idea would be to fire this spell when YOU start attacking, not the other way around.
Edit: What I can do so far
10 ft radius: I'll use an adapted version of the Invisibility 10 ft projectile;
Except for caster: I'll use the "Exclude original caster" target for the spell;
The spell per se;
The aura effect;
Which means that my problem is the firing condition.
Thanks.
A pure and simple Opcode 206 having the first aura as the resource you mean?
Sounds elegant and simple (well, after the idea is presented I mean, I would not have this idea).
For the Opcode 232: Is that correct?
I could only find one trigger (0x0093 PartyRested()) that, I assume, does one or the other
Edit: I'm sure the community wouldn't have a problem with it; I am more concerned about Beamdog taking issue with modifying their executable.
I would say they won't mind it, but best to ask them before you do the job rather than doing the job, publishing the mod and having it taken down because of legal issues.
2) Is it possible to allow a specific kit to use wizard scrolls from a specific school only?
3) Is it possible to reproduce a specialist wizard's penalty to enemies for another wizard kit? And 15% bonus/penalty to learn scrolls? I know how to add the +2 resistance, restrict the use of items and the game automatically gives the extra spell slot (that IDK if can be target by @kjeron 's mod).
Thanks.
2) Assuming you got a solution for 1 (whether mine or a cleaner one), you may add an extra test to the PATCH_IF, to apply the modifications only to scrolls that have a certain "unusable by" flag ticked in. These flags are split in 4 bytes (at 29h, 2bh, 2dh and 2fh). So for instance if you want only divination spells to be usable by your kit, then, as they are divination spells, they will be unusable by conjurers, so bit 7 at 0x2f will be a 1. You may check for these bits. Some overhaul mods might make modifications to scroll and spell usability, so you might want to check them too, for compatibility.
3) These are hardcoded and we had a long session of trial and error last summer to try and find a solution around the issue. Never got anything satysfying. IIRC you ended up asking Beamdog to dehardcode them in a feature request thread, and I joined you by asking to dehardcode other unique class features (such as HiPS on shadowdancer). Maybe it will be part of the 2.5 IE update.