nwn2fixes / player

Fixes for the casual NwN2 player
27 stars 11 forks source link

Dark vision/Rapid shot keeps turning themselves off #14

Closed Question2 closed 5 years ago

Question2 commented 5 years ago

Everytime i load a savegame, or open a new module, darkvision and rapid shot turns themselves off and I need to turn them on again...i think this happens for power attack and bard inspirations as well...

kevL commented 5 years ago

that would need to be fixed (if possible) in module load scripts, but i'm staying away from altering module load scripts since different modules use different scripts and putting them in /Override can lead to bad things[tm]

Question2 commented 5 years ago

But the same module would use the same load script right? For the OC, MOTB and SOZ campaigns?

kevL commented 5 years ago

many modules will use the same filename for the load script... but they change the body of the script. And if a script with that filename is in /Override all those modules go borky. I have no wish to create such problems.

Question2 commented 5 years ago

So all the default campaigns use the same filename but different scripts? Do you have any idea what the filename is?

kevL commented 5 years ago

So all the default campaigns use the same filename but different scripts?

maybe, maybe not ... you'd have to look at the properties of each module in each campaign ... then hunt down the version of the script that's slotted in each of their OnModuleLoad events and compare them to the other versions (of that filename) that are slotted in the other modules' OnModuleLoad events.

Do you have any idea what the filename is?

open the toolset, turn View|Options|Autosave FALSE

open the module you want to find the OnModuleLoad script for (each load script is NOT a property of a campaign – it's a property of each module, and they can be different for each module in a Campaign)

then on the menubar, do View|Module Properties

and look at its scriptset to find the name of the script you want to investigate. Fair warning: I doubt (read: you're not) going to find anything related to ActionMode button-states there because tracking those button-states is relegated to the engine rather than to scripts. Unfortunately, tracking those states (when they're turned on, when turned off, when they should reset, etc.) is involved/complicated and tends to not work anyway in my experience (because I've tried doing similar things to ActionMode buttons with varying degrees of success).

PS. it might not even be the OnModuleLoad handler that should be modified. OnPCLoaded or OnClientEnter are very probably better places to track button-state with.

Eg, Kaedrin tried to fix the NightVision toggle with code similar to this in a custom script that's called from the the OnPCLoaded script:

    if (GetActionMode(oSelf, ACTION_MODE_NIGHTVISION))
    {
        SetActionMode(oSelf, ACTION_MODE_NIGHTVISION, FALSE);
        SetActionMode(oSelf, ACTION_MODE_NIGHTVISION, TRUE);
    }

but after some tinkering and testing (and trying it with other modes like RapidShot) it doesn't appear to work, at least not on my setup.

Personally I'm convinced, because of other things I've done also, that SetActionMode() doesn't work reliably, if at all, with several of the ACTIONMODE* constants.

yet with others it works fine, similar to the way some ActionMode buttons remember their state while others don't

Question2 commented 5 years ago

I did notice that the game will remember the flurry of blows toggle but not rapid shot, which seems quite strange...