kreso Posted March 31, 2016 Share Posted March 31, 2016 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. Link to comment
Jarno Mikkola Posted March 31, 2016 Share Posted March 31, 2016 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... Link to comment
kreso Posted March 31, 2016 Author Share Posted March 31, 2016 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
kreso Posted March 31, 2016 Author Share Posted March 31, 2016 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... I looked it up, bleh. Link to comment
subtledoctor Posted March 31, 2016 Share Posted March 31, 2016 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. Link to comment
CamDawg Posted March 31, 2016 Share Posted March 31, 2016 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
kreso Posted March 31, 2016 Author Share Posted March 31, 2016 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. As for CLONE, yes, it's a limitation of the function as written. Tnx both of you. I think I'll be able to work something out. Link to comment
Gwendolyne Posted April 1, 2016 Share Posted April 1, 2016 Have a look here : http://gibberlings3.net/forums/index.php?showtopic=27709&do=findComment&comment=240332 You may save time. Link to comment
kreso Posted April 1, 2016 Author Share Posted April 1, 2016 Have a look here : http://gibberlings3.net/forums/index.php?showtopic=27709&do=findComment&comment=240332 You may save time. Tnx, I'll check it out. I've just tried ALTER instead of CLONE, no go. Link to comment
subtledoctor Posted April 1, 2016 Share Posted April 1, 2016 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
Avenger Posted April 2, 2016 Share Posted April 2, 2016 What about using their unsigned form? Link to comment
kreso Posted November 29, 2016 Author Share Posted November 29, 2016 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
subtledoctor Posted November 29, 2016 Share Posted November 29, 2016 Is the immunity to petrification opcode 101? This should be possible. LPF CLONE_EFFECT INT_VAR multi_match = 1 match_opcode = 101 opcode = 206 STR_VAR match_resource = ~[petrification]~ resource = ~[specific spell]~ END Link to comment
Jarno Mikkola Posted November 29, 2016 Share Posted November 29, 2016 ... 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
kreso Posted November 29, 2016 Author Share Posted November 29, 2016 Thanks, I'll check it out. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.