Jump to content

Scripting a Follower in the Fade


Recommended Posts

I'm really struggling to get a custom follower to work with the Fade. I initially managed to get it semi working and now it's not. I swear the guide on datoolset.net has a fault somewhere or I'm extremely blind.

 

Any help would be greatly appreciated.

Edited by Montenstein
Link to comment
Share on other sites

Hey!

 

Apologies for my initial post, that was the result of 7+ hours testing and failure and lack of sleep :laugh:

 

Okay, so, I am making a custom follower as an add-on to the main campaign.

 

I have reached the point where I need to make the companion compatible with the Fade. I tried to follow and use "Compatible Companion" (http://www.datoolset.net/wiki/Compatible_Companion_Mod_Creation) as a base. There was also some guess work involved as certain specifics I did not understand. After editing and finishing off the scripts, I reached a point where after speaking to the Sloth Demon for the first time and entering the fade, the follower was removed from the party as intended, the rest did not work, I couldn't get the "Nightmare" to load nor would they return after defeating the Demon in the Fade. At some point this stopped working entirely and then they would no longer leave the party, I must have changed something whilst frustrated and tired because I spent another hour attempting to get myself back to that point and couldn't.

 

Another thing is other guides on that tutorial I have not been able to get working in the past and I have had to more or less create my own, my knowledge is very minimal however so trying to tackle something like the Fade is absolutely killing me :laugh: :laugh:

 

I'm unsure as to if that guide is still working with current patches etc.

 

I'm hoping there was something incredibly simply that I missed in my frustration last night :laugh:

 

 

I have also completed scripts relevant to the plot and area but I don't think its worth going through them until I can get the initial part working first, I feel like the issue is related to the check_plot_changed portion and getting the function script to fire.

Edited by Montenstein
Link to comment
Share on other sites

I do just want to add, I have just noticed a bunch of errors.. :laugh:

 

EDIT:

 

I added the functions to the module script and made some other edits however I appear to be at the same position I was, I have just deleted everything and I'm going to try and start again.

 

ANOTHER EDIT:

 

Okay, so I have rebuilt the event handler (module_core) script. Entering and Exiting the Fade now works perfectly.

 

The issue I'm having now is loading into the Nightmare itself, I cant seem to manage to get the area transition to work.

 

case EVENT_TYPE_BEGIN_TRAVEL:
{
string sSource = GetEventString(ev, 0);
string sTarget = GetEventString(ev, 1);
string sWPOverride = GetEventString(ev, 2);
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;
}
Edited by Montenstein
Link to comment
Share on other sites

Ah... sounds like you're taking on something quite complex, and you've worked through quite a few issues. That's kind of how it usually goes, at least that's been my experience.

I don't have a lot of time to help you troubleshoot atm, as it is a major holiday and I need to get cooking here shortly. I will offer you a tip - a tool, so to speak that I have found extremely useful in sorting out problems, and that is to use the built-in logging tools to figure out what's going on.

The game writes a log in Documents > BioWare > Dragon Age > Logs, and you can configure scripts to write to it. The way to do that is to create a text file in the bin_ship folder on your game install directory called ECLog.ini. This is what the file should contain:

[LogTypes]
Script=1

Once you create that file, you'll see loads of entries in the log from existing vanilla scripts the next time you start the game; they start with the word Script. You can also log things from your scripts to help you troubleshoot. I'll insert some examples of logging into your code to show you how to log information that might help you troubleshoot (you'll probably want to remove or comment out the print statements before you release the code).

case EVENT_TYPE_BEGIN_TRAVEL:
    {
    PrintToLog("My event handler, scriptname: " + GetCurrentScriptName() + " received begin travel event.");
    string sSource = GetEventString(ev, 0);
    string sTarget = GetEventString(ev, 1);
    string sWPOverride = GetEventString(ev, 2);
    PrintToLog("Event source is: " + sSource + ", event target is: " + sTarget + ", WPOverride is: " + sWPOverride);

    if(sWPOverride=="1" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_GEN00PT_PARTY_SC,SAIRELLE_HAS_NIGHTMARE_A))  {
        PrintToLog("Attempting transition for nightmare A");
        DoAreaTransition("sairelle_fade_nightmare","start");
        }

    if(sWPOverride=="2" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_GEN00PT_PARTY_SC,SAIRELLE_HAS_NIGHTMARE_B))  {
        PrintToLog("Attempting transition for nightmare B");
        DoAreaTransition("sairelle_fade_nightmare","start");
        }

    if(sWPOverride=="3" && sTarget=="Fade_Follower" && WR_GetPlotFlag(PLT_GEN00PT_PARTY_SC,SAIRELLE_HAS_NIGHTMARE_C))  {
        PrintToLog("Attempting transition for nightmare C");
        DoAreaTransition("sairelle_fade_nightmare","start");
        }

    PrintToLog("No transition attempted; conditions not met.");
    break;
    } 

Printing those statements will probably tell you what's wrong. You'll also see the plot flag checks.

BTW, the game will start a new log file if you delete, move, or rename the existing one.

 

I'll be back in a dozen hours or so to see how you're doing - good luck.

Link to comment
Share on other sites

I will have a go at using this method to troubleshoot at some point.

 

After spending probably a day and a half on it I decided to leave it where it is at the minute;

 

-Sairelle leaves party when entering Fade

 

-Sairelle rejoins party after defeat of the Demon

 

In this current state, it's perfectly playable. I'm thinking I may come up with a clever storyline and spawn her in the Demon's Inner Sanctum and initiate a conversation upon entering explaining why she is there, skipping her nightmare but in an immersive way :laugh: :laugh:

 

She is a mage so it makes sense to me.

 

I think this will probably be the way to go until I return to the issue, today I opted for completing the scenes/dialogue/scripts centered around the climax portion of the game, which I'm happy to say went smoothly and perfectly :laugh:

 

Thank you for your help, I shall give it another go and update at some point.

Link to comment
Share on other sites

As I mentioned earlier, I decided to cheat my way past this for now, here's the script I wrote that I've triggered with my PCRSCR.gda;

 

#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_sairelle_fade_nightmare"
#include "plt_gen00pt_party_sc"
void main()
{
location SairelleLoc;
object oPC=GetHero();
object curArea=GetArea(oPC);
object oSairelle=GetObjectByTag("sc_sairelle");
SairelleLoc=Location(curArea, Vector(50.16, 46.31, 47.5), 180.00);
SetObjectActive(oSairelle,1);
WR_SetPlotFlag(PLT_SAIRELLE_FADE_NIGHTMARE,SAIRELLE_TALKED_TO_IN_FADE,TRUE);
WR_SetPlotFlag(PLT_SAIRELLE_FADE_NIGHTMARE,SAIRELLE_RETURNS_TO_PARTY,TRUE);
WR_SetPlotFlag(PLT_GEN00PT_PARTY_SC,SAIRELLE_TALKED_TO_IN_FADE_IS,TRUE);
AddCommand(oSairelle, CommandJumpToLocation(SairelleLoc));
}
This works great for spawning her in, right in front of you as you enter the Sloth Demons Sanctum. The only thing I wish I could work out is how to force a conversation with her. For some reason, "UT_Talk(oSairelle,oPC);" Doesn't place nice with the spawning script... It seems to despawn her :pinch: :pinch: :pinch:
I have a very similar script set up for the Gate conversation in the Climax which runs smoothly so I'm guessing I need to go and delete something in the other Fade Related scripts which is currently not being used. Hopefully I can finally leave the Fade behind for a very long time after that...
EDIT:
I've fixed all this now, got a stage and animations set up too :happy:
Edited by Montenstein
Link to comment
Share on other sites

Okay, so you probably won't believe this...

 

The initial script works perfectly.

 

Turns out its just incompatible with "Skip the Fade"...

 

I feel so stupid, if you think about it logically for a second of course it wouldn't work with that mod...

 

I actually feel like crying, I spent over 24 hours on that particular segment. I hate the fade so much it took me that long to test it legitimately.

 

:laugh: :laugh: :laugh: :laugh:

Edited by Montenstein
Link to comment
Share on other sites

  • Recently Browsing   0 members

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