row#B is 'Less than or equal specified value' (but param1 is unused, so this is probably fine...)
row#C is 'Not match entries -1 or -1'
The first is a display issue in NI - only "-1" is "use specific value", not all negative numbers.
The second I suspect is because you are passing value and relation as string variables, so they need to be evaluated:
LAF ADD_SPLPROT_ENTRY
INT_VAR
stat = 0x104 // negate 0x103 (where 0x103 - use two rows of splprot.2da)
STR_VAR
value = EVAL ~%index1%~ //
relation = EVAL ~%index2%~ //
RET
index
END
How can I ensure that a creature under the effect of a spell will deliver maximum damage with one kind of weapon (e.g. only axes or only hammers or only bastard swords)?
I have a question about the Critical Hit Effect, opcode 341. Have you noticed that the effect is applied instantly, before the projectile gets to the target? It's hard to spot for melee weapons, but possible for arrows or bolts. For example, if you hang a knockout effect on bows, enemies will drop as soon as the attack roll information appears, and the arrow is an afterthought. This has led me to use a simple 5% random chance effect on a custom missile, which I had wanted to happen on a critical hit. Do you know a way around this?
It was noticed: https://support.baldursgate.com/issues/31341.
The only way to make them sync is to give the critical hit effect spell the same projectile as the ammo - and hope non-standard ammo isn't used (Gesen).
I'm having a problem with a projectile. The missile itself is Random Path, and when it lands the AOE is supposed to fire a custom explosion 10 times for a 10-round duration. I could probably time the animation to look smooth, however, I only get one explosion, though the effects do last the entire 10 rounds. What's more, the missile's tail animation, for some reason, continues to be drawn every round of the duration after the hit, wagging all over the place, with Random Path. This goes away if I make it fly straight, but the randomness is essential for this one. Is there any way to fix both of these within the file or do I have to revert to something exotic, like spawning an invisible minion at the impact point who will produce the rest of the show?
The problem is: when I open the file after running this code, Opcode 324 is not reappearing, only Opcode 12 (Poison damage). Honestly, IDK if nothing is being added and Opcode 12 is not being removed.
@subtledoctor , I tried your suggestion and the item is still being added to the excluded store:
PATCH_IF type == 2 & !(~%SOURCE_RES%~ STRING_EQUAL_CASE ~[INN2616]~)
...
It still appears there.
Another problem: does anyone know if it's possible to summon a creature at the target point of a custom projectile? For example, if I want a lightning bolt to hit a point on the ground and Noober to jump out of there. Usually summoning effects are all Self-targeted and any projectiles are ignored.
Does anyone know about a way to make being "turned" detectable in scripts? TurnedBy([ANYONE]) trigger seems useless since the turned creature is not performing any scripts when being turned (the trigger will work at the first script run when the effect ends, but that's not what I need). Detecting turning externally via TriggerOverride("someDV",TurnedBy([ANYONE])) also doesn't work (always false based on my tests).
I've checked turned creature in save file and the CRE structure seems to be unaffected by cleric turn (no flags set, not states). Maybe there is some dummy spell applied by the engine upon successful turning, which I could patch with spell state?
edit: it can be detected via opcode #232, Target turned by condition.
Against non-party members, being turned imposes action RunAwayFrom(object,timer) (or similar).
Scripts will not interrupt this action until it's timer expires, but it can be interrupted by "ActionOverride()" from other scripts, though other scripts cannot detect "TurnedBy()" through TriggerOverride(), and by players with manually issued commands.
Against party members (Paladins), being turned applies op24, bypassing immunity to it, for (40 seconds - Paladin level).
Being controlled by a cleric applies op241, charm type 4, for 1 turn.
The creature type specified by the 'Type' field becomes immune to the spell or item specified in the 'Resource' field. It also gives a message on a successful resist.
And yes, for absolutely zero people surprise it is a kit.
Edit: Worked like a charm (as expected). And now I know how to make Opcode 324 aim kits (IESDP don't list it as possible, but Near Infinity gave me every direction I needed).
If you, fellow modder from the future, want to know how I did it here's the magic:
ACTION_IF !GAME_IS ~iwdee~ BEGIN
ACTION_FOR_EACH scroll IN ~SCRL10~ ~SCRL11~ ~SCRL12~ ~SCRL13~ ~SCRL14~ ~SCRL16~ ~SCRL17~ ~SCRL18~ BEGIN
ACTION_IF FILE_EXISTS_IN_GAME ~%scroll%.itm~ THEN BEGIN
COPY_EXISTING ~%scroll%.itm~ override
LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 324 parameter1 = IDS_OF_SYMBOL (~Kit~ ~RADene~) parameter2 = 109 target = 1 timing = 2 STR_VAR resource = EVAL ~%scroll%~ insert_point = 0 END
LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 324 parameter1 = IDS_OF_SYMBOL (~Kit~ ~RADeneCM~) parameter2 = 109 target = 1 timing = 2 STR_VAR resource = EVAL ~%scroll%~ insert_point = 1 END
END
END
END
I'm still trying to figure out why this code for excluding a store doesn't work:
COPY_EXISTING_REGEXP GLOB ~.*\.STO~ ~override~
READ_BYTE 0x8 type
READ_ASCII 0xC name
PATCH_IF (%SOURCE_SIZE% > 0x9b) BEGIN
PATCH_IF type == 2 & !(~%SOURCE_RES%~ STRING_EQUAL ~[INN2616]~)
THEN BEGIN
ADD_STORE_ITEM "APPLTH_#" LAST #0 #0 #0 ~IDENTIFIED~ #0 UNLIMITED
END
END
BUT_ONLY
@subtledoctor , I tried your suggestion and the item is still being added to the excluded store:
PATCH_IF type == 2 & !(~%SOURCE_RES%~ STRING_EQUAL_CASE ~[INN2616]~)
Is that pseudocode, or are you actually including those square brackets? STRING_EQUAL_CASE looks for a case-insensitive but otherwise exact textual match. So what's between the tildes ~~ has to be the filenames, no more and no less.
I didn't see this. Too many new messages between then and now. I will change this. And thanks, @Raduziel .
And another thing. I have an item with a weapon ability - it's a dart, actually - and another ability activated from the Items bar, Caster-targeted. Throwing the darts obviously expends them, but the other one isn't spent when it's used. What combination of "number of charges" and "when drained" do I need to prevent the number of charges from showing on the icon?
Something else. How can I limit the duration of a looping special effect when it's put At target point or Over creature (unattached)? It goes on forever, no matter what the duration. Or perhaps I can put in a delayed removal somehow?
Here is a little challenge. I'm making a spell that will shoot through a number of targets, in a line, as the projectile flies, and put all of them either under effect A or effect B, 50% of the time. One shot it will be A for everyone, the next shot it may be B. Let's say A is making them glow and B is darkening them. I'm thinking of a way to go about this randomness. If I simply put a 50-50 Cast spell subeffect in the spell, the roll is going to be different for every hit creature, some will glow and others will darken. I need instead the same result for everyone within a shot.
At the moment my best idea is to apply both of the subspells, each combined with an Everyone-targeted immunity to the other. When the roll is made for the first hit creature and, say, A is rolled, everyone will become immune to B. This is not going to change the rolls for the next targets, however, so if I keep the chances at 50-50 and the other creatures roll in the B range, they will just end up unaffected by either. If I make both rolls at 100-0, however, the first spell to apply on the list will block the second for everyone, so effectively only A will ever be observed.
Perhaps I can instead begin with a Self-targeted random, 50-50, immunity to A or B for Everyone, at the firing, and keep the rolls at 100-0. This way only one of the subspells will go through. But if there is a more beautiful solution, I'm open to suggestions.
Comments
The second I suspect is because you are passing value and relation as string variables, so they need to be evaluated:
Thanks!
The only way to make them sync is to give the critical hit effect spell the same projectile as the ammo - and hope non-standard ammo isn't used (Gesen).
Continuing with the store patching. Now I'd like to exclude one inn from the patch that puts apples in all inns' stores:
COPY_EXISTING_REGEXP GLOB ~.*\.STO~ ~override~
READ_BYTE 0x8 type
READ_ASCII 0xC name
PATCH_IF (%SOURCE_SIZE% > 0x9b) BEGIN
PATCH_IF type == 2 & !(~%name%~ STRING_EQUAL_CASE ~Candlekeep Inn~)
THEN BEGIN
ADD_STORE_ITEM "APPLTH_#" FIRST #0 #0 #0 ~IDENTIFIED~ #0 UNLIMITED
END
END
BUT_ONLY
And still it gets apples.
That's what I wanted. Thank you.
(Deleted the second issue - fixed)
So, I'm trying to build a fix for the Flail of Ages issue to incorporate it to DoF's next release. Here's the code I built, quite simple:
The problem is: when I open the file after running this code, Opcode 324 is not reappearing, only Opcode 12 (Poison damage). Honestly, IDK if nothing is being added and Opcode 12 is not being removed.
Some insight, please?
Thanks.
You need to add "type = 1" (Melee header) to all those ADD_ITEM_EFFECT....
From the ReadMe:
"SET 'type' to the type of header to which the effect should be added or 99 for all types. Defaults to 3 (magic)."
PATCH_IF type == 2 & !(~%SOURCE_RES%~ STRING_EQUAL_CASE ~[INN2616]~)
...
It still appears there.
Another problem: does anyone know if it's possible to summon a creature at the target point of a custom projectile? For example, if I want a lightning bolt to hit a point on the ground and Noober to jump out of there. Usually summoning effects are all Self-targeted and any projectiles are ignored.
I've checked turned creature in save file and the CRE structure seems to be unaffected by cleric turn (no flags set, not states). Maybe there is some dummy spell applied by the engine upon successful turning, which I could patch with spell state?
edit: it can be detected via opcode #232, Target turned by condition.
Scripts will not interrupt this action until it's timer expires, but it can be interrupted by "ActionOverride()" from other scripts, though other scripts cannot detect "TurnedBy()" through TriggerOverride(), and by players with manually issued commands.
Against party members (Paladins), being turned applies op24, bypassing immunity to it, for (40 seconds - Paladin level).
Being controlled by a cleric applies op241, charm type 4, for 1 turn.
Can I use Opcode 206 having an itm as a resource?
Header target is 5 (self).
Any other ideas?
Nevermind, I had to start a new game to the effect kick in.
Thanks.
Why is no message being displayed?
IESDP:
Thanks.
Why a golem struck by FoA +4 displays "Immune to the effects of FoA+4"?
Can I code what I did in another way to make the message display?
Thanks!
And yes, for absolutely zero people surprise it is a kit.
Edit: Worked like a charm (as expected). And now I know how to make Opcode 324 aim kits (IESDP don't list it as possible, but Near Infinity gave me every direction I needed).
If you, fellow modder from the future, want to know how I did it here's the magic:
Any suggestions?
Have you tried it already?
I didn't see this. Too many new messages between then and now. I will change this. And thanks, @Raduziel .
And another thing. I have an item with a weapon ability - it's a dart, actually - and another ability activated from the Items bar, Caster-targeted. Throwing the darts obviously expends them, but the other one isn't spent when it's used. What combination of "number of charges" and "when drained" do I need to prevent the number of charges from showing on the icon?
Something else. How can I limit the duration of a looping special effect when it's put At target point or Over creature (unattached)? It goes on forever, no matter what the duration. Or perhaps I can put in a delayed removal somehow?
At the moment my best idea is to apply both of the subspells, each combined with an Everyone-targeted immunity to the other. When the roll is made for the first hit creature and, say, A is rolled, everyone will become immune to B. This is not going to change the rolls for the next targets, however, so if I keep the chances at 50-50 and the other creatures roll in the B range, they will just end up unaffected by either. If I make both rolls at 100-0, however, the first spell to apply on the list will block the second for everyone, so effectively only A will ever be observed.
Perhaps I can instead begin with a Self-targeted random, 50-50, immunity to A or B for Everyone, at the firing, and keep the rolls at 100-0. This way only one of the subspells will go through. But if there is a more beautiful solution, I'm open to suggestions.