Jump to content

Deactivating Sustained Abilities for a Custom Follower


Recommended Posts

Hey there, does anyone have a script for deactivating sustained abilities on a custom follower?

 

For example when they go back to camp etc.

 

The only reference to this I see in a guide is not working as it says there is a bug caused with Patch 1.04 and the link given to fix the issue which is not specified is to Biowares Offline server.

Edited by Montenstein
Link to comment
Share on other sites

Yeah, I looked at that too.

 

I added it into different type of events etc and I cant get that to function at all.

 

for example;

 

Ability_DeactivateModalAbility(oFollower,ABILITY_SPELL_FLAMING_WEAPONS);

 

This is what I'm wondering about the guide saying there was a bug caused by patch 1.04, Is this the bug? that it stops that from working?

 

If we still had access to online servers I'm sure this would be alot more straight forward as I would know if there's an issue here or not.

 

EDIT:

 

Okay, so I just need to link this to camp as I was testing it wrong apparently, I think I may have come up with the solution...

 

EDIT 2:

 

Works via party selector, doesn't work in camp.

Edited by Montenstein
Link to comment
Share on other sites

I'm not sure what access to online servers has to do with anything? If you're interested in the content from the old BSN, it was archived at fextralife before it was taken down.

 

IIRC, vanilla behavior is that modal abilities are deactivated when followers are removed from the party, and they are all removed from the party when you return to camp. So I'm not sure why your custom follower would have any sustains running in camp.

 

But if things are broken and your follower's sustains are not being deactivated when you return to camp, you might need to code your event handler to catch EVENT_TYPE_BEGIN_TRAVEL and deactivate them if the destination is camp.

Link to comment
Share on other sites

"The 1.04 DA:O patch is bugged and removed/broke several features of the toolkit" This is what I'm referring to by servers. It provides a link to fix however does not specify the features broken, only that it is relevant to the deactivation script, and the link is dead. I've had a search on Fextra prior to posting here but didn't find anything of relevance, though admittedly I did not search for long on there.

 

It is mentioned at this specific segment of scripting. However, due to them being offline, the "features" that were broken are not listed. So I could spend hours on a script where the function is actually broken and I wouldn't know.

 

I've been through different events etc, I currently have it listed in the function of the main module script under "check"plot_changed" which works beautifully for checking plots and executing anything else.

 

Though for some reason, the only place I cannot get it to work is in the party camp. Despite it specifically searching for "SAIRELLE_IN_CAMP" before executing the script. This works when dropped from the party as the follower is back in camp via the plot. So I fail to see why this isn't working when all my camp scripts also specifically set that plot flag to be true aswell.

 

I even added the script that I've written that I have working when dropping from the party etc and added it to the spawn in camp script I have which is triggered via PRCSCR, nothing happens in terms of deactivating abilities yet the rest of the script functions correctly.

 

I believe this must mean that the abilities need deactivating before spawning into camp. I will try with the EVENT_TYPE_BEGIN_TRAVEL and maybe a preload area event...

Edited by Montenstein
Link to comment
Share on other sites

Okay, So I like to post my solutions so it may help someone else down the line...

 

First of all, I created a new flag inside my party plot, "plt_gen00pt_party_sc" added new flag "SAIRELLE_DEACTIVATE"

 

Inside my functions of my module script I added;

if(WR_GetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE))
    {
             object[] partyMembers = GetPartyList();
              int      memberCount = GetArraySize(partyMembers);
              int      i;
        for (i =0; i<memberCount; i++)
        {
             if (IsModalAbilityActive(partyMembers[i],ABILITY_SPELL_FLAMING_WEAPONS))
             {
                Ability_DeactivateModalAbility(partyMembers[i],ABILITY_SPELL_FLAMING_WEAPONS);
             }
        }
        }

I need to go and add all other sustainable abilities, "Flaming Weapons" was used to test before I add every single ability. If you want to keep a sustained ability active then do not add it to the list.

 

Then I modified my EVENT_TYPE_BEGIN_TRAVEL lines;

case EVENT_TYPE_BEGIN_TRAVEL:
        {
            string sSource = GetEventString(ev, 0);
            string sTarget = GetEventString(ev, 1);
            string sWPOverride = GetEventString(ev, 2);
           
            if(sTarget=="cam100ar_camp_plains")
                  WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, TRUE);
                 
            if(sTarget=="cam104ar_camp_arch1")
                  WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, TRUE);
                 
            if(sTarget=="cam110ar_camp_arch3")
                  WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, TRUE);
                                   
            if(sTarget=="cli03al_redcliffe_castle")
                  WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, TRUE);
                 
            if(sTarget=="den07al_eamon")
                  WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, TRUE);
                 
            if(sTarget=="epi300ar_post_coronation")
                  WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, TRUE);
           
            if(sWPOverride=="1" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_GEN00PT_PARTY_SC,SAIRELLE_HAS_NIGHTMARE_A))
                DoAreaTransition("sairelle_fade_nightmare","start");
            if(sWPOverride=="2" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_GEN00PT_PARTY_SC,SAIRELLE_HAS_NIGHTMARE_B))
                DoAreaTransition("sairelle_fade_nightmare","start");
            if(sWPOverride=="3" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_GEN00PT_PARTY_SC,SAIRELLE_HAS_NIGHTMARE_C))
                DoAreaTransition("sairelle_fade_nightmare","start");
            break;
        }

Some/Half of this code is relevant to the follower when in the Fade during the Broken Circle plot and not relevant to sustained abilities.

 

Then, I modified the EVENT_TYPE_PARTYMEMBER_ADDED/DROPPED;

case EVENT_TYPE_PARTYMEMBER_ADDED:
         {
            object oFollower = GetEventObject(ev, 0);
            if (GetTag(oFollower) == "sc_sairelle")
            {
               SetLocalInt(oFollower, CREATURE_REWARD_FLAGS, 0);
               WR_SetFollowerState(oFollower, FOLLOWER_STATE_ACTIVE, FALSE);
               AddCommand(oFollower, CommandJumpToLocation(GetLocation(GetHero())));
               WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_IN_PARTY, TRUE, FALSE);
               WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_IN_CAMP, FALSE, FALSE);
               WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, FALSE); //<----------------ADDED THIS LINE
            }
            break;
         }
         case EVENT_TYPE_PARTYMEMBER_DROPPED:
         {
            object oFollower = GetEventObject(ev, 0);
            if (GetTag(oFollower) == "sc_sairelle")
            {
               WR_SetFollowerState(oFollower, FOLLOWER_STATE_AVAILABLE, FALSE);
               WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_IN_CAMP, TRUE, FALSE);
               WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_IN_PARTY, FALSE, FALSE);
               WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, TRUE); //<----------------ADDED THIS LINE
            }
            WR_SetObjectActive(oFollower, FALSE);
break;

         }
            

There could very well be another place I need to add "WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC, SAIRELLE_DEACTIVATE, FALSE);" But here is the main gist of how I solved the issue. Just a little note about this method is that it has a mini bug where next time the follower is active, their mana may not restore fully, however as soon another ability is activated again this corrects itself. So if you have the follower setup with tactics, such as "self - any = spell-wisp" as soon as that is fired it corrects itself so its entirely possibly that if I didn't mention it, you probably wouldn't have ever noticed it.

 

Note that I also added WR_SetPlotFlag commands to my fade related scripts aswell as my fort drakon ones, which I have not posted here as it may not be useful to someone else. If it is useful, find the part of the script that sets plot flags for entering the fade or getting captured and add the lines there.

Edited by Montenstein
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...