Jump to content


Photo

Bgt tweaks "Disable hostile reaction after charm" component no

charm bgt

  • Please log in to reply
17 replies to this topic

#1 enkku

enkku
  • Member
  • 23 posts

Posted 23 March 2015 - 04:55 AM

For some reason my in my recent installs I haven't gotten this to work, which is a shame because charmed persons have surprisingly lot to say. Attached weidu-log, and for example a change log for SPPR204.SPL (charm person or mammal), which made Dreppin blow his top once it wore off. Same thing with other charm spells, even if I commented them out from Spell Revisions tp2 file. Also NI show that there are no flags set, so this is probably not a spell problem.

 

EDIT:

 

Looks like later versions of Stratagems' "Smarter general AI" component cause this. Whether this is intended behavior or not, I don't know. Either way, it's a pity.  

Attached Files


Edited by enkku, 25 March 2015 - 01:41 AM.


#2 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 27 March 2015 - 10:30 PM

It would indeed be a shame.


Anyone who can confirm this? I am unable to test it myself at the moment...



#3 Misant

Misant
  • Member
  • 8 posts

Posted 30 March 2015 - 02:22 AM

It would indeed be a shame.


Anyone who can confirm this? I am unable to test it myself at the moment...

 

Hello Salk,

 

I confirm the issue (WeiDU.log in attachment at the end) :

 

 

IeMA5Ow.jpg

 

RL77ac4.jpg

Attached Files


Edited by Misant, 30 March 2015 - 02:26 AM.


#4 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 31 March 2015 - 09:26 PM

Too bad Ascension64's mods are no longer updated.

 

I am myself a user of such component...

 

Has any of you two tried to see if the problem exists also for the arcane version of the spell (SPWI104.SPL)?


Edited by Salk, 31 March 2015 - 10:42 PM.


#5 enkku

enkku
  • Member
  • 23 posts

Posted 31 March 2015 - 11:26 PM

Arcane version makes npcs hostile as well. However innate charm person (SPIN119) works like a ,eh, charm. It might be that Atweaks "pnp fey creatures" component patches it somehow.



#6 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 01 April 2015 - 11:58 PM

I reported this to SCS's Forum.


Unfortunately DavidW has not been around for a couple of months and MadMate doesn't seem as active at bugfixing as he used to be... :)

 

The level of activity is generally low there but I hope there will be an increased interest after the Easter holidays.



#7 K4thos

K4thos
  • Modder
  • 315 posts

Posted 02 April 2015 - 02:23 AM

Too bad Ascension64's mods are no longer updated.

this is not a problem with BGT Tweaks (unless it doesn't work with vanilla game either)

 

I see that the ~SETUP-BGTTWEAK.TP2~ #0 #2300 // Disable hostile reaction after charm: 11 (5 Feb 12) BWP Fix

component on your weidu.log is early in load order (before SCS). Something like this should be installed .after any mod that add/modify spl, itm, eff files.

Try to install this code (you don't need to uninstall anything) and see if it fixes this problem:

/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////                                                  \\\\\
///// Disable hostile reaction after charm             \\\\\
/////                                                  \\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\
/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\

BEGIN ~Disable hostile reaction after charm~
//DESIGNATED 20
REQUIRE_PREDICATE GAME_IS ~soa tob tutu tutu_totsc bgt ca iwd_in_bg2 bgee bg2ee iwdee eet~ ~This component is not compatible with your game.~

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~
    ~^.+\.spl$~ ~override~
    PATCH_IF (("%SOURCE_RES%" STRING_EQUAL_CASE "spwi939")=0) AND ("%SOURCE_SIZE%" > 0x71) BEGIN
        READ_LONG 0x64 abil_off
        READ_SHORT 0x68 abil_num
        READ_LONG 0x6a fx_off
        PATCH_IF ("%SOURCE_FILE%" STRING_COMPARE_REGEXP "^.+\.spl$" = 0) BEGIN
            SET "abil_length" = 0x28
        END ELSE BEGIN
            SET "abil_length" = 0x38
        END
        FOR (index = 0 ; index < abil_num ; index = index + 1) BEGIN
            READ_SHORT ("%abil_off%" + 0x1e + ("%abil_length%" * "%index%")) "abil_fx_num"
            READ_SHORT ("%abil_off%" + 0x20 + ("%abil_length%" * "%index%")) "abil_fx_idx"
            FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
                READ_SHORT ("%fx_off%" + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "opcode"
                PATCH_IF ("%opcode%" = 5) BEGIN // Charm Specific Creature
                    READ_BYTE ("%fx_off%" + 0x8 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) "charm_type"
                    PATCH_IF ("%charm_type%" = 3) BEGIN
                        WRITE_BYTE ("%fx_off%" + 0x8 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) 2
                    END ELSE PATCH_IF ("%charm_type%" = 1) BEGIN
                        WRITE_BYTE ("%fx_off%" + 0x8 + (0x30 * ("%abil_fx_idx%" + "%index2%"))) 0
                    END
                END
            END
        END
    END
BUT_ONLY

COPY_EXISTING_REGEXP GLOB ~^.+\.eff$~ ~override~
    PATCH_IF ("%SOURCE_SIZE%" > 0x109) BEGIN
        READ_SHORT 0x10 "opcode"
        PATCH_IF "%opcode%" = 5 BEGIN // Charm Specific Creature
            READ_BYTE 0x20 "charm_type"
            PATCH_IF ("%charm_type%" = 3) BEGIN
                WRITE_BYTE 0x20 2
            END ELSE PATCH_IF ("%charm_type%" = 1) BEGIN
                WRITE_BYTE 0x20 0
            END
        END
    END
BUT_ONLY

if yes than your current load order is wrong (although you don't need to change it for this play through, as the above code already fixed it). If the problem will be still there than some other mod (probably SCS) added AI script commands that makes them hostile.


Edited by K4thos, 02 April 2015 - 03:46 AM.


#8 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 02 April 2015 - 03:25 AM

Thanks for the help, K4thos.

 

It's not really me experiencing and reporting the issue though. Let's hope the OP tries this out and reports back.

 

My personal installation order also puts BGT Tweaks before SCS though so it's good for me to know that this might cause incompatibility.



#9 enkku

enkku
  • Member
  • 23 posts

Posted 02 April 2015 - 06:47 AM

Yes, that was my reasoning also, so I moved the BGTtweak component way back after P5Tweaks. I tried it with scs 28 and scs 30. Unfortunately it didn't change anything so I moved it back in front as per Big World pdf.



#10 Misant

Misant
  • Member
  • 8 posts

Posted 02 April 2015 - 09:10 AM

Hello,

 

I'm ok for trying the code from K4thos but I don't know how I can do this.

If someone can explain me I will try it.

 

EDIT : I think I found a way to use it. I put the code in the tp2 file from here http://www.shsforums...95m-in-bwp-143/ (Thanks enkku for CtBXPFix.zip  :) )

 

It patched 7299 files and 1774 files.

 

And... It works for charm person ! Thanks K4thos/Salk ! 

 

HeU0ePR.jpg

 

00qFV4r.jpg


Edited by Misant, 02 April 2015 - 10:09 AM.


#11 K4thos

K4thos
  • Modder
  • 315 posts

Posted 02 April 2015 - 11:17 AM

great, I will let ALIEN know to change the suggested load order for this tweak in BWS.

 

btw. whenever you see something like:

COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ //could be SPL/EFF/CRE/ARE/WED and other file types that are modifiable as well
    //some code
BUT_ONLY

than it means that the code is analyzing every single file with such extension and is meant to be installed after any mod that add or modify files with that extension.

 

It patched 7299 files and 1774 files.

well, not really (unless some mod added charm opcode effect to every spell, item and effect in game :P). It analized all these files but patched just those with opcode = 5 (check the backup folder to see how many).


Edited by K4thos, 02 April 2015 - 11:31 AM.


#12 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 02 April 2015 - 11:24 AM

is meant to be installed after any mod that add or overwrites files with that extension.
Fixed that for you as you can have 200 mods that extend the same item, and everyone of those changes will be in effect if the file is not overwritten...

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#13 K4thos

K4thos
  • Modder
  • 315 posts

Posted 02 April 2015 - 11:42 AM

is meant to be installed after any mod that add or modify or overwrites files with that extension.

fixed again ;) Adding for example new spell effect to existing items and spells is very easy with weidu. And it can be done via simple patching, not overwriting files. Some component earlier in load order could also set these charm effects the other way around, without overwriting files. And when you doing patching globally, like this tweak, than you usually don't care what other modders thought is a good implementation - you want all of spells to behave as tweak description suggest (in this case make creatures not hostile after charm ends).


Edited by K4thos, 02 April 2015 - 12:18 PM.


#14 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 02 April 2015 - 01:37 PM

 fixed again

NO !
This is because you are modifying the item... which would indicate that you have to do them in a set order, but you don't in fact need to. You can patch the same item 1 000 000 000 times and if each change is cumulative, then they all actually work no matter which order they are installed in.
You HAVE TO first install the components that add, then those that modify with overwriting, then then those that patch with(yes, technically you overwrite with the patched item but that's get besides the point)out it.

Yes, the dot is the size of an elephant, but I rather like it that sized...
EDIT: yes, it's a language thing... and you also have to realize it, when using words like can be and/or meant to be, the later has the general connotation that you have to...and the "any mod" then get promoted to "every mod"... which switches your words into "you have to install this mod last without any other mod affecting the file after it." Unlike perhaps was your intention was.


Edited by The Imp, 02 April 2015 - 02:34 PM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#15 K4thos

K4thos
  • Modder
  • 315 posts

Posted 02 April 2015 - 02:00 PM

correct, but I still don't see why you see "or modify" as incorrect in that sentence. Global patching over all files is meant to cover all files, no matter what anyone done to them before. I didn't stated that patches are not cumulative. Just that there are cases when installing a mod that analyze all resources in order to make a desirable change early (before all overwriting, adding and patching is done by other mods) can lead to situation like in this topic. And it doesn't have to be due to overwriting. Same problem could arise for weidu patching as mentioned in the previous post. Maybe it’s a language barrier and I simply don’t understand your post.

 

edit: ah, you probably think that "add or modify or overwrite" is my suggested load order for changes made to the game. Nah, this is not what I meant there :) Obviously overwriting should be done before any mod does weidu patching.


Edited by K4thos, 02 April 2015 - 02:20 PM.


#16 enkku

enkku
  • Member
  • 23 posts

Posted 03 April 2015 - 03:13 AM

Thanks for all insights regarding the issue, although later posts went way beyond my expertise. But now, I've done so many megamod installs just to test this I'm afraid my ssd is going to melt, so I'll just use my dryads to charm half of the Sword Coast, because that seems to work. If anyone needs anymore information about my install/setup just let me know. I am using the same install which previously posted weidu.log refers to.

Happy easter to all, and Hyvää Pääsiäistä for Imp.


Edited by enkku, 03 April 2015 - 03:28 AM.


#17 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 05 April 2015 - 09:51 AM

I am not so sure I understood what the conclusion is here.

 

Is it enough to install BGT Tweaks after SCS to prevent the issue or not? (enkku seems to report there was no improvement while Misan said it works)


Edited by Salk, 05 April 2015 - 09:53 AM.


#18 K4thos

K4thos
  • Modder
  • 315 posts

Posted 05 April 2015 - 10:13 AM

Is it enough to install BGT Tweaks after SCS to prevent the issue or not? (enkku seems to report there was no improvement while Misan said it works)

we don't even know if SCS was responsible for changing the spell behavior in the first place, so we can't say that. The conclusion (or at least my recommendation) is to install this tweak at the end (at least after any mod that have anything to do with itm, spl, eff files).


Edited by K4thos, 05 April 2015 - 10:15 AM.