The solutions I can think of are pretty convoluted but yeah it should be possible. My solution would be this: Patch every mace by adding them a critical hit effect. This crit effect would cast a spell that uses OPcode 326 with condition "KIT equal specified value", with your kit given as an attribute. This spell would in turn cast the spell with the effect you want. If you want to add a level condition (e.g. you want this crit effect to occur only if your character level 7+), just add an intermediate spell that uses opcode 326 as well, checking for level this time. I don't think there's a level check in splprot.2da though, so you might have to expend splprot.2da. Here's an example of a TPA that extends splprot.2da (starting line 333). And here's the corresponding IESDP page that you will probably need if you are not familiar with splprot.2da.
I am trying to understand how summoning monsters from spells work. I have gathered that both opcode 67 and 127 are used to summon creatures, opcode 67 references a CRE file, and opcode 127 references a 2DA file. A couple of questions about these opcodes:
1. It seems that in the vanilla game, most of the time these summoning opcodes are offloaded to an EFF file. Why is this so? Is there some sort of functionality that is gained from summoning using an EFF file, instead of directly using a summoning opcode from a spell's abilities?
2. Bit of a noob question here. Say I want to make a summon that is permanent / doesn't unsummon. Which timing mode would I use? I still haven't discerned the exact difference between Permanent (9) and Permanent until death (1), as they kind of seem to imply the same sort of behavior.. in my mind, at least, when it comes to summons. Is there a guide somewhere that details the exact behavior of all the 12 (imo) confusingly named timing modes?
3. As a side question, how does timing work when opcode 177 is used in conjunction with an EFF file? Both the spell ability and the EFF file have timing modes and duration in this circumstance; which one is used? I've noticed in summoning spells that it appears that the spell ability controls the summon duration... but I am still unsure how this works.
@Luke93 Opcode 341 allows restricting it's trigger to only a specific weapon category, if that is selective enough for you. Categories: Quarterstaff Spear Halberd Dagger Mace(Club) Hammer Dart Bow (Long/Short/Composite) Crossbow (Heavy/Light) Small Sword (Short/Wakizashi) Large Sword (Long/Scimitar/Ninjato/Katana/Bastard/Two-handed) Sling Flail Morningstar Axe
It is designated by Parameter3, so the effect must be used in an EFF.
1. It seems that in the vanilla game, most of the time these summoning opcodes are offloaded to an EFF file. Why is this so? Is there some sort of functionality that is gained from summoning using an EFF file, instead of directly using a summoning opcode from a spell's abilities?
Resource2 (only available in EFF's) controls the animation played when the creature is summoned. It also has a default animation, so manually specifying an invalid file is necessary to have no animation.
2. Bit of a noob question here. Say I want to make a summon that is permanent / doesn't unsummon. Which timing mode would I use? I still haven't discerned the exact difference between Permanent (9) and Permanent until death (1), as they kind of seem to imply the same sort of behavior.. in my mind, at least, when it comes to summons. Is there a guide somewhere that details the exact behavior of all the 12 (imo) confusingly named timing modes?
Half of them exist because the engine converts one to another when attaching them to creatures (almost all durational effects eventually end up using timing mode 4096 once they are attached to a creature). You can completely ignore Timing Modes 5, 6, 7, & 8, as they are almost never use-able for any practical purpose. About half of the opcodes ignore duration, they only care if they are instantaneous or delayed. They effectively only have 2 different timing modes, (0/1/2/9/10/4096) or (3/4). For the rest, the primary difference between Timing Mode 9 and any other Timing Mode is that it is the only Timing Mode that is NOT considered a "Limited" effect. Limited effects are removed by any of the following: Death, Export(Including Pregen), Ctrl+R, and Opcode 17(Param2:BIT17). Limited effects are also not passed on to Images (Mislead/Project Image/Simulacrum). Non-instantaneous effects with Timing Mode 9 can only be removed through other opcodes that directly remove effects, like Opcodes 4, 220, or 321, or by dual-classing (if the effect was applied as a part of their CLAB file). Specifically for Timing Mode 1, there are is also this: https://forums.beamdog.com/discussion/comment/856134#Comment_856134
3. As a side question, how does timing work when opcode 177 is used in conjunction with an EFF file? Both the spell ability and the EFF file have timing modes and duration in this circumstance; which one is used? I've noticed in summoning spells that it appears that the spell ability controls the summon duration... but I am still unsure how this works.
It depends on the opcode calling the EFF: Opcodes 177/182/183/283 use their own timing mode and duration in place of those in the EFF. Opcodes 248/249/272 use each to their own, as the EFF is applied separately from their own effect.
@subtledoctor So, to sum up (suppose I wanna deal extra damage every time I score a critical hit with a katana): I need to patch every katana with 1) an equipping 177 effect (target: self, timing: instant/while equipped, probability1: 100, resource: Eff1.EFF) 2) Eff1.EFF -> opcode 341, timing: instant/while equipped, target: preset target, probability1: 100, resource: Spell1.SPL) 3) Spell1.SPL -> innate, ignore dead/wild magic, spell ability -> ability type: melee, target: living actor, ability location: ability, effect: opcode 12 (damage) -> target: preset target, timing: instant/permanent until death. Is it correct?
@Arunsun The links you posted are not working.....
@subtledoctor So, to sum up (suppose I wanna deal extra damage every time I score a critical hit with a katana): I need to patch every katana with 1) an equipping 177 effect (target: self, timing: instant/while equipped, probability1: 100, resource: Eff1.EFF) 2) Eff1.EFF -> opcode 341, timing: instant/while equipped, target: preset target, probability1: 100, resource: Spell1.SPL) 3) Spell1.SPL -> innate, ignore dead/wild magic, spell ability -> ability type: melee, target: living actor, ability location: ability, effect: opcode 12 (damage) -> target: preset target, timing: instant/permanent until death. Is it correct?
@Arunsun The links you posted are not working.....
Now they should work. For some reason it copied the http:// part twice...
Is there a way to create a spell effect that provides an AC bonus vs. creatures that have infravision?
Can't think of a direct way of doing that. My call on that would be the spell acts as an aura that is refreshed very frequently (say, every second) and bypasses dispel/resistance. This aura checks for infravision stat using opcode 326 (you'd need to expend splprot to add infravision.) and if the target has infravision, use opcode 178 to give a thac0 malus against the right kit/race/whatever. Now that typically works if the target of the AC bonus can be identified by the various IDS, so maybe a couple extra details would be needed to work a solution out: Whom does it affect? All allies? All enemies? Only certain enemies? Only a single target? Is it a passive, permanent boost or an active spell?
I feared there is no direct way to apply it. This effect is intended to be added to an item that masks your heat radiation (limited duration effect), so that any creatures that rely on infravision have a slight disadvantage at hitting you.
I might get away with adding several opcode 219 instances to target races that are known to have infravision. I won't catch creatures with non-innate infravision effects that way though.
Is there an effect (or combination of effects) that can be used to stop all scripts of a creature from executing while the effect is active, similar to Feeblemindedness?
I've tried opcode 365 (Make unselectable) with "AI enabled" set to false, which only works partially. It stops scripts from executing, but doesn't clear the current action.
Is there an effect (or combination of effects) that can be used to stop all scripts of a creature from executing while the effect is active, similar to Feeblemindedness?
I've tried opcode 365 (Make unselectable) with "AI enabled" set to false, which only works partially. It stops scripts from executing, but doesn't clear the current action.
An instant zero-duration Berserk status will disrupt the current action, through either opcode (3 or 247).
I'm a total newbie with chains, is there a way to create a chain inside a dialog? Something as follows:
Dialog starts: My PC answers to the first state The chain starts because NPCs will talk for a while The chain stops, and at the last state of the chain my PC can say something again.
Or maybe there's a better way of doing that? So far my knowledge of dialogs is null except the standard IF/THEN /BEGIN
@Luke93 Yes, though it is actually based on the "personal_space" value of the creature's current animation, listed in each animation's INI file. This value can be overridden by opcode 342. It is not based on the creatures "selection circle size" ("ellipse" value in the INI), though they are generally kept similar.
The problem is that the string doesn't appear in the combat log when an undead creature (e.g., SKELE2) is hit....
Even several vanilla spells make use of the field in that manner for opcode 318, but it is not functional for them either.
So, I was told by a dev that opcode 318 isn't supposed to display anything in the combat log. As you said, some spells do have string references in the special field of this effect, but such function was never implemented.....
It follows that opcode 324 must be used -> It displays a pregenerated feedback string (the special field has no function): Unaffected by effects from (RESOURCE)
Is there any way of tracking down the BAM that controls the idle animation of a creature from WeiDU? Ideally, what I am looking for is a function that takes in a CRE filename, and spits out the idle animation BAM filename. I'm pretty sure I could code the function myself, I just have no idea how animation cycles are attached to creatures, and how I would even track them down in the first place. Thanks!
Is there any way of tracking down the BAM that controls the idle animation of a creature from WeiDU? Ideally, what I am looking for is a function that takes in a CRE filename, and spits out the idle animation BAM filename. I'm pretty sure I could code the function myself, I just have no idea how animation cycles are attached to creatures, and how I would even track them down in the first place. Thanks!
At offset 0x28 is a number coded on 4 bytes (so actually only the first two matter and they are the wrong way around, meaning 24592 for example will be coded 10 60 in the creature file instead of 6010 which is 24592 in hex...) . This refers to the animation file. Keeping this example, you'll need to look at the 6010.ini file. In that file is a character block. In that character block is a resref line with 4 letters prefix.
The default idle animation will be that prefix+G12.bam If your character can wear armor and has its animation changed by that, then it'll be prefix+ armor animation number+G12. Armor animation numbers are 1 (unarmored), 2 (leather/studded leather armor), 3 (Chain/Splint mail) or 4 (Plate/Full plate). So for example, in 6010.ini you read chfb is the prefix for cleric_female_human. The idle animation for a female human cleric in chain mail armor will be chfb3g12.bam. Plate mails are handled differently: Note that in the ini file there are two lines after resref: resref_armor_base and resref_armor_specific, with one letter each time. In our 6010.ini example, it's B and C respectively. It means that for the first three types of armor (no armor, leather, mail), it will use chfb as a prefix, but for the plate armor it will become chfc. So the idle animation for a female human cleric in plate mail will be chfc4g12.bam. That's because some animation files are used by more than one animation file. For instance, fighter and cleric animations are identical for armors lighter than plate, but different for plate armor.
On the other hand, some characters don't change animation when they were armor. Vampires for example. If you look at the associated .ini file you'll see that male vampire prefix is mvam. So their idle animation will be mvamg12.bam.
Now it would be too simple if it was "just" that, but there are MANY exceptions and difficulties working with these. Sarevok's idle animation, for instance, is split across two bams and hidden in the USAR1G1.bam and USAR1G1E.bam. The Yuan-Ti idle animation is in MYU1SD.bam.
Really don't ask, I couldn't help you with the logic behind that . But if you stick to character animations it'll be pretty understandable.
It depends on the format the creature animation uses, and the way they are build (split, mirrored...):
BG1 MONSTER LONG : 16 directions unmirrored (10 West + 6 East) Bam files : xxxxG1,G1E,G2,G2E,G3,G3E Example : Carrion crawler
BG1 MONSTER LONG 4 PARTS : the same as above but each frame is divided into 4 parts. Bam files : xxxxG11,G11E,G12,G12E,G13,G13E,G14,G14E Bam files : xxxxG21,G21E,G22,G22E,G23,G23E,G24,G24E Bam files : xxxxG31,G31E,G32,G32E,G33,G33E,G34,G34E Example : Tanar'ri
BG2 SPLIT 4 PARTS : the same as above but each frame is divided into 4 parts. Bam files : G11,G12,G13,G14;G111,G121,G131,G141;G112,G122,G132,G141;G113,G123;G133,G143;G114,G124,G134,G144 G21,G22,G23,G24;G211,G221,G231,G241;G212,G222,G232,G241;G213,G223;G233,G243;G214,G224,G234,G244 Example : Demogorgon
BG2 UNSPLIT EXT : 9 directions mirrored Bam files : G1,G2 Example : Death Tyrant
Plus the characters animations Arunsun described, the PsT format (quite similar to the IWD one), and the more complex dragon one (each frame is divided into 9 parts ==> 567 files for a single animation slot).
If you are interested, many years ago, I drew an ods file resuming all of them, before I began to create new creature animation slots.
Comments
If you want to modify their animation slot, it is quite easy with WeiDU : COPY_EXISTING + WRITE_ASCII 0x22 ~whatever slot you prefer~
Patch every mace by adding them a critical hit effect. This crit effect would cast a spell that uses OPcode 326 with condition "KIT equal specified value", with your kit given as an attribute. This spell would in turn cast the spell with the effect you want.
If you want to add a level condition (e.g. you want this crit effect to occur only if your character level 7+), just add an intermediate spell that uses opcode 326 as well, checking for level this time. I don't think there's a level check in splprot.2da though, so you might have to expend splprot.2da. Here's an example of a TPA that extends splprot.2da (starting line 333). And here's the corresponding IESDP page that you will probably need if you are not familiar with splprot.2da.
1. It seems that in the vanilla game, most of the time these summoning opcodes are offloaded to an EFF file. Why is this so? Is there some sort of functionality that is gained from summoning using an EFF file, instead of directly using a summoning opcode from a spell's abilities?
2. Bit of a noob question here. Say I want to make a summon that is permanent / doesn't unsummon. Which timing mode would I use? I still haven't discerned the exact difference between Permanent (9) and Permanent until death (1), as they kind of seem to imply the same sort of behavior.. in my mind, at least, when it comes to summons. Is there a guide somewhere that details the exact behavior of all the 12 (imo) confusingly named timing modes?
3. As a side question, how does timing work when opcode 177 is used in conjunction with an EFF file? Both the spell ability and the EFF file have timing modes and duration in this circumstance; which one is used? I've noticed in summoning spells that it appears that the spell ability controls the summon duration... but I am still unsure how this works.
Thanks!
Quarterstaff
Spear
Halberd
Dagger
Mace(Club)
Hammer
Dart
Bow (Long/Short/Composite)
Crossbow (Heavy/Light)
Small Sword (Short/Wakizashi)
Large Sword (Long/Scimitar/Ninjato/Katana/Bastard/Two-handed)
Sling
Flail
Morningstar
Axe
It is designated by Parameter3, so the effect must be used in an EFF. Resource2 (only available in EFF's) controls the animation played when the creature is summoned. It also has a default animation, so manually specifying an invalid file is necessary to have no animation. Half of them exist because the engine converts one to another when attaching them to creatures (almost all durational effects eventually end up using timing mode 4096 once they are attached to a creature). You can completely ignore Timing Modes 5, 6, 7, & 8, as they are almost never use-able for any practical purpose.
About half of the opcodes ignore duration, they only care if they are instantaneous or delayed. They effectively only have 2 different timing modes, (0/1/2/9/10/4096) or (3/4).
For the rest, the primary difference between Timing Mode 9 and any other Timing Mode is that it is the only Timing Mode that is NOT considered a "Limited" effect. Limited effects are removed by any of the following: Death, Export(Including Pregen), Ctrl+R, and Opcode 17(Param2:BIT17). Limited effects are also not passed on to Images (Mislead/Project Image/Simulacrum).
Non-instantaneous effects with Timing Mode 9 can only be removed through other opcodes that directly remove effects, like Opcodes 4, 220, or 321, or by dual-classing (if the effect was applied as a part of their CLAB file).
Specifically for Timing Mode 1, there are is also this: https://forums.beamdog.com/discussion/comment/856134#Comment_856134 It depends on the opcode calling the EFF:
Opcodes 177/182/183/283 use their own timing mode and duration in place of those in the EFF.
Opcodes 248/249/272 use each to their own, as the EFF is applied separately from their own effect.
I need to patch every katana with
1) an equipping 177 effect (target: self, timing: instant/while equipped, probability1: 100, resource: Eff1.EFF)
2) Eff1.EFF -> opcode 341, timing: instant/while equipped, target: preset target, probability1: 100, resource: Spell1.SPL)
3) Spell1.SPL -> innate, ignore dead/wild magic, spell ability -> ability type: melee, target: living actor, ability location: ability, effect: opcode 12 (damage) -> target: preset target, timing: instant/permanent until death.
Is it correct?
@Arunsun The links you posted are not working.....
Now that typically works if the target of the AC bonus can be identified by the various IDS, so maybe a couple extra details would be needed to work a solution out:
Whom does it affect? All allies? All enemies? Only certain enemies? Only a single target?
Is it a passive, permanent boost or an active spell?
I might get away with adding several opcode 219 instances to target races that are known to have infravision. I won't catch creatures with non-innate infravision effects that way though.
Anyway, everything seems to work as expected, so: thank you!
I've tried opcode 365 (Make unselectable) with "AI enabled" set to false, which only works partially. It stops scripts from executing, but doesn't clear the current action.
Edit: It's not perfect though. Berserk still has a low chance to pick the "attack nearest creature" action when it is applied, even for duration=0.
Dialog starts:
My PC answers to the first state
The chain starts because NPCs will talk for a while
The chain stops, and at the last state of the chain my PC can say something again.
Or maybe there's a better way of doing that? So far my knowledge of dialogs is null except the standard IF/THEN /BEGIN
I tried with MDR2INV.BAM but apparently it's wrong and doesn't show anything
I want to summon @argent77 because they're the best
Unfortunately I can't help you with paperdolls. I've never touched them (except maybe while coding for NI).
What about Circle size > 3? Is it a way to target "large" creatures like Dragons, Adamantine/Iron Golems, Greater Wyverns and the like?
Yes, though it is actually based on the "personal_space" value of the creature's current animation, listed in each animation's INI file. This value can be overridden by opcode 342.
It is not based on the creatures "selection circle size" ("ellipse" value in the INI), though they are generally kept similar.
It follows that opcode 324 must be used -> It displays a pregenerated feedback string (the special field has no function):
Unaffected by effects from (RESOURCE)
The default idle animation will be that prefix+G12.bam
If your character can wear armor and has its animation changed by that, then it'll be prefix+ armor animation number+G12. Armor animation numbers are 1 (unarmored), 2 (leather/studded leather armor), 3 (Chain/Splint mail) or 4 (Plate/Full plate). So for example, in 6010.ini you read chfb is the prefix for cleric_female_human. The idle animation for a female human cleric in chain mail armor will be chfb3g12.bam.
Plate mails are handled differently: Note that in the ini file there are two lines after resref: resref_armor_base and resref_armor_specific, with one letter each time. In our 6010.ini example, it's B and C respectively. It means that for the first three types of armor (no armor, leather, mail), it will use chfb as a prefix, but for the plate armor it will become chfc. So the idle animation for a female human cleric in plate mail will be chfc4g12.bam. That's because some animation files are used by more than one animation file. For instance, fighter and cleric animations are identical for armors lighter than plate, but different for plate armor.
On the other hand, some characters don't change animation when they were armor. Vampires for example. If you look at the associated .ini file you'll see that male vampire prefix is mvam. So their idle animation will be mvamg12.bam.
Now it would be too simple if it was "just" that, but there are MANY exceptions and difficulties working with these.
Sarevok's idle animation, for instance, is split across two bams and hidden in the USAR1G1.bam and USAR1G1E.bam.
The Yuan-Ti idle animation is in MYU1SD.bam.
Really don't ask, I couldn't help you with the logic behind that . But if you stick to character animations it'll be pretty understandable.
BG1 MONSTER LONG : 16 directions unmirrored (10 West + 6 East)
Bam files : xxxxG1,G1E,G2,G2E,G3,G3E
Example : Carrion crawler
BG1 MONSTER LONG 4 PARTS : the same as above but each frame is divided into 4 parts.
Bam files : xxxxG11,G11E,G12,G12E,G13,G13E,G14,G14E
Bam files : xxxxG21,G21E,G22,G22E,G23,G23E,G24,G24E
Bam files : xxxxG31,G31E,G32,G32E,G33,G33E,G34,G34E
Example : Tanar'ri
BG1 SIMPLE CASTER : 8 directions unmirrored (5 West + 3 East)
Bam files : G1,G1E,G2,G2E
Example : Sirine, Ogre Mage
BG1 SIMPLE MONSTER : 8 directions unmirrored (5 West + 3 East)
Bam files : G1,G1E,G2,G2E
Example : Werewolf
BG2 SPLIT : 9 directions mirrored
Bam files : G1,G11,G12,G13,G14,G15,G2,G21,G22,G23,G24,G25,G26
Example : Troll
BG2 SPLIT 4 PARTS : the same as above but each frame is divided into 4 parts.
Bam files : G11,G12,G13,G14;G111,G121,G131,G141;G112,G122,G132,G141;G113,G123;G133,G143;G114,G124,G134,G144
G21,G22,G23,G24;G211,G221,G231,G241;G212,G222,G232,G241;G213,G223;G233,G243;G214,G224,G234,G244
Example : Demogorgon
BG2 UNSPLIT EXT : 9 directions mirrored
Bam files : G1,G2
Example : Death Tyrant
IWD : 8 directions unmirrored (5 West + 3 East)
Bam files : A1,A1E,A2,A2E,A3,A3E,A4,A4E;CA,CAE;DE,DEE,GH,GHE;GU,GUE;SC,SCE;SD,SDE;SL,SLE;SP,SPE;TW,TWE;WK,WKE
Plus the characters animations Arunsun described, the PsT format (quite similar to the IWD one), and the more complex dragon one (each frame is divided into 9 parts ==> 567 files for a single animation slot).
If you are interested, many years ago, I drew an ods file resuming all of them, before I began to create new creature animation slots.