Jump to content

CLONE woes


kreso

Recommended Posts

I want to make each item which uses Pause opcode to give -2 AC penalty.

 

Code I use is this:

 

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
LPF CLONE_EFFECT INT_VAR match_opcode = 165 opcode = 0 parameter1 = "-2" silent = 1 END END
BUT_ONLY_IF_IT_CHANGES
....but it doesn't work. Opcode is added just fine, but with with a value of 0 instead of -2.
Any ideas what I'm doing wrong with AC penalty? If I give it a +2 bonus, it works just fine. :undecided:
Link to comment

Sounds like the LPF doesn't like to take the negative modifiers. There's history of this in the weidus forum pages. It could be that...

Well, this is from May 2015:

 

COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
LAUNCH_PATCH_FUNCTION ADD_CRE_EFFECT
INT_VAR
opcode = 301 // Critical hit bonus
timing = 9 //Permanent after death
target = 1 //Self
parameter1 = "-20" //Modifier
resist_dispel = 2 //Not dispellable + bypass resistance
END
BUT_ONLY_IF_IT_CHANGES
Works fine....
Link to comment

Try "(0 - 1)"

 

https://forums.beamdog.com/discussion/comment/689995/#Comment_689995

 

Not sure if that will work with CLONE_EFFECT. But worst-case scenario, use ADD_SPELL_EFFECT, where that should work.

When WeiDU gets stupid with negative numbers, first thing to try is always wrapping them in quotes. parameter1 = (-1) won't work, nor will parameter1 = -1, but it'll take parameter1 = "-1" just fine. kreso's call to "-2" is correct, the issue is in the function itself.

 

As for CLONE, yes, it's a limitation of the function as written. I needed a default value to check against it if something was changed/set by the function call, and I went with -1 as defaults for most values. There's some things we could do around the edges--e.g. change the lower bound to -10 instead of -1--or it could be fixed outright with a third series of variables like 'change_parameter1' = 0/1). I'm reticent to mess too much with a function that's now in fairly wide use for fear of breaking backwards compatibility. That doesn't mean you can't grab the source from GitHub and override it locally and/or make a new function from it.

Link to comment

ALTER_EFFECT and CLONE_EFFECT are built the same way.

 

But I'm pretty sure the older functions - ADD_SPELL_EFFECT and ADD_ITEM_EFFECT etc. (the ones with three words in the names) - are different, and *can* take a negative value for parameter1. I definitely have it working in my mods.

Link to comment

More CLONE help needed.

What I need is the following; I'm not sure if it can be done but anyway:

I need to clone "immunity to effect" with a specific value to another effect.

The 2nd part is easy, but how can I specify which exact effect I need matched for CLONE to work?

 

More specific - I need to clone immunity to effect: petrification to immunity to a specific spell.

Link to comment

...

More specific - I need to clone immunity to effect: petrification to immunity to a specific spell.

Is there a reason to not just use two unique spells to facilitate this ? Aka, is the user a player character or just a .cre that can use a specific script to cast the spells they like ?

 

@subtledoctor, yeah,... but the effect needs to be in the spell only if the original creature cloned possesses the immunity.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...